Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
Refactor di plugin (#43)
Dushusire42118a06a1b
diff --git a/.vscode/settings.json b/.vscode/settings.jsonindex 769dd9f8bf..3a3791351b 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -19,6 +19,7 @@"CRDT","customd","Datas",+ "DATEFMTLISG","endindex","esbuild","evented",diff --git a/examples/univer-sheet-ts/src/main.tsx b/examples/univer-sheet-ts/src/main.tsxindex e089fb48bc..fc461659e9 100644--- a/examples/univer-sheet-ts/src/main.tsx+++ b/examples/univer-sheet-ts/src/main.tsx@@ -1,52 +1,57 @@-import { Univer, LocaleType } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { SheetPlugin } from '@univerjs/base-sheets';-import { SheetUIPlugin } from '@univerjs/ui-plugin-sheets';-import { DEFAULT_WORKBOOK_DATA_DEMO } from '@univerjs/common-plugin-data';--// TODO: @huwenzhao: change the following to new API--// univer-const univer = new Univer({- locale: LocaleType.EN,-});--// create univer sheet instance-const universheet = univer.createUniverSheet(DEFAULT_WORKBOOK_DATA_DEMO);--// base-render-univer.registerPlugin(RenderEngine);-// register plugins-univer.registerPlugin(SheetPlugin);-// ui-plugin-sheets-univer.registerPlugin(SheetUIPlugin, {- container: 'universheet',- layout: {- sheetContainerConfig: {- infoBar: true,- formulaBar: true,- toolbar: true,- sheetBar: true,- countBar: true,- rightMenu: true,- },- },-});--// base-sheet--// FormulaPlugin.create(DEFAULT_FORMULA_DATA_DEMO).installTo(universheet);-// FindPlugin.create().installTo(universheet);-// universheet.installPlugin(new OperationPlugin());-// universheet.installPlugin(new ImportXlsxPlugin());-// universheet.installPlugin(new OverGridImagePlugin());-// universheet.installPlugin(new NumfmtPlugin());--// use for console test-declare global {- interface Window {- univer?: any;- }-}--window.univer = univer;+import { Univer, LocaleType } from '@univerjs/core';+import { RenderEngine } from '@univerjs/base-render';+import { SheetPlugin } from '@univerjs/base-sheets';+import { SheetUIPlugin } from '@univerjs/ui-plugin-sheets';+import { DEFAULT_WORKBOOK_DATA_DEMO } from '@univerjs/common-plugin-data';+import { DEFAULT_FORMULA_DATA_DEMO, FormulaPlugin } from '@univerjs/sheets-plugin-formula';+import { NumfmtPlugin } from '@univerjs/sheets-plugin-numfmt';+import { FindPlugin } from '@univerjs/sheets-plugin-find';++// TODO: @huwenzhao: change the following to new API++// univer+const univer = new Univer({+ locale: LocaleType.EN,+});++// create univer sheet instance+const universheet = univer.createUniverSheet(DEFAULT_WORKBOOK_DATA_DEMO);++// base-render+univer.registerPlugin(RenderEngine);+// register plugins+univer.registerPlugin(SheetPlugin);+// ui-plugin-sheets+univer.registerPlugin(SheetUIPlugin, {+ container: 'universheet',+ layout: {+ sheetContainerConfig: {+ infoBar: true,+ formulaBar: true,+ toolbar: true,+ sheetBar: true,+ countBar: true,+ rightMenu: true,+ },+ },+});+univer.registerPlugin(NumfmtPlugin);++univer.registerPlugin(FindPlugin);++// base-sheet+univer.registerPlugin(FormulaPlugin,DEFAULT_FORMULA_DATA_DEMO)+// FindPlugin.create().installTo(universheet);+// universheet.installPlugin(new OperationPlugin());+// universheet.installPlugin(new ImportXlsxPlugin());+// universheet.installPlugin(new OverGridImagePlugin());+// universheet.installPlugin(new NumfmtPlugin());++// use for console test+declare global {+ interface Window {+ univer?: any;+ }+}++window.univer = univer;diff --git a/packages/base-formula-engine/package.json b/packages/base-formula-engine/package.jsonindex 7f8d79a49d..b3f5e665d6 100644--- a/packages/base-formula-engine/package.json+++ b/packages/base-formula-engine/package.json@@ -55,6 +55,7 @@},"dependencies": {"@univerjs/core": "workspace:^0.0.1",+ "@wendellhu/redi": "^0.10.0","preact": "^10.12.1"}}\ No newline at end of filediff --git a/packages/base-formula-engine/src/FormulaEnginePlugin.ts b/packages/base-formula-engine/src/FormulaEnginePlugin.tsindex 1290e68dae..f38d54a4a1 100644--- a/packages/base-formula-engine/src/FormulaEnginePlugin.ts+++ b/packages/base-formula-engine/src/FormulaEnginePlugin.ts@@ -1,94 +1,15 @@-import { SheetContext, IUnitRange, Plugin } from '@univerjs/core';+import { Injector, Inject } from '@wendellhu/redi';+import { SheetContext, Plugin } from '@univerjs/core';-import { LexerTreeMaker } from './Analysis/Lexer';--import { AstTreeMaker } from './Analysis/Parser';-import { Interpreter } from './Interpreter/Interpreter';-import { FormulaDataType, IInterpreterDatasetConfig } from './Basics/Common';-import { FormulaDependencyGenerator } from './Dependency/FormulaDependency';import { FormulaEnginePluginObserver } from './Analysis/LexerNode';-import { FunctionVariantType } from './ReferenceObject/BaseReferenceObject';interface IFormulaEnginePlugin {}-interface IConfig {}--interface FormulaEngineConfig {}-export class FormulaEnginePlugin extends Plugin<FormulaEnginePluginObserver> {- constructor(config?: IFormulaEnginePlugin) {+ constructor(config: IFormulaEnginePlugin, @Inject(Injector) private readonly _sheetInjector: Injector) {super('formulaEngine');}- static create(config?: IFormulaEnginePlugin) {- return new FormulaEnginePlugin(config);- }-- /**- *- * @param unitId- * @param formulaData- * @param interpreterDatasetConfig- * @param forceCalculate force calculate all formula, and ignore dependency relationship- * @param updateRangeList input external unit data for multi workbook- * @returns- */- async execute(unitId: string, formulaData: FormulaDataType, interpreterDatasetConfig?: IInterpreterDatasetConfig, forceCalculate = false, updateRangeList: IUnitRange[] = []) {- const dependencyGenerator = FormulaDependencyGenerator.create(formulaData, forceCalculate);-- const treeList = await dependencyGenerator.generate(updateRangeList, interpreterDatasetConfig);-- const interpreter = Interpreter.create(interpreterDatasetConfig);-- for (let i = 0, len = treeList.length; i < len; i++) {- const tree = treeList[i];- const astNode = tree.node;- let value: FunctionVariantType;-- interpreter.setCurrentPosition(tree.row, tree.column, tree.sheetId, tree.unitId);-- if (interpreter.checkAsyncNode(astNode)) {- value = await interpreter.executeAsync(astNode);- } else {- value = interpreter.execute(astNode);- }- interpreter.setRuntimeData(tree.row, tree.column, tree.sheetId, tree.unitId, value);- }-- return {- sheetData: interpreter.getSheetData(unitId),- arrayFormulaData: interpreter.getSheetArrayFormula(unitId),- };- }-- calculate(formulaString: string) {- this.getObserver('onBeforeFormulaCalculateObservable')?.notifyObservers(formulaString);- const lexerTreeMaker = new LexerTreeMaker(formulaString);- const lexerNode = lexerTreeMaker.treeMaker();- lexerTreeMaker.suffixExpressionHandler(lexerNode); // suffix Express, 1+(3*4=4)*5+1 convert to 134*4=5*1++- // console.log('lexerNode', lexerNode.serialize());-- this.getObserver('onAfterFormulaLexerObservable')?.notifyObservers(lexerNode);-- const astTreeMaker = AstTreeMaker.create();-- const astNode = astTreeMaker.parse(lexerNode);-- // console.log('astNode', astNode.serialize());-- const interpreter = Interpreter.create();-- if (interpreter.checkAsyncNode(astNode)) {- const resultPromise = interpreter.executeAsync(astNode);-- resultPromise.then((value) => {- console.log('formulaResult', value);- });- } else {- console.log(interpreter.execute(astNode));- }- }-initialize(): void {}override onMounted(ctx: SheetContext): void {diff --git a/packages/base-formula-engine/src/Service/FormulaEngine.service.ts b/packages/base-formula-engine/src/Service/FormulaEngine.service.tsnew file mode 100644index 0000000000..4e664d4693--- /dev/null+++ b/packages/base-formula-engine/src/Service/FormulaEngine.service.ts@@ -0,0 +1,77 @@+import { IUnitRange } from "@univerjs/core";+import { LexerTreeMaker } from "../Analysis/Lexer";+import { AstTreeMaker } from "../Analysis/Parser";+import { FormulaDependencyGenerator } from "../Dependency/FormulaDependency";+import { Interpreter } from "../Interpreter/Interpreter";+import { FunctionVariantType } from "../ReferenceObject/BaseReferenceObject";+import { FormulaDataType, IInterpreterDatasetConfig } from "../Types";++export class FormulaEngineService {++ /**+ *+ * @param unitId+ * @param formulaData+ * @param interpreterDatasetConfig+ * @param forceCalculate force calculate all formula, and ignore dependency relationship+ * @param updateRangeList input external unit data for multi workbook+ * @returns+ */+ async execute(unitId: string, formulaData: FormulaDataType, interpreterDatasetConfig?: IInterpreterDatasetConfig, forceCalculate = false, updateRangeList: IUnitRange[] = []) {+ const dependencyGenerator = FormulaDependencyGenerator.create(formulaData, forceCalculate);++ const treeList = await dependencyGenerator.generate(updateRangeList, interpreterDatasetConfig);++ const interpreter = Interpreter.create(interpreterDatasetConfig);++ for (let i = 0, len = treeList.length; i < len; i++) {+ const tree = treeList[i];+ const astNode = tree.node;+ let value: FunctionVariantType;++ interpreter.setCurrentPosition(tree.row, tree.column, tree.sheetId, tree.unitId);++ if (interpreter.checkAsyncNode(astNode)) {+ value = await interpreter.executeAsync(astNode);+ } else {+ value = interpreter.execute(astNode);+ }+ interpreter.setRuntimeData(tree.row, tree.column, tree.sheetId, tree.unitId, value);+ }++ return {+ sheetData: interpreter.getSheetData(unitId),+ arrayFormulaData: interpreter.getSheetArrayFormula(unitId),+ };+ }++ calculate(formulaString: string) {+ // TODO how to observe @alex+ // this.getObserver('onBeforeFormulaCalculateObservable')?.notifyObservers(formulaString);+ const lexerTreeMaker = new LexerTreeMaker(formulaString);+ const lexerNode = lexerTreeMaker.treeMaker();+ lexerTreeMaker.suffixExpressionHandler(lexerNode); // suffix Express, 1+(3*4=4)*5+1 convert to 134*4=5*1+++ // console.log('lexerNode', lexerNode.serialize());++ // this.getObserver('onAfterFormulaLexerObservable')?.notifyObservers(lexerNode);++ const astTreeMaker = AstTreeMaker.create();++ const astNode = astTreeMaker.parse(lexerNode);++ // console.log('astNode', astNode.serialize());++ const interpreter = Interpreter.create();++ if (interpreter.checkAsyncNode(astNode)) {+ const resultPromise = interpreter.executeAsync(astNode);++ resultPromise.then((value) => {+ console.log('formulaResult', value);+ });+ } else {+ console.log(interpreter.execute(astNode));+ }+ }++}\ No newline at end of filediff --git a/packages/base-formula-engine/src/index.ts b/packages/base-formula-engine/src/index.tsindex d1129b4b67..5b04bf8907 100644--- a/packages/base-formula-engine/src/index.ts+++ b/packages/base-formula-engine/src/index.ts@@ -1,3 +1,4 @@export { FormulaEnginePlugin } from './FormulaEnginePlugin';export type { FormulaDataType, IInterpreterDatasetConfig, SheetDataType, UnitDataType, SheetNameMapType, IFormulaData, ArrayFormulaDataType } from './Basics/Common';+export { FormulaEngineService } from './Service/FormulaEngine.service'diff --git a/packages/core/src/Plugin/Plugin.ts b/packages/core/src/Plugin/Plugin.tsindex fe347dce8c..dc69f9e437 100644--- a/packages/core/src/Plugin/Plugin.ts+++ b/packages/core/src/Plugin/Plugin.ts@@ -1,183 +1,183 @@-import { Ctor } from '@wendellhu/redi';-import { ContextBase } from '../Basics/ContextBase';--import { Context } from '../Basics/Context';-import { Observable } from '../Observer';-import { Locale, Nullable, PropsFrom } from '../Shared';-import { Univer } from '../Basics';--export type PluginCtor<T extends Plugin> = Ctor<T> & { type: PluginType };--/** Plugin types for different kinds of business. */-export enum PluginType {- Univer,- Doc,- Sheet,- Slide,-}--/**- * Basics function of plugin- */-export interface BasePlugin {- context: ContextBase;- getContext(): ContextBase;- getGlobalContext(): Context;- getLocale(): Locale;- getPluginName(): string;-- /**- * Could register dependencies at this lifecycle stage.- */- onCreate(context: ContextBase): void;-- /**- * Could setup initialization works at this lifecycle stage.- */- onMounted(context: ContextBase): void;-- /**- * Could do some initialization works at this lifecycle stage.- */- onDestroy(): void;-- deleteObserve(...names: string[]): void;- getPluginByName<T extends BasePlugin>(name: string): Nullable<T>;- /**- * save data- */- save(): object;- /**- * load data- */- load<T>(data: T): void;-}--/**- * Plug-in base class, all plug-ins must inherit from this base class. Provide basic methods.- */-export abstract class Plugin<Obs = any, O extends ContextBase = ContextBase> implements BasePlugin {- static type: PluginType;-- context: O;-- private _name: string;-- private _observeNames: Array<keyof Obs & string>;-- protected constructor(name: string) {- this._name = name;- this._observeNames = [];- }-- onCreate(context: O): void {- this.context = context;- }-- load<T>(data: T): void {}-- save(): object {- return Object();- }-- /**- * @deprecated- */- onMounted(context: O): void {}-- /**- * @deprecated- */- onDestroy(): void {- this.deleteObserve(...this._observeNames);- }-- getPluginName(): string {- return this._name;- }-- /** @deprecated */- getContext(): O {- return this.context;- }-- getGlobalContext(): Context {- return this.context.getUniver().getGlobalContext();- }-- getLocale(): Locale {- return this.getGlobalContext().getLocale();- }-- getUniver(): Univer {- return this.context.getUniver();- }-- getObserver<K extends keyof Obs & string>(name: K): Nullable<Observable<PropsFrom<Obs[K]>>> {- const manager = this.context.getObserverManager();- return manager.getObserver(name, this._name);- }-- getPluginByName<T extends BasePlugin>(name: string): Nullable<T> {- return this.context.getPluginManager().getPluginByName<T>(name);- }-- pushToObserve<K extends keyof Obs & string>(...names: K[]): void {- const manager = this.context.getObserverManager();- names.forEach((name) => {- if (!this._observeNames.includes(name)) {- this._observeNames.push(name);- }- manager.addObserver(name, this._name, new Observable());- });- }-- deleteObserve<K extends keyof Obs & string>(...names: K[]): void {- const manager = this.context.getObserverManager();- names.forEach((name) => {- manager.removeObserver(name, this._name);- });- }-}--interface IPluginRegistryItem {- plugin: typeof Plugin;- options: any;-}--/**- * Store plugin instances.- */-export class PluginStore {- private readonly plugins: Plugin[] = [];-- addPlugin(plugin: Plugin): void {- this.plugins.push(plugin);- }-- removePlugins(): Plugin[] {- const plugins = this.plugins.slice();- this.plugins.length = 0;- return plugins;- }-}--/**- * Store plugin registry items.- */-export class PluginRegistry {- private readonly pluginsRegisteredByBusiness = new Map<PluginType, [IPluginRegistryItem]>();-- registerPlugin(pluginCtor: PluginCtor<any>, options: any) {- const type = pluginCtor.type;- if (!this.pluginsRegisteredByBusiness.has(type)) {- this.pluginsRegisteredByBusiness.set(type, [] as unknown[] as [IPluginRegistryItem]);- }-- this.pluginsRegisteredByBusiness.get(type)!.push({ plugin: pluginCtor, options });- }-- getRegisterPlugins(type: PluginType): [IPluginRegistryItem] {- return this.pluginsRegisteredByBusiness.get(type) || ([] as unknown[] as [IPluginRegistryItem]);- }-}+import { Ctor } from '@wendellhu/redi';+import { ContextBase } from '../Basics/ContextBase';++import { Context } from '../Basics/Context';+import { Observable } from '../Observer';+import { Locale, Nullable, PropsFrom } from '../Shared';+import { Univer } from '../Basics';++export type PluginCtor<T extends Plugin> = Ctor<T> & { type: PluginType };++/** Plugin types for different kinds of business. */+export enum PluginType {+ Univer,+ Doc,+ Sheet,+ Slide,+}++/**+ * Basics function of plugin+ */+export interface BasePlugin {+ context: ContextBase;+ getContext(): ContextBase;+ getGlobalContext(): Context;+ getLocale(): Locale;+ getPluginName(): string;++ /**+ * Could register dependencies at this lifecycle stage.+ */+ onCreate(context: ContextBase): void;++ /**+ * Could setup initialization works at this lifecycle stage.+ */+ onMounted(context: ContextBase): void;++ /**+ * Could do some initialization works at this lifecycle stage.+ */+ onDestroy(): void;++ deleteObserve(...names: string[]): void;+ getPluginByName<T extends BasePlugin>(name: string): Nullable<T>;+ /**+ * save data+ */+ save(): object;+ /**+ * load data+ */+ load<T>(data: T): void;+}++/**+ * Plug-in base class, all plug-ins must inherit from this base class. Provide basic methods.+ */+export abstract class Plugin<Obs = any, O extends ContextBase = ContextBase> implements BasePlugin {+ static type: PluginType;++ context: O;++ private _name: string;++ private _observeNames: Array<keyof Obs & string>;++ protected constructor(name: string) {+ this._name = name;+ this._observeNames = [];+ }++ onCreate(context: O): void {+ this.context = context;+ }++ load<T>(data: T): void { }++ save(): object {+ return Object();+ }++ /**+ * @deprecated+ */+ onMounted(context: O): void { }++ /**+ * @deprecated+ */+ onDestroy(): void {+ this.deleteObserve(...this._observeNames);+ }++ getPluginName(): string {+ return this._name;+ }++ /** @deprecated */+ getContext(): O {+ return this.context;+ }++ getGlobalContext(): Context {+ return this.context.getUniver().getGlobalContext();+ }++ getLocale(): Locale {+ return this.getGlobalContext().getLocale();+ }++ getUniver(): Univer {+ return this.context.getUniver();+ }++ getObserver<K extends keyof Obs & string>(name: K): Nullable<Observable<PropsFrom<Obs[K]>>> {+ const manager = this.context.getObserverManager();+ return manager.getObserver(name, this._name);+ }++ getPluginByName<T extends BasePlugin>(name: string): Nullable<T> {+ return this.context.getPluginManager().getPluginByName<T>(name);+ }++ pushToObserve<K extends keyof Obs & string>(...names: K[]): void {+ const manager = this.context.getObserverManager();+ names.forEach((name) => {+ if (!this._observeNames.includes(name)) {+ this._observeNames.push(name);+ }+ manager.addObserver(name, this._name, new Observable());+ });+ }++ deleteObserve<K extends keyof Obs & string>(...names: K[]): void {+ const manager = this.context.getObserverManager();+ names.forEach((name) => {+ manager.removeObserver(name, this._name);+ });+ }+}++interface IPluginRegistryItem {+ plugin: typeof Plugin;+ options: any;+}++/**+ * Store plugin instances.+ */+export class PluginStore {+ private readonly plugins: Plugin[] = [];++ addPlugin(plugin: Plugin): void {+ this.plugins.push(plugin);+ }++ removePlugins(): Plugin[] {+ const plugins = this.plugins.slice();+ this.plugins.length = 0;+ return plugins;+ }+}++/**+ * Store plugin registry items.+ */+export class PluginRegistry {+ private readonly pluginsRegisteredByBusiness = new Map<PluginType, [IPluginRegistryItem]>();++ registerPlugin(pluginCtor: PluginCtor<any>, options: any) {+ const type = pluginCtor.type;+ if (!this.pluginsRegisteredByBusiness.has(type)) {+ this.pluginsRegisteredByBusiness.set(type, [] as unknown[] as [IPluginRegistryItem]);+ }++ this.pluginsRegisteredByBusiness.get(type)!.push({ plugin: pluginCtor, options });+ }++ getRegisterPlugins(type: PluginType): [IPluginRegistryItem] {+ return this.pluginsRegisteredByBusiness.get(type) || ([] as unknown[] as [IPluginRegistryItem]);+ }+}diff --git a/packages/sheets-plugin-alternating-colors/README-zh.md b/packages/sheets-plugin-alternating-colors/README-zh.mddeleted file mode 100644index e8f42d063f..0000000000--- a/packages/sheets-plugin-alternating-colors/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet AlternatingColors 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-alternating-colors-```--### 使用--```js-import { AlternatingColors } from '@univerjs/sheets-plugin-alternating-colors';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new AlternatingColors());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-alternating-colors/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-alternating-colors dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-alternating-colors/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-alternating-colors build-```diff --git a/packages/sheets-plugin-alternating-colors/README.md b/packages/sheets-plugin-alternating-colors/README.mddeleted file mode 100644index e9a1332201..0000000000--- a/packages/sheets-plugin-alternating-colors/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin AlternatingColors--### Installation--```shell-npm i @univerjs/sheets-plugin-alternating-colors-```--### Usage--```js-import { AlternatingColors } from '@univerjs/sheets-plugin-alternating-colors';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new AlternatingColors());-```--## 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/sheets-plugin-alternating-colors/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-alternating-colors dev-```--### Package--```-# Current directory ./packages/sheets-plugin-alternating-colors/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-alternating-colors build-```diff --git a/packages/sheets-plugin-alternating-colors/index.html b/packages/sheets-plugin-alternating-colors/index.htmldeleted file mode 100644index 5d5495993a..0000000000--- a/packages/sheets-plugin-alternating-colors/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up" style="height: 100vh;"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-alternating-colors/jest.config.js b/packages/sheets-plugin-alternating-colors/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-alternating-colors/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/packages/sheets-plugin-alternating-colors/package.json b/packages/sheets-plugin-alternating-colors/package.jsondeleted file mode 100644index e59ba85f23..0000000000--- a/packages/sheets-plugin-alternating-colors/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-alternating-colors",- "version": "0.0.1",- "description": "UniverSheet normal plugin-alternating-colors",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-alternating-colors.cjs.js",- "module": "./lib/univer-sheets-plugin-alternating-colors.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-alternating-colors.cjs.js",- "default": "./lib/univer-sheets-plugin-alternating-colors.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/AlternatingColorsPlugin.tsx b/packages/sheets-plugin-alternating-colors/src/AlternatingColorsPlugin.tsxdeleted file mode 100644index d904e22210..0000000000--- a/packages/sheets-plugin-alternating-colors/src/AlternatingColorsPlugin.tsx+++ /dev/null@@ -1,126 +0,0 @@-import { ISlotElement, ISlotProps } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Nullable, Plugin, PLUGIN_NAMES, Command } from '@univerjs/core';-import { IToolbarItemProps, SheetPlugin } from '@univerjs/base-sheets';-import { Banding } from './Banding';-import { IAddBandingActionData } from './Command';-import { ACTION_NAMES } from './Command/ACTION_NAMES';-import { ALTERNATING_COLORS_PLUGIN_NAME } from './Const/PLUGIN_NAME';-import { DEFAULT_PROPERTIES_BANDED_RANGE, IBandedRange } from './IBandedRange';-import { IConfig } from './IData/IAlternatingColors';-import { en, zh } from './Locale';-import { AlternatingColorsButton } from './UI/AlternatingColorsButton';-import { AlternatingColorsSide } from './UI/AlternatingColorsSide/AlternatingColorsSide';-import { AlternatingColorsPluginObserve } from './Basics/Observer';--export interface IAlternatingColorsPluginConfig {- value: IBandedRange[];-}--export class AlternatingColorsPlugin extends Plugin<AlternatingColorsPluginObserve, SheetContext> {- sheetPlugin: Nullable<SheetPlugin>;-- protected _config: IAlternatingColorsPluginConfig;-- constructor(config?: IAlternatingColorsPluginConfig) {- super(ALTERNATING_COLORS_PLUGIN_NAME);- this._config = config || { value: [] };- }-- static create(config?: IAlternatingColorsPluginConfig) {- return new AlternatingColorsPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {- // context,- };-- const item: IToolbarItemProps = {- locale: ALTERNATING_COLORS_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <AlternatingColorsButton config={config} />,- };-- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend toolbar- this.sheetPlugin?.addButton(item);-- const panelItem: ISlotProps = {- name: ALTERNATING_COLORS_PLUGIN_NAME,- type: ISlotElement.JSX,- label: <AlternatingColorsSide config={{ bandedRange: DEFAULT_PROPERTIES_BANDED_RANGE, alternatingColorsPlugin: this }} />,- };-- // extend sider- this.sheetPlugin?.addSider(panelItem);-- // extend main area- // const mainItem: IMainProps = {- // name: ALTERNATING_COLORS_PLUGIN_NAME,- // type: ISlotElement.JSX,- // content: <div>middle alternating</div>,- // };-- // this.sheetPlugin?.addMain(mainItem);- this.sheetPlugin?.showMainByName(ALTERNATING_COLORS_PLUGIN_NAME, true);- }-- /**- * {@inheritDoc Plugin.onMapping}- */-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-- getBandings(): Banding[] {- return this._config.value.map((element) => new Banding(this, element));- }-- getBandingById(bandedRangeId: string): Nullable<Banding> {- const bandingData = this._config.value.find((element) => element.bandedRangeId === bandedRangeId);-- return bandingData && new Banding(this, bandingData);- }-- getBandingData(): IBandedRange[] {- return this._config.value;- }-- /**- * add banding by setting- */- addRowBanding(bandedRange: IBandedRange) {- const context = this.getContext();- const _commandManager = context.getCommandManager();- const _worksheet = context.getWorkBook().getActiveSheet()!;-- // Organize action data- const actionData: IAddBandingActionData = {- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- bandedRange,- sheetId: _worksheet.getSheetId(),- };-- // Execute action- const command = new Command(context.getWorkBook(), actionData);- _commandManager.invoke(command);- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/Apply/AddBanding.ts b/packages/sheets-plugin-alternating-colors/src/Apply/AddBanding.tsdeleted file mode 100644index 0cda02476e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Apply/AddBanding.ts+++ /dev/null@@ -1,7 +0,0 @@-import { AlternatingColorsPlugin } from '../AlternatingColorsPlugin';-import { IBandedRange } from '../IBandedRange';--export function AddBanding(plugin: AlternatingColorsPlugin, bandedRange: IBandedRange): void {- let data = plugin.getBandingData();- data.push(bandedRange);-}diff --git a/packages/sheets-plugin-alternating-colors/src/Apply/DeleteBanding.ts b/packages/sheets-plugin-alternating-colors/src/Apply/DeleteBanding.tsdeleted file mode 100644index eb81760e3e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Apply/DeleteBanding.ts+++ /dev/null@@ -1,15 +0,0 @@-import { AlternatingColorsPlugin } from '../AlternatingColorsPlugin';-import { IBandedRange } from '../IBandedRange';--export function DeleteBanding(plugin: AlternatingColorsPlugin, bandedRangeId: string): IBandedRange {- let data = plugin.getBandingData();- const deleteBanding = data.find((bandedRange: IBandedRange, i) => {- if (bandedRange.bandedRangeId === bandedRangeId) {- // remove- data.splice(i, 1);- return bandedRange;- }- return null;- })!;- return deleteBanding;-}diff --git a/packages/sheets-plugin-alternating-colors/src/Apply/SetBanding.ts b/packages/sheets-plugin-alternating-colors/src/Apply/SetBanding.tsdeleted file mode 100644index 07e602f0c6..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Apply/SetBanding.ts+++ /dev/null@@ -1,18 +0,0 @@-import { Tools } from '@univerjs/core';-import { AlternatingColorsPlugin } from '../AlternatingColorsPlugin';-import { DEFAULT_PROPERTIES_BANDED_RANGE, IBandedRange } from '../IBandedRange';--export function SetBanding(plugin: AlternatingColorsPlugin, bandedRange: IBandedRange): IBandedRange {- let data = plugin.getBandingData();- let result: IBandedRange = DEFAULT_PROPERTIES_BANDED_RANGE;- for (let i = 0; i < data.length; i++) {- const banding = data[i];- if (banding.bandedRangeId === bandedRange.bandedRangeId) {- result = Tools.deepClone(banding);- // edit- data[i] = bandedRange;- }- }-- return result;-}diff --git a/packages/sheets-plugin-alternating-colors/src/Apply/index.ts b/packages/sheets-plugin-alternating-colors/src/Apply/index.tsdeleted file mode 100644index d05e02ad07..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Apply/index.ts+++ /dev/null@@ -1,5 +0,0 @@-// @index('./*.ts', f => `export * from '${f.path}'`)-export * from './AddBanding';-export * from './DeleteBanding';-export * from './SetBanding';-// @endindexdiff --git a/packages/sheets-plugin-alternating-colors/src/BANDING_THEME_COLOR.ts b/packages/sheets-plugin-alternating-colors/src/BANDING_THEME_COLOR.tsdeleted file mode 100644index a470fc2f4a..0000000000--- a/packages/sheets-plugin-alternating-colors/src/BANDING_THEME_COLOR.ts+++ /dev/null@@ -1,179 +0,0 @@-/**- * Banding theme color presets map- */-export const BANDING_THEME_COLOR_MAP = {- light_gray: {- headerColor: '#bfbdbe',- firstBandColor: '#ffffff',- secondBandColor: '#f8f3f7',- footerColor: '#dde2de',- },- light_cyan: {- headerColor: '#4bd4e7',- firstBandColor: '#ffffff',- secondBandColor: '#eaf7ff',- footerColor: '#aae9f8',- },- green: {- headerColor: '#5ed593',- firstBandColor: '#ffffff',- secondBandColor: '#e5fbee',- footerColor: '#a5efcc',- },- yellow: {- headerColor: '#f6cb4b',- firstBandColor: '#ffffff',- secondBandColor: '#fff9e7',- footerColor: '#ffebac',- },- light_orange: {- headerColor: '#f96420',- firstBandColor: '#ffffff',- secondBandColor: '#ffe5d9',- footerColor: '#ffcfba',- },- light_blue: {- headerColor: '#5599fc',- firstBandColor: '#ffffff',- secondBandColor: '#ecf2fe',- footerColor: '#afcbfa',- },- teal: {- headerColor: '#22a69b',- firstBandColor: '#ffffff',- secondBandColor: '#dff2f8',- footerColor: '#8dd4d0',- },- grey: {- headerColor: '#7a939a',- firstBandColor: '#ffffff',- secondBandColor: '#f0eff7',- footerColor: '#bdcad0',- },- light_brown: {- headerColor: '#d7a270',- firstBandColor: '#ffffff',- secondBandColor: '#fdf3f1',- footerColor: '#ead2b6',- },- light_green: {- headerColor: '#89c54b',- firstBandColor: '#ffffff',- secondBandColor: '#f1f7e9',- footerColor: '#c5e3a7',- },- indigo: {- headerColor: '#8f88f0',- firstBandColor: '#ffffff',- secondBandColor: '#f0e5ff',- footerColor: '#c6c4f6',- },- pink: {- headerColor: '#fd1664',- firstBandColor: '#ffffff',- secondBandColor: '#feddee',- footerColor: '#f98ab5',- },- purple: {- headerColor: '#da96d3',- firstBandColor: '#ffffff',- secondBandColor: '#fce8fb',- footerColor: '#f2caee',- },- darken_red: {- headerColor: '#b49191',- firstBandColor: '#ffffff',- secondBandColor: '#f5ebe8',- footerColor: '#d8c3c3',- },- darken_green: {- headerColor: '#91b493',- firstBandColor: '#ffffff',- secondBandColor: '#f0fbf0',- footerColor: '#b4cfb6',- },- darken_orange: {- headerColor: '#b4a891',- firstBandColor: '#ffffff',- secondBandColor: '#f8f6f1',- footerColor: '#d3cab8',- },- darken_blue: {- headerColor: '#91abb4',- firstBandColor: '#ffffff',- secondBandColor: '#eff7fa',- footerColor: '#b7cbd3',- },- darken_yellow: {- headerColor: '#b7ba82',- firstBandColor: '#ffffff',- secondBandColor: '#fafbeb',- footerColor: '#dadcb4',- },- red: {- headerColor: '#df3e3e',- firstBandColor: '#ffffff',- secondBandColor: '#fde9e9',- footerColor: '#f89292',- },- orange: {- headerColor: '#f2711c',- firstBandColor: '#ffffff',- secondBandColor: '#fef0d7',- footerColor: '#fbb335',- },- green_yellow: {- headerColor: '#b5cc18',- firstBandColor: '#ffffff',- secondBandColor: '#f9fbd4',- footerColor: '#e2ed2a',- },- cyan: {- headerColor: '#00b5ad',- firstBandColor: '#ffffff',- secondBandColor: '#ccfaf9',- footerColor: '#00e4df',- },- blue: {- headerColor: '#2185d0',- firstBandColor: '#ffffff',- secondBandColor: '#d8f3fc',- footerColor: '#3cc4f0',- },- brown: {- headerColor: '#a5673f',- firstBandColor: '#ffffff',- secondBandColor: '#f6ede5',- footerColor: '#d3a47c',- },-};--/**- * Banding theme color presets list- */-export const BANDING_THEME_COLOR_LIST = [- 'light_gray',- 'light_cyan',- 'green',- 'yellow',- 'light_orange',- 'light_blue',- 'teal',- 'grey',- 'light_brown',- 'light_green',- 'indigo',- 'pink',- 'purple',- 'darken_red',- 'darken_green',- 'darken_orange',- 'darken_blue',- 'darken_yellow',- 'red',- 'orange',- 'green_yellow',- 'cyan',- 'blue',- 'brown',-];diff --git a/packages/sheets-plugin-alternating-colors/src/Banding.ts b/packages/sheets-plugin-alternating-colors/src/Banding.tsdeleted file mode 100644index 607a626e7d..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Banding.ts+++ /dev/null@@ -1,273 +0,0 @@-import { Command, CommandManager, SheetContext, Plugin, Worksheet } from '@univerjs/core';--import { IAddBandingActionData, IDeleteBandingActionData, ISetBandingActionData } from './Command';-import { ACTION_NAMES } from './Command/ACTION_NAMES';-import { IBandedRange } from './IBandedRange';--/**- * Access and modify bandings- *- * @remarks- * The color patterns applied to rows or columns of a range. Each banding consists of a range and a set of colors for rows, columns, headers, and footers.- *- * Reference: {@link https://developers.google.com/apps-script/reference/spreadsheet/banding | Google Sheets Banding}- */-export class Banding {- protected readonly _bandedRange: IBandedRange;-- protected readonly _plugin: Plugin;-- private _worksheet: Worksheet;-- private _commandManager: CommandManager;-- private _context: SheetContext;-- // private _range: Range;-- constructor(plugin: Plugin, bandedRange: IBandedRange) {- this._plugin = plugin;- this._bandedRange = bandedRange;- this._context = this.getPlugin().getContext();- this._commandManager = this._context.getCommandManager();- this._worksheet = this._context.getWorkBook().getActiveSheet()!;- }-- getPlugin(): Plugin {- return this._plugin;- }-- // private _getRowBandingProperties(): IBandingProperties {- // const { rowProperties } = this._bandedRange;- // return typeof rowProperties.bandingTheme === 'string'- // ? BANDING_THEME_COLOR_MAP[rowProperties.bandingTheme]- // : rowProperties.bandingTheme;- // }-- // private _setRowProperties(property: string, color: string): Banding {- // const { _context, _commandManager, _bandedRange } = this;- // const { bandedRangeId, rangeData } = this._bandedRange;-- // const rowProperties: IBanding = {- // bandingTheme: Object.assign({}, this._getRowBandingProperties(), {- // [property]: color,- // }),- // showHeader: _bandedRange.rowProperties.showHeader,- // showFooter: _bandedRange.rowProperties.showFooter,- // };-- // // Organize action data- // const actionData: ISetBandingActionData = {- // actionName: ACTION_NAMES.SET_BANDING_ACTION,- // bandedRange: {- // bandedRangeId,- // rangeData,- // rowProperties,- // },- // sheetId: this._worksheet.getSheetId(),- // };-- // // Execute action- // const command = new Command(_context.getWorkBook(), actionData);- // _commandManager.invoke(command);-- // return this;- // }-- /**- * get bandedRange- */- // getBandedRange(): IBandedRange {- // return this._bandedRange;- // }- // /**- // * set bandedRange- // */- // setBandedRange(bandedRange: IBandedRange): Banding {- // this._bandedRange = bandedRange;- // return this;- // }-- /**- * add banding by setting- */- addRowBanding(): Banding {- const { _context, _commandManager, _bandedRange } = this;-- // Organize action data- const actionData: IAddBandingActionData = {- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- bandedRange: _bandedRange,- sheetId: this._worksheet.getSheetId(),- };-- // Execute action- const command = new Command(_context.getWorkBook(), actionData);- _commandManager.invoke(command);- return this;- }-- /**- * edit banding by setting- */- setRowBanding(bandedRange: IBandedRange): Banding {- const { _context, _commandManager } = this;-- // Organize action data- const actionData: ISetBandingActionData = {- actionName: ACTION_NAMES.SET_BANDING_ACTION,- bandedRange,- sheetId: this._worksheet.getSheetId(),- };-- // Execute action- const command = new Command(_context.getWorkBook(), actionData);- _commandManager.invoke(command);-- return this;- }-- /**- * Copies this banding to another range.- * @param range The range to copy this banding to.- * @returns Banding — The new banding.- */- // copyTo(range: Range): Nullable<Banding> {- // const { bandingTheme, showHeader, showFooter } =- // this._bandedRange.rowProperties;-- // return range.applyRowBanding(bandingTheme, showHeader, showFooter);- // }-- /**- * Removes this banding.- */- remove(): void {- const { _context, _commandManager, _bandedRange } = this;- // Organize action data- const actionData: IDeleteBandingActionData = {- sheetId: this._worksheet.getSheetId(),- actionName: ACTION_NAMES.DELETE_BANDING_ACTION,- bandedRangeId: _bandedRange.bandedRangeId,- };-- // Execute action- const command = new Command(_context.getWorkBook(), actionData);- _commandManager.invoke(command);- }-- /**- * get range instance- * @returns- */- // getRange(): Range {- // return this._range;- // }-- /**- * Sets the range for this banding.- * @param range The new range for this banding.- * @returns Banding — This banding, for chaining.- */- // setRange(range: Range): Banding {- // const { _context, _commandManager } = this;- // const { bandedRangeId, rowProperties } = this._bandedRange;-- // // Organize action data- // const actionData: ISetBandingActionData = {- // actionName: ACTION_NAMES.SET_BANDING_ACTION,- // bandedRange: {- // bandedRangeId,- // rangeData: range.getRangeData(),- // rowProperties,- // },- // sheetId: this._worksheet.getSheetId(),- // };-- // // Execute action- // const command = new Command(_context.getWorkBook(), actionData);- // _commandManager.invoke(command);-- // return this;- // }-- /**- * Returns the first row color that is alternating or null if no color is set.- *- * @returns String — The color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set.- */- // getFirstRowColor(): string {- // return this._getRowBandingProperties().firstBandColor;- // }-- /**- * Returns the second row color that is alternating or null if no color is set.- *- * @returns String — The color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set.- */- // getSecondRowColor(): string {- // return this._getRowBandingProperties().secondBandColor;- // }-- /**- * Returns the color of the header row or null if no color is set.- *- * @returns String — The color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set.- */- // getHeaderRowColor(): string {- // return this._getRowBandingProperties().headerColor;- // }-- /**- * Returns the color of the last row, or null if no color is set.- *- * @returns String — The color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set.- */- // getFooterRowColor(): string {- // return this._getRowBandingProperties().footerColor;- // }-- /**- * Sets the first row color that is alternating.- *- * @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.- *- * @returns Banding — This banding, for chaining.- */- // setFirstRowColor(color: string): Banding {- // return this._setRowProperties('firstBandColor', color);- // }-- /**- * Sets the second row color that is alternating.- *- * @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.- *- * @returns Banding — This banding, for chaining.- */- // setSecondRowColor(color: string): Banding {- // return this._setRowProperties('secondBandColor', color);- // }-- /**- * Sets the color of the header row.- *- * @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.- *- * @returns Banding — This banding, for chaining.- */- // setHeaderRowColor(color: string): Banding {- // return this._setRowProperties('headerColor', color);- // }-- /**- * Sets the color of the last row.- *- * @param color The color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.- *- * @returns Banding — This banding, for chaining.- */- // setFooterRowColor(color: string): Banding {- // return this._setRowProperties('footerColor', color);- // }-}diff --git a/packages/sheets-plugin-alternating-colors/src/BandingTheme.ts b/packages/sheets-plugin-alternating-colors/src/BandingTheme.tsdeleted file mode 100644index 518ac233db..0000000000--- a/packages/sheets-plugin-alternating-colors/src/BandingTheme.ts+++ /dev/null@@ -1,36 +0,0 @@-/**- * An enumeration of banding themes.- *- *- * @remarks- * Each theme consists of several complementary colors that are applied to different cells based on the banding settings.- *- * Reference: https://developers.google.com/apps-script/reference/spreadsheet/banding-theme- *- */-export enum BandingTheme {- LIGHT_GRAY = 'light_gray',- LIGHT_CYAN = 'light_cyan',- GREEN = 'green',- YELLOW = 'yellow',- LIGHT_ORANGE = 'light_orange',- LIGHT_BLUE = 'light_blue',- TEAL = 'teal',- GREY = 'grey',- LIGHT_BROWN = 'light_brown',- LIGHT_GREEN = 'light_green',- INDIGO = 'indigo',- PINK = 'pink',- PURPLE = 'purple',- DARKEN_RED = 'darken_red',- DARKEN_GREEN = 'darken_green',- DARKEN_ORANGE = 'darken_orange',- DARKEN_BLUE = 'darken_blue',- DARKEN_YELLOW = 'darken_yellow',- RED = 'red',- ORANGE = 'orange',- GREEN_YELLOW = 'green_yellow',- CYAN = 'cyan',- BLUE = 'blue',- BROWN = 'brown',-}diff --git a/packages/sheets-plugin-alternating-colors/src/Basics/Observer.ts b/packages/sheets-plugin-alternating-colors/src/Basics/Observer.tsdeleted file mode 100644index 2070c72052..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Basics/Observer.ts+++ /dev/null@@ -1,13 +0,0 @@-import { Plugin, Observable } from '@univerjs/core';--export type AlternatingColorsPluginObserve = {- onAfterChangeFontFamilyObservable: Observable<string>;-};--export function uninstall(plugin: Plugin) {- plugin.deleteObserve('onDidMountAlternatingColorsObservable');-}--export function install(plugin: Plugin) {- plugin.pushToObserve('onDidMountAlternatingColorsObservable');-}diff --git a/packages/sheets-plugin-alternating-colors/src/Command/ACTION_NAMES.ts b/packages/sheets-plugin-alternating-colors/src/Command/ACTION_NAMES.tsdeleted file mode 100644index 3c3aebf936..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/ACTION_NAMES.ts+++ /dev/null@@ -1,5 +0,0 @@-export enum ACTION_NAMES {- ADD_BANDING_ACTION = 'AddBandingAction',- SET_BANDING_ACTION = 'SetBandingAction',- DELETE_BANDING_ACTION = 'DeleteBandingAction',-}diff --git a/packages/sheets-plugin-alternating-colors/src/Command/Action/AddBandingAction.ts b/packages/sheets-plugin-alternating-colors/src/Command/Action/AddBandingAction.tsdeleted file mode 100644index 0b5e91890e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/Action/AddBandingAction.ts+++ /dev/null@@ -1,65 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, Workbook } from '@univerjs/core';-import { AlternatingColorsPlugin } from '../../AlternatingColorsPlugin';-import { AddBanding } from '../../Apply/AddBanding';-import { DeleteBanding } from '../../Apply/DeleteBanding';-import { ALTERNATING_COLORS_PLUGIN_NAME } from '../../Const';-import { IBandedRange } from '../../IBandedRange';-import { ACTION_NAMES } from '../ACTION_NAMES';-import { IDeleteBandingActionData } from './DeleteBandingAction';--export interface IAddBandingActionData extends ISheetActionData {- bandedRange: IBandedRange;-}--export class AddBandingAction extends SheetActionBase<IAddBandingActionData, IDeleteBandingActionData, void> {- constructor(actionData: IAddBandingActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);-- this._doActionData = {- ...actionData,- };- this.do();- this._oldActionData = {- actionName: ACTION_NAMES.DELETE_BANDING_ACTION,- sheetId: actionData.sheetId,- bandedRangeId: actionData.bandedRange.bandedRangeId,- };- this.validate();- }-- do(): void {- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;-- const { bandedRange } = this._doActionData;- this._observers.onActionDoObserver.notifyObservers(this);- AddBanding(plugin, bandedRange);- }-- redo(): void {- this.do();- // no need store- }-- undo(): void {- const { bandedRangeId, sheetId } = this._oldActionData;- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;- this._observers.onActionUndoObserver.notifyObservers(this);-- // update current data- this._doActionData = {- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- sheetId,- bandedRange: DeleteBanding(plugin, bandedRangeId),- };- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/Command/Action/DeleteBandingAction.ts b/packages/sheets-plugin-alternating-colors/src/Command/Action/DeleteBandingAction.tsdeleted file mode 100644index e63fb6cbb1..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/Action/DeleteBandingAction.ts+++ /dev/null@@ -1,63 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, Workbook } from '@univerjs/core';-import { AlternatingColorsPlugin } from '../../AlternatingColorsPlugin';-import { AddBanding } from '../../Apply/AddBanding';-import { DeleteBanding } from '../../Apply/DeleteBanding';-import { ALTERNATING_COLORS_PLUGIN_NAME } from '../../Const';-import { IBandedRange } from '../../IBandedRange';-import { ACTION_NAMES } from '../ACTION_NAMES';-import { IAddBandingActionData } from './AddBandingAction';--export interface IDeleteBandingActionData extends ISheetActionData {- bandedRangeId: string;-}--export class DeleteBandingAction extends SheetActionBase<IDeleteBandingActionData, IAddBandingActionData, IBandedRange> {- constructor(actionData: IDeleteBandingActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);-- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- sheetId: actionData.sheetId,- bandedRange: this.do(),- };- this.validate();- }-- do(): IBandedRange {- const { bandedRangeId } = this._doActionData;- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;- this._observers.onActionDoObserver.notifyObservers(this);- return DeleteBanding(plugin, bandedRangeId);- }-- redo(): void {- // update pre data- const { sheetId } = this._doActionData;-- this._oldActionData = {- sheetId,- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- bandedRange: this.do(),- };- }-- undo(): void {- const { bandedRange } = this._oldActionData;- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;- this._observers.onActionUndoObserver.notifyObservers(this);- AddBanding(plugin, bandedRange);- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/Command/Action/SetBandingAction.ts b/packages/sheets-plugin-alternating-colors/src/Command/Action/SetBandingAction.tsdeleted file mode 100644index 8ae9a7fbb0..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/Action/SetBandingAction.ts+++ /dev/null@@ -1,66 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, Workbook } from '@univerjs/core';-import { AlternatingColorsPlugin } from '../../AlternatingColorsPlugin';-import { SetBanding } from '../../Apply/SetBanding';-import { ALTERNATING_COLORS_PLUGIN_NAME } from '../../Const';-import { IBandedRange } from '../../IBandedRange';-import { ACTION_NAMES } from '../ACTION_NAMES';--export interface ISetBandingActionData extends ISheetActionData {- bandedRange: IBandedRange;-}--export class SetBandingAction extends SheetActionBase<ISetBandingActionData, ISetBandingActionData, IBandedRange> {- constructor(actionData: ISetBandingActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);-- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.SET_BANDING_ACTION,- sheetId: actionData.sheetId,- bandedRange: this.do(),- };- this.validate();- }-- do(): IBandedRange {- const { bandedRange } = this._doActionData;- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;- this._observers.onActionDoObserver.notifyObservers(this);- return SetBanding(plugin, bandedRange);- }-- redo(): void {- // update pre data- const { bandedRange, sheetId } = this._doActionData;- this._oldActionData = {- actionName: ACTION_NAMES.SET_BANDING_ACTION,- sheetId,- bandedRange: this.do(),- };- }-- undo(): void {- const { bandedRange, sheetId } = this._oldActionData;- const worksheet = this.getWorkSheet();- const context = worksheet.getContext();- const manager = context.getPluginManager();- const plugin = manager.getPluginByName(ALTERNATING_COLORS_PLUGIN_NAME) as AlternatingColorsPlugin;- this._observers.onActionUndoObserver.notifyObservers(this);-- // update current data- this._doActionData = {- actionName: ACTION_NAMES.SET_BANDING_ACTION,- sheetId,- bandedRange: SetBanding(plugin, bandedRange),- };- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/Command/RegisterAction.ts b/packages/sheets-plugin-alternating-colors/src/Command/RegisterAction.tsdeleted file mode 100644index ce48175bcd..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/RegisterAction.ts+++ /dev/null@@ -1,9 +0,0 @@-import { CommandManager } from '@univerjs/core';-import { AddBandingAction } from './Action/AddBandingAction';-import { DeleteBandingAction } from './Action/DeleteBandingAction';-import { SetBandingAction } from './Action/SetBandingAction';-import { ACTION_NAMES } from './ACTION_NAMES';--CommandManager.register(ACTION_NAMES.DELETE_BANDING_ACTION, DeleteBandingAction);-CommandManager.register(ACTION_NAMES.SET_BANDING_ACTION, SetBandingAction);-CommandManager.register(ACTION_NAMES.ADD_BANDING_ACTION, AddBandingAction);diff --git a/packages/sheets-plugin-alternating-colors/src/Command/index.ts b/packages/sheets-plugin-alternating-colors/src/Command/index.tsdeleted file mode 100644index 1be3fa2cdb..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Command/index.ts+++ /dev/null@@ -1,7 +0,0 @@-// @index('./*.ts', f => `export * from '${f.path}'`)-import './RegisterAction';--export * from './Action/AddBandingAction';-export * from './Action/DeleteBandingAction';-export * from './Action/SetBandingAction';-// @endindexdiff --git a/packages/sheets-plugin-alternating-colors/src/Const/CUSTOM_COLOR_MAP.ts b/packages/sheets-plugin-alternating-colors/src/Const/CUSTOM_COLOR_MAP.tsdeleted file mode 100644index a0e76a87ab..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Const/CUSTOM_COLOR_MAP.ts+++ /dev/null@@ -1,6 +0,0 @@-export const CUSTOM_COLOR_MAP = {- headerColor: 'Header',- firstBandColor: 'Color 1',- secondBandColor: 'Color 2',- footerColor: 'Footer',-};diff --git a/packages/sheets-plugin-alternating-colors/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-alternating-colors/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index fcc91c5cbe..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const ALTERNATING_COLORS_PLUGIN_NAME = 'alternatingColors';diff --git a/packages/sheets-plugin-alternating-colors/src/Const/index.ts b/packages/sheets-plugin-alternating-colors/src/Const/index.tsdeleted file mode 100644index 0749b6a9c9..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Const/index.ts+++ /dev/null@@ -1,4 +0,0 @@-// @index('./*.ts', f => `export * from '${f.path}'`)-export * from './CUSTOM_COLOR_MAP';-export * from './PLUGIN_NAME';-// @endindexdiff --git a/packages/sheets-plugin-alternating-colors/src/IBandedRange.ts b/packages/sheets-plugin-alternating-colors/src/IBandedRange.tsdeleted file mode 100644index 3189d53aa6..0000000000--- a/packages/sheets-plugin-alternating-colors/src/IBandedRange.ts+++ /dev/null@@ -1,87 +0,0 @@-import { IRangeData } from '@univerjs/core';-import { BandingTheme } from './BandingTheme';-/**- * Properties referring a single dimension (either row or column).- *- * @remarks- * If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules:- *- * 1. headerColor and footerColor take priority over band colors.- * 2. firstBandColor takes priority over secondBandColor .- * 3. rowProperties takes priority over columnProperties .- *- * For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set.- */-export interface IBandingProperties {- headerColor: string;-- firstBandColor: string;-- secondBandColor: string;-- footerColor: string;-}--/**- * Properties of Banding- */-export interface IBanding {- bandingTheme: BandingTheme | IBandingProperties;- showHeader: boolean;- showFooter: boolean;-}--/**- * A banded (alternating colors) range in a sheet.- */-export interface IBandedRange {- bandedRangeId: string;- sheetId: string;- rangeData: IRangeData;- rowProperties: IBanding;-}--/**- * Default banded range- */-export const DEFAULT_THEME_BANDED_RANGE: IBandedRange = {- bandedRangeId: 'banded-range-01',- sheetId: 'sheet-01',- rangeData: {- startRow: 0,- endRow: 1,- startColumn: 0,- endColumn: 1,- },- rowProperties: {- bandingTheme: BandingTheme.BLUE,- showHeader: true,- showFooter: false,- },-};-/**- * Default banded range- */-export const DEFAULT_PROPERTIES_BANDED_RANGE: IBandedRange = {- bandedRangeId: 'banded-range-01',- sheetId: 'sheet-01',- rangeData: {- startRow: 0,- endRow: 1,- startColumn: 0,- endColumn: 1,- },- rowProperties: {- bandingTheme: {- headerColor: 'red',-- firstBandColor: 'lightgray',-- secondBandColor: 'lightgreen',-- footerColor: 'yellow',- },- showHeader: true,- showFooter: false,- },-};diff --git a/packages/sheets-plugin-alternating-colors/src/IData/IAlternatingColors.ts b/packages/sheets-plugin-alternating-colors/src/IData/IAlternatingColors.tsdeleted file mode 100644index 79aa62a836..0000000000--- a/packages/sheets-plugin-alternating-colors/src/IData/IAlternatingColors.ts+++ /dev/null@@ -1,6 +0,0 @@-export type IConfig = {- // context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-alternating-colors/src/IData/index.ts b/packages/sheets-plugin-alternating-colors/src/IData/index.tsdeleted file mode 100644index 0c0a2b4735..0000000000--- a/packages/sheets-plugin-alternating-colors/src/IData/index.ts+++ /dev/null@@ -1,3 +0,0 @@-// @index('./*.ts', f => `export * from '${f.path}'`)-export * from './IAlternatingColors';-// @endindexdiff --git a/packages/sheets-plugin-alternating-colors/src/Locale/en.ts b/packages/sheets-plugin-alternating-colors/src/Locale/en.tsdeleted file mode 100644index 57831f4df9..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Locale/en.ts+++ /dev/null@@ -1,14 +0,0 @@-export default {- alternatingColors: {- alternatingColorsLabel: 'Alternating Colors',- applyToRange: 'Apply to range',- styles: 'Styles',- defaultStyles: 'Default styles',- customStyles: 'Custom styles',- removeAlternatingColors: 'Remove alternating colors',- headerColor: 'Header',- firstBandColor: 'Color 1',- secondBandColor: 'Color 2',- footerColor: 'Footer',- },-};diff --git a/packages/sheets-plugin-alternating-colors/src/Locale/index.ts b/packages/sheets-plugin-alternating-colors/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-alternating-colors/src/Locale/zh.ts b/packages/sheets-plugin-alternating-colors/src/Locale/zh.tsdeleted file mode 100644index 2cf59e269f..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Locale/zh.ts+++ /dev/null@@ -1,14 +0,0 @@-export default {- alternatingColors: {- alternatingColorsLabel: '交替颜色',- applyToRange: '应用范围',- styles: '样式',- defaultStyles: '默认样式',- customStyles: '自定义样式',- removeAlternatingColors: '移除交替颜色',- headerColor: '头部',- firstBandColor: '颜色 1',- secondBandColor: '颜色 2',- footerColor: '尾部',- },-};diff --git a/packages/sheets-plugin-alternating-colors/src/Types/index.d.ts b/packages/sheets-plugin-alternating-colors/src/Types/index.d.tsdeleted file mode 100644index 8640befb71..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-alternating-colors' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-alternating-colors/src/Types/preact.d.ts b/packages/sheets-plugin-alternating-colors/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-alternating-colors/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsButton.tsx b/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsButton.tsxdeleted file mode 100644index fb95991a5d..0000000000--- a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsButton.tsx+++ /dev/null@@ -1,104 +0,0 @@-import { Component, IToolbarItemProps } from '@univerjs/base-ui';--import { SheetContext, Nullable, Observer, PLUGIN_NAMES, Workbook } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';--import { ALTERNATING_COLORS_PLUGIN_NAME } from '../Const';-import { IProps } from '../IData/IAlternatingColors';--// Types for state-interface IState {- alternatingColors: IToolbarItemProps;-}--export class AlternatingColorsButton extends Component<IProps, IState> {- private _localeObserver: Nullable<Observer<Workbook>>;-- initialize(props: IProps) {- const OrderIcon = this.getComponentRender().renderFunction('OrderIcon');-- // this.SingleButton = renderComponent.renderFunction<SingleButtonComponent>('SingleButton');-- const alternatingColors: IToolbarItemProps = {- locale: ALTERNATING_COLORS_PLUGIN_NAME,- type: 'single',- label: <OrderIcon />,- show: true,- onClick: (item, context: SheetContext) => {- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.showSiderByName(ALTERNATING_COLORS_PLUGIN_NAME, true);- },- };-- this.state = {- alternatingColors,- };- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this._context- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- const locale = this._context.getLocale();- this.setState((prevState: IState) => {- let item = prevState.alternatingColors;- // set current Locale string for tooltip- item.tooltip = locale.get(`${item.locale}Label`);- item.tooltipRight = locale.get(`${item.locale}RightLabel`);-- // set current Locale string for select- item.children?.forEach((ele: IToolbarItemProps) => {- if (ele.locale) {- ele.label = locale.get(`${ele.locale}`);- }- });- item.label = typeof item.label === 'object' ? item.label : item.children![0].label;-- return {- alternatingColors: item,- };- });- }-- /**- * Render the component's HTML- *- * @returns {void}- */- render(props: IProps, state: IState) {- const { alternatingColors } = state;- // Set Provider for entire Container- const SingleButton = this.getComponentRender().renderFunction('SingleButton');- return (- <SingleButton- tooltip={alternatingColors.tooltip}- key={alternatingColors.locale}- name={alternatingColors.locale}- label={alternatingColors.label}- onClick={alternatingColors.onClick?.bind(this)}- ></SingleButton>- );- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/AlternatingColorsSide.tsx b/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/AlternatingColorsSide.tsxdeleted file mode 100644index bfd29b041e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/AlternatingColorsSide.tsx+++ /dev/null@@ -1,485 +0,0 @@-import { closest, Component, createRef } from '@univerjs/base-ui';-import { IKeyValue, IRangeStringData, Nullable, Observer, PluginManager, PLUGIN_NAMES, Tools, Workbook } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';--import { AlternatingColorsPlugin } from '../../AlternatingColorsPlugin';-import { BandingTheme } from '../../BandingTheme';-import { BANDING_THEME_COLOR_LIST, BANDING_THEME_COLOR_MAP } from '../../BANDING_THEME_COLOR';--import { ALTERNATING_COLORS_PLUGIN_NAME } from '../../Const';-import { IBandedRange, IBandingProperties } from '../../IBandedRange';-import styles from './index.module.less';--/**- * type for props- */-type IConfig = {- bandedRange: IBandedRange;- alternatingColorsPlugin: AlternatingColorsPlugin;-};-type IPanelProps = {- config: IConfig;- style?: JSX.CSSProperties;-};--// Types for state-interface IState {- bandedRange: IBandedRange;- customStyles: Array<IBandingProperties | string>;- colorSelect: IBandingProperties;- currentStyle: ICurrentStyle;- panelBodyHeight: string | number;- alternatingColors: IKeyValue;- rangeStringData: IRangeStringData;- showHeader: boolean;- showFooter: boolean;-}--interface ICurrentStyle {- type?: 'theme' | 'custom';- index?: number;-}--export class AlternatingColorsSide extends Component<IPanelProps, IState> {- alternatingColorsPlugin: AlternatingColorsPlugin;-- panelContainerRef = createRef();-- panelBodyRef = createRef();-- private _localeObserver: Nullable<Observer<Workbook>>;-- initialize(props: IPanelProps) {- const { bandedRange, alternatingColorsPlugin } = props.config;-- this.alternatingColorsPlugin = alternatingColorsPlugin;-- let colorSelect: IBandingProperties;- let currentStyle: ICurrentStyle = {};- let customStyles: Array<IBandingProperties | string> = ['add'];-- // get colorSelect from user setting- const banding = bandedRange.rowProperties;- if (banding) {- // string means BandingThemeType- if (typeof banding.bandingTheme === 'string') {- colorSelect = BANDING_THEME_COLOR_MAP[banding.bandingTheme];-- currentStyle.type = 'theme';-- // find index in theme color list- currentStyle.index = BANDING_THEME_COLOR_LIST.findIndex((theme) => banding.bandingTheme === theme);- }- // or a object as custom colors- else {- colorSelect = banding.bandingTheme;-- // we don't store all custom styles to server, just init colorSelect as customStyles- customStyles.push(colorSelect);-- // active current custom color- currentStyle = {- type: 'custom',- index: 1,- };- }- }- // init default colorSelect- else {- currentStyle = {- type: 'theme',- index: 0,- };-- colorSelect = BANDING_THEME_COLOR_MAP[BandingTheme.GREY];- }-- this.state = {- bandedRange,- customStyles,- colorSelect,- currentStyle,- panelBodyHeight: 0,- alternatingColors: {},- rangeStringData: Workbook.rangeDataToRangeStringData(bandedRange.rangeData),- showHeader: banding.showHeader,- showFooter: banding.showFooter,- };-- this.alternatingColorsPlugin.addRowBanding(bandedRange);- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this._context- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- /**- * set scroll height- */- componentDidMount() {- const dom = this.panelContainerRef.current?.base;- if (dom) {- const panelHeaderHeight = dom.querySelector(`.${styles.panelHeader}`)?.clientHeight;- const panelFooterHeight = dom.querySelector(`.${styles.panelFooter}`)?.clientHeight;-- // this.panelBodyRef.current?.styles.height = panelBodyHeight // not working- if (panelHeaderHeight !== undefined && panelFooterHeight !== undefined) {- this.setState({- panelBodyHeight: `calc(100% - ${panelHeaderHeight + panelFooterHeight}px)`,- });- }- }- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- const locale = this._context.getLocale();-- this.setState((prevState: IState) => {- const alternatingColors: IKeyValue = locale.getObject(ALTERNATING_COLORS_PLUGIN_NAME);- alternatingColors.button = locale.getObject(`button`);- return {- alternatingColors,- };- });- }-- /**- * close panel- */- handleClosePanel() {- const manage: PluginManager = this._context.getPluginManager();-- manage.getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.showSiderByName(ALTERNATING_COLORS_PLUGIN_NAME, false);- }-- /**- * choose a theme- */- handleDefaultStyleClick(e: MouseEvent) {- // get current active item index in item list- const currentItem = closest(e.target as HTMLElement, `.${styles.themeColorList} .${styles.themeColorItem}`);-- // click item gap- if (!currentItem) {- return;- }-- const dom = this.panelContainerRef.current?.base;- const nodes = Array.prototype.slice.call(dom.querySelectorAll(`.${styles.themeColorList} .${styles.themeColorItem}`));- const index = nodes.indexOf(currentItem);-- this.setState((preState: IState) => {- let { colorSelect, currentStyle } = preState;- currentStyle = {- type: 'theme',- index,- };-- // update current select- colorSelect = Tools.deepClone(BANDING_THEME_COLOR_MAP[BANDING_THEME_COLOR_LIST[index]]);-- return {- colorSelect,- currentStyle,- };- });-- this.setBanding();- }-- /**- * choose a custom style- */- handleCustomStyleClick(e: MouseEvent) {- // get current active item index in item list- const currentItem = closest(e.target as HTMLElement, `.${styles.customColorList} .${styles.themeColorItem}`);-- // add button don't need active- if (currentItem?.textContent === '+') {- this.addCustomItem();- return;- }- const dom = this.panelContainerRef.current?.base;- const nodes = Array.prototype.slice.call(dom.querySelectorAll(`.${styles.customColorList} .${styles.themeColorItem}`));- const index = nodes.indexOf(currentItem);- this.setState((preState: IState) => {- let { customStyles, colorSelect, currentStyle } = preState;- currentStyle = {- type: 'custom',- index,- };-- // update current select- colorSelect = customStyles[index] as IBandingProperties;-- return {- colorSelect,- currentStyle,- };- });-- this.setBanding();- }-- /**- * add new custom color item- */- addCustomItem(colorBanding?: IBandingProperties) {- this.setState((preState: IState) => {- let { customStyles, colorSelect, currentStyle } = preState;-- // click default style,then change color,we need changed color to set custom style- colorBanding ? customStyles.push(Tools.deepClone(colorBanding)) : customStyles.push(Tools.deepClone(colorSelect));-- // limit max length as 12- if (customStyles.length === 13) {- // remove add button- customStyles.shift();- }-- // update current item as active- currentStyle = {- type: 'custom',- index: customStyles.length - 1,- };-- // update current select- colorSelect = customStyles[customStyles.length - 1] as IBandingProperties;-- return {- colorSelect,- currentStyle,- };- });-- this.setBanding();- }-- /**- * choose custom color- */- handleColorSelect(key: string, color: string) {- let { customStyles, colorSelect, currentStyle } = this.state;-- const changeColor = {};- changeColor[key] = color;- colorSelect = Object.assign(colorSelect, changeColor);-- // change color by theme color- if (currentStyle.type === 'theme') {- this.addCustomItem(colorSelect);- } else {- this.setState({- colorSelect,- });- }-- this.setBanding();- }-- /**- * cancel choose custom color- */- handleColorCancel() {- // console.log('handleColorCancel', e, i, a);- }-- // remove banding- setBanding() {- const { currentStyle, colorSelect, bandedRange } = this.state;- let bandingTheme;- if (currentStyle.type === 'theme') {- bandingTheme = BANDING_THEME_COLOR_LIST[`${currentStyle.index}`];- } else {- bandingTheme = colorSelect;- }-- const newBandedRange = Tools.deepMerge(bandedRange, {- rowProperties: {- bandingTheme,- },- });-- // 1. 每设置一次,就调用一次API-- // 确定时将结果状态保存到bandedRange- this.alternatingColorsPlugin.getBandingById(bandedRange.bandedRangeId)?.setRowBanding(newBandedRange);- }-- handleAlternatingColorsCancel() {- const { bandedRange } = this.state;-- // 取消的话恢复到bandedRange- this.alternatingColorsPlugin.getBandingById(bandedRange.bandedRangeId)?.setRowBanding(bandedRange);-- this.handleClosePanel();- }-- handleAlternatingColorsConfirm() {- this.setBanding();- this.handleClosePanel();- }-- /**- * Render the component's HTML- *- * @returns- */- render(props: IPanelProps, state: IState) {- const { customStyles, colorSelect, currentStyle, panelBodyHeight, alternatingColors, rangeStringData, showHeader, showFooter } = state;- const { style } = props;- // Set Provider for entire Container- const SiderModal = this.getComponentRender().renderFunction('SiderModal');- const Button = this.getComponentRender().renderFunction('Button');- const CellRangeModal = this.getComponentRender().renderFunction('CellRangeModal');- const Checkbox = this.getComponentRender().renderFunction('Checkbox');- const ColorPickerCircleButton = this.getComponentRender().renderFunction('ColorPickerCircleButton');- const DeleteIcon = this.getComponentRender().renderFunction('DeleteIcon');- return (- <SiderModal- className={styles.alternatingColorsSide}- title={alternatingColors.alternatingColorsLabel}- ref={this.panelContainerRef}- footer={- <div className={styles.panelFooter}>- <div className={styles.section}>- <span className={styles.iconContainer}>- <DeleteIcon></DeleteIcon>- </span>- <span className={styles.textContainer}>{alternatingColors.removeAlternatingColors}</span>- </div>- </div>- }- pluginName={ALTERNATING_COLORS_PLUGIN_NAME}- style={{ ...style }}- >- <div className={styles.panelBody} ref={this.panelBodyRef} style={{ height: panelBodyHeight }}>- <div className={styles.panelBodyInner}>- {/* <div className={styles.panelBody} ref={this.panelBodyRef} > */}- <div className={styles.section}>- <h3>{alternatingColors.applyToRange}</h3>- <div>- <CellRangeModal placeholderProps={alternatingColors.applyToRange} valueProps={rangeStringData}></CellRangeModal>- </div>- </div>- <div className={styles.section}>- <h3>{alternatingColors.styles}</h3>- <div className={styles.stylesCheckbox}>- <Checkbox value={`Header`} checked={showHeader} children={`Header`} onChange={() => this.setState({ showHeader: !showHeader })}></Checkbox>- <Checkbox value={`Footer`} checked={showFooter} children={`Footer`} onChange={() => this.setState({ showFooter: !showFooter })}></Checkbox>- </div>-- <h4>{alternatingColors.defaultStyles}</h4>- <div className={styles.themeColorList} onClick={this.handleDefaultStyleClick.bind(this)}>- {BANDING_THEME_COLOR_LIST.map((theme, index) => {- // theme color list- const colors = BANDING_THEME_COLOR_MAP[theme];- return (- <div- className={- currentStyle.type === 'theme' && currentStyle.index === index- ? `${styles.themeColorItem} ${styles.themeColorItemActive}`- : styles.themeColorItem- }- >- <div className={styles.themeColorInnerItem}>- <div style={showHeader ? { background: colors.headerColor } : {}}> — </div>- <div style={{ background: colors.firstBandColor }}> — </div>- <div style={{ background: colors.secondBandColor }}> — </div>- <div style={showFooter ? { background: colors.footerColor } : {}}> — </div>- </div>- </div>- );- })}- </div>- <h4>{alternatingColors.customStyles}</h4>- <div>- <div className={styles.customColorList} onClick={this.handleCustomStyleClick.bind(this)}>- {customStyles.map((colors, index) =>- typeof colors === 'string' ? (- // add custom color button- <div- className={- currentStyle.type === 'custom' && currentStyle.index === index- ? `${styles.themeColorItem} ${styles.themeColorItemActive}`- : styles.themeColorItem- }- >- <div className={styles.themeColorInnerItem}>- <div className={styles.customStyleAdd}>+</div>- </div>- </div>- ) : (- // custom color list- <div- className={- currentStyle.type === 'custom' && currentStyle.index === index- ? `${styles.themeColorItem} ${styles.themeColorItemActive}`- : styles.themeColorItem- }- >- <div className={styles.themeColorInnerItem}>- <div style={showHeader ? { background: colors.headerColor } : {}}> — </div>- <div style={{ background: colors.firstBandColor }}> — </div>- <div style={{ background: colors.secondBandColor }}> — </div>- <div style={showFooter ? { background: colors.footerColor } : {}}> — </div>- </div>- </div>- )- )}- </div>-- <div className={styles.colorSelect}>- {Object.keys(colorSelect).map((key) => (- <div className={styles.colorSelectItem}>- <span className={styles.colorSelectBanner} style={{ backgroundColor: colorSelect[key] }}>- {alternatingColors[key]}- </span>- <span className={styles.colorSelectButton}>- <ColorPickerCircleButton- color={colorSelect[key]}- onClick={this.handleColorSelect.bind(this, key)}- onCancel={this.handleColorCancel.bind(this)}- style={{ bottom: '30px', right: '0' }}- />- </span>- </div>- ))}- </div>- </div>- </div>-- <div className={`${styles.section} ${styles.bottomButtons}`}>- <Button onClick={this.handleAlternatingColorsCancel.bind(this)}>{alternatingColors.button.cancel}</Button>- <Button type="primary" onClick={this.handleAlternatingColorsConfirm.bind(this)}>- {alternatingColors.button.confirm}- </Button>- </div>- </div>- </div>- </SiderModal>- );- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/index.module.less b/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/index.module.lessdeleted file mode 100644index 755edead7e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/UI/AlternatingColorsSide/index.module.less+++ /dev/null@@ -1,135 +0,0 @@-.alternating-colors-side {- .section {- padding-top: var(--padding-base);- h3 {- margin-bottom: var(--margin-base);- }- }-- .panel-body {- padding: 0 var(--padding-base);- position: relative;-- .panel-body-inner {- position: absolute;- overflow-y: auto;- height: 100%;- .styles-checkbox {- display: flex;- > label {- margin: 0 var(--margin-base) var(--margin-base) 0;- }- }-- .theme-color-list {- display: flex;- flex-wrap: wrap;- }-- .custom-color-list {- display: flex;- flex-wrap: wrap;- border: 1px solid var(--border-color-base);- border-radius: var(--border-radius-base);- .custom-style-add {- padding: var(--padding-base);- display: flex;- justify-content: center;- align-items: center;-- height: 4em;- line-height: 4em;- :hover {- cursor: pointer;- }- }- }-- // 6 items per line- .theme-color-item {- width: 15.5%;- padding: 0.1em;- border: 2px solid transparent;- box-sizing: border-box;-- :hover {- cursor: pointer;- }- .theme-color-inner-item {- border: 1px solid var(--border-color-base);- box-sizing: border-box;-- &:hover {- border-color: var(--border-color-base-hover);- }- > div {- width: 100%;- line-height: 1em;- text-align: center;- color: var(--gray-8);- }- }- }- .theme-color-item-active {- border-color: #726efe;- }-- .color-select {- display: flex;- flex-direction: column;- .color-select-item {- width: 100%;- display: flex;-- .color-select-banner {- width: 65%;- display: flex;- justify-content: center;- align-items: center;- height: 2em;- border-radius: var(--border-radius-base);- }-- .color-select-button {- &:hover {- cursor: pointer;- background-color: var(--gray-4);- }- }- }- }-- .bottom-buttons {- float: right;- button {- padding: 0 1em;- margin-left: 1em;- }- }- }- }- .panel-footer {- .section {- display: flex;- justify-content: center;- border-top: 1px solid var(--border-color-base);- padding: 0.9em var(--padding-base);- margin: 0.9em var(--padding-base);- &:hover {- cursor: pointer;- background-color: var(--gray-4);- }- .icon-container {- font-size: 1.6em;- :hover {- cursor: pointer;- }- }- .text-container {- line-height: 1.8em;- display: inline-block;- height: 1.8em;- }- }- }-}diff --git a/packages/sheets-plugin-alternating-colors/src/View/Event.ts b/packages/sheets-plugin-alternating-colors/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-alternating-colors/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-alternating-colors/src/View/ObserverList.ts b/packages/sheets-plugin-alternating-colors/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-alternating-colors/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-alternating-colors/src/View/Render.ts b/packages/sheets-plugin-alternating-colors/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-alternating-colors/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-alternating-colors/src/View/index.ts b/packages/sheets-plugin-alternating-colors/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-alternating-colors/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-alternating-colors/src/index.ts b/packages/sheets-plugin-alternating-colors/src/index.tsdeleted file mode 100644index 495f93bd9b..0000000000--- a/packages/sheets-plugin-alternating-colors/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { AlternatingColorsPlugin } from './AlternatingColorsPlugin';--export { AlternatingColorsPlugin };diff --git a/packages/sheets-plugin-alternating-colors/src/main.tsx b/packages/sheets-plugin-alternating-colors/src/main.tsxdeleted file mode 100644index 5a91ed2713..0000000000--- a/packages/sheets-plugin-alternating-colors/src/main.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));--// univerSheetUp.installPlugin(new AlternatingColorsPlugin({ value: [] }));diff --git a/packages/sheets-plugin-alternating-colors/test/Banding.test.ts b/packages/sheets-plugin-alternating-colors/test/Banding.test.tsdeleted file mode 100644index 7afb6f6196..0000000000--- a/packages/sheets-plugin-alternating-colors/test/Banding.test.ts+++ /dev/null@@ -1,70 +0,0 @@-/**- * @jest-environment jsdom- */-import { UniverSheet } from '@univerjs/core';-import { StyleUniverSheet } from '@univerjs/style-univer';-import { AlternatingColorsPlugin } from '../src';-// TODO 补充单元测试-test('Test Banding', () => {- const univerSheet = UniverSheet.newInstance({- locale: 'zh',- creator: '',- name: '',- skin: 'default',- timeZone: '',- createdTime: '',- modifiedTime: '',- appVersion: '',- lastModifiedBy: '',- styles: {- 1: {- color: 'blue',- fontFamily: 'Arial',- fontSize: 12,- background: '#ff0000',- },- 2: {- color: 'green',- fontSize: 14,- background: '#0000ff',- },- },- sheets: [- {- cellData: {- 0: {- 0: {- s: 1,- v: 1,- m: 1,- },- 1: {- s: 2,- v: 2,- m: 2,- },- },- },- },- ],- });-- const uiDefaultConfigUp = {- container: 'universheet-demo-up',- // layout: 'auto',- layout: {- outerLeft: false,- outerRight: true,- innerLeft: false,- innerRight: false,- toolbar: true,- toolbarConfig: {- undoRedo: true,- font: true,- },- contentSplit: true,- },- };- univerSheet.installPlugin(new StyleUniverSheet(uiDefaultConfigUp));- univerSheet.installPlugin(new AlternatingColorsPlugin());-});diff --git a/packages/sheets-plugin-alternating-colors/test/Banding/Action/AddBandingAction.test.ts b/packages/sheets-plugin-alternating-colors/test/Banding/Action/AddBandingAction.test.tsdeleted file mode 100644index 5b41ff4a0b..0000000000--- a/packages/sheets-plugin-alternating-colors/test/Banding/Action/AddBandingAction.test.ts+++ /dev/null@@ -1,22 +0,0 @@-/**- * @jest-environment jsdom- */-import { ACTION_NAMES } from '../../../../src';-import { ActionObservers } from '../../../../src/Command';-import { AddBandingAction } from '../../../../src/Module/Banding/Action';-import { TestInit } from '../../../ContainerStartUp';-import { bandedRange } from '../Banding.test';--test('Add Banding Action Test', () => {- const { workbook, worksheet } = TestInit();-- new AddBandingAction(- {- sheetId: worksheet.getSheetId(),- actionName: ACTION_NAMES.ADD_BANDING_ACTION,- bandedRange,- },- workbook,- new ActionObservers()- );-});diff --git a/packages/sheets-plugin-alternating-colors/test/Banding/Action/DeleteBandingAction.test.ts b/packages/sheets-plugin-alternating-colors/test/Banding/Action/DeleteBandingAction.test.tsdeleted file mode 100644index 51334b0d3c..0000000000--- a/packages/sheets-plugin-alternating-colors/test/Banding/Action/DeleteBandingAction.test.ts+++ /dev/null@@ -1,21 +0,0 @@-/**- * @jest-environment jsdom- */-import { ACTION_NAMES } from '../../../../src';-import { ActionObservers } from '../../../../src/Command';-import { DeleteBandingAction } from '../../../../src/Module/Banding/Action';-import { TestInit } from '../../../ContainerStartUp';-import { bandedRange } from '../Banding.test';--test('Delete Banding Action Test', () => {- const { workbook, worksheet } = TestInit({ bandedRanges: [bandedRange] });- new DeleteBandingAction(- {- sheetId: worksheet.getSheetId(),- actionName: ACTION_NAMES.DELETE_BANDING_ACTION,- bandedRangeId: bandedRange.bandedRangeId,- },- workbook,- new ActionObservers()- );-});diff --git a/packages/sheets-plugin-alternating-colors/test/Banding/Action/SetBandingAction.test.ts b/packages/sheets-plugin-alternating-colors/test/Banding/Action/SetBandingAction.test.tsdeleted file mode 100644index 92fcd858bb..0000000000--- a/packages/sheets-plugin-alternating-colors/test/Banding/Action/SetBandingAction.test.ts+++ /dev/null@@ -1,22 +0,0 @@-/**- * @jest-environment jsdom- */-import { ACTION_NAMES } from '../../../../src';-import { ActionObservers } from '../../../../src/Command';-import { SetBandingAction } from '../../../../src/Module/Banding/Action';-import { TestInit } from '../../../ContainerStartUp';-import { bandedRange, newBandedRange } from '../Banding.test';--test('Set Banding Action Test', () => {- const { workbook, worksheet } = TestInit({ bandedRanges: [bandedRange] });-- new SetBandingAction(- {- sheetId: worksheet.getSheetId(),- actionName: ACTION_NAMES.SET_BANDING_ACTION,- bandedRange: newBandedRange,- },- workbook,- new ActionObservers()- );-});diff --git a/packages/sheets-plugin-alternating-colors/test/Banding/Banding.test.ts b/packages/sheets-plugin-alternating-colors/test/Banding/Banding.test.tsdeleted file mode 100644index 5a29d56f18..0000000000--- a/packages/sheets-plugin-alternating-colors/test/Banding/Banding.test.ts+++ /dev/null@@ -1,66 +0,0 @@-/**- * @jest-environment jsdom- */-import {- Banding,- BandingTheme,- DEFAULT_BANDED_RANGE,- IBandedRange,-} from '../../../src';-import { TestInit } from '../../ContainerStartUp';--export const bandedRange = DEFAULT_BANDED_RANGE;--export const newBandedRange: IBandedRange = {- ...DEFAULT_BANDED_RANGE,- rowProperties: {- bandingTheme: BandingTheme.BROWN,- showHeader: true,- showFooter: false,- },-};--test('Test Banding', () => {- const { workbook, worksheet } = TestInit();-- const banding = new Banding(worksheet);-- // add- banding.addRowBanding(bandedRange);-- expect(worksheet.getConfig().bandedRanges).toEqual([bandedRange]);-- worksheet.getCommandManager().undo();-- expect(worksheet.getConfig().bandedRanges).toEqual([]);-- worksheet.getCommandManager().redo();-- expect(worksheet.getConfig().bandedRanges).toEqual([bandedRange]);-- // set- banding.setRowBanding(newBandedRange);-- expect(worksheet.getConfig().bandedRanges).toEqual([newBandedRange]);-- worksheet.getCommandManager().undo();-- expect(worksheet.getConfig().bandedRanges).toEqual([bandedRange]);-- worksheet.getCommandManager().redo();-- expect(worksheet.getConfig().bandedRanges).toEqual([newBandedRange]);-- // remove- banding.remove(newBandedRange.bandedRangeId);-- expect(worksheet.getConfig().bandedRanges).toEqual([]);-- worksheet.getCommandManager().undo();-- expect(worksheet.getConfig().bandedRanges).toEqual([newBandedRange]);-- worksheet.getCommandManager().redo();-- expect(worksheet.getConfig().bandedRanges).toEqual([]);-});diff --git a/packages/sheets-plugin-alternating-colors/tsconfig.json b/packages/sheets-plugin-alternating-colors/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-alternating-colors/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-alternating-colors/vite.config.ts b/packages/sheets-plugin-alternating-colors/vite.config.tsdeleted file mode 100644index 8a7fe78574..0000000000--- a/packages/sheets-plugin-alternating-colors/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginAlternatingColors',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets--plugin-alternating-colors',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-comment/README-zh.md b/packages/sheets-plugin-comment/README-zh.mddeleted file mode 100644index 7464c84d28..0000000000--- a/packages/sheets-plugin-comment/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Comment 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-comment-```--### 使用--```js-import { Comment } from '@univerjs/sheets-plugin-comment';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Comment());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-comment/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-comment dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-comment/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-comment build-```diff --git a/packages/sheets-plugin-comment/README.md b/packages/sheets-plugin-comment/README.mddeleted file mode 100644index 0037f6aacc..0000000000--- a/packages/sheets-plugin-comment/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Comment--### Installation--```shell-npm i @univerjs/sheets-plugin-comment-```--### Usage--```js-import { Comment } from '@univerjs/sheets-plugin-comment';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Comment());-```--## 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/sheets-plugin-comment/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-comment dev-```--### Package--```-# Current directory ./packages/sheets-plugin-comment/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-comment build-```diff --git a/packages/sheets-plugin-comment/index.html b/packages/sheets-plugin-comment/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-comment/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-comment/jest.config.js b/packages/sheets-plugin-comment/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-comment/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/packages/sheets-plugin-comment/package.json b/packages/sheets-plugin-comment/package.jsondeleted file mode 100644index dcdc33a16b..0000000000--- a/packages/sheets-plugin-comment/package.json+++ /dev/null@@ -1,66 +0,0 @@-{- "name": "@univerjs/sheets-plugin-comment",- "version": "0.0.1",- "description": "UniverSheet normal plugin-comment",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-comment.cjs.js",- "module": "./lib/univer-sheets-plugin-comment.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-comment.cjs.js",- "default": "./lib/univer-sheets-plugin-comment.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-comment/src/Action/ActionComment.ts b/packages/sheets-plugin-comment/src/Action/ActionComment.tsdeleted file mode 100644index acb91e4b30..0000000000--- a/packages/sheets-plugin-comment/src/Action/ActionComment.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionComment {}diff --git a/packages/sheets-plugin-comment/src/Action/IAction.ts b/packages/sheets-plugin-comment/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-comment/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-comment/src/Action/IActionSet.ts b/packages/sheets-plugin-comment/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-comment/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-comment/src/Action/index.ts b/packages/sheets-plugin-comment/src/Action/index.tsdeleted file mode 100644index b2729673ce..0000000000--- a/packages/sheets-plugin-comment/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionComment';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-comment/src/Base/Cache.ts b/packages/sheets-plugin-comment/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-comment/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-comment/src/Base/State.ts b/packages/sheets-plugin-comment/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-comment/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-comment/src/Base/index.ts b/packages/sheets-plugin-comment/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-comment/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-comment/src/CommentPlugin.tsx b/packages/sheets-plugin-comment/src/CommentPlugin.tsxdeleted file mode 100644index 3cdf93f30b..0000000000--- a/packages/sheets-plugin-comment/src/CommentPlugin.tsx+++ /dev/null@@ -1,56 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Nullable, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { COMMENT_COLORS_PLUGIN_NAME } from './Const/PLUGIN_NAME';-import { IConfig } from './IData/IComment';-import { en, zh } from './Locale';-import { CommentButton } from './UI/CommentButton';--export interface ICommentPluginConfig {}--export class CommentPlugin extends Plugin {- sheetPlugin: Nullable<SheetPlugin>;-- constructor(config?: ICommentPluginConfig) {- super(COMMENT_COLORS_PLUGIN_NAME);- }-- static create(config?: ICommentPluginConfig) {- return new CommentPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: COMMENT_COLORS_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <CommentButton config={config} />,- };- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend comment- this.sheetPlugin?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-comment/src/Conflict/ConflictComment.ts b/packages/sheets-plugin-comment/src/Conflict/ConflictComment.tsdeleted file mode 100644index 28263f4658..0000000000--- a/packages/sheets-plugin-comment/src/Conflict/ConflictComment.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictComment {}diff --git a/packages/sheets-plugin-comment/src/Conflict/IConflict.ts b/packages/sheets-plugin-comment/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-comment/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-comment/src/Conflict/index.ts b/packages/sheets-plugin-comment/src/Conflict/index.tsdeleted file mode 100644index bbcc7a38cb..0000000000--- a/packages/sheets-plugin-comment/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictComment';diff --git a/packages/sheets-plugin-comment/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-comment/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index d87c45f34d..0000000000--- a/packages/sheets-plugin-comment/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const COMMENT_COLORS_PLUGIN_NAME = 'comment';diff --git a/packages/sheets-plugin-comment/src/Const/index.ts b/packages/sheets-plugin-comment/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-comment/src/Domain/Comment.ts b/packages/sheets-plugin-comment/src/Domain/Comment.tsdeleted file mode 100644index 9734e99b0a..0000000000--- a/packages/sheets-plugin-comment/src/Domain/Comment.ts+++ /dev/null@@ -1 +0,0 @@-export class Comment {}diff --git a/packages/sheets-plugin-comment/src/Domain/index.ts b/packages/sheets-plugin-comment/src/Domain/index.tsdeleted file mode 100644index 1f3edd682b..0000000000--- a/packages/sheets-plugin-comment/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Comment';diff --git a/packages/sheets-plugin-comment/src/Enum/index.ts b/packages/sheets-plugin-comment/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-comment/src/IData/IComment.ts b/packages/sheets-plugin-comment/src/IData/IComment.tsdeleted file mode 100644index a809ef3796..0000000000--- a/packages/sheets-plugin-comment/src/IData/IComment.ts+++ /dev/null@@ -1,4 +0,0 @@-export type IConfig = {};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-comment/src/IData/index.ts b/packages/sheets-plugin-comment/src/IData/index.tsdeleted file mode 100644index 9710c89bde..0000000000--- a/packages/sheets-plugin-comment/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IComment';diff --git a/packages/sheets-plugin-comment/src/Locale/en.ts b/packages/sheets-plugin-comment/src/Locale/en.tsdeleted file mode 100644index ae86f85be0..0000000000--- a/packages/sheets-plugin-comment/src/Locale/en.ts+++ /dev/null@@ -1,10 +0,0 @@-export default {- comment: {- commentLabel: 'Comment',- insert: 'Insert',- edit: 'Edit',- delete: 'Delete',- showOne: 'Show/Hide',- showAll: 'Show/Hide All',- },-};diff --git a/packages/sheets-plugin-comment/src/Locale/index.ts b/packages/sheets-plugin-comment/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-comment/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-comment/src/Locale/zh.ts b/packages/sheets-plugin-comment/src/Locale/zh.tsdeleted file mode 100644index 879bd1750b..0000000000--- a/packages/sheets-plugin-comment/src/Locale/zh.ts+++ /dev/null@@ -1,10 +0,0 @@-export default {- comment: {- commentLabel: '批注',- insert: '新建批注',- edit: '编辑批注',- delete: '删除',- showOne: '显示/隐藏批注',- showAll: '显示/隐藏所有批注',- },-};diff --git a/packages/sheets-plugin-comment/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-comment/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-comment/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-comment/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-comment/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-comment/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-comment/src/ProxyData/ProxyDataComment.ts b/packages/sheets-plugin-comment/src/ProxyData/ProxyDataComment.tsdeleted file mode 100644index 45b763d43f..0000000000--- a/packages/sheets-plugin-comment/src/ProxyData/ProxyDataComment.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataComment {}diff --git a/packages/sheets-plugin-comment/src/ProxyData/index.ts b/packages/sheets-plugin-comment/src/ProxyData/index.tsdeleted file mode 100644index 4c1ffb794d..0000000000--- a/packages/sheets-plugin-comment/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataComment';diff --git a/packages/sheets-plugin-comment/src/Service/CommentService.ts b/packages/sheets-plugin-comment/src/Service/CommentService.tsdeleted file mode 100644index 8476994ee0..0000000000--- a/packages/sheets-plugin-comment/src/Service/CommentService.ts+++ /dev/null@@ -1 +0,0 @@-export class CommentService {}diff --git a/packages/sheets-plugin-comment/src/Service/index.ts b/packages/sheets-plugin-comment/src/Service/index.tsdeleted file mode 100644index 9623a56abc..0000000000--- a/packages/sheets-plugin-comment/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './CommentService';diff --git a/packages/sheets-plugin-comment/src/Shared/index.ts b/packages/sheets-plugin-comment/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-comment/src/Types/index.d.ts b/packages/sheets-plugin-comment/src/Types/index.d.tsdeleted file mode 100644index 03cfeaa433..0000000000--- a/packages/sheets-plugin-comment/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-comment' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-comment/src/Types/preact.d.ts b/packages/sheets-plugin-comment/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-comment/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-comment/src/UI/CommentButton.tsx b/packages/sheets-plugin-comment/src/UI/CommentButton.tsxdeleted file mode 100644index 77b11170dc..0000000000--- a/packages/sheets-plugin-comment/src/UI/CommentButton.tsx+++ /dev/null@@ -1,127 +0,0 @@-import { BaseComponentRender, BaseComponentSheet, BaseSelectProps, Component, IToolbarItemProps } from '@univerjs/base-ui';-import { Nullable, Observer, Workbook } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';--import { IProps } from '../IData/IComment';--// Types for state-interface IState {- comment: IToolbarItemProps;-}--export class CommentButton extends Component<IProps, IState> {- private _localeObserver: Nullable<Observer<Workbook>>;-- private _render: BaseComponentRender;-- initialize(props: IProps) {- const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- this._render = component.getComponentRender();- const NextIcon = this._render.renderFunction('NextIcon');- const CommentIcon = this._render.renderFunction('CommentIcon');-- // super(props);- const commentState: IToolbarItemProps = {- locale: 'comment.commentLabel',- type: 'select',- label: <CommentIcon />,- icon: <NextIcon />,- show: true,- border: false,- needChange: false,- children: [- {- locale: 'comment.insert',- },- {- locale: 'comment.edit',- },- {- locale: 'comment.delete',- },- {- locale: 'comment.showOne',- border: true,- },- {- locale: 'comment.showAll',- },- ],- };-- this.state = {- comment: commentState,- };- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this._context- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- const locale = this._context.getLocale();- this.setState((prevState: IState) => {- let item = prevState.comment;- // set current Locale string for tooltip- item.tooltip = locale.get(`${item.locale}`);-- // set current Locale string for select- item.children?.forEach((ele: IToolbarItemProps) => {- if (ele.locale) {- ele.label = locale.get(`${ele.locale}`);- }- });- item.label = typeof item.label === 'object' ? item.label : item.children![0].label;-- return {- comment: item,- };- });- }-- /**- * _render the component's HTML- *- * @returns {void}- */- render(props: IProps, state: IState) {- const Select = this._render.renderFunction('Select');-- const { comment } = state;- // Set Provider for entire Container- return (- <Select- tooltip={comment.tooltip}- tooltipRight={comment.tooltipRight}- border={comment.border}- needChange={comment.needChange}- key={comment.locale}- children={comment.children as BaseSelectProps[]}- label={comment.label}- icon={comment.icon}- />- );- }-}diff --git a/packages/sheets-plugin-comment/src/View/Event.ts b/packages/sheets-plugin-comment/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-comment/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-comment/src/View/ObserverList.ts b/packages/sheets-plugin-comment/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-comment/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-comment/src/View/Render.ts b/packages/sheets-plugin-comment/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-comment/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-comment/src/View/index.ts b/packages/sheets-plugin-comment/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-comment/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-comment/src/index.ts b/packages/sheets-plugin-comment/src/index.tsdeleted file mode 100644index 14daeb9654..0000000000--- a/packages/sheets-plugin-comment/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { CommentPlugin } from './CommentPlugin';--export { CommentPlugin };diff --git a/packages/sheets-plugin-comment/src/main.tsx b/packages/sheets-plugin-comment/src/main.tsxdeleted file mode 100644index ffaa9e9bd2..0000000000--- a/packages/sheets-plugin-comment/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new CommentPlugin());diff --git a/packages/sheets-plugin-comment/tsconfig.json b/packages/sheets-plugin-comment/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-comment/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-comment/vite.config.ts b/packages/sheets-plugin-comment/vite.config.tsdeleted file mode 100644index f8e6bf4260..0000000000--- a/packages/sheets-plugin-comment/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginComment',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets--plugin-comment',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-conditional-format/README-zh.md b/packages/sheets-plugin-conditional-format/README-zh.mddeleted file mode 100644index 4841c4f559..0000000000--- a/packages/sheets-plugin-conditional-format/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet ConditionalFormat 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-conditional-format-```--### 使用--```js-import { ConditionalFormat } from '@univerjs/sheets-plugin-conditional-format';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new ConditionalFormat());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-conditional-format/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-conditional-format dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-conditional-format/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-conditional-format build-```diff --git a/packages/sheets-plugin-conditional-format/README.md b/packages/sheets-plugin-conditional-format/README.mddeleted file mode 100644index 629beb0a56..0000000000--- a/packages/sheets-plugin-conditional-format/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin ConditionalFormat--### Installation--```shell-npm i @univerjs/sheets-plugin-conditional-format-```--### Usage--```js-import { ConditionalFormat } from '@univerjs/sheets-plugin-conditional-format';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new ConditionalFormat());-```--## 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/sheets-plugin-conditional-format/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-conditional-format dev-```--### Package--```-# Current directory ./packages/sheets-plugin-conditional-format/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-conditional-format build-```diff --git a/packages/sheets-plugin-conditional-format/index.html b/packages/sheets-plugin-conditional-format/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-conditional-format/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-conditional-format/jest.config.js b/packages/sheets-plugin-conditional-format/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-conditional-format/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/packages/sheets-plugin-conditional-format/package.json b/packages/sheets-plugin-conditional-format/package.jsondeleted file mode 100644index 4d4817baaa..0000000000--- a/packages/sheets-plugin-conditional-format/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-conditional-format",- "version": "0.0.1",- "description": "UniverSheet normal plugin conditionalFormat",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-conditional-format.cjs.js",- "module": "./lib/univer-sheets-plugin-conditional-format.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-conditional-format.cjs.js",- "default": "./lib/univer-sheets-plugin-conditional-format.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-conditional-format/src/Action/ActionConditionalFormat.ts b/packages/sheets-plugin-conditional-format/src/Action/ActionConditionalFormat.tsdeleted file mode 100644index c4dfe4af21..0000000000--- a/packages/sheets-plugin-conditional-format/src/Action/ActionConditionalFormat.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionConditionalFormat {}diff --git a/packages/sheets-plugin-conditional-format/src/Action/IAction.ts b/packages/sheets-plugin-conditional-format/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-conditional-format/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-conditional-format/src/Action/IActionSet.ts b/packages/sheets-plugin-conditional-format/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-conditional-format/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-conditional-format/src/Action/index.ts b/packages/sheets-plugin-conditional-format/src/Action/index.tsdeleted file mode 100644index c53eec62bc..0000000000--- a/packages/sheets-plugin-conditional-format/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionConditionalFormat';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-conditional-format/src/Assets/CFcolorGradation.png b/packages/sheets-plugin-conditional-format/src/Assets/CFcolorGradation.pngdeleted file mode 100644index b094ab2739..0000000000Binary files a/packages/sheets-plugin-conditional-format/src/Assets/CFcolorGradation.png and /dev/null differdiff --git a/packages/sheets-plugin-conditional-format/src/Assets/CFdataBar.png b/packages/sheets-plugin-conditional-format/src/Assets/CFdataBar.pngdeleted file mode 100644index 157c0d5b0e..0000000000Binary files a/packages/sheets-plugin-conditional-format/src/Assets/CFdataBar.png and /dev/null differdiff --git a/packages/sheets-plugin-conditional-format/src/Assets/CFicons.png b/packages/sheets-plugin-conditional-format/src/Assets/CFicons.pngdeleted file mode 100644index 131a526dd6..0000000000Binary files a/packages/sheets-plugin-conditional-format/src/Assets/CFicons.png and /dev/null differdiff --git a/packages/sheets-plugin-conditional-format/src/Base/Cache.ts b/packages/sheets-plugin-conditional-format/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-conditional-format/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-conditional-format/src/Base/State.ts b/packages/sheets-plugin-conditional-format/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-conditional-format/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-conditional-format/src/Base/index.ts b/packages/sheets-plugin-conditional-format/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-conditional-format/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-conditional-format/src/ConditionalFormatPlugin.tsx b/packages/sheets-plugin-conditional-format/src/ConditionalFormatPlugin.tsxdeleted file mode 100644index e50156b4a4..0000000000--- a/packages/sheets-plugin-conditional-format/src/ConditionalFormatPlugin.tsx+++ /dev/null@@ -1,57 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { en, zh } from './Locale';-import { ConditionalFormatButton } from './UI/ConditionalFormatButton';--import { IConfig } from './IData/IConditionalFormat';-import { CONDITIONAL_FORMAT_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface IConditionalFormatPluginConfig {}--export class ConditionalFormatPlugin extends Plugin {- SheetPlugin: any;-- constructor(config?: IConditionalFormatPluginConfig) {- super(CONDITIONAL_FORMAT_PLUGIN_NAME);- }-- static create(config?: IConditionalFormatPluginConfig) {- return new ConditionalFormatPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: CONDITIONAL_FORMAT_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <ConditionalFormatButton config={config} />,- };- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend comment- this.sheetPlugin?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-conditional-format/src/ConditionalFormatRule.ts b/packages/sheets-plugin-conditional-format/src/ConditionalFormatRule.tsdeleted file mode 100644index 02befe7161..0000000000--- a/packages/sheets-plugin-conditional-format/src/ConditionalFormatRule.ts+++ /dev/null@@ -1,44 +0,0 @@-import { IRangeData, Nullable } from '@univerjs/core';-import { ConditionalFormatRuleBuilder } from './ConditionalFormatRuleBuilder';-import { BooleanRule, GradientRule } from './IData/IConditionalFormatRule';--export class ConditionalFormatRule {- private _ranges: IRangeData[];-- private _rule: BooleanRule | GradientRule;-- constructor(ranges: IRangeData[], rule: BooleanRule | GradientRule) {- this._ranges = ranges;- this._rule = rule;- }-- /**- * Returns a rule builder preset with this rule's settings.- */- copy(): ConditionalFormatRuleBuilder {- return new ConditionalFormatRuleBuilder(this._ranges, this._rule);- }-- /**- * Retrieves the rule's BooleanCondition information if this rule uses boolean condition criteria. Otherwise returns null.- */- getBooleanCondition(): Nullable<BooleanRule> {- if ('minpoint' in this._rule) return null;- return this._rule;- }-- /**- * Retrieves the rule's GradientCondition information, if this rule uses gradient condition criteria. Otherwise returns null.- */- getGradientCondition(): Nullable<GradientRule> {- if ('condition' in this._rule) return null;- return this._rule;- }-- /**- * Retrieves the ranges to which this conditional format rule is applied.- */- getRanges(): IRangeData[] {- return this._ranges;- }-}diff --git a/packages/sheets-plugin-conditional-format/src/ConditionalFormatRuleBuilder.ts b/packages/sheets-plugin-conditional-format/src/ConditionalFormatRuleBuilder.tsdeleted file mode 100644index 5d88014369..0000000000--- a/packages/sheets-plugin-conditional-format/src/ConditionalFormatRuleBuilder.ts+++ /dev/null@@ -1,698 +0,0 @@-// import { ConditionType, InterpolationPointType, Range, IRangeData, IStyleData, Nullable, RelativeDate } from '@univerjs/core';-// import { ConditionalFormatRule } from './ConditionalFormatRule';-// import { BooleanCondition, BooleanRule, ConditionValue, GradientRule, InterpolationPoint } from './IData/IConditionalFormatRule';--// export class ConditionalFormatRuleBuilder {-// private _ranges: IRangeData[];--// private _booleanRule: BooleanRule;--// private _gradientRule: GradientRule;--// private _format: IStyleData;--// private _condition: BooleanCondition;--// private _maxPoint: InterpolationPoint;--// private _minPoint: InterpolationPoint;--// private _midPoint: Nullable<InterpolationPoint>;--// /**-// * get condition of date format-// */-// private _getDate = (type: ConditionType, date: RelativeDate | Date) => {-// let value: ConditionValue;-// if (typeof date === 'object') {-// value = {-// userEnteredValue: (+date).toString(),-// };-// } else {-// value = {-// relativeDate: date,-// };-// }-// this._condition = {-// type,-// values: [value],-// };-// };--// private _setBooleanRule() {-// this._booleanRule = {-// condition: this._condition,-// format: this._format,-// };-// }--// /**-// * get condition of text format-// */-// private _getText(type: ConditionType, value: string) {-// this._condition = {-// type,-// values: [-// {-// userEnteredValue: value,-// },-// ],-// };-// }--// /**-// * get condition of number format-// */-// private _getNumber(type: ConditionType, value: number[]) {-// const values: ConditionValue[] = [];-// for (let i = 0; i < value.length; i++) {-// values.push({-// userEnteredValue: value[i].toString(),-// });-// }-// this._condition = {-// type,-// values,-// };-// }--// constructor(ranges?: IRangeData[], rule?: BooleanRule | GradientRule) {-// this._ranges = ranges ?? [];-// if (rule) {-// if ('condition' in rule) {-// this._booleanRule = rule;-// } else {-// this._gradientRule = rule;-// }-// }-// }--// /**-// * Constructs a conditional format rule from the settings applied to the builder.-// */-// build(): ConditionalFormatRule {-// return new ConditionalFormatRule(this._ranges, this._booleanRule ?? this._gradientRule);-// }--// /**-// * Sets the background color for the conditional format rule's format. Passing in null removes the background color format setting from the rule.-// */-// setBackground(color: Nullable<string>): ConditionalFormatRuleBuilder {-// const bgColor = {-// rgb: color,-// };-// this._format.bg = bgColor;-// this._setBooleanRule();--// return this;-// }--// /**-// *-// * Sets text bolding for the conditional format rule's format. If bold is true, the rule bolds text if the condition is met; if false, the rule removes any existing bolding if the condition is met. Passing in null removes the bold format setting from the rule.-// */-// setBold(bold: Nullable<boolean>): ConditionalFormatRuleBuilder {-// if (bold === null) {-// delete this._format.bl;-// } else if (bold) {-// this._format.bl = 1;-// } else {-// this._format.bl = 0;-// }-// this._setBooleanRule();--// return this;-// }--// /**-// * Sets the font color for the conditional format rule's format. Passing in null removes the font color format setting from the rule.-// */-// setFontColor(color: Nullable<string>): ConditionalFormatRuleBuilder {-// const fontColor = {-// rgb: color,-// };-// this._format.cl = fontColor;-// this._setBooleanRule();--// return this;-// }--// /**-// * Sets text italics for the conditional format rule's format. If italic is true, the rule italicises text if the condition is met; if false, the rule removes any existing italicization if the condition is met. Passing in null removes the italic format setting from the rule.-// */-// setItalic(italic: Nullable<boolean>): ConditionalFormatRuleBuilder {-// if (italic === null) {-// delete this._format.it;-// } else if (italic) {-// this._format.it = 1;-// } else {-// this._format.it = 0;-// }-// this._setBooleanRule();--// return this;-// }--// /**-// * Sets one or more ranges to which this conditional format rule is applied. This operation replaces any existing ranges. Setting an empty array clears any existing ranges. A rule must have at least one range.-// */-// setRanges(ranges: Range[]): ConditionalFormatRuleBuilder {-// const range = [];-// for (let i = 0; i < ranges.length; i++) {-// range.push(ranges[i].getRangeData());-// }-// this._ranges = range;--// return this;-// }--// /**-// * Sets text strikethrough for the conditional format rule's format. If strikethrough is true, the rule strikesthrough text if the condition is met; if false, the rule removes any existing strikethrough formatting if the condition is met. Passing in null removes the strikethrough format setting from the rule.-// */-// setStrikethrough(strikethrough: Nullable<boolean>): ConditionalFormatRuleBuilder {-// if (!this._format.st) {-// this._format.st = { s: 1 };-// }--// if (strikethrough === null) {-// delete this._format.st;-// } else if (strikethrough) {-// this._format.st.s = 1;-// } else {-// this._format.st.s = 0;-// }-// this._setBooleanRule();--// return this;-// }--// /**-// * Sets text underlining for the conditional format rule's format. If underline is true, the rule underlines text if the condition is met; if false, the rule removes any existing underlines if the condition is met. Passing in null removes the underline format setting from the rule.-// */-// setUnderline(underline: Nullable<boolean>): ConditionalFormatRuleBuilder {-// if (!this._format.ul) {-// this._format.ul = { s: 1 };-// }--// if (underline === null) {-// delete this._format.st;-// } else if (underline) {-// this._format.ul.s = 1;-// } else {-// this._format.ul.s = 0;-// }-// this._setBooleanRule();--// return this;-// }--// /**-// * Sets the conditional format rule to trigger when the cell is empty.-// */-// whenCellEmpty(): ConditionalFormatRuleBuilder {-// const type = ConditionType.BLANK;-// this._condition = {-// type,-// };--// return this;-// }--// /**-// * Sets the conditional format rule to trigger when the cell is not empty.-// */-// whenCellNotEmpty(): ConditionalFormatRuleBuilder {-// const type = ConditionType.NOT_BLANK;-// this._condition = {-// type,-// };--// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a date is after the given value.-// */-// whenDateAfter(date: RelativeDate | Date): ConditionalFormatRuleBuilder {-// this._getDate(ConditionType.DATE_AFTER, date);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a date is before the given date.-// */-// whenDateBefore(date: RelativeDate | Date): ConditionalFormatRuleBuilder {-// this._getDate(ConditionType.DATE_BEFORE, date);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a date is equal to the given relative date.-// */-// whenDateEqualTo(date: RelativeDate | Date): ConditionalFormatRuleBuilder {-// this._getDate(ConditionType.DATE_EQ, date);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.-// */-// whenNumberBetween(start: number, end: number): ConditionalFormatRuleBuilder {-// let value: number[];-// if (start === end) {-// value = [start];-// } else if (start > end) {-// value = [end, start];-// } else {-// value = [start, end];-// }--// this._getNumber(ConditionType.NUMBER_BETWEEN, value);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number is equal to the given value.-// */-// whenNumberEqualTo(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMBER_EQ, [number]);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number is greater than the given value.-// */-// whenNumberGreaterThan(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMNUMBER_BETWEENR_GREATER, [number]);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.-// */-// whenNumberGreaterThanOrEqualTo(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMBER_GREATER_THAN_EQ, [number]);-// return this;-// }--// /**-// * Sets the conditional conditional format rule to trigger when a number less than the given value.-// */-// whenNumberLessThan(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMBER_LESS, [number]);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number less than or equal to the given value.-// */-// whenNumberLessThanOrEqualTo(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMBER_LESS_THAN_EQ, [number]);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.-// */-// whenNumberNotBetween(start: number, end: number): ConditionalFormatRuleBuilder {-// let value: number[];-// if (start === end) {-// value = [start];-// } else if (start > end) {-// value = [end, start];-// } else {-// value = [start, end];-// }--// this._getNumber(ConditionType.NUMBER_NOT_BETWEEN, value);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when a number is not equal to the given value.-// */-// whenNumberNotEqualTo(number: number): ConditionalFormatRuleBuilder {-// this._getNumber(ConditionType.NUMBER_NOT_EQ, [number]);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the given formula evaluates to true.-// */-// whenFormulaSatisfied(formula: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.CUSTOM_FORMULA, formula);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the input contains the given value.-// */-// whenTextContains(text: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.TEXT_CONTAINS, text);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the input does not contain the given value.-// */-// whenTextDoesNotContain(text: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.TEXT_NOT_CONTAINS, text);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the input ends with the given value.-// */-// whenTextEndsWith(text: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.TEXT_ENDS_WITH, text);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the input is equal to the given value.-// */-// whenTextEqualTo(text: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.TEXT_EQ, text);-// return this;-// }--// /**-// * Sets the conditional format rule to trigger when that the input starts with the given value.-// */-// whenTextStartsWith(text: string): ConditionalFormatRuleBuilder {-// this._getText(ConditionType.TEXT_STARTS_WITH, text);-// return this;-// }--// /**-// * Sets the conditional format rule to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing rule.-// */-// withCriteria(criteria: ConditionType, args: ConditionValue[]): ConditionalFormatRuleBuilder {-// this._condition = {-// type: criteria,-// values: args,-// };-// return this;-// }--// /**-// * Clears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges. Also sets the gradient's maxpoint color to the input color.-// */-// setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder {-// this._maxPoint = {-// colorStyle: {-// rgb: color,-// },-// };--// return this;-// }--// /**-// * Sets the conditional format rule's gradient maxpoint fields.-// */-// setGradientMaxpointWithValue(color: string, type: InterpolationPointType, value: string): ConditionalFormatRuleBuilder {-// this._maxPoint = {-// colorStyle: {-// rgb: color,-// },-// type,-// value,-// };--// return this;-// }--// /**-// * Sets the conditional format rule's gradient midpoint fields. Clears all of the midpoint fields if the passed in interpolation type is null.-// */-// setGradientMidpointWithValue(color: string, type: Nullable<InterpolationPointType>, value: string): ConditionalFormatRuleBuilder {-// if (!type) {-// this._midPoint = null;-// } else {-// this._midPoint = {-// colorStyle: {-// rgb: color,-// },-// type,-// value,-// };-// }--// return this;-// }--// /**-// * Clears the conditional format rule's gradient minpoint value, and instead uses the minimum value in the rule's ranges. Also sets the gradient's minpoint color to the input color.-// */-// setGradientMinpoint(color: string): ConditionalFormatRuleBuilder {-// this._minPoint = {-// colorStyle: {-// rgb: color,-// },-// };--// return this;-// }--// /**-// * Sets the conditional format rule's gradient minpoint fields.-// */-// setGradientMinpointWithValue(color: string, type: InterpolationPointType, value: string): ConditionalFormatRuleBuilder {-// this._minPoint = {-// colorStyle: {-// rgb: color,-// },-// type,-// value,-// };--// return this;-// }-// }--// // /**-// // * Creates a builder for a conditional formatting rule.-// // */-// // newConditionalFormatRule(): ConditionalFormatRuleBuilder {-// // return new ConditionalFormatRuleBuilder();-// // }--// // /**-// // * Get all conditional format rules in this sheet.-// // */-// // getConditionalFormatRules(): ConditionalFormatRule[] {-// // const condition = this._config.conditionalFormats;-// // const rules = [];-// // for (let i = 0; i < condition.length; i++) {-// // rules.push(-// // new ConditionalFormatRule(condition[i].ranges, condition[i].rule)-// // );-// // }-// // return rules;-// // }--// // /**-// // * Replaces all currently existing conditional format rules in the sheet with the input rules. Rules are evaluated in their input order.-// // */-// // setConditionalFormatRules(rules: ConditionalFormatRule[]) {-// // let ruleRange: IRangeData[] = [];-// // for (let i = 0; i < rules.length; i++) {-// // const rule = rules[i];-// // const rangeList = rule.getRanges();-// // const booleanConditon = rule.getBooleanCondition();-// // const gradientCondition = rule.getGradientCondition();--// // if (booleanConditon) {-// // ruleRange = this._setBooleanCondtionRange(-// // ruleRange,-// // rangeList,-// // booleanConditon-// // );-// // } else if (gradientCondition) {-// // ruleRange = this._setGradientContionRange(-// // ruleRange,-// // rangeList,-// // gradientCondition-// // );-// // }-// // }-// // }--// // private _setBooleanCondtionRange = (-// // ranges: IRangeData[],-// // rangeList: IRangeData[],-// // booleanRule: BooleanRule-// // ) => {-// // const map = new Map([-// // [-// // ConditionType.CONDITION_TYPE_UNSPECIFIED,-// // (cell: Nullable<ICellData>, values?: ConditionValue[]) => true,-// // ],-// // [ConditionType.BLANK, (cell) => !cell || cell.m === ''],-// // [ConditionType.NOT_BLANK, (cell) => !!cell && !!cell.m],-// // [-// // ConditionType.DATE_AFTER,-// // (cell, values) => {-// // values = values!;-// // if (cell && cell.fm && cell.fm.t === FormatType.DATE) {-// // if ('relativeDate' in values[0]) {-// // } else {-// // if (cell.v && cell.v > values[0].userEnteredValue!) {-// // return true;-// // }-// // }-// // }-// // return false;-// // },-// // ],-// // [-// // ConditionType.DATE_BEFORE,-// // (cell, values) => {-// // values = values!;-// // if (cell && cell.fm && cell.fm.t === FormatType.DATE) {-// // if ('relativeDate' in values[0]) {-// // } else {-// // if (cell.v && cell.v < values[0].userEnteredValue!) {-// // return true;-// // }-// // }-// // }-// // return false;-// // },-// // ],-// // [-// // ConditionType.DATE_EQ,-// // (cell, values) => {-// // values = values!;-// // if (cell && cell.fm && cell.fm.t === FormatType.DATE) {-// // if ('relativeDate' in values[0]) {-// // } else {-// // if (cell.v == values[0].userEnteredValue!) {-// // return true;-// // }-// // }-// // }-// // return false;-// // },-// // ],-// // [-// // ConditionType.NUMBER_BETWEEN,-// // (cell, values) =>-// // cell &&-// // cell.v &&-// // values &&-// // cell.v > values[0].userEnteredValue! &&-// // cell.v < values[1].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_EQ,-// // (cell, values) =>-// // cell && values && cell.v == values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMNUMBER_BETWEENR_GREATER,-// // (cell, values) =>-// // cell && cell.v && values && cell.v > values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_GREATER_THAN_EQ,-// // (cell, values) =>-// // cell &&-// // cell.v &&-// // values &&-// // cell.v >= values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_GREATER_THAN_EQ,-// // (cell, values) =>-// // values &&-// // cell &&-// // cell.v &&-// // cell.v >= values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_LESS,-// // (cell, values) =>-// // values && cell && cell.v && cell.v < values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_LESS_THAN_EQ,-// // (cell, values) =>-// // values &&-// // cell &&-// // cell.v &&-// // cell.v <= values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.NUMBER_NOT_BETWEEN,-// // (cell, values) =>-// // values &&-// // cell &&-// // cell.v &&-// // (cell.v < values[0].userEnteredValue! ||-// // cell.v > values[1].userEnteredValue!),-// // ],-// // [-// // ConditionType.NUMBER_NOT_EQ,-// // (cell, values) =>-// // values && cell && cell.v != values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.CUSTOM_FORMULA,-// // (cell, values) =>-// // values && cell && cell.f == values[0].userEnteredValue!,-// // ],-// // [-// // ConditionType.TEXT_CONTAINS,-// // (cell, values) =>-// // values && cell && cell.m?.includes(values[0].userEnteredValue!),-// // ],-// // [-// // ConditionType.TEXT_NOT_CONTAINS,-// // (cell, values) =>-// // values &&-// // (!cell ||-// // !cell.m ||-// // !cell.m.includes(values[0].userEnteredValue!)),-// // ],-// // [-// // ConditionType.TEXT_ENDS_WITH,-// // (cell, values) =>-// // values &&-// // cell &&-// // cell.m &&-// // new RegExp(values[0].userEnteredValue! + '$').test(cell.m),-// // ],-// // ]);--// // for (let i = 0; i < rangeList.length; i++) {-// // const range = new Range(this, rangeList[i]);-// // const matrix = range.getMatrix();-// // range.forEach((row, column) => {-// // const cell = matrix.getValue(row, column);-// // const condition = map.get(booleanRule.condition.type)!(-// // cell,-// // booleanRule.condition.values-// // );-// // if (condition) {-// // ranges.push({-// // startRow: row,-// // endRow: row,-// // startColumn: column,-// // endColumn: column,-// // });-// // }-// // });-// // }--// // return ranges;-// // };--// // private _setGradientContionRange = (-// // ranges: IRangeData[],-// // rangeList: IRangeData[],-// // booleanRule: GradientRule-// // ) => {-// // return ranges;-// // };diff --git a/packages/sheets-plugin-conditional-format/src/Conflict/ConflictConditionalFormat.ts b/packages/sheets-plugin-conditional-format/src/Conflict/ConflictConditionalFormat.tsdeleted file mode 100644index b313ae8535..0000000000--- a/packages/sheets-plugin-conditional-format/src/Conflict/ConflictConditionalFormat.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictConditionalFormat {}diff --git a/packages/sheets-plugin-conditional-format/src/Conflict/IConflict.ts b/packages/sheets-plugin-conditional-format/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-conditional-format/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-conditional-format/src/Conflict/index.ts b/packages/sheets-plugin-conditional-format/src/Conflict/index.tsdeleted file mode 100644index 013fea666d..0000000000--- a/packages/sheets-plugin-conditional-format/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictConditionalFormat';diff --git a/packages/sheets-plugin-conditional-format/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-conditional-format/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index 52c3c7173a..0000000000--- a/packages/sheets-plugin-conditional-format/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const CONDITIONAL_FORMAT_PLUGIN_NAME = 'conditionalFormat';diff --git a/packages/sheets-plugin-conditional-format/src/Const/index.ts b/packages/sheets-plugin-conditional-format/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-conditional-format/src/Domain/ConditionalFormat.ts b/packages/sheets-plugin-conditional-format/src/Domain/ConditionalFormat.tsdeleted file mode 100644index 1977a14391..0000000000--- a/packages/sheets-plugin-conditional-format/src/Domain/ConditionalFormat.ts+++ /dev/null@@ -1 +0,0 @@-export class ConditionalFormat {}diff --git a/packages/sheets-plugin-conditional-format/src/Domain/index.ts b/packages/sheets-plugin-conditional-format/src/Domain/index.tsdeleted file mode 100644index d120ca01fb..0000000000--- a/packages/sheets-plugin-conditional-format/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ConditionalFormat';diff --git a/packages/sheets-plugin-conditional-format/src/Enum/index.ts b/packages/sheets-plugin-conditional-format/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormat.ts b/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormat.tsdeleted file mode 100644index a809ef3796..0000000000--- a/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormat.ts+++ /dev/null@@ -1,4 +0,0 @@-export type IConfig = {};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormatRule.ts b/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormatRule.tsdeleted file mode 100644index 1589df4916..0000000000--- a/packages/sheets-plugin-conditional-format/src/IData/IConditionalFormatRule.ts+++ /dev/null@@ -1,52 +0,0 @@-import { ConditionType, IColor, IColorStyle, InterpolationPointType, IRangeData, IStyleData, RelativeDate } from '@univerjs/core';--/**- * The value of the condition.- */-export type ConditionValue = {- relativeDate?: RelativeDate;- userEnteredValue?: string;-};--/**- * A condition that can evaluate to true or false. BooleanConditions are used by conditional formatting, data validation, and the criteria in filters.- */-export type BooleanCondition = {- type: ConditionType;- values?: ConditionValue[];-};--/**- * A rule that may or may not match, depending on the condition.- */-export type BooleanRule = {- condition: BooleanCondition;- format: IStyleData;-};--/**- * A single interpolation point on a gradient conditional format. These pin the gradient color scale according to the color, type and value chosen.- */-export type InterpolationPoint = {- color?: IColor;- colorStyle?: IColorStyle;- type?: InterpolationPointType;- value?: string;-};--/**- * A rule that applies a gradient color scale format, based on the interpolation points listed. The format of a cell will vary based on its contents as compared to the values of the interpolation points.- */-export type GradientRule = {- minpoint: InterpolationPoint;- midpoint?: InterpolationPoint;- maxpoint: InterpolationPoint;-};--/**- * A rule describing a conditional format.- */-export interface IConditionalFormatRule {- ranges: IRangeData[];- rule: BooleanRule | GradientRule;-}diff --git a/packages/sheets-plugin-conditional-format/src/IData/index.ts b/packages/sheets-plugin-conditional-format/src/IData/index.tsdeleted file mode 100644index b1a7550367..0000000000--- a/packages/sheets-plugin-conditional-format/src/IData/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './IConditionalFormat';-export * from './IConditionalFormatRule';diff --git a/packages/sheets-plugin-conditional-format/src/Locale/en.ts b/packages/sheets-plugin-conditional-format/src/Locale/en.tsdeleted file mode 100644index da7db551a6..0000000000--- a/packages/sheets-plugin-conditional-format/src/Locale/en.ts+++ /dev/null@@ -1,222 +0,0 @@-export default {- conditionalformat: {- conditionalFormatLabel: 'Conditional Format',- conditionalformat_greaterThan: 'Conditionalformat-GreaterThan',- conditionalformat_greaterThan_title: 'Format cells greater than',- conditionalformat_lessThan: 'Conditionalformat-LessThan',- conditionalformat_lessThan_title: 'Format cells smaller than',- conditionalformat_betweenness: 'Conditionalformat-Betweenness',- conditionalformat_betweenness_title: 'Format cells with values between',- conditionalformat_equal: 'Conditionalformat-Equal',- conditionalformat_equal_title: 'Format cells equal to',- conditionalformat_textContains: 'Conditionalformat-TextContains',- conditionalformat_textContains_title: 'Format cells containing the following text',- conditionalformat_occurrenceDate: 'Conditionalformat-OccurrenceDate',- conditionalformat_occurrenceDate_title: 'Format cells containing the following dates',- conditionalformat_duplicateValue: 'Conditionalformat-DuplicateValue',- conditionalformat_duplicateValue_title: 'Format cells containing the following types of values',- conditionalformat_top10: 'Conditionalformat-Top10',- conditionalformat_top10_percent: 'Conditionalformat-Top10%',- conditionalformat_top10_title: 'Format the cells with the highest value',- conditionalformat_last10: 'Conditionalformat-Last10',- conditionalformat_last10_percent: 'Conditionalformat-Last10%',- conditionalformat_last10_title: 'Format the cells with the smallest value',- conditionalformat_AboveAverage: 'Conditionalformat-AboveAverage',- conditionalformat_AboveAverage_title: 'Format cells above average',- conditionalformat_SubAverage: 'Conditionalformat-SubAverage',- conditionalformat_SubAverage_title: 'Format cells below average',- rule: 'Rule',- newRule: 'New rule',- editRule: 'Edit rule',- deleteRule: 'Delete rule',- deleteCellRule: 'Delete cell rule',- deleteSheetRule: 'Delete sheet rule',- manageRules: 'Management rules',- showRules: 'Show its formatting rules',- highlightCellRules: 'Highlight cell rules',- itemSelectionRules: 'Item selection rules',- conditionalformatManageRules: 'Conditional Formatting Rule Manager',- format: 'Format',- setFormat: 'Set format',- setAs: 'Set as',- setAsByArea: 'For the selected area, set to',- applyRange: 'Apply range',- selectRange: 'Select application range',- selectRange_percent: 'Percentage of selected range',- selectRange_average: 'Average value of selected range',- selectRange_value: 'Value in the selected range',- pleaseSelectRange: 'Please select application range',- selectDataRange: 'Select data range',- selectCell: 'select cell',- pleaseSelectCell: 'Please select cell',- pleaseSelectADate: 'Please select a date',- pleaseEnterInteger: 'Please enter an integer between 1 and 1000',- onlySingleCell: 'Only a single cell can be referenced',- conditionValueCanOnly: 'The condition value can only be a number or a single cell',- ruleTypeItem1: 'Format all cells based on their respective values',- ruleTypeItem2: 'Only format cells that contain',- ruleTypeItem2_title: 'Only for cells that meet the following conditions',- ruleTypeItem3: 'Format only the top or bottom numbers',- ruleTypeItem3_title: 'Is the value in the following ranking',- ruleTypeItem4: 'Format only values above or below the average',- ruleTypeItem4_title: 'Is a value that satisfies the following conditions',- ruleTypeItem5: 'Format only unique or repeated values',- ruleTypeItem6: 'Use formulas to determine which cells to format',- formula: 'Formula',- textColor: 'Text color',- cellColor: 'Cell color',- confirm: 'Confirm',- confirmColor: 'Confirm color',- cancel: 'Cancel',- close: 'Close',- clearColorSelect: 'Clear color select',- sheet: 'Sheet',- currentSheet: 'Current Sheet',- dataBar: 'data bar',- dataBarColor: 'data bar color',- gradientDataBar_1: 'Blue-white gradient data bar',- gradientDataBar_2: 'Green-white gradient data bar',- gradientDataBar_3: 'Red-white gradient data bar',- gradientDataBar_4: 'Orange-white gradient stripes',- gradientDataBar_5: 'Light blue-white gradient stripes',- gradientDataBar_6: 'Purple-white gradient data bar',- solidColorDataBar_1: 'Blue data bar',- solidColorDataBar_2: 'Green data bar',- solidColorDataBar_3: 'Red data bar',- solidColorDataBar_4: 'Orange data bar',- solidColorDataBar_5: 'Light blue data bar',- solidColorDataBar_6: 'Purple data bar',- colorGradation: 'color gradation',- colorGradation_1: 'Green-yellow-red color gradation',- colorGradation_2: 'Red-yellow-green color gradation',- colorGradation_3: 'Green-white-red color gradation',- colorGradation_4: 'Red-white-green color gradation',- colorGradation_5: 'Blue-white-red color gradation',- colorGradation_6: 'Red-white-blue color gradation',- colorGradation_7: 'White-red color gradation',- colorGradation_8: 'Red-white color gradation',- colorGradation_9: 'Green-white color gradation',- colorGradation_10: 'White-green color gradation',- colorGradation_11: 'Green-yellow color gradation',- colorGradation_12: 'Yellow-green color gradation',- icons: 'icons',- pleaseSelectIcon: 'Please click to select a group of icons:',- cellValue: 'Cell value',- specificText: 'Specific text',- occurrence: {- text: 'Date',- example: 'YTD',- },- greaterThan: {- text: 'Greater than',- example: '>',- },- lessThan: {- text: 'Less than',- example: '<',- },- between: {- text: 'Between',- example: '[]',- },- equal: {- text: 'Equal',- example: '=',- },- in: 'In',- between2: '',- contain: 'Contain',- textContains: {- text: 'Text contains',- example: '()',- },- duplicateValue: {- text: 'Duplicate value',- example: '##',- },- uniqueValue: 'Unique value',- top: 'Top',- top10: {- text: 'Top 10',- example: 'Top 10',- },- top10_percent: {- text: 'Top 10%',- example: 'Top 10%',- },- last: 'Last',- last10: {- text: 'Last 10',- example: 'Last 10',- },- last10_percent: {- text: 'Last 10%',- example: 'Last 10%',- },- oneself: '',- above: 'Above',- aboveAverage: {- text: 'Above average',- example: 'Above',- },- below: 'Below',- belowAverage: {- text: 'Below average',- example: 'Below',- },- all: 'All',- yesterday: 'YTD',- today: 'Today',- tomorrow: 'Tomorrow',- lastWeek: 'Last week',- thisWeek: 'This week',- lastMonth: 'Last month',- thisMonth: 'This month',- lastYear: 'Last year',- thisYear: 'This year',- last7days: 'Last 7 days',- last30days: 'Last 30 days',- next7days: 'Next 7 days',- next30days: 'Next 30 days',- next60days: 'Next 60 days',- chooseRuleType: 'Choose rule type',- editRuleDescription: 'Edit rule description',- newFormatRule: 'New format rule',- editFormatRule: 'Edit format rule',- formatStyle: 'Style',- fillType: 'Fill',- color: 'Color',- twocolor: 'Two-color',- tricolor: 'Tricolor',- multicolor: 'Multi color',- grayColor: 'Gray color',- gradient: 'Gradient',- solid: 'Solid',- maxValue: 'Max value',- medianValue: 'Median value',- minValue: 'Min value',- direction: 'Direction',- threeWayArrow: 'Three-way arrow',- fourWayArrow: 'Four-way arrow',- fiveWayArrow: 'Five-way arrow',- threeTriangles: 'Three triangles',- shape: 'Shape',- threeColorTrafficLight: 'Three-color traffic light',- fourColorTrafficLight: 'Four-color traffic light',- threeSigns: 'Three signs',- greenRedBlackGradient: 'Green-red-black gradient',- rimless: 'Rimless',- bordered: 'Bordered',- mark: 'Mark',- threeSymbols: 'Three symbols',- tricolorFlag: 'Tricolor flag',- circled: 'Circled',- noCircle: 'No circle',- grade: 'Grade',- grade4: '4 Grade',- grade5: '5 Grade',- threeStars: '3 Stars',- fiveQuadrantDiagram: 'Five-quadrant diagram',- fiveBoxes: '5 Boxes',- },-};diff --git a/packages/sheets-plugin-conditional-format/src/Locale/index.ts b/packages/sheets-plugin-conditional-format/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-conditional-format/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-conditional-format/src/Locale/zh.ts b/packages/sheets-plugin-conditional-format/src/Locale/zh.tsdeleted file mode 100644index 1f8129f04d..0000000000--- a/packages/sheets-plugin-conditional-format/src/Locale/zh.ts+++ /dev/null@@ -1,223 +0,0 @@-export default {- conditionalformat: {- conditionalFormatLabel: '条件格式',- conditionalformat_greaterThan: '条件格式——大于',- conditionalformat_greaterThan_title: '为大于以下值的单元格设置格式',- conditionalformat_lessThan: '条件格式——小于',- conditionalformat_lessThan_title: '为小于以下值的单元格设置格式',- conditionalformat_betweenness: '条件格式——介于',- conditionalformat_betweenness_title: '为介于以下值的单元格设置格式',- conditionalformat_equal: '条件格式——等于',- conditionalformat_equal_title: '为等于以下值的单元格设置格式',- conditionalformat_textContains: '条件格式——文本包含',- conditionalformat_textContains_title: '为包含以下文本的单元格设置格式',- conditionalformat_occurrenceDate: '条件格式——发生日期',- conditionalformat_occurrenceDate_title: '为包含以下日期的单元格设置格式',- conditionalformat_duplicateValue: '条件格式——重复值',- conditionalformat_duplicateValue_title: '为包含以下类型值的单元格设置格式',- conditionalformat_top10: '条件格式——前 10 项',- conditionalformat_top10_percent: '条件格式——前 10%',- conditionalformat_top10_title: '为值最大的那些单元格设置格式',- conditionalformat_last10: '条件格式——最后 10 项',- conditionalformat_last10_percent: '条件格式——最后 10%',- conditionalformat_last10_title: '为值最小的那些单元格设置格式',- conditionalformat_AboveAverage: '条件格式——高于平均值',- conditionalformat_AboveAverage_title: '为高于平均值的单元格设置格式',- conditionalformat_SubAverage: '条件格式——低于平均值',- conditionalformat_SubAverage_title: '为低于平均值的单元格设置格式',- rule: '规则',- newRule: '新建规则',- editRule: '编辑规则',- deleteRule: '删除规则',- deleteCellRule: '清除所选单元格的规则',- deleteSheetRule: '清除整个工作表的规则',- manageRules: '管理规则',- showRules: '显示其格式规则',- highlightCellRules: '突出显示单元格规则',- itemSelectionRules: '项目选取规则',- conditionalformatManageRules: '条件格式规则管理器',- format: '格式',- setFormat: '设置格式',- setAs: '设置为',- setAsByArea: '针对选定区域,设置为',- applyRange: '应用范围',- selectRange: '点击选择应用范围',- selectRange_percent: '所选范围的百分比',- selectRange_average: '选定范围的平均值',- selectRange_value: '选定范围中的数值',- pleaseSelectRange: '请选择应用范围',- selectDataRange: '点击选择数据范围',- selectCell: '选择单元格',- pleaseSelectCell: '请选择单元格',- pleaseSelectADate: '请选择日期',- pleaseEnterInteger: '请输入一个介于 1 和 1000 之间的整数',- onlySingleCell: '只能对单个单元格进行引用',- conditionValueCanOnly: '条件值只能是数字或者单个单元格',- ruleTypeItem1: '基于各自值设置所有单元格的格式',- ruleTypeItem2: '只为包含以下内容的单元格设置格式',- ruleTypeItem2_title: '只为满足以下条件的单元格',- ruleTypeItem3: '仅对排名靠前或靠后的数值设置格式',- ruleTypeItem3_title: '为以下排名内的值',- ruleTypeItem4: '仅对高于或低于平均值的数值设置格式',- ruleTypeItem4_title: '为满足以下条件的值',- ruleTypeItem5: '仅对唯一值或重复值设置格式',- ruleTypeItem6: '使用公式确定要设置格式的单元格',- formula: '公式',- textColor: '文本颜色',- cellColor: '单元格颜色',- confirm: '确定',- confirmColor: '确定颜色',- cancel: '取消',- close: '关闭',- clearColorSelect: '清除颜色选择',- sheet: '表',- currentSheet: '当前工作表',- dataBar: '数据条',- dataBarColor: '数据条颜色',- gradientDataBar_1: '蓝-白渐变数据条',- gradientDataBar_2: '绿-白渐变数据条',- gradientDataBar_3: '红-白渐变数据条',- gradientDataBar_4: '橙-白渐变数据条',- gradientDataBar_5: '浅蓝-白渐变数据条',- gradientDataBar_6: '紫-白渐变数据条',- solidColorDataBar_1: '蓝色数据条',- solidColorDataBar_2: '绿色数据条',- solidColorDataBar_3: '红色数据条',- solidColorDataBar_4: '橙色数据条',- solidColorDataBar_5: '浅蓝色数据条',- solidColorDataBar_6: '紫色数据条',- colorGradation: '色阶',- colorGradation_1: '绿-黄-红色阶',- colorGradation_2: '红-黄-绿色阶',- colorGradation_3: '绿-白-红色阶',- colorGradation_4: '红-白-绿色阶',- colorGradation_5: '蓝-白-红色阶',- colorGradation_6: '红-白-蓝色阶',- colorGradation_7: '白-红色阶',- colorGradation_8: '红-白色阶',- colorGradation_9: '绿-白色阶',- colorGradation_10: '白-绿色阶',- colorGradation_11: '绿-黄色阶',- colorGradation_12: '黄-绿色阶',- icons: '图标集',- pleaseSelectIcon: '请点击选择一组图标:',- cellValue: '单元格值',- specificText: '特定文本',- occurrence: {- text: '发生日期',- example: '昨天',- },- greaterThan: {- text: '大于',- example: '>',- },- lessThan: {- text: '小于',- example: '<',- },- between: {- text: '介于',- example: '[]',- },- equal: {- text: '等于',- example: '=',- },- in: '和',- to: '到',- between2: '之间',- contain: '包含',- textContains: {- text: '文本包含',- example: '()',- },- duplicateValue: {- text: '重复值',- example: '##',- },- uniqueValue: '唯一值',- top: '前',- top10: {- text: '前 10 项',- example: '前 10 项',- },- top10_percent: {- text: '前 10%',- example: '前 10%',- },- last: '后',- last10: {- text: '后 10 项',- example: '后 10 项',- },- last10_percent: {- text: '后 10%',- example: '后 10%',- },- oneself: '个',- above: '高于',- aboveAverage: {- text: '高于平均值',- example: '高于',- },- below: '低于',- belowAverage: {- text: '低于平均值',- example: '低于',- },- all: '全部',- yesterday: '昨天',- today: '今天',- tomorrow: '明天',- lastWeek: '上周',- thisWeek: '本周',- lastMonth: '上月',- thisMonth: '本月',- lastYear: '去年',- thisYear: '本年',- last7days: '最近7天',- last30days: '最近30天',- next7days: '未来7天',- next30days: '未来30天',- next60days: '未来60天',- chooseRuleType: '选择规则类型',- editRuleDescription: '编辑规则说明',- newFormatRule: '新建格式规则',- editFormatRule: '编辑格式规则',- formatStyle: '格式样式',- fillType: '填充类型',- color: '颜色',- twocolor: '双色',- tricolor: '三色',- multicolor: '彩色',- grayColor: '灰色',- gradient: '渐变',- solid: '实心',- maxValue: '最大值',- medianValue: '中间值',- minValue: '最小值',- direction: '方向',- threeWayArrow: '三向箭头',- fourWayArrow: '四向箭头',- fiveWayArrow: '五向箭头',- threeTriangles: '3个三角形',- shape: '形状',- threeColorTrafficLight: '三色交通灯',- fourColorTrafficLight: '四色交通灯',- threeSigns: '三标志',- greenRedBlackGradient: '绿-红-黑渐变',- rimless: '无边框',- bordered: '有边框',- mark: '标记',- threeSymbols: '三个符号',- tricolorFlag: '三色旗',- circled: '有圆圈',- noCircle: '无圆圈',- grade: '等级',- grade4: '四等级',- grade5: '五等级',- threeStars: '3个星形',- fiveQuadrantDiagram: '五象限图',- fiveBoxes: '5个框',- },-};diff --git a/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-conditional-format/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-conditional-format/src/ProxyData/ProxyDataConditionalFormat.ts b/packages/sheets-plugin-conditional-format/src/ProxyData/ProxyDataConditionalFormat.tsdeleted file mode 100644index 51a28ba60d..0000000000--- a/packages/sheets-plugin-conditional-format/src/ProxyData/ProxyDataConditionalFormat.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataConditionalFormat {}diff --git a/packages/sheets-plugin-conditional-format/src/ProxyData/index.ts b/packages/sheets-plugin-conditional-format/src/ProxyData/index.tsdeleted file mode 100644index d91b8ae927..0000000000--- a/packages/sheets-plugin-conditional-format/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataConditionalFormat';diff --git a/packages/sheets-plugin-conditional-format/src/Service/ConditionalFormatService.ts b/packages/sheets-plugin-conditional-format/src/Service/ConditionalFormatService.tsdeleted file mode 100644index a33b1cda48..0000000000--- a/packages/sheets-plugin-conditional-format/src/Service/ConditionalFormatService.ts+++ /dev/null@@ -1 +0,0 @@-export class ConditionalFormatService {}diff --git a/packages/sheets-plugin-conditional-format/src/Service/index.ts b/packages/sheets-plugin-conditional-format/src/Service/index.tsdeleted file mode 100644index 61a48f2689..0000000000--- a/packages/sheets-plugin-conditional-format/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './ConditionalFormatService';diff --git a/packages/sheets-plugin-conditional-format/src/Shared/index.ts b/packages/sheets-plugin-conditional-format/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-conditional-format/src/Types/index.d.ts b/packages/sheets-plugin-conditional-format/src/Types/index.d.tsdeleted file mode 100644index aca47549ea..0000000000--- a/packages/sheets-plugin-conditional-format/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-conditional-format' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-conditional-format/src/Types/preact.d.ts b/packages/sheets-plugin-conditional-format/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-conditional-format/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-conditional-format/src/UI/ConditionContent.tsx b/packages/sheets-plugin-conditional-format/src/UI/ConditionContent.tsxdeleted file mode 100644index c608b185f6..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/ConditionContent.tsx+++ /dev/null@@ -1,350 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';-// import { IKeyValue, Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';--// import styles from './index.module.less';--// type ConditionContentProps = {-// config?: any;-// type: string;-// genre: string;-// };--// // TODO: remove IKeyValue-// type ConditionContentState = {-// condition: ConditionProps;-// setting: Record<string, LabelProps>;-// duplicateOption: LabelProps[];-// } & IKeyValue;--// type LabelProps = {-// locale?: string;-// label?: string;-// value?: string;-// };-// type ConditionProps = {-// title: string;-// subtitle: string;-// to?: string;-// prefix?: string;-// suffix?: string;-// };--// export class ConditionContent extends Component<ConditionContentProps, ConditionContentState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// greater: {-// title: {-// locale: 'conditionalformat.conditionalformat_greaterThan',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_greaterThan_title',-// },-// },-// less: {-// title: {-// locale: 'conditionalformat.conditionalformat_lessThan',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_lessThan_title',-// },-// },-// between: {-// title: {-// locale: 'conditionalformat.conditionalformat_betweenness',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_betweenness_title',-// },-// to: {-// locale: 'conditionalformat.to',-// },-// },-// equal: {-// title: {-// locale: 'conditionalformat.conditionalformat_equal',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_equal_title',-// },-// },-// text: {-// title: {-// locale: 'conditionalformat.conditionalformat_textContains',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_textContains_title',-// },-// },-// date: {-// title: {-// locale: 'conditionalformat.conditionalformat_occurrenceDate',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_occurrenceDate_title',-// },-// },-// duplicate: {-// title: {-// locale: 'conditionalformat.conditionalformat_duplicateValue',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_duplicateValue_title',-// },-// },-// top10: {-// title: {-// locale: 'conditionalformat.conditionalformat_top10',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_top10_title',-// },-// prefix: {-// locale: 'conditionalformat.top',-// },-// suffix: {-// locale: 'conditionalformat.oneself',-// },-// },-// top10_percent: {-// title: {-// locale: 'conditionalformat.conditionalformat_top10_percent',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_top10_title',-// },-// prefix: {-// locale: 'conditionalformat.top',-// },-// },-// last10: {-// title: {-// locale: 'conditionalformat.conditionalformat_last10',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_last10_title',-// },-// prefix: {-// locale: 'conditionalformat.last',-// },-// suffix: {-// locale: 'conditionalformat.oneself',-// },-// },-// last10_percent: {-// title: {-// locale: 'conditionalformat.conditionalformat_last10_percent',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_last10_title',-// },-// prefix: {-// locale: 'conditionalformat.last',-// },-// },-// above: {-// title: {-// locale: 'conditionalformat.conditionalformat_AboveAverage',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_AboveAverage_title',-// },-// },-// below: {-// title: {-// locale: 'conditionalformat.conditionalformat_SubAverage',-// },-// subtitle: {-// locale: 'conditionalformat.conditionalformat_SubAverage_title',-// },-// },-// setting: {-// setAs: {-// locale: 'conditionalformat.setAs',-// label: '',-// },-// setAreaAs: {-// locale: 'conditionalformat.setAsByArea',-// label: '',-// },-// textColor: { locale: 'conditionalformat.textColor' },-// cellColor: { locale: 'conditionalformat.cellColor' },-// },-// condition: {-// title: '',-// subtitle: '',-// to: '',-// prefix: '',-// suffix: '',-// },-// duplicateOption: [-// {-// locale: 'conditionalformat.duplicateValue.text',-// value: '',-// label: '',-// },-// {-// locale: 'conditionalformat.uniqueValue',-// value: '',-// label: '',-// },-// ],-// };-// }--// setLocale() {-// // setLocale for diffrent type of modal-// const locale = this._context.getLocale();-// const genre = this.props.genre;--// function getLabel(obj: object) {-// Object.keys(obj).forEach((item) => {-// obj[item].label = locale.get(obj[item].locale);-// });-// }--// this.setState((prevState) => {-// let { setting, condition, duplicateOption } = prevState;-// // set for condition-// let obj = prevState[genre];-// getLabel(obj);-// getLabel(setting);-// condition.title = obj.title.label;-// condition.subtitle = obj.subtitle.label;-// if (obj.to) condition.to = obj.to.label;-// if (obj.prefix) condition.prefix = obj.prefix.label;-// if (obj.suffix) condition.suffix = obj.suffix.label;--// // set for duplicateOption-// duplicateOption.forEach((item) => {-// if (item) {-// item.label = locale.get(item.locale || '');-// }-// });--// return {-// // render modal's Locale-// condition,-// duplicateOption,-// };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// pickTextColor = () => {};--// pickCellColor = () => {};--// cancelColor = () => {};--// // render different type of modal's rangepicker-// getCellRange = () => {-// const CellRangeModal = this.Render.renderFunction('CellRangeModal');-// const { type } = this.props;-// const { condition, duplicateOption, setting } = this.state;-// if (type === 'text') {-// return (-// <>-// <CellRangeModal></CellRangeModal>-// <p className={styles.setAs}>{setting.setAs.label}</p>-// </>-// );-// }-// if (type === 'between') {-// return (-// <>-// <div className={styles.conditionBetween}>-// <CellRangeModal></CellRangeModal>-// <span>{condition.to}</span>-// <CellRangeModal></CellRangeModal>-// </div>-// <p className={styles.setAs}>{setting.setAs.label}</p>-// </>-// );-// }-// if (type === 'select') {-// return (-// <>-// <select>-// {duplicateOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <p className={styles.setAs}>{setting.setAs.label}</p>-// </>-// );-// }-// if (type === 'input') {-// const Input = this.Render.renderFunction('Input');-// return (-// <>-// <div className={styles.conditionInput}>-// <span>{condition.prefix}</span>-// <Input placeholder="10" />-// <span>{condition.suffix ? condition.suffix : '%'}</span>-// </div>-// <p className={styles.setAs}>{setting.setAs.label}</p>-// </>-// );-// }-// if (type === 'none') {-// return <p>{setting.setAreaAs.label}:</p>;-// }-// };--// render(props: ConditionContentProps, state: ConditionContentState) {-// const Checkbox = this.Render.renderFunction('Checkbox');-// const ColorPicker = this.Render.renderFunction('ColorPicker');-// const { condition, setting } = state;-// return (-// <div className={styles.conditionContent}>-// <p className={styles.conditionTitle}>{condition.title}</p>-// <div className={styles.conditionSubtitle}>-// <p className={styles.setBold}>{condition.subtitle}:</p>-// {this.getCellRange()}-// </div>-// <div className={styles.colorBox}>-// <div className={styles.colorItem}>-// <Checkbox>{setting.textColor.label}</Checkbox>-// <ColorPicker color="#9c0006" onClick={this.pickTextColor} onCancel={this.cancelColor}></ColorPicker>-// </div>-// <div className={styles.colorItem}>-// <Checkbox>{setting.cellColor.label}</Checkbox>-// <ColorPicker color="#ffc7ce" onClick={this.pickCellColor} onCancel={this.cancelColor}></ColorPicker>-// </div>-// </div>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-conditional-format/src/UI/ConditionalFormatButton.tsx b/packages/sheets-plugin-conditional-format/src/UI/ConditionalFormatButton.tsxdeleted file mode 100644index db1b642ad8..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/ConditionalFormatButton.tsx+++ /dev/null@@ -1,397 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, BaseSelectProps, Component, ModalProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';--// import { IProps } from '../IData/IConditionalFormat';-// import { ConditionContent } from './ConditionContent';-// import { IconContent } from './IconContent';-// import { ImageList } from './ImageList';-// import { RuleContent } from './RuleContent';-// import { RuleManage } from './RuleManage';--// // Types for state-// interface IState {-// conditionalFormat: ConditionButtonProps;-// modalData: ModalProps[];-// }--// type ConditionButtonProps = {-// locale?: string;-// iconName?: string;-// label?: string | JSX.Element;-// value?: string;-// icon?: JSX.Element | string | null | undefined;-// type?: string;-// tooltip?: string;-// border?: boolean;-// show?: boolean;-// children?: ConditionButtonProps[];-// className?: string;-// onClick?: (...arg: any[]) => void;-// style?: JSX.CSSProperties;-// genre?: string;-// };--// export class ConditionalFormatButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: IProps) {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();-// const ConditionalFormatIcon = this.Render.renderFunction('ConditionalFormatIcon');-// const NextIcon = this.Render.renderFunction('NextIcon');-// const RightIcon = this.Render.renderFunction('RightIcon');--// // super(props);--// this.state = {-// conditionalFormat: {-// locale: 'conditionalformat.conditionalFormatLabel',-// type: 'select',-// label: <ConditionalFormatIcon />,-// icon: <NextIcon />,-// show: true,-// children: [-// {-// locale: 'conditionalformat.highlightCellRules',-// icon: <RightIcon />,-// onClick: this.showContentModal,-// children: [-// {-// locale: 'conditionalformat.greaterThan.text',-// iconName: 'conditionalformat.greaterThan.example',-// type: 'text',-// genre: 'greater',-// },-// {-// locale: 'conditionalformat.lessThan.text',-// iconName: 'conditionalformat.lessThan.example',-// type: 'text',-// genre: 'less',-// },-// {-// locale: 'conditionalformat.between.text',-// iconName: 'conditionalformat.between.example',-// type: 'between',-// genre: 'between',-// },-// {-// locale: 'conditionalformat.equal.text',-// iconName: 'conditionalformat.equal.example',-// type: 'text',-// genre: 'equal',-// },-// {-// locale: 'conditionalformat.textContains.text',-// iconName: 'conditionalformat.textContains.example',-// type: 'text',-// genre: 'text',-// },-// {-// locale: 'conditionalformat.occurrence.text',-// iconName: 'conditionalformat.occurrence.example',-// type: 'date',-// genre: 'date',-// },-// {-// locale: 'conditionalformat.duplicateValue.text',-// iconName: 'conditionalformat.duplicateValue.example',-// type: 'select',-// genre: 'duplicate',-// },-// ],-// },-// {-// locale: 'conditionalformat.itemSelectionRules',-// icon: <RightIcon />,-// onClick: this.showContentModal,-// children: [-// {-// locale: 'conditionalformat.top10.text',-// iconName: 'conditionalformat.top10.example',-// type: 'input',-// genre: 'top10',-// },-// {-// locale: 'conditionalformat.top10_percent.text',-// iconName: 'conditionalformat.top10_percent.example',-// type: 'input',-// genre: 'top10_percent',-// },-// {-// locale: 'conditionalformat.last10.text',-// iconName: 'conditionalformat.last10.example',-// type: 'input',-// genre: 'last10',-// },-// {-// locale: 'conditionalformat.last10_percent.text',-// iconName: 'conditionalformat.last10_percent.example',-// type: 'input',-// genre: 'last10_percent',-// },-// {-// locale: 'conditionalformat.aboveAverage.text',-// iconName: 'conditionalformat.aboveAverage.example',-// type: 'none',-// genre: 'above',-// },-// {-// locale: 'conditionalformat.belowAverage.text',-// iconName: 'conditionalformat.belowAverage.example',-// type: 'none',-// genre: 'below',-// },-// ],-// },-// {-// locale: 'conditionalformat.dataBar',-// icon: <RightIcon />,-// children: [-// {-// label: <ImageList config={this.props.config} type="data"></ImageList>,-// className: 'univer-image-li',-// },-// ],-// },-// {-// locale: 'conditionalformat.colorGradation',-// icon: <RightIcon />,-// children: [-// {-// label: <ImageList config={this.props.config} type="color"></ImageList>,-// className: 'univer-image-li',-// },-// ],-// },-// {-// locale: 'conditionalformat.icons',-// onClick: this.showIconModal,-// },-// {-// locale: 'conditionalformat.newRule',-// onClick: this.showRuleModal,-// border: true,-// },-// {-// locale: 'conditionalformat.deleteRule',-// icon: <RightIcon />,-// children: [-// {-// locale: 'conditionalformat.deleteSheetRule',-// },-// ],-// },-// {-// locale: 'conditionalformat.manageRules',-// onClick: this.showManageModal,-// },-// ],-// },-// modalData: [-// {-// show: false,-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'button.cancel',-// },-// ],-// children: <ConditionContent config={this.props.config} type="text" genre="greater" />,-// onCancel: () => {-// this.showModal(0, false);-// },-// },-// {-// locale: 'conditionalformat.icons',-// show: false,-// group: [-// {-// locale: 'button.cancel',-// },-// ],-// children: <IconContent config={this.props.config} />,-// onCancel: () => {-// this.showModal(1, false);-// },-// },-// {-// locale: 'conditionalformat.newFormatRule',-// show: false,-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'button.cancel',-// },-// ],-// children: <RuleContent config={this.props.config} />,-// onCancel: () => {-// this.showModal(2, false);-// },-// },-// {-// locale: 'conditionalformat.conditionalformatManageRules',-// show: false,-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'button.cancel',-// },-// ],-// children: <RuleManage config={this.props.config} />,-// onCancel: () => {-// this.showModal(3, false);-// },-// },-// ],-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.conditionalFormat;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}`);--// // set current Locale string for select-// item.children?.forEach((ele: any) => {-// if (ele.locale) {-// ele.label = locale.get(`${ele.locale}`);-// }-// if (ele.children) {-// ele.children.forEach((node: any) => {-// if (node.locale) {-// node.label = locale.get(node.locale);-// }-// if (node.iconName) {-// node.icon = locale.get(node.iconName);-// }-// });-// }-// });-// item.label = typeof item.label === 'object' ? item.label : item.children![0].label;-// // set current Locale for modal-// let { modalData } = prevState;-// modalData.forEach((ele) => {-// ele.title = ele.locale ? locale.get(ele.locale) : '';-// if (ele.group && ele.group.length) {-// ele.group.forEach((node) => {-// node.label = locale.get(node.locale!);-// });-// }-// });--// return {-// conditionalFormat: item,-// modalData,-// };-// });-// }--// // showmodal-// showModal = (index: number, isShow: boolean) => {-// this.setState((prevState) => {-// let { modalData } = prevState;--// modalData[index].show = isShow;-// return {-// modalData,-// };-// });-// };--// // show different type of modal-// showContentModal = (...a: any[]) => {-// const item = a[2].item;-// this.setState((prevState) => {-// let { modalData } = prevState;-// modalData[0].children = <ConditionContent config={this.props.config} type={item.type} genre={item.genre} />;-// modalData[0].show = true;--// return {-// modalData,-// };-// });-// };--// showRuleModal = () => {-// this.showModal(2, true);-// };--// showManageModal = () => {-// this.showModal(3, true);-// };--// showIconModal = () => {-// this.showModal(1, true);-// };--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Select = this.Render.renderFunction('Select');-// const Modal = this.Render.renderFunction('Modal');-// const { conditionalFormat, modalData } = state;-// // Set Provider for entire Container-// return (-// <>-// <Select-// tooltip={conditionalFormat.tooltip}-// key={conditionalFormat.locale}-// children={conditionalFormat.children as BaseSelectProps[]}-// label={conditionalFormat.label}-// icon={conditionalFormat.icon}-// />-// {modalData.map((item) => {-// if (!item.show) return;-// return (-// <Modal title={item.title} visible={item.show} group={item.group} onCancel={item.onCancel}>-// {item.children}-// </Modal>-// );-// })}-// </>-// );-// }-// }diff --git a/packages/sheets-plugin-conditional-format/src/UI/IconContent.tsx b/packages/sheets-plugin-conditional-format/src/UI/IconContent.tsxdeleted file mode 100644index 58ab255f04..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/IconContent.tsx+++ /dev/null@@ -1,285 +0,0 @@-import { Component } from '@univerjs/base-ui';-import { Nullable, Observer, Workbook } from '@univerjs/core';--import styles from './index.module.less';--type IconContentProps = {- config?: any;-};-type IconContentState = {- iconOption: LabelProps[];- title: Record<string, string>;-};-type LabelProps = {- title: Record<string, string>;- children: iconProps[];-};-type iconProps = {- style: string;- title: Record<string, string>;- subtitle?: Record<string, string>;-};--export class IconContent extends Component<IconContentProps, IconContentState> {- private _localeObserver: Nullable<Observer<Workbook>>;-- initialize() {- this.state = {- title: {- name: 'conditionalformat.pleaseSelectIcon',- },- iconOption: [- {- title: {- name: 'conditionalformat.direction',- },- children: [- {- style: '0 0',- title: {- name: 'threeWayArrow',- },- subtitle: {- name: 'multicolor',- },- },- {- style: '-131px 0',- title: {- name: 'threeWayArrow',- },- subtitle: {- name: 'grayColor',- },- },- {- style: '0 -20px',- title: {- name: 'threeTriangles',- },- },- {- style: '-131px -20px',- title: {- name: 'fourWayArrow',- },- subtitle: {- name: 'grayColor',- },- },- {- style: '0 -40px',- title: {- name: 'fourWayArrow',- },- subtitle: {- name: 'multicolor',- },- },- {- style: '-131px -40px',- title: {- name: 'fiveWayArrow',- },- subtitle: {- name: 'grayColor',- },- },- {- style: '0 -60px',- title: {- name: 'fiveWayArrow',- },- subtitle: {- name: 'multicolor',- },- },- ],- },- {- title: {- name: 'conditionalformat.shape',- },- children: [- {- style: '0 -80px',- title: {- name: 'threeColorTrafficLight',- },- subtitle: {- name: 'rimless',- },- },- {- style: '-131px -80px',- title: {- name: 'threeColorTrafficLight',- },- subtitle: {- name: 'bordered',- },- },- {- style: '0 -100px',- title: {- name: 'threeSigns',- },- },- {- style: '-131px -100px',- title: {- name: 'fourColorTrafficLight',- },- },- {- style: '0 -120px',- title: {- name: 'greenRedBlackGradient',- },- },- ],- },- {- title: {- name: 'conditionalformat.mark',- },- children: [- {- style: '0 -140px',- title: {- name: 'threeSymbols',- },- subtitle: {- name: 'circled',- },- },- {- style: '-131px -140px',- title: {- name: 'threeSymbols',- },- subtitle: {- name: 'noCircle',- },- },- {- style: '0 -160px',- title: {- name: 'tricolorFlag',- },- },- ],- },- {- title: {- name: 'conditionalformat.grade',- },- children: [- {- style: '0 -180px',- title: {- name: 'threeStars',- },- },- {- style: '-131px -180px',- title: {- name: 'grade4',- },- },- {- style: '0 -200px',- title: {- name: 'fiveQuadrantDiagram',- },- },- {- style: '-131px -200px',- title: {- name: 'grade5',- },- },- {- style: '0 -220px',- title: {- name: 'fiveBoxes',- },- },- ],- },- ],- };- }-- setLocale() {- const locale = this._context.getLocale();-- this.setState((prevState) => {- let { title, iconOption } = prevState;- title.label = locale.get(title.name);-- iconOption.forEach((item) => {- item.title.label = locale.get(item.title.name);- item.children.forEach((ele) => {- let subtitle = '';- if (ele.subtitle) {- subtitle = locale.get(ele.subtitle.name);- ele.title.label = `${locale.get(ele.title.name)}(${subtitle})`;- } else {- ele.title.label = locale.get(ele.title.name);- }- });- });-- return { title, iconOption };- });- }-- componentWillMount() {- this.setLocale();-- // subscribe Locale change event- this._localeObserver = this._context- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- setValue = (value: object, fn?: () => void) => {- this.setState(- (prevState) => ({- ...value,- }),- fn- );- };-- render(props: IconContentProps, state: IconContentState) {- const { iconOption, title } = state;- return (- <div className={styles.iconsContent}>- <p>{title.label}</p>- {iconOption.map((item) => (- <div>- <div className={styles.iconTitle}>{item.title!.label}</div>- <div className={styles.iconList}>- {item.children.map((ele) => (- <div className={styles.iconItem}>- <div title={ele.title.label}>- <div style={{ backgroundPosition: ele.style }}></div>- </div>- </div>- ))}- </div>- </div>- ))}- </div>- );- }-}diff --git a/packages/sheets-plugin-conditional-format/src/UI/ImageList.tsx b/packages/sheets-plugin-conditional-format/src/UI/ImageList.tsxdeleted file mode 100644index d318a3e246..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/ImageList.tsx+++ /dev/null@@ -1,232 +0,0 @@-// import { Component } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import CFcolorGradation from '../Assets/CFcolorGradation.png';-// import CFdataBar from '../Assets/CFdataBar.png';-// import styles from './index.module.less';--// type ImageListProps = {-// config?: any;-// type: string;-// };-// type ImageListState = {-// dataList: LabelProps[];-// colorList: LabelProps[];-// list: LabelProps[];-// url: string;-// };-// type LabelProps = {-// title: Record<string, string>;-// style: string;-// };--// export class ImageList extends Component<ImageListProps, ImageListState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// state = {-// dataList: [-// {-// title: {-// name: 'conditionalformat.gradientDataBar_1',-// },-// style: '0 0',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_2',-// },-// style: '-38px 0',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_3',-// },-// style: '-76px 0',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_4',-// },-// style: '0 -36px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_5',-// },-// style: '-38px -36px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_6',-// },-// style: '-75px -36px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_7',-// },-// style: '0 -72px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_8',-// },-// style: '-38px -72px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_9',-// },-// style: '-76px -72px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_10',-// },-// style: '0 -108px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_11',-// },-// style: '-38px -108px',-// },-// {-// title: {-// name: 'conditionalformat.gradientDataBar_12',-// },-// style: '-76px -108px',-// },-// ],-// colorList: [-// {-// title: {-// name: 'colorGradation_1',-// },-// style: '0 0',-// },-// {-// title: {-// name: 'colorGradation_2',-// },-// style: '-38px 0',-// },-// {-// title: {-// name: 'colorGradation_3',-// },-// style: '-76px 0',-// },-// {-// title: {-// name: 'colorGradation_4',-// },-// style: '-114px 0',-// },-// {-// title: {-// name: 'colorGradation_5',-// },-// style: '0 -36px',-// },-// {-// title: {-// name: 'colorGradation_6',-// },-// style: '-38px -36px',-// },-// {-// title: {-// name: 'colorGradation_7',-// },-// style: '-76px -36px',-// },-// {-// title: {-// name: 'colorGradation_8',-// },-// style: '-114px -36px',-// },-// {-// title: {-// name: 'colorGradation_9',-// },-// style: '0 -72px',-// },-// {-// title: {-// name: 'colorGradation_10',-// },-// style: '-38px -72px',-// },-// {-// title: {-// name: 'colorGradation_11',-// },-// style: '-76px -72px',-// },-// {-// title: {-// name: 'colorGradation_12',-// },-// style: '-114px -72px',-// },-// ],-// list: [],-// url: '',-// };--// setLocale() {-// // setLocale for diffrent type of modal-// const locale = this._context.getLocale();--// this.setState((prevState) => {-// let { dataList, colorList, list, url } = prevState;-// const { type } = this.props;-// dataList.forEach((item) => {-// item.title.label = locale.get(item.title.name);-// });-// colorList.forEach((item) => {-// item.title.label = locale.get(item.title.name);-// });--// if (type === 'data') {-// list = dataList;-// url = CFdataBar;-// } else {-// list = colorList;-// url = CFcolorGradation;-// }--// return { list, url };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// render(props: ImageListProps, state: ImageListState) {-// const { list, url } = state;-// return (-// <div className={styles.imageContent}>-// {list.map((item) => (-// <div>-// <div title={item.title.label} style={{ backgroundImage: `url(${url})`, backgroundPosition: item.style }}></div>-// </div>-// ))}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-conditional-format/src/UI/RuleContent.tsx b/packages/sheets-plugin-conditional-format/src/UI/RuleContent.tsxdeleted file mode 100644index d79caff058..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/RuleContent.tsx+++ /dev/null@@ -1,687 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component, joinClassNames } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import styles from './index.module.less';--// type RuleContentProps = {-// config?: any;-// };-// type RuleContentState = {-// ruleOption: LabelProps[];-// title: Record<string, LabelProps>;-// type: string;-// };-// type LabelProps = {-// name?: string;-// label?: string;-// value?: string;-// active?: boolean;-// type?: string;-// };--// export class RuleContent extends Component<RuleContentProps, RuleContentState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// title: {-// chooseTitle: {-// name: 'conditionalformat.chooseRuleType',-// },-// editTitle: {-// name: 'conditionalformat.editRuleDescription',-// },-// },-// ruleOption: [-// {-// name: 'conditionalformat.ruleTypeItem1',-// type: 'all',-// active: true,-// },-// {-// name: 'conditionalformat.ruleTypeItem2',-// type: 'contain',-// },-// {-// name: 'conditionalformat.ruleTypeItem3',-// type: 'rank',-// },-// {-// name: 'conditionalformat.ruleTypeItem4',-// type: 'average',-// },-// {-// name: 'conditionalformat.ruleTypeItem5',-// type: 'duplicate',-// },-// {-// name: 'conditionalformat.ruleTypeItem6',-// type: 'formula',-// },-// ],-// type: 'all',-// };-// }--// setLocale() {-// // setLocale for diffrent type of modal-// const locale = this._context.getLocale();--// function getLabel(obj: object) {-// Object.keys(obj).forEach((item) => {-// obj[item].label = locale.get(obj[item].name);-// });-// }--// this.setState((prevState) => {-// const { ruleOption, title } = prevState;-// ruleOption.forEach((item) => {-// item.label = locale.get(item.name || '');-// });--// getLabel(title);--// return { ruleOption, title };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// // choose selected rule-// handleActive = (index: number) => {-// let { ruleOption, type } = this.state;-// ruleOption.forEach((item) => {-// item.active = false;-// });-// ruleOption[index].active = true;-// type = ruleOption[index].type!;--// this.setValue({-// ruleOption,-// type,-// });-// };--// render(props: RuleContentProps, state: RuleContentState) {-// const RightIcon = this.Render.renderFunction('RightIcon');-// const { ruleOption, title, type } = state;-// const { config } = props;-// return (-// <div className={styles.ruleContent}>-// <div>-// <p className={styles.ruleTitle}>{title.chooseTitle.label}:</p>-// <div className={styles.ruleBox}>-// {ruleOption.map((item, index) => (-// <div className={joinClassNames(styles.ruleItem, { [`${styles.ruleItem}-active`]: item.active })} onClick={() => this.handleActive(index)}>-// <RightIcon /> <span>{item.label}</span>-// </div>-// ))}-// </div>-// </div>-// <div>-// <p className={styles.ruleTitle}>{title.editTitle.label}:</p>-// <div className={styles.ruleBox}>-// <RuleEditContent type={type} config={config}></RuleEditContent>-// </div>-// </div>-// </div>-// );-// }-// }--// type RuleEditProps = {-// type: string;-// config: any;-// };-// type RuleEditState = {-// all: Record<string, LabelProps>;-// formatStyle: LabelProps[];-// formatType: string;-// containType: string;-// fillType: LabelProps[];-// fillType1: LabelProps[];-// setting: Record<string, LabelProps>;-// contain: Record<string, LabelProps>;-// rank: Record<string, LabelProps>;-// cellOption: LabelProps[];-// mathOption: LabelProps[];-// textOptions: LabelProps[];-// rankOption: LabelProps[];-// average: Record<string, LabelProps>;-// averageOption: LabelProps[];-// duplicate: Record<string, LabelProps>;-// duplicateOption: LabelProps[];-// formula: Record<string, LabelProps>;-// };--// // edit rule content-// class RuleEditContent extends Component<RuleEditProps, RuleEditState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// all: {-// title: {-// name: 'conditionalformat.ruleTypeItem1',-// },-// formatStyle: {-// name: 'conditionalformat.formatStyle',-// },-// fillType: {-// name: 'conditionalformat.fillType',-// label: '',-// },-// color: {-// name: 'conditionalformat.color',-// label: '',-// },-// max: {-// name: 'conditionalformat.maxValue',-// label: '',-// },-// min: {-// name: 'conditionalformat.minValue',-// label: '',-// },-// },-// formatStyle: [-// {-// name: 'conditionalformat.dataBar',-// },-// {-// name: 'conditionalformat.colorGradation',-// },-// {-// name: 'conditionalformat.icons',-// },-// ],-// formatType: 'dataBar',-// fillType: [-// {-// name: 'conditionalformat.gradient',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.solid',-// },-// ],-// fillType1: [-// {-// name: 'conditionalformat.twocolor',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.tricolor',-// },-// ],-// setting: {-// setAs: {-// name: 'conditionalformat.setFormat',-// },-// textColor: {-// name: 'conditionalformat.textColor',-// },-// cellColor: {-// name: 'conditionalformat.cellColor',-// },-// },-// contain: {-// title: {-// name: 'conditionalformat.ruleTypeItem2_title',-// label: '',-// },-// },-// containType: 'cellValue',-// cellOption: [-// {-// name: 'conditionalformat.cellValue',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.specificText',-// },-// {-// name: 'conditionalformat.occurrence.text',-// },-// ],-// mathOption: [-// {-// name: 'conditionalformat.greaterThan.text',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.lessThan.text',-// },-// {-// name: 'conditionalformat.between.text',-// },-// {-// name: 'conditionalformat.equal.text',-// },-// ],-// textOptions: [-// {-// name: 'conditionalformat.contain',-// label: '',-// value: '',-// },-// ],-// rank: {-// title: { name: 'conditionalformat.ruleTypeItem3_title', label: '' },-// subtitle: {-// name: 'conditionalformat.selectRange_percent',-// label: '',-// },-// },-// rankOption: [-// {-// name: 'conditionalformat.top',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.last',-// },-// ],-// average: {-// title: {-// name: 'conditionalformat.ruleTypeItem4_title',-// label: '',-// },-// subtitle: {-// name: 'conditionalformat.selectRange_average',-// label: '',-// },-// },-// averageOption: [-// {-// name: 'conditionalformat.above',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.below',-// },-// ],-// duplicate: {-// title: {-// name: 'conditionalformat.all',-// label: '',-// },-// subtitle: {-// name: 'conditionalformat.selectRange_value',-// label: '',-// },-// },-// duplicateOption: [-// {-// name: 'conditionalformat.duplicateValue.text',-// label: '',-// value: '',-// },-// {-// name: 'conditionalformat.uniqueValue',-// },-// ],-// formula: {-// title: {-// name: 'conditionalformat.ruleTypeItem2_title',-// label: '',-// },-// },-// };-// }--// setLocale() {-// // setLocale for diffrent type of modal-// const locale = this._context.getLocale();-// const { type } = this.props;-// // set Locale for object-// function getLabel(obj: object) {-// Object.keys(obj).forEach((item) => {-// obj[item].label = locale.get(obj[item].name);-// });-// }-// // set Locale for array-// function getArrayLabel(arr: LabelProps[]) {-// return arr.map((item) => {-// item.label = locale.get(item.name || '');-// return item;-// });-// }-// this.setState((prevState) => {-// let {-// all,-// formatStyle,-// fillType,-// fillType1,-// setting,-// cellOption,-// mathOption,-// textOptions,-// rankOption,-// rank,-// contain,-// average,-// averageOption,-// duplicate,-// duplicateOption,-// formula,-// } = prevState;-// getLabel(all);-// getLabel(setting);-// getLabel(rank);-// getLabel(contain);-// getLabel(average);-// getLabel(duplicate);-// getLabel(formula);-// formatStyle = getArrayLabel(formatStyle);-// fillType = getArrayLabel(fillType);-// fillType1 = getArrayLabel(fillType1);-// cellOption = getArrayLabel(cellOption);-// mathOption = getArrayLabel(mathOption);-// textOptions = getArrayLabel(textOptions);-// rankOption = getArrayLabel(rankOption);-// averageOption = getArrayLabel(averageOption);-// duplicateOption = getArrayLabel(duplicateOption);--// return {-// all,-// formatStyle,-// fillType,-// fillType1,-// setting,-// cellOption,-// mathOption,-// textOptions,-// rank,-// contain,-// rankOption,-// average,-// averageOption,-// duplicate,-// duplicateOption,-// formula,-// };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// // render content for type of all-// getAllTypeContent = () => {-// const { formatType, fillType, all, fillType1 } = this.state;--// if (formatType === 'dataBar') {-// return (-// <>-// <div className={styles.ruleEditItem}>-// <span>{all.fillType.label}:</span>-// <select>-// {fillType.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// </div>-// <div className={styles.ruleEditItem}>-// <span>{all.color.label}:</span>-// </div>-// </>-// );-// }-// if (formatType === 'colorGradation') {-// return (-// <>-// <div>-// <span>{all.fillType.label}</span>-// <select>-// {fillType1.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// </div>-// <div className={styles.ruleEditItem}>-// <span>{all.color.label}:</span>-// </div>-// <div className={styles.ruleEditItem}>-// <span>{all.color.label}:</span>-// </div>-// </>-// );-// }-// if (formatType === 'icons') {-// return (-// <>-// <div>-// <span>{all.fillType.label}</span>-// </div>-// </>-// );-// }-// };--// // render content for different type-// getEditContent = () => {-// const { type } = this.props;-// if (type === 'contain') {-// const CellRangeModal = this.Render.renderFunction('CellRangeModal');--// const { cellOption, mathOption, textOptions, contain, containType } = this.state;-// return (-// <>-// <p className={styles.ruleEditTitle}>{contain.title.label}</p>-// <div className={styles.ruleEditContent}>-// <select>-// {cellOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// {containType === 'cellValue' ? (-// <>-// <select>-// {mathOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <CellRangeModal></CellRangeModal>-// </>-// ) : (-// ''-// )}-// {containType === 'specificText' ? (-// <>-// <select>-// {textOptions.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <CellRangeModal></CellRangeModal>-// </>-// ) : (-// ''-// )}-// {containType === 'occurrence' ? (-// <>-// <input type="date" />-// </>-// ) : (-// ''-// )}-// </div>-// </>-// );-// }-// if (type === 'rank') {-// const { rankOption, rank } = this.state;-// const Checkbox = this.Render.renderFunction('Checkbox');--// const Input = this.Render.renderFunction('Input');-// return (-// <>-// <p className={styles.ruleEditTitle}>{rank.title.label}</p>-// <div className={styles.ruleEditContent}>-// <select>-// {rankOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <Input />-// <Checkbox>{rank.subtitle.label}</Checkbox>-// </div>-// </>-// );-// }-// if (type === 'average') {-// const { averageOption, average } = this.state;-// return (-// <>-// <p className={styles.ruleEditTitle}>{average.title.label}</p>-// <div className={styles.ruleEditContent}>-// <select>-// {averageOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <span>{average.subtitle.label}</span>-// </div>-// </>-// );-// }-// if (type === 'duplicate') {-// const { duplicateOption, duplicate } = this.state;-// return (-// <>-// <p className={styles.ruleEditTitle}>{duplicate.title.label}</p>-// <div className={styles.ruleEditContent}>-// <select>-// {duplicateOption.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <span>{duplicate.subtitle.label}</span>-// </div>-// </>-// );-// }-// if (type === 'formula') {-// const { formula } = this.state;-// const CellRangeModal = this.Render.renderFunction('CellRangeModal');--// return (-// <>-// <p className={styles.ruleEditTitle}>{formula.title.label}</p>-// <div className={styles.ruleEditContent}>-// <CellRangeModal></CellRangeModal>-// </div>-// </>-// );-// }-// };--// pickTextColor = () => {};--// pickCellColor = () => {};--// cancelColor = () => {};--// render(props: RuleEditProps, state: RuleEditState) {-// const ColorPicker = this.Render.renderFunction('ColorPicker');-// const Checkbox = this.Render.renderFunction('Checkbox');-// const { type } = props;-// const { all, formatStyle, setting } = state;--// if (type === 'all') {-// return (-// <div className={styles.ruleEdit}>-// <p className={styles.ruleEditTitle}>{all.title.label}</p>-// <div className={styles.ruleEditItem}>-// <span>{all.formatStyle.label}:</span>-// <select>-// {formatStyle.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// </div>-// {this.getAllTypeContent()}-// </div>-// );-// }--// return (-// <div className={styles.ruleEdit}>-// <div>{this.getEditContent()}</div>-// <p className={styles.ruleEditTitle}>{setting.setAs.label}</p>-// <div className={styles.colorBox}>-// <div className={styles.colorItem}>-// <Checkbox>{setting.textColor.label}</Checkbox>-// <ColorPicker color="#9c0006" onClick={this.pickTextColor} onCancel={this.cancelColor}></ColorPicker>-// </div>-// <div className={styles.colorItem}>-// <Checkbox>{setting.cellColor.label}</Checkbox>-// <ColorPicker color="#ffc7ce" onClick={this.pickCellColor} onCancel={this.cancelColor}></ColorPicker>-// </div>-// </div>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-conditional-format/src/UI/RuleManage.tsx b/packages/sheets-plugin-conditional-format/src/UI/RuleManage.tsxdeleted file mode 100644index 8b06097523..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/RuleManage.tsx+++ /dev/null@@ -1,136 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import styles from './index.module.less';--// type RuleManageProps = {-// config?: any;-// };-// type RuleManageState = {-// title: LabelProps;-// buttons: LabelProps[];-// info: LabelProps[];-// };-// type LabelProps = {-// name?: string;-// label?: string;-// value?: string;-// active?: boolean;-// };--// export class RuleManage extends Component<RuleManageProps, RuleManageState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// title: {-// name: 'conditionalformat.showRules',-// },-// buttons: [-// {-// name: 'conditionalformat.newRule',-// },-// {-// name: 'conditionalformat.editRule',-// },-// {-// name: 'conditionalformat.deleteRule',-// },-// ],-// info: [-// {-// name: 'conditionalformat.rule',-// },-// {-// name: 'conditionalformat.format',-// },-// {-// name: 'conditionalformat.applyRange',-// },-// ],-// };-// }--// setLocale() {-// // setLocale for diffrent type of modal-// const locale = this._context.getLocale();-// // set Locale for array-// function getArrayLabel(arr: LabelProps[]) {-// return arr.map((item) => {-// item.label = locale.get(item.name || '');-// return item;-// });-// }--// this.setState((prevState) => {-// let { title, buttons, info } = prevState;-// buttons = getArrayLabel(buttons);-// info = getArrayLabel(info);--// title.label = locale.get(title.name || '');--// return { title, buttons, info };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// render(props: RuleManageProps, state: RuleManageState) {-// const { title, buttons, info } = state;-// const Button = this.Render.renderFunction('Button');--// return (-// <div className={styles.ruleManage}>-// <div>-// <span>{title.label}</span>-// <select></select>-// </div>-// <div className={styles.ruleBox}>-// <div className={styles.ruleBtn}>-// {buttons.map((item) => (-// <Button>{item.label}</Button>-// ))}-// </div>-// <div className={styles.ruleList}>-// <div className={styles.listTitle}>-// {info.map((item) => (-// <span>{item.label}</span>-// ))}-// </div>-// <div className={styles.listBox}>-// <div className={styles.listItem}></div>-// </div>-// </div>-// </div>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-conditional-format/src/UI/index.module.less b/packages/sheets-plugin-conditional-format/src/UI/index.module.lessdeleted file mode 100644index 3929ed2576..0000000000--- a/packages/sheets-plugin-conditional-format/src/UI/index.module.less+++ /dev/null@@ -1,270 +0,0 @@-.condition-content {- font-size: 12px;-- .condition-title {- font-size: 16px;- margin-bottom: 1.3em;- }-- .condition-subtitle {- p {- margin: 5px 0;- }-- .set-bold {- font-weight: bold;- }-- .cell-range-modal {- width: 50%;- }-- .condition-between {- display: flex;- justify-content: space-between;- align-items: center;-- .cell-range-modal {- width: 45%;- }- }-- select {- width: 50%;- height: 2.2em;- }-- .condition-input {- input {- width: 20%;- margin: 0 0.5em;- }- }- }-- .color-box {- border: 1px solid var(--gray-5);- padding: 0.4rem 0.8em;-- .color-item {- height: 2em;- line-height: 2em;- margin-bottom: 1em;- }- }-}--.rule-content {- font-size: 12px;-- .rule-title {- margin: 0.5rem 0;- }-- .rule-box {- border: 1px solid var(--gray-5);-- &:first-child {- margin-bottom: 1em;- }-- &:last-child {- padding: 1em;- }-- .rule-item {- padding: 0.4rem 0.5em;- cursor: pointer;-- &-active {- background-color: var(--primary-color);- color: var(--bg);- }- }-- .rule-edit {- .rule-edit-title {- font-weight: bold;- margin-bottom: 0.4em;- }-- select {- height: 2.2em;- }-- .rule-edit-item {- margin-bottom: 0.4em;-- span {- &:first-child {- margin-right: 2em;- }- }- }-- .rule-edit-content {- display: flex;- align-items: center;- margin-bottom: 1em;-- select {- margin-right: 0.5em;- }-- input {- width: auto;- height: 2.2em;- margin-right: 0.5em;- }- }-- .color-box {- border: 1px solid var(--gray-5);- padding: 0.4rem 0.8em;-- .color-item {- height: 2em;- line-height: 2em;- margin-bottom: 1em;- }- }- }- }-}--.rule-manage {- font-size: 12px;-- > div:first-child {- margin-bottom: 0.5em;- }-- .rule-box {- border: 1px solid var(--gray-5);-- .rule-btn {- padding: 0.2rem 0.4em;- border-bottom: 1px solid var(--gray-5);-- button {- margin-right: 1em;- font-size: 12px;- height: auto;- }- }-- .rule-list {- .list-title {- height: 2.2em;- padding: 0 1em;- border-bottom: 1px solid var(--gray-5);- display: flex;- align-items: center;-- span {- &:nth-of-type(1) {- width: 30%;- }-- &:nth-of-type(2) {- width: 20%;- }-- &:nth-of-type(3) {- width: 45%;- }- }- }-- .list-box {- height: 12em;- overflow-y: scroll;-- .list-item {- height: 2em;- padding: 0.2rem 1em;- border-bottom: 1px solid var(--gray-5);-- &-active {- background-color: var(--primary-color);- }- }- }- }- }-}--.icons-content {- padding: 1em;- border: 1px solid var(--gray-14);- font-size: 14px;-- p {- margin-bottom: 1em;- }-- .icon-title {- height: 1.8em;- line-height: 1.8em;- padding: 0 1em;- background-color: var(--gray-16);- }-- .icon-list {- width: 300px;- padding: 5px 0;- display: flex;- flex-wrap: wrap;-- .icon-item {- width: 50%;-- > div {- width: 145px;- height: 30px;- padding: 5px 10px;- background-color: var(--bg);- cursor: pointer;-- &:hover {- background: var(--gray-16);- }-- div {- height: 100%;- background: url('../Assets/CFicons.png');- background-size: 256px;- }- }- }- }-}--.cols-menuitem:hover,-.image-li:hover {- background-color: transparent !important;-}--.image-content {- width: 136px;- padding: 5px;- display: flex;- flex-wrap: wrap;- justify-content: space-around;-- > div {- width: 38px;- height: 36px;- padding: 5px;-- &:hover {- background-color: var(--gray-14);- }-- div {- width: 100%;- height: 100%;- background-repeat: no-repeat;- }- }-}diff --git a/packages/sheets-plugin-conditional-format/src/View/Event.ts b/packages/sheets-plugin-conditional-format/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-conditional-format/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-conditional-format/src/View/ObserverList.ts b/packages/sheets-plugin-conditional-format/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-conditional-format/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-conditional-format/src/View/Render.ts b/packages/sheets-plugin-conditional-format/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-conditional-format/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-conditional-format/src/View/index.ts b/packages/sheets-plugin-conditional-format/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-conditional-format/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-conditional-format/src/index.ts b/packages/sheets-plugin-conditional-format/src/index.tsdeleted file mode 100644index 99447c2538..0000000000--- a/packages/sheets-plugin-conditional-format/src/index.ts+++ /dev/null@@ -1,5 +0,0 @@-import { ConditionalFormatPlugin } from './ConditionalFormatPlugin';--export * from './IData';--export { ConditionalFormatPlugin };diff --git a/packages/sheets-plugin-conditional-format/src/main.tsx b/packages/sheets-plugin-conditional-format/src/main.tsxdeleted file mode 100644index b03c525228..0000000000--- a/packages/sheets-plugin-conditional-format/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new ConditionalFormatPlugin());diff --git a/packages/sheets-plugin-conditional-format/tsconfig.json b/packages/sheets-plugin-conditional-format/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-conditional-format/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-conditional-format/vite.config.ts b/packages/sheets-plugin-conditional-format/vite.config.tsdeleted file mode 100644index 4a8367d762..0000000000--- a/packages/sheets-plugin-conditional-format/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginConditionalFormat',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets--plugin-conditional-format',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-data-validation/README-zh.md b/packages/sheets-plugin-data-validation/README-zh.mddeleted file mode 100644index 63441c1bb6..0000000000--- a/packages/sheets-plugin-data-validation/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet DataValidation 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-data-validation-```--### 使用--```js-import { DataValidation } from '@univerjs/sheets-plugin-data-validation';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new DataValidation());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-data-validation/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-data-validation dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-data-validation/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-data-validation build-```diff --git a/packages/sheets-plugin-data-validation/README.md b/packages/sheets-plugin-data-validation/README.mddeleted file mode 100644index e12aaa9fed..0000000000--- a/packages/sheets-plugin-data-validation/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin DataValidation--### Installation--```shell-npm i @univerjs/sheets-plugin-data-validation-```--### Usage--```js-import { DataValidation } from '@univerjs/sheets-plugin-data-validation';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new DataValidation());-```--## 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/sheets-plugin-data-validation/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-data-validation dev-```--### Package--```-# Current directory ./packages/sheets-plugin-data-validation/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-data-validation build-```diff --git a/packages/sheets-plugin-data-validation/index.html b/packages/sheets-plugin-data-validation/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-data-validation/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-data-validation/jest.config.js b/packages/sheets-plugin-data-validation/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-data-validation/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/packages/sheets-plugin-data-validation/package.json b/packages/sheets-plugin-data-validation/package.jsondeleted file mode 100644index b3e1073309..0000000000--- a/packages/sheets-plugin-data-validation/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-data-validation",- "version": "0.0.1",- "description": "UniverSheet normal plugin dataValidation",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-data-validation.cjs.js",- "module": "./lib/univer-sheets-plugin-data-validation.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-data-validation.cjs.js",- "default": "./lib/univer-sheets-plugin-data-validation.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-data-validation/src/Action/ActionDataValidation.ts b/packages/sheets-plugin-data-validation/src/Action/ActionDataValidation.tsdeleted file mode 100644index 9b4e657cb2..0000000000--- a/packages/sheets-plugin-data-validation/src/Action/ActionDataValidation.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionDataValidation {}diff --git a/packages/sheets-plugin-data-validation/src/Action/IAction.ts b/packages/sheets-plugin-data-validation/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-data-validation/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-data-validation/src/Action/IActionSet.ts b/packages/sheets-plugin-data-validation/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-data-validation/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-data-validation/src/Action/index.ts b/packages/sheets-plugin-data-validation/src/Action/index.tsdeleted file mode 100644index f663343de7..0000000000--- a/packages/sheets-plugin-data-validation/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionDataValidation';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-data-validation/src/Base/Cache.ts b/packages/sheets-plugin-data-validation/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-data-validation/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-data-validation/src/Base/State.ts b/packages/sheets-plugin-data-validation/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-data-validation/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-data-validation/src/Base/index.ts b/packages/sheets-plugin-data-validation/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-data-validation/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-data-validation/src/Conflict/ConflictDataValidation.ts b/packages/sheets-plugin-data-validation/src/Conflict/ConflictDataValidation.tsdeleted file mode 100644index 6050bd9517..0000000000--- a/packages/sheets-plugin-data-validation/src/Conflict/ConflictDataValidation.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictDataValidation {}diff --git a/packages/sheets-plugin-data-validation/src/Conflict/IConflict.ts b/packages/sheets-plugin-data-validation/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-data-validation/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-data-validation/src/Conflict/index.ts b/packages/sheets-plugin-data-validation/src/Conflict/index.tsdeleted file mode 100644index 2b07cbb313..0000000000--- a/packages/sheets-plugin-data-validation/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictDataValidation';diff --git a/packages/sheets-plugin-data-validation/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-data-validation/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index e37ef4e61e..0000000000--- a/packages/sheets-plugin-data-validation/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const DATA_VALIDATION_PLUGIN_NAME = 'dataValidation';diff --git a/packages/sheets-plugin-data-validation/src/Const/index.ts b/packages/sheets-plugin-data-validation/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-data-validation/src/DataValidationPlugin.tsx b/packages/sheets-plugin-data-validation/src/DataValidationPlugin.tsxdeleted file mode 100644index 426dfe5fed..0000000000--- a/packages/sheets-plugin-data-validation/src/DataValidationPlugin.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { en, zh } from './Locale';-import { DataValidationButton } from './UI/DataValidationButton';--import { IConfig } from './IData/IDataValidation';-import { DATA_VALIDATION_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface IDataValidationPluginConfig {}--export class DataValidationPlugin extends Plugin {- SheetPlugin: any;-- constructor(config?: IDataValidationPluginConfig) {- super(DATA_VALIDATION_PLUGIN_NAME);- }-- static create(config?: IDataValidationPluginConfig) {- return new DataValidationPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: DATA_VALIDATION_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <DataValidationButton config={config} />,- };- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend comment- this.sheetPlugin?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-- onMapping(): void {}-}diff --git a/packages/sheets-plugin-data-validation/src/Domain/DataValidation.ts b/packages/sheets-plugin-data-validation/src/Domain/DataValidation.tsdeleted file mode 100644index 02e0042089..0000000000--- a/packages/sheets-plugin-data-validation/src/Domain/DataValidation.ts+++ /dev/null@@ -1 +0,0 @@-export class DataValidation {}diff --git a/packages/sheets-plugin-data-validation/src/Domain/index.ts b/packages/sheets-plugin-data-validation/src/Domain/index.tsdeleted file mode 100644index b57127a3ac..0000000000--- a/packages/sheets-plugin-data-validation/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './DataValidation';diff --git a/packages/sheets-plugin-data-validation/src/Enum/index.ts b/packages/sheets-plugin-data-validation/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-data-validation/src/IData/IDataValidation.ts b/packages/sheets-plugin-data-validation/src/IData/IDataValidation.tsdeleted file mode 100644index a809ef3796..0000000000--- a/packages/sheets-plugin-data-validation/src/IData/IDataValidation.ts+++ /dev/null@@ -1,4 +0,0 @@-export type IConfig = {};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-data-validation/src/IData/index.ts b/packages/sheets-plugin-data-validation/src/IData/index.tsdeleted file mode 100644index 87f5d98e31..0000000000--- a/packages/sheets-plugin-data-validation/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IDataValidation';diff --git a/packages/sheets-plugin-data-validation/src/Locale/en.ts b/packages/sheets-plugin-data-validation/src/Locale/en.tsdeleted file mode 100644index 41e56c4e40..0000000000--- a/packages/sheets-plugin-data-validation/src/Locale/en.ts+++ /dev/null@@ -1,53 +0,0 @@-export default {- dataValidation: {- dataValidationLabel: 'DataValidation',- cellRange: 'Cell range',- selectCellRange: 'Click to select a cell range',- selectCellRange2: 'Please select a range of cells',- validationCondition: 'Validation condition',- allowMultiSelect: 'Allow multiple selection',- dropdown: 'drop-down list',- checkbox: 'Checkbox',- number: 'Number',- number_integer: 'Number-integer',- number_decimal: 'Number-decimal',- text_content: 'Text-content',- text_length: 'Text-length',- date: 'Date',- validity: 'Effectiveness',- placeholder1: 'Please enter the options, separated by commas, such as 1,2,3,4,5',- placeholder2: 'Please enter content',- placeholder3: 'Numeric value, such as 10',- placeholder4: 'Please enter the specified text',- placeholder5: 'Please enter the prompt displayed when the cell is selected',- selected: 'Selected',- notSelected: 'Not selected',- between: 'Between',- notBetween: 'Not between',- equal: 'Equal',- notEqualTo: 'Not equal to',- moreThanThe: 'More than the',- lessThan: 'Less than',- greaterOrEqualTo: 'Greater or equal to',- lessThanOrEqualTo: 'Less than or equal to',- include: 'Include',- exclude: 'Exclude',- earlierThan: 'Earlier than',- noEarlierThan: 'No earlier than',- laterThan: 'Later than',- noLaterThan: 'No later than',- identificationNumber: 'Identification number',- phoneNumber: 'Phone number',- remote: 'Automatic remote acquisition option',- prohibitInput: 'Prohibit input when input data is invalid',- hintShow: 'Show prompt when the cell is selected',- deleteValidation: 'Delete validation',- tooltipInfo1: 'The drop-down list option cannot be empty',- tooltipInfo2: 'Checkbox content cannot be empty',- tooltipInfo3: 'The value entered is not a numeric type',- tooltipInfo4: 'The value 2 cannot be less than the value 1',- tooltipInfo5: 'The text content cannot be empty',- tooltipInfo6: 'The value entered is not a date type',- tooltipInfo7: 'Date 2 cannot be less than date 1',- },-};diff --git a/packages/sheets-plugin-data-validation/src/Locale/index.ts b/packages/sheets-plugin-data-validation/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-data-validation/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-data-validation/src/Locale/zh.ts b/packages/sheets-plugin-data-validation/src/Locale/zh.tsdeleted file mode 100644index afc1032cd7..0000000000--- a/packages/sheets-plugin-data-validation/src/Locale/zh.ts+++ /dev/null@@ -1,53 +0,0 @@-export default {- dataValidation: {- dataValidationLabel: '数据验证',- cellRange: '单元格范围',- selectCellRange: '点击选择单元格范围',- selectCellRange2: '请选择单元格范围',- validationCondition: '验证条件',- allowMultiSelect: '是否允许多选',- dropdown: '下拉列表',- checkbox: '复选框',- number: '数字',- number_integer: '数字-整数',- number_decimal: '数字-小数',- text_content: '文本-内容',- text_length: '文本-长度',- date: '日期',- validity: '有效性',- placeholder1: '请输入选项,以英文逗号分隔,如1,2,3,4,5',- placeholder2: '请输入内容',- placeholder3: '数值,如10',- placeholder4: '请输入指定的文本',- placeholder5: '请输入选中单元格时显示的提示语',- selected: '选择时',- notSelected: '未选择',- between: '介于',- notBetween: '不介于',- equal: '等于',- notEqualTo: '不等于',- moreThanThe: '大于',- lessThan: '小于',- greaterOrEqualTo: '大于等于',- lessThanOrEqualTo: '小于等于',- include: '包括',- exclude: '不包括',- earlierThan: '早于',- noEarlierThan: '不早于',- laterThan: '晚于',- noLaterThan: '不晚于',- identificationNumber: '身份证号码',- phoneNumber: '手机号',- remote: '自动远程获取选项',- prohibitInput: '输入数据无效时禁止输入',- hintShow: '选中单元格时显示提示语',- deleteValidation: '删除验证',- tooltipInfo1: '下拉列表选项不可为空',- tooltipInfo2: '复选框内容不可为空',- tooltipInfo3: '输入的值不是数值类型',- tooltipInfo4: '数值2不能小于数值1',- tooltipInfo5: '文本内容不能为空',- tooltipInfo6: '输入的值不是日期类型',- tooltipInfo7: '日期2不能小于日期1',- },-};diff --git a/packages/sheets-plugin-data-validation/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-data-validation/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-data-validation/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-data-validation/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-data-validation/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-data-validation/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-data-validation/src/ProxyData/ProxyDataDataValidation.ts b/packages/sheets-plugin-data-validation/src/ProxyData/ProxyDataDataValidation.tsdeleted file mode 100644index a9f218e898..0000000000--- a/packages/sheets-plugin-data-validation/src/ProxyData/ProxyDataDataValidation.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataDataValidation {}diff --git a/packages/sheets-plugin-data-validation/src/ProxyData/index.ts b/packages/sheets-plugin-data-validation/src/ProxyData/index.tsdeleted file mode 100644index 49bf042465..0000000000--- a/packages/sheets-plugin-data-validation/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataDataValidation';diff --git a/packages/sheets-plugin-data-validation/src/Service/DataValidationService.ts b/packages/sheets-plugin-data-validation/src/Service/DataValidationService.tsdeleted file mode 100644index 667f58cd4d..0000000000--- a/packages/sheets-plugin-data-validation/src/Service/DataValidationService.ts+++ /dev/null@@ -1 +0,0 @@-export class DataValidationService {}diff --git a/packages/sheets-plugin-data-validation/src/Service/index.ts b/packages/sheets-plugin-data-validation/src/Service/index.tsdeleted file mode 100644index 1865ba231f..0000000000--- a/packages/sheets-plugin-data-validation/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './DataValidationService';diff --git a/packages/sheets-plugin-data-validation/src/Shared/index.ts b/packages/sheets-plugin-data-validation/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-data-validation/src/Types/index.d.ts b/packages/sheets-plugin-data-validation/src/Types/index.d.tsdeleted file mode 100644index 5852706201..0000000000--- a/packages/sheets-plugin-data-validation/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-data-validation' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-data-validation/src/Types/preact.d.ts b/packages/sheets-plugin-data-validation/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-data-validation/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-data-validation/src/UI/DataValidationButton.tsx b/packages/sheets-plugin-data-validation/src/UI/DataValidationButton.tsxdeleted file mode 100644index 5f8732608a..0000000000--- a/packages/sheets-plugin-data-validation/src/UI/DataValidationButton.tsx+++ /dev/null@@ -1,168 +0,0 @@-// import { BaseComponentSheet, Component, IToolbarItemProps, ModalProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import { IProps } from '../IData/IDataValidation';-// import { DataValidationContent } from './DataValidationContent';-// import styles from './index.module.less';--// // Types for state-// interface IState {-// dataValidation: IToolbarItemProps;-// modalData: ModalProps[];-// tip: LabelProps[];-// }--// type LabelProps = {-// locale?: string;-// label?: string;-// };--// export class DataValidationButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// initialize(props: IProps) {-// // super(props);-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// const CheckIcon = this.Render.renderFunction('CheckIcon');--// const dataValidationState: IToolbarItemProps = {-// locale: 'dataValidation',-// type: 'single',-// label: <CheckIcon />,-// show: true,-// };--// this.state = {-// dataValidation: dataValidationState,-// tip: [-// {-// locale: 'dataValidation.tooltipInfo1',-// },-// ],-// modalData: [-// {-// locale: 'dataValidation.dataValidationLabel',-// show: false,-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'dataValidation.deleteValidation',-// },-// {-// locale: 'button.cancel',-// },-// ],-// children: <DataValidationContent config={props.config} />,-// onCancel: () => {-// this.showModal(0, false);-// },-// },-// {-// show: false,-// // children: <p>{this.state.tip[0].label}</p>,-// group: [-// {-// locale: 'button.close',-// },-// ],-// onCancel: () => {-// this.showModal(1, false);-// },-// },-// ],-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.dataValidation;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}`);--// let { modalData, tip } = prevState;-// modalData.forEach((ele) => {-// ele.title = ele.locale ? locale.get(ele.locale) : '';-// if (ele.group && ele.group.length) {-// ele.group.forEach((node) => {-// node.label = locale.get(node.locale!);-// });-// }-// });--// // tip.forEach((ele) => {-// // ele.label = Locale.get(ele.locale!);-// // });-// return {-// dataValidation: item,-// modalData,-// // tip,-// };-// });-// }--// showModal = (index: number, isShow: boolean) => {-// this.setState((prevState) => {-// let { modalData } = prevState;--// modalData[index].show = isShow;-// return {-// modalData,-// };-// });-// };--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Button = this.Render.renderFunction('Button');-// const Modal = this.Render.renderFunction('Modal');-// const { dataValidation, modalData } = state;-// // Set Provider for entire Container-// return (-// <div className={styles.singleButton}>-// <Button type="text" onClick={() => this.showModal(0, true)}>-// {dataValidation.label}-// </Button>-// {modalData.map((item, index) => {-// if (!item.show) return;-// return <Modal title={item.title} visible={item.show} group={item.group} children={item.children} onCancel={item.onCancel}></Modal>;-// })}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-data-validation/src/UI/DataValidationContent.tsx b/packages/sheets-plugin-data-validation/src/UI/DataValidationContent.tsxdeleted file mode 100644index 9ae8c7245b..0000000000--- a/packages/sheets-plugin-data-validation/src/UI/DataValidationContent.tsx+++ /dev/null@@ -1,441 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import styles from './index.module.less';--// type DataValidationProps = {-// config?: any;-// };-// type DataValidationState = {-// range: LabelProps;-// validation: LabelProps;-// options: LabelProps[];-// checkGroups: LabelProps[];-// placeholder: LabelProps[];-// checkValue: string[];-// selected: LabelProps;-// notSelected: LabelProps;-// betweenOptions: LabelProps[];-// textOptions: LabelProps[];-// validityOptions: LabelProps[];-// dateOptions: LabelProps[];-// };-// type LabelProps = {-// name?: string;-// label?: string;-// value?: string;-// checked?: boolean;-// };--// export class DataValidationContent extends Component<DataValidationProps, DataValidationState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// range: {-// name: 'dataValidation.cellRange',-// },-// validation: {-// name: 'dataValidation.validationCondition',-// },-// options: [-// {-// name: 'dataValidation.dropdown',-// value: '1',-// },-// {-// name: 'dataValidation.checkbox',-// value: '2',-// },-// {-// name: 'dataValidation.number',-// value: '3',-// },-// {-// name: 'dataValidation.number_integer',-// value: '3',-// },-// {-// name: 'dataValidation.number_decimal',-// value: '3',-// },-// {-// name: 'dataValidation.text_content',-// value: '4',-// },-// {-// name: 'dataValidation.text_length',-// value: '3',-// },-// {-// name: 'dataValidation.date',-// value: '5',-// },-// {-// name: 'dataValidation.validity',-// value: '6',-// },-// ],-// checkGroups: [-// {-// name: 'dataValidation.remote',-// value: '1',-// checked: false,-// },-// {-// name: 'dataValidation.prohibitInput',-// value: '2',-// },-// {-// name: 'dataValidation.hintShow',-// value: '3',-// },-// ],-// placeholder: [-// {-// name: 'dataValidation.placeholder5',-// label: '',-// },-// {-// name: 'dataValidation.placeholder1',-// label: '',-// },-// {-// name: 'dataValidation.placeholder2',-// label: '',-// },-// {-// name: 'dataValidation.placeholder4',-// label: '',-// },-// ],-// selected: {-// name: 'dataValidation.selected',-// label: '',-// },-// notSelected: {-// name: 'dataValidation.notSelected',-// label: '',-// },-// betweenOptions: [-// {-// name: 'dataValidation.between',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.notBetween',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.equal',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.notEqualTo',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.moreThanThe',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.lessThan',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.greaterOrEqualTo',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.lessThanOrEqualTo',-// label: '',-// value: '',-// },-// ],-// textOptions: [-// {-// name: 'dataValidation.include',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.exclude',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.equal',-// label: '',-// value: '',-// },-// ],-// dateOptions: [-// {-// name: 'dataValidation.between',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.notBetween',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.equal',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.notEqualTo',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.earlierThan',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.noEarlierThan',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.laterThan',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.noLaterThan',-// label: '',-// value: '',-// },-// ],-// validityOptions: [-// {-// name: 'dataValidation.identificationNumber',-// label: '',-// value: '',-// },-// {-// name: 'dataValidation.phoneNumber',-// label: '',-// value: '',-// },-// ],-// selectValue: '1',-// checkValue: [''],-// };-// }--// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState) => {-// let { range, validation, options, checkGroups, placeholder, selected, notSelected, betweenOptions, textOptions, validityOptions, dateOptions } = prevState;-// range.label = locale.get(range.name);-// validation.label = locale.get(validation.name);-// options.forEach((item) => {-// item.label = locale.get(item.name || '');-// });-// checkGroups.forEach((item) => {-// item.label = locale.get(item.name);-// });-// placeholder.forEach((item) => {-// item.label = locale.get(item.name);-// });-// selected.label = locale.get(selected.name);-// notSelected.label = locale.get(notSelected.name);-// betweenOptions.forEach((item) => {-// item.label = locale.get(item.name);-// });-// textOptions.forEach((item) => {-// item.label = locale.get(item.name);-// });-// validityOptions.forEach((item) => {-// item.label = locale.get(item.name);-// });-// dateOptions.forEach((item) => {-// item.label = locale.get(item.name);-// });--// return {-// range,-// validation,-// options,-// checkGroups,-// betweenOptions,-// textOptions,-// validityOptions,-// dateOptions,-// };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// handleSelect = (e: Event) => {-// const target = e.target as HTMLSelectElement;-// this.setValue({ selectValue: target.value });-// };--// // 不同验证条件显示样式-// getSelectInfo() {-// const CellRangeModal = this.Render.renderFunction('CellRangeModal');-// const Input = this.Render.renderFunction('Input');-// const { selectValue, placeholder, selected, notSelected, betweenOptions, textOptions, validityOptions, dateOptions } = this.state;-// if (selectValue === '1') {-// return <CellRangeModal placeholderProps={placeholder[1].label}></CellRangeModal>;-// }-// if (selectValue === '2') {-// return (-// <div className={styles.dataCheckbox}>-// <div>-// <span>{selected.label} ——</span>-// <Input placeholder={placeholder[2].label} />-// </div>-// <div>-// <span>{notSelected.label} ——</span>-// <Input placeholder={placeholder[2].label} />-// </div>-// </div>-// );-// }-// if (selectValue === '3') {-// return (-// <div className={styles.dataBetween}>-// <select>-// {betweenOptions.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <div>-// <Input placeholder="1" />-// <span> -- </span>-// <Input placeholder="100" />-// </div>-// </div>-// );-// }-// if (selectValue === '4') {-// return (-// <div className={styles.dataText}>-// <select>-// {textOptions.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <Input placeholder={placeholder[3].label} />-// </div>-// );-// }-// if (selectValue === '5') {-// return (-// <div className={styles.dataDate}>-// <select>-// {dateOptions.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// <div>-// <input type="date" />-// <span> - </span>-// <input type="date" />-// </div>-// </div>-// );-// }-// if (selectValue === '6') {-// return (-// <div className={styles.dataValidity}>-// <select>-// {validityOptions.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// </div>-// );-// }-// }--// checkboxHandle = (value: string[]) => {-// let { checkGroups } = this.state;-// checkGroups.forEach((item) => {-// item.checked = false;-// if (value.includes(item.value)) {-// item.checked = true;-// }-// });-// this.setValue({ checkValue: value, checkGroups });-// };--// // 选中时显示input-// getCheckInfo() {-// const Input = this.Render.renderFunction('Input');-// const { checkValue, placeholder } = this.state;-// if (checkValue.includes('3')) {-// return <Input placeholder={placeholder[0].label} />;-// }-// }--// render(props: DataValidationProps, state: DataValidationState) {-// const CellRangeModal = this.Render.renderFunction('CellRangeModal');-// const CheckboxGroup = this.Render.renderFunction('CheckboxGroup');-// const { range, validation, options, checkGroups, placeholder } = state;-// return (-// <div className={styles.dataValidation}>-// <div className={styles.boxItem}>-// <p className={styles.title}>{range.label}</p>-// <CellRangeModal></CellRangeModal>-// </div>-// <div className={styles.boxItem}>-// <p className={styles.title}>{validation.label}</p>-// <select onChange={this.handleSelect}>-// {options.map((item) => (-// <option value={item.value}>{item.label}</option>-// ))}-// </select>-// {this.getSelectInfo()}-// </div>-// <div className={styles.boxItem}>-// <CheckboxGroup options={checkGroups} onChange={this.checkboxHandle}></CheckboxGroup>-// {this.getCheckInfo()}-// </div>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-data-validation/src/UI/index.module.less b/packages/sheets-plugin-data-validation/src/UI/index.module.lessdeleted file mode 100644index e8c3a94b7b..0000000000--- a/packages/sheets-plugin-data-validation/src/UI/index.module.less+++ /dev/null@@ -1,109 +0,0 @@-.single-button {- .data-validation {- .box-item {- &:first-child {- padding-top: 0;- }-- &:last-child {- border-bottom: none;- padding-bottom: 0;- }-- padding: 1em;- border-bottom: 1px solid var(--gray-5);-- .title {- font-weight: bold;- margin-bottom: 1em;- }-- .cell-range-modal {- height: 30px;- }-- select {- width: 100%;- height: 30px;- border-color: var(--gray-5);- outline-style: none;-- & + .cell-range-modal {- margin-top: 1em;- }- }-- .checkbox-group {- flex-direction: column;-- label {- margin: 0.5em;- font-size: 12px;-- .checkbox-inner {- width: 14px;- height: 14px;- }- }- }-- .data-checkbox {- margin-top: 1em;- font-size: 12px;-- div {- span {- margin: 0.3em;- }-- &:first-child {- margin-bottom: 0.5em;- }-- input {- width: auto;- }- }- }-- .data-between {- select {- margin-top: 1em;- }-- div {- margin-top: 1em;- display: flex;- justify-content: space-between;-- input {- width: 47%;- }- }- }-- .data-text {- select {- margin: 1rem 0;- }- }-- .data-date {- select {- margin: 1rem 0;- }-- div {- display: flex;- justify-content: space-around;- }- }-- .data-validity {- select {- margin-top: 1em;- }- }- }- }-}diff --git a/packages/sheets-plugin-data-validation/src/View/Event.ts b/packages/sheets-plugin-data-validation/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-data-validation/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-data-validation/src/View/ObserverList.ts b/packages/sheets-plugin-data-validation/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-data-validation/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-data-validation/src/View/Render.ts b/packages/sheets-plugin-data-validation/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-data-validation/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-data-validation/src/View/index.ts b/packages/sheets-plugin-data-validation/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-data-validation/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-data-validation/src/index.ts b/packages/sheets-plugin-data-validation/src/index.tsdeleted file mode 100644index 080a288139..0000000000--- a/packages/sheets-plugin-data-validation/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { DataValidationPlugin } from './DataValidationPlugin';--export { DataValidationPlugin };diff --git a/packages/sheets-plugin-data-validation/src/main.tsx b/packages/sheets-plugin-data-validation/src/main.tsxdeleted file mode 100644index 0329cf9b3f..0000000000--- a/packages/sheets-plugin-data-validation/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new DataValidationPlugin());diff --git a/packages/sheets-plugin-data-validation/tsconfig.json b/packages/sheets-plugin-data-validation/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-data-validation/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-data-validation/vite.config.ts b/packages/sheets-plugin-data-validation/vite.config.tsdeleted file mode 100644index 6b02f95955..0000000000--- a/packages/sheets-plugin-data-validation/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginDataValidation',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets--plugin-data-validation',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-find/package.json b/packages/sheets-plugin-find/package.jsonindex cd3c49b66f..c33e660fc2 100644--- a/packages/sheets-plugin-find/package.json+++ b/packages/sheets-plugin-find/package.json@@ -1,68 +1,69 @@-{- "name": "@univerjs/sheets-plugin-find",- "version": "0.0.1",- "description": "UniverSheet normal plugin find",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-find.cjs.js",- "module": "./lib/univer-sheets-plugin-find.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-find.cjs.js",- "default": "./lib/univer-sheets-plugin-find.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": false,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "@univerjs/ui-plugin-sheets": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}+{+ "name": "@univerjs/sheets-plugin-find",+ "version": "0.0.1",+ "description": "UniverSheet normal plugin find",+ "keywords": [],+ "author": "DreamNum <[email protected]>",+ "license": "MIT",+ "main": "./src/index.ts",+ "module": "./src/index.ts",+ "types": "./src/Types/index.d.ts",+ "publishConfig": {+ "main": "./lib/univer-sheets-plugin-find.cjs.js",+ "module": "./lib/univer-sheets-plugin-find.js",+ "types": "./lib/index.d.ts",+ "exports": {+ ".": {+ "require": "./lib/univer-sheets-plugin-find.cjs.js",+ "default": "./lib/univer-sheets-plugin-find.js"+ },+ "./*": "./lib/*"+ },+ "access": "public"+ },+ "exports": {+ ".": "./src/index.ts",+ "./*": "./src/*"+ },+ "directories": {+ "lib": "lib"+ },+ "files": [+ "lib"+ ],+ "private": false,+ "scripts": {+ "test": "jest",+ "dev": "vite",+ "build": "tsc && vite build",+ "watch": "vite build",+ "link": "pnpm link ./",+ "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",+ "debug": "^4.3.3",+ "identity-obj-proxy": "^3.0.0",+ "jest-dev-server": "^6.1.1",+ "jest-environment-jsdom": "^29.0.3",+ "less": "^4.1.1",+ "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-render": "workspace:^0.0.1",+ "@univerjs/base-sheets": "workspace:^0.0.1",+ "@univerjs/base-ui": "workspace:^0.0.1",+ "@univerjs/common-plugin-data": "workspace:^0.0.1",+ "@univerjs/core": "workspace:^0.0.1",+ "@univerjs/ui-plugin-sheets": "workspace:^0.0.1",+ "preact": "^10.12.1",+ "@wendellhu/redi": "^0.10.0"+ }+}diff --git a/packages/sheets-plugin-find/src/Controller/FindController.ts b/packages/sheets-plugin-find/src/Controller/FindController.tsindex 7d6ea367e1..e9649dad48 100644--- a/packages/sheets-plugin-find/src/Controller/FindController.ts+++ b/packages/sheets-plugin-find/src/Controller/FindController.ts@@ -1,30 +1,36 @@-import { IToolbarItemProps } from '@univerjs/ui-plugin-sheets';-import { FIND_PLUGIN_NAME } from '../Const/PLUGIN_NAME';-import { FindPlugin } from '../FindPlugin';--export class FindController {- private _plugin: FindPlugin;-- private _findList: IToolbarItemProps;-- constructor(plugin: FindPlugin) {- this._plugin = plugin;-- this._findList = {- name: FIND_PLUGIN_NAME,- toolbarType: 1,- tooltip: 'find.findLabel',- label: {- name: 'SearchIcon',- },- show: true,- onClick: () => {- this._plugin.getFindModalController().showModal(true);- },- };- }-- getFindList() {- return this._findList;- }-}+import { IToolbarItemProps, SheetContainerUIController } from '@univerjs/ui-plugin-sheets';+import { Inject } from '@wendellhu/redi';+import { ComponentManager, Icon } from '@univerjs/base-ui';+import { FIND_PLUGIN_NAME } from '../Const/PLUGIN_NAME';+import { FindModalController } from './FindModalController';++export class FindController {+ private _findList: IToolbarItemProps;++ constructor(+ @Inject(FindModalController) private _findModalController: FindModalController,+ @Inject(SheetContainerUIController) private _uiController: SheetContainerUIController,+ @Inject(ComponentManager) private readonly _componentManager: ComponentManager+ ) {+ this._findList = {+ name: FIND_PLUGIN_NAME,+ toolbarType: 1,+ tooltip: 'find.findLabel',+ label: {+ name: 'SearchIcon',+ },+ show: true,+ onClick: () => {+ this._findModalController.showModal(true);+ },+ };+ this._componentManager.register('SearchIcon', Icon.SearchIcon);+ const toolbar = this._uiController.getToolbarController();+ toolbar.addToolbarConfig(this._findList);+ toolbar.setToolbar();+ }++ getFindList() {+ return this._findList;+ }+}diff --git a/packages/sheets-plugin-find/src/Controller/FindModalController.ts b/packages/sheets-plugin-find/src/Controller/FindModalController.tsindex 6b87adcecb..e801d6921a 100644--- a/packages/sheets-plugin-find/src/Controller/FindModalController.ts+++ b/packages/sheets-plugin-find/src/Controller/FindModalController.ts@@ -1,100 +1,95 @@-import { Nullable } from '@univerjs/core';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';-import { TextFinder } from '../Domain';-import { FindPlugin } from '../FindPlugin';-import { FindModal } from '../View/UI/FindModal';--export class FindModalController {- private _plugin: FindPlugin;-- private _findModal: FindModal;-- private _textFinder: Nullable<TextFinder>;-- constructor(plugin: FindPlugin) {- this._plugin = plugin;- this._textFinder = plugin.getTextFinder();-- this._initialize();- }-- getComponent(ref: FindModal) {- this._findModal = ref;- }-- showModal(show: boolean) {- this._findModal?.showFindModal(show);- }-- findNext(text: string) {- this._textFinder = this._plugin.getTextFinder().searchText(text);- if (!this._textFinder) return { count: 0, current: 0 };- this._textFinder.findNext();- return this._getCountInfo();- }-- findPrevious(text: string) {- this._textFinder = this._plugin.getTextFinder().searchText(text);- if (!this._textFinder) return { count: 0, current: 0 };- this._textFinder.findPrevious();- return this._getCountInfo();- }-- replaceText(text: string) {- if (!this._textFinder) return;- const replaceCount = this._textFinder.replaceWith(text);- return {- ...this._getCountInfo(),- replaceCount,- };- }-- replaceAll(text: string) {- if (!this._textFinder) return;- const replaceCount = this._textFinder.replaceAllWith(text);- return {- ...this._getCountInfo(),- replaceCount,- };- }-- matchCase(matchCase: boolean) {- if (!this._textFinder) return;- this._textFinder.matchCase(matchCase);- }-- matchEntireCell(matchEntire: boolean) {- if (!this._textFinder) return;- this._textFinder.matchEntireCell(matchEntire);- }-- private _getCountInfo() {- const count = this._textFinder?.getCount() ?? 0;- const current = this._textFinder?.getCurrentIndex() ?? 0;- return {- count,- current: current + 1,- };- }-- private _initialize() {- const sheetUIPlugin = this._plugin.getContext().getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);- const componentManager = sheetUIPlugin.getComponentManager();- componentManager.register(FindModal.name, FindModal);- sheetUIPlugin.setSlot('main', {- name: SHEET_UI_PLUGIN_NAME + FindModal.name,- component: {- name: FindModal.name,- props: {- getComponent: this.getComponent.bind(this),- findNext: this.findNext.bind(this),- findPrevious: this.findPrevious.bind(this),- replaceText: this.replaceText.bind(this),- replaceAll: this.replaceAll.bind(this),- matchCase: this.matchCase.bind(this),- matchEntireCell: this.matchEntireCell.bind(this),- },- },- });- }-}+import { ComponentManager, SlotManager } from '@univerjs/base-ui';+import { SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';+import { Inject } from '@wendellhu/redi';+import { TextFinder } from '../Domain';+import { FindModal } from '../View/UI/FindModal';++export class FindModalController {+ private _findModal: FindModal;++ constructor(+ @Inject(TextFinder) private _textFinder: TextFinder,+ @Inject(ComponentManager) private _componentManager: ComponentManager,+ @Inject(SlotManager) private readonly _slotManager: SlotManager+ ) {+ this._initialize();+ }++ getComponent(ref: FindModal) {+ this._findModal = ref;+ }++ showModal(show: boolean) {+ this._findModal?.showFindModal(show);+ }++ findNext(text: string) {+ const res = this._textFinder.searchText(text);+ if (!res) return { count: 0, current: 0 };+ this._textFinder.findNext();+ return this._getCountInfo();+ }++ findPrevious(text: string) {+ const res = this._textFinder.searchText(text);+ if (!res) return { count: 0, current: 0 };+ this._textFinder.findPrevious();+ return this._getCountInfo();+ }++ replaceText(text: string) {+ if (!this._textFinder) return;+ const replaceCount = this._textFinder.replaceWith(text);+ return {+ ...this._getCountInfo(),+ replaceCount,+ };+ }++ replaceAll(text: string) {+ if (!this._textFinder) return;+ const replaceCount = this._textFinder.replaceAllWith(text);+ return {+ ...this._getCountInfo(),+ replaceCount,+ };+ }++ matchCase(matchCase: boolean) {+ if (!this._textFinder) return;+ this._textFinder.matchCase(matchCase);+ }++ matchEntireCell(matchEntire: boolean) {+ if (!this._textFinder) return;+ this._textFinder.matchEntireCell(matchEntire);+ }++ private _getCountInfo() {+ const count = this._textFinder?.getCount() ?? 0;+ const current = this._textFinder?.getCurrentIndex() ?? 0;+ return {+ count,+ current: current + 1,+ };+ }++ private _initialize() {+ this._componentManager.register(FindModal.name, FindModal);+ this._slotManager.setSlotComponent('main', {+ name: SHEET_UI_PLUGIN_NAME + FindModal.name,+ component: {+ name: FindModal.name,+ props: {+ getComponent: this.getComponent.bind(this),+ findNext: this.findNext.bind(this),+ findPrevious: this.findPrevious.bind(this),+ replaceText: this.replaceText.bind(this),+ replaceAll: this.replaceAll.bind(this),+ matchCase: this.matchCase.bind(this),+ matchEntireCell: this.matchEntireCell.bind(this),+ },+ },+ });+ }+}diff --git a/packages/sheets-plugin-find/src/Domain/TextFind.ts b/packages/sheets-plugin-find/src/Domain/TextFind.tsindex 501a6b2423..bedfc9f50e 100644--- a/packages/sheets-plugin-find/src/Domain/TextFind.ts+++ b/packages/sheets-plugin-find/src/Domain/TextFind.ts@@ -1,332 +1,318 @@-import { Range, FormatType, IGridRange, ObjectMatrix, ICellData, Nullable, Worksheet } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { getRegExpStr } from '../Util/util';-import { FindType } from '../IData';-import { SelectSearch } from '../View/UI/FindModal';-import { FindPlugin } from '../FindPlugin';--export class TextFinder {- private _plugin: FindPlugin;-- private _text: string | FormatType;-- private _type: FindType = 'text'; // 查找类型-- private _searchRange: SelectSearch = SelectSearch.CurrentSheet; //查找范围-- private _range: IGridRange[]; // 保存匹配到的单元格range格式-- private _rangeData: IGridRange[] = []; // rangList每个单元格range格式-- private _index: number;-- private _matchCase: boolean = false; // 大小写匹配-- private _matchEntire: boolean = false; // 完全匹配-- private _useRegEx: boolean = false; // 正则匹配-- private _matchFormula: boolean = false; // 匹配公式文字-- private _startRange: Nullable<Range>; // 从这个位置后开始找-- constructor(plugin: FindPlugin) {- this._plugin = plugin;- }-- /**- * Returns all cells matching the search criteria.- */- findAll(): Nullable<TextFinder> {- this._match();- if (!this._range.length) return null;- return this;- }-- /**- * Returns the next cell matching the search criteria.- */- findNext(): Nullable<TextFinder> {- if (this._range.length === 0) return null;- this._index++;- if (this._index > this._range.length - 1) this._index = 0;- this._highlightCell(this._range[this._index]);- return this;- }-- /**- * Returns the previous cell matching the search criteria.- */- findPrevious(): Nullable<TextFinder> {- if (this._range.length === 0) return null;- this._index--;- if (this._index < 0) this._index = this._range.length - 1;- this._highlightCell(this._range[this._index]);- return this;- }-- getCount(): number {- return this._range.length;- }-- getCurrentIndex(): number {- return this._index;- }-- /**- * If true, configures the search to match the search text's case exactly, otherwise the search defaults to case-insensitive matching.- */- matchCase(matchCase: boolean): TextFinder {- this._matchCase = matchCase;- return this;- }-- /**- * If true, configures the search to match the entire contents of a cell; otherwise, the search defaults to partial matching.- */- matchEntireCell(matchEntire: boolean): TextFinder {- this._matchEntire = matchEntire;- return this;- }-- /**- * If true, configures the search to return matches that appear within formula text; otherwise cells with formulas are considered based on their displayed value.- */- matchFormulaText(matchFormulaText: boolean): TextFinder {- this._matchFormula = matchFormulaText;- return this;- }-- /**- * If true, configures the search to interpret the search string as a regular expression; otherwise the search interprets the search string as normal text.- */- useRegularExpression(useRegEx: boolean): TextFinder {- this._useRegEx = useRegEx;- return this;- }-- /**- * TODO- * 替换还需考虑编辑模式和保护模式,整个workbook- */- /**- * Replaces all matches with the specified text. Returns the number of occurrences replaced, which may be different from the number of matched cells.- */- replaceAllWith(replaceText: string): number {- if (!this._range.length) return 0;-- let count = 0;- let sheetId = this._range[0].sheetId;- let sheet = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(sheetId);- for (let i = 0; i < this._range.length; i++) {- if (sheetId !== this._range[i].sheetId) {- sheet = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(this._range[i].sheetId);- }- const range = this._range[i];- if (!sheet) continue;-- this._replaceText(sheet, range, replaceText);- count++;- }- this._range = [];- this._index = -1;-- return count;- }-- /**- * Replaces the search text in the currently matched cell with the specified text and returns the number of occurrences replaced.- */- replaceWith(replaceText: string): number {- if (!this._range.length) return 0;- const range = this._range[this._index];- const sheet = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(range.sheetId);- if (!sheet) return 0;-- this._replaceText(sheet, range, replaceText);-- this._range.splice(this._index, 1);- this._highlightCell(this._range[this._index]);- return 1;- }-- /**- * Configures the search to start searching immediately after the specified cell range.- */- startFrom(startRange: Range): TextFinder {- this._startRange = startRange;- return this;- }-- /**- * Returns the current cell matching the search criteria.- */- getCurrentMatch(): IGridRange | null {- if (this._index < 0) return null;- return this._range[this._index];- }-- // 开始查找- searchText(text: string | FormatType, type: FindType = 'text', searchRange: SelectSearch = SelectSearch.CurrentSheet): TextFinder | null {- if (!text) return null;- // 查找范围变化或者初始化rangeData- if (this._searchRange !== searchRange || !this._rangeData.length) {- this._getRange(searchRange);- }- // 查找文字或者类型变化- if (this._text !== text || this._type !== type) {- this._type = type;- this._text = text;- this._index = -1;- this.findAll();- }- return this;- }-- private _getRange(searchRange: SelectSearch) {- if (searchRange === SelectSearch.CurrentSheet) {- const sheet = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook().getActiveSheet();- const sheetId = sheet.getSheetId();- const rangeList: IGridRange = {- sheetId,- rangeData: {- startRow: 0,- endRow: sheet.getLastRow(),- startColumn: 0,- endColumn: sheet.getLastColumn(),- },- };- this._rangeData = [rangeList];- }- }-- /**- * match rule- */- private _match = () => {- const matchMap = new Map<string | FormatType, () => IGridRange[]>([- ['text', this._mathTxt.bind(this)],- // ['condition', this._matchCondition],- // ['intervalRow', () => this._matchInterval('row')],- // ['intervalColumn', () => this._matchInterval('column')],- // ['null', this._matchNull],- // ['format', this._matchFormat],- ]);- let range;- if (this._type in FormatType) {- range = matchMap.get('format')!();- } else {- range = matchMap.get(this._type)!();- }- // range.sort((a, b) => a.getRangeData().startRow - b.getRangeData().startRow).sort((a, b) => a.getRangeData().startColumn - b.getRangeData().startColumn);- // if (this._startRange) {- // const startRange = this._startRange.getRangeData();- // for (let i = 0; i < range.length; i++) {- // const cell = range[i].getRangeData();- // if (cell.startColumn <= startRange.endColumn) {- // range.splice(i, 1);- // i--;- // } else if (cell.startRow < startRange.startRow) {- // range.splice(i, 1);- // i--;- // }- // }- // }- this._range = range;- };-- // 查找文本- private _mathTxt(): IGridRange[] {- const range: IGridRange[] = [];- for (let i = 0; i < this._rangeData.length; i++) {- const sheet = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(this._rangeData[i].sheetId);- if (!sheet) return [];- let matrix: ObjectMatrix<ICellData> = new ObjectMatrix<ICellData>();- if (this._matchFormula) {- // matrix = this._rangeData[i].getValue().f;- } else {- matrix = sheet.getRange(this._rangeData[i].rangeData).getMatrix();- }-- if (this._matchEntire) {- matrix.forValue((row, col, value) => {- if (!value.m) return;- if ((this._matchCase && value.m === this._text) || (this._text as string).toLowerCase() === value.m.toLowerCase()) {- range.push({- sheetId: this._rangeData[i].sheetId,- rangeData: {- startRow: row,- endRow: row,- startColumn: col,- endColumn: col,- },- });- }- });- }- // else if (this._useRegEx) {- // let reg;- // if (this._matchCase) {- // reg = new RegExp(getRegExpStr(this._text), 'g');- // } else {- // reg = new RegExp(getRegExpStr(this._text), 'ig');- // }-- // if (reg.test(value)) {- // range.push(this._rangeData[i]);- // }- // }- else {- let reg = new RegExp(getRegExpStr(this._text as string), this._matchCase ? 'g' : 'ig');-- matrix.forValue((row, col, value) => {- if (!value.m) return;- if (reg.test(value.m)) {- reg.lastIndex = 0;- range.push({- sheetId: this._rangeData[i].sheetId,- rangeData: {- startRow: row,- endRow: row,- startColumn: col,- endColumn: col,- },- });- }- });- }- }- return range;- }-- // 高亮匹配单元格- private _highlightCell(range: IGridRange) {- if (!range) return;- this._plugin- .getContext()- .getUniver()- .getCurrentUniverSheetInstance()- .getWorkBook()- .getContext()- .getPluginManager()- .getPluginByName<SheetPlugin>('spreadsheet')- ?.getSelectionManager()- .setCurrentCell(range);- }-- private _replaceText(sheet: Worksheet, range: IGridRange, text: string) {- const value = sheet.getRange(range.rangeData).getValue();- if (!value || !value.m) return 0;- if (!this._matchEntire) {- let match;- match = 'ig';- if (this._matchCase) {- match = 'g';- }- let reg = new RegExp(getRegExpStr(this._text as string), match);- sheet.getRange(range.rangeData).setValue(value.m.replace(reg, text));- } else {- sheet.getRange(range.rangeData).setValue(text);- }- }-}+import { Range, FormatType, IGridRange, ObjectMatrix, ICellData, Nullable, Worksheet, ICurrentUniverService } from '@univerjs/core';+import { ISelectionManager, SelectionManager } from '@univerjs/base-sheets';+import { getRegExpStr } from '../Util/util';+import { FindType } from '../IData';+import { SelectSearch } from '../View/UI/FindModal';++export class TextFinder {+ private _text: string | FormatType;++ private _type: FindType = 'text'; // 查找类型++ private _searchRange: SelectSearch = SelectSearch.CurrentSheet; //查找范围++ private _range: IGridRange[]; // 保存匹配到的单元格range格式++ private _rangeData: IGridRange[] = []; // rangList每个单元格range格式++ private _index: number;++ private _matchCase: boolean = false; // 大小写匹配++ private _matchEntire: boolean = false; // 完全匹配++ private _useRegEx: boolean = false; // 正则匹配++ private _matchFormula: boolean = false; // 匹配公式文字++ private _startRange: Nullable<Range>; // 从这个位置后开始找++ constructor(@ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService, @ISelectionManager private readonly _selectionManager: SelectionManager) { }++ /**+ * Returns all cells matching the search criteria.+ */+ findAll(): Nullable<TextFinder> {+ this._match();+ if (!this._range.length) return null;+ return this;+ }++ /**+ * Returns the next cell matching the search criteria.+ */+ findNext(): Nullable<TextFinder> {+ if (this._range.length === 0) return null;+ this._index++;+ if (this._index > this._range.length - 1) this._index = 0;+ this._highlightCell(this._range[this._index]);+ return this;+ }++ /**+ * Returns the previous cell matching the search criteria.+ */+ findPrevious(): Nullable<TextFinder> {+ if (this._range.length === 0) return null;+ this._index--;+ if (this._index < 0) this._index = this._range.length - 1;+ this._highlightCell(this._range[this._index]);+ return this;+ }++ getCount(): number {+ return this._range.length;+ }++ getCurrentIndex(): number {+ return this._index;+ }++ /**+ * If true, configures the search to match the search text's case exactly, otherwise the search defaults to case-insensitive matching.+ */+ matchCase(matchCase: boolean): TextFinder {+ this._matchCase = matchCase;+ return this;+ }++ /**+ * If true, configures the search to match the entire contents of a cell; otherwise, the search defaults to partial matching.+ */+ matchEntireCell(matchEntire: boolean): TextFinder {+ this._matchEntire = matchEntire;+ return this;+ }++ /**+ * If true, configures the search to return matches that appear within formula text; otherwise cells with formulas are considered based on their displayed value.+ */+ matchFormulaText(matchFormulaText: boolean): TextFinder {+ this._matchFormula = matchFormulaText;+ return this;+ }++ /**+ * If true, configures the search to interpret the search string as a regular expression; otherwise the search interprets the search string as normal text.+ */+ useRegularExpression(useRegEx: boolean): TextFinder {+ this._useRegEx = useRegEx;+ return this;+ }++ /**+ * TODO+ * 替换还需考虑编辑模式和保护模式,整个workbook+ */+ /**+ * Replaces all matches with the specified text. Returns the number of occurrences replaced, which may be different from the number of matched cells.+ */+ replaceAllWith(replaceText: string): number {+ if (!this._range.length) return 0;++ let count = 0;+ let sheetId = this._range[0].sheetId;+ let sheet = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(sheetId);+ for (let i = 0; i < this._range.length; i++) {+ if (sheetId !== this._range[i].sheetId) {+ sheet = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(this._range[i].sheetId);+ }+ const range = this._range[i];+ if (!sheet) continue;++ this._replaceText(sheet, range, replaceText);+ count++;+ }+ this._range = [];+ this._index = -1;++ return count;+ }++ /**+ * Replaces the search text in the currently matched cell with the specified text and returns the number of occurrences replaced.+ */+ replaceWith(replaceText: string): number {+ if (!this._range.length) return 0;+ const range = this._range[this._index];+ const sheet = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(range.sheetId);+ if (!sheet) return 0;++ this._replaceText(sheet, range, replaceText);++ this._range.splice(this._index, 1);+ this._highlightCell(this._range[this._index]);+ return 1;+ }++ /**+ * Configures the search to start searching immediately after the specified cell range.+ */+ startFrom(startRange: Range): TextFinder {+ this._startRange = startRange;+ return this;+ }++ /**+ * Returns the current cell matching the search criteria.+ */+ getCurrentMatch(): IGridRange | null {+ if (this._index < 0) return null;+ return this._range[this._index];+ }++ // 开始查找+ searchText(text: string | FormatType, type: FindType = 'text', searchRange: SelectSearch = SelectSearch.CurrentSheet): TextFinder | null {+ if (!text) return null;+ // 查找范围变化或者初始化rangeData+ if (this._searchRange !== searchRange || !this._rangeData.length) {+ this._getRange(searchRange);+ }+ // 查找文字或者类型变化+ if (this._text !== text || this._type !== type) {+ this._type = type;+ this._text = text;+ this._index = -1;+ this.findAll();+ }+ return this;+ }++ private _getRange(searchRange: SelectSearch) {+ if (searchRange === SelectSearch.CurrentSheet) {+ const sheet = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getActiveSheet();+ const sheetId = sheet.getSheetId();+ const rangeList: IGridRange = {+ sheetId,+ rangeData: {+ startRow: 0,+ endRow: sheet.getLastRow(),+ startColumn: 0,+ endColumn: sheet.getLastColumn(),+ },+ };+ this._rangeData = [rangeList];+ }+ }++ /**+ * match rule+ */+ private _match = () => {+ const matchMap = new Map<string | FormatType, () => IGridRange[]>([+ ['text', this._mathTxt.bind(this)],+ // ['condition', this._matchCondition],+ // ['intervalRow', () => this._matchInterval('row')],+ // ['intervalColumn', () => this._matchInterval('column')],+ // ['null', this._matchNull],+ // ['format', this._matchFormat],+ ]);+ let range;+ if (this._type in FormatType) {+ range = matchMap.get('format')!();+ } else {+ range = matchMap.get(this._type)!();+ }+ // range.sort((a, b) => a.getRangeData().startRow - b.getRangeData().startRow).sort((a, b) => a.getRangeData().startColumn - b.getRangeData().startColumn);+ // if (this._startRange) {+ // const startRange = this._startRange.getRangeData();+ // for (let i = 0; i < range.length; i++) {+ // const cell = range[i].getRangeData();+ // if (cell.startColumn <= startRange.endColumn) {+ // range.splice(i, 1);+ // i--;+ // } else if (cell.startRow < startRange.startRow) {+ // range.splice(i, 1);+ // i--;+ // }+ // }+ // }+ this._range = range;+ };++ // 查找文本+ private _mathTxt(): IGridRange[] {+ const range: IGridRange[] = [];+ for (let i = 0; i < this._rangeData.length; i++) {+ const sheet = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getSheetBySheetId(this._rangeData[i].sheetId);+ if (!sheet) return [];+ let matrix: ObjectMatrix<ICellData> = new ObjectMatrix<ICellData>();+ if (this._matchFormula) {+ // matrix = this._rangeData[i].getValue().f;+ } else {+ matrix = sheet.getRange(this._rangeData[i].rangeData).getMatrix();+ }++ if (this._matchEntire) {+ matrix.forValue((row, col, value) => {+ if (!value.m) return;+ if ((this._matchCase && value.m === this._text) || (this._text as string).toLowerCase() === value.m.toLowerCase()) {+ range.push({+ sheetId: this._rangeData[i].sheetId,+ rangeData: {+ startRow: row,+ endRow: row,+ startColumn: col,+ endColumn: col,+ },+ });+ }+ });+ }+ // else if (this._useRegEx) {+ // let reg;+ // if (this._matchCase) {+ // reg = new RegExp(getRegExpStr(this._text), 'g');+ // } else {+ // reg = new RegExp(getRegExpStr(this._text), 'ig');+ // }++ // if (reg.test(value)) {+ // range.push(this._rangeData[i]);+ // }+ // }+ else {+ let reg = new RegExp(getRegExpStr(this._text as string), this._matchCase ? 'g' : 'ig');++ matrix.forValue((row, col, value) => {+ if (!value.m) return;+ if (reg.test(value.m)) {+ reg.lastIndex = 0;+ range.push({+ sheetId: this._rangeData[i].sheetId,+ rangeData: {+ startRow: row,+ endRow: row,+ startColumn: col,+ endColumn: col,+ },+ });+ }+ });+ }+ }+ return range;+ }++ // 高亮匹配单元格+ private _highlightCell(range: IGridRange) {+ if (!range) return;+ this._selectionManager.setCurrentCell(range);+ }++ private _replaceText(sheet: Worksheet, range: IGridRange, text: string) {+ const value = sheet.getRange(range.rangeData).getValue();+ if (!value || !value.m) return 0;+ if (!this._matchEntire) {+ let match;+ match = 'ig';+ if (this._matchCase) {+ match = 'g';+ }+ let reg = new RegExp(getRegExpStr(this._text as string), match);+ sheet.getRange(range.rangeData).setValue(value.m.replace(reg, text));+ } else {+ sheet.getRange(range.rangeData).setValue(text);+ }+ }+}diff --git a/packages/sheets-plugin-find/src/FindPlugin.ts b/packages/sheets-plugin-find/src/FindPlugin.tsindex 48c4f4d671..2993698948 100644--- a/packages/sheets-plugin-find/src/FindPlugin.ts+++ b/packages/sheets-plugin-find/src/FindPlugin.ts@@ -1,73 +1,85 @@-import { SheetContext, UniverSheet, Plugin, Worksheet } from '@univerjs/core';-// import { TextFinder } from './Domain/TextFind';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';-import { Icon } from '@univerjs/base-ui';-import { FindType } from './IData/IFind';-import { FIND_PLUGIN_NAME } from './Const/PLUGIN_NAME';-import { FindController } from './Controller/FindController';-import en from './Locale/en';-import zh from './Locale/zh';-import { FindPluginObserve, install } from './Basics/Observer';-import { FindModalController } from './Controller/FindModalController';-import { TextFinder } from './Domain';--export interface IFindPluginConfig {}--export class FindPlugin extends Plugin<FindPluginObserve> {- private _findController: FindController;-- private _findModalController: FindModalController;-- private _textFinder: TextFinder;-- constructor(config?: IFindPluginConfig) {- super(FIND_PLUGIN_NAME);- }-- static create(config?: IFindPluginConfig) {- return new FindPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);-- this._textFinder = new TextFinder(this);- this._findModalController = new FindModalController(this);- this._findController = new FindController(this);-- const context = this.getContext();- let sheetPlugin = context.getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);- sheetPlugin?.UIDidMount(() => {- sheetPlugin.getComponentManager().register('SearchIcon', Icon.SearchIcon);- sheetPlugin.addToolButton(this._findController.getFindList());- });- }-- initialize(): void {- this.getLocale().load({- en,- zh,- });- }-- createTextFinder(workSheet: Worksheet, type: FindType, text: string) {- // return new TextFinder(workSheet, type, text);- }-- onMounted(ctx: SheetContext): void {- install(this);- this.initialize();- }-- onDestroy(): void {}-- onMapping(): void {}-- getFindModalController() {- return this._findModalController;- }-- getTextFinder() {- return this._textFinder;- }-}+import { CommandManager, ICurrentUniverService, LocaleService, Plugin, PluginType, UniverSheet } from '@univerjs/core';+// import { TextFinder } from './Domain/TextFind';+import { Dependency, Inject, Injector } from '@wendellhu/redi';+import { FIND_PLUGIN_NAME } from './Const/PLUGIN_NAME';+import { FindPluginObserve } from './Basics/Observer';+import { FindController } from './Controller/FindController';+import { en, zh } from './Locale';+import { TextFinder } from './Domain/TextFind';+import { FindModalController } from './Controller/FindModalController';+// import { FindPluginObserve, install } from './Basics/Observer';+// import { FindModalController } from './Controller/FindModalController';+// import { TextFinder } from './Domain';++export interface IFindPluginConfig { }++export class FindPlugin extends Plugin<FindPluginObserve> {+ static override type = PluginType.Sheet;++ private _config: IFindPluginConfig;++ private _findController: FindController;++ private _findModalController: FindModalController;++ constructor(+ config: Partial<IFindPluginConfig>,+ @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,+ @Inject(LocaleService) private readonly _localeService: LocaleService,+ @Inject(Injector) private readonly _sheetInjector: Injector,+ @Inject(CommandManager) private readonly _commandManager: CommandManager+ ) {+ super(FIND_PLUGIN_NAME);++ this.initializeDependencies(_sheetInjector);+ }++ installTo(universheetInstance: UniverSheet) {+ universheetInstance.installPlugin(this);+ }++ // installTo(universheetInstance: UniverSheet) {+ // universheetInstance.installPlugin(this);++ // this._textFinder = new TextFinder(this);+ // this._findModalController = new FindModalController(this);+ // this._findController = new FindController(this);++ // const context = this.getContext();+ // let sheetPlugin = context.getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);+ // sheetPlugin?.UIDidMount(() => {+ // sheetPlugin.getComponentManager().register('SearchIcon', Icon.SearchIcon);+ // sheetPlugin.addToolButton(this._findController.getFindList());+ // });+ // }++ initialize(): void {+ this._localeService.getLocale().load({+ en,+ zh,+ });++ this.initController();+ }++ // createTextFinder(workSheet: Worksheet, type: FindType, text: string) {+ // // return new TextFinder(workSheet, type, text);+ // }++ override onMounted(): void {+ this.initialize();+ }++ initController() {+ this._findController = this._sheetInjector.get(FindController);+ this._findModalController = this._sheetInjector.get(FindModalController);+ }++ initializeDependencies(sheetInjector: Injector) {+ const dependencies: Dependency[] = [[FindController], [TextFinder], [FindModalController]];++ dependencies.forEach((d) => {+ sheetInjector.add(d);+ });+ }+}diff --git a/packages/sheets-plugin-formula/package.json b/packages/sheets-plugin-formula/package.jsonindex abe9ca98da..8722defd54 100644--- a/packages/sheets-plugin-formula/package.json+++ b/packages/sheets-plugin-formula/package.json@@ -63,6 +63,7 @@"@univerjs/base-ui": "workspace:^0.0.1","@univerjs/core": "workspace:^0.0.1","@univerjs/ui-plugin-sheets": "workspace:^0.0.1",+ "@wendellhu/redi": "^0.10.0","preact": "^10.12.1"}}diff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.tsindex 46e36f1d8b..1254491a75 100644--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.ts+++ b/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.ts@@ -12,18 +12,35 @@ import {Nullable,ObjectMatrix,Tools,+ ICurrentUniverService,+ IActionData,+ CommandManager,} from '@univerjs/core';+import { Inject, Injector } from '@wendellhu/redi';+import { FormulaDataType, FormulaEngineService } from '@univerjs/base-formula-engine';import { FormulaPlugin } from '../../FormulaPlugin';import { ACTION_NAMES as PLUGIN_ACTION_NAMES } from '../Enum';+import { FormulaController } from '../../Controller/FormulaController';+//export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {- execute() {- const engine = this._plugin.getFormulaEngine();- const formulaController = this._plugin.getFormulaController();+ constructor(+ actionDataList: IActionData[],+ _plugin: FormulaPlugin,+ @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,+ @Inject(FormulaController) private readonly _formulaController: FormulaController,+ @Inject(FormulaEngineService) private readonly _formulaEngineService: FormulaEngineService,+ @Inject(CommandManager) private readonly _commandManager: CommandManager+ ) {+ super(actionDataList, _plugin);+ }++ override execute() {+ const formulaController = this._formulaController;const formulaDataModel = formulaController.getDataModel();// The purpose of deep copy is to trigger the modification of formulaData through Command instead of reference relationshipconst formulaData = Tools.deepClone(formulaDataModel.getFormulaData());- const unitId = this._plugin.getContext().getWorkBook().getUnitId();+ const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();const actionDataList = this.actionDataList as ISetRangeDataActionData[];const unitRange: IUnitRange[] = [];@@ -31,13 +48,8 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {// handle each actionactionDataList.forEach((actionData) => {- if (actionData.operation != null && !ActionOperation.hasExtension(actionData)) {- return false;- }-- if (actionData.actionName !== ACTION_NAMES.SET_RANGE_DATA_ACTION) {- return false;- }+ if (actionData.operation != null && !ActionOperation.hasExtension(actionData)) return false;+ if (actionData.actionName !== ACTION_NAMES.SET_RANGE_DATA_ACTION) return false;// Filter out Actions that contain formulas, inject setRangeDataActionconst { sheetId, cellValue } = actionData;@@ -49,9 +61,7 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {}const cellData = new ObjectMatrix(formulaData[unitId][sheetId]);- if (cellValue == null) {- return;- }+ if (cellValue == null) return;const rangeMatrix = new ObjectMatrix(cellValue);@@ -65,11 +75,7 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {isArrayForm = true;isCalculate = true;- unitRange.push({- unitId,- sheetId,- rangeData: arrayFormCellRangeData,- });+ unitRange.push({ unitId, sheetId, rangeData: arrayFormCellRangeData });} else if (Tools.isStringNumber(formulaString)) {isCalculate = true;@@ -80,26 +86,22 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {}} else if (isFormulaString(formulaString)) {isCalculate = true;- cellData.setValue(r, c, {- formula: formulaString,- row: r,- column: c,- sheetId,- });+ cellData.setValue(r, c, { formula: formulaString, row: r, column: c, sheetId });}});if (!isArrayForm) {- unitRange.push({- unitId,- sheetId,- rangeData: rangeMatrix.getDataRange(),- });+ unitRange.push({ unitId, sheetId, rangeData: rangeMatrix.getDataRange() });}});if (unitRange.length === 0 || !isCalculate) return;+ this.executeFormula(unitId, formulaData, formulaController, unitRange, actionDataList);+ }++ executeFormula(unitId: string, formulaData: FormulaDataType, formulaController: FormulaController, unitRange: IUnitRange[], actionDataList: ISetRangeDataActionData[]) {+ const engine = this._formulaEngineService;// Add command after calculating the formulaengine.execute(unitId, formulaData, formulaController.toInterpreterCalculateProps(), false, unitRange).then((data) => {const { sheetData, arrayFormulaData } = data;@@ -110,7 +112,7 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {}if (arrayFormulaData) {- this._plugin.getFormulaController().addArrayFormulaData(arrayFormulaData);+ this._formulaController.addArrayFormulaData(arrayFormulaData);}const sheetIds = Object.keys(sheetData);@@ -152,16 +154,16 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {sheetId: actionDataList[0].sheetId, // Any sheetId can be passed in, it has no practical effectformulaData,};- const workBook = this._plugin.getContext().getWorkBook();- const commandManager = this._plugin.getContext().getCommandManager();+ const workBook = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook();+ const commandManager = this._commandManager;const command = new Command({ WorkBookUnit: workBook }, ...actionDatas, setFormulaDataAction);commandManager.invoke(command);});}checkArrayFormValue(row: number, column: number): Nullable<IRangeData> {- let formula;- const arrayFormulaData = this._plugin.getFormulaController().getDataModel().getArrayFormulaData();+ let formula: Nullable<IRangeData>;+ const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();if (!arrayFormulaData) return null;@@ -187,11 +189,15 @@ export class FormulaActionExtension extends BaseActionExtension<FormulaPlugin> {}export class FormulaActionExtensionFactory extends BaseActionExtensionFactory<FormulaPlugin> {- get zIndex(): number {+ constructor(_plugin: FormulaPlugin, @Inject(Injector) private readonly _sheetInjector: Injector) {+ super(_plugin);+ }++ override get zIndex(): number {return 1;}- create(actionDataList: ISheetActionData[]): BaseActionExtension<FormulaPlugin> {- return new FormulaActionExtension(actionDataList, this._plugin);+ override create(actionDataList: ISheetActionData[]): BaseActionExtension<FormulaPlugin> {+ return this._sheetInjector.createInstance(FormulaActionExtension, actionDataList, this._plugin);}}diff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.tsindex 7c39071d06..484450901a 100644--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.ts+++ b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.ts@@ -1,29 +1,43 @@import { BaseCellEditExtension, BaseCellEditExtensionFactory, ICell } from '@univerjs/base-ui';-import { IRangeData, Nullable } from '@univerjs/core';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';+import { ICurrentUniverService, IRangeData, Nullable } from '@univerjs/core';+import { SheetContainerUIController } from '@univerjs/ui-plugin-sheets';+import { Inject, Injector } from '@wendellhu/redi';import { FormulaPlugin } from '../../FormulaPlugin';+import { FormulaController } from '../../Controller/FormulaController';+import { FormulaPromptController } from '../../Controller/FormulaPromptController';export class FormulaCellEditExtension extends BaseCellEditExtension {setValue(value: string) {this._cell.value = value;}- execute() {+ override execute() {this.setValue(this._value);}}export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactory<FormulaPlugin> {- get zIndex(): number {+ constructor(+ _plugin: FormulaPlugin,+ @Inject(Injector) private readonly _sheetInjector: Injector,+ @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,+ @Inject(FormulaController) private readonly _formulaController: FormulaController,+ @Inject(FormulaPromptController) private readonly _formulaPromptController: FormulaPromptController,+ @Inject(SheetContainerUIController) private readonly _sheetContainerUIController: SheetContainerUIController+ ) {+ super(_plugin);+ }++ override get zIndex(): number {return 0;}- create(cell: ICell, value: string): FormulaCellEditExtension {- return new FormulaCellEditExtension(cell, value);+ override create(cell: ICell, value: string): FormulaCellEditExtension {+ return this._sheetInjector.createInstance(FormulaCellEditExtension, cell, value);}- check(cell: ICell) {- const unitId = this._plugin.getContext().getWorkBook().getUnitId();+ override check(cell: ICell) {+ const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();let formula = this.checkFormulaValue(cell) || this.checkArrayFormValue(cell, unitId);if (formula !== '' && !formula) {@@ -35,8 +49,8 @@ export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactorcheckFormulaValue(cell: ICell): Nullable<string> {const { row, column } = cell;- let formula;- const formulaData = this._plugin.getFormulaController().getDataModel().getFormulaData();+ let formula: Nullable<string>;+ const formulaData = this._formulaController.getDataModel().getFormulaData();Object.keys(formulaData).forEach((unitId) => {const sheetData = formulaData[unitId];@@ -48,18 +62,11 @@ export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactorconst cellData = sheetData[sheetId];Object.keys(cellData).forEach((cellRow) => {const rowArray = cellData[Number(cellRow)];- // rowArray.forEach((cellColumn: number, value: IFormulaData) => {- // if (Number(cellRow) === row && cellColumn === column) {- // // Get the content of the formula and convert it into a DOM structure- // formula = this._plugin.getFormulaPromptController().cellInputHandler.functionHTMLGenerate(value.formula);- // return false;- // }- // });Object.keys(rowArray).forEach((cellColumn) => {const value = rowArray[Number(cellColumn)];if (Number(cellRow) === row && Number(cellColumn) === column) {// Get the content of the formula and convert it into a DOM structure- formula = this._plugin.getFormulaPromptController().cellInputHandler.functionHTMLGenerate(value.formula);+ formula = this._formulaPromptController.cellInputHandler.functionHTMLGenerate(value.formula);return false;}});@@ -72,8 +79,8 @@ export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactorcheckArrayFormValue(cell: ICell, unitId: string): Nullable<string> {const { row, column } = cell;- let formula;- const arrayFormulaData = this._plugin.getFormulaController().getDataModel().getArrayFormulaData();+ let formula: Nullable<string>;+ const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();if (!arrayFormulaData) return null;@@ -84,7 +91,8 @@ export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactorconst { startRow, startColumn, endRow, endColumn } = value;if (row >= startRow && row < endRow && column >= startColumn && column < endColumn) {formula = '';- this._plugin.getContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME).setFormulaContent('');+ // .getFormulaBarUIController().getFormulaBar().setFormulaContent(str);+ this._sheetContainerUIController.getFormulaBarUIController().getFormulaBar().setFormulaContent('');return false;}});diff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.tsindex 133940218d..76a088d88f 100644--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.ts+++ b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.ts@@ -1,29 +1,40 @@import { IFormulaData } from '@univerjs/base-formula-engine';import { BaseCellInputExtension, BaseCellInputExtensionFactory, ICell } from '@univerjs/base-ui';-import { IRangeData, Nullable, ObjectArray } from '@univerjs/core';+import { ICurrentUniverService, IRangeData, Nullable, ObjectArray } from '@univerjs/core';+import { Inject, Injector } from '@wendellhu/redi';import { FormulaPlugin } from '../../FormulaPlugin';+import { FormulaController } from '../../Controller/FormulaController';export class FormulaCellInputExtension extends BaseCellInputExtension {- setValue(value: string) {+ override setValue(value: string) {this._cell.value = value;}- execute() {+ override execute() {this.setValue(this._value);}}export class FormulaCellInputExtensionFactory extends BaseCellInputExtensionFactory<FormulaPlugin> {- get zIndex(): number {+ constructor(+ _plugin: FormulaPlugin,+ @Inject(Injector) private readonly _sheetInjector: Injector,+ @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,+ @Inject(FormulaController) private readonly _formulaController: FormulaController+ ) {+ super(_plugin);+ }++ override get zIndex(): number {return 0;}- create(cell: ICell, value: string): FormulaCellInputExtension {- return new FormulaCellInputExtension(cell, value);+ override create(cell: ICell, value: string): FormulaCellInputExtension {+ return this._sheetInjector.createInstance(FormulaCellInputExtension, cell, value);}- check(cell: ICell) {- const unitId = this._plugin.getContext().getWorkBook().getUnitId();+ override check(cell: ICell) {+ const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();let formula = this.checkFormulaValue(cell) || this.checkArrayFormValue(cell, unitId);if (!formula) {@@ -36,7 +47,7 @@ export class FormulaCellInputExtensionFactory extends BaseCellInputExtensionFactcheckFormulaValue(cell: ICell): Nullable<string> {const { row, column } = cell;let formula;- const formulaData = this._plugin.getFormulaController().getDataModel().getFormulaData();+ const formulaData = this._formulaController.getDataModel().getFormulaData();Object.keys(formulaData).forEach((unitId) => {const sheetData = formulaData[unitId];@@ -71,8 +82,8 @@ export class FormulaCellInputExtensionFactory extends BaseCellInputExtensionFactcheckArrayFormValue(cell: ICell, unitId: string): Nullable<string> {const { row, column } = cell;let formula;- const formulaData = this._plugin.getFormulaController().getDataModel().getFormulaData();- const arrayFormulaData = this._plugin.getFormulaController().getDataModel().getArrayFormulaData();+ const formulaData = this._formulaController.getDataModel().getFormulaData();+ const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();if (!arrayFormulaData) return null;diff --git a/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts b/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.tsindex b1734a6694..9d11ca3468 100644--- a/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts+++ b/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts@@ -1,8 +1,8 @@-import { IRangeData, PLUGIN_NAMES, Workbook } from '@univerjs/core';+import { ICurrentUniverService, IRangeData, Workbook } from '@univerjs/core';import { Rect, Scene } from '@univerjs/base-render';-import { SheetPlugin, SheetView } from '@univerjs/base-sheets';+import { CanvasView, SheetView } from '@univerjs/base-sheets';-import { FormulaPlugin } from '../FormulaPlugin';+import { Inject } from '@wendellhu/redi';enum ARRAY_FORMULA_LINE_MANAGER_KEY {top = '__ArrayFormulaLineTopControl__',@@ -17,8 +17,6 @@ const LINE_COLOR = '#3969b9';* Ant Line Controller*/export class ArrayFormulaLineControl {- private _sheetPlugin: SheetPlugin;-private _leftControl: Rect;private _rightControl: Rect;@@ -33,9 +31,12 @@ export class ArrayFormulaLineControl {* Create ArrayFormLineController* @param plugin*/- constructor(private _plugin: FormulaPlugin, private _sheetId: string, private _range: IRangeData) {- this._sheetPlugin = this._plugin.getContext().getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)!;-+ constructor(+ private _sheetId: string,+ private _range: IRangeData,+ @ICurrentUniverService private readonly _currentUniverSheet: ICurrentUniverService,+ @Inject(CanvasView) private readonly _canvasView: CanvasView+ ) {this._initialize();}@@ -44,7 +45,7 @@ export class ArrayFormulaLineControl {* @returns*/getSheetView(): SheetView {- return this._sheetPlugin.getCanvasView().getSheetView();+ return this._canvasView.getSheetView();}/**@@ -52,7 +53,7 @@ export class ArrayFormulaLineControl {* @returns Workbook*/getWorkBook(): Workbook {- return this._sheetPlugin.getWorkbook();+ return this._currentUniverSheet.getCurrentUniverSheetInstance().getWorkBook();}/**@@ -60,7 +61,7 @@ export class ArrayFormulaLineControl {* @returns*/getSheetViewScene(): Scene {- return this._sheetPlugin.getCanvasView().getSheetView().getScene();+ return this.getSheetView().getScene();}dispose() {diff --git a/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts b/packages/sheets-plugin-formula/src/Controller/CellInputHandler.tsindex 0b53a2d9e7..27c7c192c4 100644--- a/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts+++ b/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts@@ -57,7 +57,7 @@ export class CellInputHandler {// inputValue: string;- formula: any;+ formula: IKeyValue[];functionlistPosition: object;@@ -186,6 +186,8 @@ export class CellInputHandler {}, 1);}+ // from luckysheet+ // eslint-disable-next-line max-lines-per-functionfindrangeindex(v: string, vp: string) {let _this = this;@@ -395,6 +397,8 @@ export class CellInputHandler {return `<span dir="auto" class="universheet-formula-text-color">=</span>${_this.functionHTML(txt)}`;}+ // from luckysheet+ // eslint-disable-next-line max-lines-per-functionfunctionHTML(txt: string) {let _this = this;diff --git a/packages/sheets-plugin-formula/src/Controller/FormulaController.tsx b/packages/sheets-plugin-formula/src/Controller/FormulaController.tssimilarity index 68%rename from packages/sheets-plugin-formula/src/Controller/FormulaController.tsxrename to packages/sheets-plugin-formula/src/Controller/FormulaController.tsindex e22ea821fe..69e2dfe3c9 100644--- a/packages/sheets-plugin-formula/src/Controller/FormulaController.tsx+++ b/packages/sheets-plugin-formula/src/Controller/FormulaController.ts@@ -1,41 +1,32 @@-import { FormulaEnginePlugin, IInterpreterDatasetConfig, SheetDataType, UnitDataType, SheetNameMapType, ArrayFormulaDataType } from '@univerjs/base-formula-engine';-import { SheetPlugin } from '@univerjs/base-sheets';-import { PLUGIN_NAMES, SheetContext } from '@univerjs/core';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';-import { FORMULA_PLUGIN_NAME } from '../Basics';+import { IInterpreterDatasetConfig, SheetDataType, UnitDataType, SheetNameMapType, ArrayFormulaDataType, FormulaEngineService } from '@univerjs/base-formula-engine';+import { ISelectionManager, SelectionManager } from '@univerjs/base-sheets';+import { CommandManager, ICurrentUniverService } from '@univerjs/core';+import { Inject, Injector } from '@wendellhu/redi';import { IFormulaConfig } from '../Basics/Interfaces/IFormula';-import { FormulaPlugin } from '../FormulaPlugin';import { FormulaDataModel } from '../Model/FormulaDataModel';-import { FormulaLabel } from '../View/UI/FormulaLabel';import { ArrayFormulaLineControl } from './ArrayFormulaLineController';export class FormulaController {private _formulaDataModel: FormulaDataModel;- private _formulaEngine: FormulaEnginePlugin;-- private _context: SheetContext;+ private _formulaEngine: FormulaEngineService;private _interpreterCalculatePropsCache: IInterpreterDatasetConfig;- private _sheetPlugin: SheetPlugin;-- private _sheetUIPlugin: SheetUIPlugin;-private _activeSheetId: string;private _arrayFormulaLineControls: ArrayFormulaLineControl[] = [];- constructor(private _plugin: FormulaPlugin, config?: IFormulaConfig) {+ constructor(+ config: IFormulaConfig,+ @ISelectionManager private readonly _selectionManager: SelectionManager,+ @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,+ @Inject(CommandManager) private readonly _commandManager: CommandManager,+ @Inject(Injector) private readonly _sheetInjector: Injector+ ) {this._formulaDataModel = new FormulaDataModel(config);- this._context = this._plugin.getContext();-- this._sheetPlugin = this._plugin.getContext().getPluginManager().getRequirePluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- this._sheetUIPlugin = this._plugin.getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);-- this._activeSheetId = this._sheetPlugin.getWorkbook().getActiveSheet().getSheetId();+ this._activeSheetId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getActiveSheet().getSheetId();// this._initRegisterComponent();@@ -88,8 +79,8 @@ export class FormulaController {return this._formulaDataModel;}- setFormulaEngine(formulaEngine: FormulaEnginePlugin) {- this._formulaEngine = formulaEngine;+ setFormulaEngine(formulaEngineService: FormulaEngineService) {+ this._formulaEngine = formulaEngineService;}getFormulaEngine() {@@ -105,11 +96,11 @@ export class FormulaController {}getCommandManager() {- return this._context.getCommandManager();+ return this._commandManager;}getWorkbook() {- return this._context.getWorkBook();+ return this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook();}getUnitId() {@@ -139,37 +130,38 @@ export class FormulaController {const arrayFormula = arrayFormulaData[this._activeSheetId];if (!arrayFormula) return;- const currentCellData = this._sheetPlugin.getSelectionManager().getCurrentCellData();+ const currentCellData = this._selectionManager.getCurrentCellData();arrayFormula.forValue((r, c, v) => {const { startRow, startColumn, endRow, endColumn } = v;if (currentCellData) {const { startRow: row, startColumn: column } = currentCellData;if (row >= startRow && row < endRow && column >= startColumn && column < endColumn) {- this._arrayFormulaLineControls.push(new ArrayFormulaLineControl(this._plugin, this._activeSheetId, v));+ const arrayFormulaLineControl = this._sheetInjector.createInstance(ArrayFormulaLineControl, this._activeSheetId, v);+ this._arrayFormulaLineControls.push(arrayFormulaLineControl);}}});}- private _initRegisterComponent() {- // this._sheetPlugin.registerComponent(FORMULA_PLUGIN_NAME + FormulaLabel.name, FormulaLabel);- this._plugin- .getContext()- .getUniver()- .getGlobalContext()- .getPluginManager()- .getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME)- .getAppUIController()- .getSheetContainerController()- .getMainSlotController()- .addSlot(FORMULA_PLUGIN_NAME + FormulaLabel.name, {- component: FormulaLabel,- });- }+ // private _initRegisterComponent() {+ // // this._sheetPlugin.registerComponent(FORMULA_PLUGIN_NAME + FormulaLabel.name, FormulaLabel);+ // this._plugin+ // .getContext()+ // .getUniver()+ // .getGlobalContext()+ // .getPluginManager()+ // .getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME)+ // .getAppUIController()+ // .getSheetContainerController()+ // .getMainSlotController()+ // .addSlot(FORMULA_PLUGIN_NAME + FormulaLabel.name, {+ // component: FormulaLabel,+ // });+ // }private _toInterpreterCalculateProps(): IInterpreterDatasetConfig {- const workbook = this._context.getWorkBook();+ const workbook = this.getWorkbook();const sheets = workbook.getSheets();const sheetData: SheetDataType = {};const unitData: UnitDataType = {};diff --git a/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts b/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.tsindex cf0d044d93..d02c7ed9b9 100644--- a/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts+++ b/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts@@ -1,9 +1,8 @@import { $$, getRefElement } from '@univerjs/base-ui';-import { SheetPlugin } from '@univerjs/base-sheets';-import { KeyCode, PLUGIN_NAMES, SheetContext } from '@univerjs/core';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';+import { KeyCode, ObserverManager } from '@univerjs/core';+import { SheetContainerUIController } from '@univerjs/ui-plugin-sheets';+import { Inject } from '@wendellhu/redi';import { FORMULA_PLUGIN_NAME, FunList } from '../Basics';-import { FormulaPlugin } from '../FormulaPlugin';import { HelpFunction, SearchFunction } from '../View/UI/FormulaPrompt';import { CellInputHandler } from './CellInputHandler';@@ -14,70 +13,51 @@ export class FormulaPromptController {richTextEditEle: HTMLElement;- private _context: SheetContext;-- private _sheetPlugin: SheetPlugin;-- private _sheetUIPlugin: SheetUIPlugin;-private _searchFunction: SearchFunction;private _helpFunction: HelpFunction;- constructor(private _plugin: FormulaPlugin) {- this._context = this._plugin.getContext();-- this._sheetPlugin = this._plugin.getContext().getPluginManager().getRequirePluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- this._sheetUIPlugin = this._plugin.getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);-+ constructor(+ @Inject(SheetContainerUIController) private readonly _sheetContainerUIController: SheetContainerUIController,+ @Inject(ObserverManager) private readonly _observerManager: ObserverManager+ ) {this._initRegisterComponent();this._initialize();}private _initRegisterComponent() {- this._sheetUIPlugin- .getAppUIController()- .getSheetContainerController()- .getMainSlotController()- .addSlot(- FORMULA_PLUGIN_NAME + SearchFunction.name,- {- component: SearchFunction,- },- () => {- const searchFunction = this._sheetUIPlugin- .getAppUIController()- .getSheetContainerController()- .getMainSlotController()- .getSlot(FORMULA_PLUGIN_NAME + SearchFunction.name);- this._searchFunction = searchFunction;- }- );-- this._sheetUIPlugin- .getAppUIController()- .getSheetContainerController()- .getMainSlotController()- .addSlot(- FORMULA_PLUGIN_NAME + HelpFunction.name,- {- component: HelpFunction,- },- () => {- const helpFunction = this._sheetUIPlugin- .getAppUIController()- .getSheetContainerController()- .getMainSlotController()- .getSlot(FORMULA_PLUGIN_NAME + HelpFunction.name);- this._helpFunction = helpFunction;- }- );+ this._sheetContainerUIController.getMainSlotController().addSlot(+ FORMULA_PLUGIN_NAME + SearchFunction.name,+ {+ component: SearchFunction,+ },+ () => {+ const searchFunction = this._sheetContainerUIController.getMainSlotController().getSlot(FORMULA_PLUGIN_NAME + SearchFunction.name);+ this._searchFunction = searchFunction;+ }+ );++ this._sheetContainerUIController.getMainSlotController().addSlot(+ FORMULA_PLUGIN_NAME + HelpFunction.name,+ {+ component: HelpFunction,+ },+ () => {+ const helpFunction = this._sheetContainerUIController.getMainSlotController().getSlot(FORMULA_PLUGIN_NAME + HelpFunction.name);+ this._helpFunction = helpFunction;+ }+ );}private _initialize() {- this._sheetUIPlugin.UIDidMount(() => {- const richTextEle = this._sheetUIPlugin.getAppUIController().getSheetContainerController().getCellEditorUIController()._richTextEle;+ this._mount();+ this._onRichTextKeyDownObservable();+ this._onRichTextKeyUpObservable();+ }++ private _mount() {+ this._sheetContainerUIController.UIDidMount(() => {+ const richTextEle = this._sheetContainerUIController.getCellEditorUIController()._richTextEle;this.richTextEle = richTextEle;this.richTextEditEle = $$('div', this.richTextEle);@@ -85,8 +65,10 @@ export class FormulaPromptController {// Register cell input formula supportthis.cellInputHandler = new CellInputHandler(this.richTextEditEle);});+ }- this._sheetUIPlugin.getObserver('onRichTextKeyDownObservable')?.add((event: KeyboardEvent) => {+ private _onRichTextKeyDownObservable() {+ this._observerManager.getObserver<KeyboardEvent>('onRichTextKeyDownObservable')?.add((event: KeyboardEvent) => {let ctrlKey = event.ctrlKey;let altKey = event.altKey;let shiftKey = event.shiftKey;@@ -110,10 +92,11 @@ export class FormulaPromptController {this.cellInputHandler.functionInputHandler(this.richTextEditEle, kcode);}});- this._sheetUIPlugin.getObserver('onRichTextKeyUpObservable')?.add((event: KeyboardEvent) => {- let kcode = event.keyCode;+ }- // stop edit+ private _onRichTextKeyUpObservable() {+ this._observerManager.getObserver<KeyboardEvent>('onRichTextKeyUpObservable')?.add((event: KeyboardEvent) => {+ let kcode = event.keyCode;if (kcode === KeyCode.ENTER) {this._searchFunction.updateState(false);this._helpFunction.updateState(false);@@ -135,46 +118,27 @@ export class FormulaPromptController {this.cellInputHandler.searchFunction(this.richTextEditEle);const formula = this.cellInputHandler.getFormula();let helpFormula = this.cellInputHandler.getHelpFormula();-let height = parseInt(this.richTextEle.style.minHeight);let width = parseInt(this.richTextEle.style.minWidth);let left = parseInt(this.richTextEle.style.left);let top = parseInt(this.richTextEle.style.top) + height;-- // Get the viewport width/height of the Main SheetContainer- const sheetContainer = getRefElement(this._sheetUIPlugin.getAppUIController().getSheetContainerController().getContentRef());+ const sheetContainer = getRefElement(this._sheetContainerUIController.getContentRef());const screenW = sheetContainer.offsetWidth;const screenH = sheetContainer.offsetHeight;-- // Parse out a reasonable display position, and the list cannot be hidden- const position = {- left,- top,- };-+ const position = { left, top };const getPosition = (component: SearchFunction | HelpFunction) => {- // Get the width/height of the listconst searchFunctionEle = getRefElement(component.getContentRef());const rootW = searchFunctionEle.offsetWidth;- // const rootW = this._searchFunction?.base?.offsetWidth;const rootH = searchFunctionEle.offsetHeight;-- // right is true, indicating that the width from the lower left corner of the cell to the right border of the browser can hold the SearchFunction. Otherwise, the component is placed on the left.- // bottom is true, indicating that the height from the lower left corner of the cell to the lower border of the browser can place the SearchFunction. Otherwise, the component is put on top.const right = screenW - left > rootW;const bottom = screenH - top > rootH;-if (!right) {left -= rootW - width;}if (!bottom) {top -= rootH + height;}-- return {- left,- top,- };+ return { left, top };};if (formula[0]) {@@ -202,7 +166,6 @@ export class FormulaPromptController {event.preventDefault();event.stopPropagation();const searchFunctionState = this._searchFunction.getState();- // Select the formula when the search formula box is open, and execute the formula when it is closedif (searchFunctionState.searchActive) {const func = searchFunctionState.formula[searchFunctionState.selectIndex] as any;this.cellInputHandler.searchFunctionEnter(func.n);diff --git a/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts b/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.tsindex 41512ddf5d..af06fa36e8 100644--- a/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts+++ b/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts@@ -1,9 +1,9 @@-import { ComponentChildren } from '@univerjs/base-ui';-import { SheetPlugin } from '@univerjs/base-sheets';-import { PLUGIN_NAMES } from '@univerjs/core';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';+import { ComponentChildren, ComponentManager } from '@univerjs/base-ui';+import { ObserverManager } from '@univerjs/core';+import { SheetContainerUIController } from '@univerjs/ui-plugin-sheets';+import { Inject } from '@wendellhu/redi';+import { SelectionControl } from '@univerjs/base-render/src/Component/Sheets/Selection/SelectionControl';import { FormulaType, FORMULA_PLUGIN_NAME, FunList, SelectCategoryType } from '../Basics';-import { FormulaPlugin } from '../FormulaPlugin';import { SearchFormulaContent } from '../View/UI/SearchFormulaModal/SearchFormulaContent';import { SearchFormulaModal } from '../View/UI/SearchFormulaModal/SearchFormulaModal';import { SearchItem } from '../View/UI/SearchFormulaModal/SearchItem';@@ -57,8 +57,6 @@ export interface SearchFormulaModalData {}export class SearchFormulaController {- private _plugin: FormulaPlugin;-private _modalData: SearchFormulaModalData[];private _formulaModal: SearchFormulaModal;@@ -69,9 +67,11 @@ export class SearchFormulaController {private _cellRangeModalData: SearchFormulaModalData;- constructor(plugin: FormulaPlugin) {- this._plugin = plugin;-+ constructor(+ @Inject(SheetContainerUIController) private readonly _sheetContainerUIController: SheetContainerUIController,+ @Inject(ComponentManager) private readonly _componentManager: ComponentManager,+ @Inject(ObserverManager) private readonly _observerManager: ObserverManager+ ) {this._funParams = {funParams: {},};@@ -165,7 +165,7 @@ export class SearchFormulaController {showCellRangeModal(show: boolean) {this._cellRangeModalData.show = show;- const sheetPlugin = this._plugin.getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);+ // const sheetPlugin = this._plugin.getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);// const cellRangeModal = sheetPlugin?.getModalGroupControl().getModal(CellRangeModal.name);// cellRangeModal.setModal(this._cellRangeModalData);this.showFormulaModal('SearchItem', false);@@ -179,17 +179,14 @@ export class SearchFormulaController {private _initialize() {this._initRegisterComponent();- const sheetPlugin = this._plugin.getContext().getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)!;- sheetPlugin.getObserver('onChangeSelectionObserver')?.add((selection) => {+ this._observerManager.getObserver<SelectionControl>('onChangeSelectionObserver')?.add((selection) => {const info = selection.getCurrentCellInfo();// this._searchItem.changeRange(info?.startColumn.toString() ?? '');});}private _initRegisterComponent() {- const sheetUIPlugin = this._plugin.getContext().getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);- const ComponentManager = sheetUIPlugin.getComponentManager();- sheetUIPlugin.addSlot(FORMULA_PLUGIN_NAME + SearchFormulaModal.name, {+ this._sheetContainerUIController.getMainSlotController().addSlot(FORMULA_PLUGIN_NAME + SearchFormulaModal.name, {component: SearchFormulaModal,props: {getComponent: (ref: SearchFormulaModal) => {@@ -197,7 +194,7 @@ export class SearchFormulaController {},},});- ComponentManager.register(FORMULA_PLUGIN_NAME + SearchItem.name, SearchItem);- ComponentManager.register(FORMULA_PLUGIN_NAME + SearchFormulaContent.name, SearchFormulaContent);+ this._componentManager.register(FORMULA_PLUGIN_NAME + SearchItem.name, SearchItem);+ this._componentManager.register(FORMULA_PLUGIN_NAME + SearchFormulaContent.name, SearchFormulaContent);}}diff --git a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx b/packages/sheets-plugin-formula/src/FormulaPlugin.tsxindex 4dc09494bc..1c8e70f582 100644--- a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx+++ b/packages/sheets-plugin-formula/src/FormulaPlugin.tsx@@ -1,7 +1,8 @@-import { SheetContext, UniverSheet, Plugin } from '@univerjs/core';-import { FormulaEnginePlugin } from '@univerjs/base-formula-engine';-import { CellEditExtensionManager, CellInputExtensionManager, Icon } from '@univerjs/base-ui';-import { SheetUIPlugin, SHEET_UI_PLUGIN_NAME } from '@univerjs/ui-plugin-sheets';+import { Dependency, Inject, Injector } from '@wendellhu/redi';+import { Plugin, CommandManager, PluginType } from '@univerjs/core';+import { FormulaEngineService } from '@univerjs/base-formula-engine';+import { CellEditExtensionManager, CellInputExtensionManager, ComponentManager, Icon } from '@univerjs/base-ui';+import { SheetContainerUIController } from '@univerjs/ui-plugin-sheets';import { zh, en } from './Locale';import { IFormulaConfig } from './Basics/Interfaces/IFormula';@@ -15,7 +16,9 @@ import { FormulaPluginObserve, install } from './Basics/Observer';import { SearchFormulaController } from './Controller/SearchFormulaModalController';import { FormulaPromptController } from './Controller/FormulaPromptController';-export class FormulaPlugin extends Plugin<FormulaPluginObserve, SheetContext> {+export class FormulaPlugin extends Plugin<FormulaPluginObserve> {+ static override type = PluginType.Sheet;+protected _formulaActionExtensionFactory: FormulaActionExtensionFactory;private _formulaController: FormulaController;@@ -24,55 +27,44 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve, SheetContext> {private _formulaPromptController: FormulaPromptController;- constructor(private _config?: IFormulaConfig) {+ constructor(private _config: IFormulaConfig, @Inject(Injector) private readonly _sheetInjector: Injector, @Inject(CommandManager) private readonly _commandManager: CommandManager) {super(FORMULA_PLUGIN_NAME);}- static create(config?: IFormulaConfig) {- return new FormulaPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);+ initialize(): void {+ /**+ * load more Locale object+ */+ this.getLocale().load({+ en,+ zh,+ });- const context = this.getContext();- let formulaEngine = context.getPluginManager().getPluginByName<FormulaEnginePlugin>('formulaEngine');- if (!formulaEngine) {- formulaEngine = new FormulaEnginePlugin();- universheetInstance.installPlugin(formulaEngine);- }+++ const sheetContainerUIController = this._sheetInjector.get(SheetContainerUIController);+ const formulaBar = sheetContainerUIController.getFormulaBarUIController().getFormulaBar();+- let sheetPlugin = context.getUniver().getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);- sheetPlugin?.UIDidMount(() => {- this._formulaController = new FormulaController(this, this._config);- this._searchFormulaController = new SearchFormulaController(this);- this._formulaPromptController = new FormulaPromptController(this);+ sheetContainerUIController.UIDidMount(() => {+ this.initializeDependencies(this._sheetInjector);+ this.registerExtension();- this._formulaController.setFormulaEngine(formulaEngine as FormulaEnginePlugin);+ let formulaEngineService = this._sheetInjector.get(FormulaEngineService);+ this._formulaController.setFormulaEngine(formulaEngineService);firstLoader(this._formulaController);- sheetPlugin.getComponentManager().register('FxIcon', Icon.Math.FxIcon);- sheetPlugin.setFx({+ const componentManager = this._sheetInjector.get(ComponentManager);+ componentManager.register('FxIcon', Icon.Math.FxIcon);++ formulaBar.setFx({onClick: () => {this._searchFormulaController.showFormulaModal('SearchFormula', true);},icon: 'FxIcon',});});- }-- initialize(context: SheetContext): void {- this.context = context;- /**- * load more Locale object- */- this.getLocale().load({- en,- zh,- });-- this.registerExtension();// this._arrayFormLineControl.addArrayFormLineToSheet(// {@@ -103,26 +95,30 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve, SheetContext> {// );}- onMounted(context: SheetContext): void {+ override onMounted(): void {install(this);- this.initialize(context);+ this.initialize();}- onDestroy(): void {- const actionRegister = this.context.getCommandManager().getActionExtensionManager().getRegister();+ override onDestroy(): void {+ const actionRegister = this._commandManager.getActionExtensionManager().getRegister();actionRegister.delete(this._formulaActionExtensionFactory);}registerExtension() {const cellEditRegister = CellEditExtensionManager.create();- cellEditRegister.add(new FormulaCellEditExtensionFactory(this));+ const formulaCellEditExtensionFactory = this._sheetInjector.createInstance(FormulaCellEditExtensionFactory, this);+ this._sheetInjector.add([FormulaCellEditExtensionFactory, { useValue: formulaCellEditExtensionFactory }]);+ cellEditRegister.add(formulaCellEditExtensionFactory);const cellInputRegister = CellInputExtensionManager.create();- cellInputRegister.add(new FormulaCellInputExtensionFactory(this));+ const formulaCellInputExtensionFactory = this._sheetInjector.createInstance(FormulaCellInputExtensionFactory, this);+ this._sheetInjector.add([FormulaCellInputExtensionFactory, { useValue: formulaCellInputExtensionFactory }]);+ cellInputRegister.add(formulaCellInputExtensionFactory);- const actionRegister = this.context.getCommandManager().getActionExtensionManager().getRegister();- this._formulaActionExtensionFactory = new FormulaActionExtensionFactory(this);+ const actionRegister = this._commandManager.getActionExtensionManager().getRegister();+ this._formulaActionExtensionFactory = new FormulaActionExtensionFactory(this,this._sheetInjector);actionRegister.add(this._formulaActionExtensionFactory);}@@ -141,4 +137,21 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve, SheetContext> {getFormulaPromptController() {return this._formulaPromptController;}++ private initializeDependencies(sheetInjector: Injector){+ const dependencies: Dependency[] = [+ [SearchFormulaController],+ [FormulaPromptController],+ ];++ dependencies.forEach((d) => {+ sheetInjector.add(d);+ });++ this._searchFormulaController = this._sheetInjector.get(SearchFormulaController);+ this._formulaPromptController = this._sheetInjector.get(FormulaPromptController);+ this._formulaController = sheetInjector.createInstance(FormulaController, this._config);+ sheetInjector.add([FormulaController, { useValue: this._formulaController }]);+ sheetInjector.add([FormulaEngineService]);+ }}diff --git a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsxindex 61036657c6..1705eeb0e5 100644--- a/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx+++ b/packages/sheets-plugin-formula/src/View/UI/FormulaPrompt/SearchFunction.tsx@@ -1,4 +1,5 @@import { BaseComponentProps, Component, createRef } from '@univerjs/base-ui';+import { IKeyValue } from '@univerjs/core';import styles from './index.module.less';interface IProps extends BaseComponentProps {}@@ -7,7 +8,7 @@ interface IState {lang: string;locale: [];formulaValue: string;- formula: [];+ formula: IKeyValue[];functionList: any;selectIndex: number;searchActive: boolean;@@ -52,7 +53,7 @@ export class SearchFunction extends Component<IProps, IState> {* @param formula* @param selectIndex*/- updateState(searchActive: boolean, formula: [] = [], selectIndex: number = 0, position = { left: 0, top: 0 }, cb?: () => void) {+ updateState(searchActive: boolean, formula: IKeyValue[] = [], selectIndex: number = 0, position = { left: 0, top: 0 }, cb?: () => void) {this.setState({ searchActive, formula, selectIndex, position }, cb);}diff --git a/packages/sheets-plugin-freeze/README-zh.md b/packages/sheets-plugin-freeze/README-zh.mddeleted file mode 100644index 8921badc42..0000000000--- a/packages/sheets-plugin-freeze/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Frozen 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-freeze-```--### 使用--```js-import { Frozen } from '@univerjs/sheets-plugin-freeze';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Frozen());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-freeze/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-freeze dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-freeze/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-freeze build-```diff --git a/packages/sheets-plugin-freeze/README.md b/packages/sheets-plugin-freeze/README.mddeleted file mode 100644index 66006e1d7b..0000000000--- a/packages/sheets-plugin-freeze/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Frozen--### Installation--```shell-npm i @univerjs/sheets-plugin-freeze-```--### Usage--```js-import { Frozen } from '@univerjs/sheets-plugin-freeze';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Frozen());-```--## 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/sheets-plugin-freeze/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-freeze dev-```--### Package--```-# Current directory ./packages/sheets-plugin-freeze/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-freeze build-```diff --git a/packages/sheets-plugin-freeze/index.html b/packages/sheets-plugin-freeze/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-freeze/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-freeze/jest.config.js b/packages/sheets-plugin-freeze/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-freeze/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/packages/sheets-plugin-freeze/package.json b/packages/sheets-plugin-freeze/package.jsondeleted file mode 100644index 21b798d384..0000000000--- a/packages/sheets-plugin-freeze/package.json+++ /dev/null@@ -1,66 +0,0 @@-{- "name": "@univerjs/sheets-plugin-freeze",- "version": "0.0.1",- "description": "UniverSheet normal plugin-freeze",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-freeze.cjs.js",- "module": "./lib/univer-sheets-plugin-freeze.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-freeze.cjs.js",- "default": "./lib/univer-sheets-plugin-freeze.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-freeze/src/Action/RegisterAction.ts b/packages/sheets-plugin-freeze/src/Action/RegisterAction.tsdeleted file mode 100644index caad5b4420..0000000000--- a/packages/sheets-plugin-freeze/src/Action/RegisterAction.ts+++ /dev/null@@ -1,7 +0,0 @@-import { CommandManager } from '@univerjs/core';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';-import { SetFrozenColumnsAction } from './SetFrozenColumnsAction';-import { SetFrozenRowsAction } from './SetFrozenRowsAction';--CommandManager.register(ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION, SetFrozenColumnsAction);-CommandManager.register(ACTION_NAMES.SET_FROZEN_ROWS_ACTION, SetFrozenRowsAction);diff --git a/packages/sheets-plugin-freeze/src/Action/SetFrozenCancelAction.ts b/packages/sheets-plugin-freeze/src/Action/SetFrozenCancelAction.tsdeleted file mode 100644index 452b526f34..0000000000--- a/packages/sheets-plugin-freeze/src/Action/SetFrozenCancelAction.ts+++ /dev/null@@ -1,53 +0,0 @@-import { SheetActionBase, ISheetActionData, Workbook, ActionObservers, ActionType } from '@univerjs/core';-import { SetFrozenCancel } from '../Apply/SetFrozenCancel';-import { SetFrozenColumns } from '../Apply/SetFrozenColumns';-import { SetFrozenRows } from '../Apply/SetFrozenRows';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export class SetFrozenCancelAction extends SheetActionBase<ISheetActionData> {- _numbers: number[] = [];-- constructor(actionData: ISheetActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION,- sheetId: actionData.sheetId,- };- this.do();- this.validate();- }-- do(): void {- const worksheet = this.getWorkSheet();- this._numbers = SetFrozenCancel(worksheet);- this._observers.notifyObservers({- type: ActionType.REDO,- data: this._doActionData,- action: this,- });- }-- redo(): void {- this.do();- }-- undo(): void {- const worksheet = this.getWorkSheet();-- SetFrozenRows(worksheet, this._numbers[0]);- SetFrozenColumns(worksheet, this._numbers[1]);-- this._observers.notifyObservers({- type: ActionType.UNDO,- data: this._oldActionData,- action: this,- });- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-freeze/src/Action/SetFrozenColumnsAction.ts b/packages/sheets-plugin-freeze/src/Action/SetFrozenColumnsAction.tsdeleted file mode 100644index ff457db6c5..0000000000--- a/packages/sheets-plugin-freeze/src/Action/SetFrozenColumnsAction.ts+++ /dev/null@@ -1,63 +0,0 @@-import { ISheetActionData, SheetActionBase, Workbook, ActionObservers, ActionType } from '@univerjs/core';-import { SetFrozenColumns } from '../Apply/SetFrozenColumns';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export interface ISetFrozenColumnsActionData extends ISheetActionData {- numColumns: number;-}--export class SetFrozenColumnsAction extends SheetActionBase<ISetFrozenColumnsActionData> {- constructor(actionData: ISetFrozenColumnsActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);- this._doActionData = {- ...actionData,- };-- this._oldActionData = {- actionName: ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION,- sheetId: actionData.sheetId,- numColumns: this.do(),- };- this.validate();- }-- do(): number {- const worksheet = this.getWorkSheet();- this._observers.notifyObservers({- type: ActionType.REDO,- data: this._doActionData,- action: this,- });- return SetFrozenColumns(worksheet, this._doActionData.numColumns);- }-- redo(): void {- // update pre data- const { sheetId } = this._doActionData;- this._oldActionData = {- sheetId,- actionName: ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION,- numColumns: this.do(),- };- }-- undo(): void {- const { numColumns, sheetId } = this._oldActionData;- const worksheet = this.getWorkSheet();- // update current data- this._doActionData = {- actionName: ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION,- sheetId,- numColumns: SetFrozenColumns(worksheet, numColumns),- };- this._observers.notifyObservers({- type: ActionType.UNDO,- data: this._oldActionData,- action: this,- });- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-freeze/src/Action/SetFrozenRowsAction.ts b/packages/sheets-plugin-freeze/src/Action/SetFrozenRowsAction.tsdeleted file mode 100644index bfb2b250dc..0000000000--- a/packages/sheets-plugin-freeze/src/Action/SetFrozenRowsAction.ts+++ /dev/null@@ -1,64 +0,0 @@-import { ISheetActionData, SheetActionBase, Workbook, ActionObservers, ActionType } from '@univerjs/core';-import { SetFrozenRows } from '../Apply/SetFrozenRows';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export interface ISetFrozenRowsActionData extends ISheetActionData {- numRows: number;-}--export class SetFrozenRowsAction extends SheetActionBase<ISetFrozenRowsActionData> {- constructor(actionData: ISetFrozenRowsActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);- this._doActionData = {- ...actionData,- };-- this._oldActionData = {- actionName: ACTION_NAMES.SET_FROZEN_ROWS_ACTION,- sheetId: actionData.sheetId,- numRows: this.do(),- };- this.validate();- }-- do(): number {- const worksheet = this.getWorkSheet();- const result = SetFrozenRows(worksheet, this._doActionData.numRows);- this._observers.notifyObservers({- type: ActionType.REDO,- data: this._doActionData,- action: this,- });- return result;- }-- redo(): void {- // update pre data- const { sheetId } = this._doActionData;- this._oldActionData = {- sheetId,- actionName: ACTION_NAMES.SET_FROZEN_ROWS_ACTION,- numRows: this.do(),- };- }-- undo(): void {- const { numRows, sheetId } = this._oldActionData;- const worksheet = this.getWorkSheet();- // update current data- this._doActionData = {- actionName: ACTION_NAMES.SET_FROZEN_ROWS_ACTION,- sheetId,- numRows: SetFrozenRows(worksheet, numRows),- };- this._observers.notifyObservers({- type: ActionType.UNDO,- data: this._oldActionData,- action: this,- });- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-freeze/src/Action/index.ts b/packages/sheets-plugin-freeze/src/Action/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/Apply/SetFrozenCancel.ts b/packages/sheets-plugin-freeze/src/Apply/SetFrozenCancel.tsdeleted file mode 100644index 6965ffb2bd..0000000000--- a/packages/sheets-plugin-freeze/src/Apply/SetFrozenCancel.ts+++ /dev/null@@ -1,17 +0,0 @@-import { Worksheet } from '@univerjs/core';--export function SetFrozenCancel(worksheet: Worksheet): number[] {- // get config- const config = worksheet.getConfig();-- // store old sheet name- const oldFreezeColumn = config.freezeColumn;- const oldFreezeRow = config.freezeRow;-- // set new sheet name- config.freezeColumn = -1;- config.freezeRow = -1;-- // return old sheet name to undo- return [oldFreezeRow, oldFreezeColumn];-}diff --git a/packages/sheets-plugin-freeze/src/Apply/SetFrozenColumns.ts b/packages/sheets-plugin-freeze/src/Apply/SetFrozenColumns.tsdeleted file mode 100644index e7754ac6b6..0000000000--- a/packages/sheets-plugin-freeze/src/Apply/SetFrozenColumns.ts+++ /dev/null@@ -1,15 +0,0 @@-import { Worksheet } from '@univerjs/core';--export function SetFrozenColumns(worksheet: Worksheet, numColumns: number): number {- // get config- const config = worksheet.getConfig();-- // store old sheet name- const oldStatus = config.freezeColumn;-- // set new sheet name- config.freezeColumn = numColumns;-- // return old sheet name to undo- return oldStatus;-}diff --git a/packages/sheets-plugin-freeze/src/Apply/SetFrozenRows.ts b/packages/sheets-plugin-freeze/src/Apply/SetFrozenRows.tsdeleted file mode 100644index a1eaaf8931..0000000000--- a/packages/sheets-plugin-freeze/src/Apply/SetFrozenRows.ts+++ /dev/null@@ -1,15 +0,0 @@-import { Worksheet } from '@univerjs/core';--export function SetFrozenRows(worksheet: Worksheet, numRows: number): number {- // get config- const config = worksheet.getConfig();-- // store old sheet name- const oldStatus = config.freezeRow;-- // set new sheet name- config.freezeRow = numRows;-- // return old sheet name to undo- return oldStatus;-}diff --git a/packages/sheets-plugin-freeze/src/Apply/index.ts b/packages/sheets-plugin-freeze/src/Apply/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/Basics/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-freeze/src/Basics/Const/PLUGIN_NAME.tsdeleted file mode 100644index 9e71cf3705..0000000000--- a/packages/sheets-plugin-freeze/src/Basics/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const FROZEN_PLUGIN_NAME = 'freeze';diff --git a/packages/sheets-plugin-freeze/src/Basics/Enum/ACTION_NAMES.ts b/packages/sheets-plugin-freeze/src/Basics/Enum/ACTION_NAMES.tsdeleted file mode 100644index d0f736365d..0000000000--- a/packages/sheets-plugin-freeze/src/Basics/Enum/ACTION_NAMES.ts+++ /dev/null@@ -1,7 +0,0 @@-export enum ACTION_NAMES {- SET_FROZEN_COLUMNS_ACTION = 'SetFrozenColumnsAction',- SET_FROZEN_ROWS_ACTION = 'SetFrozenRowsAction',- SET_FROZEN_CANCEL_ACTION = 'SetFrozenCancelAction',-}--export type ACTION_NAMES_TYPE = `${ACTION_NAMES}`;diff --git a/packages/sheets-plugin-freeze/src/Controller/Freeze.ts b/packages/sheets-plugin-freeze/src/Controller/Freeze.tsdeleted file mode 100644index 89a61b69f4..0000000000--- a/packages/sheets-plugin-freeze/src/Controller/Freeze.ts+++ /dev/null@@ -1,44 +0,0 @@-import { CommandManager, Worksheet, Command, SheetContext } from '@univerjs/core';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export class Freeze {- private _commandManager: CommandManager;-- private _context: SheetContext;-- private _worksheet: Worksheet;-- constructor(workSheet: Worksheet) {- this._context = workSheet.getContext();- this._commandManager = this._context.getCommandManager();- this._worksheet = workSheet;- }-- setFrozenColumns(columns: number): Worksheet {- const { _context, _commandManager } = this;- const configure = {- actionName: ACTION_NAMES.SET_FROZEN_COLUMNS_ACTION,- sheetId: this._worksheet.getSheetId(),- numColumns: columns,- };- const command = new Command(_context.getWorkBook(), configure);- _commandManager.invoke(command);-- return this._worksheet;- }-- setCancelFrozen(): void {}-- setFrozenRows(rows: number): Worksheet {- const { _context, _commandManager } = this;- const configure = {- actionName: ACTION_NAMES.SET_FROZEN_ROWS_ACTION,- sheetId: this._worksheet.getSheetId(),- numRows: rows,- };- const command = new Command(_context.getWorkBook(), configure);- _commandManager.invoke(command);-- return this._worksheet;- }-}diff --git a/packages/sheets-plugin-freeze/src/Controller/index.ts b/packages/sheets-plugin-freeze/src/Controller/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/FreezePlugin.tsx b/packages/sheets-plugin-freeze/src/FreezePlugin.tsxdeleted file mode 100644index 7cbd5de053..0000000000--- a/packages/sheets-plugin-freeze/src/FreezePlugin.tsx+++ /dev/null@@ -1,56 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { FROZEN_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';-import { IConfig } from './IData';-import { en, zh } from './Model/Locale';-import { FreezeButton } from './View/UI/FreezeButton';--export interface IFreezePluginConfig {}--export class FreezePlugin extends Plugin {- SheetPlugin: any;-- constructor(config?: IFreezePluginConfig) {- super(FROZEN_PLUGIN_NAME);- }-- static create(config?: IFreezePluginConfig) {- return new FreezePlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: FROZEN_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <FreezeButton config={config} />,- };- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend comment- this.sheetPlugin?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-freeze/src/IData.ts b/packages/sheets-plugin-freeze/src/IData.tsdeleted file mode 100644index f2e2cc5bac..0000000000--- a/packages/sheets-plugin-freeze/src/IData.ts+++ /dev/null@@ -1 +0,0 @@-export type IConfig = {};diff --git a/packages/sheets-plugin-freeze/src/Model/Const/index.ts b/packages/sheets-plugin-freeze/src/Model/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/Model/Enum/index.ts b/packages/sheets-plugin-freeze/src/Model/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/Model/Locale/en.ts b/packages/sheets-plugin-freeze/src/Model/Locale/en.tsdeleted file mode 100644index c1d4a16375..0000000000--- a/packages/sheets-plugin-freeze/src/Model/Locale/en.ts+++ /dev/null@@ -1,9 +0,0 @@-export default {- frozenLabel: 'Frozen',- frozenRightLabel: 'more Frozen',- frozen: {- one: 'one',- two: 'two',- three: 'three',- },-};diff --git a/packages/sheets-plugin-freeze/src/Model/Locale/index.ts b/packages/sheets-plugin-freeze/src/Model/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-freeze/src/Model/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-freeze/src/Model/Locale/zh.ts b/packages/sheets-plugin-freeze/src/Model/Locale/zh.tsdeleted file mode 100644index e864c45e1d..0000000000--- a/packages/sheets-plugin-freeze/src/Model/Locale/zh.ts+++ /dev/null@@ -1,15 +0,0 @@-export default {- frozen: {- frozenLabel: '冻结首行',- frozenRightLabel: '更多选项',-- default: '冻结首行',- frozenRow: '冻结首行',- frozenColumn: '冻结首列',- frozenRC: '冻结行列',- frozenRowRange: '冻结行到选区',- frozenColumnRange: '冻结列到选区',- frozenRCRange: '冻结行列到选区',- frozenCancel: '取消冻结',- },-};diff --git a/packages/sheets-plugin-freeze/src/Model/Shared/index.ts b/packages/sheets-plugin-freeze/src/Model/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/Types/index.d.ts b/packages/sheets-plugin-freeze/src/Types/index.d.tsdeleted file mode 100644index a81e4f494e..0000000000--- a/packages/sheets-plugin-freeze/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-freeze' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-freeze/src/Types/preact.d.ts b/packages/sheets-plugin-freeze/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-freeze/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-freeze/src/View/Render/index.ts b/packages/sheets-plugin-freeze/src/View/Render/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-freeze/src/View/UI/FreezeButton.tsx b/packages/sheets-plugin-freeze/src/View/UI/FreezeButton.tsxdeleted file mode 100644index 0c6b2f5a2d..0000000000--- a/packages/sheets-plugin-freeze/src/View/UI/FreezeButton.tsx+++ /dev/null@@ -1,139 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, BaseSelectProps, Component, ISelectButton, IToolbarItemProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import { IConfig } from '../../IData';--// interface IProps {-// config: IConfig;-// }--// // Types for state-// interface IState {-// frozen: IToolbarItemProps;-// }--// export class FreezeButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: IProps) {-// // super(props);-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();-// const NextIcon = this.Render.renderFunction('NextIcon');-// const FreezeIcon = this.Render.renderFunction('FreezeIcon');--// this.state = {-// frozen: {-// locale: 'frozen',-// type: 'select',-// label: <FreezeIcon />,-// icon: <NextIcon />,-// show: true,-// border: false,-// selectType: ISelectButton.DOUBLE,-// needChange: false,-// children: [-// {-// locale: 'frozen.default',-// },-// {-// locale: 'frozen.frozenRow',-// },-// {-// locale: 'frozen.frozenColumn',-// },-// {-// locale: 'frozen.frozenRC',-// border: true,-// },-// {-// locale: 'frozen.frozenRowRange',-// },-// {-// locale: 'frozen.frozenColumnRange',-// },-// {-// locale: 'frozen.frozenRCRange',-// },-// {-// locale: 'frozen.frozenCancel',-// border: true,-// },-// ],-// },-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.frozen;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`frozen.${item.locale}Label`);-// item.tooltipRight = locale.get(`frozen.${item.locale}RightLabel`);--// // set current Locale string for select-// item.children?.forEach((ele: IToolbarItemProps) => {-// if (ele.locale) {-// ele.label = locale.get(`${ele.locale}`);-// }-// });-// item.label = typeof item.label === 'object' ? item.label : item.children![0].label;--// return {-// frozen: item,-// };-// });-// }--// /**-// * Render the component's HTML-// *-// * @returns-// */-// render(props: IProps, state: IState) {-// const Select = this.Render.renderFunction('Select');-// const { frozen } = state;-// // Set Provider for entire Container-// return (-// <Select-// tooltip={frozen.tooltip}-// tooltipRight={frozen.tooltipRight}-// border={frozen.border}-// selectType={frozen.selectType}-// needChange={frozen.needChange}-// key={frozen.locale}-// children={frozen.children as BaseSelectProps[]}-// label={frozen.label}-// icon={frozen.icon}-// />-// );-// }-// }diff --git a/packages/sheets-plugin-freeze/src/index.ts b/packages/sheets-plugin-freeze/src/index.tsdeleted file mode 100644index ea077b16e4..0000000000--- a/packages/sheets-plugin-freeze/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { FreezePlugin } from './FreezePlugin';--export { FreezePlugin };diff --git a/packages/sheets-plugin-freeze/src/main.tsx b/packages/sheets-plugin-freeze/src/main.tsxdeleted file mode 100644index 66a0348fd7..0000000000--- a/packages/sheets-plugin-freeze/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new FreezePlugin());diff --git a/packages/sheets-plugin-freeze/tsconfig.json b/packages/sheets-plugin-freeze/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-freeze/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-freeze/vite.config.ts b/packages/sheets-plugin-freeze/vite.config.tsdeleted file mode 100644index 0f2cb30468..0000000000--- a/packages/sheets-plugin-freeze/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginFrozen',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-freeze',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-group/.gitignore b/packages/sheets-plugin-group/.gitignoredeleted file mode 100644index 12e1bd6bec..0000000000--- a/packages/sheets-plugin-group/.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.localdiff --git a/packages/sheets-plugin-group/README-zh.md b/packages/sheets-plugin-group/README-zh.mddeleted file mode 100644index 50c4447e27..0000000000--- a/packages/sheets-plugin-group/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Group 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-group-```--### 使用--```js-import { Group } from '@univerjs/sheets-plugin-group';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Group());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-group/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-group dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-group/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-group build-```diff --git a/packages/sheets-plugin-group/README.md b/packages/sheets-plugin-group/README.mddeleted file mode 100644index f88edc37ce..0000000000--- a/packages/sheets-plugin-group/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Group--### Installation--```shell-npm i @univerjs/sheets-plugin-group-```--### Usage--```js-import { Group } from '@univerjs/sheets-plugin-group';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Group());-```--## 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/sheets-plugin-group/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-group dev-```--### Package--```-# Current directory ./packages/sheets-plugin-group/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-group build-```diff --git a/packages/sheets-plugin-group/index.html b/packages/sheets-plugin-group/index.htmldeleted file mode 100644index e8b1031294..0000000000--- a/packages/sheets-plugin-group/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%;- margin: 0;- }- </style>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo" style="height: 100%;"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-group/jest.config.js b/packages/sheets-plugin-group/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-group/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/packages/sheets-plugin-group/package.json b/packages/sheets-plugin-group/package.jsondeleted file mode 100644index 454862025a..0000000000--- a/packages/sheets-plugin-group/package.json+++ /dev/null@@ -1,63 +0,0 @@-{- "name": "@univerjs/sheets-plugin-group",- "version": "0.0.1",- "description": "UniverSheet normal sheets-plugin-group",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-group.cjs.js",- "module": "./lib/univer-sheets-plugin-group.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-group.cjs.js",- "default": "./lib/univer-sheets-plugin-group.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "serve": "vite preview"- },- "devDependencies": {- "@preact/preset-vite": "2.0.0",- "@testing-library/preact": "^2.0.1",- "@types/jest": "^27.0.1",- "@types/node": "^18.14.0",- "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"- },- "dependencies": {- "@univerjs/base-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}\ No newline at end of filediff --git a/packages/sheets-plugin-group/src/Action/RegisterAction.ts b/packages/sheets-plugin-group/src/Action/RegisterAction.tsdeleted file mode 100644index daab9c2e8a..0000000000--- a/packages/sheets-plugin-group/src/Action/RegisterAction.ts+++ /dev/null@@ -1,7 +0,0 @@-import { CommandManager } from '@univerjs/core';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';-import { SetCollapseAllColumnGroupsAction } from './SetCollapseAllColumnGroupsAction';-import { SetCollapseAllRowGroupsAction } from './SetCollapseAllRowGroupsAction';--CommandManager.register(ACTION_NAMES.SET_COLLAPSE_ALL_COLUMN_GROUPS_ACTION, SetCollapseAllColumnGroupsAction);-CommandManager.register(ACTION_NAMES.SET_COLLAPSE_ALL_ROW_GROUPS_ACTION, SetCollapseAllRowGroupsAction);diff --git a/packages/sheets-plugin-group/src/Action/SetCollapseAllColumnGroupsAction.ts b/packages/sheets-plugin-group/src/Action/SetCollapseAllColumnGroupsAction.tsdeleted file mode 100644index 3e0eea0fba..0000000000--- a/packages/sheets-plugin-group/src/Action/SetCollapseAllColumnGroupsAction.ts+++ /dev/null@@ -1,59 +0,0 @@-import { ISheetActionData, SheetActionBase, ActionObservers, ActionType, CommandUnit } from '@univerjs/core';--/**- * @internal- */-export interface ISetCollapseAllColumnGroupsData extends ISheetActionData {}--/**- * Set to collapse all column groups- *- * @internal- */-export class SetCollapseAllColumnGroupsAction extends SheetActionBase<ISetCollapseAllColumnGroupsData, ISetCollapseAllColumnGroupsData> {- constructor(actionData: ISetCollapseAllColumnGroupsData, commandUnit: CommandUnit, observers: ActionObservers) {- super(actionData, commandUnit, observers);- this._doActionData = {- ...actionData,- };- this.do();- this._oldActionData = {- ...actionData,- };- this.validate();- }-- do(): void {- const workSheet = this.getWorkSheet();- // const structGroup = workSheet.getColumnStructGroup();-- // SetCollapseAllColumnGroups(structGroup, GroupOpenType.open);-- this._observers.notifyObservers({- type: ActionType.REDO,- data: this._doActionData,- action: this,- });- }-- redo(): void {- this.do();- }-- undo(): void {- const workSheet = this.getWorkSheet();- // const structGroup = workSheet.getColumnStructGroup();-- // SetCollapseAllColumnGroups(structGroup, GroupOpenType.close);-- this._observers.notifyObservers({- type: ActionType.UNDO,- data: this._oldActionData,- action: this,- });- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-group/src/Action/SetCollapseAllRowGroupsAction.ts b/packages/sheets-plugin-group/src/Action/SetCollapseAllRowGroupsAction.tsdeleted file mode 100644index 39c90bf724..0000000000--- a/packages/sheets-plugin-group/src/Action/SetCollapseAllRowGroupsAction.ts+++ /dev/null@@ -1,59 +0,0 @@-import { ISheetActionData, SheetActionBase, ActionObservers, ActionType, CommandUnit } from '@univerjs/core';--/**- * @internal- */-export interface ISetCollapseAllRowGroupsData extends ISheetActionData {}--/**- * Set to collapse all row groups- *- * @internal- */-export class SetCollapseAllRowGroupsAction extends SheetActionBase<ISetCollapseAllRowGroupsData, ISetCollapseAllRowGroupsData> {- constructor(actionData: ISetCollapseAllRowGroupsData, commandUnit: CommandUnit, observers: ActionObservers) {- super(actionData, commandUnit, observers);- this._doActionData = {- ...actionData,- };- this.do();- this._oldActionData = {- ...actionData,- };- this.validate();- }-- do(): void {- const workSheet = this.getWorkSheet();- // const rowStructGroup = workSheet.getRowStructGroup();-- // SetCollapseAllRowGroups(rowStructGroup, GroupOpenType.open);-- this._observers.notifyObservers({- type: ActionType.REDO,- data: this._doActionData,- action: this,- });- }-- redo(): void {- this.do();- }-- undo(): void {- const workSheet = this.getWorkSheet();- // const rowStructGroup = workSheet.getRowStructGroup();-- // SetCollapseAllRowGroups(rowStructGroup, GroupOpenType.close);-- this._observers.notifyObservers({- type: ActionType.UNDO,- data: this._oldActionData,- action: this,- });- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-group/src/Apply/SetCollapseAllColumnGroups.ts b/packages/sheets-plugin-group/src/Apply/SetCollapseAllColumnGroups.tsdeleted file mode 100644index b75480e6d8..0000000000--- a/packages/sheets-plugin-group/src/Apply/SetCollapseAllColumnGroups.ts+++ /dev/null@@ -1,12 +0,0 @@-import { GroupOpenType, StructGroup } from '../Controller/StructGroup';--/**- *- * @param structGroup- * @param openType- *- * @internal- */-export function SetCollapseAllColumnGroups(structGroup: StructGroup, openType: GroupOpenType) {- structGroup.setAllGroupOpenType(openType);-}diff --git a/packages/sheets-plugin-group/src/Apply/SetCollapseAllRowGroups.ts b/packages/sheets-plugin-group/src/Apply/SetCollapseAllRowGroups.tsdeleted file mode 100644index 9bf55a0682..0000000000--- a/packages/sheets-plugin-group/src/Apply/SetCollapseAllRowGroups.ts+++ /dev/null@@ -1,12 +0,0 @@-import { GroupOpenType, StructGroup } from '../Controller/StructGroup';--/**- *- * @param structGroup- * @param openType- *- * @internal- */-export function SetCollapseAllRowGroups(structGroup: StructGroup, openType: GroupOpenType) {- structGroup.setAllGroupOpenType(openType);-}diff --git a/packages/sheets-plugin-group/src/Basics/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-group/src/Basics/Const/PLUGIN_NAME.tsdeleted file mode 100644index 1ce64b3039..0000000000--- a/packages/sheets-plugin-group/src/Basics/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const GROUP_PLUGIN_NAME = 'group';diff --git a/packages/sheets-plugin-group/src/Basics/Const/index.ts b/packages/sheets-plugin-group/src/Basics/Const/index.tsdeleted file mode 100644index caeb42be51..0000000000--- a/packages/sheets-plugin-group/src/Basics/Const/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './PLUGIN_NAME';diff --git a/packages/sheets-plugin-group/src/Basics/Enum/ACTION_NAMES.ts b/packages/sheets-plugin-group/src/Basics/Enum/ACTION_NAMES.tsdeleted file mode 100644index 293c4e9296..0000000000--- a/packages/sheets-plugin-group/src/Basics/Enum/ACTION_NAMES.ts+++ /dev/null@@ -1,6 +0,0 @@-export enum ACTION_NAMES {- SET_COLLAPSE_ALL_ROW_GROUPS_ACTION = 'SetCollapseAllRowGroupsAction',- SET_COLLAPSE_ALL_COLUMN_GROUPS_ACTION = 'SetCollapseAllColumnGroupsAction',-}--export type ACTION_NAMES_TYPE = `${ACTION_NAMES}`;diff --git a/packages/sheets-plugin-group/src/Basics/Enum/index.ts b/packages/sheets-plugin-group/src/Basics/Enum/index.tsdeleted file mode 100644index 3cc114295e..0000000000--- a/packages/sheets-plugin-group/src/Basics/Enum/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ACTION_NAMES';diff --git a/packages/sheets-plugin-group/src/Basics/Shared/index.ts b/packages/sheets-plugin-group/src/Basics/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-group/src/Basics/index.ts b/packages/sheets-plugin-group/src/Basics/index.tsdeleted file mode 100644index 5694e7c22f..0000000000--- a/packages/sheets-plugin-group/src/Basics/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Const';-export * from './Enum';-export * from '../Locale';diff --git a/packages/sheets-plugin-group/src/Controller/Group.ts b/packages/sheets-plugin-group/src/Controller/Group.tsdeleted file mode 100644index 0aec8523b7..0000000000--- a/packages/sheets-plugin-group/src/Controller/Group.ts+++ /dev/null@@ -1,115 +0,0 @@-import { Nullable } from '@univerjs/core';--/**- *- * Access and modify spreadsheet groups.- *- * @remarks- * Groups are an association between an interval of contiguous rows or columns that can be expanded or collapsed as a unit to hide/show the rows or columns. Each group has a control toggle on the row or column directly before or after the group (depending on settings) that can expand or collapse the group as a whole.--The depth of a group refers to the nested position of the group and how many larger groups contain the group. The collapsed state of a group refers to whether the group should remain collapsed or expanded after a parent group has been expanded. Additionally, at the time that a group is collapsed or expanded, the rows or columns within the group are hidden or set visible, though individual rows or columns can be hidden or set visible irrespective of the collapsed state.-- * @privateRemarks- * zh: 线段组- */-export class Group {- expand: boolean;-- begin: number;-- close: number;-- constructor(begin: number, close: number, expand: boolean) {- this.begin = begin;- this.close = close;- this.expand = expand;- }-}--/**- *- * group at a depth- *- * @privateRemarks- * zh: 组层级- */-export class LayoutGroup {- depth: number;-- group: Group[];-- constructor(depth: number, group: Group[] = []) {- this.depth = depth;- this.group = group;- }-- addGroup(group: Group) {- this.group.push(group);- }-}--/**- *- * List of all groups- *- * @privateRemarks- * zh: 组列表- */-export class GroupList {- private _groups: LayoutGroup[];-- /**- * GroupList- */- constructor() {- this._groups = [];- }-- /**- * find a specific depth level group- *- * @privateRemarks- * zh: 查找指定深度层级分组- *- * @param depth- * @returns- */- getLayoutGroupByDepth(depth: number): Nullable<LayoutGroup> {- for (let i = 0, len = this._groups.length; i < len; i++) {- const group = this._groups[i];- if (group.depth === depth) {- return group;- }- }- return null;- }-- /**- * delete the specified group- *- * @privateRemarks- * zh: 删除指定分组- *- * @param begin- * @param close- * @param depth- */- remove(begin: number, close: number, depth: number) {- const layoutGroup = this.getLayoutGroupByDepth(depth);- // TODO ...- }-- addGroup(group: Group, depth: number) {- const layoutGroup = this.getLayoutGroupByDepth(depth);- if (layoutGroup) {- layoutGroup.addGroup(group);- } else {- // TODO depth = 1 ?- const newLayoutGroup = new LayoutGroup(1);- newLayoutGroup.addGroup(group);- this._groups.push(newLayoutGroup);- }- }-- // overlapping(src: Group): Group {}-}diff --git a/packages/sheets-plugin-group/src/Controller/StructGroup.ts b/packages/sheets-plugin-group/src/Controller/StructGroup.tsdeleted file mode 100644index 3b34d7a294..0000000000--- a/packages/sheets-plugin-group/src/Controller/StructGroup.ts+++ /dev/null@@ -1,204 +0,0 @@-/**- * Types of group line- */-export enum GroupLineType {- prefix,- suffix,- include,- nothing,-}--/**- * Status of group open- */-export enum GroupOpenType {- open,- close,-}--/**- * A group line, including start position, end position, state- */-export class GroupLine {- start: number;-- end: number;-- type: GroupOpenType;-- constructor(start: number, end: number) {- this.start = start;- this.end = end;- this.type = GroupOpenType.open;- }-- isCrossLine(line: GroupLine): GroupLineType {- if (this.start > line.start && this.start < line.end) {- return GroupLineType.prefix;- }- if (this.end < line.end && this.start < line.start) {- return GroupLineType.suffix;- }- if (this.start === line.start && this.end === line.end) {- return GroupLineType.include;- }- return GroupLineType.nothing;- }-}--/**- * A set of GroupLines- */-export class GroupLayout {- lines: GroupLine[];-- constructor() {- this.lines = [];- }-- findCrossLine(line: GroupLine): Map<GroupLineType, GroupLine[]> {- const lines = this.lines;- const length = lines.length;- const table = new Map<GroupLineType, GroupLine[]>();- const include = new Array<GroupLine>();- const prefix = new Array<GroupLine>();- const suffix = new Array<GroupLine>();- for (let i = 0; i < length; i++) {- const item = lines[i];- const type = line.isCrossLine(item);- switch (type) {- case GroupLineType.include: {- include.push(item);- break;- }- case GroupLineType.suffix: {- suffix.push(item);- break;- }- case GroupLineType.prefix: {- prefix.push(item);- break;- }- }- }- if (suffix.length > 0) {- table.set(GroupLineType.suffix, suffix);- }- if (prefix.length > 0) {- table.set(GroupLineType.prefix, prefix);- }- if (include.length > 0) {- table.set(GroupLineType.include, include);- }- return table;- }-- setAllGroupOpenType(type: GroupOpenType) {- this.lines.forEach((line) => (line.type = type));- }-- addGroupLine(line: GroupLine): void {- this.lines.push(line);- }-}--/**- * A set of GroupLayouts- */-export class GroupDepth {- layouts: GroupLayout[];-- findCrossLine(line: GroupLine): Array<Map<GroupLineType, GroupLine[]>> {- const table = new Array<Map<GroupLineType, GroupLine[]>>();- const layouts = this.layouts;- const length = layouts.length;- for (let i = 0; i < length; i++) {- const item = layouts[i];- const result = item.findCrossLine(line);- if (result.size > 0) {- table.push(result);- }- }- return table;- }-- setAllGroupOpenType(type: GroupOpenType) {- this.layouts.forEach((layout) => layout.setAllGroupOpenType(type));- }-- addLineToDepth(depth: number, line: GroupLine): void {- const layouts = this.layouts;- let layout = layouts[depth];- if (layout == null) {- layout = new GroupLayout();- layouts[depth] = layout;- }- layout.addGroupLine(line);- }-}--/**- * Handle GroupDepth- */-export class StructGroup {- protected _groupDepth: GroupDepth;-- constructor() {- this._groupDepth = new GroupDepth();- }-- _processPrefix(line: GroupLine, table: Array<Map<GroupLineType, GroupLine[]>>): void {- let filter: GroupLine[] = [];- let previous = line;- for (let i = 0; i < table.length; i++) {- const element = table[i];- const lines = element.get(GroupLineType.suffix);- filter = filter.concat(lines || []);- }- for (let i = 0; i < filter.length; i++) {- const element = filter[i];- if (i === filter.length - 1) {- line.end = element.end;- element.end = previous.end;- } else {- element.end = previous.end;- previous = element;- }- }- }-- _processSuffix(line: GroupLine, table: Array<Map<GroupLineType, GroupLine[]>>): void {- let filter: GroupLine[] = [];- let previous = line;- for (let i = 0; i < table.length; i++) {- const element = table[i];- const lines = element.get(GroupLineType.prefix);- filter = filter.concat(lines || []);- }- for (let i = 0; i < filter.length; i++) {- const element = filter[i];- if (i === filter.length - 1) {- line.start = element.start;- element.start = previous.start;- } else {- element.start = previous.start;- previous = element;- }- }- }-- _processInclude(line: GroupLine, table: Array<Map<GroupLineType, GroupLine[]>>): void {}-- setAllGroupOpenType(type: GroupOpenType) {- this._groupDepth.setAllGroupOpenType(type);- }-- addGroupLine(line: GroupLine): void {- const groupDepth = this._groupDepth;- const table = groupDepth.findCrossLine(line);- this._processPrefix(line, table);- this._processSuffix(line, table);- this._processInclude(line, table);- this._groupDepth.addLineToDepth(table.length, line);- }-}diff --git a/packages/sheets-plugin-group/src/Controller/index.ts b/packages/sheets-plugin-group/src/Controller/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-group/src/GroupPlugin.tsx b/packages/sheets-plugin-group/src/GroupPlugin.tsxdeleted file mode 100644index 0729f7494a..0000000000--- a/packages/sheets-plugin-group/src/GroupPlugin.tsx+++ /dev/null@@ -1,46 +0,0 @@-import { SheetContext, Plugin, UniverSheet } from '@univerjs/core';-import { GROUP_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';--export interface IGroupPluginConfig {}--// TODO@jerry-// Group affects row and column hiding, registered to RowRulerManager, ColumnRulerManager-export class GroupPlugin extends Plugin {- constructor(config?: IGroupPluginConfig) {- super(GROUP_PLUGIN_NAME);- }-- static create(config?: IGroupPluginConfig) {- return new GroupPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- // const context = this.getContext();- //- // /**- // * load more Locale object- // */- // context.getLocale().load({- // en,- // zh,- // });- //- // const item: IToolbarItemProps = {- // locale: 'group',- // type: ISlotElement.JSX,- // show: true,- // label: <GroupButton />,- // };- // context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-group/src/Locale/en.ts b/packages/sheets-plugin-group/src/Locale/en.tsdeleted file mode 100644index 28616ba8c8..0000000000--- a/packages/sheets-plugin-group/src/Locale/en.ts+++ /dev/null@@ -1,9 +0,0 @@-export default {- groupLabel: 'Group',- groupRightLabel: 'more Group',- group: {- one: 'one',- two: 'two',- three: 'three',- },-};diff --git a/packages/sheets-plugin-group/src/Locale/index.ts b/packages/sheets-plugin-group/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-group/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-group/src/Locale/zh.ts b/packages/sheets-plugin-group/src/Locale/zh.tsdeleted file mode 100644index f33b082c84..0000000000--- a/packages/sheets-plugin-group/src/Locale/zh.ts+++ /dev/null@@ -1,9 +0,0 @@-export default {- groupLabel: '插件',- groupRightLabel: '更多 Group',- group: {- one: '一',- two: '二',- three: '三',- },-};diff --git a/packages/sheets-plugin-group/src/Model/index.ts b/packages/sheets-plugin-group/src/Model/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-group/src/Types/index.d.ts b/packages/sheets-plugin-group/src/Types/index.d.tsdeleted file mode 100644index f74e998af1..0000000000--- a/packages/sheets-plugin-group/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-group' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-group/src/Types/preact.d.ts b/packages/sheets-plugin-group/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-group/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-group/src/View/Render/index.ts b/packages/sheets-plugin-group/src/View/Render/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-group/src/View/UI/GroupButton.tsx b/packages/sheets-plugin-group/src/View/UI/GroupButton.tsxdeleted file mode 100644index b1dbfffbec..0000000000--- a/packages/sheets-plugin-group/src/View/UI/GroupButton.tsx+++ /dev/null@@ -1,114 +0,0 @@-import { Nullable, Observer } from '@univerjs/core';-import { ISelectButton, Component, Icon } from '@univerjs/base-ui';-import { ComponentChild, RenderableProps } from 'preact';--interface IProps {}--export class GroupButton extends Component<IProps> {- private _localeObserver: Nullable<Observer<void>>;-- initialize(props: IProps) {- const group = {- locale: 'group',- type: 'select',- label: <Icon.Data.OrderASCIcon />,- icon: <Icon.NextIcon />,- show: true,- border: false,- selectType: ISelectButton.DOUBLE,- needChange: false,- children: [- {- locale: 'group.one',- icon: <Icon.Data.OrderASCIcon />,- },- {- locale: 'group.two',- icon: <Icon.Data.OrderDESCIcon />,- },- {- locale: 'group.three',- icon: <Icon.Data.OrderIcon />,- },- ],- };-- this.state = {- group,- };- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this.getContext()- .getObserverManager()- .getObserver('onAfterChangeUILocaleObservable', 'core')- ?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver('onAfterChangeUILocaleObservable','core')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- // const locale = this.getContext().getLocale();- // this.setState((prevState: IState) => {- // let item = prevState.group;- // // set current Locale string for tooltip- // item.tooltip = locale.get(`${item.locale}Label`);- // item.tooltipRight = locale.get(`${item.locale}RightLabel`);- //- // // set current Locale string for select- // item.children?.forEach((ele) => {- // if (ele.locale) {- // ele.label = locale.get(`${ele.locale}`);- // }- // });- // item.label = typeof item.label === 'object' ? item.label : item.children![0].label;- //- // return {- // group: item,- // };- // });- }-- render(props: RenderableProps<IProps> | undefined, state: Readonly<{}> | undefined, context: any): ComponentChild {- return undefined;- }-- /**- * Render the component's HTML- *- * @returns {void}- */- // render(props: IProps, state: IState) {- // const { group } = state;- // // Set Provider for entire Container- // return (- // <Select- // tooltip={group.tooltip}- // tooltipRight={group.tooltipRight}- // border={group.border}- // needChange={group.needChange}- // key={group.locale}- // children={group.children as BaseSelectProps[]}- // label={group.label}- // icon={group.icon}- // />- // );- // }-}diff --git a/packages/sheets-plugin-group/src/index.ts b/packages/sheets-plugin-group/src/index.tsdeleted file mode 100644index 2cb728bef2..0000000000--- a/packages/sheets-plugin-group/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { GroupPlugin } from './GroupPlugin';--export { GroupPlugin };diff --git a/packages/sheets-plugin-group/src/main.tsx b/packages/sheets-plugin-group/src/main.tsxdeleted file mode 100644index 9f34a029ed..0000000000--- a/packages/sheets-plugin-group/src/main.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new FilterPlugin());-// univerSheetUp.installPlugin(new GroupPlugin());diff --git a/packages/sheets-plugin-group/tsconfig.json b/packages/sheets-plugin-group/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-group/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-group/vite.config.ts b/packages/sheets-plugin-group/vite.config.tsdeleted file mode 100644index 3115a42d8c..0000000000--- a/packages/sheets-plugin-group/vite.config.ts+++ /dev/null@@ -1,37 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- // lib: {- // entry: resolve('src/index.ts'),- // name: 'BaseStyleUniver',- // formats: ['es', 'umd', 'cjs'],- // fileName: 'index',- // },- // outDir: './lib',- },- 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()],-});diff --git a/packages/sheets-plugin-link/README-zh.md b/packages/sheets-plugin-link/README-zh.mddeleted file mode 100644index 964f4e8bfe..0000000000--- a/packages/sheets-plugin-link/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet InsertLink 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-insert-link-```--### 使用--```js-import { InsertLink } from '@univerjs/sheets-plugin-insert-link';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new InsertLink());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/plugin-insert-link/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-insert-link dev-```--### 打包--```-# 当前目录 ./packages/plugin-insert-link/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-insert-link build-```diff --git a/packages/sheets-plugin-link/README.md b/packages/sheets-plugin-link/README.mddeleted file mode 100644index 210e03af02..0000000000--- a/packages/sheets-plugin-link/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin InsertLink--### Installation--```shell-npm i @univerjs/sheets-plugin-insert-link-```--### Usage--```js-import { InsertLink } from '@univerjs/sheets-plugin-insert-link';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new InsertLink());-```--## 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/plugin-insert-link/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-insert-link dev-```--### Package--```-# Current directory ./packages/plugin-insert-link/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-insert-link build-```diff --git a/packages/sheets-plugin-link/index.html b/packages/sheets-plugin-link/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-link/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-link/jest.config.js b/packages/sheets-plugin-link/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-link/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/packages/sheets-plugin-link/package.json b/packages/sheets-plugin-link/package.jsondeleted file mode 100644index 80b43bd6d8..0000000000--- a/packages/sheets-plugin-link/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-link",- "version": "0.0.1",- "description": "UniverSheet normal plugin insertLink",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-link.cjs.js",- "module": "./lib/univer-sheets-plugin-link.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-link.cjs.js",- "default": "./lib/univer-sheets-plugin-link.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-link/src/Action/ActionLink.ts b/packages/sheets-plugin-link/src/Action/ActionLink.tsdeleted file mode 100644index b165f0d99c..0000000000--- a/packages/sheets-plugin-link/src/Action/ActionLink.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionInsertLink {}diff --git a/packages/sheets-plugin-link/src/Action/IAction.ts b/packages/sheets-plugin-link/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-link/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-link/src/Action/IActionSet.ts b/packages/sheets-plugin-link/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-link/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-link/src/Action/index.ts b/packages/sheets-plugin-link/src/Action/index.tsdeleted file mode 100644index 6aacb88e9d..0000000000--- a/packages/sheets-plugin-link/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionLink';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-link/src/Base/Cache.ts b/packages/sheets-plugin-link/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-link/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-link/src/Base/State.ts b/packages/sheets-plugin-link/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-link/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-link/src/Base/index.ts b/packages/sheets-plugin-link/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-link/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-link/src/Conflict/ConflictLink.ts b/packages/sheets-plugin-link/src/Conflict/ConflictLink.tsdeleted file mode 100644index 281baca7f3..0000000000--- a/packages/sheets-plugin-link/src/Conflict/ConflictLink.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictInsertLink {}diff --git a/packages/sheets-plugin-link/src/Conflict/IConflict.ts b/packages/sheets-plugin-link/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-link/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-link/src/Conflict/index.ts b/packages/sheets-plugin-link/src/Conflict/index.tsdeleted file mode 100644index dd9dc24972..0000000000--- a/packages/sheets-plugin-link/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictLink';diff --git a/packages/sheets-plugin-link/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-link/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index 19df146bad..0000000000--- a/packages/sheets-plugin-link/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const LINK_PLUGIN_NAME = 'link';diff --git a/packages/sheets-plugin-link/src/Const/index.ts b/packages/sheets-plugin-link/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-link/src/Domain/Link.ts b/packages/sheets-plugin-link/src/Domain/Link.tsdeleted file mode 100644index ac337e2abe..0000000000--- a/packages/sheets-plugin-link/src/Domain/Link.ts+++ /dev/null@@ -1 +0,0 @@-export class Link {}diff --git a/packages/sheets-plugin-link/src/Domain/index.ts b/packages/sheets-plugin-link/src/Domain/index.tsdeleted file mode 100644index 3db78f51f0..0000000000--- a/packages/sheets-plugin-link/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Link';diff --git a/packages/sheets-plugin-link/src/Enum/index.ts b/packages/sheets-plugin-link/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-link/src/IData/ILink.ts b/packages/sheets-plugin-link/src/IData/ILink.tsdeleted file mode 100644index 964fd78160..0000000000--- a/packages/sheets-plugin-link/src/IData/ILink.ts+++ /dev/null@@ -1,8 +0,0 @@-import { SheetContext } from '@univerjs/core';--export type IConfig = {- context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-link/src/IData/index.ts b/packages/sheets-plugin-link/src/IData/index.tsdeleted file mode 100644index ef6463f8a8..0000000000--- a/packages/sheets-plugin-link/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ILink';diff --git a/packages/sheets-plugin-link/src/LinkPlugin.tsx b/packages/sheets-plugin-link/src/LinkPlugin.tsxdeleted file mode 100644index d55abbefc0..0000000000--- a/packages/sheets-plugin-link/src/LinkPlugin.tsx+++ /dev/null@@ -1,51 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { en, zh } from './Locale';-import { LinkButton } from './UI/LinkButton';--import { IConfig } from './IData/ILink';-import { LINK_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface ILinkPluginConfig {}--export class LinkPlugin extends Plugin {- constructor(config?: ILinkPluginConfig) {- super(LINK_PLUGIN_NAME);- }-- static create(config?: ILinkPluginConfig) {- return new LinkPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = { context };-- const item: IToolbarItemProps = {- locale: LINK_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <LinkButton config={config} />,- };- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-link/src/Locale/en.ts b/packages/sheets-plugin-link/src/Locale/en.tsdeleted file mode 100644index 84e1c3b51a..0000000000--- a/packages/sheets-plugin-link/src/Locale/en.ts+++ /dev/null@@ -1,18 +0,0 @@-export default {- insertLink: {- insertLinkLabel: 'InsertLink',- linkText: 'Text',- linkType: 'Link type',- external: 'External link',- internal: 'Internal link',- linkAddress: 'Link address',- linkSheet: 'Worksheet',- linkCell: 'Cell reference',- linkTooltip: 'Tooltip',- placeholder1: 'Please enter the web link address',- placeholder2: 'Please enter the cell to be quoted, example A1',- placeholder3: 'Please enter the prompt content',- tooltipInfo1: 'Please enter a valid link',- tooltipInfo2: 'Please enter the correct cell reference',- },-};diff --git a/packages/sheets-plugin-link/src/Locale/index.ts b/packages/sheets-plugin-link/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-link/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-link/src/Locale/zh.ts b/packages/sheets-plugin-link/src/Locale/zh.tsdeleted file mode 100644index 0dd4c3fd57..0000000000--- a/packages/sheets-plugin-link/src/Locale/zh.ts+++ /dev/null@@ -1,18 +0,0 @@-export default {- insertLink: {- insertLinkLabel: '插入链接',- linkText: '文本',- linkType: '链接类型',- external: '外部链接',- internal: '内部链接',- linkAddress: '链接地址',- linkSheet: '工作表',- linkCell: '单元格引用',- linkTooltip: '提示',- placeholder1: '请输入网页链接地址',- placeholder2: '请输入要引用的单元格,例A1',- placeholder3: '请输入提示内容',- tooltipInfo1: '请输入有效的链接',- tooltipInfo2: '请输入正确的单元格引用',- },-};diff --git a/packages/sheets-plugin-link/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-link/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-link/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-link/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-link/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-link/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-link/src/ProxyData/ProxyDataLink.ts b/packages/sheets-plugin-link/src/ProxyData/ProxyDataLink.tsdeleted file mode 100644index ddf6e06c83..0000000000--- a/packages/sheets-plugin-link/src/ProxyData/ProxyDataLink.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataLink {}diff --git a/packages/sheets-plugin-link/src/ProxyData/index.ts b/packages/sheets-plugin-link/src/ProxyData/index.tsdeleted file mode 100644index 3f863433d7..0000000000--- a/packages/sheets-plugin-link/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataLink';diff --git a/packages/sheets-plugin-link/src/Service/LinkService.ts b/packages/sheets-plugin-link/src/Service/LinkService.tsdeleted file mode 100644index e17bd6012a..0000000000--- a/packages/sheets-plugin-link/src/Service/LinkService.ts+++ /dev/null@@ -1 +0,0 @@-export class LinkService {}diff --git a/packages/sheets-plugin-link/src/Service/index.ts b/packages/sheets-plugin-link/src/Service/index.tsdeleted file mode 100644index 9b718b6864..0000000000--- a/packages/sheets-plugin-link/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './LinkService';diff --git a/packages/sheets-plugin-link/src/Shared/index.ts b/packages/sheets-plugin-link/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-link/src/Types/index.d.ts b/packages/sheets-plugin-link/src/Types/index.d.tsdeleted file mode 100644index 470ba38fe0..0000000000--- a/packages/sheets-plugin-link/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-link' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-link/src/Types/preact.d.ts b/packages/sheets-plugin-link/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-link/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-link/src/UI/LinkButton.tsx b/packages/sheets-plugin-link/src/UI/LinkButton.tsxdeleted file mode 100644index 4da8999950..0000000000--- a/packages/sheets-plugin-link/src/UI/LinkButton.tsx+++ /dev/null@@ -1,135 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component, IToolbarItemProps, ModalProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { Icon } from '@univerjs/style-univer';-// import { IProps } from '../IData/ILink';-// import styles from './index.module.less';-// import { LinkContent } from './LinkContent';--// // Types for state-// interface IState {-// insertLink: IToolbarItemProps;-// modalData: ModalProps[];-// }--// const insertLink: IToolbarItemProps = {-// locale: 'toolbar.insertLink',-// type: 'single',-// label: <Icon.Insert.LinkIcon />,-// show: true,-// };--// export class LinkButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: IProps) {-// // super(props);-// const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// insertLink,-// modalData: [-// {-// locale: 'insertLink.insertLinkLabel',-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'button.cancel',-// },-// ],-// show: false,-// children: <LinkContent config={this.props} />,-// onCancel: () => this.showModal(0, false),-// },-// ],-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.insertLink;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}`);--// let modalData = prevState.modalData;-// modalData.forEach((ele) => {-// ele.title = locale.get(ele.locale!);-// if (ele.group && ele.group.length) {-// ele.group.forEach((node) => {-// node.label = locale.get(node.locale!);-// });-// }-// });--// return {-// insertLink: item,-// modalData,-// };-// });-// }--// showModal = (index: number, isShow: boolean) => {-// let { modalData } = this.state;-// modalData[index].show = isShow;-// this.setState((prevState) => ({-// modalData,-// }));-// };--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Button = this.Render.renderFunction('Button');-// const Modal = this.Render.renderFunction('Modal');--// // eslint-disable-next-line @typescript-eslint/no-shadow-// const { insertLink, modalData } = state;-// // Set Provider for entire Container-// return (-// <div className={styles.singleButton}>-// <Button type="text" onClick={() => this.showModal(0, true)}>-// {insertLink.label}-// </Button>-// {modalData.map((item) => {-// if (!item.show) return;-// return <Modal title={item.title} visible={item.show} group={item.group} children={item.children} onCancel={item.onCancel}></Modal>;-// })}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-link/src/UI/LinkContent.tsx b/packages/sheets-plugin-link/src/UI/LinkContent.tsxdeleted file mode 100644index fc754b5513..0000000000--- a/packages/sheets-plugin-link/src/UI/LinkContent.tsx+++ /dev/null@@ -1,192 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { IProps } from '../IData';-// import styles from './index.module.less';--// type LinkContentProps = {-// config: IProps;-// };-// type LinkContentBaseProps = {-// name: string;-// show: boolean;-// label?: string;-// type: string;-// id: string;-// placeholder?: {-// name?: string;-// label?: string;-// };-// children?: Array<Record<string, string>>;-// onChange?: (e: Event) => void;-// };-// type LinkContentState = {-// data: LinkContentBaseProps[];-// type: string;-// };-// export class LinkContent extends Component<LinkContentProps, LinkContentState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: LinkContentProps) {-// // super(props);-// const component = this.props.config.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// this.state = {-// data: [-// {-// name: 'insertLink.linkText',-// show: true,-// type: 'single',-// id: 'linkText',-// },-// {-// name: 'insertLink.linkType',-// show: true,-// type: 'select',-// id: 'linkType',-// onChange: (e: Event) => this.changeLinkType(e),-// children: [-// {-// name: 'insertLink.external',-// value: 'external',-// },-// {-// name: 'insertLink.internal',-// value: 'internal',-// },-// ],-// },-// {-// name: 'insertLink.linkAddress',-// show: true,-// type: 'single',-// id: 'linkAddress',-// placeholder: { name: 'insertLink.placeholder1' },-// },-// {-// name: 'insertLink.linkSheet',-// id: 'linkSheet',-// show: false,-// type: 'select',-// },-// {-// name: 'insertLink.linkCell',-// show: false,-// id: 'linkCell',-// type: 'single',-// placeholder: { name: 'insertLink.placeholder2' },-// },-// {-// name: 'insertLink.linkTooltip',-// show: true,-// id: 'linkTooltip',-// type: 'single',-// placeholder: { name: 'insertLink.placeholder3' },-// },-// ],-// type: 'single',-// };-// }--// setValue = (value: object, fn?: () => void) => {-// this.setState(-// (prevState) => ({-// ...value,-// }),-// fn-// );-// };--// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState) => {-// let { data } = prevState;-// data.forEach((item) => {-// item.label = locale.get(item.name);-// if (item.children && item.children.length) {-// item.children.forEach((ele) => {-// ele.label = locale.get(ele.name);-// });-// }-// if (item.placeholder) {-// item.placeholder.label = locale.get(item.placeholder.name);-// }-// });--// return {-// data,-// };-// });-// }--// changeLinkType = (e: Event) => {-// const target = e.target as HTMLSelectElement;-// let { data } = this.state;-// const addressIndex = data.findIndex((item) => item.id === 'linkAddress');-// const sheetIndex = data.findIndex((item) => item.id === 'linkSheet');-// const cellIndex = data.findIndex((item) => item.id === 'linkCell');-// if (target.value === 'external') {-// data[addressIndex].show = true;-// data[sheetIndex].show = false;-// data[cellIndex].show = false;-// } else {-// data[addressIndex].show = false;-// data[sheetIndex].show = true;-// data[cellIndex].show = true;-// }-// this.setValue({ data });-// };--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// render(props: LinkContentProps, state: LinkContentState) {-// const Input = this.Render.renderFunction('Input');-// const { data } = state;-// return (-// <div className={styles.insertContent}>-// {data.map((item) => {-// if (!item.show) return <></>;-// if (item.type === 'single') {-// return (-// <div>-// <label for={item.id}>{item.label}:</label>-// <Input id={item.id} type="text" placeholder={item.placeholder?.label}></Input>-// </div>-// );-// }-// return (-// <div>-// <label for={item.id}>{item.label}:</label>-// <select-// id={item.id}-// onChange={(e) => {-// item.onChange?.(e);-// }}-// >-// {item.children?.map((ele) => (-// <option value={ele.value}>{ele.label}</option>-// ))}-// </select>-// </div>-// );-// })}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-link/src/UI/index.module.less b/packages/sheets-plugin-link/src/UI/index.module.lessdeleted file mode 100644index 495d7c7c27..0000000000--- a/packages/sheets-plugin-link/src/UI/index.module.less+++ /dev/null@@ -1,30 +0,0 @@-.single-button {- .insert-content {- font-size: 12px;-- > div {- margin-bottom: 1.2em;-- &:last-of-type {- margin-bottom: 0;- }- }-- label {- width: 6em;- text-align: right;- display: inline-block;- margin-right: 1em;- }-- input {- width: 50%;- height: 2em;- }-- select {- height: 2em;- width: 50%;- }- }-}diff --git a/packages/sheets-plugin-link/src/View/Event.ts b/packages/sheets-plugin-link/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-link/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-link/src/View/ObserverList.ts b/packages/sheets-plugin-link/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-link/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-link/src/View/Render.ts b/packages/sheets-plugin-link/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-link/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-link/src/View/index.ts b/packages/sheets-plugin-link/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-link/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-link/src/index.ts b/packages/sheets-plugin-link/src/index.tsdeleted file mode 100644index d71bfd6bfe..0000000000--- a/packages/sheets-plugin-link/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { LinkPlugin } from './LinkPlugin';--export { LinkPlugin };diff --git a/packages/sheets-plugin-link/src/main.tsx b/packages/sheets-plugin-link/src/main.tsxdeleted file mode 100644index 43c5f65a33..0000000000--- a/packages/sheets-plugin-link/src/main.tsx+++ /dev/null@@ -1,13 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-// import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};-const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-// univerSheetUp.installPlugin(new UniverComponentSheet());-// univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new LinkPlugin());diff --git a/packages/sheets-plugin-link/tsconfig.json b/packages/sheets-plugin-link/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-link/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-link/vite.config.ts b/packages/sheets-plugin-link/vite.config.tsdeleted file mode 100644index 808c6eab5b..0000000000--- a/packages/sheets-plugin-link/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginInsertLink',- formats: ['es', 'umd', 'cjs'],- fileName: 'universheet-plugin-insert-link',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-numfmt/src/Basics/Const/CONFIG.ts b/packages/sheets-plugin-numfmt/src/Basics/Const/CONFIG.tsindex 4da81d21ee..9217b882a2 100644--- a/packages/sheets-plugin-numfmt/src/Basics/Const/CONFIG.ts+++ b/packages/sheets-plugin-numfmt/src/Basics/Const/CONFIG.ts@@ -1,3 +1,3 @@-export const NumftmConfig = {+export const NumfmtConfig = {show: true,};diff --git a/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts b/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.tsindex 9982bf7324..cbb6698046 100644--- a/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts+++ b/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts@@ -1,110 +1,105 @@import {- PLUGIN_NAMES,ObjectMatrixPrimitiveType,Command,ObjectMatrix,IRangeData,Range,ACTION_NAMES as CORE_ACTION_NAME,- ICellData,- ActionOperation,- ISetRangeDataActionData,- SheetContext,+ CommandManager,+ ICurrentUniverService} from '@univerjs/core';import { BaseComponentRender } from '@univerjs/base-ui';-import { ISheetContext, SheetPlugin } from '@univerjs/base-sheets';-import { numfmt } from '@univerjs/base-numfmt-engine';-import { IToolbarItemProps, SHEET_UI_PLUGIN_NAME, SheetUIPlugin } from '@univerjs/ui-plugin-sheets';-import { ACTION_NAMES } from '../Basics/Enum';+import { ISelectionManager, SelectionManager } from '@univerjs/base-sheets';+import { IToolbarItemProps, SheetContainerUIController } from '@univerjs/ui-plugin-sheets';+import styles from '../View/UI/index.module.less';import { NumfmtPlugin } from '../NumfmtPlugin';-import { DEFAULT_DATA, NUMFMT_PLUGIN_NAME, NumftmConfig } from '../Basics/Const';+import { DEFAULT_DATA, NUMFMT_PLUGIN_NAME, NumfmtConfig } from '../Basics/Const';import { NumfmtModel } from '../Model/NumfmtModel';--import styles from '../View/UI/index.module.less';+import { Inject, Injector } from '@wendellhu/redi';+import { NumfmtModalController } from './NumfmtModalController';export class NumfmtController {- protected _sheetPlugin: SheetPlugin;-protected _numfmtList: IToolbarItemProps;protected _model: NumfmtModel;- protected _plugin: NumfmtPlugin;-- protected _sheetUIPlugin: SheetUIPlugin;-protected _render: BaseComponentRender;// eslint-disable-next-line max-lines-per-function- constructor(@ISheetContext private readonly sheetContext: SheetContext, plugin: NumfmtPlugin) {- this._sheetUIPlugin = plugin.getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);+ constructor(+ plugin: NumfmtPlugin,+ @Inject(ISelectionManager) private readonly _selectionManager: SelectionManager,+ @Inject(CommandManager) private readonly _commandManager: CommandManager,+ @Inject(SheetContainerUIController) private readonly _sheetContainerUIController: SheetContainerUIController,+ @Inject(Injector) private readonly _numfmtInjector: Injector,+ @Inject(ICurrentUniverService) private readonly _currentUniverService: ICurrentUniverService,+ @Inject(NumfmtModalController) private readonly _numfmtModalController: NumfmtModalController+ ) {this._model = new NumfmtModel();- this._plugin = plugin;- this._sheetPlugin = this._plugin.getContext().getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)!;- const executeFormatter = (type: string): void => {- const manager = this._sheetPlugin.getSelectionManager();- const workbook = this._plugin.getContext().getWorkBook();- const activeSheet = workbook.getActiveSheet();- const activeRange = manager.getActiveRangeList();- const cellMatrix = activeSheet.getCellMatrix();- if (activeRange == null) {- return;- }- // update cell data- activeRange.getRangeList().forEach((range) => {- let matrix = new ObjectMatrix<ICellData>();- Range.foreach(range, (row, col) => {- const cell = cellMatrix.getValue(row, col);- if (cell) {- const formatter = numfmt(type);- matrix.setValue(row, col, { v: cell.v, m: formatter(cell.v) });- }- });- const setRangeDataAction: ISetRangeDataActionData = {- sheetId: activeSheet.getSheetId(),- cellValue: matrix.getData(),- actionName: CORE_ACTION_NAME.SET_RANGE_DATA_ACTION,- };- const newSetRangeDataAction = ActionOperation.make<ISetRangeDataActionData>(setRangeDataAction).removeExtension().getAction();- const cmd = new Command({ WorkBookUnit: workbook }, newSetRangeDataAction);- workbook.getCommandManager().invoke(cmd);- });- // update numfmt data- activeRange.getRangeList().forEach((range) => {- let matrix = new ObjectMatrix();- Range.foreach(range, (row, col) => {- matrix.setValue(row, col, type);- });- const setNumfmtRangeDataAction = {- sheetId: activeSheet.getSheetId(),- actionName: ACTION_NAMES.SET_NUMFMT_RANGE_DATA_ACTION,- numfmtMatrix: matrix.getData(),- };- const cmd = new Command({ WorkBookUnit: workbook }, setNumfmtRangeDataAction);- cmd.invoke();- });- };+ // const executeFormatter = (type: string): void => {+ // const manager = this._sheetPlugin.getSelectionManager();+ // const workbook = this._plugin.getContext().getWorkBook();+ // const activeSheet = workbook.getActiveSheet();+ // const activeRange = manager.getActiveRangeList();+ // const cellMatrix = activeSheet.getCellMatrix();+ // if (activeRange == null) {+ // return;+ // }+ // // update cell data+ // activeRange.getRangeList().forEach((range) => {+ // let matrix = new ObjectMatrix<ICellData>();+ // Range.foreach(range, (row, col) => {+ // const cell = cellMatrix.getValue(row, col);+ // if (cell) {+ // const formatter = numfmt(type);+ // matrix.setValue(row, col, { v: cell.v, m: formatter(cell.v) });+ // }+ // });+ // const setRangeDataAction: ISetRangeDataActionData = {+ // sheetId: activeSheet.getSheetId(),+ // cellValue: matrix.getData(),+ // actionName: CORE_ACTION_NAME.SET_RANGE_DATA_ACTION,+ // };+ // const newSetRangeDataAction = ActionOperation.make<ISetRangeDataActionData>(setRangeDataAction).removeExtension().getAction();+ // const cmd = new Command({ WorkBookUnit: workbook }, newSetRangeDataAction);+ // workbook.getCommandManager().invoke(cmd);+ // });+ // // update numfmt data+ // activeRange.getRangeList().forEach((range) => {+ // let matrix = new ObjectMatrix();+ // Range.foreach(range, (row, col) => {+ // matrix.setValue(row, col, type);+ // });+ // const setNumfmtRangeDataAction = {+ // sheetId: activeSheet.getSheetId(),+ // actionName: ACTION_NAMES.SET_NUMFMT_RANGE_DATA_ACTION,+ // numfmtMatrix: matrix.getData(),+ // };+ // const cmd = new Command({ WorkBookUnit: workbook }, setNumfmtRangeDataAction);+ // cmd.invoke();+ // });+ // };const CHILDREN_DATA = DEFAULT_DATA.map((item, index) => ({onClick: () => {switch (index) {case 0: {- executeFormatter('G');+ //executeFormatter('G');break;}case 1: {- executeFormatter('@');+ //executeFormatter('@');break;}case 2: {- executeFormatter('#.##');+ //executeFormatter('#.##');break;}case 3: {- executeFormatter('#.##%');+ //executeFormatter('#.##%');break;}case 4: {- executeFormatter('#.##E+');+ //executeFormatter('#.##E+');break;}case 5: {@@ -112,7 +107,7 @@ export class NumfmtController {break;}case 6: {- executeFormatter('¥#.##');+ //executeFormatter('¥#.##');break;}case 7: {@@ -120,23 +115,23 @@ export class NumfmtController {break;}case 8: {- executeFormatter('yyyy-mm-dd');+ //executeFormatter('yyyy-mm-dd');break;}case 9: {- executeFormatter('h:mm AM/PM');+ //executeFormatter('h:mm AM/PM');break;}case 10: {- executeFormatter('h:mm');+ //executeFormatter('h:mm');break;}case 11: {- executeFormatter('yyyy-mm-dd h:mm AM/PM');+ //executeFormatter('yyyy-mm-dd h:mm AM/PM');break;}case 12: {- executeFormatter('yyyy-mm-dd h:mm');+ //executeFormatter('yyyy-mm-dd h:mm');break;}case 13: {@@ -151,7 +146,7 @@ export class NumfmtController {type: 0,label: 'toolbar.moreFormats',className: styles.customFormat,- show: NumftmConfig.show,+ show: NumfmtConfig.show,border: true,children: [...CHILDREN_DATA,@@ -163,26 +158,26 @@ export class NumfmtController {{label: 'format.moreCurrency',onClick: () => {- this._plugin.getNumfmtModalController().showModal('currency', true);+ this._numfmtModalController.showModal('currency', true);},},{label: 'format.moreDateTime',onClick: () => {- this._plugin.getNumfmtModalController().showModal('date', true);+ this._numfmtModalController.showModal('date', true);},},{label: 'format.moreNumber',onClick: () => {- this._plugin.getNumfmtModalController().showModal('number', true);+ this._numfmtModalController.showModal('number', true);},},],},],};- this._sheetUIPlugin.addToolButton(this._numfmtList);+ this._sheetContainerUIController.getToolbarController().addToolbarConfig(this._numfmtList);}getNumfmtBySheetIdConfig(sheetId: string): ObjectMatrixPrimitiveType<string> {@@ -194,8 +189,7 @@ export class NumfmtController {Range.foreach(numfmtRange, (row, column) => {numfmtMatrix.setValue(row, column, numfmtValue);});- const pluginContext = this._plugin.getContext();- const commandManager = pluginContext.getCommandManager();+ const commandManager = this._commandManager;const config = {actionName: CORE_ACTION_NAME.SET_RANGE_DATA_ACTION,sheetId,@@ -204,7 +198,7 @@ export class NumfmtController {};const command = new Command({- WorkBookUnit: pluginContext.getWorkBook(),+ WorkBookUnit: this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook(),},config);@@ -215,8 +209,7 @@ export class NumfmtController {const numfmtMatrix = new ObjectMatrix<string>();numfmtMatrix.setValue(row, column, numfmt);const numfmtRange: IRangeData = { startRow: row, startColumn: column, endRow: row, endColumn: column };- const pluginContext = this._plugin.getContext();- const commandManager = pluginContext.getCommandManager();+ const commandManager = this._commandManager;const config = {actionName: CORE_ACTION_NAME.SET_RANGE_DATA_ACTION,sheetId,@@ -225,7 +218,7 @@ export class NumfmtController {};const command = new Command({- WorkBookUnit: pluginContext.getWorkBook(),+ WorkBookUnit: this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook(),},config);diff --git a/packages/sheets-plugin-numfmt/src/Controller/NumfmtModalController.ts b/packages/sheets-plugin-numfmt/src/Controller/NumfmtModalController.tsindex f244e54dbc..139823ea8c 100644--- a/packages/sheets-plugin-numfmt/src/Controller/NumfmtModalController.ts+++ b/packages/sheets-plugin-numfmt/src/Controller/NumfmtModalController.ts@@ -1,7 +1,8 @@-import { ComponentChildren } from '@univerjs/base-ui';+import { ComponentChildren, ComponentManager } from '@univerjs/base-ui';import { SheetPlugin } from '@univerjs/base-sheets';-import { Locale, PLUGIN_NAMES } from '@univerjs/core';-import { SHEET_UI_PLUGIN_NAME, SheetUIPlugin } from '@univerjs/ui-plugin-sheets';+import { LocaleService, ObserverManager } from '@univerjs/core';+import { SheetUIPlugin } from '@univerjs/ui-plugin-sheets';+import { Inject } from '@wendellhu/redi';import { NumfmtPlugin } from '../NumfmtPlugin';import { FormatContent } from '../View/UI/FormatContent';import { NumfmtModal } from '../View/UI/NumfmtModal';@@ -39,9 +40,11 @@ export class NumfmtModalController {protected _modalData: ModalDataProps[];- constructor(numfmtPlugin: NumfmtPlugin) {- const locale: Locale = numfmtPlugin.getGlobalContext().getLocale();- this._numfmtPlugin = numfmtPlugin;+ constructor(+ @Inject(ObserverManager) private readonly _observerManager: ObserverManager,+ @Inject(LocaleService) private readonly _localeService: LocaleService,+ @Inject(ComponentManager) private readonly _componentManager: ComponentManager+ ) {this._modalData = [{locale: 'toolbar.currencyFormat',@@ -62,8 +65,8 @@ export class NumfmtModalController {name: NUMFMT_PLUGIN_NAME + FormatContent.name,props: {data: this.resetContentData(CURRENCYDETAIL),+ input: this._localeService.getLocale().get('format.decimalPlaces'),onClick: (value: string) => console.dir(value),- input: locale.get('format.decimalPlaces'),onChange: (value: string) => console.dir(value),},},@@ -120,18 +123,16 @@ export class NumfmtModalController {},},];- this._sheetPlugin = numfmtPlugin.getContext().getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)!;- this._sheetUIPlugin = numfmtPlugin.getGlobalContext().getPluginManager().getRequirePluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME);- this._sheetUIPlugin.getComponentManager().register(NUMFMT_PLUGIN_NAME + FormatContent.name, FormatContent);- this._sheetUIPlugin.getComponentManager().register(NUMFMT_PLUGIN_NAME + NumfmtModal.name, NumfmtModal);- this._numfmtPlugin.getObserver('onNumfmtModalDidMountObservable')!.add((component): void => {+ this._componentManager.register(NUMFMT_PLUGIN_NAME + FormatContent.name, FormatContent);+ this._componentManager.register(NUMFMT_PLUGIN_NAME + NumfmtModal.name, NumfmtModal);+ this._observerManager.getObserver<NumfmtModal>('onNumfmtModalDidMountObservable')!.add((component): void => {this._numfmtModal = component;this.resetModalData();});}resetContentData(data: any[]): any[] {- const locale = this._numfmtPlugin.getGlobalContext().getLocale();+ const locale = this._localeService.getLocale();for (let i = 0; i < data.length; i++) {if (data[i].locale) {data[i].label = locale.get(data[i].locale);@@ -142,7 +143,7 @@ export class NumfmtModalController {// 渲染所需数据resetModalData(): void {- const locale: Locale = this._numfmtPlugin.getGlobalContext().getLocale();+ const locale = this._localeService.getLocale();this._modalData.forEach((item) => {item.title = locale.get(item.locale);if (item.group && item.group.length) {diff --git a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.tsindex cb736256d1..48b75d183d 100644--- a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts+++ b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts@@ -1,49 +1,47 @@-import { IRenderingEngine, RenderEngine } from '@univerjs/base-render';-import { ISheetContext } from '@univerjs/base-sheets';-import { IRangeData, ObjectMatrixPrimitiveType, Plugin, PLUGIN_NAMES, SheetContext } from '@univerjs/core';-import { Injector } from '@wendellhu/redi';+import { CommandManager, IRangeData, LocaleService, ObjectMatrixPrimitiveType, Plugin, PluginType, SheetContext } from '@univerjs/core';+import { Dependency, Inject, Injector } from '@wendellhu/redi';import { NUMFMT_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';import { install, NumfmtPluginObserve } from './Basics/Observer';-import { NumfmtActionExtensionFactory } from './Basics/Register/NumfmtActionExtension';-import { NumfmtController } from './Controller/NumfmtController';-import { NumfmtModalController } from './Controller/NumfmtModalController';import en from './Locale/en';import zh from './Locale/zh';+import { NumfmtController } from './Controller/NumfmtController';+import { NumfmtActionExtensionFactory } from './Basics/Register/NumfmtActionExtension';+import { NumfmtModalController } from './Controller/NumfmtModalController';export interface INumfmtPluginConfig {}export class NumfmtPlugin extends Plugin<NumfmtPluginObserve, SheetContext> {+ static override type = PluginType.Sheet;+private _numfmtController: NumfmtController;private _numfmtModalController: NumfmtModalController;- private _injector: Injector;-private _numfmtActionExtensionFactory: NumfmtActionExtensionFactory;- constructor(config?: INumfmtPluginConfig) {+ constructor(+ config: Partial<INumfmtPluginConfig>,+ @Inject(LocaleService) private readonly _localeService: LocaleService,+ @Inject(Injector) private readonly _sheetInjector: Injector,+ @Inject(CommandManager) private readonly _commandManager: CommandManager+ ) {super(NUMFMT_PLUGIN_NAME);- this.initializeDependencies();- }-- static create(config?: INumfmtPluginConfig): NumfmtPlugin {- return new NumfmtPlugin(config);+ this.initializeDependencies(_sheetInjector);}- onMounted(context: SheetContext): void {+ override onMounted(): void {install(this);- console.log('NumfmtPlugin onMounted');- this.getLocale().load({ en, zh });+ this._localeService.getLocale().load({ en, zh });this._numfmtActionExtensionFactory = new NumfmtActionExtensionFactory(this);- this._numfmtController = this._injector.get(NumfmtController);- this._numfmtModalController = this._injector.get(NumfmtModalController);- const actionRegister = this.context.getCommandManager().getActionExtensionManager().getRegister();+ this._numfmtController = this._sheetInjector.get(NumfmtController);+ this._numfmtModalController = this._sheetInjector.get(NumfmtModalController);+ const actionRegister = this._commandManager.getActionExtensionManager().getRegister();actionRegister.add(this._numfmtActionExtensionFactory);}- onDestroy(): void {+ override onDestroy(): void {super.onDestroy();- const actionRegister = this.context.getCommandManager().getActionExtensionManager().getRegister();+ const actionRegister = this._commandManager.getActionExtensionManager().getRegister();actionRegister.delete(this._numfmtActionExtensionFactory);}@@ -63,12 +61,15 @@ export class NumfmtPlugin extends Plugin<NumfmtPluginObserve, SheetContext> {return this._numfmtModalController;}- private initializeDependencies(): void {- this._injector = new Injector([- [ISheetContext, { useFactory: () => this.getContext() }],- [IRenderingEngine, { useFactory: () => this.getGlobalContext().getPluginManager().getRequirePluginByName<RenderEngine>(PLUGIN_NAMES.BASE_RENDER).getEngine() }],- [NumfmtController],- [NumfmtModalController],- ]);+ private initializeDependencies(sheetInjector: Injector): void {+ // this._injector = new Injector([+ // [IRenderingEngine, { useFactory: () => this.getGlobalContext().getPluginManager().getRequirePluginByName<RenderEngine>(PLUGIN_NAMES.BASE_RENDER).getEngine() }],+ // [NumfmtController],+ // [NumfmtModalController],+ // ]);+ const dependencies: Dependency[] = [[NumfmtController], [NumfmtModalController]];+ dependencies.forEach((d) => {+ sheetInjector.add(d);+ });}}diff --git a/packages/sheets-plugin-pivot-table/README-zh.md b/packages/sheets-plugin-pivot-table/README-zh.mddeleted file mode 100644index 47005316f7..0000000000--- a/packages/sheets-plugin-pivot-table/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet PivotTable 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-pivot-table-```--### 使用--```js-import { PivotTable } from '@univerjs/sheets-plugin-pivot-table';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new PivotTable());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-pivot-table/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-pivot-table dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-pivot-table/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-pivot-table build-```diff --git a/packages/sheets-plugin-pivot-table/README.md b/packages/sheets-plugin-pivot-table/README.mddeleted file mode 100644index 30ead5bd76..0000000000--- a/packages/sheets-plugin-pivot-table/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin PivotTable--### Installation--```shell-npm i @univerjs/sheets-plugin-pivot-table-```--### Usage--```js-import { PivotTable } from '@univerjs/sheets-plugin-pivot-table';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new PivotTable());-```--## 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/sheets-plugin-pivot-table/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-pivot-table dev-```--### Package--```-# Current directory ./packages/sheets-plugin-pivot-table/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-pivot-table build-```diff --git a/packages/sheets-plugin-pivot-table/index.html b/packages/sheets-plugin-pivot-table/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-pivot-table/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-pivot-table/jest.config.js b/packages/sheets-plugin-pivot-table/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-pivot-table/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/packages/sheets-plugin-pivot-table/package.json b/packages/sheets-plugin-pivot-table/package.jsondeleted file mode 100644index 47d886bfc1..0000000000--- a/packages/sheets-plugin-pivot-table/package.json+++ /dev/null@@ -1,66 +0,0 @@-{- "name": "@univerjs/sheets-plugin-pivot-table",- "version": "0.0.1",- "description": "UniverSheet normal plugin-pivot-table",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-pivot-table.cjs.js",- "module": "./lib/univer-sheets-plugin-pivot-table.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-pivot-table.cjs.js",- "default": "./lib/univer-sheets-plugin-pivot-table.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-pivot-table/src/Action/ActionPivotTable.ts b/packages/sheets-plugin-pivot-table/src/Action/ActionPivotTable.tsdeleted file mode 100644index 2ba5026cc2..0000000000--- a/packages/sheets-plugin-pivot-table/src/Action/ActionPivotTable.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionPivotTable {}diff --git a/packages/sheets-plugin-pivot-table/src/Action/IAction.ts b/packages/sheets-plugin-pivot-table/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-pivot-table/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-pivot-table/src/Action/IActionSet.ts b/packages/sheets-plugin-pivot-table/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-pivot-table/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-pivot-table/src/Action/index.ts b/packages/sheets-plugin-pivot-table/src/Action/index.tsdeleted file mode 100644index 4a30c47ce6..0000000000--- a/packages/sheets-plugin-pivot-table/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionPivotTable';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-pivot-table/src/Base/Cache.ts b/packages/sheets-plugin-pivot-table/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-pivot-table/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-pivot-table/src/Base/State.ts b/packages/sheets-plugin-pivot-table/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-pivot-table/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-pivot-table/src/Base/index.ts b/packages/sheets-plugin-pivot-table/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-pivot-table/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-pivot-table/src/Conflict/ConflictPivotTable.ts b/packages/sheets-plugin-pivot-table/src/Conflict/ConflictPivotTable.tsdeleted file mode 100644index a6837cdd79..0000000000--- a/packages/sheets-plugin-pivot-table/src/Conflict/ConflictPivotTable.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictPivotTable {}diff --git a/packages/sheets-plugin-pivot-table/src/Conflict/IConflict.ts b/packages/sheets-plugin-pivot-table/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-pivot-table/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-pivot-table/src/Conflict/index.ts b/packages/sheets-plugin-pivot-table/src/Conflict/index.tsdeleted file mode 100644index 142cdf84da..0000000000--- a/packages/sheets-plugin-pivot-table/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictPivotTable';diff --git a/packages/sheets-plugin-pivot-table/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-pivot-table/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index 4fb0f1e323..0000000000--- a/packages/sheets-plugin-pivot-table/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const PIVOT_TABLE_PLUGIN_NAME = 'pivotTable';diff --git a/packages/sheets-plugin-pivot-table/src/Const/index.ts b/packages/sheets-plugin-pivot-table/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-pivot-table/src/Domain/PivotTable.ts b/packages/sheets-plugin-pivot-table/src/Domain/PivotTable.tsdeleted file mode 100644index f521824b13..0000000000--- a/packages/sheets-plugin-pivot-table/src/Domain/PivotTable.ts+++ /dev/null@@ -1 +0,0 @@-export class PivotTable {}diff --git a/packages/sheets-plugin-pivot-table/src/Domain/index.ts b/packages/sheets-plugin-pivot-table/src/Domain/index.tsdeleted file mode 100644index 1746420653..0000000000--- a/packages/sheets-plugin-pivot-table/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './PivotTable';diff --git a/packages/sheets-plugin-pivot-table/src/Enum/index.ts b/packages/sheets-plugin-pivot-table/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-pivot-table/src/IData/IPivotTable.ts b/packages/sheets-plugin-pivot-table/src/IData/IPivotTable.tsdeleted file mode 100644index a809ef3796..0000000000--- a/packages/sheets-plugin-pivot-table/src/IData/IPivotTable.ts+++ /dev/null@@ -1,4 +0,0 @@-export type IConfig = {};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-pivot-table/src/IData/index.ts b/packages/sheets-plugin-pivot-table/src/IData/index.tsdeleted file mode 100644index e9ba6c934a..0000000000--- a/packages/sheets-plugin-pivot-table/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IPivotTable';diff --git a/packages/sheets-plugin-pivot-table/src/Locale/en.ts b/packages/sheets-plugin-pivot-table/src/Locale/en.tsdeleted file mode 100644index bb0ddeca2e..0000000000--- a/packages/sheets-plugin-pivot-table/src/Locale/en.ts+++ /dev/null@@ -1,59 +0,0 @@-export default {- pivotTableLabel: 'PivotTable',- pivotTable: {- title: 'Pivot Table',- closePannel: 'Close',- editRange: 'Range',- tipPivotFieldSelected: 'Select the fields',- tipClearSelectedField: 'Clear all fields',- btnClearSelectedField: 'Clear',- btnFilter: 'Filter',- titleRow: 'Row',- titleColumn: 'Column',- titleValue: 'Value',- tipShowColumn: 'Statistics fields are displayed as columns',- tipShowRow: 'Statistics fields are displayed as rows',-- titleSelectionDataRange: 'Select range',- titleDataRange: 'Data range',-- valueSum: 'SUM',-- valueStatisticsSUM: 'Sum',- valueStatisticsCOUNT: 'Count',- valueStatisticsCOUNTA: 'Count A',- valueStatisticsCOUNTUNIQUE: 'Count Unique',- valueStatisticsAVERAGE: 'Average',- valueStatisticsMAX: 'Max',- valueStatisticsMIN: 'Min',- valueStatisticsMEDIAN: 'Median',- valueStatisticsPRODUCT: 'Product',- valueStatisticsSTDEV: 'Stdev',-- valueStatisticsSTDEVP: 'Stdevp',- valueStatisticslet: 'Var',- valueStatisticsVARP: 'VarP',-- errorNotAllowEdit: 'This operation is prohibited in non-editing mode!',- errorNotAllowMulti: 'Cannot perform this operation on multiple selection areas, please select a single range and try again',- errorSelectRange: 'Please select the range of the new pivot table',- errorIsDamage: 'The source data of this pivot table is corrupted!',- errorNotAllowPivotData: 'Cannot select pivot table as source data!',- errorSelectionRange: 'Selection failed, wrong input range!',- errorIncreaseRange: 'Please expand the selected range!',-- titleAddColumn: 'Add column to pivot table',- titleMoveColumn: 'Move the column to the white box below',- titleClearColumnFilter: 'Clear the filter for this column',- titleFilterColumn: 'Filter',-- titleSort: 'Sort',- titleNoSort: 'No sort',- titleSortAsc: 'ASC',- titleSortDesc: 'DESC',- titleSortBy: 'Sort by',- titleShowSum: 'Show total',- titleStasticTrue: 'Yes',- titleStasticFalse: 'No',- },-};diff --git a/packages/sheets-plugin-pivot-table/src/Locale/index.ts b/packages/sheets-plugin-pivot-table/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-pivot-table/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-pivot-table/src/Locale/zh.ts b/packages/sheets-plugin-pivot-table/src/Locale/zh.tsdeleted file mode 100644index d132060011..0000000000--- a/packages/sheets-plugin-pivot-table/src/Locale/zh.ts+++ /dev/null@@ -1,59 +0,0 @@-export default {- pivotTableLabel: '数据透视表',- pivotTable: {- title: '数据透视表',- closePannel: '关闭',- editRange: '编辑范围',- tipPivotFieldSelected: '选择需要添加到数据透视表的字段',- tipClearSelectedField: '清除所有已选字段',- btnClearSelectedField: '清除',- btnFilter: '筛选',- titleRow: '行',- titleColumn: '列',- titleValue: '数值',- tipShowColumn: '统计字段显示为列',- tipShowRow: '统计字段显示为行',-- titleSelectionDataRange: '选取数据范围',- titleDataRange: '数据范围',-- valueSum: '总计',-- valueStatisticsSUM: '求和',- valueStatisticsCOUNT: '数值计数',- valueStatisticsCOUNTA: '计数',- valueStatisticsCOUNTUNIQUE: '去重计数',- valueStatisticsAVERAGE: '平均值',- valueStatisticsMAX: '最大值',- valueStatisticsMIN: '最小值',- valueStatisticsMEDIAN: '中位数',- valueStatisticsPRODUCT: '乘积',- valueStatisticsSTDEV: '标准差',-- valueStatisticsSTDEVP: '整体标准差',- valueStatisticslet: '方差',- valueStatisticsVARP: '整体方差',-- errorNotAllowEdit: '非编辑模式下禁止该操作!',- errorNotAllowMulti: '不能对多重选择区域执行此操作,请选择单个区域,然后再试',- errorSelectRange: '请选择新建透视表的区域',- errorIsDamage: '此数据透视表的源数据已损坏!',- errorNotAllowPivotData: '不可选择数据透视表为源数据!',- errorSelectionRange: '选择失败, 输入范围错误!',- errorIncreaseRange: '请扩大选择的数据范围!',-- titleAddColumn: '添加列到数据透视表',- titleMoveColumn: '移动该列到下方白框',- titleClearColumnFilter: '清除该列的筛选条件',- titleFilterColumn: '筛选该列',-- titleSort: '排序',- titleNoSort: '无排序',- titleSortAsc: '升序',- titleSortDesc: '降序',- titleSortBy: '排序依据',- titleShowSum: '显示总计',- titleStasticTrue: '是',- titleStasticFalse: '否',- },-};diff --git a/packages/sheets-plugin-pivot-table/src/PivotTablePlugin.tsx b/packages/sheets-plugin-pivot-table/src/PivotTablePlugin.tsxdeleted file mode 100644index 2025b4d62a..0000000000--- a/packages/sheets-plugin-pivot-table/src/PivotTablePlugin.tsx+++ /dev/null@@ -1,57 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { en, zh } from './Locale';-import { PivotTableButton } from './UI/PivotTableButton';--import { IConfig } from './IData/IPivotTable';-import { PIVOT_TABLE_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface IPivotTablePluginConfig {}--export class PivotTablePlugin extends Plugin {- SheetPlugin: any;-- constructor(config?: IPivotTablePluginConfig) {- super(PIVOT_TABLE_PLUGIN_NAME);- }-- static create(config?: IPivotTablePluginConfig) {- return new PivotTablePlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: PIVOT_TABLE_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <PivotTableButton config={config} />,- };- // get spreadsheet plugin- this.sheetPlugin = context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);-- // extend comment- this.sheetPlugin?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-pivot-table/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-pivot-table/src/ProxyData/ProxyDataPivotTable.ts b/packages/sheets-plugin-pivot-table/src/ProxyData/ProxyDataPivotTable.tsdeleted file mode 100644index 39999cf189..0000000000--- a/packages/sheets-plugin-pivot-table/src/ProxyData/ProxyDataPivotTable.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataPivotTable {}diff --git a/packages/sheets-plugin-pivot-table/src/ProxyData/index.ts b/packages/sheets-plugin-pivot-table/src/ProxyData/index.tsdeleted file mode 100644index da713b14f7..0000000000--- a/packages/sheets-plugin-pivot-table/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataPivotTable';diff --git a/packages/sheets-plugin-pivot-table/src/Service/PivotTableService.ts b/packages/sheets-plugin-pivot-table/src/Service/PivotTableService.tsdeleted file mode 100644index 6439a94e3e..0000000000--- a/packages/sheets-plugin-pivot-table/src/Service/PivotTableService.ts+++ /dev/null@@ -1 +0,0 @@-export class PivotTableService {}diff --git a/packages/sheets-plugin-pivot-table/src/Service/index.ts b/packages/sheets-plugin-pivot-table/src/Service/index.tsdeleted file mode 100644index 257ab9e1fe..0000000000--- a/packages/sheets-plugin-pivot-table/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './PivotTableService';diff --git a/packages/sheets-plugin-pivot-table/src/Shared/index.ts b/packages/sheets-plugin-pivot-table/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-pivot-table/src/Types/index.d.ts b/packages/sheets-plugin-pivot-table/src/Types/index.d.tsdeleted file mode 100644index b31ac0a2b4..0000000000--- a/packages/sheets-plugin-pivot-table/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-pivot-table' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-pivot-table/src/Types/preact.d.ts b/packages/sheets-plugin-pivot-table/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-pivot-table/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-pivot-table/src/UI/PivotTableButton.tsx b/packages/sheets-plugin-pivot-table/src/UI/PivotTableButton.tsxdeleted file mode 100644index 380344d969..0000000000--- a/packages/sheets-plugin-pivot-table/src/UI/PivotTableButton.tsx+++ /dev/null@@ -1,106 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component, IToolbarItemProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import { PIVOT_TABLE_PLUGIN_NAME } from '../Const/PLUGIN_NAME';-// import { IProps } from '../IData/IPivotTable';-// import styles from './index.module.less';--// // Types for state-// interface IState {-// pivotTable: IToolbarItemProps;-// // modalData: Array<ModalProps>;-// }--// export class PivotTableButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: IProps) {-// // super(props);-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// const PivotableIcon = this.Render.renderFunction('PivotableIcon');-// const pivotTableState: IToolbarItemProps = {-// locale: PIVOT_TABLE_PLUGIN_NAME,-// type: 'single',-// label: <PivotableIcon />,-// show: true,-// };-// this.state = {-// pivotTable: pivotTableState,-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.pivotTable;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}Label`);-// item.tooltipRight = locale.get(`${item.locale}RightLabel`);--// // set current Locale string for select-// item.children?.forEach((ele: IToolbarItemProps) => {-// if (ele.locale) {-// ele.label = locale.get(`${ele.locale}`);-// }-// });-// item.label = typeof item.label === 'object' ? item.label : item.children![0].label;--// return {-// pivotTable: item,-// };-// });-// }--// showPivotTable = () => {};--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Button = this.Render.renderFunction('Button');-// const Tooltip = this.Render.renderFunction('Tooltip');-// const { pivotTable } = state;-// // Set Provider for entire Container-// return (-// <div className={styles.singleButton}>-// <Tooltip title={pivotTable.tooltip!} placement={'bottom'}>-// <Button type="text" onClick={this.showPivotTable}>-// {pivotTable.label}-// </Button>-// </Tooltip>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-pivot-table/src/UI/index.module.less b/packages/sheets-plugin-pivot-table/src/UI/index.module.lessdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-pivot-table/src/View/Event.ts b/packages/sheets-plugin-pivot-table/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-pivot-table/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-pivot-table/src/View/ObserverList.ts b/packages/sheets-plugin-pivot-table/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-pivot-table/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-pivot-table/src/View/Render.ts b/packages/sheets-plugin-pivot-table/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-pivot-table/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-pivot-table/src/View/index.ts b/packages/sheets-plugin-pivot-table/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-pivot-table/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-pivot-table/src/index.ts b/packages/sheets-plugin-pivot-table/src/index.tsdeleted file mode 100644index bcc926eec3..0000000000--- a/packages/sheets-plugin-pivot-table/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { PivotTablePlugin } from './PivotTablePlugin';--export { PivotTablePlugin };diff --git a/packages/sheets-plugin-pivot-table/src/main.tsx b/packages/sheets-plugin-pivot-table/src/main.tsxdeleted file mode 100644index d7a2b380aa..0000000000--- a/packages/sheets-plugin-pivot-table/src/main.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));--// univerSheetUp.installPlugin(new PivotTablePlugin());diff --git a/packages/sheets-plugin-pivot-table/tsconfig.json b/packages/sheets-plugin-pivot-table/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-pivot-table/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-pivot-table/vite.config.ts b/packages/sheets-plugin-pivot-table/vite.config.tsdeleted file mode 100644index 7fbd0d7557..0000000000--- a/packages/sheets-plugin-pivot-table/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginPivotTable',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-pivot-table',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-print/README-zh.md b/packages/sheets-plugin-print/README-zh.mddeleted file mode 100644index 3a777f7dc3..0000000000--- a/packages/sheets-plugin-print/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Print 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-print-```--### 使用--```js-import { Print } from '@univerjs/sheets-plugin-print';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Print());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-print/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-print dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-print/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-print build-```diff --git a/packages/sheets-plugin-print/README.md b/packages/sheets-plugin-print/README.mddeleted file mode 100644index cc74c44f69..0000000000--- a/packages/sheets-plugin-print/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Print--### Installation--```shell-npm i @univerjs/sheets-plugin-print-```--### Usage--```js-import { Print } from '@univerjs/sheets-plugin-print';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Print());-```--## 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/sheets-plugin-print/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-print dev-```--### Package--```-# Current directory ./packages/sheets-plugin-print/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-print build-```diff --git a/packages/sheets-plugin-print/index.html b/packages/sheets-plugin-print/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-print/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-print/jest.config.js b/packages/sheets-plugin-print/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-print/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/packages/sheets-plugin-print/package.json b/packages/sheets-plugin-print/package.jsondeleted file mode 100644index 8131099157..0000000000--- a/packages/sheets-plugin-print/package.json+++ /dev/null@@ -1,66 +0,0 @@-{- "name": "@univerjs/sheets-plugin-print",- "version": "0.0.1",- "description": "UniverSheet normal plugin-print",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-print.cjs.js",- "module": "./lib/univer-sheets-plugin-print.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-print.cjs.js",- "default": "./lib/univer-sheets-plugin-print.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-print/src/Action/ActionPrint.ts b/packages/sheets-plugin-print/src/Action/ActionPrint.tsdeleted file mode 100644index 87d736b9d3..0000000000--- a/packages/sheets-plugin-print/src/Action/ActionPrint.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionPrint {}diff --git a/packages/sheets-plugin-print/src/Action/IAction.ts b/packages/sheets-plugin-print/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-print/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-print/src/Action/IActionSet.ts b/packages/sheets-plugin-print/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-print/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-print/src/Action/index.ts b/packages/sheets-plugin-print/src/Action/index.tsdeleted file mode 100644index 61b1675205..0000000000--- a/packages/sheets-plugin-print/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionPrint';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-print/src/Base/Cache.ts b/packages/sheets-plugin-print/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-print/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-print/src/Base/State.ts b/packages/sheets-plugin-print/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-print/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-print/src/Base/index.ts b/packages/sheets-plugin-print/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-print/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-print/src/Conflict/ConflictPrint.ts b/packages/sheets-plugin-print/src/Conflict/ConflictPrint.tsdeleted file mode 100644index 7f56846223..0000000000--- a/packages/sheets-plugin-print/src/Conflict/ConflictPrint.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictPrint {}diff --git a/packages/sheets-plugin-print/src/Conflict/IConflict.ts b/packages/sheets-plugin-print/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-print/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-print/src/Conflict/index.ts b/packages/sheets-plugin-print/src/Conflict/index.tsdeleted file mode 100644index e1f6e1ffe0..0000000000--- a/packages/sheets-plugin-print/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictPrint';diff --git a/packages/sheets-plugin-print/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-print/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index f8c650a9c7..0000000000--- a/packages/sheets-plugin-print/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const PRINT_PLUGIN_NAME = 'print';diff --git a/packages/sheets-plugin-print/src/Const/index.ts b/packages/sheets-plugin-print/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-print/src/Domain/Print.ts b/packages/sheets-plugin-print/src/Domain/Print.tsdeleted file mode 100644index aef2cc53f1..0000000000--- a/packages/sheets-plugin-print/src/Domain/Print.ts+++ /dev/null@@ -1 +0,0 @@-export class Print {}diff --git a/packages/sheets-plugin-print/src/Domain/index.ts b/packages/sheets-plugin-print/src/Domain/index.tsdeleted file mode 100644index 3a6ad4096e..0000000000--- a/packages/sheets-plugin-print/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Print';diff --git a/packages/sheets-plugin-print/src/Enum/index.ts b/packages/sheets-plugin-print/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-print/src/IData/IPrint.ts b/packages/sheets-plugin-print/src/IData/IPrint.tsdeleted file mode 100644index 964fd78160..0000000000--- a/packages/sheets-plugin-print/src/IData/IPrint.ts+++ /dev/null@@ -1,8 +0,0 @@-import { SheetContext } from '@univerjs/core';--export type IConfig = {- context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-print/src/IData/index.ts b/packages/sheets-plugin-print/src/IData/index.tsdeleted file mode 100644index eb85e5b5d4..0000000000--- a/packages/sheets-plugin-print/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IPrint';diff --git a/packages/sheets-plugin-print/src/Locale/en.ts b/packages/sheets-plugin-print/src/Locale/en.tsdeleted file mode 100644index 2d1ef11a47..0000000000--- a/packages/sheets-plugin-print/src/Locale/en.ts+++ /dev/null@@ -1,28 +0,0 @@-export default {- print: {- printLabel: '插件',- printRightLabel: '更多 Print',- printSettings: 'Print Settings',- cancel: 'cancel',- next: 'next',- preview: 'preview',- print: 'print',- paperSize: 'paper size',- width: 'width',- height: 'height',- pageOrientation: 'page orientation',- zoom: 'zoom',- margin: 'margin',- formatOptions: 'format options',- gridlines: 'gridlines',- remarks: 'remarks',- pageOrder: 'page order',- alignment: 'alignment',- level: 'level',- vertical: 'vertical',- headerAndFooter: 'header and footer',- headers: 'Row and column headers',- rows: 'Freeze rows repeatedly',- column: 'Freeze columns repeatedly',- },-};diff --git a/packages/sheets-plugin-print/src/Locale/index.ts b/packages/sheets-plugin-print/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-print/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-print/src/Locale/zh.ts b/packages/sheets-plugin-print/src/Locale/zh.tsdeleted file mode 100644index 1c5b2509a8..0000000000--- a/packages/sheets-plugin-print/src/Locale/zh.ts+++ /dev/null@@ -1,28 +0,0 @@-export default {- print: {- printLabel: '插件',- printRightLabel: '更多 Print',- printSettings: '打印设置',- cancel: '取消',- next: '下一步',- preview: '预览',- print: '打印',- paperSize: '纸张大小',- width: '宽度',- height: '高度',- pageOrientation: '网页方向',- zoom: '缩放',- margin: '边距',- formatOptions: '格式设置',- gridlines: '网格线',- remarks: '备注',- pageOrder: '页面顺序',- alignment: '对齐',- level: '水平',- vertical: '垂直',- headerAndFooter: '页眉和页脚',- headers: '行标题和列标题',- rows: '重复冻结行',- column: '重复冻结列',- },-};diff --git a/packages/sheets-plugin-print/src/PrintPlugin.tsx b/packages/sheets-plugin-print/src/PrintPlugin.tsxdeleted file mode 100644index 318c40d775..0000000000--- a/packages/sheets-plugin-print/src/PrintPlugin.tsx+++ /dev/null@@ -1,53 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { en, zh } from './Locale';-import { PrintButton } from './UI/PrintButton';--import { IConfig } from './IData/IPrint';-import { PRINT_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface IPrintPluginConfig {}--export class PrintPlugin extends Plugin {- constructor(config?: IPrintPluginConfig) {- super(PRINT_PLUGIN_NAME);- }-- static create(config?: IPrintPluginConfig) {- return new PrintPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {- context,- };-- const item: IToolbarItemProps = {- locale: PRINT_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <PrintButton config={config} />,- };- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-print/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-print/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-print/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-print/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-print/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-print/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-print/src/ProxyData/ProxyDataPrint.ts b/packages/sheets-plugin-print/src/ProxyData/ProxyDataPrint.tsdeleted file mode 100644index d2e6cb82e7..0000000000--- a/packages/sheets-plugin-print/src/ProxyData/ProxyDataPrint.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataPrint {}diff --git a/packages/sheets-plugin-print/src/ProxyData/index.ts b/packages/sheets-plugin-print/src/ProxyData/index.tsdeleted file mode 100644index 0fd7cf4ea6..0000000000--- a/packages/sheets-plugin-print/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataPrint';diff --git a/packages/sheets-plugin-print/src/Service/PrintService.ts b/packages/sheets-plugin-print/src/Service/PrintService.tsdeleted file mode 100644index 804db0e57d..0000000000--- a/packages/sheets-plugin-print/src/Service/PrintService.ts+++ /dev/null@@ -1 +0,0 @@-export class PrintService {}diff --git a/packages/sheets-plugin-print/src/Service/index.ts b/packages/sheets-plugin-print/src/Service/index.tsdeleted file mode 100644index fc48b8a1cd..0000000000--- a/packages/sheets-plugin-print/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './PrintService';diff --git a/packages/sheets-plugin-print/src/Shared/index.ts b/packages/sheets-plugin-print/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-print/src/Types/index.d.ts b/packages/sheets-plugin-print/src/Types/index.d.tsdeleted file mode 100644index dcb0ac434a..0000000000--- a/packages/sheets-plugin-print/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-print' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-print/src/Types/preact.d.ts b/packages/sheets-plugin-print/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-print/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-print/src/UI/PrintButton.tsx b/packages/sheets-plugin-print/src/UI/PrintButton.tsxdeleted file mode 100644index a5ded93684..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintButton.tsx+++ /dev/null@@ -1,139 +0,0 @@-import { BaseComponentSheet, BaseIconProps, BaseSelectProps, Component, IToolbarItemProps } from '@univerjs/base-ui';-import { Nullable, Observer, Workbook } from '@univerjs/core';-import { FunctionComponent } from 'preact';-import { IProps } from '../IData/IPrint';-import { PrintMode } from './PrintMode';-// Types for state-interface IState {- print: IToolbarItemProps;- isPrintShow: boolean;-}--export class PrintButton extends Component<IProps, IState> {- Select: FunctionComponent<BaseSelectProps>;-- PrintIcon: FunctionComponent<BaseIconProps>;-- NextIcon: FunctionComponent<BaseIconProps>;-- PrintAreaIcon: FunctionComponent<BaseIconProps>;-- PrintTitleIcon: FunctionComponent<BaseIconProps>;-- private _localeObserver: Nullable<Observer<Workbook>>;-- initialize(props: IProps) {- // super(props);- const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- const render = component.getComponentRender();- this.Select = render.renderFunction('Select');- this.PrintIcon = render.renderFunction('PrintIcon');- this.NextIcon = render.renderFunction('NextIcon');- this.PrintAreaIcon = render.renderFunction('PrintAreaIcon');- this.PrintTitleIcon = render.renderFunction('PrintTitleIcon');-- this.state = {- isPrintShow: false,- print: {- locale: 'print',- type: 'select',- label: <this.PrintIcon />,- show: true,- icon: <this.NextIcon />,- children: [- {- locale: 'print.menuItemPrint',- icon: <this.PrintIcon />,- onClick: this.setPrintShow.bind(this),- },- {- locale: 'print.menuItemAreas',- icon: <this.PrintAreaIcon />,- border: true,- },- {- locale: 'print.menuItemRows',- icon: <this.PrintTitleIcon />,- },- {- locale: 'print.menuItemColumns',- icon: <this.PrintTitleIcon />,- },- ],- },- };- }-- setPrintShow() {- this.setState({ isPrintShow: true });- }-- setPrintHide() {- this.setState({ isPrintShow: false });- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this._context- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- const locale = this._context.getLocale();- this.setState((prevState: IState) => {- let item = prevState.print;- // set current Locale string for tooltip- item.tooltip = locale.get(`${item.locale}Label`);- item.tooltipRight = locale.get(`${item.locale}RightLabel`);-- // set current Locale string for select- item.children?.forEach((ele: IToolbarItemProps) => {- if (ele.locale) {- ele.label = locale.get(`${ele.locale}`);- }- });- item.label = typeof item.label === 'object' ? item.label : item.children![0].label;-- return {- print: item,- };- });- }-- /**- * Render the component's HTML- *- * @returns {void}- */- render(props: IProps, state: IState) {- const { print, isPrintShow } = state;- const { Select } = this;- // Set Provider for entire Container- return (- <>- <Select tooltip={print.tooltip} key={print.locale} label={print.label} icon={print.icon} children={print.children as BaseSelectProps[]} />- <PrintMode config={this.props.config} visible={isPrintShow} onCancel={this.setPrintHide.bind(this)}></PrintMode>- </>- );- }-}diff --git a/packages/sheets-plugin-print/src/UI/PrintMode/index.module.less b/packages/sheets-plugin-print/src/UI/PrintMode/index.module.lessdeleted file mode 100644index 70493843d5..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintMode/index.module.less+++ /dev/null@@ -1,201 +0,0 @@-.print-mode {- width: 100vw !important;- height: 100vh !important;- background-color: var(--gray-14);- // background-color: #fff;- position: fixed;- left: 0;- top: 0;- z-index: 3;-- .print-header {- height: 10vh;- background-color: #333;- color: #fff;- display: flex;- align-items: center;- justify-content: center;-- .print-header-title {- flex: 2;- padding-left: 40px;- font-size: 20px;- font-weight: bold;- }-- .print-header-btn {- flex: 3;- text-align: right;- padding-right: 30px;-- .print-return {- color: #fff;- background: transparent;- border-color: transparent;- }- }- }-- .print-container {- display: flex;-- .printLeft {- flex: 1;- }-- .print-side {- width: 300px;- height: calc(100vh - 10vh);- padding: 10px 0;- border-left: 1px solid;- box-sizing: border-box;- display: flex;- flex-direction: column;- transition: all 0.5s;- opacity: 1;- background-color: var(--bg);- overflow: auto;-- .print-select-title {- font-size: 14px;- color: #999;- margin: 10px 0;- }-- .print-select {- width: 100%;- padding: 0 10px;-- .print-selector {- display: flex;- position: relative;- padding-bottom: 5px;- border-bottom: 1px solid var(--border-color-base);-- .print-selector-label {- flex: 1;-- .printSelectInput {- width: 100%;- }- }-- .cols-menu {- width: calc(100%);- position: absolute;- top: 0px;- left: 0px;- }- }- }-- .print-radio {- padding: 10px;-- .print-radio-group {- display: flex;-- > div {- flex: 1;- }- }- }-- .checkbox-group {- flex-direction: column;- padding-left: 10px;-- .checkbox-wrapper {- margin: 5px 0;- }- }-- .print-side-title {- margin: 5px 0;- padding: 0 10px;- color: rgba(0, 0, 0, 0.87);- font-size: 13px;- font-weight: normal;- }-- .print-input-group {- display: flex;- padding: 10px;- }-- .print-input {- flex: 1;-- .print-input-title {- color: #066;- }-- input {- padding: 5px 0;- margin: 5px 0;- width: 80%;- background: transparent;- color: rgba(0, 0, 0, 0.87);- display: block;- font-size: 13px;- line-height: 18px;- outline: none;- border: none;- border-bottom: 1px solid var(--border-color-base);- }- }- }- }-- & * {- user-select: none;- box-sizing: border-box;- }-}--// .print-selset {-// width: 100%;-// box-sizing: border-box;-// padding: 0 10px;-// position: relative;-// background: #fff;--// .print-selset-title {-// color: #999;-// }--// .print-selector {-// width: 100%;-// display: flex;-// border-bottom: 1px solid #ccc;--// .print-selector-item {-// flex: 1;-// padding-bottom: 5px;-// }-// }--// .print-menu {-// width: calc(100% - 20px);-// border: 1px solid;-// box-sizing: border-box;-// position: absolute;-// background: #fff;-// box-shadow: var(--box-shadow-base);-// z-index: 5;-// .print-menu-item {-// padding: 10px;-// &:hover {-// background-color: #ccccccff;-// }-// }-// }-// }--// .print-radio {-// display: flex;-// padding: 10px;-// > div {-// flex: 1;-// }-// }diff --git a/packages/sheets-plugin-print/src/UI/PrintMode/index.ts b/packages/sheets-plugin-print/src/UI/PrintMode/index.tsdeleted file mode 100644index 7f329fe3f3..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintMode/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './printMode';-// export * from "./selsct";diff --git a/packages/sheets-plugin-print/src/UI/PrintMode/printInput.tsx b/packages/sheets-plugin-print/src/UI/PrintMode/printInput.tsxdeleted file mode 100644index d314c7470a..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintMode/printInput.tsx+++ /dev/null@@ -1,38 +0,0 @@-// import { Component, createRef } from '@univerjs/base-ui';-// import styles from './index.module.less';--// interface IProps {-// title: string;-// onInput: (value: string) => void;-// }-// interface IState {-// inputFocus: boolean;-// }--// class PrintInput extends Component<IProps, IState> {-// initialize(props: IProps) {-// // super();-// this.state = {-// inputFocus: false,-// };-// }--// inputRef = createRef();--// onInput() {-// const value = this.inputRef.current.value;--// this.props.onInput(value);-// }--// render() {-// return (-// <div className={styles.printInput}>-// <span>{this.props.title}:</span>-// <input ref={this.inputRef} onInput={this.onInput.bind(this)} type="text" />-// </div>-// );-// }-// }--// export { PrintInput };diff --git a/packages/sheets-plugin-print/src/UI/PrintMode/printMode.tsx b/packages/sheets-plugin-print/src/UI/PrintMode/printMode.tsxdeleted file mode 100644index d7d63bf24e..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintMode/printMode.tsx+++ /dev/null@@ -1,392 +0,0 @@-// import {-// BaseButtonProps,-// BaseCheckboxGroupProps,-// BaseCollapseProps,-// BaseComponentSheet,-// BasePanelProps,-// BaseRadioGroupProps,-// BaseRadioIProps,-// Component,-// FunctionComponent,-// } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { IConfig } from '../../IData';-// import styles from './index.module.less';-// import { PrintInput } from './printInput';-// import { PrintSelect } from './printSelsct';--// interface Options {-// key: number;-// value: string;-// }-// interface IProps {-// visible: boolean;-// onCancel: () => void;-// config: IConfig;-// }-// interface IState {-// active: string | number;-// options: Options;-// printSheet: any;-// printPaperSize: any;-// printZoom: any;-// printMargin: any;-// printPageOrder: any;-// printHorizontal: any;-// printVertical: any;-// paperSizeCustom: boolean;-// locale: any;-// }--// class PrintMode extends Component<IProps, IState> {-// // printModeRef = createRef();--// private _localeObserver: Nullable<Observer<Workbook>>;--// Button: FunctionComponent<BaseButtonProps>;--// CheckboxGroup: FunctionComponent<BaseCheckboxGroupProps>;--// Collapse: FunctionComponent<BaseCollapseProps>;--// Panel: FunctionComponent<BasePanelProps>;--// Radio: FunctionComponent<BaseRadioIProps>;--// RadioGroup: FunctionComponent<BaseRadioGroupProps>;--// initialize(props: IProps) {-// const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// const render = component.getComponentRender();-// this.Button = render.renderFunction('Button');-// this.CheckboxGroup = render.renderFunction('CheckboxGroup');-// this.Collapse = render.renderFunction('Collapse');-// this.Panel = render.renderFunction('Panel');-// this.Radio = render.renderFunction('Radio');-// this.RadioGroup = render.renderFunction('RadioGroup');--// this.state = {-// active: '1',-// options: { key: 1, value: '111' },-// paperSizeCustom: false,-// printSheet: [-// {-// name: 'print.menuItemPrint',-// label: '当前工作表',-// },-// ],-// printPaperSize: [-// {-// name: 'print.menuItemPrint',-// label: '信纸(21.6厘米x27.9厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: '小报(27.9厘米x43.2厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: '法律专用纸(21.6厘米x35.6厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: '报表(14.0厘米x21.6厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: '行政公文纸(18.4厘米x26.7厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: '对折纸(18.4厘米x26.7厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: 'A3(29.7厘米x42.0厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: 'A4(21.0厘米x29.7厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: 'A5(14.8厘米x21.0厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: 'B4(25.0厘米x35.3厘米)',-// },-// {-// name: 'print.menuItemPrint',-// label: 'B5(17.6厘米x25.0厘米)',-// },-// {-// name: 'print.custom',-// label: '自定义',-// },-// ],-// printZoom: [-// {-// name: 'print.menuItemPrint',-// label: '正常(100%)',-// },-// {-// name: 'print.menuItemPrint',-// label: '适合宽度',-// },-// {-// name: 'print.menuItemPrint',-// label: '适合高度',-// },-// {-// name: 'print.menuItemPrint',-// label: '适合页面大小',-// },-// ],-// printMargin: [-// {-// name: 'print.menuItemPrint',-// label: '正常',-// },-// {-// name: 'print.menuItemPrint',-// label: '窄',-// },-// {-// name: 'print.menuItemPrint',-// label: '宽',-// },-// ],-// printPageOrder: [-// {-// name: 'print.menuItemPrint',-// label: '先往下,再翻页',-// },-// {-// name: 'print.menuItemPrint',-// label: '先翻页,再往下',-// },-// ],-// printHorizontal: [-// {-// name: 'print.menuItemPrint',-// label: '水平居中',-// },-// {-// name: 'print.menuItemPrint',-// label: '左对齐',-// },-// {-// name: 'print.menuItemPrint',-// label: '右对齐',-// },-// ],-// printVertical: [-// {-// name: 'print.menuItemPrint',-// label: '顶部对齐',-// },-// {-// name: 'print.menuItemPrint',-// label: '底部对齐',-// },-// {-// name: 'print.menuItemPrint',-// label: '垂直居中',-// },-// ],-// locale: null,-// };-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// setLocale() {-// const locale = this._context.getLocale().get('print');-// this.setState({ locale });-// }--// onChange(val: string | number) {-// this.setState({-// active: val,-// });-// }--// onReturn() {-// this.props.onCancel();-// }--// render() {-// const { Button, CheckboxGroup, Collapse, Panel, Radio, RadioGroup } = this;-// const { locale } = this.state.locale;-// return (-// <>-// {this.props.visible ? (-// <div className={styles.printMode}>-// <div className={styles.printHeader}>-// <div className={styles.printHeaderTitle}>{locale.printSettings}</div>-// <div className={styles.printHeaderBtn}>-// <Button className={styles.printReturn} onClick={this.onReturn.bind(this)}>-// {locale.cancel}-// </Button>-// <Button type="primary">{locale.next}</Button>-// </div>-// </div>-// <div className={styles.printContainer}>-// <div className={styles.printLeft}>{locale.preview}</div>-// <div className={styles.printSide}>-// <PrintSelect config={this.props.config} title={locale.print} onChange={(value) => {}} children={this.state.printSheet} />-// <PrintSelect-// config={this.props.config}-// title={locale.paperSize}-// onChange={(value) => {-// console.log(value);-// switch (value.name) {-// case 'print.custom':-// this.setState({-// paperSizeCustom: true,-// });-// break;--// default:-// this.setState({-// paperSizeCustom: false,-// });-// break;-// }-// }}-// children={this.state.printPaperSize}-// />-// {this.state.paperSizeCustom ? (-// <div className={styles.printInputGroup}>-// <PrintInput-// title={locale.width}-// onInput={(value) => {-// console.log(value);-// }}-// ></PrintInput>-// <PrintInput-// title={locale.height}-// onInput={(value) => {-// console.log(value);-// }}-// ></PrintInput>-// </div>-// ) : null}-// <div className={styles.printRadio}>-// <div className={styles.printSelectTitle}>{locale.pageOrientation}</div>-// <RadioGroup className={styles.printRadioGroup} onChange={this.onChange.bind(this)} active={this.state.active}>-// <Radio value="1">11111</Radio>-// <Radio value="2">22222</Radio>-// </RadioGroup>-// </div>-// <PrintSelect config={this.props.config} title={locale.zoom} onChange={() => {}} children={this.state.printZoom} />-// <PrintSelect config={this.props.config} title={locale.margin} onChange={() => {}} children={this.state.printMargin} />-// <Collapse>-// <Panel header={locale.formatOptions}>-// <>-// <CheckboxGroup-// options={[-// {-// name: '',-// label: '显示网格线',-// value: '1',-// },-// {-// name: '',-// label: '显示备注',-// value: '2',-// },-// ]}-// onChange={(value) => {}}-// ></CheckboxGroup>-// <PrintSelect config={this.props.config} title={locale.pageOrder} onChange={() => {}} children={this.state.printPageOrder} />-// <div className={styles.printSideTitle}>{locale.alignment}</div>-// <div style={{ width: '50%' }}>-// <PrintSelect config={this.props.config} title={locale.level} onChange={() => {}} children={this.state.printHorizontal} />-// <PrintSelect config={this.props.config} title={locale.vertical} onChange={() => {}} children={this.state.printVertical} />-// </div>-// </>-// </Panel>-// <Panel header={locale.headerAndFooter}>-// <>-// <CheckboxGroup-// options={[-// {-// name: '',-// label: '页码',-// value: '1',-// },-// {-// name: '',-// label: '工作簿标题',-// value: '2',-// },-// {-// name: '',-// label: '工作表名称',-// value: '3',-// },-// {-// name: '',-// label: '当前日期',-// value: '4',-// },-// {-// name: '',-// label: '当前时间',-// value: '5',-// },-// ]}-// onChange={(value) => {}}-// ></CheckboxGroup>-// <div className={styles.printSideTitle}>{locale.headers}</div>-// <div className={styles.printSideTitle}>转到“查看”>“冻结”可选择要在所有页面重复的行/列</div>-// <CheckboxGroup-// options={[-// {-// name: '',-// label: '重复冻结行',-// value: '1',-// disabled: true,-// },-// {-// name: '',-// label: '重复冻结列',-// value: '2',-// disabled: true,-// },-// ]}-// onChange={(value) => {}}-// ></CheckboxGroup>-// </>-// </Panel>-// </Collapse>-// </div>-// </div>-// </div>-// ) : null}-// </>-// );-// }-// }--// export { PrintMode };diff --git a/packages/sheets-plugin-print/src/UI/PrintMode/printSelsct.tsx b/packages/sheets-plugin-print/src/UI/PrintMode/printSelsct.tsxdeleted file mode 100644index 1549dce3e9..0000000000--- a/packages/sheets-plugin-print/src/UI/PrintMode/printSelsct.tsx+++ /dev/null@@ -1,113 +0,0 @@-// import { BaseComponentSheet, BaseIconProps, BaseUlProps, Component, createRef, FunctionComponent } from '@univerjs/base-ui';-// import { IConfig } from '../../IData';-// import styles from './index.module.less';--// interface IProps {-// title: string;-// isInput?: boolean;-// children: any;-// onChange: (value: any) => void;-// config: IConfig;-// }-// interface IState {-// active: any;-// inputShow: boolean;-// }--// let time = 100;-// let timeOut: ReturnType<typeof setTimeout> | null = null;-// class PrintSelect extends Component<IProps, IState> {-// NextIcon: FunctionComponent<BaseIconProps>;--// Ul: FunctionComponent<BaseUlProps>;--// initialize(props: IProps) {-// // super();-// const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// const render = component.getComponentRender();-// this.NextIcon = render.renderFunction('NextIcon');-// this.Ul = render.renderFunction('Ul');-// this.state = {-// active: {},-// inputShow: false,-// };-// }--// ref = createRef();--// inputRef = createRef();--// onDblClick() {-// clearTimeout(timeOut!);-// if (!this.props.isInput) return;-// this.setState({-// inputShow: true,-// });-// }--// /**-// * Listen for click events-// * @eventProperty-// */-// handleClick(...args: any[]) {-// this.hideSelect(args[0]);-// const { item } = args[1];-// this.props.onChange(item);-// this.setState({-// active: item,-// });-// }--// // 显示子组件-// showSelect = (e: MouseEvent) => {-// if (this.state.inputShow) return;-// clearTimeout(timeOut!);-// timeOut = setTimeout(() => {-// e.stopImmediatePropagation();-// const current = this.ref.current;-// if (current) current.showSelect();-// }, time);--// // 点击外部隐藏子组件-// document.addEventListener('click', this.hideSelect, true);-// };--// // 隐藏子组件-// hideSelect = (e: MouseEvent) => {-// if (this.state.inputShow && this.inputRef.current.contains(e.target)) return;-// const current = this.ref.current;--// if (current) {-// current.hideSelect(e);-// this.setState({-// inputShow: false,-// });-// }--// document.removeEventListener('click', this.hideSelect, true);-// };--// componentWillMount() {-// this.setState({-// active: this.props.children[0],-// });-// }--// render() {-// const { NextIcon, Ul } = this;-// return (-// <div className={styles.printSelect}>-// <div className={styles.printSelectTitle}>{this.props.title}</div>-// <div className={styles.printSelector} onClick={this.showSelect.bind(this)} onDblClick={this.onDblClick.bind(this)}>-// <span className={styles.printSelectorLabel}>-// {this.state.inputShow ? <input type="text" className={styles.printSelectInput} ref={this.inputRef} /> : <span>{this.state.active.label}</span>}-// </span>-// <NextIcon />-// <Ul children={this.props.children} onClick={this.handleClick.bind(this)} ref={this.ref}></Ul>-// </div>-// </div>-// );-// }-// }--// export { PrintSelect };diff --git a/packages/sheets-plugin-print/src/View/Event.ts b/packages/sheets-plugin-print/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-print/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-print/src/View/ObserverList.ts b/packages/sheets-plugin-print/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-print/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-print/src/View/Render.ts b/packages/sheets-plugin-print/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-print/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-print/src/View/index.ts b/packages/sheets-plugin-print/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-print/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-print/src/index.ts b/packages/sheets-plugin-print/src/index.tsdeleted file mode 100644index 60cfd78569..0000000000--- a/packages/sheets-plugin-print/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { PrintPlugin } from './PrintPlugin';--export { PrintPlugin };diff --git a/packages/sheets-plugin-print/src/main.tsx b/packages/sheets-plugin-print/src/main.tsxdeleted file mode 100644index b8d70ffa57..0000000000--- a/packages/sheets-plugin-print/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new PrintPlugin());diff --git a/packages/sheets-plugin-print/tsconfig.json b/packages/sheets-plugin-print/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-print/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-print/vite.config.ts b/packages/sheets-plugin-print/vite.config.tsdeleted file mode 100644index e8954832e4..0000000000--- a/packages/sheets-plugin-print/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginPrint',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-print',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-protection/README-zh.md b/packages/sheets-plugin-protection/README-zh.mddeleted file mode 100644index 819b71cc5f..0000000000--- a/packages/sheets-plugin-protection/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Protection 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-protection-```--### 使用--```js-import { Protection } from '@univerjs/sheets-plugin-protection';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Protection());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-protection/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-protection dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-protection/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-protection build-```diff --git a/packages/sheets-plugin-protection/README.md b/packages/sheets-plugin-protection/README.mddeleted file mode 100644index ab61448dab..0000000000--- a/packages/sheets-plugin-protection/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Protection--### Installation--```shell-npm i @univerjs/sheets-plugin-protection-```--### Usage--```js-import { Protection } from '@univerjs/sheets-plugin-protection';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Protection());-```--## 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/sheets-plugin-protection/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-protection dev-```--### Package--```-# Current directory ./packages/sheets-plugin-protection/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-protection build-```diff --git a/packages/sheets-plugin-protection/index.html b/packages/sheets-plugin-protection/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-protection/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-protection/jest.config.js b/packages/sheets-plugin-protection/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-protection/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/packages/sheets-plugin-protection/package.json b/packages/sheets-plugin-protection/package.jsondeleted file mode 100644index 66183d9340..0000000000--- a/packages/sheets-plugin-protection/package.json+++ /dev/null@@ -1,66 +0,0 @@-{- "name": "@univerjs/sheets-plugin-protection",- "version": "0.0.1",- "description": "UniverSheet normal plugin-protection",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-protection.cjs.js",- "module": "./lib/univer-sheets-plugin-protection.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-protection.cjs.js",- "default": "./lib/univer-sheets-plugin-protection.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-protection/src/Action/AddAllowedAction.ts b/packages/sheets-plugin-protection/src/Action/AddAllowedAction.tsdeleted file mode 100644index e77a230f42..0000000000--- a/packages/sheets-plugin-protection/src/Action/AddAllowedAction.ts+++ /dev/null@@ -1,42 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, Workbook } from '@univerjs/core';-import { Allowed } from '../Controller';-import { AddAllowed, RemoveAllowed } from '../Apply';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export interface IAddAllowedActionData extends ISheetActionData {- allowed: Allowed;-}--export class AddAllowedAction extends SheetActionBase<IAddAllowedActionData, IAddAllowedActionData> {- constructor(actionData: IAddAllowedActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.ADD_ALLOWED_ACTION,- sheetId: actionData.sheetId,- allowed: actionData.allowed,- };- this.do();- this.validate();- }-- do(): void {- this.redo();- }-- redo(): void {- const worksheet = this.getWorkSheet();- AddAllowed(worksheet, this._doActionData.allowed);- }-- undo(): void {- const worksheet = this.getWorkSheet();- RemoveAllowed(worksheet, this._doActionData.allowed);- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-protection/src/Action/AddUnlockAction.ts b/packages/sheets-plugin-protection/src/Action/AddUnlockAction.tsdeleted file mode 100644index df26217517..0000000000--- a/packages/sheets-plugin-protection/src/Action/AddUnlockAction.ts+++ /dev/null@@ -1,41 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, Range, Workbook } from '@univerjs/core';-import { AddUnlock, RemoveUnlock } from '../Apply';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export interface IAddUnlockActionData extends ISheetActionData {- unlock: Range;-}--export class AddUnlockAction extends SheetActionBase<IAddUnlockActionData, IAddUnlockActionData> {- constructor(actionData: IAddUnlockActionData, workbook: Workbook, observers: ActionObservers) {- super(actionData, workbook, observers);- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.ADD_UNLOCK_ACTION,- sheetId: actionData.sheetId,- unlock: actionData.unlock,- };- this.do();- this.validate();- }-- do(): void {- this.redo();- }-- redo(): void {- const worksheet = this.getWorkSheet();- AddUnlock(worksheet, this._doActionData.unlock);- }-- undo(): void {- const worksheet = this.getWorkSheet();- RemoveUnlock(worksheet, this._doActionData.unlock);- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-protection/src/Action/RegisterAction.ts b/packages/sheets-plugin-protection/src/Action/RegisterAction.tsdeleted file mode 100644index ebf5fedbcd..0000000000--- a/packages/sheets-plugin-protection/src/Action/RegisterAction.ts+++ /dev/null@@ -1,9 +0,0 @@-import { CommandManager } from '@univerjs/core';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';-import { AddAllowedAction } from './AddAllowedAction';-import { AddUnlockAction } from './AddUnlockAction';-import { SetProtectionAction } from './SetProtectionAction';--CommandManager.register(ACTION_NAMES.ADD_ALLOWED_ACTION, AddAllowedAction);-CommandManager.register(ACTION_NAMES.ADD_UNLOCK_ACTION, AddUnlockAction);-CommandManager.register(ACTION_NAMES.SET_PROTECTION_ACTION, SetProtectionAction);diff --git a/packages/sheets-plugin-protection/src/Action/SetProtectionAction.ts b/packages/sheets-plugin-protection/src/Action/SetProtectionAction.tsdeleted file mode 100644index 2937b07757..0000000000--- a/packages/sheets-plugin-protection/src/Action/SetProtectionAction.ts+++ /dev/null@@ -1,45 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, CommandUnit } from '@univerjs/core';-import { SetProtection } from '../Apply';-import { ACTION_NAMES } from '../Basics/Enum/ACTION_NAMES';--export interface ISetProtectionActionData extends ISheetActionData {- enable: boolean;- password: string;-}--export class SetProtectionAction extends SheetActionBase<ISetProtectionActionData, ISetProtectionActionData> {- protected _oldValue: [boolean, string];-- constructor(actionData: ISetProtectionActionData, commandUnit: CommandUnit, observers: ActionObservers) {- super(actionData, commandUnit, observers);- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.SET_PROTECTION_ACTION,- sheetId: actionData.sheetId,- enable: actionData.enable,- password: actionData.password,- };- this.do();- this.validate();- }-- do(): void {- this.redo();- }-- redo(): void {- const worksheet = this.getWorkSheet();- this._oldValue = SetProtection(worksheet, this._doActionData.enable, this._doActionData.password);- }-- undo(): void {- const worksheet = this.getWorkSheet();- SetProtection(worksheet, this._oldValue[0], this._oldValue[1]);- }-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-protection/src/Action/index.ts b/packages/sheets-plugin-protection/src/Action/index.tsdeleted file mode 100644index 749907f23f..0000000000--- a/packages/sheets-plugin-protection/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './AddAllowedAction';-export * from './AddUnlockAction';-export * from './SetProtectionAction';diff --git a/packages/sheets-plugin-protection/src/Apply/AddAllowed.ts b/packages/sheets-plugin-protection/src/Apply/AddAllowed.tsdeleted file mode 100644index bf542d661d..0000000000--- a/packages/sheets-plugin-protection/src/Apply/AddAllowed.ts+++ /dev/null@@ -1,7 +0,0 @@-import { Worksheet } from '@univerjs/core';-import { Allowed } from '../Controller';--export function AddAllowed(workSheet: Worksheet, allowed: Allowed) {- // const protection = workSheet.getProtection();- // protection.getAllowedList().addAllow(allowed);-}diff --git a/packages/sheets-plugin-protection/src/Apply/AddUnlock.ts b/packages/sheets-plugin-protection/src/Apply/AddUnlock.tsdeleted file mode 100644index 3d5e68f25f..0000000000--- a/packages/sheets-plugin-protection/src/Apply/AddUnlock.ts+++ /dev/null@@ -1,6 +0,0 @@-import { Range, Worksheet } from '@univerjs/core';--export function AddUnlock(workSheet: Worksheet, unlock: Range) {- // const protection = workSheet.getProtection();- // protection.getUnlockList().addUnlock(unlock);-}diff --git a/packages/sheets-plugin-protection/src/Apply/RemoveAllowed.ts b/packages/sheets-plugin-protection/src/Apply/RemoveAllowed.tsdeleted file mode 100644index 727846b61b..0000000000--- a/packages/sheets-plugin-protection/src/Apply/RemoveAllowed.ts+++ /dev/null@@ -1,7 +0,0 @@-import { Worksheet } from '@univerjs/core';-import { Allowed } from '../Controller';--export function RemoveAllowed(workSheet: Worksheet, allowed: Allowed) {- // const protection = workSheet.getProtection();- // protection.getAllowedList().removeAllow(allowed);-}diff --git a/packages/sheets-plugin-protection/src/Apply/RemoveUnlock.ts b/packages/sheets-plugin-protection/src/Apply/RemoveUnlock.tsdeleted file mode 100644index 45b3156221..0000000000--- a/packages/sheets-plugin-protection/src/Apply/RemoveUnlock.ts+++ /dev/null@@ -1,6 +0,0 @@-import { Range, Worksheet } from '@univerjs/core';--export function RemoveUnlock(workSheet: Worksheet, unlock: Range) {- // const protection = workSheet.getProtection();- // protection.getUnlockList().removeUnlock(unlock);-}diff --git a/packages/sheets-plugin-protection/src/Apply/SetProtection.ts b/packages/sheets-plugin-protection/src/Apply/SetProtection.tsdeleted file mode 100644index 6b41db00d6..0000000000--- a/packages/sheets-plugin-protection/src/Apply/SetProtection.ts+++ /dev/null@@ -1,11 +0,0 @@-import { Worksheet } from '@univerjs/core';--export function SetProtection(workSheet: Worksheet, enable: boolean, password: string): [boolean, string] {- // const protection = workSheet.getProtection();- // const oldEnable = protection.getEnable();- // const oldPassword = protection.getPassword();- // protection.setPassword(password);- // protection.setEnable(enable);- // return [oldEnable, oldPassword];- return [false, ''];-}diff --git a/packages/sheets-plugin-protection/src/Apply/index.ts b/packages/sheets-plugin-protection/src/Apply/index.tsdeleted file mode 100644index c2eceb486d..0000000000--- a/packages/sheets-plugin-protection/src/Apply/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export * from './AddAllowed';-export * from './AddUnlock';-export * from './RemoveUnlock';-export * from './RemoveAllowed';-export * from './SetProtection';diff --git a/packages/sheets-plugin-protection/src/Basics/Cache.ts b/packages/sheets-plugin-protection/src/Basics/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-protection/src/Basics/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-protection/src/Basics/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-protection/src/Basics/Const/PLUGIN_NAME.tsdeleted file mode 100644index 477331fd61..0000000000--- a/packages/sheets-plugin-protection/src/Basics/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const PROTECTION_PLUGIN_NAME = 'protection';diff --git a/packages/sheets-plugin-protection/src/Basics/Const/index.ts b/packages/sheets-plugin-protection/src/Basics/Const/index.tsdeleted file mode 100644index caeb42be51..0000000000--- a/packages/sheets-plugin-protection/src/Basics/Const/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './PLUGIN_NAME';diff --git a/packages/sheets-plugin-protection/src/Basics/Enum/ACTION_NAMES.ts b/packages/sheets-plugin-protection/src/Basics/Enum/ACTION_NAMES.tsdeleted file mode 100644index 3c79529df7..0000000000--- a/packages/sheets-plugin-protection/src/Basics/Enum/ACTION_NAMES.ts+++ /dev/null@@ -1,7 +0,0 @@-export enum ACTION_NAMES {- ADD_ALLOWED_ACTION = 'AddAllowedAction',- ADD_UNLOCK_ACTION = 'AddUnlockAction',- SET_PROTECTION_ACTION = 'SetProtectionAction',-}--export type ACTION_NAMES_TYPE = `${ACTION_NAMES}`;diff --git a/packages/sheets-plugin-protection/src/Basics/Enum/index.ts b/packages/sheets-plugin-protection/src/Basics/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-protection/src/Basics/Shared/index.ts b/packages/sheets-plugin-protection/src/Basics/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-protection/src/Basics/State.ts b/packages/sheets-plugin-protection/src/Basics/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-protection/src/Basics/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-protection/src/Basics/index.ts b/packages/sheets-plugin-protection/src/Basics/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-protection/src/Basics/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-protection/src/Controller/Allowed.ts b/packages/sheets-plugin-protection/src/Controller/Allowed.tsdeleted file mode 100644index 7c8265713a..0000000000--- a/packages/sheets-plugin-protection/src/Controller/Allowed.ts+++ /dev/null@@ -1,20 +0,0 @@-import { Range } from '@univerjs/core';--export class Allowed {- protected _password: string;-- protected _range: Range;-- constructor(password: string, range: Range) {- this._password = password;- this._range = range;- }-- getRange(): Range {- return this._range;- }-- getPassword(): string {- return this._password;- }-}diff --git a/packages/sheets-plugin-protection/src/Controller/AllowedList.ts b/packages/sheets-plugin-protection/src/Controller/AllowedList.tsdeleted file mode 100644index 736112528b..0000000000--- a/packages/sheets-plugin-protection/src/Controller/AllowedList.ts+++ /dev/null@@ -1,36 +0,0 @@-import { Nullable, Rectangle } from '@univerjs/core';-import { Allowed } from './Allowed';--export class AllowedList {- protected _allowList: Allowed[];-- constructor() {- this._allowList = new Array<Allowed>();- }-- removeAllow(allow: Allowed): void {- for (let i = 0; i < this._allowList.length; i++) {- if (this._allowList[i] === allow) {- this._allowList.splice(i, 1);- }- }- }-- addAllow(allow: Allowed): void {- this._allowList.push(allow);- }-- isLockCell(row: number, column: number): Nullable<Allowed> {- for (let i = 0; i < this._allowList.length; i++) {- const allowed = this._allowList[i];- const range = allowed.getRange();- const data = range.getRangeData();- const rect = new Rectangle(data.startRow, data.startColumn, data.endRow, data.endColumn);- const item = new Rectangle(row, column, row, column);- if (rect.intersects(item)) {- return allowed;- }- }- return null;- }-}diff --git a/packages/sheets-plugin-protection/src/Controller/Protection.ts b/packages/sheets-plugin-protection/src/Controller/Protection.tsdeleted file mode 100644index cdbfc1c0e6..0000000000--- a/packages/sheets-plugin-protection/src/Controller/Protection.ts+++ /dev/null@@ -1,337 +0,0 @@-import { Nullable, Rectangle } from '@univerjs/core';-import { Allowed } from './Allowed';-import { AllowedList } from './AllowedList';-import { UnlockList } from './UnlockList';--export class Protection {- protected _unlockList: UnlockList;-- protected _allowedList: AllowedList;-- protected _useColumnFormat: boolean;-- protected _useRowFormat: boolean;-- protected _useInsertRow: boolean;-- protected _useInsertColumn: boolean;-- protected _useRemoveRow: boolean;-- protected _useRemoveColumn: boolean;-- protected _useCellFormat: boolean;-- protected _useSort: boolean;-- protected _useFilter: boolean;-- protected _useSelectLockCell: boolean;-- protected _useSelectUnlockCell: boolean;-- protected _enable: boolean;-- protected _password: string;-- constructor() {- this._unlockList = new UnlockList();- this._allowedList = new AllowedList();- }-- isEnable(): boolean {- return this._enable;- }-- isLockCell(row: number, column: number): Nullable<Rectangle> {- return this._unlockList.isLockCell(row, column);- }-- isAllowCell(row: number, column: number): Nullable<Allowed> {- return this._allowedList.isLockCell(row, column);- }-- getUseCellFormat(): boolean {- return this._useCellFormat;- }-- getUseSort(): boolean {- return this._useSort;- }-- getUseFilter(): boolean {- return this._useRemoveColumn;- }-- getUseSelectLockCell(): boolean {- return this._useSelectLockCell;- }-- getUseSelectUnlockCell(): boolean {- return this._useSelectUnlockCell;- }-- getUseColumnFormat(): boolean {- return this._useCellFormat;- }-- getUseRowFormat(): boolean {- return this._useCellFormat;- }-- getUseInsertRow(): boolean {- return this._useCellFormat;- }-- getUseInsertColumn(): boolean {- return this._useInsertColumn;- }-- getEnable(): boolean {- return this._enable;- }-- getUseRemoveRow(): boolean {- return this._useRemoveRow;- }-- getPassword(): string {- return this._password;- }-- getAllowedList(): AllowedList {- return this._allowedList;- }-- getUnlockList(): UnlockList {- return this._unlockList;- }-- getUseRemoveColumn(): boolean {- return this._useRemoveColumn;- }-- setUseSort(): boolean {- return this._useSort;- }-- setUseFilter(): boolean {- return this._useRemoveColumn;- }-- setUseCellFormat(): boolean {- return this._useCellFormat;- }-- setEnable(enable: boolean): void {- this._enable = enable;- }-- setUseSelectLockCell(value: boolean): void {- this._useSelectLockCell = value;- }-- setUseSelectUnlockCell(value: boolean): void {- this._useSelectUnlockCell = value;- }-- setUseColumnFormat(value: boolean): void {- this._useCellFormat = value;- }-- setPassword(password: string): void {- this._password = password;- }-- setUseRowFormat(value: boolean): void {- this._useCellFormat = value;- }-- setUseInsertRow(value: boolean): void {- this._useCellFormat = value;- }-- setUseInsertColumn(value: boolean): void {- this._useInsertColumn = value;- }-- setUseRemoveRow(value: boolean): void {- this._useRemoveRow = value;- }-- setUseRemoveColumn(value: boolean): void {- this._useRemoveColumn = value;- }-}--// import { Range } from '@univerjs/core';--// interface IConfig {-// canSelect: boolean;--// canSetCell: boolean;-// canSetRow: boolean;-// canSetCol: boolean;--// canInsertRow: boolean;-// canInsertcol: boolean;-// canInsertLink: boolean;--// canDeleteRow: boolean;-// canDeleteCol: boolean;--// canSort: boolean;-// canFilter: boolean;-// canReport: boolean;-// }--// export class Protection {-// // 是否可编辑-// private _canEdit: boolean;--// private _password: string;--// private _config: IConfig;--// // 可编辑范围-// private _editRange: Array<Range>;--// // 禁止编辑范围-// private _notEditRange: Array<Range>;--// setConfig() {}--// getConfig() {}--// // return sheet or range-// getProtectionType() {}-// }--// class Demo {-// /**-// * 将给定用户添加到受保护工作表或范围的编辑器列表中。-// * @param { string | User | string[]} emailAddress-// */-// addEditor(user: string | User | string[]) {}--// /**-// * 将指定的目标受众添加为受保护范围的编辑者。-// * @param { string } audienceId-// */-// addTargetAudience(audienceId: string) {}--// /**-// * 确定拥有电子表格的域中的所有用户是否都有权编辑受保护的范围或工作表。-// */-// canDomainEdit() {}--// /**-// * 确定用户是否有权编辑受保护的范围或工作表。-// */-// canEdit() {}--// /**-// * 获取受保护的区域或工作表的说明。-// */-// getDescription() {}--// /**-// * 获取受保护区域或工作表的编辑器列表。-// */-// getEditors() {}--// /**-// * 获取受保护区域的类型,范围或 SHEET。-// */-// getProtectionType() {}--// /**-// * 获取受保护的范围。-// */-// getRange() {}--// /**-// * 获取受保护区域的名称(如果它与命名区域相关联)。-// */-// getRangeName() {}--// /**-// * 返回可以编辑受保护范围的目标访问群体的 ID。-// */-// getTargetAudiences() {}--// /**-// * 获取受保护工作表中未受保护的范围的数组。-// */-// getUnprotectedRanges() {}--// /**-// * 确定受保护区域是否正在使用"基于警告"的保护。-// */-// isWarningOnly() {}--// /**-// * 取消保护范围或工作表。-// */-// remove() {}--// /**-// * 从受保护的工作表或范围的编辑器列表中删除给定用户。-// * @param { string | User } user-// */-// removeEditor(user: string | User) {}--// /**-// * 从受保护的工作表或范围的编辑器列表中删除给定的用户数组。-// * @param { string[] } emailAddresses-// */-// removeEditors(emailAddresses: string[]) {}--// /**-// * 将指定的目标访问群体作为受保护范围的编辑者删除。-// * @param { string } audienceId-// */-// removeTargetAudience(audienceId: string) {}--// /**-// * 设置受保护的区域或工作表的说明。-// * @param { string } description-// */-// setDescription(description: string) {}--// /**-// * 设置拥有电子表格的域中的所有用户是否都有权编辑受保护的区域或工作表。-// * @param { string } editable-// */-// setDomainEdit(editable: string) {}--// /**-// * 将受保护的范围与现有的命名区域相关联。-// * @param { NamedRange } namedRange-// */-// setNamedRange(namedRange: NamedRange) {}--// /**-// * 调整受保护的范围。-// * @param { Range } range-// */-// setRange(range: Range) {}--// /**-// * 将受保护的范围与现有的命名区域相关联。-// * @param { string } rangeName-// */-// setRangeName(rangeName: string) {}--// /**-// * 取消保护受保护工作表中给定的范围数组。-// * @param { Range[] } ranges-// */-// setUnprotectedRanges(ranges: Range[]) {}--// /**-// * 设置此受保护范围是否使用"基于警告"的保护。-// * @param { Boolean } warningOnly-// */-// setWarningOnly(warningOnly: boolean) {}-// }diff --git a/packages/sheets-plugin-protection/src/Controller/UnlockList.ts b/packages/sheets-plugin-protection/src/Controller/UnlockList.tsdeleted file mode 100644index ee706943fb..0000000000--- a/packages/sheets-plugin-protection/src/Controller/UnlockList.ts+++ /dev/null@@ -1,34 +0,0 @@-import { Nullable, Range, Rectangle } from '@univerjs/core';--export class UnlockList {- protected _rangeList: Range[];-- constructor() {- this._rangeList = new Array<Range>();- }-- removeUnlock(range: Range): void {- for (let i = 0; i < this._rangeList.length; i++) {- if (this._rangeList[i] === range) {- this._rangeList.splice(i, 1);- }- }- }-- addUnlock(range: Range): void {- this._rangeList.push(range);- }-- isLockCell(row: number, column: number): Nullable<Rectangle> {- for (let i = 0; i < this._rangeList.length; i++) {- const range = this._rangeList[i];- const data = range.getRangeData();- const rect = new Rectangle(data.startRow, data.startColumn, data.endRow, data.endColumn);- const item = new Rectangle(row, column, row, column);- if (rect.intersects(item)) {- return rect;- }- }- return null;- }-}diff --git a/packages/sheets-plugin-protection/src/Controller/index.ts b/packages/sheets-plugin-protection/src/Controller/index.tsdeleted file mode 100644index 641c4197d9..0000000000--- a/packages/sheets-plugin-protection/src/Controller/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export * from './Allowed';-export * from './AllowedList';-export * from './Protection';-export * from './UnlockList';diff --git a/packages/sheets-plugin-protection/src/IData/IProtection.ts b/packages/sheets-plugin-protection/src/IData/IProtection.tsdeleted file mode 100644index 964fd78160..0000000000--- a/packages/sheets-plugin-protection/src/IData/IProtection.ts+++ /dev/null@@ -1,8 +0,0 @@-import { SheetContext } from '@univerjs/core';--export type IConfig = {- context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-protection/src/IData/index.ts b/packages/sheets-plugin-protection/src/IData/index.tsdeleted file mode 100644index 36d0c93d31..0000000000--- a/packages/sheets-plugin-protection/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IProtection';diff --git a/packages/sheets-plugin-protection/src/Locale/en.ts b/packages/sheets-plugin-protection/src/Locale/en.tsdeleted file mode 100644index f6a7fc9a87..0000000000--- a/packages/sheets-plugin-protection/src/Locale/en.ts+++ /dev/null@@ -1,10 +0,0 @@-export default {- protection: {- protectionLabel: 'Worksheet Protection',- Ok: 'OK',- Cancel: 'Cancel',- ProtectionWorksheet: 'Protection Worksheet',- AllowUsersToEdit: 'Allow users to edit',- Password: 'Please enter the password (can be left blank)',- },-};diff --git a/packages/sheets-plugin-protection/src/Locale/index.ts b/packages/sheets-plugin-protection/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-protection/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-protection/src/Locale/zh.ts b/packages/sheets-plugin-protection/src/Locale/zh.tsdeleted file mode 100644index e4e693d75f..0000000000--- a/packages/sheets-plugin-protection/src/Locale/zh.ts+++ /dev/null@@ -1,10 +0,0 @@-export default {- protection: {- protectionLabel: '工作表保护',- Ok: '确定',- Cancel: '取消',- ProtectionWorksheet: '保护工作表',- AllowUsersToEdit: '允许用户编辑',- Password: '请输入密码(可留空)',- },-};diff --git a/packages/sheets-plugin-protection/src/ProtectionPlugin.tsx b/packages/sheets-plugin-protection/src/ProtectionPlugin.tsxdeleted file mode 100644index 6d8773a2a3..0000000000--- a/packages/sheets-plugin-protection/src/ProtectionPlugin.tsx+++ /dev/null@@ -1,67 +0,0 @@-import { SheetContext, UniverSheet, Plugin } from '@univerjs/core';-import { PROTECTION_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';-import { Protection } from './Controller';--export interface IProtectionPluginConfig {}--export class ProtectionPlugin extends Plugin {- _protectionSlider: Protection;-- constructor(config?: IProtectionPluginConfig) {- super(PROTECTION_PLUGIN_NAME);- }-- static create(config?: IProtectionPluginConfig) {- return new ProtectionPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- // /**- // * load more Locale object- // */- // context.getLocale().load({- // en,- // zh,- // });- // const config: IConfig = {- // context,- // };- //- // const item: IToolbarItemProps = {- // locale: PROTECTION_PLUGIN_NAME,- // type: ISlotElement.JSX,- // show: true,- // label: <ProtectionButton config={config} />,- // };- // context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- //- // // TODO- // this._protectionSlider = new Protection();- //- // const rangeData = {- // startRow: 0,- // endRow: 10,- // startColumn: 0,- // endColumn: 10,- // };- //- // const siderItem: ISlotProps = {- // name: 'protection',- // type: ISlotElement.JSX,- // label: <ProtectionSide config={{ rangeData, context, protection: this._protectionSlider }} />,- // };- // context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addSider(siderItem);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-protection/src/Types/index.d.ts b/packages/sheets-plugin-protection/src/Types/index.d.tsdeleted file mode 100644index 86db48aa5f..0000000000--- a/packages/sheets-plugin-protection/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-protection' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-protection/src/Types/preact.d.ts b/packages/sheets-plugin-protection/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-protection/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-protection/src/UI/ProtectionButton.tsx b/packages/sheets-plugin-protection/src/UI/ProtectionButton.tsxdeleted file mode 100644index 1eee9a64d4..0000000000--- a/packages/sheets-plugin-protection/src/UI/ProtectionButton.tsx+++ /dev/null@@ -1,97 +0,0 @@-import { Component } from '@univerjs/base-ui';-import { Nullable, Observer, Workbook } from '@univerjs/core';-import { ComponentChild, RenderableProps } from 'preact';-import { IProps } from '../IData/IProtection';--// Types for state-// interface IState {-// protection: IToolbarItemProps;-// }--export class ProtectionButton extends Component<IProps> {- private _localeObserver: Nullable<Observer<Workbook>>;-- // SingleButton: FunctionComponent<BaseSingleButtonProps>;- //- // LockIcon: FunctionComponent<BaseIconProps>;-- initialize(props: IProps) {- // super();- // const component = this._context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- // const render = component.getComponentRender();- // this.SingleButton = render.renderFunction('SingleButton');- // this.LockIcon = render.renderFunction('LockIcon');- //- // const protection: IToolbarItemProps = {- // locale: 'protection',- // type: 'single',- // label: <this.LockIcon />,- // show: true,- // onClick: () => {- // this._context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.showSiderByName(PROTECTION_PLUGIN_NAME, true);- // },- // };- // this.state = {- // protection,- // };- }-- /**- * init- */- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserver = this.getContext()- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- // const locale = this.getContext().getLocale();- // let item = this.state.protection;- // // set current Locale string for tooltip- // item.tooltip = locale.get(`${item.locale}.${item.locale}Label`);- // this.setState({ protection: item });- }-- render(props: RenderableProps<IProps> | undefined, state: Readonly<{}> | undefined, context: any): ComponentChild {- return undefined;- }-- /**- * Render the component's HTML- *- * @returns {void}- */- // render(props: IProps, state: IState) {- // const { protection } = state;- // // Set Provider for entire Container- // return (- // <SingleButton- // tooltip={protection.tooltip}- // key={protection.locale}- // name={protection.locale}- // label={protection.label}- // icon={protection.icon}- // onClick={protection.onClick?.bind(this)}- // ></SingleButton>- // // <Select tooltip={protection.tooltip} tooltipRight={protection.tooltipRight} key={protection.name} label={protection.label} onClick={protection.onClick?.bind(this)} />- // );- // }-}diff --git a/packages/sheets-plugin-protection/src/UI/ProtectionSide/ProtectionSide.tsx b/packages/sheets-plugin-protection/src/UI/ProtectionSide/ProtectionSide.tsxdeleted file mode 100644index dfc9b04f84..0000000000--- a/packages/sheets-plugin-protection/src/UI/ProtectionSide/ProtectionSide.tsx+++ /dev/null@@ -1,124 +0,0 @@-import { BaseComponentSheet, Component } from '@univerjs/base-ui';-import { SheetContext, IRangeData, Nullable, Observer, Workbook } from '@univerjs/core';-import { Protection } from '../../Controller/Protection';--import styles from './index.module.less';--type IConfig = {- context: SheetContext;- rangeData: IRangeData;- protection: Protection;-};--interface IProps {- config: IConfig;- style?: JSX.CSSProperties;-}-interface IState {- configTxt: Array<{ checked: boolean; label: string }>;- isShow: boolean;- locale: any;-}--class ProtectionSide extends Component<IProps, IState> {- private _localeObserv: Nullable<Observer<Workbook>>;-- // protectionRef = createRef();- //- // SiderModal: FunctionComponent<BaseSiderModalProps>;-- initialize(props: IProps) {- // super(props);-- const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- const render = component.getComponentRender();- // this.SiderModal = render.renderFunction('SiderModal');-- this.state = {- configTxt: [- { checked: false, label: '选定1' },- { checked: false, label: '选定2' },- ],- isShow: true,- locale: null,- };- }-- componentWillMount() {- this.setLocale();-- // subscribe Locale change event-- this._localeObserv = this.getContext()- .getObserverManager()- .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- ?.add(() => {- this.setLocale();- });- }-- componentWillUnmount() {- // this.context.coreContext.getObserverManager().getObserver('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserv);- }-- setLocale() {- const locale = this.context.coreContext.getLocale().get('protection');- this.setState({ locale });- }-- changeChecked(index: number) {- const configTxt = this.state.configTxt;- configTxt[index].checked = !configTxt[index].checked;- this.setState({- configTxt,- });- }-- footer() {- return (- <div className={styles.protectionSideFooter}>- <div className={styles.protectionSideOk}>{this.state.locale.Ok}</div>- <div className={styles.protectionSideCancel}>{this.state.locale.Cancel}</div>- </div>- );- }-- render() {- // const { style } = this.props;- // return (- // <this.SiderModal- // title={this.state.locale.protectionLabel}- // closeSide={() => {- // // this.context.coreContext.getPluginManager().getPluginByName<StyleUniverSheet>('styleUniverSheet')?.showSiderByName(PROTECTION_PLUGIN_NAME, false);- // }}- // footer={this.footer()}- // pluginName={PROTECTION_PLUGIN_NAME}- // className={styles.protectionSide}- // style={{ ...style }}- // >- // <div className={styles.protectionSideBody}>- // <div className={styles.protectionSideSwich}>- // <input type="checkbox" />- // <label>{this.state.locale.ProtectionWorksheet}</label>- // </div>- // <div className={styles.protectionSideTxt}>- // <input type="text" placeholder={this.state.locale.Password} />- // <textarea type="text" placeholder="" />- // </div>- // <ul className={styles.protectionSideConfig}>- // {this.state.configTxt.map((item, index) => (- // <li onClick={this.changeChecked.bind(this, index)}>- // <input type="checkbox" checked={item.checked} />- // <label>{item.label}</label>- // </li>- // ))}- // </ul>- // <div className={styles.protectionSideCol}>{this.state.locale.AllowUsersToEdit}</div>- // </div>- // </this.SiderModal>- // );- return null;- }-}--export { ProtectionSide };diff --git a/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.module.less b/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.module.lessdeleted file mode 100644index 9f83c65120..0000000000--- a/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.module.less+++ /dev/null@@ -1,126 +0,0 @@-.protection-side {- position: fixed;- right: 0;- top: 0;- width: 300px;- // height: 100vh;- border-left: 1px solid;- display: flex;- flex-direction: column;- transition: all 0.5s;- opacity: 1;-- .protection-side-header {- font-size: 16px;- color: #fff;- background-color: #666;- display: flex;- align-items: center;- justify-content: space-between;- height: 40px;- padding: 0 15px;- box-sizing: border-box;- }- .protection-side-body {- font-size: 14px;- padding: 10px 5px;- flex: 1;-- .protection-side-swich {- font-size: 14px;- }-- .protection-side-txt {- margin: 10px 0;- input {- width: 100%;- display: block;- box-sizing: border-box;- margin-bottom: 10px;- }- textarea {- width: 100%;- display: block;- box-sizing: border-box;- resize: none;- }- }- .protection-side-config {- font-size: 14px;- }- .protection-side-col {- margin: 10px 0;- padding: 10px 0;- border-top: 1px solid #ededed;- }- }-- .protection-side-footer {- text-align: center;- display: flex;-- .protection-side-ok {- color: #fff;- background-color: #0188fb;- padding: 10px;- flex: 1;- }- .protection-side-cancel {- color: #333;- background-color: #fafafa;- padding: 10px;- flex: 1;- }- }-}-.protection-side-body {- width: 100%;- font-size: 14px;- padding: 10px 5px;- flex: 1;-- .protection-side-swich {- font-size: 14px;- }-- .protection-side-txt {- margin: 10px 0;- input {- width: 100%;- display: block;- box-sizing: border-box;- margin-bottom: 10px;- }- textarea {- width: 100%;- display: block;- box-sizing: border-box;- resize: none;- }- }- .protection-side-config {- font-size: 14px;- }- .protection-side-col {- margin: 10px 0;- padding: 10px 0;- border-top: 1px solid #ededed;- }-}-.protection-side-footer {- text-align: center;- display: flex;-- .protection-side-ok {- color: #fff;- background-color: #0188fb;- padding: 10px;- flex: 1;- }- .protection-side-cancel {- color: #333;- background-color: #fafafa;- padding: 10px;- flex: 1;- }-}diff --git a/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.ts b/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.tsdeleted file mode 100644index ff3654dff9..0000000000--- a/packages/sheets-plugin-protection/src/UI/ProtectionSide/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ProtectionSide';diff --git a/packages/sheets-plugin-protection/src/View/Event.ts b/packages/sheets-plugin-protection/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-protection/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-protection/src/View/ObserverList.ts b/packages/sheets-plugin-protection/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-protection/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-protection/src/View/Render.ts b/packages/sheets-plugin-protection/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-protection/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-protection/src/View/index.ts b/packages/sheets-plugin-protection/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-protection/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-protection/src/index.ts b/packages/sheets-plugin-protection/src/index.tsdeleted file mode 100644index ef5e390c9a..0000000000--- a/packages/sheets-plugin-protection/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { ProtectionPlugin } from './ProtectionPlugin';--export { ProtectionPlugin };diff --git a/packages/sheets-plugin-protection/src/main.tsx b/packages/sheets-plugin-protection/src/main.tsxdeleted file mode 100644index b39d6fd17d..0000000000--- a/packages/sheets-plugin-protection/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';--const uiDefaultConfigUp = {- container: 'universheet-demo',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-// univerSheetUp.installPlugin(new UniverComponentSheet());-// univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new FilterPlugin());-// univerSheetUp.installPlugin(new ProtectionPlugin());diff --git a/packages/sheets-plugin-protection/tsconfig.json b/packages/sheets-plugin-protection/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-protection/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-protection/vite.config.ts b/packages/sheets-plugin-protection/vite.config.tsdeleted file mode 100644index 084fa7608c..0000000000--- a/packages/sheets-plugin-protection/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginProtection',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-protection',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-screenshot/README-zh.md b/packages/sheets-plugin-screenshot/README-zh.mddeleted file mode 100644index 0e8ee897c1..0000000000--- a/packages/sheets-plugin-screenshot/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Screenshot 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-screenshot-```--### 使用--```js-import { Screenshot } from '@univerjs/sheets-plugin-screenshot';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Screenshot());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-screenshot/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-screenshot dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-screenshot/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-screenshot build-```diff --git a/packages/sheets-plugin-screenshot/README.md b/packages/sheets-plugin-screenshot/README.mddeleted file mode 100644index fdd9c4475c..0000000000--- a/packages/sheets-plugin-screenshot/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Screenshot--### Installation--```shell-npm i @univerjs/sheets-plugin-screenshot-```--### Usage--```js-import { Screenshot } from '@univerjs/sheets-plugin-screenshot';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Screenshot());-```--## 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/sheets-plugin-screenshot/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-screenshot dev-```--### Package--```-# Current directory ./packages/sheets-plugin-screenshot/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-screenshot build-```diff --git a/packages/sheets-plugin-screenshot/index.html b/packages/sheets-plugin-screenshot/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-screenshot/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-screenshot/jest.config.js b/packages/sheets-plugin-screenshot/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-screenshot/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/packages/sheets-plugin-screenshot/package.json b/packages/sheets-plugin-screenshot/package.jsondeleted file mode 100644index d4f9be5378..0000000000--- a/packages/sheets-plugin-screenshot/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-screenshot",- "version": "0.0.1",- "description": "UniverSheet normal plugin screenshot",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-screenshot.cjs.js",- "module": "./lib/univer-sheets-plugin-screenshot.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-screenshot.cjs.js",- "default": "./lib/univer-sheets-plugin-screenshot.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-screenshot/src/Action/ActionScreenshot.ts b/packages/sheets-plugin-screenshot/src/Action/ActionScreenshot.tsdeleted file mode 100644index b4ef763ef8..0000000000--- a/packages/sheets-plugin-screenshot/src/Action/ActionScreenshot.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionScreenshot {}diff --git a/packages/sheets-plugin-screenshot/src/Action/IAction.ts b/packages/sheets-plugin-screenshot/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-screenshot/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-screenshot/src/Action/IActionSet.ts b/packages/sheets-plugin-screenshot/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-screenshot/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-screenshot/src/Action/index.ts b/packages/sheets-plugin-screenshot/src/Action/index.tsdeleted file mode 100644index e9319cd857..0000000000--- a/packages/sheets-plugin-screenshot/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionScreenshot';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-screenshot/src/Base/Cache.ts b/packages/sheets-plugin-screenshot/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-screenshot/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-screenshot/src/Base/State.ts b/packages/sheets-plugin-screenshot/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-screenshot/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-screenshot/src/Base/index.ts b/packages/sheets-plugin-screenshot/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-screenshot/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-screenshot/src/Conflict/ConflictScreenshot.ts b/packages/sheets-plugin-screenshot/src/Conflict/ConflictScreenshot.tsdeleted file mode 100644index 9bb7c6d407..0000000000--- a/packages/sheets-plugin-screenshot/src/Conflict/ConflictScreenshot.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictScreenshot {}diff --git a/packages/sheets-plugin-screenshot/src/Conflict/IConflict.ts b/packages/sheets-plugin-screenshot/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-screenshot/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-screenshot/src/Conflict/index.ts b/packages/sheets-plugin-screenshot/src/Conflict/index.tsdeleted file mode 100644index 447bcc08db..0000000000--- a/packages/sheets-plugin-screenshot/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictScreenshot';diff --git a/packages/sheets-plugin-screenshot/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-screenshot/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index 4748ffe9a8..0000000000--- a/packages/sheets-plugin-screenshot/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const SCREENSHOT_PLUGIN_NAME = 'screenshot';diff --git a/packages/sheets-plugin-screenshot/src/Const/index.ts b/packages/sheets-plugin-screenshot/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-screenshot/src/Domain/Screenshot.ts b/packages/sheets-plugin-screenshot/src/Domain/Screenshot.tsdeleted file mode 100644index a262885628..0000000000--- a/packages/sheets-plugin-screenshot/src/Domain/Screenshot.ts+++ /dev/null@@ -1 +0,0 @@-export class Screenshot {}diff --git a/packages/sheets-plugin-screenshot/src/Domain/index.ts b/packages/sheets-plugin-screenshot/src/Domain/index.tsdeleted file mode 100644index cc8bbffa7c..0000000000--- a/packages/sheets-plugin-screenshot/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Screenshot';diff --git a/packages/sheets-plugin-screenshot/src/Enum/index.ts b/packages/sheets-plugin-screenshot/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-screenshot/src/IData/IScreenshot.ts b/packages/sheets-plugin-screenshot/src/IData/IScreenshot.tsdeleted file mode 100644index 964fd78160..0000000000--- a/packages/sheets-plugin-screenshot/src/IData/IScreenshot.ts+++ /dev/null@@ -1,8 +0,0 @@-import { SheetContext } from '@univerjs/core';--export type IConfig = {- context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-screenshot/src/IData/index.ts b/packages/sheets-plugin-screenshot/src/IData/index.tsdeleted file mode 100644index 032c576aa4..0000000000--- a/packages/sheets-plugin-screenshot/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './IScreenshot';diff --git a/packages/sheets-plugin-screenshot/src/Locale/en.ts b/packages/sheets-plugin-screenshot/src/Locale/en.tsdeleted file mode 100644index 54d2ee37ef..0000000000--- a/packages/sheets-plugin-screenshot/src/Locale/en.ts+++ /dev/null@@ -1,18 +0,0 @@-export default {- screenshot: {- screenshotLabel: 'Screenshot',- screenshotTipNoSelection: 'Please select the scope of the screenshot',- screenshotTipTitle: 'Warning!',- screenshotTipHasMerge: 'This operation cannot be performed on merged cells',- screenshotTipHasMulti: 'This operation cannot be performed on multiple selection regions',- screenshotTipSuccess: 'Successful',- screenshotImageName: 'Screenshot',-- downLoadClose: 'Close',- downLoadCopy: 'Copy to clipboard',- downLoadBtn: 'Download',- browserNotTip: 'not supported by IE browser!',- rightclickTip: 'Please right-click "copy" on the picture',- successTip: 'Successfully (if pasting fails, please right-click on the image to "copy image")',- },-};diff --git a/packages/sheets-plugin-screenshot/src/Locale/index.ts b/packages/sheets-plugin-screenshot/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-screenshot/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-screenshot/src/Locale/zh.ts b/packages/sheets-plugin-screenshot/src/Locale/zh.tsdeleted file mode 100644index 523f6d8006..0000000000--- a/packages/sheets-plugin-screenshot/src/Locale/zh.ts+++ /dev/null@@ -1,18 +0,0 @@-export default {- screenshot: {- screenshotLabel: '截图',- screenshotTipNoSelection: '请框选需要截图的范围',- screenshotTipTitle: '提示!',- screenshotTipHasMerge: '无法对合并单元格执行此操作',- screenshotTipHasMulti: '无法对多重选择区域执行此操作',- screenshotTipSuccess: '截取成功',- screenshotImageName: '截图',-- downLoadClose: '关闭',- downLoadCopy: '复制到剪切板',- downLoadBtn: '下载',- browserNotTip: '下载功能IE浏览器不支持!',- rightclickTip: "请在图片上右键点击'复制'",- successTip: "已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')",- },-};diff --git a/packages/sheets-plugin-screenshot/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-screenshot/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-screenshot/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-screenshot/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-screenshot/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-screenshot/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-screenshot/src/ProxyData/ProxyDataScreenshot.ts b/packages/sheets-plugin-screenshot/src/ProxyData/ProxyDataScreenshot.tsdeleted file mode 100644index 607c2d4b5d..0000000000--- a/packages/sheets-plugin-screenshot/src/ProxyData/ProxyDataScreenshot.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataScreenshot {}diff --git a/packages/sheets-plugin-screenshot/src/ProxyData/index.ts b/packages/sheets-plugin-screenshot/src/ProxyData/index.tsdeleted file mode 100644index a929e21384..0000000000--- a/packages/sheets-plugin-screenshot/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataScreenshot';diff --git a/packages/sheets-plugin-screenshot/src/ScreenshotPlugin.tsx b/packages/sheets-plugin-screenshot/src/ScreenshotPlugin.tsxdeleted file mode 100644index da72f857c5..0000000000--- a/packages/sheets-plugin-screenshot/src/ScreenshotPlugin.tsx+++ /dev/null@@ -1,50 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { SCREENSHOT_PLUGIN_NAME } from './Const/PLUGIN_NAME';-import { IConfig } from './IData/IScreenshot';-import { en, zh } from './Locale';-import { ScreenshotButton } from './UI/ScreenshotButton';--export interface IScreenshotPluginConfig {}--export class ScreenshotPlugin extends Plugin {- constructor(config?: IScreenshotPluginConfig) {- super(SCREENSHOT_PLUGIN_NAME);- }-- static create(config?: IScreenshotPluginConfig) {- return new ScreenshotPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = { context };-- const item: IToolbarItemProps = {- locale: SCREENSHOT_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <ScreenshotButton config={config} />,- };- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-screenshot/src/Service/ScreenshotService.ts b/packages/sheets-plugin-screenshot/src/Service/ScreenshotService.tsdeleted file mode 100644index 980925e36e..0000000000--- a/packages/sheets-plugin-screenshot/src/Service/ScreenshotService.ts+++ /dev/null@@ -1 +0,0 @@-export class ScreenshotService {}diff --git a/packages/sheets-plugin-screenshot/src/Service/index.ts b/packages/sheets-plugin-screenshot/src/Service/index.tsdeleted file mode 100644index 4335a1223c..0000000000--- a/packages/sheets-plugin-screenshot/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './ScreenshotService';diff --git a/packages/sheets-plugin-screenshot/src/Shared/index.ts b/packages/sheets-plugin-screenshot/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-screenshot/src/Types/index.d.ts b/packages/sheets-plugin-screenshot/src/Types/index.d.tsdeleted file mode 100644index 27473c53e6..0000000000--- a/packages/sheets-plugin-screenshot/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-screenshot' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-screenshot/src/Types/preact.d.ts b/packages/sheets-plugin-screenshot/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-screenshot/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-screenshot/src/UI/ScreenshotButton.tsx b/packages/sheets-plugin-screenshot/src/UI/ScreenshotButton.tsxdeleted file mode 100644index 6c0e5ece28..0000000000--- a/packages/sheets-plugin-screenshot/src/UI/ScreenshotButton.tsx+++ /dev/null@@ -1,155 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component, createRef, IToolbarItemProps, ModalProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { IProps } from '../IData/IScreenshot';-// import styles from './index.module.less';--// // Types for state-// interface IState {-// screenshot: IToolbarItemProps;-// modalData: ModalProps[];-// }-// // const screenshot: IToolbarItemProps = {-// // name: 'screenshot.screenshotLabel',-// // type: 'single',-// // icon: <Icon.View.ScreenshotIcon />,-// // show: true,-// // };--// export class ScreenshotButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// ref = createRef();--// Render: BaseComponentRender;--// initialize(props: IProps) {-// // super(props);--// const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();--// const ScreenshotIcon = this.Render.renderFunction('ScreenshotIcon');--// this.state = {-// screenshot: {-// locale: 'screenshot.screenshotLabel',-// type: 'single',-// icon: <ScreenshotIcon />,-// show: true,-// },-// modalData: [-// {-// locale: 'screenshot.screenshotTipSuccess',-// show: false,-// group: [-// {-// locale: 'screenshot.downLoadBtn',-// type: 'primary',-// },-// {-// locale: 'screenshot.downLoadCopy',-// type: 'primary',-// },-// {-// locale: 'screenshot.downLoadClose',-// },-// ],-// onCancel: () => this.showModal(0, false),-// },-// {-// locale: 'screenshot.screenshotTipTitle',-// show: false,-// children: 'screenshot.screenshotTipHasMulti',-// group: [-// {-// locale: 'screenshot.downLoadClose',-// },-// ],-// },-// ],-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.screenshot;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}`);--// let modal = prevState.modalData;-// if (modal.length) {-// modal.forEach((ele) => {-// ele.title = locale.get(ele.locale!);-// if (ele.group && ele.group.length) {-// ele.group.forEach((node) => {-// node.label = locale.get(node.locale!);-// });-// }-// });-// }--// return {-// screenshot: item,-// modalData: modal,-// };-// });-// }--// showModal = (index: number, isShow: boolean) => {-// let { modalData } = this.state;-// modalData[index].show = isShow;-// this.setState((prevState) => ({-// modalData,-// }));-// };--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Button = this.Render.renderFunction('Button');-// const Modal = this.Render.renderFunction('Modal');-// const { screenshot, modalData } = state;-// // Set Provider for entire Container-// return (-// <div className={styles.singleButton}>-// <Button type="text" onClick={() => this.showModal(0, true)}>-// {screenshot.icon}-// </Button>-// {modalData.map((item) => {-// if (!item.show) return;-// return <Modal visible={item.show} title={item.title} group={item.group} onCancel={item.onCancel}></Modal>;-// })}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-screenshot/src/UI/index.module.less b/packages/sheets-plugin-screenshot/src/UI/index.module.lessdeleted file mode 100644index 17baa786d4..0000000000--- a/packages/sheets-plugin-screenshot/src/UI/index.module.less+++ /dev/null@@ -1,3 +0,0 @@-.single-button {- display: inline-block;-}\ No newline at end of filediff --git a/packages/sheets-plugin-screenshot/src/View/Event.ts b/packages/sheets-plugin-screenshot/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-screenshot/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-screenshot/src/View/ObserverList.ts b/packages/sheets-plugin-screenshot/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-screenshot/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-screenshot/src/View/Render.ts b/packages/sheets-plugin-screenshot/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-screenshot/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-screenshot/src/View/index.ts b/packages/sheets-plugin-screenshot/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-screenshot/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-screenshot/src/index.ts b/packages/sheets-plugin-screenshot/src/index.tsdeleted file mode 100644index a79b12b210..0000000000--- a/packages/sheets-plugin-screenshot/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { ScreenshotPlugin } from './ScreenshotPlugin';--export { ScreenshotPlugin };diff --git a/packages/sheets-plugin-screenshot/src/main.tsx b/packages/sheets-plugin-screenshot/src/main.tsxdeleted file mode 100644index dc7daeba03..0000000000--- a/packages/sheets-plugin-screenshot/src/main.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new ScreenshotPlugin());diff --git a/packages/sheets-plugin-screenshot/tsconfig.json b/packages/sheets-plugin-screenshot/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-screenshot/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-screenshot/vite.config.ts b/packages/sheets-plugin-screenshot/vite.config.tsdeleted file mode 100644index b8a37fd379..0000000000--- a/packages/sheets-plugin-screenshot/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginScreenshot',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-screenshot',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-sort/README-zh.md b/packages/sheets-plugin-sort/README-zh.mddeleted file mode 100644index 3149777a80..0000000000--- a/packages/sheets-plugin-sort/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet Sort 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-sort-```--### 使用--```js-import { Sort } from '@univerjs/sheets-plugin-sort';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Sort());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-sort/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-sort dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-sort/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-sort build-```diff --git a/packages/sheets-plugin-sort/README.md b/packages/sheets-plugin-sort/README.mddeleted file mode 100644index a7453e182b..0000000000--- a/packages/sheets-plugin-sort/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin Sort--### Installation--```shell-npm i @univerjs/sheets-plugin-sort-```--### Usage--```js-import { Sort } from '@univerjs/sheets-plugin-sort';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new Sort());-```--## 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/sheets-plugin-sort/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-sort dev-```--### Package--```-# Current directory ./packages/sheets-plugin-sort/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-sort build-```diff --git a/packages/sheets-plugin-sort/index.html b/packages/sheets-plugin-sort/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-sort/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-sort/jest.config.js b/packages/sheets-plugin-sort/jest.config.jsdeleted file mode 100644index 93bcfd6e89..0000000000--- a/packages/sheets-plugin-sort/jest.config.js+++ /dev/null@@ -1,19 +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',- },- },- unmockedModulePathPatterns: ['node_modules/preact/', 'node_modules/enzyme/'],-};diff --git a/packages/sheets-plugin-sort/package.json b/packages/sheets-plugin-sort/package.jsondeleted file mode 100644index 7fcddf45a9..0000000000--- a/packages/sheets-plugin-sort/package.json+++ /dev/null@@ -1,68 +0,0 @@-{- "name": "@univerjs/sheets-plugin-sort",- "version": "0.0.1",- "description": "UniverSheet normal plugin sort",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-sort.cjs.js",- "module": "./lib/univer-sheets-plugin-sort.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-sort.cjs.js",- "default": "./lib/univer-sheets-plugin-sort.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "serve": "vite preview"- },- "devDependencies": {- "@preact/preset-vite": "2.0.0",- "enzyme": "^3.11.0",- "@testing-library/preact": "^2.0.1",- "@types/jest": "^27.5.2",- "@types/node": "^18.14.0",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-sort/src/Action/ActionSort.ts b/packages/sheets-plugin-sort/src/Action/ActionSort.tsdeleted file mode 100644index 9ba9e353a0..0000000000--- a/packages/sheets-plugin-sort/src/Action/ActionSort.ts+++ /dev/null@@ -1,85 +0,0 @@-import { Tools } from '@univerjs/core';--export class ActionSort {- orderbydata(data: any, index: number, isAsc: boolean = true) {- let a = (x: any, y: any) => {- let x1 = x[index];- let y1 = y[index];-- if (Tools.isObject(x[index])) {- x1 = x[index].v;- }-- if (Tools.isObject(y[index])) {- y1 = y[index].v;- }-- if (Tools.isBlank(x1)) {- return 1;- }-- if (Tools.isBlank(y1)) {- return -1;- }- if (Tools.isDate(x1) && Tools.isDate(y1)) {- return diff(x1, y1);- }- if (Tools.isNumber(x1) && Tools.isNumber(y1)) {- return Number(x1) - Number(y1);- }- if (!Tools.isNumber(x1) && !Tools.isNumber(y1)) {- return x1.localeCompare(y1, 'zh');- }- if (!Tools.isNumber(x1)) {- return 1;- }- if (!Tools.isNumber(y1)) {- return -1;- }- };-- let d = (x: any, y: any) => {- let x1 = x[index];- let y1 = y[index];-- if (Tools.isObject(x[index])) {- x1 = x[index].v;- }-- if (Tools.isObject(y[index])) {- y1 = y[index].v;- }-- if (Tools.isBlank(x1)) {- return 1;- }-- if (Tools.isBlank(y1)) {- return -1;- }-- if (Tools.isDate(x1) && Tools.isDate(y1)) {- return diff(x1, y1);- }- if (Tools.isNumber(x1) && Tools.isNumber(y1)) {- return Number(y1) - Number(x1);- }- if (!Tools.isNumber(x1) && !Tools.isNumber(y1)) {- return y1.localeCompare(x1, 'zh');- }- if (!Tools.isNumber(x1)) {- return -1;- }- if (!Tools.isNumber(y1)) {- return 1;- }- };-- if (isAsc) {- return data.sort(a);- }- return data.sort(d);- }-}--function diff(x1: Date, y1: Date) {}diff --git a/packages/sheets-plugin-sort/src/Action/AscSortAction.ts b/packages/sheets-plugin-sort/src/Action/AscSortAction.tsdeleted file mode 100644index 9b1f91d3de..0000000000--- a/packages/sheets-plugin-sort/src/Action/AscSortAction.ts+++ /dev/null@@ -1,36 +0,0 @@-import { SheetActionBase, ActionObservers, ISheetActionData, IRangeData, CommandUnit } from '@univerjs/core';-import { ACTION_NAMES } from '../Enum';-import { IDescSortData } from './DescSortAction';--export interface IAscSortData extends ISheetActionData {- rangeData: IRangeData;-}--export class AscSortAction extends SheetActionBase<IAscSortData, IDescSortData> {- constructor(actionData: IAscSortData, commandUnit: CommandUnit, observers: ActionObservers) {- super(actionData, commandUnit, observers);- this._doActionData = {- ...actionData,- };- this._oldActionData = {- actionName: ACTION_NAMES.ASC_SORT_ACTION,- sheetId: actionData.sheetId,- range: actionData.rangeData,- };- }-- do(): void {- const { rangeData } = this._doActionData;- const worksheet = this.getWorkSheet();- }-- redo(): void {- this.do();- }-- undo(): void {}-- validate(): boolean {- return false;- }-}diff --git a/packages/sheets-plugin-sort/src/Action/DescSortAction.ts b/packages/sheets-plugin-sort/src/Action/DescSortAction.tsdeleted file mode 100644index 2dcfcc2e46..0000000000--- a/packages/sheets-plugin-sort/src/Action/DescSortAction.ts+++ /dev/null@@ -1,26 +0,0 @@-import { SheetActionBase, ISheetActionData, IRangeData } from '@univerjs/core';-import { IAscSortData } from './index';--export interface IDescSortData extends ISheetActionData {- range: IRangeData;-}--export class DescSortAction extends SheetActionBase<IDescSortData, IAscSortData> {- do(): void {}-- redo(): void {- this.do();- }-- undo(): void {}-- validate(): boolean {- return false;- }-}--// const actionData: IDescSortData = {-// actionName: ACTION_NAMES.DESC_SORT_ACTION,-// range: range.getRangeData(),-// sheetId: this._workSheet.getSheetId(),-// };diff --git a/packages/sheets-plugin-sort/src/Action/RegisterAction.ts b/packages/sheets-plugin-sort/src/Action/RegisterAction.tsdeleted file mode 100644index 7e3def686c..0000000000--- a/packages/sheets-plugin-sort/src/Action/RegisterAction.ts+++ /dev/null@@ -1,6 +0,0 @@-import { CommandManager } from '@univerjs/core';-import { ACTION_NAMES } from '../Enum/ACTION_NAMES';-import { DescSortAction, AscSortAction } from '.';--CommandManager.register(ACTION_NAMES.DESC_SORT_ACTION, DescSortAction);-CommandManager.register(ACTION_NAMES.ASC_SORT_ACTION, AscSortAction);diff --git a/packages/sheets-plugin-sort/src/Action/index.ts b/packages/sheets-plugin-sort/src/Action/index.tsdeleted file mode 100644index 503da989b7..0000000000--- a/packages/sheets-plugin-sort/src/Action/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './AscSortAction';-export * from './DescSortAction';diff --git a/packages/sheets-plugin-sort/src/Conflict/ConflictSort.ts b/packages/sheets-plugin-sort/src/Conflict/ConflictSort.tsdeleted file mode 100644index d8ff68a326..0000000000--- a/packages/sheets-plugin-sort/src/Conflict/ConflictSort.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictSort {}diff --git a/packages/sheets-plugin-sort/src/Conflict/IConflict.ts b/packages/sheets-plugin-sort/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-sort/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-sort/src/Conflict/index.ts b/packages/sheets-plugin-sort/src/Conflict/index.tsdeleted file mode 100644index 15ff6ca1b0..0000000000--- a/packages/sheets-plugin-sort/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictSort';diff --git a/packages/sheets-plugin-sort/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-sort/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index d52bd8ca27..0000000000--- a/packages/sheets-plugin-sort/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const SORT_PLUGIN_NAME = 'sort';diff --git a/packages/sheets-plugin-sort/src/Const/index.ts b/packages/sheets-plugin-sort/src/Const/index.tsdeleted file mode 100644index 15c2f8636f..0000000000--- a/packages/sheets-plugin-sort/src/Const/index.ts+++ /dev/null@@ -1,41 +0,0 @@-interface P {- name: string;- detail: string;- example: string;- require: string;- repeat: string;- type: string;-}-interface FunctionList {- n: string;- t: number;- d: string;- a: string;- m?: number[];- p: P[];-}--interface FunctionType {- [index: string]: string;-}--const functionType: FunctionType = {- '0': '数学',- '1': '统计',- '2': '查找',- '3': 'UniverSheet内置',- '4': '数据挖掘',- '5': '数据源',- '6': '日期',- '7': '过滤器',- '8': '财务',- '9': '工程计算',- '10': '逻辑',- '11': '运算符',- '12': '文本',- '13': '转换工具',- '14': '数组',- '15': '其他',-};-export { functionType };-export type { FunctionList, FunctionType, P };diff --git a/packages/sheets-plugin-sort/src/Domain/Sort.ts b/packages/sheets-plugin-sort/src/Domain/Sort.tsdeleted file mode 100644index 888ea594ff..0000000000--- a/packages/sheets-plugin-sort/src/Domain/Sort.ts+++ /dev/null@@ -1,103 +0,0 @@-import { Range, Worksheet, Workbook, SheetContext, Command, CommandManager, Inject } from '@univerjs/core';-import { IAscSortData } from '../Action';-import { ACTION_NAMES, SortOrderType, SortOrder } from '../Enum';--interface SortCriteria {- key: string;- basis: string;- order: SortOrderType;-}--export class Sort {- @Inject('CommandManager')- private _commandManager: CommandManager;-- @Inject('WorkBook')- private _workbook: Workbook;-- @Inject('Context')- private _context: SheetContext;-- private _workSheet: Worksheet;-- private _range: Range;-- private _orderType: SortOrderType;-- // // 只影响选区- // isOnlyRange: boolean;- //- // // 石头包含标题行- // hasHeader: boolean;- //- // // 初始数据- // soreBefore: any;- //- // // 排序后数据- // soreAfter: any;- //- // sortCriteria: SortCriteria[];-- constructor(range: Range, order: SortOrderType = SortOrder.ASCENDING) {- this._range = range;- // this.isOnlyRange = false;- this._orderType = order;- }-- /**- * TODO- * @returns- */- getBackgroundColor() {- const { _range } = this;- }-- /**- * TODO- */- getDataSourceColumn() {}-- /**- * TODO- */- getDimensionIndex() {}-- /**- * TODO- */- getForegroundColor() {}-- /**- * TODO- */- getSortOrder() {- return this._orderType;- }-- /**- * TODO- */- isAscending() {}-- /**- * TODO- */- ASCSord() {- const { _range, _context, _commandManager, _workSheet } = this;- console.log(_workSheet);-- const actionData: IAscSortData = {- actionName: ACTION_NAMES.ASC_SORT_ACTION,- rangeData: _range.getRangeData(),- sheetId: _workSheet.getSheetId(),- };-- const command = new Command(- {- WorkBookUnit: _context.getWorkBook(),- },- actionData- );- _commandManager.invoke(command);- }-}diff --git a/packages/sheets-plugin-sort/src/Domain/index.ts b/packages/sheets-plugin-sort/src/Domain/index.tsdeleted file mode 100644index da9576c52d..0000000000--- a/packages/sheets-plugin-sort/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Sort';diff --git a/packages/sheets-plugin-sort/src/Enum/ACTION_NAMES.ts b/packages/sheets-plugin-sort/src/Enum/ACTION_NAMES.tsdeleted file mode 100644index fed49e2f25..0000000000--- a/packages/sheets-plugin-sort/src/Enum/ACTION_NAMES.ts+++ /dev/null@@ -1,6 +0,0 @@-export enum ACTION_NAMES {- DESC_SORT_ACTION = 'DescSortAction',- ASC_SORT_ACTION = 'AscSortAction',-}--export type ACTION_NAMES_TYPE = `${ACTION_NAMES}`;diff --git a/packages/sheets-plugin-sort/src/Enum/SortOrder.ts b/packages/sheets-plugin-sort/src/Enum/SortOrder.tsdeleted file mode 100644index 4b1efff15e..0000000000--- a/packages/sheets-plugin-sort/src/Enum/SortOrder.ts+++ /dev/null@@ -1,6 +0,0 @@-export enum SortOrder {- ASCENDING = 'ASCENDING',- DESCENDING = 'DESCENDING',-}--export type SortOrderType = `${SortOrder}`;diff --git a/packages/sheets-plugin-sort/src/Enum/index.ts b/packages/sheets-plugin-sort/src/Enum/index.tsdeleted file mode 100644index 0566b1d1f5..0000000000--- a/packages/sheets-plugin-sort/src/Enum/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './SortOrder';-export * from './ACTION_NAMES';diff --git a/packages/sheets-plugin-sort/src/IData/ISort.ts b/packages/sheets-plugin-sort/src/IData/ISort.tsdeleted file mode 100644index 964fd78160..0000000000--- a/packages/sheets-plugin-sort/src/IData/ISort.ts+++ /dev/null@@ -1,8 +0,0 @@-import { SheetContext } from '@univerjs/core';--export type IConfig = {- context: SheetContext;-};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-sort/src/IData/index.ts b/packages/sheets-plugin-sort/src/IData/index.tsdeleted file mode 100644index b14d66588c..0000000000--- a/packages/sheets-plugin-sort/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ISort';diff --git a/packages/sheets-plugin-sort/src/Locale/en.ts b/packages/sheets-plugin-sort/src/Locale/en.tsdeleted file mode 100644index fb3348f3f5..0000000000--- a/packages/sheets-plugin-sort/src/Locale/en.ts+++ /dev/null@@ -1,26 +0,0 @@-export default {- sortLabel: 'Sort',- sortRightLabel: 'More sort',- sort: {- asc: 'Ascending ',- desc: 'Descending ',- custom: 'Custom sort',-- hasTitle: 'Data has a header row',- sortBy: 'Sort by',- addOthers: 'Add another sort column',- close: 'close',- confirm: 'sort',-- columnOperation: 'Column',- secondaryTitle: 'then by',-- sortTitle: 'Sort range',-- sortRangeTitle: 'Sort range from',- sortRangeTitleTo: 'to',-- noRangeError: 'Cannot perform this operation on multiple selection areas, please select a single range and try again',- mergeError: 'There are merged cells in the selection, this operation cannot be performed!',- },-};diff --git a/packages/sheets-plugin-sort/src/Locale/index.ts b/packages/sheets-plugin-sort/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-sort/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-sort/src/Locale/zh.ts b/packages/sheets-plugin-sort/src/Locale/zh.tsdeleted file mode 100644index c5171a117d..0000000000--- a/packages/sheets-plugin-sort/src/Locale/zh.ts+++ /dev/null@@ -1,26 +0,0 @@-export default {- sortLabel: '排序',- sortRightLabel: '更多',- sort: {- asc: '升序',- desc: '降序',- custom: '自定义排序',-- hasTitle: '数据具有标题行',- sortBy: '排序依据',- addOthers: '添加其他排序列',- close: '关闭',- confirm: '排序',-- columnOperation: '列',- secondaryTitle: '次要排序',-- sortTitle: '排序范围',-- sortRangeTitle: '排序范围从',- sortRangeTitleTo: '到',-- noRangeError: '不能对多重选择区域执行此操作,请选择单个区域,然后再试',- mergeError: '选区有合并单元格,无法执行此操作!',- },-};diff --git a/packages/sheets-plugin-sort/src/Service/SortService.ts b/packages/sheets-plugin-sort/src/Service/SortService.tsdeleted file mode 100644index 90ace6214a..0000000000--- a/packages/sheets-plugin-sort/src/Service/SortService.ts+++ /dev/null@@ -1 +0,0 @@-export class SortService {}diff --git a/packages/sheets-plugin-sort/src/Service/index.ts b/packages/sheets-plugin-sort/src/Service/index.tsdeleted file mode 100644index aae3c5a9f7..0000000000--- a/packages/sheets-plugin-sort/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './SortService';diff --git a/packages/sheets-plugin-sort/src/Shared/index.ts b/packages/sheets-plugin-sort/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-sort/src/SortPlugin.tsx b/packages/sheets-plugin-sort/src/SortPlugin.tsxdeleted file mode 100644index 39afea8399..0000000000--- a/packages/sheets-plugin-sort/src/SortPlugin.tsx+++ /dev/null@@ -1,65 +0,0 @@-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetContext, IRangeType, Plugin, PLUGIN_NAMES, UniverSheet } from '@univerjs/core';-import { SheetPlugin } from '@univerjs/base-sheets';-import { SORT_PLUGIN_NAME } from './Const/PLUGIN_NAME';-import { Sort } from './Domain';-import { IConfig } from './IData/ISort';-import { en, zh } from './Locale';-import { SortButton } from './UI/SortButton';--export interface ISortPluginConfig {}--export class SortPlugin extends Plugin {- private _sort: Sort | null;-- constructor(config?: ISortPluginConfig) {- super(SORT_PLUGIN_NAME);- }-- static create(config?: ISortPluginConfig) {- return new SortPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = { context };-- const item: IToolbarItemProps = {- locale: SORT_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <SortButton config={config} />,- };- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();-- // const sort = this.createSort('A1:B2').ASCSord();- }-- createSort(range: IRangeType) {- const _range = this.getContext().getWorkBook().getSheets()[0].getRange(range);- this._sort = new Sort(_range, 'ASCENDING');- return this._sort;- }-- removeSort() {- this._sort = null;- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-sort/src/Test/index.test.tsx b/packages/sheets-plugin-sort/src/Test/index.test.tsxdeleted file mode 100644index 67464fc5f9..0000000000--- a/packages/sheets-plugin-sort/src/Test/index.test.tsx+++ /dev/null@@ -1,12 +0,0 @@-// import { mount } from 'enzyme';-// import { SortButton } from '../UI/SortButton';-//-// const config = {};-//-// describe('SortButton', () => {-// it('SortButton find Select component', () => {-// const wrapper = mount(<SortButton config={config} />);-//-// expect(wrapper.find('Select')).toBe(true);-// });-// });diff --git a/packages/sheets-plugin-sort/src/Test/setup.ts b/packages/sheets-plugin-sort/src/Test/setup.tsdeleted file mode 100644index 92cef4885e..0000000000--- a/packages/sheets-plugin-sort/src/Test/setup.ts+++ /dev/null@@ -1,4 +0,0 @@-// import { configure } from 'enzyme';-// import Adapter from 'enzyme-adapter-preact-pure';-//-// configure({ adapter: new Adapter() });diff --git a/packages/sheets-plugin-sort/src/Types/index.d.ts b/packages/sheets-plugin-sort/src/Types/index.d.tsdeleted file mode 100644index fb3a4f4009..0000000000--- a/packages/sheets-plugin-sort/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-sort' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-sort/src/Types/preact.d.ts b/packages/sheets-plugin-sort/src/Types/preact.d.tsdeleted file mode 100644index 0d092b3751..0000000000--- a/packages/sheets-plugin-sort/src/Types/preact.d.ts+++ /dev/null@@ -1,4 +0,0 @@-/// <reference types="enzyme-adapter-preact-pure" />-import JSX = preact.JSX;--declare module 'enzyme';diff --git a/packages/sheets-plugin-sort/src/UI/SortButton.tsx b/packages/sheets-plugin-sort/src/UI/SortButton.tsxdeleted file mode 100644index 0f6d128508..0000000000--- a/packages/sheets-plugin-sort/src/UI/SortButton.tsx+++ /dev/null@@ -1,195 +0,0 @@-import { Component } from '@univerjs/base-ui';--import { ComponentChild } from 'preact';-import { IProps } from '../IData/ISort';--// interface config extends IToolbarItemProps {-// config?: { [index: string]: any };-// }-// Types for state-// interface IState {-// sort: config;-// isSortCustom: boolean;-// }--const sort = {};-export class SortButton extends Component<IProps> {- // Select: FunctionComponent<BaseSelectProps>;- //- // OrderASCIcon: FunctionComponent<BaseIconProps>;- //- // OrderDESCIcon: FunctionComponent<BaseIconProps>;- //- // OrderIcon: FunctionComponent<BaseIconProps>;- //- // NextIcon: FunctionComponent<BaseIconProps>;- //- // private _localeObserver: Nullable<Observer<Workbook>>;- //- // sortCustom = createRef();-- // initialize(props: IProps) {- // // super(props);- //- // const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- // const render = component.getComponentRender();- // this.Select = render.renderFunction('Select');- // this.OrderASCIcon = render.renderFunction('OrderASCIcon');- // this.OrderDESCIcon = render.renderFunction('OrderDESCIcon');- // this.OrderIcon = render.renderFunction('OrderIcon');- // this.NextIcon = render.renderFunction('NextIcon');- //- // this.state = {- // sort: {- // locale: 'sort',- // type: ISlotElement.SELECT,- // label: <this.OrderASCIcon />,- // icon: <this.NextIcon />,- // show: true,- // border: false,- // selectType: ISelectButton.DOUBLE,- // needChange: true,- // children: [- // {- // locale: 'sort.asc',- // icon: <this.OrderASCIcon />,- // selected: true,- // },- // {- // locale: 'sort.desc',- // icon: <this.OrderDESCIcon />,- // selected: false,- // },- // {- // locale: 'sort.custom',- // icon: <this.OrderIcon />,- // selected: false,- // onClick: this.SortCustomShow.bind(this),- // },- // ],- // },- // isSortCustom: false,- // };- // }-- /**- * init- */- // componentWillMount() {- // this.setLocale();- //- // // subscribe Locale change event- //- // this._localeObserver = this._context- // .getObserverManager()- // .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')- // ?.add(() => {- // this.setLocale();- // });- // }-- // remove to SortCustomShow- // componentDidMount() {- // document.addEventListener('click', this.SortCustomHide.bind(this), true);- // }- /**- * destory- */- componentWillUnmount() {- // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);- // document.removeEventListener('click', this.SortCustomHide.bind(this), true);- }-- /**- * set text by config setting and Locale message- */- // setLocale() {- // const locale = this._context.getLocale();- //- // this.setState((prevState: IState) => {- // let item = prevState.sort;- // // set current Locale string for tooltip- // item.tooltip = locale.get(`${item.locale}Label`);- // item.tooltipRight = locale.get(`${item.locale}RightLabel`);- //- // // set current Locale string for select- // item.children?.forEach((ele: IToolbarItemProps) => {- // if (ele.locale) {- // ele.label = locale.get(`${ele.locale}`);- // }- // });- // item.label = typeof item.label === 'object' ? item.label : item.children![0].label;- // item.config = JSON.parse(locale.get(`${item.locale}`));- // return {- // sort: item,- // };- // });- // }-- SortCustomShow() {- this.setState({- isSortCustom: true,- });-- document.addEventListener('click', this.SortCustomHide.bind(this), true);- }-- SortCustomHide(e: Event) {- // const div = document.createElement('div');- // const container = document.querySelector('.univer-modal-mask') || div;- // const close = document.querySelector('.univer-modal-close') || div;- //- // if (this.state.isSortCustom && (container.contains(e.target as Element) || close.contains(e.target as Element))) {- // this.setState({- // isSortCustom: false,- // });- // }- //- // document.removeEventListener('click', this.SortCustomHide.bind(this), true);- }-- click() {- console.log(this);-- // this.state.sort.onClick();- }-- render(): ComponentChild {- return null;- }-- /**- * Render the component's HTML- *- * @returns {void}- */- // render(props: IProps, state: IState) {- // // eslint-disable-next-line @typescript-eslint/no-shadow- // const { sort, isSortCustom } = state;- // const { Select } = this;- // // Set Provider for entire Container- // return (- // <>- // <Select- // tooltip={sort.tooltip}- // tooltipRight={sort.tooltipRight}- // label={sort.label}- // icon={sort.icon}- // selectType={sort.selectType}- // border={sort.border}- // needChange={sort.needChange}- // onClick={sort.onClick}- // key={sort.locale}- // children={sort.children as BaseSelectProps[]}- // />- // <SortCustom- // ref={this.sortCustom}- // config={{ context: this.props.config.context, locale: sort.config }}- // visible={isSortCustom}- // onOk={this.SortCustomShow.bind(this)}- // onCancel={this.SortCustomHide.bind(this)}- // />- // </>- // );- // }-}diff --git a/packages/sheets-plugin-sort/src/UI/SortCustom/SortCustom.tsx b/packages/sheets-plugin-sort/src/UI/SortCustom/SortCustom.tsxdeleted file mode 100644index 03e4b8acee..0000000000--- a/packages/sheets-plugin-sort/src/UI/SortCustom/SortCustom.tsx+++ /dev/null@@ -1,158 +0,0 @@-import {- BaseButtonProps,- BaseComponentSheet,- BaseIconProps,- BaseModalProps,- BaseRadioGroupProps,- BaseRadioIProps,- BaseSelectProps,- Component,- FunctionComponent,-} from '@univerjs/base-ui';-import { SheetContext } from '@univerjs/core';--import styles from './index.module.less';--type Options = {- key: string | number;- value: string | number;-};--type IProps = {- visible: boolean;- onOk: () => void;- onCancel: (e: Event) => void;- config: { context: SheetContext; locale: any };-};-type IState = {- active: string | number;- options: Options[];- sortRules: Array<{ options: Options[]; order: string | number }>;-};--class SortCustom extends Component<IProps, IState> {- Modal: FunctionComponent<BaseModalProps>;-- Button: FunctionComponent<BaseButtonProps>;-- CloseIcon: FunctionComponent<BaseIconProps>;-- Select: FunctionComponent<BaseSelectProps>;-- RadioGroup: FunctionComponent<BaseRadioGroupProps>;-- Radio: FunctionComponent<BaseRadioIProps>;-- initialize() {- // super();- const component = this.props.config.context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- const render = component.getComponentRender();- this.CloseIcon = render.renderFunction('CloseIcon');- this.Select = render.renderFunction('Select');- this.Modal = render.renderFunction('Modal');- this.Button = render.renderFunction('Button');- this.RadioGroup = render.renderFunction('RadioGroup');- this.Radio = render.renderFunction('Radio');-- this.state = {- active: '1',- options: [{ key: 1, value: '111' }],- sortRules: [- { options: [{ key: 1, value: '111' }], order: '1' },- { options: [{ key: 2, value: '222' }], order: '2' },- ],- };- }-- sortRulesDelete(index: number) {- let sortRules = this.state.sortRules;- sortRules.splice(index, 1);- this.setState({- sortRules,- });- }-- row(item: { options: Options[]; order: string | number }, i: number) {- const { Select, CloseIcon, RadioGroup, Radio } = this;- const locale = this.props.config.locale;- return (- <div className={styles.sortRadio}>- <div className={styles.sortSelect}>- {i !== 0 && (- <span onClick={this.sortRulesDelete.bind(this, i)} className={styles.sortRulesClose}>- <CloseIcon />- </span>- )}- <span className={styles.sortSelectLabel}>{i === 0 ? locale.hasTitle : locale.secondaryTitle}</span>- <Select children={item.options} />- </div>- <RadioGroup- vertical={true}- onChange={(val: string | number) => {- this.setState((prevState) => {- let sortRules = prevState.sortRules;- sortRules[i].order = val;- return {- sortRules,- };- });- }}- active={item.order}- >- <Radio value="1">{locale.asc}A-Z</Radio>- <Radio value="2">{locale.desc}Z-A</Radio>- </RadioGroup>- </div>- );- }-- addRow() {- let sortRulesIndex = this.state.sortRules.length;- this.setState((prevState) => {- let sortRules = prevState.sortRules;- let option: { options: Options[]; order: string | number } = {- options: [- {- key: sortRulesIndex + 1,- value: sortRulesIndex + 1,- },- ],- order: '1',- };- sortRules.push(option);- return {- sortRules,- };- });- }-- modeClose(e: Event) {- this.setState({- sortRules: [- { options: [{ key: 1, value: '111' }], order: '1' },- { options: [{ key: 2, value: '222' }], order: '2' },- ],- });- this.props.onCancel(e);- }-- render() {- const locale = this.props.config.locale;- const { Modal, Button } = this;- return (- <Modal title={`${locale.sortRangeTitle}A1${locale.sortRangeTitleTo}B1`} isDrag={true} visible={this.props.visible} onCancel={(e) => this.modeClose.bind(this, e)}>- <>- <div>{locale.hasTitle}</div>- {this.state.sortRules.map((item, index) => this.row(item, index))}- <div>- <Button className={styles.sortAddButton} type="primary" onClick={this.addRow.bind(this)}>- {locale.addOthers}- </Button>- </div>- </>- </Modal>- );- }-}--export { SortCustom };diff --git a/packages/sheets-plugin-sort/src/UI/SortCustom/index.module.less b/packages/sheets-plugin-sort/src/UI/SortCustom/index.module.lessdeleted file mode 100644index cb6238a6bd..0000000000--- a/packages/sheets-plugin-sort/src/UI/SortCustom/index.module.less+++ /dev/null@@ -1,40 +0,0 @@-.sort-radio {- display: flex;- align-items: center;- border-top: 1px solid var(--border-color-base);- padding: 10px 0;- &:nth-child(2) {- border-top: none;- // background-color: turquoise;- }-}-.sort-select {- display: flex;- align-items: center;- justify-content: space-between;- margin-right: 20px;-- .sort-select-label {- margin-right: 20px;- }-}--.sort-rules-close {- display: inline-block;- padding: 5px;- cursor: pointer;- color: var(--text-color-secondary);- margin-right: 15px;- &:hover {- color: var(--text-color);- }- & * {- cursor: pointer;- }-}--button.sort-add-button {- padding: 5px;- line-height: 1;- font-size: 14px;-}diff --git a/packages/sheets-plugin-sort/src/UI/SortCustom/index.ts b/packages/sheets-plugin-sort/src/UI/SortCustom/index.tsdeleted file mode 100644index 64f77f4ff7..0000000000--- a/packages/sheets-plugin-sort/src/UI/SortCustom/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './SortCustom';diff --git a/packages/sheets-plugin-sort/src/View/Event.ts b/packages/sheets-plugin-sort/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-sort/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-sort/src/View/ObserverList.ts b/packages/sheets-plugin-sort/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-sort/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-sort/src/View/Render.ts b/packages/sheets-plugin-sort/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-sort/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-sort/src/View/index.ts b/packages/sheets-plugin-sort/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-sort/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-sort/src/index.ts b/packages/sheets-plugin-sort/src/index.tsdeleted file mode 100644index 5d08517631..0000000000--- a/packages/sheets-plugin-sort/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { SortPlugin } from './SortPlugin';--export { SortPlugin };diff --git a/packages/sheets-plugin-sort/src/main.tsx b/packages/sheets-plugin-sort/src/main.tsxdeleted file mode 100644index 5f2fba780b..0000000000--- a/packages/sheets-plugin-sort/src/main.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',- // layout: 'auto',- layout: {- outerLeft: true,- outerRight: true,- innerLeft: false,- innerRight: false,- toolbar: true,- toolbarConfig: {- undoRedo: true,- font: true,- },- contentSplit: true,- },-};-const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-// univerSheetUp.installPlugin(new UniverComponentSheet());-// univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));-// univerSheetUp.installPlugin(new SortPlugin());diff --git a/packages/sheets-plugin-sort/tsconfig.json b/packages/sheets-plugin-sort/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-sort/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-sort/vite.config.ts b/packages/sheets-plugin-sort/vite.config.tsdeleted file mode 100644index 34fccaf50e..0000000000--- a/packages/sheets-plugin-sort/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginSort',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets-plugin-sort',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/sheets-plugin-split-column/README-zh.md b/packages/sheets-plugin-split-column/README-zh.mddeleted file mode 100644index b860e2b519..0000000000--- a/packages/sheets-plugin-split-column/README-zh.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet SplitColumn 插件--### 安装--```shell-npm i @univerjs/sheets-plugin-split-column-```--### 使用--```js-import { SplitColumn } from '@univerjs/sheets-plugin-split-column';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new SplitColumn());-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 6--### 安装--```-pnpm install-```--### 开发--```-# 当前目录 ./packages/sheets-plugin-split-column/-npm run dev--# 或者项目根目录 ./-pnpm run --filter @univerjs/sheets-plugin-split-column dev-```--### 打包--```-# 当前目录 ./packages/sheets-plugin-split-column/-npm run build--# 或者根目录 ./-pnpm run --filter @univerjs/sheets-plugin-split-column build-```diff --git a/packages/sheets-plugin-split-column/README.md b/packages/sheets-plugin-split-column/README.mddeleted file mode 100644index 71c252e319..0000000000--- a/packages/sheets-plugin-split-column/README.md+++ /dev/null@@ -1,55 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet Plugin SplitColumn--### Installation--```shell-npm i @univerjs/sheets-plugin-split-column-```--### Usage--```js-import { SplitColumn } from '@univerjs/sheets-plugin-split-column';--const univerSheet = new UniverSheet();-univerSheet.installPlugin(new SplitColumn());-```--## 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/sheets-plugin-split-column/-npm run dev--# Or project root directory ./-pnpm run --filter @univerjs/sheets-plugin-split-column dev-```--### Package--```-# Current directory ./packages/sheets-plugin-split-column/-npm run build--# Or root directory ./-pnpm run --filter @univerjs/sheets-plugin-split-column build-```diff --git a/packages/sheets-plugin-split-column/index.html b/packages/sheets-plugin-split-column/index.htmldeleted file mode 100644index dfd279c1b4..0000000000--- a/packages/sheets-plugin-split-column/index.html+++ /dev/null@@ -1,18 +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>-</head>--<body>- <div id="app"></div>- <div id="universheet-demo-up"></div>- <div id="universheet-demo-down"></div>- <script type="module" src="/src/main.tsx"></script>-</body>--</html>\ No newline at end of filediff --git a/packages/sheets-plugin-split-column/jest.config.js b/packages/sheets-plugin-split-column/jest.config.jsdeleted file mode 100644index a1ab72c760..0000000000--- a/packages/sheets-plugin-split-column/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/packages/sheets-plugin-split-column/package.json b/packages/sheets-plugin-split-column/package.jsondeleted file mode 100644index b67ad035f4..0000000000--- a/packages/sheets-plugin-split-column/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/sheets-plugin-split-column",- "version": "0.0.1",- "description": "UniverSheet normal plugin splitColumn",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-split-column.cjs.js",- "module": "./lib/univer-sheets-plugin-split-column.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-split-column.cjs.js",- "default": "./lib/univer-sheets-plugin-split-column.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "scripts": {- "test": "jest",- "dev": "vite",- "build": "tsc && vite build",- "watch": "vite build",- "link": "pnpm link ./",- "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",- "debug": "^4.3.3",- "identity-obj-proxy": "^3.0.0",- "jest-dev-server": "^6.1.1",- "jest-environment-jsdom": "^29.0.3",- "less": "^4.1.1",- "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-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "preact": "^10.12.1"- }-}diff --git a/packages/sheets-plugin-split-column/src/Action/ActionSplitColumn.ts b/packages/sheets-plugin-split-column/src/Action/ActionSplitColumn.tsdeleted file mode 100644index de2ac62a98..0000000000--- a/packages/sheets-plugin-split-column/src/Action/ActionSplitColumn.ts+++ /dev/null@@ -1 +0,0 @@-export class ActionSplitColumn {}diff --git a/packages/sheets-plugin-split-column/src/Action/IAction.ts b/packages/sheets-plugin-split-column/src/Action/IAction.tsdeleted file mode 100644index 9b031a3c3c..0000000000--- a/packages/sheets-plugin-split-column/src/Action/IAction.ts+++ /dev/null@@ -1 +0,0 @@-export class IAction {}diff --git a/packages/sheets-plugin-split-column/src/Action/IActionSet.ts b/packages/sheets-plugin-split-column/src/Action/IActionSet.tsdeleted file mode 100644index f8e2a8f7e6..0000000000--- a/packages/sheets-plugin-split-column/src/Action/IActionSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IActionSet {}diff --git a/packages/sheets-plugin-split-column/src/Action/index.ts b/packages/sheets-plugin-split-column/src/Action/index.tsdeleted file mode 100644index c99c1dbf84..0000000000--- a/packages/sheets-plugin-split-column/src/Action/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Modify localData, conflict handling, generate data transfer protocol, submit for background execution- *- * zh: 修改localData、冲突处理、生成数据传输协议、提交后台执行- */-export * from './ActionSplitColumn';-export * from './IAction';-export * from './IActionSet';diff --git a/packages/sheets-plugin-split-column/src/Base/Cache.ts b/packages/sheets-plugin-split-column/src/Base/Cache.tsdeleted file mode 100644index 002f98640e..0000000000--- a/packages/sheets-plugin-split-column/src/Base/Cache.ts+++ /dev/null@@ -1 +0,0 @@-export class Cache {}diff --git a/packages/sheets-plugin-split-column/src/Base/State.ts b/packages/sheets-plugin-split-column/src/Base/State.tsdeleted file mode 100644index f277253fef..0000000000--- a/packages/sheets-plugin-split-column/src/Base/State.ts+++ /dev/null@@ -1 +0,0 @@-export class State {}diff --git a/packages/sheets-plugin-split-column/src/Base/index.ts b/packages/sheets-plugin-split-column/src/Base/index.tsdeleted file mode 100644index 6c6e3b5d96..0000000000--- a/packages/sheets-plugin-split-column/src/Base/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './Cache';-export * from './State';diff --git a/packages/sheets-plugin-split-column/src/Conflict/ConflictSplitColumn.ts b/packages/sheets-plugin-split-column/src/Conflict/ConflictSplitColumn.tsdeleted file mode 100644index 906bfbbc2f..0000000000--- a/packages/sheets-plugin-split-column/src/Conflict/ConflictSplitColumn.ts+++ /dev/null@@ -1 +0,0 @@-export class ConflictSplitColumn {}diff --git a/packages/sheets-plugin-split-column/src/Conflict/IConflict.ts b/packages/sheets-plugin-split-column/src/Conflict/IConflict.tsdeleted file mode 100644index 02b0979966..0000000000--- a/packages/sheets-plugin-split-column/src/Conflict/IConflict.ts+++ /dev/null@@ -1 +0,0 @@-export class IConflict {}diff --git a/packages/sheets-plugin-split-column/src/Conflict/index.ts b/packages/sheets-plugin-split-column/src/Conflict/index.tsdeleted file mode 100644index ee9f7405da..0000000000--- a/packages/sheets-plugin-split-column/src/Conflict/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- * en: Handling action conflicts- *- * zh: 处理action冲突- */-export * from './IConflict';-export * from './ConflictSplitColumn';diff --git a/packages/sheets-plugin-split-column/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-split-column/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index 84ae64ec17..0000000000--- a/packages/sheets-plugin-split-column/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const SPLIT_COLUMN_PLUGIN_NAME = 'splitColumn';diff --git a/packages/sheets-plugin-split-column/src/Const/index.ts b/packages/sheets-plugin-split-column/src/Const/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-split-column/src/Domain/SplitColumn.ts b/packages/sheets-plugin-split-column/src/Domain/SplitColumn.tsdeleted file mode 100644index 89ec6a0ffe..0000000000--- a/packages/sheets-plugin-split-column/src/Domain/SplitColumn.ts+++ /dev/null@@ -1 +0,0 @@-export class SplitColumn {}diff --git a/packages/sheets-plugin-split-column/src/Domain/index.ts b/packages/sheets-plugin-split-column/src/Domain/index.tsdeleted file mode 100644index 333a32ea1c..0000000000--- a/packages/sheets-plugin-split-column/src/Domain/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './SplitColumn';diff --git a/packages/sheets-plugin-split-column/src/Enum/index.ts b/packages/sheets-plugin-split-column/src/Enum/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-split-column/src/IData/ISplitColumn.ts b/packages/sheets-plugin-split-column/src/IData/ISplitColumn.tsdeleted file mode 100644index a809ef3796..0000000000--- a/packages/sheets-plugin-split-column/src/IData/ISplitColumn.ts+++ /dev/null@@ -1,4 +0,0 @@-export type IConfig = {};--// Types for props-export type IProps = { config: IConfig };diff --git a/packages/sheets-plugin-split-column/src/IData/index.ts b/packages/sheets-plugin-split-column/src/IData/index.tsdeleted file mode 100644index e66610eb1d..0000000000--- a/packages/sheets-plugin-split-column/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './ISplitColumn';diff --git a/packages/sheets-plugin-split-column/src/Locale/en.ts b/packages/sheets-plugin-split-column/src/Locale/en.tsdeleted file mode 100644index 7e8024a911..0000000000--- a/packages/sheets-plugin-split-column/src/Locale/en.ts+++ /dev/null@@ -1,15 +0,0 @@-export default {- splitColumn: {- splitColumnLabel: 'SplitColumn',- splitDelimiters: 'Delimiters',- splitOther: 'Other',- splitContinueSymbol: 'Consecutive separators are treated as a single',- splitDataPreview: 'Preview',- splitTextTitle: 'Split text',- splitConfirmToExe: 'There is already data here, do you want to replace it?',-- tipNoMulti: 'Cannot perform this operation on multiple selection areas, please select a single area and try again',- tipNoMultiColumn:- 'Only one column of data can be converted at a time. The selected area can have multiple rows but not multiple columns. Please try again after selecting a single column range',- },-};diff --git a/packages/sheets-plugin-split-column/src/Locale/index.ts b/packages/sheets-plugin-split-column/src/Locale/index.tsdeleted file mode 100644index 3ac4bcd0fd..0000000000--- a/packages/sheets-plugin-split-column/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import zh from './zh';-import en from './en';--export { zh, en };diff --git a/packages/sheets-plugin-split-column/src/Locale/zh.ts b/packages/sheets-plugin-split-column/src/Locale/zh.tsdeleted file mode 100644index a040acdc9b..0000000000--- a/packages/sheets-plugin-split-column/src/Locale/zh.ts+++ /dev/null@@ -1,14 +0,0 @@-export default {- splitColumn: {- splitColumnLabel: '分列',- splitDelimiters: '分割符号',- splitOther: '其它',- splitContinueSymbol: '连续分隔符号视为单个处理',- splitDataPreview: '数据预览',- splitTextTitle: '文本分列',- splitConfirmToExe: '此处已有数据,是否替换它?',-- tipNoMulti: '不能对多重选择区域执行此操作,请选择单个区域,然后再试',- tipNoMultiColumn: '一次只能转换一列数据,选定区域可以有多行,但不能有多列,请在选定单列区域以后再试',- },-};diff --git a/packages/sheets-plugin-split-column/src/ProxyData/IProxyData.ts b/packages/sheets-plugin-split-column/src/ProxyData/IProxyData.tsdeleted file mode 100644index 0bd8a3cf07..0000000000--- a/packages/sheets-plugin-split-column/src/ProxyData/IProxyData.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyData {}diff --git a/packages/sheets-plugin-split-column/src/ProxyData/IProxyDataSet.ts b/packages/sheets-plugin-split-column/src/ProxyData/IProxyDataSet.tsdeleted file mode 100644index 9bf75cd768..0000000000--- a/packages/sheets-plugin-split-column/src/ProxyData/IProxyDataSet.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSet {}diff --git a/packages/sheets-plugin-split-column/src/ProxyData/ProxyDataSplitColumn.ts b/packages/sheets-plugin-split-column/src/ProxyData/ProxyDataSplitColumn.tsdeleted file mode 100644index 2209053b36..0000000000--- a/packages/sheets-plugin-split-column/src/ProxyData/ProxyDataSplitColumn.ts+++ /dev/null@@ -1 +0,0 @@-export class IProxyDataSplitColumn {}diff --git a/packages/sheets-plugin-split-column/src/ProxyData/index.ts b/packages/sheets-plugin-split-column/src/ProxyData/index.tsdeleted file mode 100644index 7ff26951b9..0000000000--- a/packages/sheets-plugin-split-column/src/ProxyData/index.ts+++ /dev/null@@ -1,8 +0,0 @@-/**- * en: Transfer to background data protocol- *- * zh: 传输到后台数据协议- */-export * from './IProxyData';-export * from './IProxyDataSet';-export * from './ProxyDataSplitColumn';diff --git a/packages/sheets-plugin-split-column/src/Service/SplitColumnService.ts b/packages/sheets-plugin-split-column/src/Service/SplitColumnService.tsdeleted file mode 100644index cd660d022b..0000000000--- a/packages/sheets-plugin-split-column/src/Service/SplitColumnService.ts+++ /dev/null@@ -1 +0,0 @@-export class SplitColumnService {}diff --git a/packages/sheets-plugin-split-column/src/Service/index.ts b/packages/sheets-plugin-split-column/src/Service/index.tsdeleted file mode 100644index da62d18b2e..0000000000--- a/packages/sheets-plugin-split-column/src/Service/index.ts+++ /dev/null@@ -1,7 +0,0 @@-/**- *- * en: Operate and register localData- *- * zh: 操作、注册localData- */-export * from './SplitColumnService';diff --git a/packages/sheets-plugin-split-column/src/Shared/index.ts b/packages/sheets-plugin-split-column/src/Shared/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-split-column/src/SplitColumnPlugin.tsx b/packages/sheets-plugin-split-column/src/SplitColumnPlugin.tsxdeleted file mode 100644index a770a024e1..0000000000--- a/packages/sheets-plugin-split-column/src/SplitColumnPlugin.tsx+++ /dev/null@@ -1,51 +0,0 @@-import { SheetContext, UniverSheet, Plugin, PLUGIN_NAMES } from '@univerjs/core';-import { IToolbarItemProps, ISlotElement } from '@univerjs/base-ui';-import { SheetPlugin } from '@univerjs/base-sheets';-import { SplitColumnButton } from './UI/SplitColumnButton';-import { zh, en } from './Locale';--import { IConfig } from './IData/ISplitColumn';-import { SPLIT_COLUMN_PLUGIN_NAME } from './Const/PLUGIN_NAME';--export interface ISplitColumnPluginConfig {}--export class SplitColumnPlugin extends Plugin {- constructor(config?: ISplitColumnPluginConfig) {- super(SPLIT_COLUMN_PLUGIN_NAME);- }-- static create(config?: ISplitColumnPluginConfig) {- return new SplitColumnPlugin(config);- }-- installTo(universheetInstance: UniverSheet) {- universheetInstance.installPlugin(this);- }-- initialize(): void {- const context = this.getContext();-- /**- * load more Locale object- */- context.getLocale().load({- en,- zh,- });- const config: IConfig = {};-- const item: IToolbarItemProps = {- locale: SPLIT_COLUMN_PLUGIN_NAME,- type: ISlotElement.JSX,- show: true,- label: <SplitColumnButton config={config} />,- };- context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)?.addButton(item);- }-- onMounted(ctx: SheetContext): void {- this.initialize();- }-- onDestroy(): void {}-}diff --git a/packages/sheets-plugin-split-column/src/Types/index.d.ts b/packages/sheets-plugin-split-column/src/Types/index.d.tsdeleted file mode 100644index f2f9d76fe3..0000000000--- a/packages/sheets-plugin-split-column/src/Types/index.d.ts+++ /dev/null@@ -1,8 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-split-column' {}--// use css module-declare module '*.less' {- const resource: { [key: string]: string };- export = resource;-}diff --git a/packages/sheets-plugin-split-column/src/Types/preact.d.ts b/packages/sheets-plugin-split-column/src/Types/preact.d.tsdeleted file mode 100644index 0d9c32b84c..0000000000--- a/packages/sheets-plugin-split-column/src/Types/preact.d.ts+++ /dev/null@@ -1 +0,0 @@-import JSX = preact.JSX;diff --git a/packages/sheets-plugin-split-column/src/UI/SplitColumnButton.tsx b/packages/sheets-plugin-split-column/src/UI/SplitColumnButton.tsxdeleted file mode 100644index e96bb0cfa8..0000000000--- a/packages/sheets-plugin-split-column/src/UI/SplitColumnButton.tsx+++ /dev/null@@ -1,178 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component, IToolbarItemProps, ModalProps } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import { IProps } from '../IData/ISplitColumn';-// import styles from './index.module.less';-// import { SplitColumnContent } from './SplitColumnContent';--// // Types for state-// interface IState {-// splitColumn: IToolbarItemProps;-// modalData: ModalProps[];-// notice: Notice[];-// }--// type Notice = {-// locale: string;-// label?: string;-// };--// export class SplitColumnButton extends Component<IProps, IState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize(props: IProps) {-// // super(props);-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();-// const DivideIcon = this.Render.renderFunction('DivideIcon');--// const splitColumn: IToolbarItemProps = {-// locale: 'splitColumn.splitColumnLabel',-// type: 'single',-// label: <DivideIcon />,-// show: true,-// };--// this.state = {-// splitColumn,-// notice: [-// {-// locale: 'splitColumn.tipNoMulti',-// },-// {-// locale: 'splitColumn.tipNoMultiColumn',-// },-// ],-// modalData: [-// {-// locale: 'splitColumn.splitTextTitle',-// show: false,-// group: [-// {-// locale: 'button.confirm',-// type: 'primary',-// },-// {-// locale: 'button.cancel',-// },-// ],-// children: <SplitColumnContent config={this.props.config} />,-// onCancel: () => {-// this.showModal(0, false);-// },-// },-// {-// show: false,-// group: [-// {-// locale: 'button.close',-// },-// ],-// },-// {-// show: false,-// group: [-// {-// locale: 'button.close',-// },-// ],-// },-// ],-// };-// }--// /**-// * init-// */-// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event--// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// /**-// * destory-// */-// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// /**-// * set text by config setting and Locale message-// */-// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState: IState) => {-// let item = prevState.splitColumn;-// // set current Locale string for tooltip-// item.tooltip = locale.get(`${item.locale}`);--// let notice = prevState.notice;-// notice.forEach((ele) => {-// ele.label = locale.get(ele.locale);-// });--// let modalData = prevState.modalData;-// modalData.forEach((ele, index) => {-// ele.title = locale.get(ele.locale!);-// if (ele.group && ele.group.length) {-// ele.group.forEach((node) => {-// node.label = locale.get(node.locale!);-// });-// }-// if (index === 1) {-// ele.children = <p>{notice[0].label}</p>;-// }-// if (index === 2) {-// ele.children = <p>{notice[1].label}</p>;-// }-// });--// return {-// splitColumn: item,-// modalData,-// notice,-// };-// });-// }--// showModal = (index: number, isShow: boolean) => {-// let { modalData } = this.state;-// modalData[index].show = isShow;-// this.setState((prevState) => ({-// modalData,-// }));-// };--// /**-// * Render the component's HTML-// *-// * @returns {void}-// */-// render(props: IProps, state: IState) {-// const Button = this.Render.renderFunction('Button');-// const Modal = this.Render.renderFunction('Modal');-// const { splitColumn, modalData } = state;-// // Set Provider for entire Container-// return (-// <div className={styles.singleButton}>-// <Button type="text" onClick={() => this.showModal(0, true)}>-// {splitColumn.label}-// </Button>-// {modalData.map((item) => {-// if (!item.show) return;-// return <Modal visible={item.show} onCancel={item.onCancel} title={item.title} group={item.group} children={item.children}></Modal>;-// })}-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-split-column/src/UI/SplitColumnContent.tsx b/packages/sheets-plugin-split-column/src/UI/SplitColumnContent.tsxdeleted file mode 100644index 8714222319..0000000000--- a/packages/sheets-plugin-split-column/src/UI/SplitColumnContent.tsx+++ /dev/null@@ -1,117 +0,0 @@-// import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';-// import { Nullable, Observer, Workbook } from '@univerjs/core';-// import { SheetPlugin } from '@univerjs/base-sheets';-// import styles from './index.module.less';--// type SplitContextProps = {-// config?: any;-// };-// type SplitContextState = {-// SplitGroup: SplitGroup[];-// symbol: SplitGroup;-// divide: SplitGroup;-// preview: SplitGroup;-// };-// type SplitGroup = {-// name: string;-// label?: string;-// value?: string;-// content?: string;-// };--// export class SplitColumnContent extends Component<SplitContextProps, SplitContextState> {-// private _localeObserver: Nullable<Observer<Workbook>>;--// Render: BaseComponentRender;--// initialize() {-// const component = new SheetPlugin().getPluginByName<BaseComponentSheet>('ComponentSheet')!;-// this.Render = component.getComponentRender();-// this.state = {-// SplitGroup: [-// {-// name: 'punctuation.tab',-// },-// {-// name: 'punctuation.semicolon',-// },-// {-// name: 'punctuation.comma',-// },-// {-// name: 'punctuation.space',-// },-// {-// name: 'splitColumn.splitOther',-// },-// ],-// symbol: {-// name: 'splitColumn.splitDelimiters',-// },-// divide: {-// name: 'splitColumn.splitContinueSymbol',-// },-// preview: {-// name: 'splitColumn.splitDataPreview',-// content: '',-// },-// };-// }--// setLocale() {-// const locale = this._context.getLocale();-// this.setState((prevState) => {-// let { SplitGroup, symbol, divide, preview } = prevState;-// SplitGroup.forEach((item) => {-// item.label = locale.get(item.name);-// });-// symbol.label = locale.get(symbol.name);-// divide.label = locale.get(divide.name);-// preview.label = locale.get(preview.name);--// return {-// SplitGroup,-// symbol,-// divide,-// preview,-// };-// });-// }--// componentWillMount() {-// this.setLocale();--// // subscribe Locale change event-// this._localeObserver = this._context-// .getObserverManager()-// .getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')-// ?.add(() => {-// this.setLocale();-// });-// }--// componentWillUnmount() {-// // this._context.getObserverManager().getObserver<Workbook>('onAfterChangeUILocaleObservable', 'workbook')?.remove(this._localeObserver);-// }--// render(props: SplitContextProps, state: SplitContextState) {-// const CheckboxGroup = this.Render.renderFunction('CheckboxGroup');-// const Checkbox = this.Render.renderFunction('Checkbox');-// const Input = this.Render.renderFunction('Input');-// const { SplitGroup, symbol, divide, preview } = state;-// return (-// <div className={styles.splitContent}>-// <p>{symbol.label}</p>-// <div className={styles.splitBox}>-// <CheckboxGroup options={SplitGroup}></CheckboxGroup>-// <Input />-// </div>-// <div className={styles.splitDivid}>-// <Checkbox value={divide.value}>{divide.label}</Checkbox>-// </div>-// <p>{preview.label}</p>-// <div className={styles.splitPreview}>{preview.content}</div>-// </div>-// );-// }-// }diff --git a/packages/sheets-plugin-split-column/src/UI/index.module.less b/packages/sheets-plugin-split-column/src/UI/index.module.lessdeleted file mode 100644index 6070428b17..0000000000--- a/packages/sheets-plugin-split-column/src/UI/index.module.less+++ /dev/null@@ -1,39 +0,0 @@-.single-button {- .split-content {- p {- padding: 0.5em;-- &:last-of-type {- margin-top: 0.5em;- }- }-- label {- height: 1.8em;- }-- .split-box {- padding: 0.5em;- border: 1px solid #dfdfdf;- position: relative;-- .checkbox-group {- flex-direction: column;- }-- input {- width: auto;- position: absolute;- left: 75px;- bottom: 0.5em;- height: 1.8em;- }- }-- .split-preview {- border: 1px solid #dfdfdf;- height: 9em;- overflow-y: auto;- }- }-}diff --git a/packages/sheets-plugin-split-column/src/View/Event.ts b/packages/sheets-plugin-split-column/src/View/Event.tsdeleted file mode 100644index 8c34a9ab4c..0000000000--- a/packages/sheets-plugin-split-column/src/View/Event.ts+++ /dev/null@@ -1 +0,0 @@-export class Event {}diff --git a/packages/sheets-plugin-split-column/src/View/ObserverList.ts b/packages/sheets-plugin-split-column/src/View/ObserverList.tsdeleted file mode 100644index a1b96aa311..0000000000--- a/packages/sheets-plugin-split-column/src/View/ObserverList.ts+++ /dev/null@@ -1 +0,0 @@-export class ObserverList {}diff --git a/packages/sheets-plugin-split-column/src/View/Render.ts b/packages/sheets-plugin-split-column/src/View/Render.tsdeleted file mode 100644index faca95e82e..0000000000--- a/packages/sheets-plugin-split-column/src/View/Render.ts+++ /dev/null@@ -1 +0,0 @@-export class Render {}diff --git a/packages/sheets-plugin-split-column/src/View/index.ts b/packages/sheets-plugin-split-column/src/View/index.tsdeleted file mode 100644index 732247fef5..0000000000--- a/packages/sheets-plugin-split-column/src/View/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './Event';-export * from './ObserverList';-export * from './Render';diff --git a/packages/sheets-plugin-split-column/src/index.ts b/packages/sheets-plugin-split-column/src/index.tsdeleted file mode 100644index 9b62416ecc..0000000000--- a/packages/sheets-plugin-split-column/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import { SplitColumnPlugin } from './SplitColumnPlugin';--export { SplitColumnPlugin };diff --git a/packages/sheets-plugin-split-column/src/main.tsx b/packages/sheets-plugin-split-column/src/main.tsxdeleted file mode 100644index 9aa55f1cb6..0000000000--- a/packages/sheets-plugin-split-column/src/main.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { UniverSheet } from '@univerjs/core';-import { RenderEngine } from '@univerjs/base-render';-import { DEFAULT_WORKBOOK_DATA } from '@univerjs/common-plugin-data';-import { SheetPlugin } from '@univerjs/base-sheets';--const uiDefaultConfigUp = {- container: 'universheet-demo-up',-};--const univerSheetUp = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA);-univerSheetUp.installPlugin(new RenderEngine());-univerSheetUp.installPlugin(new UniverComponentSheet());-univerSheetUp.installPlugin(new SheetPlugin(uiDefaultConfigUp));--// univerSheetUp.installPlugin(new SplitColumnPlugin());diff --git a/packages/sheets-plugin-split-column/tsconfig.json b/packages/sheets-plugin-split-column/tsconfig.jsondeleted file mode 100644index bb244c6545..0000000000--- a/packages/sheets-plugin-split-column/tsconfig.json+++ /dev/null@@ -1,38 +0,0 @@-{- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "target": "ESNext",- "lib": [- "ESNext",- "DOM",- "WebWorker"- ],- "module": "ESNext",- "moduleResolution": "Node", //This value is needed for Node.js.- "declaration": true,- "declarationDir": "./lib",- "declarationMap": true,- "sourceMap": true,- "resolveJsonModule": true,- "strict": true,- "noImplicitOverride": true,- "allowJs": true,- "baseUrl": "./",- "skipLibCheck": true,- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "experimentalDecorators": true,- "jsx": "react-jsx",- "jsxImportSource": "preact",- "strictPropertyInitialization": false,- "types": [- "jest",- "node",- "@types/jest"- ]- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-split-column/vite.config.ts b/packages/sheets-plugin-split-column/vite.config.tsdeleted file mode 100644index e4b8b7c0e1..0000000000--- a/packages/sheets-plugin-split-column/vite.config.ts+++ /dev/null@@ -1,48 +0,0 @@-import { defineConfig } from 'vite';-import path from 'path';-import preact from '@preact/preset-vite';-import createExternal from 'vite-plugin-external';-import { name, version } from './package.json';--const resolve = (url: string) => path.resolve(__dirname, url);--export default defineConfig({- build: {- lib: {- entry: resolve('src/index.ts'),- name: 'UniverSheetsPluginSplitColumn',- formats: ['es', 'umd', 'cjs'],- fileName: 'univer-sheets--plugin-split-column',- },- outDir: './lib',- },- 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(),- createExternal({- externals: {- '@univerjs/core': '@univerjs/core',- '@univerjs/style-univer': '@univerjs/style-univer',- preact: 'preact',- react: 'react',- },- }),- ],-});diff --git a/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts b/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.tsindex ce9514d2b5..490f2f1536 100644--- a/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts+++ b/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts@@ -1,176 +1,177 @@-import { Inject, Injector, Self, SkipSelf } from '@wendellhu/redi';--import { ComponentManager, DragManager, getRefElement, Prompt, SlotManager } from '@univerjs/base-ui';-import { LocaleService, LocaleType, ObserverManager } from '@univerjs/core';--import { ISheetUIPluginConfig } from '../Basics/Interfaces/ComponentConfig/ISheetUIPluginConfig';-import { SheetContainer } from '../View';-import { CellEditorUIController } from './CellEditorUIController';-import { CountBarUIController } from './CountBarUIController';-import { FormulaBarUIController } from './FormulaBarUIController';-import { InfoBarUIController } from './InfoBarUIController';-import { RightMenuUIController } from './RightMenuUIController';-import { SheetBarUIController } from './SheetBarUIContruller';-import { SlotController } from './SlotController';-import { ToolbarUIController } from './ToolbarUIController';--// NOTE: is this class necessary? Could be merged to AppUIConrainer-export class SheetContainerUIController {- private _sheetContainer: SheetContainer;-- private _toolbarController: ToolbarUIController;-- private _slotController: SlotController;-- private _slotManager: SlotManager;-- private _cellEditorUIController: CellEditorUIController;-- private _formulaBarUIController: FormulaBarUIController;-- private _infoBarController: InfoBarUIController;-- private _rightMenuController: RightMenuUIController;-- private _countBarController: CountBarUIController;-- private _sheetBarController: SheetBarUIController;-- private _config: ISheetUIPluginConfig;-- private _dragManager: DragManager;-- constructor(- config: ISheetUIPluginConfig,- @SkipSelf() @Inject(ObserverManager) private readonly _globalObserverManager: ObserverManager,- @Inject(LocaleService) private readonly _localeService: LocaleService,- @Self() @Inject(ObserverManager) private readonly _observerManager: ObserverManager,- @Inject(Injector) private readonly _injector: Injector,- @Inject(ComponentManager) private readonly _componentManager: ComponentManager- ) {- this._config = config;-- this._slotController = new SlotController();- this._slotManager = new SlotManager();- this._toolbarController = this._injector.createInstance(ToolbarUIController, this._config.layout?.toolbarConfig);- this._cellEditorUIController = this._injector.createInstance(CellEditorUIController, () => this.getContentRef());- this._formulaBarUIController = this._injector.createInstance(FormulaBarUIController);- this._infoBarController = this._injector.createInstance(InfoBarUIController);- this._rightMenuController = this._injector.createInstance(RightMenuUIController, this._config.layout?.rightMenuConfig);- this._countBarController = this._injector.createInstance(CountBarUIController);- this._sheetBarController = this._injector.createInstance(SheetBarUIController);- this._dragManager = this._injector.createInstance(DragManager);-- // 插入prompt组件- this._componentManager.register(Prompt.name, Prompt);- this._slotManager.setSlotComponent('main', {- name: Prompt.name,- component: {- name: Prompt.name,- },- });- }-- getUIConfig() {- const config = {- injector: this._injector,- config: this._config,- changeLocale: this.changeLocale,- getComponent: this.getComponent,- // 其余组件的props- methods: {- toolbar: {- getComponent: this._toolbarController.getComponent,- },- cellEditor: {- getComponent: this._cellEditorUIController.getComponent,- },- formulaBar: {- getComponent: this._formulaBarUIController.getComponent,- },- infoBar: {- getComponent: this._infoBarController.getComponent,- // renameSheet: this._infoBarController.renameSheet,- },- rightMenu: {- getComponent: this._rightMenuController.getComponent,- },- countBar: {- getComponent: this._countBarController.getComponent,- onChange: this._countBarController.onChange,- },- sheetBar: {- getComponent: this._sheetBarController.getComponent,- addSheet: this._sheetBarController.addSheet,- selectSheet: this._sheetBarController.selectSheet,- dragEnd: this._sheetBarController.dragEnd,- changeSheetName: this._sheetBarController.changeSheetName,- },- slot: {- // getComponent: this._slotController.getComponent,- getComponent: this._slotManager.getComponent,- },- },- };- return config;- }-- // 获取SheetContainer组件- getComponent = (ref: SheetContainer) => {- this._sheetContainer = ref;-- this._observerManager.getObserver<SheetContainer>('onUIDidMount')?.notifyObservers(this._sheetContainer);- this._globalObserverManager.requiredObserver<boolean>('onUIDidMountObservable', 'core').notifyObservers(true);-- this.setSheetContainer();- };-- /**- * Change language- * @param {String} lang new language- *- * e: {target: HTMLSelectElement } reference from https://stackoverflow.com/a/48443771- *- */- changeLocale = (locale: string) => {- this._localeService.getLocale().change(locale as LocaleType);-- // publish- this._globalObserverManager.requiredObserver('onAfterChangeUILocaleObservable', 'core')!.notifyObservers();- };-- getContentRef() {- return this._sheetContainer.getContentRef();- }-- getCellEditorUIController() {- return this._cellEditorUIController;- }-- getFormulaBarUIController() {- return this._formulaBarUIController;- }-- getMainSlotController() {- return this._slotController;- }-- getSlotManager() {- return this._slotManager;- }-- getToolbarController() {- return this._toolbarController;- }-- UIDidMount(cb: Function) {- if (this._sheetContainer) return cb(this._sheetContainer);-- this._observerManager.getObserver('onUIDidMount')?.add(() => cb(this._sheetContainer));- }-- private setSheetContainer() {- // handle drag event- this._dragManager.handleDragAction(getRefElement(this._sheetContainer));- }-}+import { Inject, Injector, Self, SkipSelf } from '@wendellhu/redi';++import { ComponentManager, DragManager, getRefElement, Prompt, SlotManager } from '@univerjs/base-ui';+import { LocaleService, LocaleType, ObserverManager } from '@univerjs/core';++import { ISheetUIPluginConfig } from '../Basics/Interfaces/ComponentConfig/ISheetUIPluginConfig';+import { SheetContainer } from '../View';+import { CellEditorUIController } from './CellEditorUIController';+import { CountBarUIController } from './CountBarUIController';+import { FormulaBarUIController } from './FormulaBarUIController';+import { InfoBarUIController } from './InfoBarUIController';+import { RightMenuUIController } from './RightMenuUIController';+import { SheetBarUIController } from './SheetBarUIContruller';+import { SlotController } from './SlotController';+import { ToolbarUIController } from './ToolbarUIController';++// NOTE: is this class necessary? Could be merged to AppUIConrainer+export class SheetContainerUIController {+ private _sheetContainer: SheetContainer;++ private _toolbarController: ToolbarUIController;++ private _slotController: SlotController;++ // private _slotManager: SlotManager;++ private _cellEditorUIController: CellEditorUIController;++ private _formulaBarUIController: FormulaBarUIController;++ private _infoBarController: InfoBarUIController;++ private _rightMenuController: RightMenuUIController;++ private _countBarController: CountBarUIController;++ private _sheetBarController: SheetBarUIController;++ private _config: ISheetUIPluginConfig;++ private _dragManager: DragManager;++ constructor(+ config: ISheetUIPluginConfig,+ @SkipSelf() @Inject(ObserverManager) private readonly _globalObserverManager: ObserverManager,+ @Inject(LocaleService) private readonly _localeService: LocaleService,+ @Self() @Inject(ObserverManager) private readonly _observerManager: ObserverManager,+ @Inject(Injector) private readonly _injector: Injector,+ @Inject(ComponentManager) private readonly _componentManager: ComponentManager,+ @Inject(SlotManager) private readonly _slotManager: SlotManager+ ) {+ this._config = config;++ this._slotController = new SlotController();+ // this._slotManager = new SlotManager();+ this._toolbarController = this._injector.createInstance(ToolbarUIController, this._config.layout?.toolbarConfig);+ this._cellEditorUIController = this._injector.createInstance(CellEditorUIController, () => this.getContentRef());+ this._formulaBarUIController = this._injector.createInstance(FormulaBarUIController);+ this._infoBarController = this._injector.createInstance(InfoBarUIController);+ this._rightMenuController = this._injector.createInstance(RightMenuUIController, this._config.layout?.rightMenuConfig);+ this._countBarController = this._injector.createInstance(CountBarUIController);+ this._sheetBarController = this._injector.createInstance(SheetBarUIController);+ this._dragManager = this._injector.createInstance(DragManager);++ // 插入prompt组件+ this._componentManager.register(Prompt.name, Prompt);+ this._slotManager.setSlotComponent('main', {+ name: Prompt.name,+ component: {+ name: Prompt.name,+ },+ });+ }++ getUIConfig() {+ const config = {+ injector: this._injector,+ config: this._config,+ changeLocale: this.changeLocale,+ getComponent: this.getComponent,+ // 其余组件的props+ methods: {+ toolbar: {+ getComponent: this._toolbarController.getComponent,+ },+ cellEditor: {+ getComponent: this._cellEditorUIController.getComponent,+ },+ formulaBar: {+ getComponent: this._formulaBarUIController.getComponent,+ },+ infoBar: {+ getComponent: this._infoBarController.getComponent,+ // renameSheet: this._infoBarController.renameSheet,+ },+ rightMenu: {+ getComponent: this._rightMenuController.getComponent,+ },+ countBar: {+ getComponent: this._countBarController.getComponent,+ onChange: this._countBarController.onChange,+ },+ sheetBar: {+ getComponent: this._sheetBarController.getComponent,+ addSheet: this._sheetBarController.addSheet,+ selectSheet: this._sheetBarController.selectSheet,+ dragEnd: this._sheetBarController.dragEnd,+ changeSheetName: this._sheetBarController.changeSheetName,+ },+ slot: {+ // getComponent: this._slotController.getComponent,+ getComponent: this._slotManager.getComponent,+ },+ },+ };+ return config;+ }++ // 获取SheetContainer组件+ getComponent = (ref: SheetContainer) => {+ this._sheetContainer = ref;++ this._observerManager.getObserver<SheetContainer>('onUIDidMount')?.notifyObservers(this._sheetContainer);+ this._globalObserverManager.requiredObserver<boolean>('onUIDidMountObservable', 'core').notifyObservers(true);++ this.setSheetContainer();+ };++ /**+ * Change language+ * @param {String} lang new language+ *+ * e: {target: HTMLSelectElement } reference from https://stackoverflow.com/a/48443771+ *+ */+ changeLocale = (locale: string) => {+ this._localeService.getLocale().change(locale as LocaleType);++ // publish+ this._globalObserverManager.requiredObserver('onAfterChangeUILocaleObservable', 'core')!.notifyObservers();+ };++ getContentRef() {+ return this._sheetContainer.getContentRef();+ }++ getCellEditorUIController() {+ return this._cellEditorUIController;+ }++ getFormulaBarUIController() {+ return this._formulaBarUIController;+ }++ getMainSlotController() {+ return this._slotController;+ }++ getSlotManager() {+ return this._slotManager;+ }++ getToolbarController() {+ return this._toolbarController;+ }++ UIDidMount(cb: Function) {+ if (this._sheetContainer) return cb(this._sheetContainer);++ this._observerManager.getObserver('onUIDidMount')?.add(() => cb(this._sheetContainer));+ }++ private setSheetContainer() {+ // handle drag event+ this._dragManager.handleDragAction(getRefElement(this._sheetContainer));+ }+}diff --git a/packages/ui-plugin-sheets/src/SheetUIPlugin.ts b/packages/ui-plugin-sheets/src/SheetUIPlugin.tsindex 9cdbdfc405..3e66be4d79 100644--- a/packages/ui-plugin-sheets/src/SheetUIPlugin.ts+++ b/packages/ui-plugin-sheets/src/SheetUIPlugin.ts@@ -1,169 +1,170 @@-import { Inject, Injector } from '@wendellhu/redi';-import { Plugin, Tools, Univer, PluginType } from '@univerjs/core';-import { ComponentManager, getRefElement, RegisterManager, KeyboardManager, SlotComponent, ZIndexManager } from '@univerjs/base-ui';-import { IRenderingEngine } from '@univerjs/base-render';-import { DefaultSheetUIConfig, installObserver, ISheetUIPluginConfig, SheetUIPluginObserve, SHEET_UI_PLUGIN_NAME } from './Basics';-import { AppUIController } from './Controller/AppUIController';-import { Fx } from './View/FormulaBar';-import { SlotComponentProps } from './Controller/SlotController';-import { IToolbarItemProps } from './Controller/ToolbarUIController';-import { zh, en } from './Locale';--export class SheetUIPlugin extends Plugin<SheetUIPluginObserve> {- static override type = PluginType.Sheet;-- private _appUIController: AppUIController;-- private _keyboardManager: KeyboardManager;-- private _registerManager: RegisterManager;-- private _config: ISheetUIPluginConfig;-- private _zIndexManager: ZIndexManager;-- private _componentManager: ComponentManager;-- constructor(config: ISheetUIPluginConfig, @Inject(Injector) private readonly _sheetInjector: Injector) {- super(SHEET_UI_PLUGIN_NAME);-- this._config = Tools.deepMerge({}, DefaultSheetUIConfig, config);- }-- static create(config?: ISheetUIPluginConfig) {- return new SheetUIPlugin(config || {}, new Injector());- }-- installTo(univerInstance: Univer) {- univerInstance.install(this);- }-- initialize(): void {- installObserver(this);- /**- * load more Locale object- *- * TODO 异步加载- */- this.getLocale().load({- zh,- en,- });-- this.initializeDependencies();-- // AppUIController initializes the DOM as an asynchronous rendering process, and must wait for the UI rendering to complete before starting to render the canvas- this.UIDidMount(() => {- this.initRender();- });- }-- initializeDependencies(): void {- this._sheetInjector.add([KeyboardManager]);- this._sheetInjector.add([RegisterManager]);- this._sheetInjector.add([ComponentManager]);- this._sheetInjector.add([ZIndexManager]);-- // TODO: maybe we don't have to instantiate these dependencies manually- this._componentManager = this._sheetInjector.get(ComponentManager);- this._keyboardManager = this._sheetInjector.get(KeyboardManager);- this._zIndexManager = this._sheetInjector.get(ZIndexManager);- this._registerManager = this._sheetInjector.get(RegisterManager);-- this._appUIController = this._sheetInjector.createInstance(AppUIController, this._config);- }-- initRender() {- const engine = this._sheetInjector.get(IRenderingEngine);- let container = getRefElement(this._appUIController.getSheetContainerController().getContentRef());-- // mount canvas to DOM container- engine.setContainer(container);-- window.addEventListener('resize', () => {- engine.resize();- });-- // should be clear- setTimeout(() => {- engine.resize();- }, 0);- }-- initUI() {}-- override onMounted(): void {- this.initialize();- }-- override onDestroy(): void {}-- getAppUIController() {- return this._appUIController;- }-- getComponentManager() {- return this._componentManager;- }-- getZIndexManager() {- return this._zIndexManager;- }-- /**- * usage this._clipboardExtensionManager.handle(data);- * @returns- */- getRegisterManager(): RegisterManager {- return this._registerManager;- }-- /**- * usage this._clipboardExtensionManager.handle(data);- * @returns- */- getKeyboardManager(): KeyboardManager {- return this._keyboardManager;- }-- /**- * Formula Bar API- * @param str- */- setFormulaContent(str: string) {- this._appUIController.getSheetContainerController().getFormulaBarUIController().getFormulaBar().setFormulaContent(str);- }-- setFx(fx: Fx) {- this._appUIController.getSheetContainerController().getFormulaBarUIController().getFormulaBar().setFx(fx);- }-- /**- * This API is used in plugins for initialization that depends on UI rendering- * @param cb- * @returns- */- UIDidMount(cb: Function) {- this._appUIController.getSheetContainerController().UIDidMount(cb);- }-- setSlot(slotName: string, component: SlotComponent, cb?: () => {}) {- this._appUIController.getSheetContainerController().getSlotManager().setSlotComponent(slotName, component, cb);- }-- addSlot(name: string, slot: SlotComponentProps, cb?: () => void) {- this._appUIController.getSheetContainerController().getMainSlotController().addSlot(name, slot, cb);- }-- getSlot(name: string) {- return this._appUIController.getSheetContainerController().getMainSlotController().getSlot(name);- }-- addToolButton(config: IToolbarItemProps) {- this._appUIController.getSheetContainerController().getToolbarController().addToolbarConfig(config);- }-- deleteToolButton(name: string) {- this._appUIController.getSheetContainerController().getToolbarController().deleteToolbarConfig(name);- }-}+import { Inject, Injector } from '@wendellhu/redi';+import { Plugin, Tools, Univer, PluginType } from '@univerjs/core';+import { ComponentManager, getRefElement, RegisterManager, KeyboardManager, SlotComponent, ZIndexManager, SlotManager } from '@univerjs/base-ui';+import { IRenderingEngine } from '@univerjs/base-render';+import { DefaultSheetUIConfig, installObserver, ISheetUIPluginConfig, SheetUIPluginObserve, SHEET_UI_PLUGIN_NAME } from './Basics';+import { AppUIController } from './Controller/AppUIController';+import { Fx } from './View/FormulaBar';+import { SlotComponentProps } from './Controller/SlotController';+import { IToolbarItemProps } from './Controller/ToolbarUIController';+import { zh, en } from './Locale';++export class SheetUIPlugin extends Plugin<SheetUIPluginObserve> {+ static override type = PluginType.Sheet;++ private _appUIController: AppUIController;++ private _keyboardManager: KeyboardManager;++ private _registerManager: RegisterManager;++ private _config: ISheetUIPluginConfig;++ private _zIndexManager: ZIndexManager;++ private _componentManager: ComponentManager;++ constructor(config: ISheetUIPluginConfig, @Inject(Injector) private readonly _sheetInjector: Injector) {+ super(SHEET_UI_PLUGIN_NAME);++ this._config = Tools.deepMerge({}, DefaultSheetUIConfig, config);+ }++ static create(config?: ISheetUIPluginConfig) {+ return new SheetUIPlugin(config || {}, new Injector());+ }++ installTo(univerInstance: Univer) {+ univerInstance.install(this);+ }++ initialize(): void {+ installObserver(this);+ /**+ * load more Locale object+ *+ * TODO 异步加载+ */+ this.getLocale().load({+ zh,+ en,+ });++ this.initializeDependencies();++ // AppUIController initializes the DOM as an asynchronous rendering process, and must wait for the UI rendering to complete before starting to render the canvas+ this.UIDidMount(() => {+ this.initRender();+ });+ }++ initializeDependencies(): void {+ this._sheetInjector.add([KeyboardManager]);+ this._sheetInjector.add([RegisterManager]);+ this._sheetInjector.add([ComponentManager]);+ this._sheetInjector.add([ZIndexManager]);+ this._sheetInjector.add([SlotManager]);++ // TODO: maybe we don't have to instantiate these dependencies manually+ this._componentManager = this._sheetInjector.get(ComponentManager);+ this._keyboardManager = this._sheetInjector.get(KeyboardManager);+ this._zIndexManager = this._sheetInjector.get(ZIndexManager);+ this._registerManager = this._sheetInjector.get(RegisterManager);++ this._appUIController = this._sheetInjector.createInstance(AppUIController, this._config);+ }++ initRender() {+ const engine = this._sheetInjector.get(IRenderingEngine);+ let container = getRefElement(this._appUIController.getSheetContainerController().getContentRef());++ // mount canvas to DOM container+ engine.setContainer(container);++ window.addEventListener('resize', () => {+ engine.resize();+ });++ // should be clear+ setTimeout(() => {+ engine.resize();+ }, 0);+ }++ initUI() { }++ override onMounted(): void {+ this.initialize();+ }++ override onDestroy(): void { }++ getAppUIController() {+ return this._appUIController;+ }++ getComponentManager() {+ return this._componentManager;+ }++ getZIndexManager() {+ return this._zIndexManager;+ }++ /**+ * usage this._clipboardExtensionManager.handle(data);+ * @returns+ */+ getRegisterManager(): RegisterManager {+ return this._registerManager;+ }++ /**+ * usage this._clipboardExtensionManager.handle(data);+ * @returns+ */+ getKeyboardManager(): KeyboardManager {+ return this._keyboardManager;+ }++ /**+ * Formula Bar API+ * @param str+ */+ setFormulaContent(str: string) {+ this._appUIController.getSheetContainerController().getFormulaBarUIController().getFormulaBar().setFormulaContent(str);+ }++ setFx(fx: Fx) {+ this._appUIController.getSheetContainerController().getFormulaBarUIController().getFormulaBar().setFx(fx);+ }++ /**+ * This API is used in plugins for initialization that depends on UI rendering+ * @param cb+ * @returns+ */+ UIDidMount(cb: Function) {+ this._appUIController.getSheetContainerController().UIDidMount(cb);+ }++ setSlot(slotName: string, component: SlotComponent, cb?: () => {}) {+ this._appUIController.getSheetContainerController().getSlotManager().setSlotComponent(slotName, component, cb);+ }++ addSlot(name: string, slot: SlotComponentProps, cb?: () => void) {+ this._appUIController.getSheetContainerController().getMainSlotController().addSlot(name, slot, cb);+ }++ getSlot(name: string) {+ return this._appUIController.getSheetContainerController().getMainSlotController().getSlot(name);+ }++ addToolButton(config: IToolbarItemProps) {+ this._appUIController.getSheetContainerController().getToolbarController().addToolbarConfig(config);+ }++ deleteToolButton(name: string) {+ this._appUIController.getSheetContainerController().getToolbarController().deleteToolbarConfig(name);+ }+}