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
chore: remove experimental packages from pnpm workspace and simplify vitest configuration (#6422)
白熱beb196f4cc5c
diff --git a/.release-it.json b/.release-it.jsonindex 714ea70e92..47df77b91a 100644--- a/.release-it.json+++ b/.release-it.json@@ -19,8 +19,7 @@"skipChecks": true,"workspaces": ["common/*",- "packages/*",- "packages-experimental/action-recorder"+ "packages/*"]}}diff --git a/.vscode/settings.json b/.vscode/settings.jsonindex 21cc6b0816..75ddc5ae96 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -57,5 +57,7 @@"editor.quickSuggestions": {"strings": "on"- }+ },++ "vitest.maximumConfigs": 80}diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 974b249dc6..6349c53a82 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -66,7 +66,6 @@ The structure of the repository is as follows:├── examples/ demos running on the web├── mockdata/ mock data for development├── packages/ Univer core and plugins-├── packages-experimental/ experimental plugins (not published on npm.com)```The file structure of a plugin should be organized as follows:diff --git a/packages-experimental/debugger/README.md b/common/debugger/README.mdsimilarity index 100%rename from packages-experimental/debugger/README.mdrename to common/debugger/README.mddiff --git a/packages-experimental/debugger/package.json b/common/debugger/package.jsonsimilarity index 100%rename from packages-experimental/debugger/package.jsonrename to common/debugger/package.jsondiff --git a/packages-experimental/debugger/postcss.config.mjs b/common/debugger/postcss.config.mjssimilarity index 100%rename from packages-experimental/debugger/postcss.config.mjsrename to common/debugger/postcss.config.mjsdiff --git a/packages-experimental/debugger/src/components/FloatButton.tsx b/common/debugger/src/components/FloatButton.tsxsimilarity index 100%rename from packages-experimental/debugger/src/components/FloatButton.tsxrename to common/debugger/src/components/FloatButton.tsxdiff --git a/packages-experimental/debugger/src/components/Image.tsx b/common/debugger/src/components/Image.tsxsimilarity index 100%rename from packages-experimental/debugger/src/components/Image.tsxrename to common/debugger/src/components/Image.tsxdiff --git a/packages-experimental/debugger/src/components/RangeLoading.tsx b/common/debugger/src/components/RangeLoading.tsxsimilarity index 100%rename from packages-experimental/debugger/src/components/RangeLoading.tsxrename to common/debugger/src/components/RangeLoading.tsxdiff --git a/packages-experimental/debugger/src/components/VueComponent.vue b/common/debugger/src/components/VueComponent.vuesimilarity index 100%rename from packages-experimental/debugger/src/components/VueComponent.vuerename to common/debugger/src/components/VueComponent.vuediff --git a/packages-experimental/debugger/src/components/WebComponent.ts b/common/debugger/src/components/WebComponent.tssimilarity index 100%rename from packages-experimental/debugger/src/components/WebComponent.tsrename to common/debugger/src/components/WebComponent.tsdiff --git a/packages-experimental/debugger/src/controllers/config.schema.ts b/common/debugger/src/controllers/config.schema.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/config.schema.tsrename to common/debugger/src/controllers/config.schema.tsdiff --git a/packages-experimental/debugger/src/controllers/debugger.controller.ts b/common/debugger/src/controllers/debugger.controller.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/debugger.controller.tsrename to common/debugger/src/controllers/debugger.controller.tsdiff --git a/packages-experimental/debugger/src/controllers/e2e/data/default-doc.ts b/common/debugger/src/controllers/e2e/data/default-doc.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/e2e/data/default-doc.tsrename to common/debugger/src/controllers/e2e/data/default-doc.tsdiff --git a/packages-experimental/debugger/src/controllers/e2e/data/default-sheet.ts b/common/debugger/src/controllers/e2e/data/default-sheet.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/e2e/data/default-sheet.tsrename to common/debugger/src/controllers/e2e/data/default-sheet.tsdiff --git a/packages-experimental/debugger/src/controllers/e2e/e2e.controller.ts b/common/debugger/src/controllers/e2e/e2e.controller.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/e2e/e2e.controller.tsrename to common/debugger/src/controllers/e2e/e2e.controller.tsdiff --git a/packages-experimental/debugger/src/controllers/local-save/record.controller.ts b/common/debugger/src/controllers/local-save/record.controller.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/local-save/record.controller.tsrename to common/debugger/src/controllers/local-save/record.controller.tsdiff --git a/packages-experimental/debugger/src/controllers/local-save/util.ts b/common/debugger/src/controllers/local-save/util.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/local-save/util.tsrename to common/debugger/src/controllers/local-save/util.tsdiff --git a/packages-experimental/debugger/src/controllers/performance-monitor.controller.ts b/common/debugger/src/controllers/performance-monitor.controller.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/performance-monitor.controller.tsrename to common/debugger/src/controllers/performance-monitor.controller.tsdiff --git a/packages-experimental/debugger/src/controllers/watermark.menu.controller.ts b/common/debugger/src/controllers/watermark.menu.controller.tssimilarity index 100%rename from packages-experimental/debugger/src/controllers/watermark.menu.controller.tsrename to common/debugger/src/controllers/watermark.menu.controller.tsdiff --git a/packages-experimental/debugger/src/global.css b/common/debugger/src/global.csssimilarity index 100%rename from packages-experimental/debugger/src/global.cssrename to common/debugger/src/global.cssdiff --git a/packages-experimental/debugger/src/index.ts b/common/debugger/src/index.tssimilarity index 100%rename from packages-experimental/debugger/src/index.tsrename to common/debugger/src/index.tsdiff --git a/packages-experimental/debugger/src/plugin.ts b/common/debugger/src/plugin.tssimilarity index 100%rename from packages-experimental/debugger/src/plugin.tsrename to common/debugger/src/plugin.tsdiff --git a/packages-experimental/debugger/src/views/Fab.tsx b/common/debugger/src/views/Fab.tsxsimilarity index 100%rename from packages-experimental/debugger/src/views/Fab.tsxrename to common/debugger/src/views/Fab.tsxdiff --git a/packages-experimental/debugger/src/views/test-editor/component-name.ts b/common/debugger/src/views/test-editor/component-name.tssimilarity index 100%rename from packages-experimental/debugger/src/views/test-editor/component-name.tsrename to common/debugger/src/views/test-editor/component-name.tsdiff --git a/packages-experimental/debugger/src/views/use-cell-content.ts b/common/debugger/src/views/use-cell-content.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-cell-content.tsrename to common/debugger/src/views/use-cell-content.tsdiff --git a/packages-experimental/debugger/src/views/use-dark-mode.ts b/common/debugger/src/views/use-dark-mode.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-dark-mode.tsrename to common/debugger/src/views/use-dark-mode.tsdiff --git a/packages-experimental/debugger/src/views/use-dialog.ts b/common/debugger/src/views/use-dialog.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-dialog.tsrename to common/debugger/src/views/use-dialog.tsdiff --git a/packages-experimental/debugger/src/views/use-dispose.ts b/common/debugger/src/views/use-dispose.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-dispose.tsrename to common/debugger/src/views/use-dispose.tsdiff --git a/packages-experimental/debugger/src/views/use-editable.ts b/common/debugger/src/views/use-editable.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-editable.tsrename to common/debugger/src/views/use-editable.tsdiff --git a/packages-experimental/debugger/src/views/use-floating-dom.ts b/common/debugger/src/views/use-floating-dom.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-floating-dom.tsrename to common/debugger/src/views/use-floating-dom.tsdiff --git a/packages-experimental/debugger/src/views/use-locale.ts b/common/debugger/src/views/use-locale.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-locale.tsrename to common/debugger/src/views/use-locale.tsdiff --git a/packages-experimental/debugger/src/views/use-message.ts b/common/debugger/src/views/use-message.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-message.tsrename to common/debugger/src/views/use-message.tsdiff --git a/packages-experimental/debugger/src/views/use-notification.ts b/common/debugger/src/views/use-notification.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-notification.tsrename to common/debugger/src/views/use-notification.tsdiff --git a/packages-experimental/debugger/src/views/use-sidebar.ts b/common/debugger/src/views/use-sidebar.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-sidebar.tsrename to common/debugger/src/views/use-sidebar.tsdiff --git a/packages-experimental/debugger/src/views/use-snapshot.ts b/common/debugger/src/views/use-snapshot.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-snapshot.tsrename to common/debugger/src/views/use-snapshot.tsdiff --git a/packages-experimental/debugger/src/views/use-theme.ts b/common/debugger/src/views/use-theme.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-theme.tsrename to common/debugger/src/views/use-theme.tsdiff --git a/packages-experimental/debugger/src/views/use-units.ts b/common/debugger/src/views/use-units.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-units.tsrename to common/debugger/src/views/use-units.tsdiff --git a/packages-experimental/debugger/src/views/use-user.ts b/common/debugger/src/views/use-user.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-user.tsrename to common/debugger/src/views/use-user.tsdiff --git a/packages-experimental/debugger/src/views/use-watermark.ts b/common/debugger/src/views/use-watermark.tssimilarity index 100%rename from packages-experimental/debugger/src/views/use-watermark.tsrename to common/debugger/src/views/use-watermark.tsdiff --git a/packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsx b/common/debugger/src/views/watermark/WatermarkImageSetting.tsxsimilarity index 100%rename from packages-experimental/debugger/src/views/watermark/WatermarkImageSetting.tsxrename to common/debugger/src/views/watermark/WatermarkImageSetting.tsxdiff --git a/packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsx b/common/debugger/src/views/watermark/WatermarkPanel.tsxsimilarity index 100%rename from packages-experimental/debugger/src/views/watermark/WatermarkPanel.tsxrename to common/debugger/src/views/watermark/WatermarkPanel.tsxdiff --git a/packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsx b/common/debugger/src/views/watermark/WatermarkPanelFooter.tsxsimilarity index 100%rename from packages-experimental/debugger/src/views/watermark/WatermarkPanelFooter.tsxrename to common/debugger/src/views/watermark/WatermarkPanelFooter.tsxdiff --git a/packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsx b/common/debugger/src/views/watermark/WatermarkTextSetting.tsxsimilarity index 100%rename from packages-experimental/debugger/src/views/watermark/WatermarkTextSetting.tsxrename to common/debugger/src/views/watermark/WatermarkTextSetting.tsxdiff --git a/packages-experimental/debugger/src/vite-env.d.ts b/common/debugger/src/vite-env.d.tssimilarity index 100%rename from packages-experimental/debugger/src/vite-env.d.tsrename to common/debugger/src/vite-env.d.tsdiff --git a/packages-experimental/debugger/tailwind.config.ts b/common/debugger/tailwind.config.tssimilarity index 100%rename from packages-experimental/debugger/tailwind.config.tsrename to common/debugger/tailwind.config.tsdiff --git a/packages-experimental/debugger/tsconfig.json b/common/debugger/tsconfig.jsonsimilarity index 100%rename from packages-experimental/debugger/tsconfig.jsonrename to common/debugger/tsconfig.jsondiff --git a/packages-experimental/debugger/tsconfig.node.json b/common/debugger/tsconfig.node.jsonsimilarity index 100%rename from packages-experimental/debugger/tsconfig.node.jsonrename to common/debugger/tsconfig.node.jsondiff --git a/packages-experimental/debugger/vitest.config.ts b/common/debugger/vitest.config.tssimilarity index 100%rename from packages-experimental/debugger/vitest.config.tsrename to common/debugger/vitest.config.tsdiff --git a/mockdata/.gitignore b/common/mockdata/.gitignoresimilarity index 100%rename from mockdata/.gitignorerename to common/mockdata/.gitignorediff --git a/mockdata/README.md b/common/mockdata/README.mdsimilarity index 100%rename from mockdata/README.mdrename to common/mockdata/README.mddiff --git a/mockdata/package.json b/common/mockdata/package.jsonsimilarity index 98%rename from mockdata/package.jsonrename to common/mockdata/package.jsonindex 76f0b8bd08..c329fdc5bd 100644--- a/mockdata/package.json+++ b/common/mockdata/package.json@@ -69,7 +69,6 @@"@univerjs/thread-comment": "workspace:*","@univerjs/thread-comment-ui": "workspace:*","@univerjs/ui": "workspace:*",- "@univerjs/uni-formula-ui": "workspace:*","@univerjs/uniscript": "workspace:*"},"devDependencies": {diff --git a/mockdata/scripts/generate-locales.ts b/common/mockdata/scripts/generate-locales.tssimilarity index 84%rename from mockdata/scripts/generate-locales.tsrename to common/mockdata/scripts/generate-locales.tsindex f2cdc64adb..c9908f4e47 100644--- a/mockdata/scripts/generate-locales.ts+++ b/common/mockdata/scripts/generate-locales.ts@@ -42,15 +42,11 @@ async function generateLocales() {const pkgJsonFile = fs.readJsonSync(path.resolve(__dirname, '../package.json'));- const packages = fs.readdirSync(path.resolve(__dirname, '../../packages'))- .filter((dir) => fs.statSync(path.join(__dirname, '../../packages', dir)).isDirectory())- .map((dir) => path.join(__dirname, '../../packages', dir));+ const packages = fs.readdirSync(path.resolve(__dirname, '../../../packages'))+ .filter((dir) => fs.statSync(path.join(__dirname, '../../../packages', dir)).isDirectory())+ .map((dir) => path.join(__dirname, '../../../packages', dir));- const experimentalPackages = fs.readdirSync(path.resolve(__dirname, '../../packages-experimental'))- .filter((dir) => fs.statSync(path.join(__dirname, '../../packages-experimental', dir)).isDirectory())- .map((dir) => path.join(__dirname, '../../packages-experimental', dir));-- const allPackages = [...packages, ...experimentalPackages];+ const allPackages = [...packages];for (const pkg of allPackages) {const localePath = path.join(pkg, 'src/locale');if (fs.existsSync(localePath)) {diff --git a/mockdata/src/docs/default-document-data-cn.ts b/common/mockdata/src/docs/default-document-data-cn.tssimilarity index 100%rename from mockdata/src/docs/default-document-data-cn.tsrename to common/mockdata/src/docs/default-document-data-cn.tsdiff --git a/mockdata/src/docs/default-document-data-dreamer.ts b/common/mockdata/src/docs/default-document-data-dreamer.tssimilarity index 100%rename from mockdata/src/docs/default-document-data-dreamer.tsrename to common/mockdata/src/docs/default-document-data-dreamer.tsdiff --git a/mockdata/src/docs/default-document-data-en.ts b/common/mockdata/src/docs/default-document-data-en.tssimilarity index 100%rename from mockdata/src/docs/default-document-data-en.tsrename to common/mockdata/src/docs/default-document-data-en.tsdiff --git a/mockdata/src/docs/default-document-data.ts b/common/mockdata/src/docs/default-document-data.tssimilarity index 100%rename from mockdata/src/docs/default-document-data.tsrename to common/mockdata/src/docs/default-document-data.tsdiff --git a/mockdata/src/docs/default-document.data-simple.ts b/common/mockdata/src/docs/default-document.data-simple.tssimilarity index 100%rename from mockdata/src/docs/default-document.data-simple.tsrename to common/mockdata/src/docs/default-document.data-simple.tsdiff --git a/mockdata/src/docs/index.ts b/common/mockdata/src/docs/index.tssimilarity index 100%rename from mockdata/src/docs/index.tsrename to common/mockdata/src/docs/index.tsdiff --git a/mockdata/src/index.ts b/common/mockdata/src/index.tssimilarity index 100%rename from mockdata/src/index.tsrename to common/mockdata/src/index.tsdiff --git a/mockdata/src/sheets/default-workbook-data.ts b/common/mockdata/src/sheets/default-workbook-data.tssimilarity index 100%rename from mockdata/src/sheets/default-workbook-data.tsrename to common/mockdata/src/sheets/default-workbook-data.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-default-style.ts b/common/mockdata/src/sheets/demo/default-workbook-data-default-style.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-default-style.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-default-style.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo1.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo1.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo1.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo1.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo2.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo2.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo2.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo2.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo3.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo3.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo3.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo3.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo4.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo4.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo4.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo4.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo5.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo5.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo5.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo5.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo6.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo6.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo6.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo6.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo7.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo7.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo7.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo7.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-demo8.ts b/common/mockdata/src/sheets/demo/default-workbook-data-demo8.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-demo8.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-demo8.tsdiff --git a/mockdata/src/sheets/demo/default-workbook-data-validation.ts b/common/mockdata/src/sheets/demo/default-workbook-data-validation.tssimilarity index 100%rename from mockdata/src/sheets/demo/default-workbook-data-validation.tsrename to common/mockdata/src/sheets/demo/default-workbook-data-validation.tsdiff --git a/mockdata/src/sheets/demo/index.ts b/common/mockdata/src/sheets/demo/index.tssimilarity index 100%rename from mockdata/src/sheets/demo/index.tsrename to common/mockdata/src/sheets/demo/index.tsdiff --git a/mockdata/src/sheets/index.ts b/common/mockdata/src/sheets/index.tssimilarity index 100%rename from mockdata/src/sheets/index.tsrename to common/mockdata/src/sheets/index.tsdiff --git a/mockdata/src/sheets/slide-workbook-data.ts b/common/mockdata/src/sheets/slide-workbook-data.tssimilarity index 100%rename from mockdata/src/sheets/slide-workbook-data.tsrename to common/mockdata/src/sheets/slide-workbook-data.tsdiff --git a/mockdata/src/sheets/uniscript-data.ts b/common/mockdata/src/sheets/uniscript-data.tssimilarity index 100%rename from mockdata/src/sheets/uniscript-data.tsrename to common/mockdata/src/sheets/uniscript-data.tsdiff --git a/mockdata/src/slides/default-pages/page1.ts b/common/mockdata/src/slides/default-pages/page1.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page1.tsrename to common/mockdata/src/slides/default-pages/page1.tsdiff --git a/mockdata/src/slides/default-pages/page2.ts b/common/mockdata/src/slides/default-pages/page2.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page2.tsrename to common/mockdata/src/slides/default-pages/page2.tsdiff --git a/mockdata/src/slides/default-pages/page3.ts b/common/mockdata/src/slides/default-pages/page3.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page3.tsrename to common/mockdata/src/slides/default-pages/page3.tsdiff --git a/mockdata/src/slides/default-pages/page4.ts b/common/mockdata/src/slides/default-pages/page4.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page4.tsrename to common/mockdata/src/slides/default-pages/page4.tsdiff --git a/mockdata/src/slides/default-pages/page5.ts b/common/mockdata/src/slides/default-pages/page5.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page5.tsrename to common/mockdata/src/slides/default-pages/page5.tsdiff --git a/mockdata/src/slides/default-pages/page6.ts b/common/mockdata/src/slides/default-pages/page6.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page6.tsrename to common/mockdata/src/slides/default-pages/page6.tsdiff --git a/mockdata/src/slides/default-pages/page7.ts b/common/mockdata/src/slides/default-pages/page7.tssimilarity index 100%rename from mockdata/src/slides/default-pages/page7.tsrename to common/mockdata/src/slides/default-pages/page7.tsdiff --git a/mockdata/src/slides/default-slide-data.ts b/common/mockdata/src/slides/default-slide-data.tssimilarity index 100%rename from mockdata/src/slides/default-slide-data.tsrename to common/mockdata/src/slides/default-slide-data.tsdiff --git a/mockdata/src/slides/index.ts b/common/mockdata/src/slides/index.tssimilarity index 100%rename from mockdata/src/slides/index.tsrename to common/mockdata/src/slides/index.tsdiff --git a/mockdata/src/slides/rich-text/page3-richtext1.ts b/common/mockdata/src/slides/rich-text/page3-richtext1.tssimilarity index 100%rename from mockdata/src/slides/rich-text/page3-richtext1.tsrename to common/mockdata/src/slides/rich-text/page3-richtext1.tsdiff --git a/mockdata/src/slides/rich-text/page3-richtext2.ts b/common/mockdata/src/slides/rich-text/page3-richtext2.tssimilarity index 100%rename from mockdata/src/slides/rich-text/page3-richtext2.tsrename to common/mockdata/src/slides/rich-text/page3-richtext2.tsdiff --git a/mockdata/src/slides/rich-text/page3-richtext3.ts b/common/mockdata/src/slides/rich-text/page3-richtext3.tssimilarity index 100%rename from mockdata/src/slides/rich-text/page3-richtext3.tsrename to common/mockdata/src/slides/rich-text/page3-richtext3.tsdiff --git a/mockdata/src/slides/rich-text/page5-richtext1.ts b/common/mockdata/src/slides/rich-text/page5-richtext1.tssimilarity index 100%rename from mockdata/src/slides/rich-text/page5-richtext1.tsrename to common/mockdata/src/slides/rich-text/page5-richtext1.tsdiff --git a/mockdata/src/slides/unlimited-slide-data.ts b/common/mockdata/src/slides/unlimited-slide-data.tssimilarity index 100%rename from mockdata/src/slides/unlimited-slide-data.tsrename to common/mockdata/src/slides/unlimited-slide-data.tsdiff --git a/mockdata/tsconfig.json b/common/mockdata/tsconfig.jsonsimilarity index 100%rename from mockdata/tsconfig.jsonrename to common/mockdata/tsconfig.jsondiff --git a/common/shared/vitest/index.js b/common/shared/vitest/index.jsindex 3c3c560b57..4f4d33d825 100644--- a/common/shared/vitest/index.js+++ b/common/shared/vitest/index.js@@ -50,7 +50,6 @@ function createConfig(options) {'src/locale/**','**/*.stories.tsx','**/__testing__/**',- 'packages-experimental/**/*','**/*/tailwind.config.ts',],},diff --git a/common/storybook/tailwind.config.ts b/common/storybook/tailwind.config.tsindex 5dec6b875e..4d4326ec49 100644--- a/common/storybook/tailwind.config.ts+++ b/common/storybook/tailwind.config.ts@@ -24,7 +24,6 @@ import animate from 'tailwindcss-animate';const __dirname = path.dirname(fileURLToPath(import.meta.url));const packagesDir = fs.readdirSync(path.resolve(__dirname, '../../packages')).map((dir) => path.resolve(__dirname, `../../packages/${dir}`));-const packagesExperimentalDir = fs.readdirSync(path.resolve(__dirname, '../../packages-experimental')).map((dir) => path.resolve(__dirname, `../../packages-experimental/${dir}`));const tailwindProjects = packagesDir.concat(packagesExperimentalDir).reduce((acc, dir) => {const tailwindConfig = path.resolve(dir, 'tailwind.config.ts');diff --git a/e2e/e2e.d.ts b/e2e/e2e.d.tsindex 33ab4e0395..8218b8fa29 100644--- a/e2e/e2e.d.ts+++ b/e2e/e2e.d.ts@@ -1,5 +1,5 @@// The type definition is copied from:-// packages-experimental/debugger/src/controllers/e2e/e2e.controller.ts+// common/debugger/src/controllers/e2e/e2e.controller.tsexport interface IE2EControllerAPI {loadAndRelease(id: number, loadTimeout?: number, disposeTimeout?: number): Promise<void>;loadDefaultSheet(loadTimeout?: number): Promise<void>;diff --git a/examples/esbuild.config.ts b/examples/esbuild.config.tsindex 1d74f2c763..ef18b4630d 100644--- a/examples/esbuild.config.ts+++ b/examples/esbuild.config.ts@@ -131,11 +131,6 @@ const entryPoints = [// slides'./src/slides/main.ts',- // uni- './src/uni/main.ts',- './src/uni/worker.ts',- './src/uni/lazy.ts',-// mobile sheet'./src/mobile-s/main.ts','./src/mobile-s/worker.ts',diff --git a/examples/package.json b/examples/package.jsonindex 4f9b3621ba..00046ff382 100644--- a/examples/package.json+++ b/examples/package.json@@ -75,13 +75,7 @@"@univerjs/ui": "workspace:*","@univerjs/ui-adapter-vue3": "workspace:*","@univerjs/ui-adapter-web-component": "workspace:*",- "@univerjs/uni-docs-ui": "workspace:*",- "@univerjs/uni-formula": "workspace:*",- "@univerjs/uni-formula-ui": "workspace:*",- "@univerjs/uni-sheets-ui": "workspace:*",- "@univerjs/uni-slides-ui": "workspace:*","@univerjs/uniscript": "workspace:*",- "@univerjs/uniui": "workspace:*","@univerjs/watermark": "workspace:*","lit": "^3.3.2","monaco-editor": "0.55.1",diff --git a/examples/src/main.tsx b/examples/src/main.tsxindex 04cb734e1a..0dc24cafb3 100644--- a/examples/src/main.tsx+++ b/examples/src/main.tsx@@ -67,9 +67,6 @@ function Examples() {}, {title: '📚 Docs Uniscript',href: './docs-uniscript/',- }, {- title: '🌌 Uni Mode',- href: './uni/',}, {title: '📱 Mobile',href: './mobile-s/',diff --git a/examples/src/uni/lazy.ts b/examples/src/uni/lazy.tsdeleted file mode 100644index 8c2f82c0b7..0000000000--- a/examples/src/uni/lazy.ts+++ /dev/null@@ -1,39 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { UniverSheetsFilterUIPlugin } from '@univerjs/sheets-filter-ui';-import { UniverDocUniFormulaUIPlugin } from '@univerjs/uni-formula-ui';-import type { Plugin, PluginCtor } from '@univerjs/core';-// import { UniverUniscriptPlugin } from '@univerjs/uniscript';--export default function getLazyPlugins(): Array<[PluginCtor<Plugin>] | [PluginCtor<Plugin>, unknown]> {- return [- // [- // UniverUniscriptPlugin,- // {- // getWorkerUrl(moduleID: string, label: string) {- // if (label === 'typescript' || label === 'javascript') {- // return './vs/language/typescript/ts.worker.js';- // }-- // return './vs/editor/editor.worker.js';- // },- // },- // ],- [UniverSheetsFilterUIPlugin],- [UniverDocUniFormulaUIPlugin],- ];-}diff --git a/examples/src/uni/main.ts b/examples/src/uni/main.tsdeleted file mode 100644index 7f2aea8f5c..0000000000--- a/examples/src/uni/main.ts+++ /dev/null@@ -1,159 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { Injector, LocaleType, LogLevel, Univer, UniverInstanceType } from '@univerjs/core';-import { FUniver } from '@univerjs/core/facade';-import { UniverDocsPlugin } from '@univerjs/docs';-import { UniverDocsDrawingUIPlugin } from '@univerjs/docs-drawing-ui';-import { DocUIController, UniverDocsUIPlugin } from '@univerjs/docs-ui';-import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';-import { UniverRenderEnginePlugin } from '@univerjs/engine-render';-import { DEFAULT_DOCUMENT_DATA_CN, DEFAULT_DOCUMENT_DATA_EN, DEFAULT_SLIDE_DATA, DEFAULT_WORKBOOK_DATA_DEMO, DEFAULT_WORKBOOK_DATA_DEMO1 } from '@univerjs/mockdata';-import zhCN from '@univerjs/mockdata/locales/zh-CN';-import { UniverRPCMainThreadPlugin } from '@univerjs/rpc';-import { UniverSheetsPlugin } from '@univerjs/sheets';-import { UniverSheetsConditionalFormattingUIPlugin } from '@univerjs/sheets-conditional-formatting-ui';-import { UniverSheetsDrawingUIPlugin } from '@univerjs/sheets-drawing-ui';-import { UniverSheetsFindReplacePlugin } from '@univerjs/sheets-find-replace';-import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';-import { UniverSheetsFormulaUIPlugin } from '@univerjs/sheets-formula-ui';-import { UniverSheetsHyperLinkUIPlugin } from '@univerjs/sheets-hyper-link-ui';-import { UniverSheetsNumfmtPlugin } from '@univerjs/sheets-numfmt';-import { UniverSheetsNumfmtUIPlugin } from '@univerjs/sheets-numfmt-ui';-import { UniverSheetsSortUIPlugin } from '@univerjs/sheets-sort-ui';-import { UniverSheetsThreadCommentPlugin } from '@univerjs/sheets-thread-comment';-import { SheetUIController, UniverSheetsUIPlugin } from '@univerjs/sheets-ui';-import { UniverSlidesPlugin } from '@univerjs/slides';-import { SlidesUIController, UniverSlidesUIPlugin } from '@univerjs/slides-ui';-import { UniverThreadCommentUIPlugin } from '@univerjs/thread-comment-ui';-import { UniDocsUIController } from '@univerjs/uni-docs-ui';-import { UniverDocUniFormulaPlugin } from '@univerjs/uni-formula';-import { UniSheetsUIController } from '@univerjs/uni-sheets-ui';-import { UniSlidesUIController } from '@univerjs/uni-slides-ui';-import { UniverUniUIPlugin } from '@univerjs/uniui';--import '../global.css';--const LOAD_LAZY_PLUGINS_TIMEOUT = 4_000;--// univer-const univer = new Univer({- locale: LocaleType.ZH_CN,- locales: {- [LocaleType.ZH_CN]: zhCN,- },- logLevel: LogLevel.VERBOSE,-});--registerBasicPlugins(univer);-registerSheetPlugins(univer);-registerSlidePlugins(univer);-registerUniPlugins(univer);--// create univer instances-univer.createUnit(UniverInstanceType.UNIVER_SHEET, DEFAULT_WORKBOOK_DATA_DEMO);-univer.createUnit(UniverInstanceType.UNIVER_DOC, DEFAULT_DOCUMENT_DATA_EN);-univer.createUnit(UniverInstanceType.UNIVER_SHEET, DEFAULT_WORKBOOK_DATA_DEMO1);--declare global {- // eslint-disable-next-line ts/naming-convention- interface Window {- univer?: Univer;- univerAPI?: ReturnType<typeof FUniver.newAPI>;- }-}--setTimeout(() => {- import('./lazy').then((lazy) => {- const plugins = lazy.default();- plugins.forEach((p) => univer.registerPlugin(p[0], p[1]));-- univer.createUnit(UniverInstanceType.UNIVER_DOC, DEFAULT_DOCUMENT_DATA_CN);- univer.createUnit(UniverInstanceType.UNIVER_SLIDE, DEFAULT_SLIDE_DATA);- });-}, LOAD_LAZY_PLUGINS_TIMEOUT);--window.univer = univer;-window.univerAPI = FUniver.newAPI(univer);--function registerBasicPlugins(univer: Univer) {- univer.registerPlugin(UniverDocsPlugin);- univer.registerPlugin(UniverFormulaEnginePlugin, {- notExecuteFormula: true,- });- univer.registerPlugin(UniverRenderEnginePlugin);- univer.registerPlugin(UniverUniUIPlugin, {- container: 'app',- });-- univer.registerPlugin(UniverDocsUIPlugin, {- override: [- [DocUIController, {- useFactory: (injector) => {- injector.createInstance(UniDocsUIController, {});- },- deps: [Injector],- }],- ],- });-- const worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });- univer.registerPlugin(UniverRPCMainThreadPlugin, { workerURL: worker });- univer.onDispose(() => worker.terminate());-- univer.registerPlugin(UniverThreadCommentUIPlugin);-- univer.registerPlugin(UniverDocsDrawingUIPlugin);-}--function registerSheetPlugins(univer: Univer) {- univer.registerPlugin(UniverSheetsPlugin);- univer.registerPlugin(UniverSheetsUIPlugin, {- override: [- [SheetUIController, {- useFactory: (injector) => {- injector.createInstance(UniSheetsUIController, {});- },- deps: [Injector],- }],- ],- });- univer.registerPlugin(UniverSheetsNumfmtPlugin);- univer.registerPlugin(UniverSheetsNumfmtUIPlugin);- univer.registerPlugin(UniverSheetsFormulaPlugin);- univer.registerPlugin(UniverSheetsFormulaUIPlugin);- univer.registerPlugin(UniverSheetsFindReplacePlugin);- univer.registerPlugin(UniverSheetsHyperLinkUIPlugin);- univer.registerPlugin(UniverSheetsSortUIPlugin);- univer.registerPlugin(UniverSheetsThreadCommentPlugin);- univer.registerPlugin(UniverSheetsConditionalFormattingUIPlugin);- univer.registerPlugin(UniverSheetsDrawingUIPlugin);-}--function registerSlidePlugins(univer: Univer) {- univer.registerPlugin(UniverSlidesPlugin);- univer.registerPlugin(UniverSlidesUIPlugin, {- override: [- [SlidesUIController, {- useClass: UniSlidesUIController,- }],- ],- });-}--function registerUniPlugins(univer: Univer) {- univer.registerPlugin(UniverDocUniFormulaPlugin);-}diff --git a/examples/src/uni/worker.ts b/examples/src/uni/worker.tsdeleted file mode 100644index a6fb7752e0..0000000000--- a/examples/src/uni/worker.ts+++ /dev/null@@ -1,31 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { LocaleType, Univer } from '@univerjs/core';-import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';-import { UniverRPCWorkerThreadPlugin } from '@univerjs/rpc';-import { UniverSheetsPlugin } from '@univerjs/sheets';--const univer = new Univer({- locale: LocaleType.ZH_CN,-});--univer.registerPlugin(UniverSheetsPlugin, { onlyRegisterFormulaRelatedMutations: true });-univer.registerPlugin(UniverFormulaEnginePlugin);-univer.registerPlugin(UniverRPCWorkerThreadPlugin);--declare let self: WorkerGlobalScope & typeof globalThis & { univer: Univer };-self.univer = univer;diff --git a/examples/tailwind.config.ts b/examples/tailwind.config.tsindex d167bd838e..648746fbad 100644--- a/examples/tailwind.config.ts+++ b/examples/tailwind.config.ts@@ -24,9 +24,8 @@ import animate from 'tailwindcss-animate';const __dirname = path.dirname(fileURLToPath(import.meta.url));const packagesDir = fs.readdirSync(path.resolve(__dirname, '../packages')).map((dir) => path.resolve(__dirname, `../packages/${dir}`));-const packagesExperimentalDir = fs.readdirSync(path.resolve(__dirname, '../packages-experimental')).map((dir) => path.resolve(__dirname, `../packages-experimental/${dir}`));-const tailwindProjects = packagesDir.concat(packagesExperimentalDir).reduce((acc, dir) => {+const tailwindProjects = packagesDir.reduce((acc, dir) => {const tailwindConfig = path.resolve(dir, 'tailwind.config.ts');if (fs.existsSync(tailwindConfig)) {acc.push(`${dir}/src/**/*.{js,ts,jsx,tsx}`);diff --git a/packages-experimental/README.md b/packages-experimental/README.mddeleted file mode 100644index 3b61bacaf8..0000000000--- a/packages-experimental/README.md+++ /dev/null@@ -1,4 +0,0 @@-# Experimental Packages--Experimental packages in development. These packages are not meant to be published to npm or used in production so set-`private` to `true` in package.json files.diff --git a/packages-experimental/uni-docs-ui/README.md b/packages-experimental/uni-docs-ui/README.mddeleted file mode 100644index 0a4b4bad90..0000000000--- a/packages-experimental/uni-docs-ui/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uni-docs-ui--[](https://npmjs.org/packages/@univerjs/uni-sheets-ui)-[](https://img.shields.io/npm/l/@univerjs/uni-sheets-ui)--## Introduction--This package provides a UI controller in replacement of the `@univerjs/docs-ui` package.--## Usage--### Installation--```shell-npm i @univerjs/uni-docs-ui-```diff --git a/packages-experimental/uni-docs-ui/package.json b/packages-experimental/uni-docs-ui/package.jsondeleted file mode 100644index b1ac3e59ed..0000000000--- a/packages-experimental/uni-docs-ui/package.json+++ /dev/null@@ -1,79 +0,0 @@-{- "name": "@univerjs/uni-docs-ui",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "peerDependencies": {- "rxjs": ">=7.0.0"- },- "dependencies": {- "@univerjs/core": "workspace:*",- "@univerjs/docs": "workspace:*",- "@univerjs/docs-drawing-ui": "workspace:*",- "@univerjs/docs-ui": "workspace:*",- "@univerjs/engine-render": "workspace:*",- "@univerjs/ui": "workspace:*",- "@univerjs/uniui": "workspace:*"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "postcss": "^8.5.6",- "rxjs": "^7.8.2",- "tailwindcss": "3.4.18",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uni-docs-ui/postcss.config.mjs b/packages-experimental/uni-docs-ui/postcss.config.mjsdeleted file mode 100644index 7d59f53133..0000000000--- a/packages-experimental/uni-docs-ui/postcss.config.mjs+++ /dev/null@@ -1 +0,0 @@-export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages-experimental/uni-docs-ui/src/controllers/menu.schema.ts b/packages-experimental/uni-docs-ui/src/controllers/menu.schema.tsdeleted file mode 100644index 5c221f3ac0..0000000000--- a/packages-experimental/uni-docs-ui/src/controllers/menu.schema.ts+++ /dev/null@@ -1,52 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { MenuSchemaType } from '@univerjs/ui';-import { DocsUIMenuSchema } from '@univerjs/docs-ui';-import { RibbonStartGroup } from '@univerjs/ui';-import { FONT_GROUP_MENU_ID, UNI_MENU_POSITIONS } from '@univerjs/uniui';-import {- DOC_BOLD_MUTATION_ID,- DOC_ITALIC_MUTATION_ID,- DOC_STRIKE_MUTATION_ID,- DOC_UNDERLINE_MUTATION_ID,- DocBoldMenuItemFactory,- DocItalicMenuItemFactory,- DocStrikeThroughMenuItemFactory,- DocUnderlineMenuItemFactory,-} from './menu';--export const menuSchema: MenuSchemaType = {- [UNI_MENU_POSITIONS.TOOLBAR_MAIN]: (DocsUIMenuSchema as any)[RibbonStartGroup.FORMAT],- [FONT_GROUP_MENU_ID]: {- [DOC_BOLD_MUTATION_ID]: {- order: 0,- menuItemFactory: DocBoldMenuItemFactory,- },- [DOC_ITALIC_MUTATION_ID]: {- order: 1,- menuItemFactory: DocItalicMenuItemFactory,- },- [DOC_UNDERLINE_MUTATION_ID]: {- order: 2,- menuItemFactory: DocUnderlineMenuItemFactory,- },- [DOC_STRIKE_MUTATION_ID]: {- order: 3,- menuItemFactory: DocStrikeThroughMenuItemFactory,- },- },-};diff --git a/packages-experimental/uni-docs-ui/src/controllers/menu.ts b/packages-experimental/uni-docs-ui/src/controllers/menu.tsdeleted file mode 100644index 68892d88ab..0000000000--- a/packages-experimental/uni-docs-ui/src/controllers/menu.ts+++ /dev/null@@ -1,272 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor } from '@univerjs/core';-import type { IMenuButtonItem, IMenuItem } from '@univerjs/ui';-import { BooleanNumber, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { DocSelectionManagerService, DocSkeletonManagerService, SetTextSelectionsOperation } from '@univerjs/docs';-import { SetInlineFormatCommand } from '@univerjs/docs-ui';-import { DocumentEditArea, IRenderManagerService } from '@univerjs/engine-render';-import { getHeaderFooterMenuHiddenObservable, getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';-import { combineLatest, Observable } from 'rxjs';--export const DOC_ITALIC_MUTATION_ID = 'doc.command.uni-italic';-export const DOC_BOLD_MUTATION_ID = 'doc.command.uni-bold';-export const DOC_UNDERLINE_MUTATION_ID = 'doc.command.uni-underline';-export const DOC_STRIKE_MUTATION_ID = 'doc.command.uni-strike';-export const DOC_TABLE_MUTATION_ID = 'doc.command.uni-table';--export function DocBoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);-- return {- id: DOC_BOLD_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'BoldIcon',- title: 'Set bold',- tooltip: 'toolbar.bold',- activated$: new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;-- if (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) {- const textRun = getFontStyleAtCursor(accessor);-- if (textRun == null) {- return;- }-- const bl = textRun.ts?.bl;-- subscriber.next(bl === BooleanNumber.TRUE);- }- });-- subscriber.next(false);-- return disposable.dispose;- }),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),- };-}--export function DocItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);-- return {- id: DOC_ITALIC_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'ItalicIcon',- title: 'Set italic',- tooltip: 'toolbar.italic',- activated$: new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;-- if (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) {- const textRun = getFontStyleAtCursor(accessor);-- if (textRun == null) {- return;- }-- const it = textRun.ts?.it;-- subscriber.next(it === BooleanNumber.TRUE);- }- });-- subscriber.next(false);-- return disposable.dispose;- }),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),- };-}--export function DocUnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);-- return {- id: DOC_UNDERLINE_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'UnderlineIcon',- title: 'Set underline',- tooltip: 'toolbar.underline',- activated$: new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;-- if (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) {- const textRun = getFontStyleAtCursor(accessor);-- if (textRun == null) {- return;- }-- const ul = textRun.ts?.ul;-- subscriber.next(ul?.s === BooleanNumber.TRUE);- }- });-- subscriber.next(false);-- return disposable.dispose;- }),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),- };-}--export function DocStrikeThroughMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);-- return {- id: DOC_STRIKE_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'StrikethroughIcon',- title: 'Set strike through',- tooltip: 'toolbar.strikethrough',- activated$: new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;-- if (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) {- const textRun = getFontStyleAtCursor(accessor);-- if (textRun == null) {- return;- }-- const st = textRun.ts?.st;-- subscriber.next(st?.s === BooleanNumber.TRUE);- }- });-- subscriber.next(false);-- return disposable.dispose;- }),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),- };-}--export function DocTableMenuFactory(accessor: IAccessor): IMenuItem {- return {- id: DOC_TABLE_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'GridIcon',- tooltip: 'toolbar.table.main',- disabled$: getTableDisabledObservable(accessor),- // Do not show header footer menu and insert table at zen mode.- hidden$: combineLatest(getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC), getInsertTableHiddenObservable(accessor), getHeaderFooterMenuHiddenObservable(accessor), (one, two, three) => {- return one || two || three;- }),- };-}--function getFontStyleAtCursor(accessor: IAccessor) {- const univerInstanceService = accessor.get(IUniverInstanceService);- const textSelectionService = accessor.get(DocSelectionManagerService);-- const editorDataModel = univerInstanceService.getUniverDocInstance(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);- const activeTextRange = textSelectionService.getActiveTextRange();-- if (editorDataModel == null || activeTextRange == null) return null;-- const textRuns = editorDataModel.getBody()?.textRuns;- if (textRuns == null) return;-- const { startOffset } = activeTextRange;- const textRun = textRuns.find(({ st, ed }) => startOffset! >= st && startOffset! <= ed);- return textRun;-}--function getTableDisabledObservable(accessor: IAccessor): Observable<boolean> {- const docSelectionManagerService = accessor.get(DocSelectionManagerService);-- return new Observable((subscriber) => {- const subscription = docSelectionManagerService.textSelection$.subscribe((selection) => {- if (selection == null) {- subscriber.next(true);- return;- }-- const { textRanges } = selection;-- if (textRanges.length !== 1) {- subscriber.next(true);- return;- }-- const textRange = textRanges[0];- const { collapsed, startNodePosition } = textRange;-- if (!collapsed) {- subscriber.next(true);- return;- }-- if (startNodePosition != null) {- const { path } = startNodePosition;-- // TODO: Not support insert table in table cell now.- if (path.indexOf('cells') !== -1) {- subscriber.next(true);- return;- }- }-- subscriber.next(false);- });-- return () => subscription.unsubscribe();- });-}--function getInsertTableHiddenObservable(- accessor: IAccessor-): Observable<boolean> {- const univerInstanceService = accessor.get(IUniverInstanceService);- const renderManagerService = accessor.get(IRenderManagerService);-- return new Observable((subscriber) => {- const subscription = univerInstanceService.focused$.subscribe((unitId) => {- if (unitId == null) {- return subscriber.next(true);- }- const univerType = univerInstanceService.getUnitType(unitId);-- if (univerType !== UniverInstanceType.UNIVER_DOC) {- return subscriber.next(true);- }-- const currentRender = renderManagerService.getRenderById(unitId);- if (currentRender == null) {- return subscriber.next(true);- }-- const viewModel = currentRender.with(DocSkeletonManagerService).getViewModel();-- viewModel.editAreaChange$.subscribe((editArea) => {- subscriber.next(editArea === DocumentEditArea.HEADER || editArea === DocumentEditArea.FOOTER);- });- });-- return () => subscription.unsubscribe();- });-}diff --git a/packages-experimental/uni-docs-ui/src/controllers/uni-docs-ui.controller.ts b/packages-experimental/uni-docs-ui/src/controllers/uni-docs-ui.controller.tsdeleted file mode 100644index d807efe0d4..0000000000--- a/packages-experimental/uni-docs-ui/src/controllers/uni-docs-ui.controller.ts+++ /dev/null@@ -1,95 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { ICommandService, IConfigService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { DOCS_IMAGE_MENU_ID } from '@univerjs/docs-drawing-ui';-import {- BulletListCommand,- DocCreateTableOperation,- DocUIController,- OrderListCommand,- SetInlineFormatBoldCommand,- SetInlineFormatFontFamilyCommand,- SetInlineFormatFontSizeCommand,- SetInlineFormatItalicCommand,- SetInlineFormatStrikethroughCommand,- SetInlineFormatTextBackgroundColorCommand,- SetInlineFormatTextColorCommand,- SetInlineFormatUnderlineCommand,-} from '@univerjs/docs-ui';-import { ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';-import { BuiltinUniToolbarItemId, generateCloneMutation, UniToolbarService } from '@univerjs/uniui';-import { DOC_BOLD_MUTATION_ID, DOC_ITALIC_MUTATION_ID, DOC_STRIKE_MUTATION_ID, DOC_TABLE_MUTATION_ID, DOC_UNDERLINE_MUTATION_ID } from './menu';-import { menuSchema } from './menu.schema';--export class UniDocsUIController extends DocUIController {- constructor(- @Inject(Injector) injector: Injector,- @Inject(ComponentManager) componentManager: ComponentManager,- @ICommandService commandService: ICommandService,- @ILayoutService layoutService: ILayoutService,- @IMenuManagerService menuManagerService: IMenuManagerService,- @IUIPartsService uiPartsService: IUIPartsService,- @IUniverInstanceService univerInstanceService: IUniverInstanceService,- @IShortcutService shortcutService: IShortcutService,- @IConfigService configService: IConfigService,- @Inject(UniToolbarService) private readonly _toolbarService: UniToolbarService- ) {- super(- injector,- componentManager,- commandService,- layoutService,- menuManagerService,- uiPartsService,- univerInstanceService,- shortcutService,- configService- );-- this._initUniMenus();- this._initMutations();- }-- private _initUniMenus(): void {- this._menuManagerService.appendRootMenu(menuSchema);-- ([- [BuiltinUniToolbarItemId.FONT_FAMILY, SetInlineFormatFontFamilyCommand.id],- [BuiltinUniToolbarItemId.FONT_SIZE, SetInlineFormatFontSizeCommand.id],- [BuiltinUniToolbarItemId.COLOR, SetInlineFormatTextColorCommand.id],- [BuiltinUniToolbarItemId.BACKGROUND, SetInlineFormatTextBackgroundColorCommand.id],- [BuiltinUniToolbarItemId.IMAGE, DOCS_IMAGE_MENU_ID],- [BuiltinUniToolbarItemId.TABLE, DOC_TABLE_MUTATION_ID],- [BuiltinUniToolbarItemId.ORDER_LIST, OrderListCommand.id],- [BuiltinUniToolbarItemId.UNORDER_LIST, BulletListCommand.id],- ]).forEach(([id, menuId]) => {- this.disposeWithMe(this._toolbarService.implementItem(id, { id: menuId, type: UniverInstanceType.UNIVER_DOC }));- });- }-- private _initMutations() {- [- generateCloneMutation(DOC_BOLD_MUTATION_ID, SetInlineFormatBoldCommand),- generateCloneMutation(DOC_ITALIC_MUTATION_ID, SetInlineFormatItalicCommand),- generateCloneMutation(DOC_UNDERLINE_MUTATION_ID, SetInlineFormatUnderlineCommand),- generateCloneMutation(DOC_STRIKE_MUTATION_ID, SetInlineFormatStrikethroughCommand),- generateCloneMutation(DOC_TABLE_MUTATION_ID, DocCreateTableOperation),- ].forEach((mutation) => {- this.disposeWithMe(this._commandService.registerCommand(mutation));- });- }-}diff --git a/packages-experimental/uni-docs-ui/src/index.ts b/packages-experimental/uni-docs-ui/src/index.tsdeleted file mode 100644index 67f5352c2e..0000000000--- a/packages-experimental/uni-docs-ui/src/index.ts+++ /dev/null@@ -1,17 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export { UniDocsUIController } from './controllers/uni-docs-ui.controller';diff --git a/packages-experimental/uni-docs-ui/src/vite-env.d.ts b/packages-experimental/uni-docs-ui/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uni-docs-ui/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uni-docs-ui/tailwind.config.ts b/packages-experimental/uni-docs-ui/tailwind.config.tsdeleted file mode 100644index 75967f186f..0000000000--- a/packages-experimental/uni-docs-ui/tailwind.config.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Config } from 'tailwindcss';-import preset from '@univerjs-infra/shared/tailwind';--const config: Config = {- presets: [preset],- content: [- './src/**/*.{js,ts,jsx,tsx}',- ],-};--export default config;diff --git a/packages-experimental/uni-docs-ui/tsconfig.json b/packages-experimental/uni-docs-ui/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uni-docs-ui/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uni-docs-ui/tsconfig.node.json b/packages-experimental/uni-docs-ui/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uni-docs-ui/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uni-docs-ui/vitest.config.ts b/packages-experimental/uni-docs-ui/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uni-docs-ui/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/packages-experimental/uni-formula-ui/README.md b/packages-experimental/uni-formula-ui/README.mddeleted file mode 100644index 953e36f3d2..0000000000--- a/packages-experimental/uni-formula-ui/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uni-formula-ui--[](https://npmjs.org/packages/@univerjs/uni-formula-ui)-[](https://img.shields.io/npm/l/@univerjs/uni-formula-ui)--## Introduction--> TODO: Introduction--## Usage--### Installation--```shell-npm i @univerjs/uni-formula-ui-```diff --git a/packages-experimental/uni-formula-ui/package.json b/packages-experimental/uni-formula-ui/package.jsondeleted file mode 100644index 4f117a9363..0000000000--- a/packages-experimental/uni-formula-ui/package.json+++ /dev/null@@ -1,92 +0,0 @@-{- "name": "@univerjs/uni-formula-ui",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*",- "./locale/*": "./src/locale/*.ts"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./locale/*": {- "import": "./lib/es/locale/*.js",- "require": "./lib/cjs/locale/*.js",- "types": "./lib/types/locale/*.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "peerDependencies": {- "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",- "rxjs": ">=7.0.0"- },- "dependencies": {- "@univerjs/core": "workspace:*",- "@univerjs/design": "workspace:*",- "@univerjs/docs": "workspace:*",- "@univerjs/docs-ui": "workspace:*",- "@univerjs/engine-formula": "workspace:*",- "@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^1.1.0",- "@univerjs/rpc": "workspace:*",- "@univerjs/sheets-formula-ui": "workspace:*",- "@univerjs/slides-ui": "workspace:*",- "@univerjs/ui": "workspace:*",- "@univerjs/uni-formula": "workspace:*"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "postcss": "^8.5.6",- "react": "18.3.1",- "rxjs": "^7.8.2",- "tailwindcss": "3.4.18",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uni-formula-ui/postcss.config.mjs b/packages-experimental/uni-formula-ui/postcss.config.mjsdeleted file mode 100644index 7d59f53133..0000000000--- a/packages-experimental/uni-formula-ui/postcss.config.mjs+++ /dev/null@@ -1 +0,0 @@-export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages-experimental/uni-formula-ui/src/commands/commands/doc.command.ts b/packages-experimental/uni-formula-ui/src/commands/commands/doc.command.tsdeleted file mode 100644index c4b8960672..0000000000--- a/packages-experimental/uni-formula-ui/src/commands/commands/doc.command.ts+++ /dev/null@@ -1,102 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICommand, IDocumentBody, IMutationInfo } from '@univerjs/core';-import type { IAddDocUniFormulaMutationParams, IRemoveDocUniFormulaMutationParams, IUpdateDocUniFormulaMutationParams } from '@univerjs/uni-formula';-import { BuildTextUtils, CommandType, CustomRangeType, generateRandomId, ICommandService, LocaleService, makeCustomRangeStream, sequenceExecute } from '@univerjs/core';-import { replaceSelectionFactory } from '@univerjs/docs';-import { AddDocUniFormulaMutation, RemoveDocUniFormulaMutation, UpdateDocUniFormulaMutation } from '@univerjs/uni-formula';--export interface IAddDocUniFormulaCommandParams {- unitId: string;- startIndex: number;-- f: string;-}--export const AddDocUniFormulaCommand: ICommand<IAddDocUniFormulaCommandParams> = {- type: CommandType.COMMAND,- id: 'doc.command.add-uni-formula',- async handler(accessor, params: IAddDocUniFormulaCommandParams) {- const { f, unitId, startIndex } = params;-- const commandService = accessor.get(ICommandService);- const localeService = accessor.get(LocaleService);-- const rangeId = generateRandomId();- const placeholder = localeService.t('uni-formula.command.stream-placeholder');- const dataStream = makeCustomRangeStream(placeholder);- const body: IDocumentBody = {- dataStream,- customRanges: [{- startIndex: 0,- endIndex: dataStream.length - 1,- rangeId,- rangeType: CustomRangeType.UNI_FORMULA,- wholeEntity: true,- }],- };-- const insertCustomRangeMutation = replaceSelectionFactory(accessor, {- unitId,- body,- selection: BuildTextUtils.selection.makeSelection(startIndex, startIndex + 1),- });-- if (insertCustomRangeMutation) {- const addFormulaResourceMutation: IMutationInfo<IAddDocUniFormulaMutationParams> = {- id: AddDocUniFormulaMutation.id,- params: { unitId, rangeId, f },- };-- return sequenceExecute([insertCustomRangeMutation, addFormulaResourceMutation], commandService).result;- }-- return false;- },-};--export interface IUpdateDocUniFormulaCommandParams {- unitId: string;- rangeId: string;- f: string;-}--// TODO: implement update & remove command--export const UpdateDocUniFormulaCommand: ICommand<IUpdateDocUniFormulaCommandParams> = {- type: CommandType.COMMAND,- id: 'doc.command.update-uni-formula',- handler: (accessor, params: IUpdateDocUniFormulaCommandParams) => {- const commandService = accessor.get(ICommandService);- return commandService.syncExecuteCommand(UpdateDocUniFormulaMutation.id, params as IUpdateDocUniFormulaMutationParams);- },-};--export interface IRemoveDocUniFormulaCommandParams {- unitId: string;- rangeId: string;-}--export const RemoveDocUniFormulaCommand: ICommand<IRemoveDocUniFormulaCommandParams> = {- type: CommandType.COMMAND,- id: 'doc.command.remove-uni-formula',- handler: (accessor, params: IRemoveDocUniFormulaCommandParams) => {- const commandService = accessor.get(ICommandService);- // TODO: maybe remove formula under selection?- return commandService.syncExecuteCommand(RemoveDocUniFormulaMutation.id, params as IRemoveDocUniFormulaMutationParams);- },-};diff --git a/packages-experimental/uni-formula-ui/src/commands/commands/slide.command.ts b/packages-experimental/uni-formula-ui/src/commands/commands/slide.command.tsdeleted file mode 100644index d3176b0ccc..0000000000--- a/packages-experimental/uni-formula-ui/src/commands/commands/slide.command.ts+++ /dev/null@@ -1,75 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICommand, IDocumentBody } from '@univerjs/core';-import { BuildTextUtils, CommandType, CustomRangeType, generateRandomId, ICommandService, LocaleService, makeCustomRangeStream } from '@univerjs/core';-import { replaceSelectionFactory } from '@univerjs/docs';-import { SLIDE_EDITOR_ID } from '@univerjs/slides-ui';-import { SlideUIFormulaCacheService } from '../../services/slide-ui-formula-cache.service';--export interface IAddSlideUniFormulaCommandParams {- unitId: string;- pageId: string;- elementId: string;- startIndex: number;-- f: string;-}--export const AddSlideUniFormulaCommand: ICommand<IAddSlideUniFormulaCommandParams> = {- type: CommandType.COMMAND,- id: 'slide.command.add-slide-uni-formula',- async handler(accessor, params: IAddSlideUniFormulaCommandParams) {- const { startIndex } = params;-- const commandService = accessor.get(ICommandService);- const slideUiFormulaCacheService = accessor.get(SlideUIFormulaCacheService);- const localeService = accessor.get(LocaleService);- const placeholder = localeService.t('uni-formula.command.stream-placeholder');-- // TODO: use placeholder here?- const rangeId = generateRandomId();- const dataStream = makeCustomRangeStream(placeholder);- const body: IDocumentBody = {- dataStream,- customRanges: [{- startIndex: 0,- endIndex: dataStream.length - 1,- rangeId,- rangeType: CustomRangeType.UNI_FORMULA,- wholeEntity: true,- }],- };-- const insertCustomRangeMutation = replaceSelectionFactory(accessor, {- unitId: SLIDE_EDITOR_ID,- body,- selection: BuildTextUtils.selection.makeSelection(startIndex, startIndex + 1),- });-- // NOTE: For slides, the process to update a element's content is pretty different from docs.- // Since the text editor in slides is temporary, we don't need to update the content of the element when user- // has not confirmed the change. So we don't need to add a mutation to update resources here.- // We will do that when user confirms the change.-- if (insertCustomRangeMutation) {- slideUiFormulaCacheService.writeCache(rangeId, params);- return commandService.executeCommand(insertCustomRangeMutation.id, insertCustomRangeMutation.params, { onlyLocal: true });- }-- return false;- },-};diff --git a/packages-experimental/uni-formula-ui/src/commands/operations/operation.ts b/packages-experimental/uni-formula-ui/src/commands/operations/operation.tsdeleted file mode 100644index 4cb6439c0d..0000000000--- a/packages-experimental/uni-formula-ui/src/commands/operations/operation.ts+++ /dev/null@@ -1,78 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICommand, IOperation } from '@univerjs/core';-import { CommandType } from '@univerjs/core';-import { UniFormulaPopupService } from '../../services/formula-popup.service';--export interface IDocPopupPosition {- rangeId?: string;-}--export interface ISlidePopupPosition extends IDocPopupPosition {- pageId: string;- elementId: string;-}--export type IPopupPosition = IDocPopupPosition | ISlidePopupPosition;--export function isSlidePosition(position?: IPopupPosition): position is ISlidePopupPosition {- return !!position && 'pageId' in position;-}--export interface IShowDocFormulaPopupOperationParams {- unitId: string;- startIndex: number;- type?: 'new' | 'existing';- position: IDocPopupPosition;-}--export interface IShowSlideFormulaPopupOPerationParams extends IShowDocFormulaPopupOperationParams {- position: ISlidePopupPosition;-}--export type IShowFormulaPopupOperationParams = IShowDocFormulaPopupOperationParams | IShowSlideFormulaPopupOPerationParams;--export const ShowFormulaPopupOperation: IOperation<IShowFormulaPopupOperationParams> = {- id: 'uni-formula.operation.show-formula-popup',- type: CommandType.OPERATION,- handler(accessor, params: IShowFormulaPopupOperationParams) {- const { type = 'new', startIndex, unitId, position } = params;- const { rangeId } = position;- const formulaPopupService = accessor.get(UniFormulaPopupService);-- if (type === 'existing' && !rangeId) return false;- return formulaPopupService.showDocPopup(unitId, startIndex, type, position);- },-};--export const CloseFormulaPopupOperation: IOperation = {- id: 'uni-formula.operation.close-formula-popup',- type: CommandType.OPERATION,- handler(accessor) {- const docFormulaPopupService = accessor.get(UniFormulaPopupService);- return docFormulaPopupService.closePopup(true);- },-};--export const ConfirmFormulaPopupCommand: ICommand = {- id: 'uni-formula.operation.confirm-formula-popup',- type: CommandType.COMMAND,- handler(accessor) {- const docFormulaPopupService = accessor.get(UniFormulaPopupService);- return docFormulaPopupService.confirmPopup();- },-};diff --git a/packages-experimental/uni-formula-ui/src/const.ts b/packages-experimental/uni-formula-ui/src/const.tsdeleted file mode 100644index a1125577fa..0000000000--- a/packages-experimental/uni-formula-ui/src/const.ts+++ /dev/null@@ -1,17 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export const DOC_FORMULA_UI_PLUGIN_NAME = 'DOC_FORMULA_UI_PLUGIN';diff --git a/packages-experimental/uni-formula-ui/src/controllers/doc-formula-input.controller.ts b/packages-experimental/uni-formula-ui/src/controllers/doc-formula-input.controller.tsdeleted file mode 100644index c02e742ed9..0000000000--- a/packages-experimental/uni-formula-ui/src/controllers/doc-formula-input.controller.ts+++ /dev/null@@ -1,188 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { DocumentDataModel } from '@univerjs/core';-import type { IInsertCommandParams } from '@univerjs/docs-ui';-import type { IShowFormulaPopupOperationParams } from '../commands/operations/operation';-import { CustomRangeType, Disposable, ICommandService, ILogService, Inject, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { DocSelectionManagerService } from '@univerjs/docs';--import { DeleteLeftCommand, DocEventManagerService, IEditorService, InsertCommand, MoveCursorOperation } from '@univerjs/docs-ui';-import { IRenderManagerService } from '@univerjs/engine-render';-import { filter, map, switchMap } from 'rxjs';-import { AddDocUniFormulaCommand, RemoveDocUniFormulaCommand, UpdateDocUniFormulaCommand } from '../commands/commands/doc.command';-import { CloseFormulaPopupOperation, ShowFormulaPopupOperation } from '../commands/operations/operation';-import { UniFormulaPopupService } from '../services/formula-popup.service';-import { UNI_FORMULA_EDITOR_ID } from '../views/components/DocFormulaPopup';--const FORMULA_INPUT_TRIGGER_CHAR = '=';--export class DocUniFormulaInputController extends Disposable {- constructor(- @ICommandService private readonly _commandService: ICommandService,- @IUniverInstanceService private readonly _instanceSrv: IUniverInstanceService,- @IEditorService private readonly _editorService: IEditorService,- @ILogService private readonly _logService: ILogService,- @Inject(UniFormulaPopupService) private readonly _formulaPopupSrv: UniFormulaPopupService,- @IRenderManagerService private readonly _renderManagerService: IRenderManagerService,- @Inject(DocSelectionManagerService) private readonly _textSelectionManagerService: DocSelectionManagerService- ) {- super();-- this._initKeyboardListeners();- this._initCommands();- this._initHoverListener();- }-- private _initCommands(): void {- [- AddDocUniFormulaCommand,- RemoveDocUniFormulaCommand,- UpdateDocUniFormulaCommand,- ].forEach((command) => this._commandService.registerCommand(command));- }-- private _initKeyboardListeners(): void {- // TODO@wzhudev: only need to listen when a doc unit is focused.- // The formula input trigger works not exactly the same as Mention.- this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {- const currentEditor = this._editorService.getFocusEditor();- const focusedUnit = this._instanceSrv.getFocusedUnit();-- const { id } = commandInfo;-- if (- currentEditor?.getEditorId() === UNI_FORMULA_EDITOR_ID ||- focusedUnit?.type !== UniverInstanceType.UNIVER_DOC- ) {- return;- }-- if (id === InsertCommand.id) {- const params = commandInfo.params as IInsertCommandParams;- const activeRange = this._textSelectionManagerService.getActiveTextRange();- if (params.body.dataStream === FORMULA_INPUT_TRIGGER_CHAR && activeRange) {- this._showPopup({- startIndex: activeRange.startOffset! - 1,- unitId: focusedUnit.getUnitId(),- position: {},- });- } else if (this._formulaPopupSrv.popupInfo) {- this._closePopup();- }- }-- if (id === MoveCursorOperation.id || id === DeleteLeftCommand.id) {- this._closePopup();- }- }));- }-- private _initHoverListener(): void {- const rangesWithDoc$ = this._instanceSrv.focused$.pipe(- map((focused) => focused ? this._instanceSrv.getUnit<DocumentDataModel>(focused, UniverInstanceType.UNIVER_DOC) : null),- map((doc) => doc && { doc, docEventManagerService: this._renderManagerService.getRenderById(doc!.getUnitId())?.with(DocEventManagerService) }),- filter((info) => !!info),- switchMap((info) => info.docEventManagerService!.hoverCustomRanges$.pipe(map((ranges) => ({ doc: info.doc, ranges }))))- );-- this.disposeWithMe(rangesWithDoc$.subscribe(({ doc, ranges: customRanges }) => {- if (- !doc ||- this._formulaPopupSrv.popupInfo?.type === 'new' ||- this._formulaPopupSrv.popupLocked- ) {- return;- }-- const formulaCustomRange = customRanges.find((range) => range.range.rangeType === CustomRangeType.UNI_FORMULA)?.range;- if (formulaCustomRange) {- const { startIndex, rangeId } = formulaCustomRange;- this._logService.debug('[DocUniFormulaController]: activeCustomRanges', customRanges);- this._showPopup({- startIndex,- unitId: doc.getUnitId(),- position: { rangeId },- type: 'existing',- });- } else {- if (!this._hovered) {- this._closePopup(500);- }- }- }));- this.disposeWithMe(rangesWithDoc$.subscribe(({ doc, ranges: customRanges }) => {- if (- !doc ||- this._formulaPopupSrv.popupInfo?.type === 'new' ||- this._formulaPopupSrv.popupLocked- ) {- return;- }-- const formulaCustomRange = customRanges.find((range) => range.range.rangeType === CustomRangeType.UNI_FORMULA)?.range;- if (formulaCustomRange) {- const { startIndex, rangeId } = formulaCustomRange;- this._logService.debug('[DocUniFormulaController]: activeCustomRanges', customRanges);- this._showPopup({- startIndex,- unitId: doc.getUnitId(),- position: { rangeId },- type: 'existing',- });- } else {- if (!this._hovered) {- this._closePopup(500);- }- }- }));-- this.disposeWithMe(this._formulaPopupSrv.popupHovered$.subscribe((hovered) => {- if (hovered) {- this._removeTimer();- }-- this._hovered = hovered;- }));- }-- private _hovered = false;-- private _removeTimer(): void {- if (this._closePopupTimer !== null) {- window.clearTimeout(this._closePopupTimer);- this._closePopupTimer = null;- }- }-- private _showPopup(params: IShowFormulaPopupOperationParams): void {- this._removeTimer();- this._commandService.executeCommand(ShowFormulaPopupOperation.id, params);- }-- private _closePopupTimer: number | null = null;- private _closePopup(timeout: number = 0): void {- if (!this._formulaPopupSrv.popupInfo) {- return;- }-- if (timeout === 0) {- this._commandService.executeCommand(CloseFormulaPopupOperation.id);- } else {- this._closePopupTimer = window.setTimeout(() => this._closePopup(0), timeout);- }- }-}diff --git a/packages-experimental/uni-formula-ui/src/controllers/slide-formula-input.controller.ts b/packages-experimental/uni-formula-ui/src/controllers/slide-formula-input.controller.tsdeleted file mode 100644index b7b7bd0df5..0000000000--- a/packages-experimental/uni-formula-ui/src/controllers/slide-formula-input.controller.ts+++ /dev/null@@ -1,114 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IInsertCommandParams } from '@univerjs/docs-ui';-import type { IShowFormulaPopupOperationParams, ISlidePopupPosition } from '../commands/operations/operation';-import { Disposable, ICommandService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { DocSelectionManagerService } from '@univerjs/docs';-import { IEditorService, InsertCommand } from '@univerjs/docs-ui';-import { ISlideEditorBridgeService } from '@univerjs/slides-ui';-import { AddSlideUniFormulaCommand } from '../commands/commands/slide.command';-import { CloseFormulaPopupOperation, ShowFormulaPopupOperation } from '../commands/operations/operation';-import { UniFormulaPopupService } from '../services/formula-popup.service';-import { UNI_FORMULA_EDITOR_ID } from '../views/components/DocFormulaPopup';--const FORMULA_INPUT_TRIGGER_CHAR = '=';--export class SlideUniFormulaInputController extends Disposable {- constructor(- @Inject(Injector) private readonly _injector: Injector,- @IUniverInstanceService private readonly _instanceSrv: IUniverInstanceService,- @ICommandService private readonly _commandSrv: ICommandService,- @IEditorService private readonly _editorSrv: IEditorService,- @Inject(DocSelectionManagerService) private readonly _textSelectionManagerService: DocSelectionManagerService,- @Inject(UniFormulaPopupService) private readonly _formulaPopupSrv: UniFormulaPopupService- ) {- super();-- this._initCommands();- this._initKeyboardListeners();- }-- private _initCommands() {- [- AddSlideUniFormulaCommand,- ].forEach((cmd) => this._commandSrv.registerCommand(cmd));- }-- private _initKeyboardListeners(): void {- this.disposeWithMe(this._commandSrv.onCommandExecuted((commandInfo) => {- const currentEditor = this._editorSrv.getFocusEditor();- const focusedUnit = this._instanceSrv.getFocusedUnit();-- const { id } = commandInfo;-- if (- currentEditor?.getEditorId() === UNI_FORMULA_EDITOR_ID ||- focusedUnit?.type !== UniverInstanceType.UNIVER_SLIDE- ) {- return;- }-- if (id === InsertCommand.id) {- const params = commandInfo.params as IInsertCommandParams;- const activeRange = this._textSelectionManagerService.getActiveTextRange();- if (params.body.dataStream === FORMULA_INPUT_TRIGGER_CHAR && activeRange) {- // NOTE: we can avoid manually get the SlideEditorBridgeService when we split- // slide formula editor plugin into a separate package.- const editorBridgeService = this._injector.get(ISlideEditorBridgeService);- const editorRect = editorBridgeService.getEditorRect();- const { pageId, richTextObj } = editorRect;- const { oKey } = richTextObj;- this._showPopup({- startIndex: activeRange.startOffset! - 1,- unitId: focusedUnit.getUnitId(),- position: {- pageId,- elementId: oKey,- } as ISlidePopupPosition,- });- } else if (this._formulaPopupSrv.popupInfo) {- this._closePopup();- }- }- }));- }-- private _removeTimer(): void {- if (this._closePopupTimer !== null) {- window.clearTimeout(this._closePopupTimer);- this._closePopupTimer = null;- }- }-- private _showPopup(params: IShowFormulaPopupOperationParams): void {- this._removeTimer();- this._commandSrv.executeCommand(ShowFormulaPopupOperation.id, params);- }-- private _closePopupTimer: number | null = null;- private _closePopup(timeout: number = 0): void {- if (!this._formulaPopupSrv.popupInfo) {- return;- }-- if (timeout === 0) {- this._commandSrv.executeCommand(CloseFormulaPopupOperation.id);- } else {- this._closePopupTimer = window.setTimeout(() => this._closePopup(0), timeout);- }- }-}diff --git a/packages-experimental/uni-formula-ui/src/controllers/uni-formula-ui.controller.ts b/packages-experimental/uni-formula-ui/src/controllers/uni-formula-ui.controller.tsdeleted file mode 100644index e4f940df50..0000000000--- a/packages-experimental/uni-formula-ui/src/controllers/uni-formula-ui.controller.ts+++ /dev/null@@ -1,37 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { Disposable, ICommandService, Inject } from '@univerjs/core';-import { ComponentManager } from '@univerjs/ui';-import { CloseFormulaPopupOperation, ConfirmFormulaPopupCommand, ShowFormulaPopupOperation } from '../commands/operations/operation';-import { UniFormulaPopup } from '../views/components/DocFormulaPopup';--export class UniFormulaUniController extends Disposable {- constructor(- @ICommandService private readonly _commandSrv: ICommandService,- @Inject(ComponentManager) private readonly _componentManager: ComponentManager- ) {- super();-- [- ShowFormulaPopupOperation,- CloseFormulaPopupOperation,- ConfirmFormulaPopupCommand,- ].forEach((command) => this._commandSrv.registerCommand(command));-- this.disposeWithMe(this._componentManager.register(UniFormulaPopup.componentKey, UniFormulaPopup));- }-}diff --git a/packages-experimental/uni-formula-ui/src/global.css b/packages-experimental/uni-formula-ui/src/global.cssdeleted file mode 100644index 7c05d4ddc4..0000000000--- a/packages-experimental/uni-formula-ui/src/global.css+++ /dev/null@@ -1,2 +0,0 @@-@tailwind components;-@tailwind utilities;diff --git a/packages-experimental/uni-formula-ui/src/index.ts b/packages-experimental/uni-formula-ui/src/index.tsdeleted file mode 100644index bdde3d6a5f..0000000000--- a/packages-experimental/uni-formula-ui/src/index.ts+++ /dev/null@@ -1,20 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import './global.css';--export { UniverDocUniFormulaUIPlugin } from './plugin';-export { UniFormulaService } from './services/uni-formula.service';diff --git a/packages-experimental/uni-formula-ui/src/locale/ca-ES.ts b/packages-experimental/uni-formula-ui/src/locale/ca-ES.tsdeleted file mode 100644index 8afd24641a..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/ca-ES.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Crear nova fórmula',- existing: 'Edita la fórmula',- },- placeholder: 'Fes clic aquí per inserir una fórmula o continua escrivint per tancar...',- button: {- confirm: 'Confirma',- cancel: 'Cancel·la',- },- },- command: {- 'stream-placeholder': 'Fórmula Uni',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/en-US.ts b/packages-experimental/uni-formula-ui/src/locale/en-US.tsdeleted file mode 100644index 5609285675..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/en-US.ts+++ /dev/null@@ -1,36 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--const locale = {- 'uni-formula': {- popup: {- title: {- new: 'Create new formula',- existing: 'Edit formula',- },- placeholder: 'Click here to insert formula or continue typing to close...',- button: {- confirm: 'Confirm',- cancel: 'Cancel',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/es-ES.ts b/packages-experimental/uni-formula-ui/src/locale/es-ES.tsdeleted file mode 100644index a9492fbe4e..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/es-ES.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Crear nueva fórmula',- existing: 'Editar fórmula',- },- placeholder: 'Haz clic aquí para insertar una fórmula o continúa escribiendo para cerrar...',- button: {- confirm: 'Confirmar',- cancel: 'Cancelar',- },- },- command: {- 'stream-placeholder': 'Fórmula Uni',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/fa-IR.ts b/packages-experimental/uni-formula-ui/src/locale/fa-IR.tsdeleted file mode 100644index 60e6fa98ad..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/fa-IR.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'ایجاد فرمول جدید',- existing: 'ویرایش فرمول',- },- placeholder: 'برای درج فرمول اینجا کلیک کنید یا برای ادامه تایپ کردن بسته شود...',- button: {- confirm: 'تایید',- cancel: 'انصراف',- },- },- command: {- 'stream-placeholder': 'فرمول Uni',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/fr-FR.ts b/packages-experimental/uni-formula-ui/src/locale/fr-FR.tsdeleted file mode 100644index 87f9fab2db..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/fr-FR.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Créer une nouvelle formule',- existing: 'Modifier la formule',- },- placeholder: 'Cliquez ici pour insérer une formule ou continuez à taper pour fermer...',- button: {- confirm: 'Confirmer',- cancel: 'Annuler',- },- },- command: {- 'stream-placeholder': 'Formule Uni',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/ja-JP.ts b/packages-experimental/uni-formula-ui/src/locale/ja-JP.tsdeleted file mode 100644index bd1096dd55..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/ja-JP.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: '新しい数式を作成',- existing: '数式を編集',- },- placeholder: '数式を挿入するか、入力を続けて閉じます...',- button: {- confirm: '確定',- cancel: 'キャンセル',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/ko-KR.ts b/packages-experimental/uni-formula-ui/src/locale/ko-KR.tsdeleted file mode 100644index 40e7d2f324..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/ko-KR.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: '새 수식 생성',- existing: '수식 편집',- },- placeholder: '수식을 삽입하거나 계속 입력하여 닫습니다...',- button: {- confirm: '확인',- cancel: '취소',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/ru-RU.ts b/packages-experimental/uni-formula-ui/src/locale/ru-RU.tsdeleted file mode 100644index 9ff3b4452f..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/ru-RU.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Create new formula',- existing: 'Edit formula',- },- placeholder: 'Click here to insert formula or continue typing to close...',- button: {- confirm: 'Confirm',- cancel: 'Cancel',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/vi-VN.ts b/packages-experimental/uni-formula-ui/src/locale/vi-VN.tsdeleted file mode 100644index 9ff3b4452f..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/vi-VN.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Create new formula',- existing: 'Edit formula',- },- placeholder: 'Click here to insert formula or continue typing to close...',- button: {- confirm: 'Confirm',- cancel: 'Cancel',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/zh-CN.ts b/packages-experimental/uni-formula-ui/src/locale/zh-CN.tsdeleted file mode 100644index 8e7a9ab1c0..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/zh-CN.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: '添加公式',- existing: '编辑公式',- },- placeholder: '点击此处添加公式,或继续输入以关闭',- button: {- confirm: '确认',- cancel: '取消',- },- },- command: {- 'stream-placeholder': '无界公式',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/locale/zh-TW.ts b/packages-experimental/uni-formula-ui/src/locale/zh-TW.tsdeleted file mode 100644index 9ff3b4452f..0000000000--- a/packages-experimental/uni-formula-ui/src/locale/zh-TW.ts+++ /dev/null@@ -1,38 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type enUS from './en-US';--const locale: typeof enUS = {- 'uni-formula': {- popup: {- title: {- new: 'Create new formula',- existing: 'Edit formula',- },- placeholder: 'Click here to insert formula or continue typing to close...',- button: {- confirm: 'Confirm',- cancel: 'Cancel',- },- },- command: {- 'stream-placeholder': 'Uni Formula',- },- },-};--export default locale;diff --git a/packages-experimental/uni-formula-ui/src/plugin.ts b/packages-experimental/uni-formula-ui/src/plugin.tsdeleted file mode 100644index 919728b9df..0000000000--- a/packages-experimental/uni-formula-ui/src/plugin.ts+++ /dev/null@@ -1,65 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Dependency } from '@univerjs/core';-import { DependentOn, Inject, Injector, Plugin, touchDependencies, UniverInstanceType } from '@univerjs/core';--import { IUniFormulaService, UniverDocUniFormulaPlugin } from '@univerjs/uni-formula';-import { DOC_FORMULA_UI_PLUGIN_NAME } from './const';-import { DocUniFormulaInputController } from './controllers/doc-formula-input.controller';-import { SlideUniFormulaInputController } from './controllers/slide-formula-input.controller';-import { UniFormulaUniController } from './controllers/uni-formula-ui.controller';-import { UniFormulaPopupService } from './services/formula-popup.service';-import { SlideUIFormulaCacheService } from './services/slide-ui-formula-cache.service';-import { UniFormulaService } from './services/uni-formula.service';--@DependentOn(UniverDocUniFormulaPlugin)-export class UniverDocUniFormulaUIPlugin extends Plugin {- static override pluginName: string = DOC_FORMULA_UI_PLUGIN_NAME;- static override type: UniverInstanceType = UniverInstanceType.UNIVER_UNKNOWN;-- constructor(- _config: unknown,- @Inject(Injector) protected readonly _injector: Injector- ) {- super();- }-- override onStarting() {- ([- [UniFormulaUniController],- [DocUniFormulaInputController],- [SlideUniFormulaInputController],- [SlideUIFormulaCacheService],- [UniFormulaPopupService],- [IUniFormulaService, { useClass: UniFormulaService }],- ] as Dependency[]).forEach((d) => this._injector.add(d));- }-- override onReady(): void {- touchDependencies(this._injector, [- [IUniFormulaService],- ]);- }-- override onSteady(): void {- touchDependencies(this._injector, [- [UniFormulaUniController],- [DocUniFormulaInputController],- [SlideUniFormulaInputController],- ]);- }-}diff --git a/packages-experimental/uni-formula-ui/src/services/formula-popup.service.ts b/packages-experimental/uni-formula-ui/src/services/formula-popup.service.tsdeleted file mode 100644index 57458d82a5..0000000000--- a/packages-experimental/uni-formula-ui/src/services/formula-popup.service.ts+++ /dev/null@@ -1,178 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IDisposable, Nullable } from '@univerjs/core';-import type { IShortcutItem } from '@univerjs/ui';-import type { IAddDocUniFormulaCommandParams } from '../commands/commands/doc.command';-import type { IAddSlideUniFormulaCommandParams } from '../commands/commands/slide.command';-import type { IPopupPosition } from '../commands/operations/operation';-import { BuildTextUtils, Disposable, FORMULA_EDITOR_ACTIVATED, ICommandService, IContextService, ILogService, Inject } from '@univerjs/core';-import { DocCanvasPopManagerService } from '@univerjs/docs-ui';-import { FORMULA_PROMPT_ACTIVATED } from '@univerjs/sheets-formula-ui';-import { IShortcutService, KeyCode } from '@univerjs/ui';-import { IUniFormulaService } from '@univerjs/uni-formula';-import { BehaviorSubject, Subject } from 'rxjs';-import { AddDocUniFormulaCommand } from '../commands/commands/doc.command';-import { AddSlideUniFormulaCommand } from '../commands/commands/slide.command';-import { ConfirmFormulaPopupCommand, isSlidePosition } from '../commands/operations/operation';--export const DOC_FORMULA_POPUP_KEY = 'DOC_FORMULA_POPUP' as const;--export interface IUniFormulaPopupInfo {- unitId: string;- type: 'new' | 'existing';- f: Nullable<string>;- disposable: IDisposable;- startIndex: number;- position?: IPopupPosition;-}--export class UniFormulaPopupService extends Disposable {- private readonly _popupInfo$ = new BehaviorSubject<Nullable<IUniFormulaPopupInfo>>(null);- readonly popupInfo$ = this._popupInfo$.asObservable();- get popupInfo(): Nullable<IUniFormulaPopupInfo> { return this._popupInfo$.getValue(); }-- private _popupLocked = false;- get popupLocked(): boolean { return this._popupLocked; }-- private readonly _popupHovered$ = new Subject<boolean>();- readonly popupHovered$ = this._popupHovered$.asObservable();-- private _cachedFormulaString = '';-- constructor(- @Inject(DocCanvasPopManagerService) private readonly _docCanvasPopupManagerService: DocCanvasPopManagerService,- @IUniFormulaService private readonly _uniFormulaService: IUniFormulaService,- @IContextService private readonly _contextService: IContextService,- @ILogService private readonly _logService: ILogService,- @ICommandService private readonly _commandService: ICommandService,- @IShortcutService private readonly _shortcutService: IShortcutService- ) {- super();-- const UniFormulaConfirmShortcut: IShortcutItem = {- id: ConfirmFormulaPopupCommand.id,- binding: KeyCode.ENTER,- description: 'shortcut.doc.confirm-formula-popup',- preconditions: (contextService) =>- !contextService.getContextValue(FORMULA_PROMPT_ACTIVATED) && this.canConfirmPopup(),- priority: 10000,- };-- this.disposeWithMe(this._shortcutService.registerShortcut(UniFormulaConfirmShortcut));- }-- override dispose(): void {- super.dispose();-- this._popupInfo$.next(null);- this._popupInfo$.complete();-- this._popupHovered$.complete();- }-- cacheFormulaString(f: string): void {- this._cachedFormulaString = f;- }-- hoverPopup(hovered: boolean): void {- this._popupHovered$.next(hovered);- }-- showDocPopup(unitId: string, startIndex: number, type: 'new'): boolean;- showDocPopup(unitId: string, startIndex: number, type: 'existing', position: IPopupPosition): boolean;- showDocPopup(unitId: string, startIndex: number, type: 'new' | 'existing', position?: IPopupPosition): boolean;- showDocPopup(unitId: string, startIndex: number, type: 'new' | 'existing', position?: IPopupPosition): boolean {- this.closePopup();-- // Open existing doc formula.- const f = (position && position.rangeId && type === 'existing')- ? this._uniFormulaService.getDocFormula(unitId, position.rangeId)?.f ?? '='- : '=';-- const disposable = this._docCanvasPopupManagerService.attachPopupToRange(- BuildTextUtils.selection.makeSelection(startIndex),- {- componentKey: DOC_FORMULA_POPUP_KEY,- onClickOutside: () => this.closePopup(), // user may update ref range selections- direction: 'top',- },- unitId- );- this._popupInfo$.next({ unitId, disposable, type, f, startIndex, position });- return true;- }-- lockPopup(): void {- this._popupLocked = true;- this._contextService.setContextValue(FORMULA_EDITOR_ACTIVATED, true);- }-- canConfirmPopup(): boolean {- return this._cachedFormulaString !== '';- }-- async confirmPopup(): Promise<boolean> {- const info = this.popupInfo;- if (!info) return true;-- const f = this._cachedFormulaString;- if (!f) {- this._logService.warn('[FormulaPopupService]: cannot write empty formula into the field.');- return false;- }-- this.unlockPopup();- this.closePopup();-- // Write to slide.- if (isSlidePosition(info.position)) {- return this._commandService.executeCommand<IAddSlideUniFormulaCommandParams>(AddSlideUniFormulaCommand.id, {- unitId: info.unitId,- f,- startIndex: info.startIndex,- pageId: info.position.pageId,- elementId: info.position.elementId,- });- }-- // Write to doc.- return this._commandService.executeCommand(AddDocUniFormulaCommand.id, {- unitId: info.unitId,- f,- startIndex: info.startIndex,- } as IAddDocUniFormulaCommandParams);- }-- unlockPopup(): void {- this._popupLocked = false;- }-- closePopup(force = false): boolean {- if (this._popupLocked && !force) return false;-- this._popupLocked = false;- this._cachedFormulaString = '';-- this.popupInfo?.disposable.dispose();- this._popupInfo$.next(null);- this._popupHovered$.next(false);-- this._contextService.setContextValue(FORMULA_EDITOR_ACTIVATED, false);-- return true;- }-}diff --git a/packages-experimental/uni-formula-ui/src/services/slide-ui-formula-cache.service.ts b/packages-experimental/uni-formula-ui/src/services/slide-ui-formula-cache.service.tsdeleted file mode 100644index eeff1ca8d4..0000000000--- a/packages-experimental/uni-formula-ui/src/services/slide-ui-formula-cache.service.ts+++ /dev/null@@ -1,76 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { CustomRangeType, Disposable } from '@univerjs/core';-import { ISlideEditorBridgeService } from '@univerjs/slides-ui';-import { IUniFormulaService } from '@univerjs/uni-formula';-import type { RichText } from '@univerjs/engine-render';-import type { IAddSlideUniFormulaCommandParams } from '../commands/commands/slide.command';-import type { UniFormulaService } from './uni-formula.service';--export class SlideUIFormulaCacheService extends Disposable {- private readonly _caches: Map<string, IAddSlideUniFormulaCommandParams> = new Map();-- constructor(- @ISlideEditorBridgeService private readonly _editorBridgeService: ISlideEditorBridgeService,- @IUniFormulaService private readonly _uniFormulaService: UniFormulaService- ) {- super();-- this._editorBridgeService.endEditing$.subscribe((richText) => this._checkApplyCache(richText));- }-- writeCache(rangeId: string, params: IAddSlideUniFormulaCommandParams) {- if (this._caches.size && this._caches.values().next().value?.unitId !== params.unitId) {- this.clearCache();- }-- this._caches.set(rangeId, params);- }-- private _checkApplyCache(richText: RichText) {- const document = richText.documentData;- const customRanges = document.body?.customRanges;- if (!customRanges || customRanges.length === 0) {- this.clearCache();- return;- };-- // Check if there are custom ranges in the rich text. If there are, we would write apply the cache- // to the uni formula service- customRanges.forEach((range) => {- if (range.rangeType === CustomRangeType.UNI_FORMULA) {- const cache = this._caches.get(range.rangeId);- if (cache) {- this._applyCache(range.rangeId, cache);- } else {- throw new Error('[SlideUIFormulaCacheService]: cache not found!');- }- }- });-- this.clearCache();- }-- private _applyCache(rangeId: string, cache: IAddSlideUniFormulaCommandParams) {- const { unitId, pageId, elementId, f } = cache;- this._uniFormulaService.registerSlideFormula(unitId, pageId, elementId, rangeId, f);- }-- clearCache() {- this._caches.clear();- }-}diff --git a/packages-experimental/uni-formula-ui/src/services/uni-formula.service.ts b/packages-experimental/uni-formula-ui/src/services/uni-formula.service.tsdeleted file mode 100644index 3f8e4ce612..0000000000--- a/packages-experimental/uni-formula-ui/src/services/uni-formula.service.ts+++ /dev/null@@ -1,430 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type {- DocumentDataModel,- ICellData,- ICommand,- IDisposable,- IDocumentBody,- Nullable,- SlideDataModel,-} from '@univerjs/core';-import type { IDocFormulaCache, ISlideFormulaCache } from '@univerjs/uni-formula';-import type { IDocPopupPosition, ISlidePopupPosition } from '../commands/operations/operation';-import {- BuildTextUtils,- CommandType,- CustomRangeType,- ICommandService,- Inject,- Injector,- IResourceManagerService,- IUniverInstanceService,- makeCustomRangeStream,- Quantity,- RCDisposable,- toDisposable,- UniverInstanceType,-} from '@univerjs/core';-import { replaceSelectionFactory } from '@univerjs/docs';-import { OtherFormulaBizType, RegisterOtherFormulaService } from '@univerjs/engine-formula';-import { RichText } from '@univerjs/engine-render';-import { DataSyncPrimaryController } from '@univerjs/rpc';-import { CanvasView } from '@univerjs/slides-ui';-import { DumbUniFormulaService, IUniFormulaService } from '@univerjs/uni-formula';-import { take } from 'rxjs';-import { isSlidePosition } from '../commands/operations/operation';--const PSEUDO_SUBUNIT = 'PSEUDO_SUBUNIT';--export interface IUpdateSlideUniFormulaCacheCommandParams {- unitId: string;- positions: ISlidePopupPosition[];- cache: ISlideFormulaCache[];-}--export interface IUpdateDocUniFormulaCacheCommandParams {- /** The doc in which formula results changed. */- unitId: string;- positions: ISlidePopupPosition[] | IDocPopupPosition[];- /** Calculation results. */- cache: IDocFormulaCache[];-}--export const UpdateSlideUniFormulaCacheCommand: ICommand<IUpdateSlideUniFormulaCacheCommandParams> = {- type: CommandType.COMMAND,- id: 'uni-formula.mutation.update-slide-uni-formula-cache',- handler(accessor, params: IUpdateSlideUniFormulaCacheCommandParams) {- const { unitId, positions, cache } = params;-- const uniFormulaService = accessor.get(IUniFormulaService);- const instanceService = accessor.get(IUniverInstanceService);- const slideCanvasView = accessor.get(CanvasView);-- const slide = instanceService.getUnit<SlideDataModel>(unitId, UniverInstanceType.UNIVER_SLIDE);- if (!slide) return true;-- return positions.every((position, index) => {- // TODO@wzhudev: we should get the slide's rendering modules to update the formula results.- // Note that this is very hacky because Univer Slide hasn't provide any mutations to- // modify its content. This is just for POC of uni formula.- const scene = slideCanvasView.getRenderUnitByPageId(position.pageId, unitId).scene;- if (!scene) return false;-- const element = scene.getObject(position.elementId);- if (!element || !(element instanceof RichText)) return false;-- const documentModel = element.documentModel;- const originBody = documentModel.getBody()!;- const range = originBody.customRanges?.find((r) => r.rangeId === position.rangeId);- if (!range) return false;-- const dataStream = makeCustomRangeStream(`${cache[index].v ?? ''}`);- const body: IDocumentBody = {- dataStream,- customRanges: [{- startIndex: 0,- endIndex: dataStream.length - 1,- rangeId: position.rangeId!,- rangeType: CustomRangeType.UNI_FORMULA,- wholeEntity: true,- }],- };-- const redoMutation = replaceSelectionFactory(accessor, {- unitId,- body,- selection: BuildTextUtils.selection.makeSelection(range.startIndex, range.endIndex),- doc: documentModel,- });-- if (!redoMutation) return false;-- // This is pretty annoying...- element.documentModel.apply(redoMutation.params.actions);- element.refreshDocumentByDocData(); // trigger re-render-- uniFormulaService.updateSlideFormulaResults(unitId, position.pageId, position.elementId, position.rangeId!, cache[index]);-- return true;- });- },-};--/**- * This command is internal. It should not be exposed to third-party developers.- *- * @ignore- */-export const UpdateDocUniFormulaCacheCommand: ICommand<IUpdateDocUniFormulaCacheCommandParams> = {- type: CommandType.COMMAND,- id: 'uni-formula.mutation.update-doc-uni-formula-cache',- handler(accessor, params: IUpdateDocUniFormulaCacheCommandParams) {- const { unitId, positions, cache } = params;-- const uniFormulaService = accessor.get(IUniFormulaService);- const instanceService = accessor.get(IUniverInstanceService);- const commandService = accessor.get(ICommandService);-- const doc = instanceService.getUnit<DocumentDataModel>(unitId, UniverInstanceType.UNIVER_DOC);- // The document may have not loaded on this client. We are safe to ignore cache updating.- if (!doc) return true;-- const body = doc.getBody();-- function getRange(rangeId: string) {- return body?.customRanges?.find((r) => r.rangeId === rangeId);- }-- const ids = positions.map((position) => position.rangeId!);- const saveCacheResult = uniFormulaService.updateDocFormulaResults(unitId, ids, cache);- if (!saveCacheResult) return false;-- return ids.every((id, index) => {- const range = getRange(id);- if (!range) return true; // If we cannot find that rangeId, we are save to ignore cache.-- const dataStream = makeCustomRangeStream(`${cache[index].v ?? ''}`);- const body: IDocumentBody = {- dataStream,- customRanges: [{- startIndex: 0,- endIndex: dataStream.length - 1,- rangeId: id,- rangeType: CustomRangeType.UNI_FORMULA,- wholeEntity: true,- }],- };-- const redoMutation = replaceSelectionFactory(accessor, {- unitId,- body,- selection: BuildTextUtils.selection.makeSelection(range.startIndex, range.endIndex),- });-- if (redoMutation) {- return commandService.syncExecuteCommand(redoMutation.id, redoMutation.params);- }-- return false;- });- },-};--/**- * This service provides methods for docs and slides to register a formula into Univer's formula system.- * And it also manages formula resources fields of docs and slides. `SHEET_FORMULA_REMOTE_PLUGIN`- * is not required but optional here.- */-export class UniFormulaService extends DumbUniFormulaService implements IUniFormulaService {- private readonly _formulaIdToKey = new Map<string, string>();-- private _canPerformFormulaCalculation = false;-- private get _registerOtherFormulaSrv() { return this._injector.get(RegisterOtherFormulaService); }- private get _dataSyncPrimaryController() { return this._injector.get(DataSyncPrimaryController, Quantity.OPTIONAL); }-- constructor(- @Inject(Injector) private readonly _injector: Injector,- @IResourceManagerService resourceManagerService: IResourceManagerService,- @ICommandService commandSrv: ICommandService,- @IUniverInstanceService instanceSrv: IUniverInstanceService- ) {- super(resourceManagerService, commandSrv, instanceSrv);-- [- UpdateSlideUniFormulaCacheCommand,- UpdateDocUniFormulaCacheCommand,- ].forEach((command) => commandSrv.registerCommand(command));-- // Only able to perform formula calculation after a sheet is loaded.- // FIXME: the formula engine is not unit-agnostic.- if (instanceSrv.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).length) {- this._canPerformFormulaCalculation = true;- } else {- this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(UniverInstanceType.UNIVER_SHEET).pipe(take(1))- .subscribe(() => {- this._canPerformFormulaCalculation = true;- this._initFormulaRegistration();- }));- }- }-- /**- * Register a doc formula into the formula system.- */- override registerDocFormula(unitId: string, rangeId: string, f: string, v: ICellData['v'], t: ICellData['t']): IDisposable {- const key = getDocFormulaKey(unitId, rangeId);- if (this._docFormulas.has(key)) {- throw new Error(`[UniFormulaService]: cannot register formula ${key} when it is already registered!`);- }-- if (this._canPerformFormulaCalculation) {- const pseudoId = getPseudoUnitKey(unitId);- this._checkSyncingUnit(pseudoId);-- const id = this._registerOtherFormulaSrv.registerFormulaWithRange(pseudoId, PSEUDO_SUBUNIT, f, undefined, undefined, OtherFormulaBizType.DOC, rangeId);- this._docFormulas.set(key, { unitId, rangeId, f, formulaId: id, v, t });- this._formulaIdToKey.set(id, key);-- this._checkResultSubscription();- } else {- this._docFormulas.set(key, { unitId, rangeId, f, formulaId: '', v, t });- }-- return toDisposable(() => this.unregisterDocFormula(unitId, rangeId));- }-- override registerSlideFormula(- unitId: string,- pageId: string,- elementId: string,- rangeId: string,- f: string,- v: ICellData['v'],- t: ICellData['t']- ): IDisposable {- const key = getSlideFormulaKey(unitId, pageId, elementId, rangeId);- if (this._slideFormulas.has(key)) {- throw new Error(`[UniFormulaService]: cannot register formula ${key} when it is already registered!`);- }-- if (this._canPerformFormulaCalculation) {- const pseudoId = getPseudoUnitKey(unitId);- this._checkSyncingUnit(pseudoId);-- const id = this._registerOtherFormulaSrv.registerFormulaWithRange(pseudoId, PSEUDO_SUBUNIT, f, undefined, undefined, OtherFormulaBizType.SLIDE, `${pageId}_${elementId}_${rangeId}`);- this._slideFormulas.set(key, { unitId, pageId, elementId, rangeId, f, formulaId: id, v, t });- this._formulaIdToKey.set(id, key);-- this._checkResultSubscription();- } else {- this._slideFormulas.set(key, { unitId, pageId, elementId, rangeId, f, formulaId: '', v, t });- }-- return toDisposable(() => this.unregisterSlideFormula(unitId, pageId, elementId, rangeId));- }-- override unregisterDocFormula(unitId: string, rangeId: string): void {- const key = getDocFormulaKey(unitId, rangeId);- const item = this._docFormulas.get(key);- if (!item) return;-- const pseudoId = getPseudoUnitKey(unitId);- this._checkDisposingResultSubscription();- this._dataSyncDisposables.get(pseudoId)?.dec();-- if (this._canPerformFormulaCalculation) {- this._registerOtherFormulaSrv.deleteFormula(pseudoId, PSEUDO_SUBUNIT, [item.formulaId]);- this._formulaIdToKey.delete(item.formulaId);- }-- this._docFormulas.delete(key);- }-- override unregisterSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): void {- const key = getSlideFormulaKey(unitId, pageId, elementId, formulaId);- const item = this._slideFormulas.get(key);- if (!item) return;-- const pseudoId = getPseudoUnitKey(unitId);- this._checkDisposingResultSubscription();- this._dataSyncDisposables.get(pseudoId)?.dec();-- if (this._canPerformFormulaCalculation) {- this._registerOtherFormulaSrv.deleteFormula(pseudoId, PSEUDO_SUBUNIT, [item.formulaId]);- this._formulaIdToKey.delete(item.formulaId);- }-- this._slideFormulas.delete(key);- }-- private _initFormulaRegistration(): void {- // When the doc bootstraps, there could be no sheets modules loaded. So we need to check if there- // are registered formulas but not added to the formula system.- this._docFormulas.forEach((value, key) => {- if (!value.formulaId) {- const { unitId, f, rangeId } = value;- const pseudoId = getPseudoUnitKey(unitId);- this._checkSyncingUnit(pseudoId);-- const id = this._registerOtherFormulaSrv.registerFormulaWithRange(pseudoId, PSEUDO_SUBUNIT, f, undefined, undefined, OtherFormulaBizType.DOC, rangeId);- value.formulaId = id;- this._formulaIdToKey.set(id, key);- }- });- }-- private _dataSyncDisposables = new Map<string, RCDisposable>();- private _checkSyncingUnit(unitId: string): void {- if (!this._dataSyncPrimaryController) return;-- if (!this._dataSyncDisposables.has(unitId)) {- this._dataSyncPrimaryController.syncUnit(unitId);- this._dataSyncDisposables.set(unitId, new RCDisposable(toDisposable(() => this._dataSyncDisposables.delete(unitId))));- }-- this._dataSyncDisposables.get(unitId)!.inc();- }-- private _resultSubscription: Nullable<IDisposable>;- private _checkResultSubscription(): void {- if (this._resultSubscription || !this._registerOtherFormulaSrv) return;-- this._resultSubscription = toDisposable(this._registerOtherFormulaSrv.formulaResult$.subscribe((resultMap) => {- for (const resultOfUnit in resultMap) {- const results = resultMap[resultOfUnit][PSEUDO_SUBUNIT];- if (results) {- const mutationParam = results.map((result) => {- const formulaId = result.formulaId;- const key = this._formulaIdToKey.get(formulaId);- if (!key) return null;-- const docItem = this._docFormulas.get(key);- if (docItem) {- const r = result.result?.[0][0][0][0]; // Ranges defaults to one row and one column- if (docItem.v === r?.v && docItem.t === r?.t) return null;-- return { position: { rangeId: docItem.rangeId }, unitId: docItem.unitId, cache: r };- };-- const slideItem = this._slideFormulas.get(key);- if (slideItem) {- const r = result.result?.[0][0][0][0]; // Ranges defaults to one row and one column- if (slideItem.v === r?.v && slideItem.t === r?.t) return null;-- return {- unitId: slideItem.unitId,- position: {- elementId: slideItem.elementId,- rangeId: slideItem.rangeId,- pageId: slideItem.pageId,- },- cache: r,- };- }-- return null;- }).reduce((previous, curr) => {- if (!curr || !curr.cache) return previous;-- if (!previous.unitId) previous.unitId = curr.unitId;- previous.positions.push(curr.position);- previous.cache.push(curr.cache);-- return previous;- }, {- unitId: '',- positions: [] as (ISlidePopupPosition | IDocPopupPosition)[],- cache: [] as Pick<ICellData, 'v' | 't'>[],- });-- if (mutationParam.positions.length === 0) return;-- if (isSlidePosition(mutationParam.positions[0])) {- this._commandSrv.executeCommand(UpdateSlideUniFormulaCacheCommand.id, mutationParam as IUpdateSlideUniFormulaCacheCommandParams);- } else {- this._commandSrv.executeCommand(UpdateDocUniFormulaCacheCommand.id, mutationParam as IUpdateDocUniFormulaCacheCommandParams);- }- }- }- }));- }-- private _checkDisposingResultSubscription(): void {- if (this._docFormulas.size === 0) this._disposeResultSubscription();- }-- private _disposeResultSubscription(): void {- if (this._resultSubscription) {- this._resultSubscription.dispose();- this._resultSubscription = null;- }- }-}--function getPseudoUnitKey(unitId: string): string {- return `pseudo-${unitId}`;-}--function getDocFormulaKey(unitId: string, formulaId: string): string {- return `pseudo-${unitId}-${formulaId}`;-}--function getSlideFormulaKey(unitId: string, pageId: string, elementId: string, rangeId: string): string {- return `pseudo-${unitId}-${pageId}-${elementId}-${rangeId}`;-}diff --git a/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx b/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsxdeleted file mode 100644index 0433292b70..0000000000--- a/packages-experimental/uni-formula-ui/src/views/components/DocFormulaPopup.tsx+++ /dev/null@@ -1,159 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IDocumentData, Nullable } from '@univerjs/core';-import type { IUniFormulaPopupInfo } from '../../services/formula-popup.service';--import {- BooleanNumber,- createInternalEditorID,- DEFAULT_EMPTY_DOCUMENT_VALUE,- DocumentFlavor,- HorizontalAlign,- ICommandService,- LocaleService,- VerticalAlign,- WrapStrategy,-} from '@univerjs/core';-import { borderClassName, clsx } from '@univerjs/design';-import { CheckMarkIcon, CloseIcon } from '@univerjs/icons';-import { useDependency, useObservable } from '@univerjs/ui';-import { useCallback, useEffect, useRef, useState } from 'react';-import { CloseFormulaPopupOperation, ConfirmFormulaPopupCommand } from '../../commands/operations/operation';-import { DOC_FORMULA_POPUP_KEY, UniFormulaPopupService } from '../../services/formula-popup.service';--export const UNI_FORMULA_EDITOR_ID = createInternalEditorID('UNI_FORMULA');--function makeSnapshot(f: string): IDocumentData {- return {- id: UNI_FORMULA_EDITOR_ID,- body: {- dataStream: `${f}${DEFAULT_EMPTY_DOCUMENT_VALUE}`,- textRuns: [],- paragraphs: [- {- startIndex: 0,- },- ],- },- documentStyle: {- documentFlavor: DocumentFlavor.UNSPECIFIED,- marginTop: 5,- marginBottom: 5,- marginRight: 0,- marginLeft: 0,- paragraphLineGapDefault: 0,- pageSize: {- width: Number.POSITIVE_INFINITY,- height: Number.POSITIVE_INFINITY,- },- renderConfig: {- horizontalAlign: HorizontalAlign.UNSPECIFIED,- verticalAlign: VerticalAlign.TOP,- centerAngle: 0,- vertexAngle: 0,- wrapStrategy: WrapStrategy.OVERFLOW,- isRenderStyle: BooleanNumber.FALSE,- },- },- };-}--export function UniFormulaPopup() {- const docFormulaPopupService = useDependency(UniFormulaPopupService);- const popupInfo = useObservable(docFormulaPopupService.popupInfo$);-- if (!popupInfo) {- return null;- }-- return <DocFormula popupInfo={popupInfo} />;-}--UniFormulaPopup.componentKey = DOC_FORMULA_POPUP_KEY;--function DocFormula(props: { popupInfo: IUniFormulaPopupInfo }) {- const { popupInfo } = props;- const { f } = popupInfo;-- const localeService = useDependency(LocaleService);- const formulaPopupService = useDependency(UniFormulaPopupService);- const commandService = useDependency(ICommandService);-- const [formulaString, setFormulaString] = useState<Nullable<string>>(f);- const snapshotRef = useRef(makeSnapshot(f ?? ''));-- const [focused, setFocused] = useState(false);-- const onFormulaStringChange = useCallback((formulaString: string) => {- setFormulaString(formulaString);- formulaPopupService.cacheFormulaString(formulaString);- }, [formulaPopupService]);-- const onConfirm = useCallback(() => {- // TODO: call operation instead- commandService.executeCommand(ConfirmFormulaPopupCommand.id);- }, [commandService]);-- const onHovered = useCallback((hovered: boolean) => {- formulaPopupService.hoverPopup(hovered);- }, [formulaPopupService]);-- const onCancel = useCallback(() => {- commandService.executeCommand(CloseFormulaPopupOperation.id);- }, [commandService]);-- const handleEscKey = useCallback((event: { key: string }) => {- if (event.key === 'Escape') {- onCancel();- }- }, [onCancel]);-- useEffect(() => {- document.addEventListener('keydown', handleEscKey);- return () => {- document.removeEventListener('keydown', handleEscKey);- };- }, [handleEscKey]);-- return (- <div- className={clsx(`- u univer-box-border univer-flex univer-h-12 univer-w-[482px] univer-items-center univer-gap-x-2- univer-overflow-hidden univer-rounded-lg univer-border-gray-200 univer-bg-white univer-p-2- univer-shadow-lg- dark:!univer-bg-gray-900- `, borderClassName)}- onMouseEnter={() => onHovered(true)}- onMouseLeave={() => onHovered(false)}- >- <div className="univer-flex">- <span- className="univer-flex univer-items-center univer-gap-2 univer-rounded-lg univer-p-1"- onClick={onCancel}- >- <CloseIcon />- </span>- <span- className="univer-flex univer-items-center univer-gap-2 univer-rounded-lg univer-p-1"- onClick={onConfirm}- >- <CheckMarkIcon />- </span>- </div>- </div>- );-}diff --git a/packages-experimental/uni-formula-ui/src/vite-env.d.ts b/packages-experimental/uni-formula-ui/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uni-formula-ui/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uni-formula-ui/tailwind.config.ts b/packages-experimental/uni-formula-ui/tailwind.config.tsdeleted file mode 100644index 75967f186f..0000000000--- a/packages-experimental/uni-formula-ui/tailwind.config.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Config } from 'tailwindcss';-import preset from '@univerjs-infra/shared/tailwind';--const config: Config = {- presets: [preset],- content: [- './src/**/*.{js,ts,jsx,tsx}',- ],-};--export default config;diff --git a/packages-experimental/uni-formula-ui/tsconfig.json b/packages-experimental/uni-formula-ui/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uni-formula-ui/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uni-formula-ui/tsconfig.node.json b/packages-experimental/uni-formula-ui/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uni-formula-ui/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uni-formula-ui/vitest.config.ts b/packages-experimental/uni-formula-ui/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uni-formula-ui/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/packages-experimental/uni-formula/README.md b/packages-experimental/uni-formula/README.mddeleted file mode 100644index e18aba50e1..0000000000--- a/packages-experimental/uni-formula/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uni-formula--[](https://npmjs.org/packages/@univerjs/uni-formula)-[](https://img.shields.io/npm/l/@univerjs/uni-formula)--## Introduction--Provide formula feature in Univer Docs and Univer Slides.--## Usage--### Installation--```shell-npm i @univerjs/uni-formula-```diff --git a/packages-experimental/uni-formula/package.json b/packages-experimental/uni-formula/package.jsondeleted file mode 100644index b4b959e2d9..0000000000--- a/packages-experimental/uni-formula/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@univerjs/uni-formula",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "dependencies": {- "@univerjs/core": "workspace:*"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uni-formula/src/commands/mutations/doc-formula.mutation.ts b/packages-experimental/uni-formula/src/commands/mutations/doc-formula.mutation.tsdeleted file mode 100644index 01e7d6fd75..0000000000--- a/packages-experimental/uni-formula/src/commands/mutations/doc-formula.mutation.ts+++ /dev/null@@ -1,78 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IMutation } from '@univerjs/core';-import { CommandType } from '@univerjs/core';--import { IUniFormulaService } from '../../services/uni-formula.service';--export interface IAddDocUniFormulaMutationParams {- unitId: string;- rangeId: string;-- f: string;-}--export const AddDocUniFormulaMutation: IMutation<IAddDocUniFormulaMutationParams> = {- type: CommandType.MUTATION,- id: 'doc.mutation.add-doc-uni-formula',- handler(accessor, params: IAddDocUniFormulaMutationParams) {- const { unitId, f, rangeId: id } = params;- const uniFormulaService = accessor.get(IUniFormulaService);-- uniFormulaService.registerDocFormula(unitId, id, f);-- return true;- },-};--export interface IUpdateDocUniFormulaMutationParams extends IAddDocUniFormulaMutationParams {}--export const UpdateDocUniFormulaMutation: IMutation<IUpdateDocUniFormulaMutationParams> = {- type: CommandType.MUTATION,- id: 'doc.mutation.update-doc-uni-formula',- handler(accessor, params: IUpdateDocUniFormulaMutationParams) {- const { unitId, f, rangeId: id } = params;- const uniFormulaService = accessor.get(IUniFormulaService);-- if (!uniFormulaService.hasDocFormula(unitId, id)) return false;-- uniFormulaService.unregisterDocFormula(unitId, id);- uniFormulaService.registerDocFormula(unitId, id, f);- return true;- },-};--export interface IRemoveDocUniFormulaMutationParams {- unitId: string;- rangeId: string;-}--export const RemoveDocUniFormulaMutation: IMutation<IRemoveDocUniFormulaMutationParams> = {- type: CommandType.MUTATION,- id: 'doc.mutation.remove-doc-uni-formula',- handler(accessor, params: IRemoveDocUniFormulaMutationParams) {- const { unitId, rangeId: id } = params;- const uniFormulaService = accessor.get(IUniFormulaService);-- if (!uniFormulaService.hasDocFormula(unitId, id)) {- return false;- }-- uniFormulaService.unregisterDocFormula(unitId, id);- return true;- },-};diff --git a/packages-experimental/uni-formula/src/commands/mutations/slide-formua.mutation.ts b/packages-experimental/uni-formula/src/commands/mutations/slide-formua.mutation.tsdeleted file mode 100644index 302ef64c9b..0000000000--- a/packages-experimental/uni-formula/src/commands/mutations/slide-formua.mutation.ts+++ /dev/null@@ -1,58 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IMutation } from '@univerjs/core';-import { CommandType } from '@univerjs/core';-import { IUniFormulaService } from '../../services/uni-formula.service';--export interface IAddSlideUniFormulaMutationParams {- unitId: string;- pageId: string;- elementId: string;- rangeId: string;-- f: string;-}--export const AddSlideUniFormulaMutation: IMutation<IAddSlideUniFormulaMutationParams> = {- type: CommandType.MUTATION,- id: 'slide.mutation.add-slide-uni-formula',- handler(accessor, params: IAddSlideUniFormulaMutationParams) {- const { unitId, pageId, elementId, f, rangeId: id } = params;- const uniFormulaService = accessor.get(IUniFormulaService);-- uniFormulaService.registerSlideFormula(unitId, pageId, elementId, id, f);-- return true;- },-};--export interface IUpdateSlideUniFormulaMutationParams extends IAddSlideUniFormulaMutationParams {}--export const UpdateSlideUniFormulaMutation: IMutation<IUpdateSlideUniFormulaMutationParams> = {- type: CommandType.MUTATION,- id: 'slide.mutation.update-slide-uni-formula',- handler(accessor, params: IUpdateSlideUniFormulaMutationParams) {- const { unitId, pageId, elementId, f, rangeId: id } = params;- const uniFormulaService = accessor.get(IUniFormulaService);-- if (!uniFormulaService.hasSlideFormula(unitId, pageId, elementId, id)) return false;-- uniFormulaService.unregisterSlideFormula(unitId, pageId, elementId, id);- uniFormulaService.registerSlideFormula(unitId, pageId, elementId, id, f);- return true;- },-};diff --git a/packages-experimental/uni-formula/src/const.ts b/packages-experimental/uni-formula/src/const.tsdeleted file mode 100644index a2219bac31..0000000000--- a/packages-experimental/uni-formula/src/const.ts+++ /dev/null@@ -1,19 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export const UNI_FORMULA_PLUGIN_NAME = 'UI_FORMULA_PLUGIN';--export const DOC_UNI_FORMULA_RESOURCE_NAME = 'DOC_FORMULA_PLUGIN';diff --git a/packages-experimental/uni-formula/src/controller/uni-formula.controller.ts b/packages-experimental/uni-formula/src/controller/uni-formula.controller.tsdeleted file mode 100644index ceb55b89d1..0000000000--- a/packages-experimental/uni-formula/src/controller/uni-formula.controller.ts+++ /dev/null@@ -1,34 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { ICommandService } from '@univerjs/core';-import { AddDocUniFormulaMutation, RemoveDocUniFormulaMutation, UpdateDocUniFormulaMutation } from '../commands/mutations/doc-formula.mutation';--export class UniFormulaController {- constructor(- @ICommandService private readonly _commandSrv: ICommandService- ) {- this._initCommands();- }-- private _initCommands(): void {- [- AddDocUniFormulaMutation,- UpdateDocUniFormulaMutation,- RemoveDocUniFormulaMutation,- ].forEach((command) => this._commandSrv.registerCommand(command));- }-}diff --git a/packages-experimental/uni-formula/src/index.ts b/packages-experimental/uni-formula/src/index.tsdeleted file mode 100644index cfc6283a98..0000000000--- a/packages-experimental/uni-formula/src/index.ts+++ /dev/null@@ -1,29 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export {- AddDocUniFormulaMutation,- type IAddDocUniFormulaMutationParams,- type IRemoveDocUniFormulaMutationParams,- type IUpdateDocUniFormulaMutationParams,- RemoveDocUniFormulaMutation,- UpdateDocUniFormulaMutation,-} from './commands/mutations/doc-formula.mutation';-export { UNI_FORMULA_PLUGIN_NAME as DOC_FORMULA_PLUGIN_NAME } from './const';-export type { IDocFormulaCache, IDocFormulaData, IDocFormulaReference } from './models/doc-formula';-export type { ISlideFormulaCache, ISlideFormulaData, ISlideFormulaReference } from './models/slide-formula';-export { UniverDocUniFormulaPlugin } from './plugin';-export { DumbUniFormulaService, IUniFormulaService } from './services/uni-formula.service';diff --git a/packages-experimental/uni-formula/src/models/doc-formula.ts b/packages-experimental/uni-formula/src/models/doc-formula.tsdeleted file mode 100644index 02adebb672..0000000000--- a/packages-experimental/uni-formula/src/models/doc-formula.ts+++ /dev/null@@ -1,55 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICellData } from '@univerjs/core';--export const DOC_FORMULA_RESOURCE_KEY = 'DOC_FORMULA_RESOURCE';--/**- * This interface represents a single formula entity in a Univer Doc.- */-export interface IDocFormulaData {- /** Id of this formula. It should be unique in a single document, and bound to the custom range's id. */- rangeId: string;-- /**- * Raw formula string. For example `=SUM(A1:B4)`.- */- f: string;-- /**- * Formula calculation result.- */- v?: ICellData['v'];-- /**- * Formula calculation format.- */- t?: ICellData['t'];-}--export interface IDocFormulaReference extends IDocFormulaData {- unitId: string;-- /** Formula id assigned by the formula engine. It should not be written to snapshot. */- formulaId: string;-}--export interface IDocFormulaCache extends Pick<ICellData, 'v' | 't'> { }--export function toJson(formulas: IDocFormulaReference[]): string {- return JSON.stringify(formulas.map((f) => ({ rangeId: f.rangeId, f: f.f, v: f.v, t: f.t })));-}diff --git a/packages-experimental/uni-formula/src/models/slide-formula.ts b/packages-experimental/uni-formula/src/models/slide-formula.tsdeleted file mode 100644index e06eccc406..0000000000--- a/packages-experimental/uni-formula/src/models/slide-formula.ts+++ /dev/null@@ -1,50 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICellData } from '@univerjs/core';--export interface ISlideFormulaData {- rangeId: string;-- f: string;-- v?: ICellData['v'];-- t?: ICellData['t'];-}--export interface ISlideFormulaReference extends ISlideFormulaData {- unitId: string;-- pageId: string;-- elementId: string;-- formulaId: string;-}--export interface ISlideFormulaCache extends Pick<ICellData, 'v' | 't'> { }--export function slideToJson(formulas: ISlideFormulaReference[]): string {- return JSON.stringify(formulas.map((f) => ({- rangeId: f.rangeId,- pageId: f.pageId,- elementId: f.elementId,- f: f.f,- v: f.v,- t: f.t,- })));-}diff --git a/packages-experimental/uni-formula/src/plugin.ts b/packages-experimental/uni-formula/src/plugin.tsdeleted file mode 100644index e1d81262ca..0000000000--- a/packages-experimental/uni-formula/src/plugin.ts+++ /dev/null@@ -1,45 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Dependency } from '@univerjs/core';-import { Inject, Injector, Plugin, registerDependencies, touchDependencies, UniverInstanceType } from '@univerjs/core';-import { UNI_FORMULA_PLUGIN_NAME } from './const';-import { UniFormulaController } from './controller/uni-formula.controller';-import { DumbUniFormulaService, IUniFormulaService } from './services/uni-formula.service';--export class UniverDocUniFormulaPlugin extends Plugin {- static override pluginName: string = UNI_FORMULA_PLUGIN_NAME;-- // This plugin should load only when sheet related modules are loaded.- static override type: UniverInstanceType = UniverInstanceType.UNIVER_UNKNOWN;-- constructor(- private readonly _config: { playDumb: boolean } | undefined,- @Inject(Injector) protected readonly _injector: Injector- ) {- super();- }-- override onStarting(): void {- const dependencies: Dependency[] = [[UniFormulaController]];- if (this._config?.playDumb) {- dependencies.push([IUniFormulaService, { useClass: DumbUniFormulaService }]);- }-- registerDependencies(this._injector, dependencies);- touchDependencies(this._injector, dependencies.map((d) => [d[0]]));- }-}diff --git a/packages-experimental/uni-formula/src/services/uni-formula.service.ts b/packages-experimental/uni-formula/src/services/uni-formula.service.tsdeleted file mode 100644index 09e6c5a0f2..0000000000--- a/packages-experimental/uni-formula/src/services/uni-formula.service.ts+++ /dev/null@@ -1,216 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICellData, IDisposable, Nullable } from '@univerjs/core';-import type { IDocFormulaCache, IDocFormulaData, IDocFormulaReference } from '../models/doc-formula';--import type { ISlideFormulaReference } from '../models/slide-formula';-import {- createIdentifier,- Disposable,- ICommandService,- IResourceManagerService,- IUniverInstanceService,- toDisposable,- UniverInstanceType,-} from '@univerjs/core';-import { DOC_UNI_FORMULA_RESOURCE_NAME } from '../const';-import { toJson } from '../models/doc-formula';--export interface IUniFormulaService {- updateDocFormulaResults(unitId: string, formulaIds: string[], v: IDocFormulaCache[]): boolean;- updateSlideFormulaResults(unitId: string, pageId: string, elementId: string, formulaId: string, v: IDocFormulaCache): boolean;-- // #region doc- hasDocFormula(unitId: string, formulaId: string): boolean;- getDocFormula(unitId: string, rangeId: string): Nullable<IDocFormulaReference>;- registerDocFormula(unitId: string, rangeId: string, f: string, v: ICellData['v'], t: ICellData['t']): IDisposable;- unregisterDocFormula(unitId: string, rangeId: string): void;- // #endregion-- // #region slide- hasSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): boolean;- getSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): Nullable<ISlideFormulaReference>;- registerSlideFormula(unitId: string, pageId: string, elementId: string, f: string, v: ICellData['v'], t: ICellData['t']): IDisposable;- unregisterSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): void;- // #endregion-}--export const IUniFormulaService = createIdentifier<IUniFormulaService>('uni-formula.uni-formula.service');--// NOTE@wzhudev: we implement formula for doc and slide here for convenience, but we should separate them in the future.--export class DumbUniFormulaService extends Disposable implements IUniFormulaService {- protected readonly _docFormulas = new Map<string, IDocFormulaReference>();- protected readonly _slideFormulas = new Map<string, ISlideFormulaReference>();-- constructor(- @IResourceManagerService resourceManagerSrv: IResourceManagerService,- @ICommandService protected readonly _commandSrv: ICommandService,- @IUniverInstanceService protected readonly _instanceSrv: IUniverInstanceService- ) {- super();-- this._initDocFormulaResources(resourceManagerSrv);-- this._instanceSrv.getTypeOfUnitDisposed$(UniverInstanceType.UNIVER_DOC).subscribe((doc) => {- this._unregisterDoc(doc.getUnitId());- });- }-- // #region docs-- hasDocFormula(unitId: string, formulaId: string): boolean {- return this._docFormulas.has(getDocFormulaKey(unitId, formulaId));- }-- getDocFormula(unitId: string, rangeId: string): Nullable<IDocFormulaReference> {- return this._docFormulas.get(getDocFormulaKey(unitId, rangeId)) ?? null;- }-- updateDocFormulaResults(unitId: string, formulaIds: string[], v: IDocFormulaCache[]): boolean {- formulaIds.forEach((id, index) => {- const formulaData = this._docFormulas.get(getDocFormulaKey(unitId, id));- if (!formulaData) return true;-- formulaData.v = v[index].v;- formulaData.t = v[index].t;- return true;- });-- return true;- }-- /**- * Register a doc formula into the formula system.- */- registerDocFormula(unitId: string, rangeId: string, f: string, v: ICellData['v'], t: ICellData['t']): IDisposable {- const key = getDocFormulaKey(unitId, rangeId);- if (this._docFormulas.has(key)) {- throw new Error(`[UniFormulaService]: cannot register formula ${key} when it is already registered!`);- }-- this._docFormulas.set(key, { unitId, rangeId, f, formulaId: '', v, t });-- return toDisposable(() => this.unregisterDocFormula(unitId, rangeId));- }-- unregisterDocFormula(unitId: string, rangeId: string): void {- const key = getDocFormulaKey(unitId, rangeId);- const item = this._docFormulas.get(key);- if (item) {- this._docFormulas.delete(key);- }- }-- updateSlideFormulaResults(unitId: string, pageId: string, elementId: string, formulaId: string, v: IDocFormulaCache): boolean {- const formulaData = this._slideFormulas.get(getSlideFormulaKey(unitId, pageId, elementId, formulaId));- if (!formulaData) return true;-- formulaData.v = v.v;- formulaData.t = v.t;- return true;- }-- private _initDocFormulaResources(resourceManagerService: IResourceManagerService): void {- resourceManagerService.registerPluginResource({- pluginName: DOC_UNI_FORMULA_RESOURCE_NAME,- businesses: [UniverInstanceType.UNIVER_DOC],- toJson: (unitId: string) => {- const formulas = this._getAllFormulasOfUnit(unitId);- return toJson(formulas.map((f) => f[1]));- },- parseJson: (json: string) => {- const formulas = JSON.parse(json) as IDocFormulaData[];- return formulas;- },- onLoad: (unitId, formulas) => {- formulas.forEach((f) => this.registerDocFormula(unitId, f.rangeId, f.f, f.v, f.t));- },- onUnLoad: (unitId) => {- this._unregisterDoc(unitId);- },- });- }-- /**- * Remove all formulas under a doc.- */- private _unregisterDoc(unitId: string): void {- const existingFormulas = Array.from(this._docFormulas.entries());- existingFormulas.forEach(([_, value]) => {- if (value.unitId === unitId) this.unregisterDocFormula(unitId, value.rangeId);- });- }-- // #endregion-- // #region slides-- registerSlideFormula(- unitId: string,- pageId: string,- elementId: string,- rangeId: string,- f: string,- v: ICellData['v'],- t: ICellData['t']- ): IDisposable {- const key = getSlideFormulaKey(unitId, pageId, elementId, f);- if (this._slideFormulas.has(key)) {- throw new Error(`[UniFormulaService]: cannot register formula ${key} when it is already registered!`);- }-- this._slideFormulas.set(key, { unitId, pageId, elementId, rangeId, formulaId: '', f, v, t });-- return toDisposable(() => this.unregisterDocFormula(unitId, rangeId));- }-- hasSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): boolean {- return this._slideFormulas.has(getSlideFormulaKey(unitId, pageId, elementId, formulaId));- }-- getSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): Nullable<ISlideFormulaReference> {- return this._slideFormulas.get(getSlideFormulaKey(unitId, pageId, elementId, formulaId)) ?? null;- }-- unregisterSlideFormula(unitId: string, pageId: string, elementId: string, formulaId: string): void {- const key = getSlideFormulaKey(unitId, pageId, elementId, formulaId);- const item = this._slideFormulas.get(key);- if (item) {- this._slideFormulas.delete(key);- }- }-- // #endregion-- private _getAllFormulasOfUnit(unitId: string) {- const formulas = Array.from(this._docFormulas.entries()).filter((v) => v[1].unitId === unitId);- return formulas;- }-}--export function getPseudoDocUnitKey(unitId: string): string {- return `pseudo-${unitId}`;-}--export function getDocFormulaKey(unitId: string, formulaId: string): string {- return `pseudo-${unitId}-${formulaId}`;-}--function getSlideFormulaKey(unitId: string, pageId: string, elementId: string, formulaId: string): string {- return `pseudo-${unitId}-${pageId}-${elementId}-${formulaId}`;-}diff --git a/packages-experimental/uni-formula/src/vite-env.d.ts b/packages-experimental/uni-formula/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uni-formula/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uni-formula/tsconfig.json b/packages-experimental/uni-formula/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uni-formula/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uni-formula/tsconfig.node.json b/packages-experimental/uni-formula/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uni-formula/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uni-formula/vitest.config.ts b/packages-experimental/uni-formula/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uni-formula/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/packages-experimental/uni-sheets-ui/README.md b/packages-experimental/uni-sheets-ui/README.mddeleted file mode 100644index 52972216df..0000000000--- a/packages-experimental/uni-sheets-ui/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uni-sheets-ui--[](https://npmjs.org/packages/@univerjs/uni-sheets-ui)-[](https://img.shields.io/npm/l/@univerjs/uni-sheets-ui)--## Introduction--> TODO: Introduction--## Usage--### Installation--```shell-npm i @univerjs/uni-sheets-ui-```diff --git a/packages-experimental/uni-sheets-ui/package.json b/packages-experimental/uni-sheets-ui/package.jsondeleted file mode 100644index f3fc8132dc..0000000000--- a/packages-experimental/uni-sheets-ui/package.json+++ /dev/null@@ -1,84 +0,0 @@-{- "name": "@univerjs/uni-sheets-ui",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "peerDependencies": {- "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",- "rxjs": ">=7.0.0"- },- "dependencies": {- "@univerjs/core": "workspace:*",- "@univerjs/design": "workspace:*",- "@univerjs/docs": "workspace:*",- "@univerjs/docs-ui": "workspace:*",- "@univerjs/icons": "^1.1.0",- "@univerjs/sheets": "workspace:*",- "@univerjs/sheets-drawing-ui": "workspace:*",- "@univerjs/sheets-ui": "workspace:*",- "@univerjs/ui": "workspace:*",- "@univerjs/uniui": "workspace:*"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "postcss": "^8.5.6",- "react": "18.3.1",- "rxjs": "^7.8.2",- "tailwindcss": "3.4.18",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uni-sheets-ui/postcss.config.mjs b/packages-experimental/uni-sheets-ui/postcss.config.mjsdeleted file mode 100644index 7d59f53133..0000000000--- a/packages-experimental/uni-sheets-ui/postcss.config.mjs+++ /dev/null@@ -1 +0,0 @@-export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages-experimental/uni-sheets-ui/src/controllers/menu.schema.ts b/packages-experimental/uni-sheets-ui/src/controllers/menu.schema.tsdeleted file mode 100644index 38a28030ed..0000000000--- a/packages-experimental/uni-sheets-ui/src/controllers/menu.schema.ts+++ /dev/null@@ -1,52 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { MenuSchemaType } from '@univerjs/ui';-import { SheetsUIMenuSchema } from '@univerjs/sheets-ui';-import { RibbonStartGroup } from '@univerjs/ui';-import { FONT_GROUP_MENU_ID, UNI_MENU_POSITIONS } from '@univerjs/uniui';-import {- SHEET_BOLD_MUTATION_ID,- SHEET_ITALIC_MUTATION_ID,- SHEET_STRIKE_MUTATION_ID,- SHEET_UNDERLINE_MUTATION_ID,- SheetBoldMenuItemFactory,- SheetItalicMenuItemFactory,- SheetStrikeThroughMenuItemFactory,- SheetUnderlineMenuItemFactory,-} from './menu';--export const menuSchema: MenuSchemaType = {- [UNI_MENU_POSITIONS.TOOLBAR_MAIN]: (SheetsUIMenuSchema as any)[RibbonStartGroup.FORMAT],- [FONT_GROUP_MENU_ID]: {- [SHEET_BOLD_MUTATION_ID]: {- order: 0,- menuItemFactory: SheetBoldMenuItemFactory,- },- [SHEET_ITALIC_MUTATION_ID]: {- order: 1,- menuItemFactory: SheetItalicMenuItemFactory,- },- [SHEET_UNDERLINE_MUTATION_ID]: {- order: 2,- menuItemFactory: SheetUnderlineMenuItemFactory,- },- [SHEET_STRIKE_MUTATION_ID]: {- order: 3,- menuItemFactory: SheetStrikeThroughMenuItemFactory,- },- },-};diff --git a/packages-experimental/uni-sheets-ui/src/controllers/menu.ts b/packages-experimental/uni-sheets-ui/src/controllers/menu.tsdeleted file mode 100644index b8abb7452e..0000000000--- a/packages-experimental/uni-sheets-ui/src/controllers/menu.ts+++ /dev/null@@ -1,284 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor } from '@univerjs/core';-import type { IMenuButtonItem } from '@univerjs/ui';-import { BooleanNumber, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, EDITOR_ACTIVATED, FOCUSING_SHEET, FontItalic, FontWeight, ICommandService, IContextService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { DocSelectionManagerService, SetTextSelectionsOperation } from '@univerjs/docs';-import { SetInlineFormatCommand } from '@univerjs/docs-ui';-import {- RangeProtectionPermissionEditPoint,- SetRangeValuesMutation,- SetSelectionsOperation,- SetWorksheetActiveOperation,- SheetsSelectionsService,- WorkbookEditablePermission,- WorksheetEditPermission,- WorksheetSetCellStylePermission,-} from '@univerjs/sheets';-import { deriveStateFromActiveSheet$, getCurrentRangeDisable$ } from '@univerjs/sheets-ui';-import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';-import { Observable } from 'rxjs';--export const SHEET_BOLD_MUTATION_ID = 'sheet.command.uni-bold';-export const SHEET_ITALIC_MUTATION_ID = 'sheet.command.uni-italic';-export const SHEET_UNDERLINE_MUTATION_ID = 'sheet.command.uni-underline';-export const SHEET_STRIKE_MUTATION_ID = 'sheet.command.uni-strike';--export function SheetBoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);- const univerInstanceService = accessor.get(IUniverInstanceService);- const contextService = accessor.get(IContextService);- const selectionManagerService = accessor.get(SheetsSelectionsService);-- return {- id: SHEET_BOLD_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'BoldIcon',- title: 'Set bold',- tooltip: 'toolbar.bold',- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;- if (id === SetRangeValuesMutation.id || id === SetSelectionsOperation.id || id === SetWorksheetActiveOperation.id) {- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let isBold = FontWeight.NORMAL;-- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isBold = range?.getFontWeight();- }-- subscriber.next(isBold === FontWeight.BOLD);- }-- if (- (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) &&- contextService.getContextValue(EDITOR_ACTIVATED) &&- contextService.getContextValue(FOCUSING_SHEET)- ) {- const textRun = getFontStyleAtCursor(accessor);- if (textRun == null) {- return;- }-- const bl = textRun.ts?.bl;- subscriber.next(bl === BooleanNumber.TRUE);- }- });-- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- if (!worksheet) {- subscriber.next(false);- return;- }-- let isBold = FontWeight.NORMAL;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isBold = range?.getFontWeight();- }- subscriber.next(isBold === FontWeight.BOLD);-- return disposable.dispose;- })),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),- };-}--export function SheetItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);- const univerInstanceService = accessor.get(IUniverInstanceService);- const selectionManagerService = accessor.get(SheetsSelectionsService);- const contextService = accessor.get(IContextService);-- return {- id: SHEET_ITALIC_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'ItalicIcon',- title: 'Set italic',- tooltip: 'toolbar.italic',- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;- if (id === SetRangeValuesMutation.id || id === SetSelectionsOperation.id || id === SetWorksheetActiveOperation.id) {- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let isItalic = FontItalic.NORMAL;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isItalic = range?.getFontStyle();- }-- subscriber.next(isItalic === FontItalic.ITALIC);- }-- if (- (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) &&- contextService.getContextValue(EDITOR_ACTIVATED) &&- contextService.getContextValue(FOCUSING_SHEET)- ) {- const textRun = getFontStyleAtCursor(accessor);- if (textRun == null) return;-- const it = textRun.ts?.it;- subscriber.next(it === BooleanNumber.TRUE);- }- });-- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let isItalic = FontItalic.NORMAL;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isItalic = range?.getFontStyle();- }-- subscriber.next(isItalic === FontItalic.ITALIC);- return disposable.dispose;- })),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),- };-}--export function SheetUnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);- const univerInstanceService = accessor.get(IUniverInstanceService);- const selectionManagerService = accessor.get(SheetsSelectionsService);- const contextService = accessor.get(IContextService);-- return {- id: SHEET_UNDERLINE_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'UnderlineIcon',- title: 'Set underline',- tooltip: 'toolbar.underline',- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;- if (id === SetRangeValuesMutation.id || id === SetSelectionsOperation.id || id === SetWorksheetActiveOperation.id) {- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let isUnderline;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isUnderline = range?.getUnderline();- }-- subscriber.next(!!(isUnderline && isUnderline.s));- }-- if (- (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) &&- contextService.getContextValue(EDITOR_ACTIVATED) &&- contextService.getContextValue(FOCUSING_SHEET)- ) {- const textRun = getFontStyleAtCursor(accessor);- if (textRun == null) return;-- const ul = textRun.ts?.ul;- subscriber.next(ul?.s === BooleanNumber.TRUE);- }- });-- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let isUnderline;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- isUnderline = range?.getUnderline();- }-- subscriber.next(!!(isUnderline && isUnderline.s));- return disposable.dispose;- })),- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),- };-}--export function SheetStrikeThroughMenuItemFactory(accessor: IAccessor): IMenuButtonItem {- const commandService = accessor.get(ICommandService);- const univerInstanceService = accessor.get(IUniverInstanceService);- const selectionManagerService = accessor.get(SheetsSelectionsService);- const contextService = accessor.get(IContextService);-- return {- id: SHEET_STRIKE_MUTATION_ID,- type: MenuItemType.BUTTON,- icon: 'StrikethroughIcon',- title: 'Set strike through',- tooltip: 'toolbar.strikethrough',- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new Observable<boolean>((subscriber) => {- const disposable = commandService.onCommandExecuted((c) => {- const id = c.id;- if (id === SetRangeValuesMutation.id || id === SetSelectionsOperation.id || id === SetWorksheetActiveOperation.id) {- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let st;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- st = range?.getStrikeThrough();- }-- subscriber.next(!!(st && st.s));- }-- if (- (id === SetTextSelectionsOperation.id || id === SetInlineFormatCommand.id) &&- contextService.getContextValue(EDITOR_ACTIVATED) &&- contextService.getContextValue(FOCUSING_SHEET)- ) {- const textRun = getFontStyleAtCursor(accessor);-- if (textRun == null) {- return;- }-- const st = textRun.ts?.st;-- subscriber.next(st?.s === BooleanNumber.TRUE);- }- });-- const primary = selectionManagerService.getCurrentLastSelection()?.primary;- let st;- if (primary != null) {- const range = worksheet.getRange(primary.startRow, primary.startColumn);- st = range?.getStrikeThrough();- }-- subscriber.next(!!(st && st.s));- return disposable.dispose;- })),- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),- };-}--function getFontStyleAtCursor(accessor: IAccessor) {- const univerInstanceService = accessor.get(IUniverInstanceService);- const textSelectionService = accessor.get(DocSelectionManagerService);-- const editorDataModel = univerInstanceService.getUniverDocInstance(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);- const activeTextRange = textSelectionService.getActiveRectRange();-- if (editorDataModel == null || activeTextRange == null) return null;-- const textRuns = editorDataModel.getBody()?.textRuns;- if (textRuns == null) return;-- const { startOffset } = activeTextRange;- const textRun = textRuns.find(({ st, ed }) => startOffset! >= st && startOffset! <= ed);- return textRun;-}diff --git a/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx b/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsxdeleted file mode 100644index efc0640dcb..0000000000--- a/packages-experimental/uni-sheets-ui/src/controllers/uni-sheets-ui.controller.tsx+++ /dev/null@@ -1,118 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Workbook } from '@univerjs/core';-import { ICommandService, IConfigService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { SetBackgroundColorCommand } from '@univerjs/sheets';-import { SHEETS_IMAGE_MENU_ID } from '@univerjs/sheets-drawing-ui';-import {- RenderSheetContent,- SetRangeBoldCommand,- SetRangeFontFamilyCommand,- SetRangeFontSizeCommand,- SetRangeItalicCommand,- SetRangeStrickThroughCommand,- SetRangeTextColorCommand,- SetRangeUnderlineCommand,- SheetUIController,-} from '@univerjs/sheets-ui';-import {- BuiltInUIPart,- ComponentManager,- connectInjector,- ILayoutService,- IMenuManagerService,- IShortcutService,- IUIPartsService,- useDependency,- useObservable,-} from '@univerjs/ui';-import { BuiltinUniToolbarItemId, generateCloneMutation, UniToolbarService, UniUIPart } from '@univerjs/uniui';-import { UniSheetBar } from '../views/uni-sheet-bar/UniSheetBar';-import { SHEET_BOLD_MUTATION_ID, SHEET_ITALIC_MUTATION_ID, SHEET_STRIKE_MUTATION_ID, SHEET_UNDERLINE_MUTATION_ID } from './menu';-import { menuSchema } from './menu.schema';--export class UniSheetsUIController extends SheetUIController {- constructor(- @Inject(Injector) injector: Injector,- @Inject(ComponentManager) componentManager: ComponentManager,- @ILayoutService layoutService: ILayoutService,- @ICommandService commandService: ICommandService,- @IShortcutService shortcutService: IShortcutService,- @IMenuManagerService menuManagerService: IMenuManagerService,- @IUIPartsService uiPartsService: IUIPartsService,- @IConfigService configService: IConfigService,- @Inject(UniToolbarService) private readonly _toolbarService: UniToolbarService- ) {- super(- injector,- componentManager,- layoutService,- commandService,- shortcutService,- menuManagerService,- uiPartsService,- configService- );- this._initUniMenus();- this._initMutations();- }-- protected override _initWorkbenchParts(): void {- const uiController = this._uiPartsService;- const injector = this._injector;-- this.disposeWithMe(uiController.registerComponent(UniUIPart.OUTLINE, () => connectInjector(RenderOutline, injector)));- this.disposeWithMe(uiController.registerComponent(BuiltInUIPart.CONTENT, () => connectInjector(RenderSheetContent, injector)));- }-- private _initUniMenus(): void {- this._menuManagerService.appendRootMenu(menuSchema);-- ([- [BuiltinUniToolbarItemId.FONT_FAMILY, SetRangeFontFamilyCommand.id],- [BuiltinUniToolbarItemId.FONT_SIZE, SetRangeFontSizeCommand.id],- [BuiltinUniToolbarItemId.COLOR, SetRangeTextColorCommand.id],- [BuiltinUniToolbarItemId.BACKGROUND, SetBackgroundColorCommand.id],- [BuiltinUniToolbarItemId.IMAGE, SHEETS_IMAGE_MENU_ID],- ]).forEach(([id, menuId]) => {- this._toolbarService.implementItem(id, { id: menuId, type: UniverInstanceType.UNIVER_SHEET });- });- }-- private _initMutations() {- [- generateCloneMutation(SHEET_BOLD_MUTATION_ID, SetRangeBoldCommand),- generateCloneMutation(SHEET_ITALIC_MUTATION_ID, SetRangeItalicCommand),- generateCloneMutation(SHEET_UNDERLINE_MUTATION_ID, SetRangeUnderlineCommand),- generateCloneMutation(SHEET_STRIKE_MUTATION_ID, SetRangeStrickThroughCommand),- ].forEach((mutation) => {- this.disposeWithMe(this._commandService.registerCommand(mutation));- });- }-}--function RenderOutline() {- const univerInstanceService = useDependency(IUniverInstanceService);- const focused = useObservable(univerInstanceService.focused$);- const workbook = useObservable(() => univerInstanceService.getCurrentTypeOfUnit$<Workbook>(UniverInstanceType.UNIVER_SHEET), null, false, []);-- if (!workbook || focused !== workbook?.getUnitId()) return null;-- return (- <UniSheetBar />- );-}diff --git a/packages-experimental/uni-sheets-ui/src/global.css b/packages-experimental/uni-sheets-ui/src/global.cssdeleted file mode 100644index 7c05d4ddc4..0000000000--- a/packages-experimental/uni-sheets-ui/src/global.css+++ /dev/null@@ -1,2 +0,0 @@-@tailwind components;-@tailwind utilities;diff --git a/packages-experimental/uni-sheets-ui/src/index.ts b/packages-experimental/uni-sheets-ui/src/index.tsdeleted file mode 100644index e5a1ffd7ea..0000000000--- a/packages-experimental/uni-sheets-ui/src/index.ts+++ /dev/null@@ -1,19 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import './global.css';--export { UniSheetsUIController } from './controllers/uni-sheets-ui.controller';diff --git a/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx b/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsxdeleted file mode 100644index 398ea244ec..0000000000--- a/packages-experimental/uni-sheets-ui/src/views/uni-sheet-bar/UniSheetBar.tsx+++ /dev/null@@ -1,149 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICommandInfo } from '@univerjs/core';-import type { IBaseSheetBarProps } from '@univerjs/sheets-ui';-import { ICommandService } from '@univerjs/core';-import { clsx, scrollbarClassName, Tooltip } from '@univerjs/design';-import { IncreaseIcon } from '@univerjs/icons';-import {- InsertSheetCommand,- InsertSheetMutation,- RemoveSheetMutation,- SetTabColorMutation,- SetWorksheetActiveOperation,- SetWorksheetHideMutation,- SetWorksheetNameMutation,- SetWorksheetOrderMutation,-} from '@univerjs/sheets';-import { useActiveWorkbook } from '@univerjs/sheets-ui';-import { useDependency } from '@univerjs/ui';-import { useCallback, useEffect, useRef, useState } from 'react';--export function UniSheetBar() {- const [sheetList, setSheetList] = useState<IBaseSheetBarProps[]>([]);- const [activeKey, setActiveKey] = useState('');- const workbook = useActiveWorkbook()!;- const commandService = useDependency(ICommandService);- const sheetBarRef = useRef<HTMLDivElement>(null);-- const updateSheetItems = useCallback(() => {- const currentSubUnitId = workbook.getActiveSheet()?.getSheetId() || '';- setActiveKey(currentSubUnitId);-- const sheets = workbook.getSheets();- const activeSheet = workbook.getActiveSheet();- const sheetListItems = sheets- .filter((sheet) => !sheet.isSheetHidden())- .map((sheet, index) => {- return {- sheetId: sheet.getSheetId(),- label: sheet.getName(),- index,- selected: activeSheet === sheet,- color: sheet.getTabColor() ?? undefined,- };- });-- setSheetList(sheetListItems);- setActiveKey(currentSubUnitId);- }, [workbook]);-- useEffect(() => {- updateSheetItems();- const disposable = setupStatusUpdate();-- return () => {- disposable.dispose();- };- }, [workbook]);-- const handleSheetActiveChange = (subUnitId: string | undefined) => {- if (!subUnitId) return;-- commandService.executeCommand(SetWorksheetActiveOperation.id, {- subUnitId,- unitId: workbook.getUnitId(),- });- };-- const handleSheetAdd = () => {- commandService.executeCommand(InsertSheetCommand.id);- };-- const setupStatusUpdate = () =>- commandService.onCommandExecuted((commandInfo: ICommandInfo) => {- switch (commandInfo.id) {- case SetTabColorMutation.id:- case SetWorksheetHideMutation.id:- case RemoveSheetMutation.id:- case SetWorksheetNameMutation.id:- case InsertSheetMutation.id:- case SetWorksheetOrderMutation.id:- case SetWorksheetActiveOperation.id:- updateSheetItems();- break;- default:- break;- }- });-- return (- <div className="univer-flex univer-h-full univer-select-none univer-flex-col univer-justify-between" ref={sheetBarRef}>- <div className={clsx('univer-overflow-y-auto', scrollbarClassName)}>- <div className="univer-flex univer-flex-col univer-gap-1 univer-text-sm univer-font-medium">- {sheetList.map((item, index) => (- <div- key={index}- className={clsx(`- univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-rounded-lg- univer-px-1 univer-py-0- hover:univer-bg-gray-100- dark:hover:!univer-bg-gray-700- `, activeKey === item.sheetId ? 'univer-text-primary-500' : '')}- onClick={() => handleSheetActiveChange(item.sheetId)}- >- <Tooltip showIfEllipsis title={item.label} placement="right">- <span>- {' '}- {item.label}- {' '}- </span>- </Tooltip>- </div>- ))}- </div>- </div>-- <button- type="button"- className={`- before:absolute before:left-0 before:top-0 before:h-full before:w-full before:bg-gray-100- before:content-['']- univer-relative univer-mt-4 univer-flex univer-h-8 univer-items-center univer-justify-center- univer-rounded-lg univer-border-0 univer-bg-transparent univer-text-primary-600- hover:univer-cursor-pointer hover:univer-bg-gray-100- dark:hover:!univer-bg-gray-700- `}-- onClick={handleSheetAdd}- >- <IncreaseIcon className="univer-mr-1 univer-size-4" />- <span>New sheet</span>- </button>- </div>- );-}diff --git a/packages-experimental/uni-sheets-ui/src/vite-env.d.ts b/packages-experimental/uni-sheets-ui/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uni-sheets-ui/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uni-sheets-ui/tailwind.config.ts b/packages-experimental/uni-sheets-ui/tailwind.config.tsdeleted file mode 100644index 75967f186f..0000000000--- a/packages-experimental/uni-sheets-ui/tailwind.config.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Config } from 'tailwindcss';-import preset from '@univerjs-infra/shared/tailwind';--const config: Config = {- presets: [preset],- content: [- './src/**/*.{js,ts,jsx,tsx}',- ],-};--export default config;diff --git a/packages-experimental/uni-sheets-ui/tsconfig.json b/packages-experimental/uni-sheets-ui/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uni-sheets-ui/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uni-sheets-ui/tsconfig.node.json b/packages-experimental/uni-sheets-ui/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uni-sheets-ui/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uni-sheets-ui/vitest.config.ts b/packages-experimental/uni-sheets-ui/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uni-sheets-ui/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/packages-experimental/uni-slides-ui/README.md b/packages-experimental/uni-slides-ui/README.mddeleted file mode 100644index e4801469ab..0000000000--- a/packages-experimental/uni-slides-ui/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uni-slides-ui--[](https://npmjs.org/packages/@univerjs/uni-slides-ui)-[](https://img.shields.io/npm/l/@univerjs/uni-slides-ui)--## Introduction--> TODO: Introduction--## Usage--### Installation--```shell-npm i @univerjs/uni-slides-ui-```diff --git a/packages-experimental/uni-slides-ui/package.json b/packages-experimental/uni-slides-ui/package.jsondeleted file mode 100644index 323354a83e..0000000000--- a/packages-experimental/uni-slides-ui/package.json+++ /dev/null@@ -1,80 +0,0 @@-{- "name": "@univerjs/uni-slides-ui",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "peerDependencies": {- "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"- },- "dependencies": {- "@univerjs/core": "workspace:*",- "@univerjs/design": "workspace:*",- "@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^1.1.0",- "@univerjs/slides-ui": "workspace:*",- "@univerjs/ui": "workspace:*",- "@univerjs/uniui": "workspace:*"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "postcss": "^8.5.6",- "react": "18.3.1",- "rxjs": "^7.8.2",- "tailwindcss": "3.4.18",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uni-slides-ui/postcss.config.mjs b/packages-experimental/uni-slides-ui/postcss.config.mjsdeleted file mode 100644index 7d59f53133..0000000000--- a/packages-experimental/uni-slides-ui/postcss.config.mjs+++ /dev/null@@ -1 +0,0 @@-export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages-experimental/uni-slides-ui/src/controllers/menu.schema.ts b/packages-experimental/uni-slides-ui/src/controllers/menu.schema.tsdeleted file mode 100644index b3024f179f..0000000000--- a/packages-experimental/uni-slides-ui/src/controllers/menu.schema.ts+++ /dev/null@@ -1,24 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { MenuSchemaType } from '@univerjs/ui';-import { SlidesUIMenuSchema } from '@univerjs/slides-ui';-import { RibbonStartGroup } from '@univerjs/ui';-import { UNI_MENU_POSITIONS } from '@univerjs/uniui';--export const menuSchema: MenuSchemaType = {- [UNI_MENU_POSITIONS.TOOLBAR_MAIN]: (SlidesUIMenuSchema as any)[RibbonStartGroup.FORMAT],-};diff --git a/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx b/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsxdeleted file mode 100644index e99b72ab0a..0000000000--- a/packages-experimental/uni-slides-ui/src/controllers/uni-slides-ui.controller.tsx+++ /dev/null@@ -1,69 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { SlideDataModel } from '@univerjs/core';-import { ICommandService, Inject, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { SHAPE_MENU_ID, SlideAddTextCommand, SlideEditorContainer, SLIDES_IMAGE_MENU_ID, SlidesUIController } from '@univerjs/slides-ui';-import { BuiltInUIPart, ComponentManager, connectInjector, IMenuManagerService, IShortcutService, IUIPartsService, useDependency, useObservable } from '@univerjs/ui';-import { BuiltinUniToolbarItemId, UniToolbarService, UniUIPart } from '@univerjs/uniui';-import { UniSlideSideBar } from '../views/UniSlideSideBar';-import { menuSchema } from './menu.schema';--export class UniSlidesUIController extends SlidesUIController {- constructor(- @Inject(Injector) _injector: Injector,- @IMenuManagerService _menuManagerService: IMenuManagerService,- @Inject(ComponentManager) _componentManager: ComponentManager,- @IUIPartsService _uiPartsService: IUIPartsService,- @ICommandService _commandService: ICommandService,- @IShortcutService _shortcutService: IShortcutService,- @Inject(UniToolbarService) private readonly _toolbarService: UniToolbarService- ) {- super(_injector, _menuManagerService, _componentManager, _uiPartsService, _commandService, _shortcutService);- this._initUniMenus();- }-- protected override _initUIComponents(): void {- this.disposeWithMe(this._uiPartsService.registerComponent(UniUIPart.OUTLINE, () => connectInjector(RenderOutline, this._injector)));-- this.disposeWithMe(- this._uiPartsService.registerComponent(BuiltInUIPart.CONTENT, () => connectInjector(SlideEditorContainer, this._injector))- );- }-- private _initUniMenus(): void {- this._menuManagerService.appendRootMenu(menuSchema);-- ([- [BuiltinUniToolbarItemId.IMAGE, SLIDES_IMAGE_MENU_ID],- [BuiltinUniToolbarItemId.FONT_GROUP, SHAPE_MENU_ID],- [BuiltinUniToolbarItemId.TABLE, SlideAddTextCommand.id],- ]).forEach(([id, menuId]) => {- this._toolbarService.implementItem(id, { id: menuId, type: UniverInstanceType.UNIVER_SLIDE });- });- }-}--function RenderOutline() {- const univerInstanceService = useDependency(IUniverInstanceService);- const focused = useObservable(univerInstanceService.focused$);- const slide = useObservable(() => univerInstanceService.getCurrentTypeOfUnit$<SlideDataModel>(UniverInstanceType.UNIVER_SLIDE), null, false, []);- if (!slide || focused !== slide.getUnitId()) return null;-- return (- <UniSlideSideBar />- );-}diff --git a/packages-experimental/uni-slides-ui/src/global.css b/packages-experimental/uni-slides-ui/src/global.cssdeleted file mode 100644index 7c05d4ddc4..0000000000--- a/packages-experimental/uni-slides-ui/src/global.css+++ /dev/null@@ -1,2 +0,0 @@-@tailwind components;-@tailwind utilities;diff --git a/packages-experimental/uni-slides-ui/src/index.ts b/packages-experimental/uni-slides-ui/src/index.tsdeleted file mode 100644index b12e44bdb9..0000000000--- a/packages-experimental/uni-slides-ui/src/index.ts+++ /dev/null@@ -1,19 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import './global.css';--export { UniSlidesUIController } from './controllers/uni-slides-ui.controller';diff --git a/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx b/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsxdeleted file mode 100644index 936d23dd0e..0000000000--- a/packages-experimental/uni-slides-ui/src/views/UniSlideSideBar.tsx+++ /dev/null@@ -1,145 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { SlideDataModel } from '@univerjs/core';-import { ICommandService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';-import { borderClassName, clsx, scrollbarClassName } from '@univerjs/design';-import { IRenderManagerService } from '@univerjs/engine-render';-import { IncreaseIcon } from '@univerjs/icons';-import { ActivateSlidePageOperation, AppendSlideOperation, SetSlidePageThumbOperation } from '@univerjs/slides-ui';-import { useDependency, useObservable } from '@univerjs/ui';-import { createRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';--/**- * This components works as the root component of the left Sidebar of Slide.- */--export function UniSlideSideBar() {- const univerInstanceService = useDependency(IUniverInstanceService);- const commandService = useDependency(ICommandService);- const renderManagerService = useDependency(IRenderManagerService);- const localeService = useDependency(LocaleService);-- const slideBarRef = useRef<HTMLDivElement>(null);- const currentSlide = useObservable(- () => univerInstanceService.getCurrentTypeOfUnit$<SlideDataModel>(UniverInstanceType.UNIVER_SLIDE),- undefined,- undefined,- []- );- const pages = currentSlide?.getPages();- const pageOrder = currentSlide?.getPageOrder();-- if (!pages || !pageOrder) {- return null;- }-- const slideList = pageOrder.map((id) => pages[id]);-- const [activatePageId, setActivatePageId] = useState<string | null>(pageOrder[0]);- const [barHeight, setBarHeight] = useState(0);-- const divRefs = useMemo(() => slideList.map(() => createRef<HTMLDivElement>()), [slideList]);-- useEffect(() => {- const subscriber = currentSlide?.activePage$.subscribe((page) => {- const id = page?.id ?? null;-- id && setActivatePageId(id);- });-- return () => {- subscriber?.unsubscribe();- };- }, []);-- useEffect(() => {- divRefs.forEach((ref, index) => {- if (ref.current) {- const slide = slideList[index];- renderManagerService.getRenderById(slide.id)?.engine.setContainer(ref.current);- }- });-- if (divRefs.length > 0) {- commandService.syncExecuteCommand(SetSlidePageThumbOperation.id, {- unitId: currentSlide?.getUnitId(),- });- }- }, [divRefs, commandService, renderManagerService, slideList, currentSlide]); // 依赖于divRefs数组的变化-- useEffect(() => {- const slideBar = slideBarRef.current;- if (slideBar) {- setBarHeight(slideBar.clientHeight - 38);- }- }, []);-- const activatePage = useCallback((page: string) => {- commandService.syncExecuteCommand(ActivateSlidePageOperation.id, { id: page, unitId: currentSlide?.getUnitId() });- }, [commandService, currentSlide]);-- const handleAppendSlide = useCallback(() => {- commandService.syncExecuteCommand(AppendSlideOperation.id, { unitId: currentSlide?.getUnitId() });- }, [commandService, currentSlide]);-- return (- <div className="univer-flex univer-h-full univer-select-none univer-flex-col" ref={slideBarRef}>- <div- className={clsx('univer-overflow-y-auto', scrollbarClassName)}- style={{ height: `${barHeight}px` }}- >- {slideList.map((item, index) => (- <div- key={item.id}- className={clsx(`- univer-relative univer-my-4 univer-box-border univer-flex univer-w-[160px]- univer-overflow-hidden univer-rounded-lg- hover:univer-border-primary-600- `, borderClassName, item.id === activatePageId && 'univer-border-primary-600')}- onClick={() => activatePage(item.id)}- >- <span- className={`- univer-absolute univer-bottom-1 univer-left-1 univer-z-10 univer-inline-flex univer-size-5- univer-items-center univer-justify-center univer-overflow-hidden univer-rounded- univer-text-xs univer-text-white- `}- >- {index + 1}- </span>- <div ref={divRefs[index]} className="univer-relative univer-h-[90px] univer-w-[160px]" />- </div>- ))}- </div>- <button- type="button"- className={`- before:absolute before:left-0 before:top-0 before:h-px before:content-[''] before:univer-bg-gray-200- univer-relative univer-mt-4 univer-flex univer-h-8 univer-cursor-pointer univer-items-center- univer-justify-center univer-rounded-lg univer-border-0 univer-bg-transparent univer-px-1- univer-text-primary-500- hover:univer-bg-gray-100- dark:hover:!univer-bg-gray-700- `}- onClick={handleAppendSlide}- >- <IncreaseIcon className="univer-mr-1 univer-size-4" />- <span>{localeService.t('slide.append')}</span>- </button>- </div>- );-}diff --git a/packages-experimental/uni-slides-ui/src/vite-env.d.ts b/packages-experimental/uni-slides-ui/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uni-slides-ui/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uni-slides-ui/tailwind.config.ts b/packages-experimental/uni-slides-ui/tailwind.config.tsdeleted file mode 100644index 75967f186f..0000000000--- a/packages-experimental/uni-slides-ui/tailwind.config.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Config } from 'tailwindcss';-import preset from '@univerjs-infra/shared/tailwind';--const config: Config = {- presets: [preset],- content: [- './src/**/*.{js,ts,jsx,tsx}',- ],-};--export default config;diff --git a/packages-experimental/uni-slides-ui/tsconfig.json b/packages-experimental/uni-slides-ui/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uni-slides-ui/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uni-slides-ui/tsconfig.node.json b/packages-experimental/uni-slides-ui/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uni-slides-ui/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uni-slides-ui/vitest.config.ts b/packages-experimental/uni-slides-ui/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uni-slides-ui/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/packages-experimental/uniui/README.md b/packages-experimental/uniui/README.mddeleted file mode 100644index fb7f05dcb9..0000000000--- a/packages-experimental/uniui/README.md+++ /dev/null@@ -1,16 +0,0 @@-# @univerjs/uniui--[](https://npmjs.org/packages/@univerjs/uniui)-[](https://img.shields.io/npm/l/@univerjs/uniui)--## Introduction--> TODO: Introduction--## Usage--### Installation--```shell-npm i @univerjs/uniui-```diff --git a/packages-experimental/uniui/package.json b/packages-experimental/uniui/package.jsondeleted file mode 100644index 2388247cff..0000000000--- a/packages-experimental/uniui/package.json+++ /dev/null@@ -1,86 +0,0 @@-{- "name": "@univerjs/uniui",- "version": "0.0.0",- "private": true,- "description": "",- "author": "DreamNum <[email protected]>",- "license": "Apache-2.0",- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/univer"- },- "homepage": "https://univer.ai",- "repository": {- "type": "git",- "url": "https://github.com/dream-num/univer"- },- "bugs": {- "url": "https://github.com/dream-num/univer/issues"- },- "keywords": [],- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "main": "./src/index.ts",- "types": "./lib/types/index.d.ts",- "publishConfig": {- "access": "public",- "main": "./lib/es/index.js",- "module": "./lib/es/index.js",- "exports": {- ".": {- "import": "./lib/es/index.js",- "require": "./lib/cjs/index.js",- "types": "./lib/types/index.d.ts"- },- "./*": {- "import": "./lib/es/*",- "require": "./lib/cjs/*",- "types": "./lib/types/index.d.ts"- },- "./lib/*": "./lib/*"- }- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "scripts": {- "test": "vitest run",- "test:watch": "vitest",- "coverage": "vitest run --coverage",- "typecheck": "tsc --noEmit",- "build": "univer-cli build"- },- "peerDependencies": {- "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",- "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",- "rxjs": ">=7.0.0"- },- "dependencies": {- "@floating-ui/react-dom": "^2.1.6",- "@univerjs/core": "workspace:*",- "@univerjs/design": "workspace:*",- "@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^1.1.0",- "@univerjs/sheets": "workspace:*",- "@univerjs/sheets-ui": "workspace:*",- "@univerjs/ui": "workspace:*",- "@xyflow/react": "^12.10.0"- },- "devDependencies": {- "@univerjs-infra/shared": "workspace:*",- "@univerjs/themes": "workspace:*",- "postcss": "^8.5.6",- "react": "18.3.1",- "react-dom": "18.3.1",- "rxjs": "^7.8.2",- "tailwindcss": "3.4.18",- "typescript": "^5.9.3",- "vite": "^7.3.0",- "vitest": "^4.0.16"- }-}diff --git a/packages-experimental/uniui/postcss.config.mjs b/packages-experimental/uniui/postcss.config.mjsdeleted file mode 100644index 7d59f53133..0000000000--- a/packages-experimental/uniui/postcss.config.mjs+++ /dev/null@@ -1 +0,0 @@-export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages-experimental/uniui/src/commands/operations/set-flow-viewport.operation.ts b/packages-experimental/uniui/src/commands/operations/set-flow-viewport.operation.tsdeleted file mode 100644index 00741bcbcb..0000000000--- a/packages-experimental/uniui/src/commands/operations/set-flow-viewport.operation.ts+++ /dev/null@@ -1,51 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor, ICommand, IExecutionOptions } from '@univerjs/core';-import { CommandType } from '@univerjs/core';-import { FlowManagerService } from '../../services/flow/flow-manager.service';--export interface ISetFlowViewportParams {- viewport: {- zoom: number;- x: number;- y: number;- };-}--// This operation will not trigger viewport change locally but for live-share collaboration.--export const SetFlowViewportOperation: ICommand = {- id: 'uniui.operation.set-flow-viewport',- type: CommandType.OPERATION,- handler: async (accessor: IAccessor, params: ISetFlowViewportParams, options?: IExecutionOptions) => {- const { fromCollab } = options || {};- if (!fromCollab) {- return true;- }- const flowManagerService = accessor.get(FlowManagerService);- const oldViewport = flowManagerService.getViewport();- const { viewport } = params;- const { zoom, x, y } = viewport;- if (oldViewport) {- if (zoom === oldViewport.zoom && x === oldViewport.x && y === oldViewport.y) {- return false;- }- }- flowManagerService.setViewport(viewport);- return true;- },-};diff --git a/packages-experimental/uniui/src/commands/operations/uni-focus-unit.operation.ts b/packages-experimental/uniui/src/commands/operations/uni-focus-unit.operation.tsdeleted file mode 100644index 61dfb91d37..0000000000--- a/packages-experimental/uniui/src/commands/operations/uni-focus-unit.operation.ts+++ /dev/null@@ -1,33 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor, ICommand } from '@univerjs/core';-import { CommandType, IUniverInstanceService } from '@univerjs/core';--export interface IUniFocusUnitParams {- unitId: string | null;-}--export const UniFocusUnitOperation: ICommand = {- id: 'uniui.operation.uni-focus-unit',- type: CommandType.OPERATION,- handler: async (accessor: IAccessor, params: IUniFocusUnitParams) => {- const { unitId } = params;- const instanceService = accessor.get(IUniverInstanceService);- instanceService.focusUnit(unitId);- return true;- },-};diff --git a/packages-experimental/uniui/src/commands/operations/uni.operation.ts b/packages-experimental/uniui/src/commands/operations/uni.operation.tsdeleted file mode 100644index 6de9a3b25a..0000000000--- a/packages-experimental/uniui/src/commands/operations/uni.operation.ts+++ /dev/null@@ -1,31 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor, ICommand } from '@univerjs/core';-import { CommandType, IUniverInstanceService } from '@univerjs/core';--export const DisposeUnitOperation: ICommand = {- id: 'uniui.operation.dispose-unit',- type: CommandType.OPERATION,- handler: async (accessor: IAccessor) => {- const univerInstanceService = accessor.get(IUniverInstanceService);- const unitId = univerInstanceService.getFocusedUnit()?.getUnitId();- if (unitId) {- univerInstanceService.disposeUnit(unitId);- }- return true;- },-};diff --git a/packages-experimental/uniui/src/controllers/menu.schema.ts b/packages-experimental/uniui/src/controllers/menu.schema.tsdeleted file mode 100644index 26cd397d80..0000000000--- a/packages-experimental/uniui/src/controllers/menu.schema.ts+++ /dev/null@@ -1,109 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { MenuSchemaType } from '@univerjs/ui';-import { RibbonStartGroup, UIMenuSchema } from '@univerjs/ui';-import { FONT_GROUP_MENU_ID } from '@univerjs/uniui';-import {- DELETE_MENU_ID,- DeleteMenuItemFactory,- DOWNLOAD_MENU_ID,- DownloadMenuItemFactory,- FAKE_BG_COLOR_MENU_ID,- FAKE_FONT_COLOR_MENU_ID,- FAKE_FONT_FAMILY_MENU_ID,- FAKE_FONT_GROUP_MENU_ID,- FAKE_FONT_SIZE_MENU_ID,- FAKE_IMAGE_MENU_ID,- FAKE_ORDER_LIST_MENU_ID,- FAKE_TABLE_MENU_ID,- FAKE_UNORDER_LIST_MENU_ID,- FakeBackgroundColorSelectorMenuItemFactory,- FakeFontFamilySelectorMenuItemFactory,- FakeFontGroupMenuItemFactory,- FakeFontSizeSelectorMenuItemFactory,- FakeImageMenuFactory,- FakeOrderListMenuItemFactory,- FakePivotTableMenuItemFactory,- FakeTextColorSelectorMenuItemFactory,- FakeUnorderListMenuItemFactory,- FontGroupMenuItemFactory,- // LOCK_MENU_ID,- // LockMenuItemFactory,- PRINT_MENU_ID,- PrintMenuItemFactory,- SHARE_MENU_ID,- ShareMenuItemFactory,- UNI_MENU_POSITIONS,- ZEN_MENU_ID,- ZenMenuItemFactory,-} from './menu';--export const menuSchema: MenuSchemaType = {- [UNI_MENU_POSITIONS.TOOLBAR_MAIN]: {- ...(UIMenuSchema as any)[RibbonStartGroup.HISTORY],- [FAKE_FONT_FAMILY_MENU_ID]: {- menuItemFactory: FakeFontFamilySelectorMenuItemFactory,- },- [FAKE_FONT_SIZE_MENU_ID]: {- menuItemFactory: FakeFontSizeSelectorMenuItemFactory,- },- [FAKE_FONT_COLOR_MENU_ID]: {- menuItemFactory: FakeTextColorSelectorMenuItemFactory,- },- [FAKE_BG_COLOR_MENU_ID]: {- menuItemFactory: FakeBackgroundColorSelectorMenuItemFactory,- },- [FAKE_IMAGE_MENU_ID]: {- menuItemFactory: FakeImageMenuFactory,- },- [FAKE_UNORDER_LIST_MENU_ID]: {- menuItemFactory: FakeUnorderListMenuItemFactory,- },- [FAKE_ORDER_LIST_MENU_ID]: {- menuItemFactory: FakeOrderListMenuItemFactory,- },- [FONT_GROUP_MENU_ID]: {- menuItemFactory: FontGroupMenuItemFactory,- },- [FAKE_FONT_GROUP_MENU_ID]: {- menuItemFactory: FakeFontGroupMenuItemFactory,- },- [FAKE_TABLE_MENU_ID]: {- menuItemFactory: FakePivotTableMenuItemFactory,- },- },- [UNI_MENU_POSITIONS.TOOLBAR_FLOAT]: {- [DOWNLOAD_MENU_ID]: {- menuItemFactory: DownloadMenuItemFactory,- },- [SHARE_MENU_ID]: {- menuItemFactory: ShareMenuItemFactory,- },- // [LOCK_MENU_ID]: {- // menuItemFactory: LockMenuItemFactory,- // },- [PRINT_MENU_ID]: {- menuItemFactory: PrintMenuItemFactory,- },- [ZEN_MENU_ID]: {- menuItemFactory: ZenMenuItemFactory,- },- [DELETE_MENU_ID]: {- menuItemFactory: DeleteMenuItemFactory,- },- },-};diff --git a/packages-experimental/uniui/src/controllers/menu.ts b/packages-experimental/uniui/src/controllers/menu.tsdeleted file mode 100644index 10a5ce1c30..0000000000--- a/packages-experimental/uniui/src/controllers/menu.ts+++ /dev/null@@ -1,248 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IAccessor } from '@univerjs/core';-import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';-import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { MenuItemType } from '@univerjs/ui';-import { Observable } from 'rxjs';-import { DisposeUnitOperation } from '../commands/operations/uni.operation';--export const UNIT_LINE_COLOR_MENU_ID = 'UNIT_LINE_COLOR_MENU_ID';-export const DOWNLOAD_MENU_ID = 'DOWNLOAD_MENU_ID';-export const SHARE_MENU_ID = 'SHARE_MENU_ID';-export const LOCK_MENU_ID = 'LOCK_MENU_ID';-export const PRINT_MENU_ID = 'PRINT_MENU_ID';-export const ZEN_MENU_ID = 'ZEN_MENU_ID';-export const DELETE_MENU_ID = DisposeUnitOperation.id;-export const FRAME_SIZE_MENU_ID = 'FRAME_SIZE_MENU_ID';--export const FONT_GROUP_MENU_ID = 'FONT_GROUP_MENU_ID';--export const FAKE_FONT_FAMILY_MENU_ID = 'FAKE_FONT_FAMILY_MENU_ID';-export const FAKE_FONT_SIZE_MENU_ID = 'FAKE_FONT_SIZE_MENU_ID';-export const FAKE_FONT_COLOR_MENU_ID = 'FAKE_FONT_COLOR_MENU_ID';-export const FAKE_BG_COLOR_MENU_ID = 'FAKE_BG_COLOR_MENU_ID';-export const FAKE_IMAGE_MENU_ID = 'FAKE_IMAGE_MENU_ID';-export const FAKE_FONT_GROUP_MENU_ID = 'FAKE_FONT_GROUP_MENU_ID';-export const FAKE_TABLE_MENU_ID = 'FAKE_TABLE_MENU_ID';-export const FAKE_UNORDER_LIST_MENU_ID = 'FAKE_UNORDER_LIST_MENU_ID';-export const FAKE_ORDER_LIST_MENU_ID = 'FAKE_ORDER_LIST_MENU_ID';--export enum UNI_MENU_POSITIONS {- TOOLBAR_MAIN = 'toolbar_main',- TOOLBAR_FLOAT = 'toolbar_float',-}--export function FakeFontFamilySelectorMenuItemFactory(): IMenuSelectorItem<string> {- return {- id: FAKE_FONT_FAMILY_MENU_ID,- tooltip: 'toolbar.font',- type: MenuItemType.SELECTOR,- label: 'UI_PLUGIN_DOCS_FONT_SIZE_COMPONENT',- selections: [],- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeFontSizeSelectorMenuItemFactory(): IMenuSelectorItem<number> {- return {- id: FAKE_FONT_SIZE_MENU_ID,- type: MenuItemType.SELECTOR,- tooltip: 'toolbar.fontSize',- label: {- name: 'UI_PLUGIN_DOCS_FONT_SIZE_COMPONENT',- props: {- min: 1,- max: 400,- },- },- selections: [],- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeTextColorSelectorMenuItemFactory(): IMenuSelectorItem<string> {- return {- id: FAKE_FONT_COLOR_MENU_ID,- icon: 'FontColorDoubleIcon',- tooltip: 'toolbar.textColor.main',- type: MenuItemType.BUTTON_SELECTOR,- selections: [],- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeBackgroundColorSelectorMenuItemFactory(): IMenuSelectorItem<string> {- return {- id: FAKE_BG_COLOR_MENU_ID,- tooltip: 'toolbar.fillColor.main',- type: MenuItemType.BUTTON_SELECTOR,- icon: 'PaintBucketDoubleIcon',- selections: [],- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeImageMenuFactory(): IMenuItem {- return {- id: FAKE_IMAGE_MENU_ID,- type: MenuItemType.SUBITEMS,- icon: 'AdditionAndSubtractionIcon',- tooltip: 'sheetImage.title',- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeUnorderListMenuItemFactory(): IMenuItem {- return {- id: FAKE_UNORDER_LIST_MENU_ID,- type: MenuItemType.BUTTON_SELECTOR,- icon: 'UnorderIcon',- tooltip: 'toolbar.unorder',- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakeOrderListMenuItemFactory(): IMenuItem {- return {- id: FAKE_ORDER_LIST_MENU_ID,- type: MenuItemType.BUTTON_SELECTOR,- icon: 'OrderIcon',- tooltip: 'toolbar.order',- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FontGroupMenuItemFactory(accessor: IAccessor): IMenuSelectorItem {- const univerInstanceService = accessor.get(IUniverInstanceService);- return {- id: FONT_GROUP_MENU_ID,- type: MenuItemType.SUBITEMS,- tooltip: 'Font group',- icon: 'BoldIcon',- hidden$: new Observable((subscriber) => {- const subscription = univerInstanceService.focused$.subscribe((unitId) => {- if (unitId == null) {- return subscriber.next(true);- }- const univerType = univerInstanceService.getUnitType(unitId);-- subscriber.next(univerType === UniverInstanceType.UNIVER_SLIDE);- });-- const focusedUniverInstance = univerInstanceService.getFocusedUnit();-- if (focusedUniverInstance == null) {- return subscriber.next(true);- }-- const univerType = univerInstanceService.getUnitType(focusedUniverInstance.getUnitId());- subscriber.next(univerType === UniverInstanceType.UNIVER_SLIDE);-- return () => subscription.unsubscribe();- }),- };-}--export function FakeFontGroupMenuItemFactory(): IMenuSelectorItem {- return {- id: FAKE_FONT_GROUP_MENU_ID,- type: MenuItemType.SUBITEMS,- tooltip: 'Font group',- icon: 'BoldIcon',- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function FakePivotTableMenuItemFactory(): IMenuItem {- return {- id: FAKE_TABLE_MENU_ID,- type: MenuItemType.BUTTON,- icon: 'PivotTableIcon',- tooltip: 'PivotTable',- disabled$: new Observable((subscriber) => { subscriber.next(true); }),- };-}--export function UnitLineColorMenuItemFactory(): IMenuButtonItem {- return {- id: UNIT_LINE_COLOR_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- icon: '',- };-}--export function DownloadMenuItemFactory(): IMenuButtonItem {- return {- id: DOWNLOAD_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- tooltip: 'Download',- icon: 'DownloadIcon',- };-}--export function ShareMenuItemFactory(): IMenuButtonItem {- return {- id: SHARE_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- tooltip: 'Share',- icon: 'ShareIcon',- };-}--export function LockMenuItemFactory(): IMenuButtonItem {- return {- id: LOCK_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- tooltip: 'Lock',- icon: 'LockIcon',- };-}--export function PrintMenuItemFactory(): IMenuButtonItem {- return {- id: PRINT_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- tooltip: 'Print',- icon: 'PrintIcon',- };-}--export function ZenMenuItemFactory(): IMenuButtonItem {- return {- id: ZEN_MENU_ID,- type: MenuItemType.BUTTON,- title: '',- icon: 'ZenIcon',- tooltip: 'Full screen',- };-}--export function DeleteMenuItemFactory(): IMenuButtonItem {- return {- id: DELETE_MENU_ID,- type: MenuItemType.BUTTON,- title: 'Delete',- tooltip: 'Delete',- icon: 'DeleteIcon',- };-}diff --git a/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx b/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsxdeleted file mode 100644index 758cf8efd6..0000000000--- a/packages-experimental/uniui/src/controllers/uniui-desktop.controller.tsx+++ /dev/null@@ -1,114 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IDisposable } from '@univerjs/core';-import type { IUniverUIConfig, IWorkbenchOptions } from '@univerjs/ui';-import { Disposable, Inject, Injector, LifecycleService, LifecycleStages, Optional, toDisposable } from '@univerjs/core';-import { render as createRoot, unmount } from '@univerjs/design';-import { BuiltInUIPart, CanvasPopup, connectInjector, FloatDom, ILayoutService, IUIPartsService } from '@univerjs/ui';-import { delay, filter, take } from 'rxjs';--import { UniWorkbench } from '../views/workbench/UniWorkbench';--const STEADY_TIMEOUT = 3000;--export class UniverUniUIController extends Disposable {- constructor(- private readonly _config: IUniverUIConfig,- @Inject(Injector) private readonly _injector: Injector,- @Inject(LifecycleService) private readonly _lifecycleService: LifecycleService,- @IUIPartsService private readonly _uiPartsService: IUIPartsService,- @Optional(ILayoutService) private readonly _layoutService?: ILayoutService- ) {- super();-- this._initBuiltinComponents();-- Promise.resolve().then(() => this._bootstrapWorkbench());- }-- private _bootstrapWorkbench(): void {- this.disposeWithMe(- bootstrap(this._injector, this._config, (contentEl, containerEl) => {- if (this._layoutService) {- this.disposeWithMe(this._layoutService.registerContentElement(contentEl));- this.disposeWithMe(this._layoutService.registerContainerElement(containerEl));- }-- this._lifecycleService.lifecycle$.pipe(- filter((lifecycle) => lifecycle === LifecycleStages.Ready),- delay(300),- take(1)- ).subscribe(() => {- this._lifecycleService.stage = LifecycleStages.Rendered;- setTimeout(() => this._lifecycleService.stage = LifecycleStages.Steady, STEADY_TIMEOUT);- });- })- );- }-- private _initBuiltinComponents() {- this.disposeWithMe(this._uiPartsService.registerComponent(BuiltInUIPart.FLOATING, () => connectInjector(CanvasPopup, this._injector)));- this.disposeWithMe(this._uiPartsService.registerComponent(BuiltInUIPart.UNIT, () => connectInjector(FloatDom, this._injector)));- }-}--function bootstrap(- injector: Injector,- options: IWorkbenchOptions,- callback: (contentEl: HTMLElement, containerElement: HTMLElement) => void-): IDisposable {- let mountContainer: HTMLElement;-- const container = options.container;- if (typeof container === 'string') {- const containerElement = document.getElementById(container);- if (!containerElement) {- mountContainer = createContainer(container);- } else {- mountContainer = containerElement;- }- } else if (container instanceof HTMLElement) {- mountContainer = container;- } else {- mountContainer = createContainer('univer');- }-- const ConnectedApp = connectInjector(UniWorkbench, injector);- function render() {- createRoot(- <ConnectedApp- {...options}- mountContainer={mountContainer}- onRendered={(contentEl) => callback(contentEl, mountContainer)}- />,- mountContainer- );- }-- render();-- return toDisposable(() => {- unmount(mountContainer);- });-}--function createContainer(id: string): HTMLElement {- const element = document.createElement('div');- element.id = id;- // FIXME: the element is not append to the DOM tree. So it won't be rendered.- return element;-}diff --git a/packages-experimental/uniui/src/controllers/uniui-flow.controller.tsx b/packages-experimental/uniui/src/controllers/uniui-flow.controller.tsxdeleted file mode 100644index c1d0e06d73..0000000000--- a/packages-experimental/uniui/src/controllers/uniui-flow.controller.tsx+++ /dev/null@@ -1,53 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IFlowViewport } from '../services/flow/flow-manager.service';-import { Disposable, ICommandService, Inject } from '@univerjs/core';-import { auditTime, throttleTime } from 'rxjs';-import { SetFlowViewportOperation } from '../commands/operations/set-flow-viewport.operation';-import { UniFocusUnitOperation } from '../commands/operations/uni-focus-unit.operation';-import { FlowManagerService } from '../services/flow/flow-manager.service';--export class UniuiFlowController extends Disposable {- constructor(- @ICommandService protected readonly _commandService: ICommandService,- @Inject(FlowManagerService) protected readonly _flowManagerService: FlowManagerService- ) {- super();- this._initCommands();- this._triggerCommands();- }-- private _initCommands(): void {- [- SetFlowViewportOperation,- UniFocusUnitOperation,- ].forEach((c) => {- this.disposeWithMe(this._commandService.registerCommand(c));- });- }-- private _triggerCommands() {- this._flowManagerService.viewportChanged$.pipe(- throttleTime(100, undefined, { leading: true, trailing: true }),- auditTime(100)- ).subscribe((viewport: IFlowViewport | null) => {- if (viewport) {- this._commandService.executeCommand(SetFlowViewportOperation.id, { viewport });- }- });- }-}diff --git a/packages-experimental/uniui/src/controllers/uniui-leftsidebar.controller.tsx b/packages-experimental/uniui/src/controllers/uniui-leftsidebar.controller.tsxdeleted file mode 100644index c57665f9b9..0000000000--- a/packages-experimental/uniui/src/controllers/uniui-leftsidebar.controller.tsx+++ /dev/null@@ -1,63 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ISidebarService } from '@univerjs/ui';-import { Disposable, Inject, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { ComponentManager, ILeftSidebarService } from '@univerjs/ui';-import { distinctUntilChanged, map } from 'rxjs';-import { Outline } from '../views/outline/Outline';--const OUTLINE_COMPONENT = 'OUTLINE_COMPONENT';--export class UniuiLeftSidebarController extends Disposable {- constructor(- @Inject(ComponentManager) private readonly _componentManager: ComponentManager,- @IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService,- @ILeftSidebarService private readonly _leftSidebarService: ISidebarService- ) {- super();-- this._initComponents();- this._initShowOutlineListener();- }-- private _initComponents(): void {- this.disposeWithMe(this._componentManager.register(OUTLINE_COMPONENT, Outline));- }-- private _initShowOutlineListener(): void {- this.disposeWithMe(this._univerInstanceService.focused$.pipe(- map((unitId) => !unitId ? false : this._univerInstanceService.getUnit(unitId)?.type !== UniverInstanceType.UNIVER_DOC),- distinctUntilChanged()- ).subscribe((showOutline) => {- if (showOutline) {- this._leftSidebarService.open({- children: { label: OUTLINE_COMPONENT },- visible: true,- width: 185,- });- } else {- this._leftSidebarService.close();- }- }));-- this.disposeWithMe(this._univerInstanceService.unitDisposed$.pipe(- distinctUntilChanged()- ).subscribe(() => {- this._leftSidebarService.close();- }));- }-}diff --git a/packages-experimental/uniui/src/controllers/uniui-toolbar.controller.tsx b/packages-experimental/uniui/src/controllers/uniui-toolbar.controller.tsxdeleted file mode 100644index e436ba2adf..0000000000--- a/packages-experimental/uniui/src/controllers/uniui-toolbar.controller.tsx+++ /dev/null@@ -1,72 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { MenuConfig } from '@univerjs/ui';-import { Disposable, ICommandService, Inject, Injector } from '@univerjs/core';-import { DeleteIcon, DownloadIcon, LockIcon, PivotTableIcon, PrintIcon, ShareIcon, ZenIcon } from '@univerjs/icons';-import { ComponentManager, IMenuManagerService } from '@univerjs/ui';-import { DisposeUnitOperation } from '../commands/operations/uni.operation';-import { UniToolbarService } from '../services/toolbar/uni-toolbar-service';-import { menuSchema } from './menu.schema';--export interface IUniuiToolbarConfig {- menu: MenuConfig;-}--export const DefaultUniuiToolbarConfig = {};--export class UniuiToolbarController extends Disposable {- constructor(- @IMenuManagerService protected readonly _menuManagerService: IMenuManagerService,- @Inject(Injector) protected readonly _injector: Injector,- @Inject(ComponentManager) protected readonly _componentManager: ComponentManager,- @ICommandService protected readonly _commandService: ICommandService,- @Inject(UniToolbarService) protected readonly _toolbarService: UniToolbarService- ) {- super();- this._initComponent();- this._initMenus();- this._initCommands();- }-- private _initComponent(): void {- const componentManager = this._componentManager;- const iconList: Record<string, React.ForwardRefExoticComponent<any>> = {- DownloadIcon,- ShareIcon,- LockIcon,- PrintIcon,- ZenIcon,- DeleteIcon,- PivotTableIcon,- };- for (const k in iconList) {- this.disposeWithMe(componentManager.register(k, iconList[k]));- }- }-- private _initMenus(): void {- this._menuManagerService.appendRootMenu(menuSchema);- }-- private _initCommands(): void {- [- DisposeUnitOperation,- ].forEach((c) => {- this.disposeWithMe(this._commandService.registerCommand(c));- });- }-}diff --git a/packages-experimental/uniui/src/controllers/utils.ts b/packages-experimental/uniui/src/controllers/utils.tsdeleted file mode 100644index 2b3e590257..0000000000--- a/packages-experimental/uniui/src/controllers/utils.ts+++ /dev/null@@ -1,25 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ICommand } from '@univerjs/core';-import { Tools } from '@univerjs/core';--export const generateCloneMutation = (cloneId: string, sourceMutation: ICommand): ICommand => {- return {- ...Tools.deepClone(sourceMutation),- id: cloneId,- };-};diff --git a/packages-experimental/uniui/src/global.css b/packages-experimental/uniui/src/global.cssdeleted file mode 100644index 7c05d4ddc4..0000000000--- a/packages-experimental/uniui/src/global.css+++ /dev/null@@ -1,2 +0,0 @@-@tailwind components;-@tailwind utilities;diff --git a/packages-experimental/uniui/src/index.ts b/packages-experimental/uniui/src/index.tsdeleted file mode 100644index f6b8726e59..0000000000--- a/packages-experimental/uniui/src/index.ts+++ /dev/null@@ -1,28 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import './global.css';--export { SetFlowViewportOperation } from './commands/operations/set-flow-viewport.operation';-export { UniFocusUnitOperation } from './commands/operations/uni-focus-unit.operation';-export { DELETE_MENU_ID, DOWNLOAD_MENU_ID, FONT_GROUP_MENU_ID, LOCK_MENU_ID, PRINT_MENU_ID, SHARE_MENU_ID, UNI_MENU_POSITIONS, ZEN_MENU_ID } from './controllers/menu';-export { generateCloneMutation } from './controllers/utils';-export { UniverUniUIPlugin } from './plugin';-export { UniToolbarService } from './services/toolbar/uni-toolbar-service';-export { BuiltinUniToolbarItemId } from './services/toolbar/uni-toolbar-service';-export { getGridUnitLocalCacheKey, type IProjectNode, type IUnitGrid, IUnitGridService, UnitGridService } from './services/unit-grid/unit-grid.service';-export { UniUIPart } from './views/outline/Outline';-export { UniFloatToolbarUIPart } from './views/uni-toolbar/UniFloatToolbar';diff --git a/packages-experimental/uniui/src/plugin.ts b/packages-experimental/uniui/src/plugin.tsdeleted file mode 100644index fe98a2e550..0000000000--- a/packages-experimental/uniui/src/plugin.ts+++ /dev/null@@ -1,150 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Dependency } from '@univerjs/core';-import type { IUniverUIConfig } from '@univerjs/ui';-import { DependentOn, ICommandService, IConfirmService, IContextService, ILocalStorageService, Inject, Injector, merge, mergeOverrideWithDependencies, Plugin } from '@univerjs/core';-import { UniverRenderEnginePlugin } from '@univerjs/engine-render';-import {- BrowserClipboardService,- CanvasFloatDomService,- CanvasPopupService,- ComponentManager,- ContextMenuService,- DesktopBeforeCloseService,- DesktopConfirmService,- DesktopDialogService,- DesktopGalleryService,- DesktopGlobalZoneService,- DesktopLayoutService,- DesktopLocalFileService,- DesktopLocalStorageService,- DesktopMessageService,- DesktopNotificationService,- DesktopSidebarService,- DesktopZenZoneService,- DISABLE_AUTO_FOCUS_KEY,- ErrorController,- IBeforeCloseService,- ICanvasPopupService,- IClipboardInterfaceService,- IContextMenuService,- IDialogService,- IGalleryService,- IGlobalZoneService,- ILayoutService,- ILeftSidebarService,- ILocalFileService,- IMenuManagerService,- IMessageService,- INotificationService,- IPlatformService,- IShortcutService,- ISidebarService,- IUIController,- IUIPartsService,- IZenZoneService,- MenuManagerService,- PlatformService,- SharedController,- ShortcutPanelController,- ShortcutPanelService,- ShortcutService,- ThemeSwitcherService,- UIPartsService,- UNIVER_UI_PLUGIN_NAME,- ZIndexManager,-} from '@univerjs/ui';-import { UniverUniUIController } from './controllers/uniui-desktop.controller';-import { UniuiFlowController } from './controllers/uniui-flow.controller';-import { UniuiLeftSidebarController } from './controllers/uniui-leftsidebar.controller';-import { UniuiToolbarController } from './controllers/uniui-toolbar.controller';-import { FlowManagerService } from './services/flow/flow-manager.service';-import { UniToolbarService } from './services/toolbar/uni-toolbar-service';-import { IUnitGridService, UnitGridService } from './services/unit-grid/unit-grid.service';--/**- * This plugin enables the Uni Mode of Univer. It should replace- * `UniverUIPlugin` when registered.- */-@DependentOn(UniverRenderEnginePlugin)-export class UniverUniUIPlugin extends Plugin {- static override pluginName: string = UNIVER_UI_PLUGIN_NAME;-- constructor(- private readonly _config: Partial<IUniverUIConfig> = {},- @Inject(Injector) protected readonly _injector: Injector,- @IContextService private readonly _contextService: IContextService,- @ICommandService private readonly _commandService: ICommandService- ) {- super();-- this._config = merge({}, this._config);- if (this._config.disableAutoFocus) {- this._contextService.setContextValue(DISABLE_AUTO_FOCUS_KEY, true);- }- }-- override onStarting(): void {- const dependencies: Dependency[] = mergeOverrideWithDependencies([- [ComponentManager],- [ZIndexManager],- [ShortcutPanelService],- [FlowManagerService],- [UniToolbarService],- [IUnitGridService, { useClass: UnitGridService }],- [IUIPartsService, { useClass: UIPartsService }],- [ILayoutService, { useClass: DesktopLayoutService }],- [IShortcutService, { useClass: ShortcutService }],- [IPlatformService, { useClass: PlatformService }],- [IMenuManagerService, { useClass: MenuManagerService }],- [IContextMenuService, { useClass: ContextMenuService }],- [ThemeSwitcherService],- [IClipboardInterfaceService, { useClass: BrowserClipboardService, lazy: true }],- [INotificationService, { useClass: DesktopNotificationService, lazy: true }],- [IGalleryService, { useClass: DesktopGalleryService, lazy: true }],- [IDialogService, { useClass: DesktopDialogService, lazy: true }],- [IConfirmService, { useClass: DesktopConfirmService, lazy: true }],- [ISidebarService, { useClass: DesktopSidebarService, lazy: true }],- [ILeftSidebarService, { useClass: DesktopSidebarService, lazy: true }],- [IZenZoneService, { useClass: DesktopZenZoneService, lazy: true }],- [IGlobalZoneService, { useClass: DesktopGlobalZoneService, lazy: true }],- [IMessageService, { useClass: DesktopMessageService, lazy: true }],- [ILocalStorageService, { useClass: DesktopLocalStorageService, lazy: true }],- [IBeforeCloseService, { useClass: DesktopBeforeCloseService }],- [ILocalFileService, { useClass: DesktopLocalFileService }],- [ICanvasPopupService, { useClass: CanvasPopupService }],- [CanvasFloatDomService],- [IUIController, {- useFactory: () => this._injector.createInstance(UniverUniUIController, this._config),- }],- [SharedController],- [ErrorController],- [ShortcutPanelController],- [UniuiLeftSidebarController],- [UniuiToolbarController],- [UniuiFlowController],- ], this._config.override);- dependencies.forEach((dependency) => this._injector.add(dependency));- }-- override onReady(): void {- this._injector.get(IUIController); // Do not move it to onStarting, otherwise the univer instance may not be mounted.- this._injector.get(UniuiFlowController);- this._injector.get(UniuiLeftSidebarController);- this._injector.get(UniuiToolbarController);- }-}diff --git a/packages-experimental/uniui/src/services/flow/flow-manager.service.ts b/packages-experimental/uniui/src/services/flow/flow-manager.service.tsdeleted file mode 100644index b3edea7b77..0000000000--- a/packages-experimental/uniui/src/services/flow/flow-manager.service.ts+++ /dev/null@@ -1,73 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ReactFlowInstance } from '@xyflow/react';-import { Disposable } from '@univerjs/core';--import { BehaviorSubject } from 'rxjs';--export interface IFlowViewport {- zoom: number;- x: number;- y: number;-}--export class FlowManagerService extends Disposable {- private readonly _viewportChanged$ = new BehaviorSubject<IFlowViewport | null>(null);- readonly viewportChanged$ = this._viewportChanged$.asObservable();-- private _flowInstance: ReactFlowInstance<any>;-- constructor() {- super();- }-- getViewport() {- return this._flowInstance?.getViewport();- }-- setViewport(viewport: { zoom: number; x: number; y: number }) {- this._flowInstance?.setViewport(viewport, {- duration: 100,- });- }-- setReactFlowInstance(instance: ReactFlowInstance<any>) {- this._flowInstance = instance;- }-- fitView() {- if (this._flowInstance) {- this._flowInstance.fitView();- }- }-- zoomIn() {- if (this._flowInstance) {- this._flowInstance.zoomIn();- }- }-- zoomOut() {- if (this._flowInstance) {- this._flowInstance.zoomOut();- }- }-- setViewportChanged(viewport: IFlowViewport) {- this._viewportChanged$.next(viewport);- }-}diff --git a/packages-experimental/uniui/src/services/toolbar/uni-toolbar-service.ts b/packages-experimental/uniui/src/services/toolbar/uni-toolbar-service.tsdeleted file mode 100644index 263f28f14d..0000000000--- a/packages-experimental/uniui/src/services/toolbar/uni-toolbar-service.ts+++ /dev/null@@ -1,125 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { Disposable, RedoCommand, toDisposable, UndoCommand, UniverInstanceType } from '@univerjs/core';-import { FAKE_BG_COLOR_MENU_ID, FAKE_FONT_COLOR_MENU_ID, FAKE_FONT_FAMILY_MENU_ID, FAKE_FONT_GROUP_MENU_ID, FAKE_FONT_SIZE_MENU_ID, FAKE_IMAGE_MENU_ID, FAKE_ORDER_LIST_MENU_ID, FAKE_TABLE_MENU_ID, FAKE_UNORDER_LIST_MENU_ID, FONT_GROUP_MENU_ID } from '../../controllers/menu';--interface IItemImpl {- id: string;- type: UniverInstanceType;-}--export interface IUniToolbarItem {- id: string;- impl: IItemImpl[];-}--export enum BuiltinUniToolbarItemId {- UNDO = 'undo',- REDO = 'redo',- FONT_FAMILY = 'font-famaily',- FONT_SIZE = 'font-size',- FONT_GROUP = 'font-group',- COLOR = 'color',- BACKGROUND = 'background',- IMAGE = 'image',- TABLE = 'table',- UNORDER_LIST = 'unorder-list',- ORDER_LIST = 'order-list',-}--export class UniToolbarService extends Disposable {- private _items: IUniToolbarItem[];- constructor() {- super();- this._init();- }-- private _init() {- this._items = [- {- id: BuiltinUniToolbarItemId.UNDO,- impl: [{ id: UndoCommand.id, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.REDO,- impl: [{ id: RedoCommand.id, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.FONT_FAMILY,- impl: [{ id: FAKE_FONT_FAMILY_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.FONT_SIZE,- impl: [{ id: FAKE_FONT_SIZE_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.FONT_GROUP,- impl: [- { id: FAKE_FONT_GROUP_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN },- { id: FONT_GROUP_MENU_ID, type: UniverInstanceType.UNIVER_SHEET },- { id: FONT_GROUP_MENU_ID, type: UniverInstanceType.UNIVER_DOC },- ],- },- {- id: BuiltinUniToolbarItemId.COLOR,- impl: [{ id: FAKE_FONT_COLOR_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.BACKGROUND,- impl: [{ id: FAKE_BG_COLOR_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.IMAGE,- impl: [{ id: FAKE_IMAGE_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.UNORDER_LIST,- impl: [{ id: FAKE_UNORDER_LIST_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.ORDER_LIST,- impl: [{ id: FAKE_ORDER_LIST_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- {- id: BuiltinUniToolbarItemId.TABLE,- impl: [{ id: FAKE_TABLE_MENU_ID, type: UniverInstanceType.UNIVER_UNKNOWN }],- },- ];- }-- addItem(item: IUniToolbarItem) {- this._items.push(item);- return toDisposable(() => {- this._items = this._items.filter((i) => i.id !== item.id);- });- }-- getItems() {- return this._items;- }-- implementItem(id: string, impl: IItemImpl) {- const item = this._items.find((item) => item.id === id);- if (item) {- item.impl.push(impl);- return toDisposable(() => {- item.impl = item.impl.filter((i) => i.id !== impl.id);- });- }- return toDisposable(() => {});- }-}diff --git a/packages-experimental/uniui/src/services/unit-grid/unit-grid.service.ts b/packages-experimental/uniui/src/services/unit-grid/unit-grid.service.tsdeleted file mode 100644index 37f498736b..0000000000--- a/packages-experimental/uniui/src/services/unit-grid/unit-grid.service.ts+++ /dev/null@@ -1,202 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Nullable, UnitModel } from '@univerjs/core';-import { createIdentifier, Disposable, ILocalStorageService, isInternalEditorID, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import type { IRender } from '@univerjs/engine-render';-import { IRenderManagerService } from '@univerjs/engine-render';-import type { Observable } from 'rxjs';-import { BehaviorSubject } from 'rxjs';--export type IUnitGrid = IProjectNode[];--export interface IProjectNode {- id: string;- data: {- unitId: string;- type: UniverInstanceType;- };- style: {- width: string;- height: string;- display: string;- borderRadius: string;- border: string;- backgroundColor: string;- };- position: {- x: number;- y: number;- };-}--export interface IUnitGridService {- readonly unitGrid: IProjectNode[];- readonly unitGrid$: Observable<IProjectNode[]>;- readonly newNode: IProjectNode | null;- readonly newNode$: Observable<IProjectNode | null>;-- setContainerForRender(unitId: string, element: HTMLElement): void;-- changeDimension(id: string, dimensions: { width: number; height: number }): void;- changePosition(id: string, position: { x: number; y: number }): void;--}--export const IUnitGridService = createIdentifier<IUnitGridService>('uniui.grid.service');--// NOTE: please note that caching position and dimension of units is just for demo.-// The grid should be a unit itself.--/**- * This services decides which (now at maximum two) units are going to be rendered in the browser.- */-export class UnitGridService extends Disposable implements IUnitGridService {- // TODO@wzhudev: currently we only support at maximum 2 units rendered side by side.- // In the future we would introduce a grid system (very much like vscode's) to support more- // units and more complex layout.- protected _unitGrid: IUnitGrid = [];- private readonly _unitGrid$ = new BehaviorSubject<IUnitGrid>(this._unitGrid);- readonly unitGrid$ = this._unitGrid$.asObservable();-- protected _newNode: IProjectNode | null = null;- private readonly _newNode$ = new BehaviorSubject<IProjectNode | null>(null);- readonly newNode$ = this._newNode$.asObservable();-- get unitGrid() { return this._unitGrid; }- get cachedGrid() { return this._cachedGrid; }- get newNode() { return this._newNode; }-- private _nodeIndex = 0;-- constructor(- @IRenderManagerService protected readonly _renderSrv: IRenderManagerService,- @ILocalStorageService protected readonly _localStorageService: ILocalStorageService,- @IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService- ) {- super();-- this._init();- }-- override dispose(): void {- super.dispose();-- this._unitGrid$.complete();- this._newNode$.complete();- }-- setNewNodeObserver() {- this._newNode$.next(this._newNode);- }-- setContainerForRender(unitId: string, element: HTMLElement) {- this._renderSrv.getRenderById(unitId)?.engine.setContainer(element);- }-- changeDimension(id: string, dimension: { width: number; height: number }): void {- const node = this._unitGrid.find((item) => item.id === id);- if (node) {- node.style.width = `${dimension.width}px`;- node.style.height = `${dimension.height}px`;- this._cacheData();- }- }-- changePosition(id: string, position: { x: number; y: number }): void {- const node = this._unitGrid.find((item) => item.id === id);- if (node) {- node.position.x = position.x;- node.position.y = position.y;- this._cacheData();- }- }-- private async _init(): Promise<void> {- await this._initData();-- this._renderSrv.getRenderAll().forEach((renderer) => this._onRendererCreated(renderer));- this.disposeWithMe(this._renderSrv.created$.subscribe((render) => this._onRendererCreated(render)));- // When hot reload in development mode, render dispose will be triggered, causing data to be cleared. Replace it with unitDispose- this.disposeWithMe(this._univerInstanceService.unitDisposed$.subscribe((unitModel) => this._onUnitDisposed(unitModel)));- }-- protected _cachedGrid: Nullable<IUnitGrid> = null;- protected async _initData(): Promise<void> {- const raw = await this._localStorageService.getItem<IUnitGrid>(getGridUnitLocalCacheKey('static'));- if (raw) {- this._cachedGrid = raw;- }- }-- protected _cacheData(): void {- this._localStorageService.setItem(getGridUnitLocalCacheKey('static'), this.unitGrid);- }-- protected _onRendererCreated(renderer: IRender): void {- const { unitId, type, isThumbNail } = renderer;- if (isInternalEditorID(unitId) || isThumbNail) {- return;- }-- this._insertNewNode(unitId, type);- }-- private _insertNewNode(unitId: string, type: UniverInstanceType): void {- const index = this._nodeIndex;- this._nodeIndex += 1;-- const MAX_COUNT_IN_ROW = 3;- const newNode: IProjectNode = this._cachedGrid?.find((item) => item.id === unitId) ?? {- id: unitId,- data: {- unitId,- type,- },- style: {- width: type === UniverInstanceType.UNIVER_SLIDE ? '1000px' : '940px',- height: '854px',- display: 'flex',- borderRadius: '8px',- border: '1px solid #ccc',- backgroundColor: type === UniverInstanceType.UNIVER_SHEET ? '#fff' : '#f4f6f8',- },- position: { x: (index % MAX_COUNT_IN_ROW) * 1050, y: Math.floor(index / MAX_COUNT_IN_ROW) * 950 + 40 },- };-- this._unitGrid.push(newNode);- this._newNode = newNode; // set new node, for viewport to scroll to- this._emitLayoutChange();- }-- protected _onUnitDisposed(unitModel: UnitModel): void {- const unitId = unitModel.getUnitId();- const idx = this._unitGrid.findIndex((item) => item.id === unitId);- if (idx !== -1) {- this._unitGrid.splice(idx, 1);- this._emitLayoutChange();- }- }-- private _emitLayoutChange(): void {- this._unitGrid$.next(this._unitGrid.slice());- this._cacheData();- }-}--export function getGridUnitLocalCacheKey(projectId: string): string {- return `project-cache-${projectId}`;-}diff --git a/packages-experimental/uniui/src/views/hooks/title.ts b/packages-experimental/uniui/src/views/hooks/title.tsdeleted file mode 100644index f32bd6eec7..0000000000--- a/packages-experimental/uniui/src/views/hooks/title.ts+++ /dev/null@@ -1,33 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Nullable } from '@univerjs/core';-import { IUniverInstanceService } from '@univerjs/core';-import { useDependency, useObservable } from '@univerjs/ui';-import { useMemo } from 'react';--export function useUnitTitle(unitId: string): string | undefined {- const instanceService = useDependency(IUniverInstanceService);- const unit = useMemo(() => instanceService.getUnit(unitId), [unitId, instanceService]);- const title = useObservable<string>(unit?.name$, '', false, [unit]);- return title;-}--export function useUnitFocused(unitId: string): boolean {- const instanceService = useDependency(IUniverInstanceService);- const focusedUnitId = useObservable<Nullable<string>>(instanceService.focused$);- return unitId === focusedUnitId;-}diff --git a/packages-experimental/uniui/src/views/outline/Outline.tsx b/packages-experimental/uniui/src/views/outline/Outline.tsxdeleted file mode 100644index 76f621e5a6..0000000000--- a/packages-experimental/uniui/src/views/outline/Outline.tsx+++ /dev/null@@ -1,30 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { ComponentContainer, useComponentsOfPart } from '@univerjs/ui';--export enum UniUIPart {- OUTLINE = 'OUTLINE',-}--export function Outline() {- const outlineComponent = useComponentsOfPart(UniUIPart.OUTLINE);- return (- <ComponentContainer key="outline" components={outlineComponent} />- );-}--Outline.componentName = 'Outline';diff --git a/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx b/packages-experimental/uniui/src/views/uni-controls/UniControls.tsxdeleted file mode 100644index 87a440ca14..0000000000--- a/packages-experimental/uniui/src/views/uni-controls/UniControls.tsx+++ /dev/null@@ -1,224 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { CSSProperties, ReactElement } from 'react';-import type { IProjectNode } from '../../services/unit-grid/unit-grid.service';-import { borderClassName, Button, clsx, Dropdown, Tooltip } from '@univerjs/design';-import { CheckMarkIcon, FullscreenIcon, IncreaseIcon, ZoomReduceIcon } from '@univerjs/icons';-import { ISidebarService, useDependency } from '@univerjs/ui';-import { useReactFlow } from '@xyflow/react';-import { useCallback, useEffect, useLayoutEffect, useState } from 'react';-import { IUnitGridService } from '../../services/unit-grid/unit-grid.service';-import { UniDiv } from '../uni-toolbar/UniFloatToolbar';--export const UniControlButton = (props: { tooltips: string; children?: ReactElement; onClick: () => void; style?: CSSProperties }) => {- const { children, onClick, style, tooltips } = props;- return (- <Tooltip title={tooltips}>- <Button- variant="text"- className="univer-p-1.5"- onClick={onClick}- style={style}- >- {children}- </Button>- </Tooltip>-- );-};--export const MAX_ZOOM = 2;-export const MIN_ZOOM = 0.1;-export const DEFAULT_ZOOM = 1;--// 0 means fit view-const shortcuts = [10, 50, 75, 100, 125, 150, 200, 0];--export enum UniControlItem {- AI = 'AI',-}--// The component on the bottom right corner of the screen, providing zoom in, zoom out, fit view,-// and AI button and other shared functionalities.-export const UniControls = ({ zoom, onItemClick }: { zoom: number; onItemClick?: (key: UniControlItem) => void }) => {- const unitGridService = useDependency(IUnitGridService);- const { zoomIn, zoomOut, fitView, getNodes, setCenter, getZoom } = useReactFlow();-- const zoomPercent = Math.floor(zoom * 100);- const rightPadding = useRightSidebarVisible() ? 360 : 12;-- const onZoomInHandler = () => {- zoomIn();- };- const onZoomOutHandler = () => {- zoomOut();- };-- const onFullscreenHandler = () => {- document.body.requestFullscreen();- };-- const setZoomAtCenter = useCallback((zoom: number) => {- const nodes = getNodes();- const xLeftPositions = nodes.map((node) => node.position.x);- const xRightPositions = nodes.map((node) => node.position.x + (node.measured?.width ?? 0));- const yTopPositions = nodes.map((node) => node.position.y);- const yDownPositions = nodes.map((node) => node.position.y + (node.measured?.height ?? 0));- const centerX = (Math.min(...xLeftPositions) + Math.max(...xRightPositions)) / 2;- const centerY = (Math.min(...yTopPositions) + Math.max(...yDownPositions)) / 2;- setCenter(centerX, centerY, { zoom });- }, [getNodes, setCenter]);-- const handleFitView = (node: IProjectNode | null) => {- if (node) {- const { x, y } = node.position;- const width = Number.parseInt(`${node.style?.width}`) || 0;- const height = Number.parseInt(`${node.style?.height}`) || 0;-- // Use the setCenter method to position the viewport to the center of the node.- setCenter(x + width / 2, y + height / 2, {- duration: 300,- zoom: 1,- });- }- };- const onZoomMenuChange = useCallback((value: number) => {- if (value === 0) {- fitView();- } else {- setZoomAtCenter(value / 100);- }- }, [setZoomAtCenter, fitView]);-- useLayoutEffect(() => {- setTimeout(() => {- setZoomAtCenter(1);- }, 1000);- }, [setZoomAtCenter]);-- useEffect(() => {- const newNodeSubscribe = unitGridService.newNode$.subscribe((node) => handleFitView(node));-- // const timer = setTimeout(() => {- // fitView();- // }, 1000);-- return () => {- // clearTimeout(timer);- newNodeSubscribe.unsubscribe();- };- }, [fitView]);-- return (- <div- className={clsx(`- univer-fixed univer-bottom-3 univer-right-3 univer-flex univer-w-fit univer-items-center univer-gap-3- univer-rounded-[10px] univer-bg-white univer-p-2 univer-shadow- `, borderClassName)}- style={{ right: `${rightPadding}px` }}- >- <UniControlButton tooltips="Full screen" onClick={onFullscreenHandler}>- <FullscreenIcon />- </UniControlButton>- <UniControlButton tooltips="Zoom in" onClick={onZoomInHandler}>- <IncreaseIcon />- </UniControlButton>- <Dropdown- overlay={(- <div- className={`- univer-box-border univer-grid univer-w-32 univer-items-center univer-gap-1 univer-p-4- univer-text-xs- `}- >- {shortcuts?.map((item) => (- <a- key={item}- className={clsx(`- univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-py-1- univer-pl-9 univer-text-gray-900 univer-no-underline univer-transition-colors- univer-duration-200- hover:univer-bg-gray-100- dark:!univer-text-white dark:hover:!univer-bg-gray-700- `, item === zoomPercent ? 'univer-bg-gray-100' : '')}- onClick={() => onZoomMenuChange(item)}- >- {item === zoomPercent && (- <span- className={`- univer-absolute univer-left-1 univer-top-0 univer-flex univer-h-full- univer-items-center univer-text-green-600- `}- >- <CheckMarkIcon />- </span>- )}- <span>- {item === 0 ? 'Fit View' : `${item}%`}- </span>- </a>- ))}- </div>- )}- >- <a- className={`- univer-h-7 univer-w-[55px] univer-cursor-pointer univer-rounded univer-text-center univer-text-xs- univer-leading-loose univer-text-gray-700 univer-no-underline univer-transition-all- univer-duration-200- group-data-[open=true]:univer-bg-gray-200- hover:univer-bg-gray-200- `}- >- {zoomPercent}- %- </a>- </Dropdown>- <UniControlButton tooltips="Zoom out" onClick={onZoomOutHandler}>- <ZoomReduceIcon />- </UniControlButton>- <UniDiv />- <UniControlButton tooltips="AI" onClick={() => onItemClick?.(UniControlItem.AI)} style={{ background: '#274FEE' }}>- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">- <path d="M5.09091 19C4.63904 19 4.27273 18.6337 4.27273 18.1818C4.27273 17.7299 4.63904 17.3636 5.09091 17.3636C5.54278 17.3636 5.90909 17.7299 5.90909 18.1818C5.90909 18.6337 5.54278 19 5.09091 19Z" fill="white" />- <path d="M14.9091 2.63636C14.4572 2.63636 14.0909 2.27005 14.0909 1.81818C14.0909 1.36631 14.4572 1 14.9091 1C15.361 1 15.7273 1.36631 15.7273 1.81818C15.7273 2.27005 15.361 2.63636 14.9091 2.63636Z" fill="white" />- <path d="M18.1818 5.90909C17.7299 5.90909 17.3636 5.54278 17.3636 5.09091C17.3636 4.63904 17.7299 4.27273 18.1818 4.27273C18.6337 4.27273 19 4.63904 19 5.09091C19 5.54278 18.6337 5.90909 18.1818 5.90909Z" fill="white" />- <path d="M8.93208 4.29446C9.20363 3.17457 10.7964 3.17457 11.0679 4.29446L11.8151 7.3759C11.9121 7.77574 12.2243 8.08792 12.6241 8.18487L15.7055 8.93208C16.8254 9.20363 16.8254 10.7964 15.7055 11.0679L12.6241 11.8151C12.2243 11.9121 11.9121 12.2243 11.8151 12.6241L11.0679 15.7055C10.7964 16.8254 9.20363 16.8254 8.93208 15.7055L8.18487 12.6241C8.08792 12.2243 7.77574 11.9121 7.3759 11.8151L4.29446 11.0679C3.17457 10.7964 3.17457 9.20363 4.29446 8.93208L7.3759 8.18487C7.77574 8.08792 8.08792 7.77574 8.18487 7.3759L8.93208 4.29446Z" fill="white" />- <path fillRule="evenodd" clipRule="evenodd" d="M18.4393 12.4507C18.8203 12.5929 19.0139 13.0171 18.8717 13.3981C17.9506 15.8661 16.0383 17.8485 13.6187 18.8611C13.2435 19.0181 12.8121 18.8412 12.6551 18.4661C12.4981 18.0909 12.675 17.6595 13.0501 17.5025C15.0952 16.6467 16.7134 14.9692 17.4919 12.8831C17.6341 12.5021 18.0583 12.3085 18.4393 12.4507Z" fill="white" />- <path fillRule="evenodd" clipRule="evenodd" d="M7.56245 1.56016C7.70495 1.94106 7.51169 2.36536 7.1308 2.50786C5.03326 3.29259 3.34878 4.92965 2.49933 6.9978C2.34482 7.37399 1.9146 7.55369 1.53842 7.39918C1.16223 7.24467 0.982523 6.81445 1.13703 6.43827C2.14164 3.99234 4.13199 2.05736 6.61475 1.1285C6.99565 0.986002 7.41995 1.17926 7.56245 1.56016Z" fill="white" />- <path d="M1.81818 15.7273C1.36631 15.7273 1 15.361 1 14.9091C1 14.4572 1.36631 14.0909 1.81818 14.0909C2.27005 14.0909 2.63636 14.4572 2.63636 14.9091C2.63636 15.361 2.27005 15.7273 1.81818 15.7273Z" fill="white" />- </svg>- </UniControlButton>- </div>- );-};--function useRightSidebarVisible() {- const sidebarService = useDependency(ISidebarService);- const [visible, setVisible] = useState(false);- useEffect(() => {- const sidebarSubscription = sidebarService.sidebarOptions$.subscribe((options) => {- setVisible(!!options.visible);- });-- return () => {- sidebarSubscription.unsubscribe();- };- }, [sidebarService]);-- return visible;-}diff --git a/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx b/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsxdeleted file mode 100644index 1647208a6e..0000000000--- a/packages-experimental/uniui/src/views/uni-sidebar/UniSidebar.tsx+++ /dev/null@@ -1,151 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ISidebarMethodOptions } from '@univerjs/ui';-import type { ReactNode } from 'react';-import { borderClassName, clsx, scrollbarClassName } from '@univerjs/design';-import { CloseIcon } from '@univerjs/icons';-import { CustomLabel, ILeftSidebarService, ISidebarService, useDependency, useObservable } from '@univerjs/ui';-import { useEffect, useMemo, useRef } from 'react';--export interface IUniSidebarProps {- position: 'left' | 'right';- sidebarService: ISidebarService;- showClose?: boolean;-}--export function LeftSidebar() {- const sidebarService = useDependency(ILeftSidebarService);- return <UniSidebar position="left" sidebarService={sidebarService} showClose={false} />;-}--export function RightSidebar() {- const sidebarService = useDependency(ISidebarService);- return <UniSidebar position="right" sidebarService={sidebarService} />;-}--export function UniSidebar(props: IUniSidebarProps) {- const { sidebarService, position, showClose = true } = props;- const sidebarOptions = useObservable<ISidebarMethodOptions>(sidebarService.sidebarOptions$);- const scrollRef = useRef<HTMLDivElement>(null);-- const options = useMemo(() => {- if (!sidebarOptions) {- return null;- }-- const copy = { ...sidebarOptions } as Omit<ISidebarMethodOptions, 'children'> & {- children?: ReactNode;- header?: ReactNode;- footer?: ReactNode;- };-- for (const key of ['children', 'header', 'footer']) {- const k = key as keyof ISidebarMethodOptions;-- if (sidebarOptions[k]) {- const props = sidebarOptions[k] as any;-- if (props) {- (copy as any)[k] = <CustomLabel {...props} />;- }- }- }-- return copy;- }, [sidebarOptions]);-- useEffect(() => {- const handleScroll = (e: Event) => {- sidebarService.scrollEvent$.next(e);- };- const scrollElement = scrollRef.current;- if (scrollElement) {- scrollElement.addEventListener('scroll', handleScroll);- }-- return () => {- scrollElement?.removeEventListener('scroll', handleScroll);- };- }, [sidebarService]);-- const width = useMemo(() => {- if (!options?.visible) return '0px';-- if (typeof options.width === 'number') {- return `${options.width}px`;- }-- return options.width;- }, [options]);-- function handleClose() {- const options = {- ...sidebarOptions,- visible: false,- };-- sidebarService.sidebarOptions$.next(options);- options?.onClose?.();- }-- const visible = options?.visible ?? false;- return (- <aside- className={clsx(`- univer-pointer-events-auto univer-fixed univer-bottom-3 univer-top-12 univer-z-20 univer-box-border- univer-overflow-hidden univer-rounded-lg univer-shadow-lg univer-transition-all- `, borderClassName, {- 'univer-left-3 univer-w-[180px]': position === 'left',- 'univer-right-3 univer-min-w-[280px] univer-max-w-[400px]': position === 'right',- 'univer-translate-x-[calc(-100%-12px)]': position === 'left' && !visible,- 'univer-translate-x-[calc(100%+12px)]': position === 'right' && !visible,- })}- style={{ width }}- >- <section- ref={scrollRef}- className={clsx(`- univer-m-auto univer-box-border univer-flex univer-h-0 univer-min-h-full univer-w-full univer-flex-col- univer-overflow-hidden univer-overflow-y-auto univer-bg-white- `, scrollbarClassName)}- >- { showClose && (- <header- className={`- univer-sticky univer-top-0 univer-z-10 univer-box-border univer-flex univer-h-[44px]- univer-flex-shrink-0 univer-flex-grow-0 univer-content-between univer-items-center- univer-justify-between univer-p-4 univer-pb-0 univer-text-lg univer-font-medium- `}- >- {options?.header}-- <a className="univer-cursor-pointer" onClick={handleClose}>- <CloseIcon />- </a>- </header>- )}-- <section- className="univer-box-border univer-flex-grow univer-p-2"- >- {options?.children}- </section>- {options?.footer && <footer className="univer-sticky univer-bottom-0 univer-box-border univer-p-4">{options.footer}</footer>}- </section>- </aside>- );-}diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsxdeleted file mode 100644index 5a6f7721ab..0000000000--- a/packages-experimental/uniui/src/views/uni-toolbar/UniFloatToolbar.tsx+++ /dev/null@@ -1,132 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Nullable } from '@univerjs/core';-import type { IMenuItem } from '@univerjs/ui';-import type { IUnitRendererProps } from '../workbench/UniWorkbench';-import { flip, offset, shift, useFloating } from '@floating-ui/react-dom';-import { IUniverInstanceService } from '@univerjs/core';-import { ComponentContainer, IMenuManagerService, ToolbarItem, useComponentsOfPart, useDependency, useObservable } from '@univerjs/ui';-import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';-import { DELETE_MENU_ID, DOWNLOAD_MENU_ID, LOCK_MENU_ID, PRINT_MENU_ID, SHARE_MENU_ID, UNI_MENU_POSITIONS, ZEN_MENU_ID } from '../../controllers/menu';--export interface IFloatingToolbarRef {- update: () => void;-}--export enum UniFloatToolbarUIPart {- NAME = 'name',-}--const UNI_FLOATING_TOOLBAR_SCHEMA: string[] = [- DOWNLOAD_MENU_ID,- SHARE_MENU_ID,- LOCK_MENU_ID,- PRINT_MENU_ID,- ZEN_MENU_ID,- DELETE_MENU_ID,-];--export const UniFloatingToolbar = forwardRef<IFloatingToolbarRef, { node: Nullable<IUnitRendererProps> }>(({ node }, ref) => {- const menuManagerService = useDependency(IMenuManagerService);- const isMenuChange = useObservable(menuManagerService.menuChanged$);- const [uniVisibleItems, setUniVisibleItems] = useState<IMenuItem[]>([]);-- const { x, y, refs, strategy, update } = useFloating({- placement: 'top',- middleware: [offset(10), flip(), shift({ padding: 5 })],- });-- const { setReference, setFloating } = refs;-- const toolbarNameComponents = useComponentsOfPart(UniFloatToolbarUIPart.NAME);-- // Function to update the visible items- const updateVisibleItems = () => {- const menus = menuManagerService.getMenuByPositionKey(UNI_MENU_POSITIONS.TOOLBAR_FLOAT);- if (menus) {- const visibleItems = UNI_FLOATING_TOOLBAR_SCHEMA.map((id) => menus.find((item) => item.key === id)?.item).filter((item) => !!item);- setUniVisibleItems(visibleItems);- }- };-- useImperativeHandle(ref, () => ({- update: () => update(),- }), [update]);-- useEffect(() => {- if (node) {- const ref = document.querySelector(`[data-id="${node.unitId}"]`);- setReference(ref);- }- }, [node, setReference]);-- // Listen for menu changes and update visible items- useEffect(() => {- updateVisibleItems();- }, [isMenuChange]);-- if (!node || !refs.reference.current) {- return null;- }-- return (- <div- ref={setFloating}- className={`- univer-flex univer-items-center univer-gap-2 univer-rounded-md univer-bg-white univer-text-sm- univer-text-primary-600- dark:!univer-bg-gray-900- `}- style={{ position: strategy, top: y ?? 0, left: x ?? 0 }}- >- <div- className="univer-inline-flex univer-flex-shrink-0 univer-items-center univer-gap-2 univer-p-2"- >- <ComponentContainer- key="name"- components={toolbarNameComponents}- fallback={<UnitName unitId={node.unitId} />}- />- <UniDiv />- <div className="univer-flex">- {uniVisibleItems.map((subItem) => <ToolbarItem key={subItem.id} {...subItem} />)}- </div>- </div>- </div>- );-});--export function UniDiv() {- return <div className="univer-h-6 univer-w-px univer-bg-gray-100" />;-}--export function UnitName({ unitId }: { unitId: string }) {- const instanceService = useDependency(IUniverInstanceService);- const unit = instanceService.getUnit(unitId);- const name = useObservable(unit?.name$);- return (- <div- className={`- univer-flex univer-h-6 univer-items-center univer-gap-1 univer-rounded-md univer-bg-white univer-px-1- univer-py-0 univer-text-sm univer-text-gray-900- dark:!univer-text-white- `}- >- {name}- </div>- );-};diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsxdeleted file mode 100644index 5c29f16db6..0000000000--- a/packages-experimental/uniui/src/views/uni-toolbar/UniFormulaBar.tsx+++ /dev/null@@ -1,240 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Workbook } from '@univerjs/core';-import {- DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,- FOCUSING_FX_BAR_EDITOR,- ICommandService,- IContextService,- IPermissionService,- IUniverInstanceService,- Rectangle,- UniverInstanceType,-} from '@univerjs/core';-import { Button, clsx } from '@univerjs/design';-import { DeviceInputEventType } from '@univerjs/engine-render';-import { CheckMarkIcon, CloseIcon, FxIcon } from '@univerjs/icons';-import {- RangeProtectionPermissionEditPoint,- RangeProtectionRuleModel,- SheetsSelectionsService,- WorkbookEditablePermission,- WorksheetEditPermission,- WorksheetProtectionRuleModel,- WorksheetSetCellValuePermission,-} from '@univerjs/sheets';-import { EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, IEditorBridgeService, IFormulaEditorManagerService, SetCellEditVisibleOperation, useActiveWorkbook, useKeyEventConfig } from '@univerjs/sheets-ui';-import { ComponentManager, KeyCode, useDependency, useObservable } from '@univerjs/ui';-import { useCallback, useLayoutEffect, useRef, useState } from 'react';-import { EMPTY, merge, switchMap } from 'rxjs';--export const UniFormulaBar = () => {- const editorBridgeService = useDependency(IEditorBridgeService);- const univerInstanceService = useDependency(IUniverInstanceService);- const commandService = useDependency(ICommandService);-- const visibleInfo = useObservable(editorBridgeService.visible$);- const focusedId = useObservable(univerInstanceService.focused$);- const visible = (visibleInfo?.visible && focusedId) || false;-- const handleOpenWrite = useCallback(() => {- if (focusedId) {- commandService.executeCommand(SetCellEditVisibleOperation.id, {- visible: true,- eventType: DeviceInputEventType.PointerDown,- unitId: focusedId,- });- }- }, [editorBridgeService, focusedId]);-- return (- <>- <div- className={clsx(`- univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded-md- univer-border-primary-400 univer-bg-primary-300 univer-px-3 univer-py-1.5 univer-text-sm- univer-text-primary-600- `, {- 'univer-opacity-30': !focusedId,- })}- onClick={() => handleOpenWrite()}- >- <FxIcon />- <span className="univer-whitespace-nowrap univer-text-xs">- Write formula- </span>- </div>- <div- className={clsx(`- dark:!univer-bg-dark- univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-h-full univer-w-full univer-bg-white- `, {- 'univer-hidden': !visible,- })}- >- <FormulaBar />- </div>- </>- );-};--// This copies the FormulaBar component from the sheets-ui package.-// FIXME@wzhudev: it is not appropriate to copy the component here.-export function FormulaBar() {- const formulaEditorManagerService = useDependency(IFormulaEditorManagerService);- const editorBridgeService = useDependency(IEditorBridgeService);- const componentManager = useDependency(ComponentManager);- const commandService = useDependency(ICommandService);- const selectionManager = useDependency(SheetsSelectionsService);- const worksheetProtectionRuleModel = useDependency(WorksheetProtectionRuleModel);- const rangeProtectionRuleModel = useDependency(RangeProtectionRuleModel);- const permissionService = useDependency(IPermissionService);- const contextService = useDependency(IContextService);-- const [disable, setDisable] = useState<boolean>(false);- const univerInstanceService = useDependency(IUniverInstanceService);- const FormulaEditor = componentManager.get(EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY);- const currentWorkbook = useActiveWorkbook();- const isFocusFxBar = contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);- const editState = useObservable(editorBridgeService.currentEditCellState$);- const isRefSelecting = useRef<0 | 1 | 2>(0);- const keyCodeConfig = useKeyEventConfig(isRefSelecting, editState?.unitId ?? '');-- function getPermissionIds(unitId: string, subUnitId: string): string[] {- return [- new WorkbookEditablePermission(unitId).id,- new WorksheetSetCellValuePermission(unitId, subUnitId).id,- new WorksheetEditPermission(unitId, subUnitId).id,- ];- }-- useLayoutEffect(() => {- const workbook = univerInstanceService.getCurrentUnitForType<Workbook>(UniverInstanceType.UNIVER_SHEET)!;- const subscription = merge(- worksheetProtectionRuleModel.ruleChange$,- rangeProtectionRuleModel.ruleChange$,- selectionManager.selectionMoveEnd$,- selectionManager.selectionSet$,- workbook.activeSheet$- ).pipe(- switchMap(() => {- const unitId = workbook.getUnitId();- const worksheet = workbook.getActiveSheet();- if (!worksheet) return EMPTY;-- const subUnitId = worksheet.getSheetId();- const range = selectionManager.getCurrentLastSelection()?.range;- if (!range) return EMPTY;-- const permissionIds = getPermissionIds(unitId, subUnitId);-- const selectionRanges = selectionManager.getCurrentSelections()?.map((selection) => selection.range);- const permissionList = rangeProtectionRuleModel.getSubunitRuleList(unitId, subUnitId).filter((rule) => {- return rule.ranges.some((r) => selectionRanges?.some((selectionRange) => Rectangle.intersects(r, selectionRange)));- });-- permissionList.forEach((p) => {- permissionIds.push(new RangeProtectionPermissionEditPoint(unitId, subUnitId, p.permissionId).id);- });-- return permissionService.composePermission$(permissionIds);- })- ).subscribe((permissions) => {- if (permissions) {- setDisable(!permissions.every((p) => p.value));- }- });-- return () => {- subscription.unsubscribe();- };- }, []);-- // Handle click the "×" button.- function handleCloseBtnClick() {- const visibleState = editorBridgeService.isVisible();- if (visibleState.visible) {- commandService.executeCommand(SetCellEditVisibleOperation.id, {- visible: false,- eventType: DeviceInputEventType.Keyboard,- keycode: KeyCode.ESC,- unitId: currentWorkbook?.getUnitId() ?? '',- });- }- }-- // Handle click the "√" button.- function handleConfirmBtnClick() {- const visibleState = editorBridgeService.isVisible();- if (visibleState.visible) {- commandService.executeCommand(SetCellEditVisibleOperation.id, {- visible: false,- eventType: DeviceInputEventType.PointerDown,- unitId: currentWorkbook?.getUnitId() ?? '',- });- }- }-- return (- <div- className={`- univer-box-border univer-flex univer-h-full univer-w-full univer-items-center univer-gap-2 univer-p-2- `}- >- <div- className={clsx('univer-univer-grow-0 univer-flex univer-shrink-0 univer-px-1.5', {- 'univer-cursor-not-allowed univer-text-gray-200': disable,- })}- >- <Button size="small" variant="text" className="univer-text-red-600" onClick={handleCloseBtnClick}>- <CloseIcon />- </Button>- <Button size="small" variant="text" className="univer-text-green-600" onClick={handleConfirmBtnClick}>- <CheckMarkIcon />- </Button>- </div>- {FormulaEditor && (- <FormulaEditor- className="univer-h-full univer-shrink univer-grow"- disableSelectionOnClick- editorId={DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY}- initValue=""- onChange={() => { }}- isFocus={isFocusFxBar}- unitId={editState?.unitId}- subUnitId={editState?.sheetId}- autofocus={false}- isSupportAcrossSheet- resetSelectionOnBlur={false}- isSingle={false}- keyboardEventConfig={keyCodeConfig}- onFormulaSelectingChange={(isSelecting: 0 | 1 | 2, isFocusing: boolean) => {- isRefSelecting.current = isSelecting;- if (!isFocusing) return;- if (isSelecting) {- editorBridgeService.enableForceKeepVisible();- } else {- editorBridgeService.disableForceKeepVisible();- }- }}- autoScrollbar={false}- disableContextMenu={false}- />- )}- </div>- );-}diff --git a/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx b/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsxdeleted file mode 100644index aeca3e52f4..0000000000--- a/packages-experimental/uniui/src/views/uni-toolbar/UniToolbar.tsx+++ /dev/null@@ -1,87 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { IMenuItem } from '@univerjs/ui';-import type { ComponentType } from 'react';-import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';-import { useWorkbooks } from '@univerjs/sheets-ui';-import { IMenuManagerService, ToolbarItem, useDependency, useObservable } from '@univerjs/ui';-import { useEffect, useState } from 'react';-import { UNI_MENU_POSITIONS } from '../../controllers/menu';-import { UniToolbarService } from '../../services/toolbar/uni-toolbar-service';-import { UniFormulaBar } from './UniFormulaBar';--export interface IToolbarProps {- headerMenuComponents?: Set<ComponentType>;-}--export function UniToolbar() {- const uniToolbarService = useDependency(UniToolbarService);- const instanceService = useDependency(IUniverInstanceService);- const focusedUnit = useObservable(instanceService.focused$);- const menuManagerService = useDependency(IMenuManagerService);- const isMenuChange = useObservable(menuManagerService.menuChanged$);- const [uniVisibleItems, setUniVisibleItems] = useState<(IMenuItem | null)[]>([]);-- const type = focusedUnit ? (instanceService.getUnit(focusedUnit)?.type ?? UniverInstanceType.UNIVER_UNKNOWN) : UniverInstanceType.UNIVER_UNKNOWN;-- const toolbarItems = uniToolbarService.getItems();- const hasWorkbooks = useWorkbooks().length > 0;-- // The initialization of the UniToolbar component may be earlier than the initialization of the SheetUIController in the onReady cycle, resulting in the UNI_MENU_POSITIONS.TOOLBAR_MAIN menu not being registered- // Function to update the visible items- const updateVisibleItems = () => {- const menus = menuManagerService.getMenuByPositionKey(UNI_MENU_POSITIONS.TOOLBAR_MAIN);- if (menus) {- const visibleItems = toolbarItems.map((item) => {- const { impl } = item;- const typeImpl = impl.find((item) => item.type === type);- const visibleItem = menus.find((item) => item.key === typeImpl?.id)?.item;- if (visibleItem) {- return visibleItem;- }- const placeHolderImpl = impl.find((item) => item.type === UniverInstanceType.UNIVER_UNKNOWN);- const placeHolderItem = menus.find((item) => item.key === placeHolderImpl?.id)?.item;- if (placeHolderItem) {- return placeHolderItem;- }- return null;- }).filter((item) => !!item && !item.id.startsWith('FAKE_'));- setUniVisibleItems(visibleItems);- }- };-- // Listen for menu changes and update visible items- useEffect(() => {- updateVisibleItems();- }, [isMenuChange]);-- return (- <div- className={`- univer-relative univer-box-border univer-flex univer-select-none univer-items-center univer-gap-2- univer-overflow-hidden univer-rounded-lg univer-border univer-border-gray-300 univer-bg-white univer-p-2- univer-text-sm univer-shadow-lg- `}- >- {hasWorkbooks && <UniFormulaBar />}- <div className="univer-flex univer-shrink-0 univer-items-center univer-gap-1">- {uniVisibleItems.map((subItem) => subItem && <ToolbarItem key={subItem.id} {...subItem} />)}- </div>- </div>-- );-}diff --git a/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx b/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsxdeleted file mode 100644index ca70e54657..0000000000--- a/packages-experimental/uniui/src/views/workbench/UniWorkbench.tsx+++ /dev/null@@ -1,385 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--// Refer to packages/ui/src/views/App.tsx--import type { IWorkbenchOptions } from '@univerjs/ui';-import type { NodeTypes, ReactFlowInstance, Viewport } from '@xyflow/react';-import type { IFloatingToolbarRef } from '../uni-toolbar/UniFloatToolbar';-import { debounce, ICommandService, IContextService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';-import { borderClassName, clsx, ConfigContext, ConfigProvider } from '@univerjs/design';-import { IRenderManagerService } from '@univerjs/engine-render';-import { MenuIcon } from '@univerjs/icons';-import {- BuiltInUIPart,- ComponentContainer,- ContextMenu,- GlobalZone,- ThemeSwitcherService,- UNI_DISABLE_CHANGING_FOCUS_KEY,- useComponentsOfPart,- useDependency,- useObservable,-} from '@univerjs/ui';-import {- Background,- NodeResizer,- ReactFlow,- ReactFlowProvider,- useNodesState,-} from '@xyflow/react';-import { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';-import { createPortal } from 'react-dom';-import { UniFocusUnitOperation } from '../../commands/operations/uni-focus-unit.operation';-import { FlowManagerService } from '../../services/flow/flow-manager.service';-import { IUnitGridService } from '../../services/unit-grid/unit-grid.service';-import { useUnitFocused, useUnitTitle } from '../hooks/title';-import { DEFAULT_ZOOM, MAX_ZOOM, MIN_ZOOM, UniControlItem, UniControls } from '../uni-controls/UniControls';-import { LeftSidebar, RightSidebar } from '../uni-sidebar/UniSidebar';-import { UniFloatingToolbar } from '../uni-toolbar/UniFloatToolbar';-import { UniToolbar } from '../uni-toolbar/UniToolbar';--import '@xyflow/react/dist/style.css';-// Refer to packages/ui/src/views/workbench/Workbench.tsx--export interface IUniWorkbenchProps extends IWorkbenchOptions {- mountContainer: HTMLElement;-- onRendered: (contentEl: HTMLElement) => void;-}--export function UniWorkbench(props: IUniWorkbenchProps) {- const {- header = true,- contextMenu = true,- mountContainer,- onRendered,- } = props;-- const localeService = useDependency(LocaleService);- const themeService = useDependency(ThemeService);- const unitGridService = useDependency(IUnitGridService);- const instanceService = useDependency(IUniverInstanceService);- const renderManagerService = useDependency(IRenderManagerService);- const flowManagerService = useDependency(FlowManagerService);- const commandService = useDependency(ICommandService);- const themeSwitcherService = useDependency(ThemeSwitcherService);-- const contentRef = useRef<HTMLDivElement>(null);- const floatingToolbarRef = useRef<IFloatingToolbarRef>(null);- const reactFlowInstance = useRef<HTMLDivElement | null>(null);-- const headerComponents = useComponentsOfPart(BuiltInUIPart.HEADER);- const contentComponents = useComponentsOfPart(BuiltInUIPart.CONTENT);- const globalComponents = useComponentsOfPart(BuiltInUIPart.GLOBAL);-- const focusedUnit = useObservable(instanceService.focused$);-- useEffect(() => {- if (contentRef.current) {- onRendered?.(contentRef.current);- }- }, [onRendered]);-- useLayoutEffect(() => {- const sub = themeService.currentTheme$.subscribe((theme) => {- themeSwitcherService.injectThemeToHead(theme);- });-- return () => {- sub.unsubscribe();- };- }, []);-- const [locale, setLocale] = useState(localeService.getLocales());- const [zoom, setZoom] = useState<number>(DEFAULT_ZOOM);-- const onControlItemClick = useCallback((key: UniControlItem) => {- switch (key) {- case UniControlItem.AI: {- commandService.executeCommand('project.controls-pro-search.operation');- break;- }- }- }, [commandService]);-- const resizeUnits = useCallback(debounce(() => {- renderManagerService.getRenderAll().forEach((renderer) => renderer.engine.resize());- }, 400), [renderManagerService]); // TODO: this is not-- // Create a portal container for injecting global component themes.- const portalContainer = useMemo<HTMLElement>(() => document.createElement('div'), []);-- useEffect(() => {- document.body.appendChild(portalContainer);-- const subscriptions = [- localeService.localeChanged$.subscribe(() => {- setLocale(localeService.getLocales());- }),- ];-- return () => {- // batch unsubscribe- subscriptions.forEach((subscription) => subscription.unsubscribe());-- // cleanup- document.body.removeChild(portalContainer);- };- }, [localeService, mountContainer, portalContainer]);-- const nodeTypes: NodeTypes = {- customNode: UnitNode,- };-- const unitGrid = useObservable(unitGridService.unitGrid$, undefined, true);- const gridNodes = useMemo(() => unitGrid.map((item) => ({- id: item.id,- type: 'customNode',- dragHandle: '.univer-uni-node-drag-handle',- style: item.style,- focusable: true,- data: {- unitId: item.data.unitId,- gridService: unitGridService,- instanceService,- },- position: item.position,- })), [unitGrid]);-- const [nodes, setNodes, onNodesChange] = useNodesState(gridNodes);- useEffect(() => {- setNodes(gridNodes);- }, [gridNodes]);-- const onMove = useCallback((event: MouseEvent | TouchEvent | null, viewport: Viewport) => {- floatingToolbarRef.current?.update();- const { zoom } = viewport;- setZoom(zoom);- flowManagerService.setViewportChanged(viewport);- }, [floatingToolbarRef, setZoom, flowManagerService]);-- const onFlowInit = useCallback((instance: ReactFlowInstance<any>) => {- flowManagerService.setReactFlowInstance(instance);- }, [flowManagerService]);-- const disableReactFlowBehavior = !!focusedUnit;-- return (- <ConfigProvider locale={locale?.design} mountContainer={portalContainer}>- {/**- * IMPORTANT! This `tabIndex` should not be moved. This attribute allows the element to catch- * all focusin event merged from its descendants. The DesktopLayoutService would listen to focusin events- * bubbled to this element and refocus the input element.- */}- <ReactFlowProvider>- <div- data-u-comp="workbench-layout"- className="univer-relative univer-flex univer-h-full univer-min-h-0 univer-flex-col"- tabIndex={-1}- onBlur={(e) => e.stopPropagation()}- >- <div className="univer-absolute univer-left-0 univer-top-0 univer-h-full univer-w-full">- <section- className="univer-relative univer-flex univer-h-full univer-w-full"- ref={contentRef}- data-range-selector- onContextMenu={(e) => e.preventDefault()}- >- <ReactFlow- ref={reactFlowInstance}- maxZoom={MAX_ZOOM}- minZoom={MIN_ZOOM}- zoomOnDoubleClick={!disableReactFlowBehavior}- zoomOnPinch={!disableReactFlowBehavior}- zoomOnScroll={!disableReactFlowBehavior}- panOnDrag={!disableReactFlowBehavior}- panOnScroll={!disableReactFlowBehavior}- nodes={nodes}- nodeTypes={nodeTypes}- onNodesChange={(nodes) => {- nodes.forEach((node) => {- if (node.type === 'dimensions' && node.resizing) {- unitGridService.changeDimension(node.id, { width: node.dimensions!.width, height: node.dimensions!.height });- } else if (node.type === 'position') {- unitGridService.changePosition(node.id, { x: node.position!.x, y: node.position!.y });- }- });-- onNodesChange(nodes);- }}- onReset={resizeUnits}- fitView- defaultViewport={{ zoom: MIN_ZOOM, x: 0, y: 0 }}- onPointerDown={(event) => {- if (event.target instanceof HTMLElement- && (- event.target.dataset.uComp === 'render-canvas'- || event.target.classList.contains('react-flow__resize-control'))- ) {- return;- }- commandService.executeCommand(UniFocusUnitOperation.id, { unitId: null });- }}- onMove={onMove}- onInit={onFlowInit}- >- <Background bgColor="#f4f6f8" color="#d9d9d9" />- </ReactFlow>-- {/* Sheet cell editors etc. Their size would not be affected the scale of ReactFlow. */}- <ComponentContainer key="content" components={contentComponents} />- </section>- </div>- <div- className={`- univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-h-full- univer-w-full- [&>*]:univer-pointer-events-auto- `}- >- {/* header */}- {header && (- <div- className={`- univer-relative univer-z-10 univer-flex univer-w-full univer-items-center- univer-justify-center univer-pt-3- `}- >- <div className="univer-pointer-events-auto univer-max-w-[calc(100%-650px)]">- <UniToolbar />- <ComponentContainer key="header" components={headerComponents} />- </div>- </div>- )}- <UniFloatingToolbar ref={floatingToolbarRef} node={nodes.find((n) => n.id === focusedUnit)?.data} />-- <LeftSidebar />- <RightSidebar />-- {/* uni mode controller buttons */}- <UniControls zoom={zoom} onItemClick={onControlItemClick} />- </div>- </div>- <ComponentContainer key="global" components={globalComponents} />- <GlobalZone />- {contextMenu && <ContextMenu />}- <FloatingContainer />- </ReactFlowProvider>- </ConfigProvider>- );-}--interface IUnitNodeProps {- data: IUnitRendererProps;-}--function UnitNode({ data }: IUnitNodeProps) {- const { unitId } = data;- const title = useUnitTitle(unitId);- const focused = useUnitFocused(unitId);- const unitComponents = useComponentsOfPart(BuiltInUIPart.UNIT);-- const contextService = useDependency(IContextService);- const commandService = useDependency(ICommandService);-- const disableChangingUnitFocusing = useObservable(- () => contextService.subscribeContextValue$(UNI_DISABLE_CHANGING_FOCUS_KEY),- false,- false,- []- );-- const focus = useCallback(() => {- if (!disableChangingUnitFocusing && !focused) {- commandService.executeCommand(UniFocusUnitOperation.id, { unitId });- }- }, [disableChangingUnitFocusing, focused, unitId, commandService]);-- return (- <div className="univer-relative univer-flex univer-h-full univer-w-full" onPointerDownCapture={focus}>- <NodeResizer isVisible={focused} minWidth={180} minHeight={100} />- <UnitRenderer- key={data.unitId}- {...data}- />-- <div- className={`- univer-absolute -univer-left-8 univer-flex univer-h-[18px] univer-w-[18px] univer-items-center- univer-justify-center univer-rounded univer-p-1 univer-shadow-sm- `}- >- <MenuIcon />- </div>-- <div- className={`- univer-absolute -univer-top-6 univer-left-0 univer-text-sm univer-text-gray-600- dark:!univer-text-gray-200- `}- >- {title}- </div>- <ComponentContainer key="unit" components={unitComponents} sharedProps={{ unitId }} />- </div>-- );-}--export interface IUnitRendererProps {- unitId: string;-- gridService: IUnitGridService;- instanceService: IUniverInstanceService;-}--function UnitRenderer(props: IUnitRendererProps) {- const { unitId, gridService } = props;- const mountRef = useRef<HTMLDivElement>(null);-- const instanceService = useDependency(IUniverInstanceService);-- const focusedUnit = useObservable(instanceService.focused$);- const focused = focusedUnit === unitId;-- useEffect(() => {- if (mountRef.current) {- gridService.setContainerForRender(unitId, mountRef.current);- }- }, [gridService, unitId]);-- return (- <div- className={clsx(`- univer-relative univer-flex-1 univer-overflow-hidden univer-rounded-lg univer-border-transparent- `, borderClassName, {- 'univer-border-primary-600': focused,- })}- ref={mountRef}- // We bind these focusing events on capture phrase so the- // other event handlers would have correct currently focused unit.- onWheel={(event) => event.stopPropagation()}- />- );-}--function FloatingContainer() {- const { mountContainer } = useContext(ConfigContext);- const floatingComponents = useComponentsOfPart(BuiltInUIPart.FLOATING);-- return createPortal(<ComponentContainer key="floating" components={floatingComponents} />, mountContainer!);-}diff --git a/packages-experimental/uniui/src/vite-env.d.ts b/packages-experimental/uniui/src/vite-env.d.tsdeleted file mode 100644index 11f02fe2a0..0000000000--- a/packages-experimental/uniui/src/vite-env.d.ts+++ /dev/null@@ -1 +0,0 @@-/// <reference types="vite/client" />diff --git a/packages-experimental/uniui/tailwind.config.ts b/packages-experimental/uniui/tailwind.config.tsdeleted file mode 100644index 75967f186f..0000000000--- a/packages-experimental/uniui/tailwind.config.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * Copyright 2023-present DreamNum Co., Ltd.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { Config } from 'tailwindcss';-import preset from '@univerjs-infra/shared/tailwind';--const config: Config = {- presets: [preset],- content: [- './src/**/*.{js,ts,jsx,tsx}',- ],-};--export default config;diff --git a/packages-experimental/uniui/tsconfig.json b/packages-experimental/uniui/tsconfig.jsondeleted file mode 100644index 018601b6b9..0000000000--- a/packages-experimental/uniui/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/base",- "compilerOptions": {- "rootDir": "src",- "outDir": "lib/types"- },- "references": [- {- "path": "./tsconfig.node.json"- }- ],- "include": [- "src"- ]-}diff --git a/packages-experimental/uniui/tsconfig.node.json b/packages-experimental/uniui/tsconfig.node.jsondeleted file mode 100644index 4947a09903..0000000000--- a/packages-experimental/uniui/tsconfig.node.json+++ /dev/null@@ -1,4 +0,0 @@-{- "extends": "@univerjs-infra/shared/tsconfigs/node",- "include": ["vitest.config.ts"]-}diff --git a/packages-experimental/uniui/vitest.config.ts b/packages-experimental/uniui/vitest.config.tsdeleted file mode 100644index af97c6d7a2..0000000000--- a/packages-experimental/uniui/vitest.config.ts+++ /dev/null@@ -1,3 +0,0 @@-import createConfig from '@univerjs-infra/shared/vitest';--export default createConfig();diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 99a38188e0..61ab52bffc 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -111,6 +111,212 @@ importers:specifier: ^4.0.16version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ common/debugger:+ dependencies:+ '@univerjs/core':+ specifier: workspace:*+ version: link:../../packages/core+ '@univerjs/design':+ specifier: workspace:*+ version: link:../../packages/design+ '@univerjs/docs-drawing-ui':+ specifier: workspace:*+ version: link:../../packages/docs-drawing-ui+ '@univerjs/engine-render':+ specifier: workspace:*+ version: link:../../packages/engine-render+ '@univerjs/icons':+ specifier: ^1.1.0+ '@univerjs/mockdata':+ specifier: workspace:*+ version: link:../mockdata+ '@univerjs/sheets':+ specifier: workspace:*+ version: link:../../packages/sheets+ '@univerjs/sheets-drawing-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-drawing-ui+ '@univerjs/themes':+ specifier: workspace:*+ version: link:../../packages/themes+ '@univerjs/ui':+ specifier: workspace:*+ version: link:../../packages/ui+ '@univerjs/watermark':+ specifier: workspace:*+ version: link:../../packages/watermark+ devDependencies:+ '@univerjs-infra/shared':+ specifier: workspace:*+ version: link:../shared+ postcss:+ specifier: ^8.5.6+ version: 8.5.6+ react:+ specifier: 19.2.3+ version: 19.2.3+ rxjs:+ specifier: ^7.8.2+ version: 7.8.2+ tailwindcss:+ specifier: 3.4.18+ version: 3.4.18+ typescript:+ specifier: ^5.9.3+ version: 5.9.3+ vite:+ specifier: ^7.3.0+ version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vitest:+ specifier: ^4.0.16+ version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vue:+ specifier: ^3.5.26+ version: 3.5.26([email protected])++ common/mockdata:+ dependencies:+ '@univerjs/action-recorder':+ specifier: workspace:*+ version: link:../../packages/action-recorder+ '@univerjs/core':+ specifier: workspace:*+ version: link:../../packages/core+ '@univerjs/data-validation':+ specifier: workspace:*+ version: link:../../packages/data-validation+ '@univerjs/design':+ specifier: workspace:*+ version: link:../../packages/design+ '@univerjs/docs':+ specifier: workspace:*+ version: link:../../packages/docs+ '@univerjs/docs-drawing':+ specifier: workspace:*+ version: link:../../packages/docs-drawing+ '@univerjs/docs-drawing-ui':+ specifier: workspace:*+ version: link:../../packages/docs-drawing-ui+ '@univerjs/docs-hyper-link-ui':+ specifier: workspace:*+ version: link:../../packages/docs-hyper-link-ui+ '@univerjs/docs-quick-insert-ui':+ specifier: workspace:*+ version: link:../../packages/docs-quick-insert-ui+ '@univerjs/docs-ui':+ specifier: workspace:*+ version: link:../../packages/docs-ui+ '@univerjs/drawing':+ specifier: workspace:*+ version: link:../../packages/drawing+ '@univerjs/drawing-ui':+ specifier: workspace:*+ version: link:../../packages/drawing-ui+ '@univerjs/engine-render':+ specifier: workspace:*+ version: link:../../packages/engine-render+ '@univerjs/find-replace':+ specifier: workspace:*+ version: link:../../packages/find-replace+ '@univerjs/sheets':+ specifier: workspace:*+ version: link:../../packages/sheets+ '@univerjs/sheets-conditional-formatting':+ specifier: workspace:*+ version: link:../../packages/sheets-conditional-formatting+ '@univerjs/sheets-conditional-formatting-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-conditional-formatting-ui+ '@univerjs/sheets-crosshair-highlight':+ specifier: workspace:*+ version: link:../../packages/sheets-crosshair-highlight+ '@univerjs/sheets-data-validation':+ specifier: workspace:*+ version: link:../../packages/sheets-data-validation+ '@univerjs/sheets-data-validation-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-data-validation-ui+ '@univerjs/sheets-drawing':+ specifier: workspace:*+ version: link:../../packages/sheets-drawing+ '@univerjs/sheets-drawing-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-drawing-ui+ '@univerjs/sheets-filter':+ specifier: workspace:*+ version: link:../../packages/sheets-filter+ '@univerjs/sheets-filter-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-filter-ui+ '@univerjs/sheets-find-replace':+ specifier: workspace:*+ version: link:../../packages/sheets-find-replace+ '@univerjs/sheets-formula':+ specifier: workspace:*+ version: link:../../packages/sheets-formula+ '@univerjs/sheets-formula-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-formula-ui+ '@univerjs/sheets-hyper-link':+ specifier: workspace:*+ version: link:../../packages/sheets-hyper-link+ '@univerjs/sheets-hyper-link-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-hyper-link-ui+ '@univerjs/sheets-note-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-note-ui+ '@univerjs/sheets-numfmt-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-numfmt-ui+ '@univerjs/sheets-sort':+ specifier: workspace:*+ version: link:../../packages/sheets-sort+ '@univerjs/sheets-sort-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-sort-ui+ '@univerjs/sheets-table-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-table-ui+ '@univerjs/sheets-thread-comment':+ specifier: workspace:*+ version: link:../../packages/sheets-thread-comment+ '@univerjs/sheets-thread-comment-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-thread-comment-ui+ '@univerjs/sheets-ui':+ specifier: workspace:*+ version: link:../../packages/sheets-ui+ '@univerjs/sheets-zen-editor':+ specifier: workspace:*+ version: link:../../packages/sheets-zen-editor+ '@univerjs/slides-ui':+ specifier: workspace:*+ version: link:../../packages/slides-ui+ '@univerjs/thread-comment':+ specifier: workspace:*+ version: link:../../packages/thread-comment+ '@univerjs/thread-comment-ui':+ specifier: workspace:*+ version: link:../../packages/thread-comment-ui+ '@univerjs/ui':+ specifier: workspace:*+ version: link:../../packages/ui+ '@univerjs/uniscript':+ specifier: workspace:*+ version: link:../../packages/uniscript+ devDependencies:+ '@univerjs-infra/shared':+ specifier: workspace:*+ version: link:../shared+ fs-extra:+ specifier: ^11.3.3+ version: 11.3.3+ typescript:+ specifier: ^5.9.3+ version: 5.9.3+common/shared:dependencies:'@typescript-eslint/parser':@@ -285,7 +491,7 @@ importers:version: link:../packages/data-validation'@univerjs/debugger':specifier: workspace:*- version: link:../packages-experimental/debugger+ version: link:../common/debugger'@univerjs/design':specifier: workspace:*version: link:../packages/design@@ -333,7 +539,7 @@ importers:'@univerjs/mockdata':specifier: workspace:*- version: link:../mockdata+ version: link:../common/mockdata'@univerjs/network':specifier: workspace:*version: link:../packages/network@@ -378,667 +584,143 @@ importers:version: link:../packages/sheets-find-replace'@univerjs/sheets-formula':specifier: workspace:*- version: link:../packages/sheets-formula- '@univerjs/sheets-formula-ui':- specifier: workspace:*- version: link:../packages/sheets-formula-ui- '@univerjs/sheets-hyper-link':- specifier: workspace:*- version: link:../packages/sheets-hyper-link- '@univerjs/sheets-hyper-link-ui':- specifier: workspace:*- version: link:../packages/sheets-hyper-link-ui- '@univerjs/sheets-note':- specifier: workspace:*- version: link:../packages/sheets-note- '@univerjs/sheets-note-ui':- specifier: workspace:*- version: link:../packages/sheets-note-ui- '@univerjs/sheets-numfmt':- specifier: workspace:*- version: link:../packages/sheets-numfmt- '@univerjs/sheets-numfmt-ui':- specifier: workspace:*- version: link:../packages/sheets-numfmt-ui- '@univerjs/sheets-sort':- specifier: workspace:*- version: link:../packages/sheets-sort- '@univerjs/sheets-sort-ui':- specifier: workspace:*- version: link:../packages/sheets-sort-ui- '@univerjs/sheets-table':- specifier: workspace:*- version: link:../packages/sheets-table- '@univerjs/sheets-table-ui':- specifier: workspace:*- version: link:../packages/sheets-table-ui- '@univerjs/sheets-thread-comment':- specifier: workspace:*- version: link:../packages/sheets-thread-comment- '@univerjs/sheets-thread-comment-ui':- specifier: workspace:*- version: link:../packages/sheets-thread-comment-ui- '@univerjs/sheets-ui':- specifier: workspace:*- version: link:../packages/sheets-ui- '@univerjs/sheets-zen-editor':- specifier: workspace:*- version: link:../packages/sheets-zen-editor- '@univerjs/slides':- specifier: workspace:*- version: link:../packages/slides- '@univerjs/slides-ui':- specifier: workspace:*- version: link:../packages/slides-ui- '@univerjs/themes':- specifier: workspace:*- version: link:../packages/themes- '@univerjs/thread-comment':- specifier: workspace:*- version: link:../packages/thread-comment- '@univerjs/thread-comment-ui':- specifier: workspace:*- version: link:../packages/thread-comment-ui- '@univerjs/ui':- specifier: workspace:*- version: link:../packages/ui- '@univerjs/ui-adapter-vue3':- specifier: workspace:*- version: link:../packages/ui-adapter-vue3- '@univerjs/ui-adapter-web-component':- specifier: workspace:*- version: link:../packages/ui-adapter-web-component- '@univerjs/uni-docs-ui':- specifier: workspace:*- version: link:../packages-experimental/uni-docs-ui- '@univerjs/uni-formula':- specifier: workspace:*- version: link:../packages-experimental/uni-formula- '@univerjs/uni-formula-ui':- specifier: workspace:*- version: link:../packages-experimental/uni-formula-ui- '@univerjs/uni-sheets-ui':- specifier: workspace:*- version: link:../packages-experimental/uni-sheets-ui- '@univerjs/uni-slides-ui':- specifier: workspace:*- version: link:../packages-experimental/uni-slides-ui- '@univerjs/uniscript':- specifier: workspace:*- version: link:../packages/uniscript- '@univerjs/uniui':- specifier: workspace:*- version: link:../packages-experimental/uniui- '@univerjs/watermark':- specifier: workspace:*- version: link:../packages/watermark- lit:- specifier: ^3.3.2- version: 3.3.2- monaco-editor:- specifier: 0.55.1- version: 0.55.1- react:- specifier: 19.2.3- version: 19.2.3- react-dom:- specifier: 19.2.3- version: 19.2.3([email protected])- react-mosaic-component:- specifier: ^6.1.1- version: 6.1.1(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])- devDependencies:- '@types/fs-extra':- specifier: ^11.0.4- version: 11.0.4- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../common/shared- detect-port:- specifier: ^2.1.0- version: 2.1.0- esbuild:- specifier: ^0.27.2- version: 0.27.2- esbuild-plugin-alias:- specifier: ^0.2.1- version: 0.2.1- esbuild-plugin-clean:- specifier: ^1.0.1- version: 1.0.1([email protected])- esbuild-plugin-copy:- specifier: ^2.1.1- version: 2.1.1([email protected])- esbuild-plugin-vue3:- specifier: ^0.5.1- esbuild-style-plugin:- specifier: ^1.6.3- version: 1.6.3- fs-extra:- specifier: ^11.3.3- version: 11.3.3- minimist:- specifier: ^1.2.8- version: 1.2.8- postcss:- specifier: ^8.5.6- version: 8.5.6- tailwindcss:- specifier: 3.4.18- version: 3.4.18- tailwindcss-animate:- specifier: ^1.0.7- version: 1.0.7([email protected])- typescript:- specifier: ^5.9.3- version: 5.9.3-- mockdata:- dependencies:- '@univerjs/action-recorder':- specifier: workspace:*- version: link:../packages/action-recorder- '@univerjs/core':- specifier: workspace:*- version: link:../packages/core- '@univerjs/data-validation':- specifier: workspace:*- version: link:../packages/data-validation- '@univerjs/design':- specifier: workspace:*- version: link:../packages/design- '@univerjs/docs':- specifier: workspace:*- version: link:../packages/docs- '@univerjs/docs-drawing':- specifier: workspace:*- version: link:../packages/docs-drawing- '@univerjs/docs-drawing-ui':- specifier: workspace:*- version: link:../packages/docs-drawing-ui- '@univerjs/docs-hyper-link-ui':- specifier: workspace:*- version: link:../packages/docs-hyper-link-ui- '@univerjs/docs-quick-insert-ui':- specifier: workspace:*- version: link:../packages/docs-quick-insert-ui- '@univerjs/docs-ui':- specifier: workspace:*- version: link:../packages/docs-ui- '@univerjs/drawing':- specifier: workspace:*- version: link:../packages/drawing- '@univerjs/drawing-ui':- specifier: workspace:*- version: link:../packages/drawing-ui- '@univerjs/engine-render':- specifier: workspace:*- version: link:../packages/engine-render- '@univerjs/find-replace':- specifier: workspace:*- version: link:../packages/find-replace- '@univerjs/sheets':- specifier: workspace:*- version: link:../packages/sheets- '@univerjs/sheets-conditional-formatting':- specifier: workspace:*- version: link:../packages/sheets-conditional-formatting- '@univerjs/sheets-conditional-formatting-ui':- specifier: workspace:*- version: link:../packages/sheets-conditional-formatting-ui- '@univerjs/sheets-crosshair-highlight':- specifier: workspace:*- version: link:../packages/sheets-crosshair-highlight- '@univerjs/sheets-data-validation':- specifier: workspace:*- version: link:../packages/sheets-data-validation- '@univerjs/sheets-data-validation-ui':- specifier: workspace:*- version: link:../packages/sheets-data-validation-ui- '@univerjs/sheets-drawing':- specifier: workspace:*- version: link:../packages/sheets-drawing- '@univerjs/sheets-drawing-ui':- specifier: workspace:*- version: link:../packages/sheets-drawing-ui- '@univerjs/sheets-filter':- specifier: workspace:*- version: link:../packages/sheets-filter- '@univerjs/sheets-filter-ui':- specifier: workspace:*- version: link:../packages/sheets-filter-ui- '@univerjs/sheets-find-replace':- specifier: workspace:*- version: link:../packages/sheets-find-replace- '@univerjs/sheets-formula':- specifier: workspace:*- version: link:../packages/sheets-formula- '@univerjs/sheets-formula-ui':- specifier: workspace:*- version: link:../packages/sheets-formula-ui- '@univerjs/sheets-hyper-link':- specifier: workspace:*- version: link:../packages/sheets-hyper-link- '@univerjs/sheets-hyper-link-ui':- specifier: workspace:*- version: link:../packages/sheets-hyper-link-ui- '@univerjs/sheets-note-ui':- specifier: workspace:*- version: link:../packages/sheets-note-ui- '@univerjs/sheets-numfmt-ui':- specifier: workspace:*- version: link:../packages/sheets-numfmt-ui- '@univerjs/sheets-sort':- specifier: workspace:*- version: link:../packages/sheets-sort- '@univerjs/sheets-sort-ui':- specifier: workspace:*- version: link:../packages/sheets-sort-ui- '@univerjs/sheets-table-ui':- specifier: workspace:*- version: link:../packages/sheets-table-ui- '@univerjs/sheets-thread-comment':- specifier: workspace:*- version: link:../packages/sheets-thread-comment- '@univerjs/sheets-thread-comment-ui':- specifier: workspace:*- version: link:../packages/sheets-thread-comment-ui- '@univerjs/sheets-ui':- specifier: workspace:*- version: link:../packages/sheets-ui- '@univerjs/sheets-zen-editor':- specifier: workspace:*- version: link:../packages/sheets-zen-editor- '@univerjs/slides-ui':- specifier: workspace:*- version: link:../packages/slides-ui- '@univerjs/thread-comment':- specifier: workspace:*- version: link:../packages/thread-comment- '@univerjs/thread-comment-ui':- specifier: workspace:*- version: link:../packages/thread-comment-ui- '@univerjs/ui':- specifier: workspace:*- version: link:../packages/ui- '@univerjs/uni-formula-ui':- specifier: workspace:*- version: link:../packages-experimental/uni-formula-ui- '@univerjs/uniscript':- specifier: workspace:*- version: link:../packages/uniscript- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../common/shared- fs-extra:- specifier: ^11.3.3- version: 11.3.3- typescript:- specifier: ^5.9.3- version: 5.9.3-- packages-experimental/debugger:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- '@univerjs/design':- specifier: workspace:*- version: link:../../packages/design- '@univerjs/docs-drawing-ui':- specifier: workspace:*- version: link:../../packages/docs-drawing-ui- '@univerjs/engine-render':- specifier: workspace:*- version: link:../../packages/engine-render- '@univerjs/icons':- specifier: ^1.1.0- '@univerjs/mockdata':- specifier: workspace:*- version: link:../../mockdata- '@univerjs/sheets':- specifier: workspace:*- version: link:../../packages/sheets- '@univerjs/sheets-drawing-ui':- specifier: workspace:*- version: link:../../packages/sheets-drawing-ui- '@univerjs/themes':- specifier: workspace:*- version: link:../../packages/themes- '@univerjs/ui':- specifier: workspace:*- version: link:../../packages/ui- '@univerjs/watermark':- specifier: workspace:*- version: link:../../packages/watermark- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../../common/shared- postcss:- specifier: ^8.5.6- version: 8.5.6- react:- specifier: 19.2.3- version: 19.2.3- rxjs:- specifier: ^7.8.2- version: 7.8.2- tailwindcss:- specifier: 3.4.18- version: 3.4.18- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vue:- specifier: ^3.5.26- version: 3.5.26([email protected])-- packages-experimental/uni-docs-ui:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- '@univerjs/docs':- specifier: workspace:*- version: link:../../packages/docs- '@univerjs/docs-drawing-ui':- specifier: workspace:*- version: link:../../packages/docs-drawing-ui- '@univerjs/docs-ui':- specifier: workspace:*- version: link:../../packages/docs-ui- '@univerjs/engine-render':- specifier: workspace:*- version: link:../../packages/engine-render- '@univerjs/ui':- specifier: workspace:*- version: link:../../packages/ui- '@univerjs/uniui':- specifier: workspace:*- version: link:../uniui- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../../common/shared- postcss:- specifier: ^8.5.6- version: 8.5.6- rxjs:- specifier: ^7.8.2- version: 7.8.2- tailwindcss:- specifier: 3.4.18- version: 3.4.18- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-- packages-experimental/uni-formula:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../../common/shared- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-- packages-experimental/uni-formula-ui:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- '@univerjs/design':- specifier: workspace:*- version: link:../../packages/design- '@univerjs/docs':- specifier: workspace:*- version: link:../../packages/docs- '@univerjs/docs-ui':- specifier: workspace:*- version: link:../../packages/docs-ui- '@univerjs/engine-formula':- specifier: workspace:*- version: link:../../packages/engine-formula- '@univerjs/engine-render':- specifier: workspace:*- version: link:../../packages/engine-render- '@univerjs/icons':- specifier: ^1.1.0- '@univerjs/rpc':- specifier: workspace:*- version: link:../../packages/rpc- '@univerjs/sheets-formula-ui':- specifier: workspace:*- version: link:../../packages/sheets-formula-ui- '@univerjs/slides-ui':- specifier: workspace:*- version: link:../../packages/slides-ui- '@univerjs/ui':- specifier: workspace:*- version: link:../../packages/ui- '@univerjs/uni-formula':- specifier: workspace:*- version: link:../uni-formula- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../../common/shared- postcss:- specifier: ^8.5.6- version: 8.5.6- react:- specifier: 19.2.3- version: 19.2.3- rxjs:- specifier: ^7.8.2- version: 7.8.2- tailwindcss:- specifier: 3.4.18- version: 3.4.18- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-- packages-experimental/uni-sheets-ui:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- '@univerjs/design':- specifier: workspace:*- version: link:../../packages/design- '@univerjs/docs':- specifier: workspace:*- version: link:../../packages/docs- '@univerjs/docs-ui':- specifier: workspace:*- version: link:../../packages/docs-ui- '@univerjs/icons':- specifier: ^1.1.0- '@univerjs/sheets':- specifier: workspace:*- version: link:../../packages/sheets- '@univerjs/sheets-drawing-ui':- specifier: workspace:*- version: link:../../packages/sheets-drawing-ui- '@univerjs/sheets-ui':- specifier: workspace:*- version: link:../../packages/sheets-ui- '@univerjs/ui':- specifier: workspace:*- version: link:../../packages/ui- '@univerjs/uniui':- specifier: workspace:*- version: link:../uniui- devDependencies:- '@univerjs-infra/shared':- specifier: workspace:*- version: link:../../common/shared- postcss:- specifier: ^8.5.6- version: 8.5.6- react:- specifier: 19.2.3- version: 19.2.3- rxjs:- specifier: ^7.8.2- version: 7.8.2- tailwindcss:- specifier: 3.4.18- version: 3.4.18- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-- packages-experimental/uni-slides-ui:- dependencies:- '@univerjs/core':- specifier: workspace:*- version: link:../../packages/core- '@univerjs/design':+ version: link:../packages/sheets-formula+ '@univerjs/sheets-formula-ui':specifier: workspace:*- version: link:../../packages/design- '@univerjs/engine-render':+ version: link:../packages/sheets-formula-ui+ '@univerjs/sheets-hyper-link':specifier: workspace:*- version: link:../../packages/engine-render- '@univerjs/icons':- specifier: ^1.1.0- '@univerjs/slides-ui':+ version: link:../packages/sheets-hyper-link+ '@univerjs/sheets-hyper-link-ui':specifier: workspace:*- version: link:../../packages/slides-ui- '@univerjs/ui':+ version: link:../packages/sheets-hyper-link-ui+ '@univerjs/sheets-note':specifier: workspace:*- version: link:../../packages/ui- '@univerjs/uniui':+ version: link:../packages/sheets-note+ '@univerjs/sheets-note-ui':specifier: workspace:*- version: link:../uniui- devDependencies:- '@univerjs-infra/shared':+ version: link:../packages/sheets-note-ui+ '@univerjs/sheets-numfmt':specifier: workspace:*- version: link:../../common/shared- postcss:- specifier: ^8.5.6- version: 8.5.6- react:- specifier: 19.2.3- version: 19.2.3- rxjs:- specifier: ^7.8.2- version: 7.8.2- tailwindcss:- specifier: 3.4.18- version: 3.4.18- typescript:- specifier: ^5.9.3- version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-- packages-experimental/uniui:- dependencies:- '@floating-ui/react-dom':- specifier: ^2.1.6- '@univerjs/core':+ version: link:../packages/sheets-numfmt+ '@univerjs/sheets-numfmt-ui':specifier: workspace:*- version: link:../../packages/core- '@univerjs/design':+ version: link:../packages/sheets-numfmt-ui+ '@univerjs/sheets-sort':specifier: workspace:*- version: link:../../packages/design- '@univerjs/engine-render':+ version: link:../packages/sheets-sort+ '@univerjs/sheets-sort-ui':specifier: workspace:*- version: link:../../packages/engine-render- '@univerjs/icons':- specifier: ^1.1.0- '@univerjs/sheets':+ version: link:../packages/sheets-sort-ui+ '@univerjs/sheets-table':specifier: workspace:*- version: link:../../packages/sheets+ version: link:../packages/sheets-table+ '@univerjs/sheets-table-ui':+ specifier: workspace:*+ version: link:../packages/sheets-table-ui+ '@univerjs/sheets-thread-comment':+ specifier: workspace:*+ version: link:../packages/sheets-thread-comment+ '@univerjs/sheets-thread-comment-ui':+ specifier: workspace:*+ version: link:../packages/sheets-thread-comment-ui'@univerjs/sheets-ui':specifier: workspace:*- version: link:../../packages/sheets-ui- '@univerjs/ui':+ version: link:../packages/sheets-ui+ '@univerjs/sheets-zen-editor':specifier: workspace:*- version: link:../../packages/ui- '@xyflow/react':- specifier: ^12.10.0- version: 12.10.0(@types/[email protected])([email protected]([email protected]))([email protected])- devDependencies:- '@univerjs-infra/shared':+ version: link:../packages/sheets-zen-editor+ '@univerjs/slides':specifier: workspace:*- version: link:../../common/shared+ version: link:../packages/slides+ '@univerjs/slides-ui':+ specifier: workspace:*+ version: link:../packages/slides-ui'@univerjs/themes':specifier: workspace:*- version: link:../../packages/themes- postcss:- specifier: ^8.5.6- version: 8.5.6+ version: link:../packages/themes+ '@univerjs/thread-comment':+ specifier: workspace:*+ version: link:../packages/thread-comment+ '@univerjs/thread-comment-ui':+ specifier: workspace:*+ version: link:../packages/thread-comment-ui+ '@univerjs/ui':+ specifier: workspace:*+ version: link:../packages/ui+ '@univerjs/ui-adapter-vue3':+ specifier: workspace:*+ version: link:../packages/ui-adapter-vue3+ '@univerjs/ui-adapter-web-component':+ specifier: workspace:*+ version: link:../packages/ui-adapter-web-component+ '@univerjs/uniscript':+ specifier: workspace:*+ version: link:../packages/uniscript+ '@univerjs/watermark':+ specifier: workspace:*+ version: link:../packages/watermark+ lit:+ specifier: ^3.3.2+ version: 3.3.2+ monaco-editor:+ specifier: 0.55.1+ version: 0.55.1react:specifier: 19.2.3version: 19.2.3react-dom:specifier: 19.2.3version: 19.2.3([email protected])- rxjs:- specifier: ^7.8.2- version: 7.8.2+ react-mosaic-component:+ specifier: ^6.1.1+ version: 6.1.1(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])+ devDependencies:+ '@types/fs-extra':+ specifier: ^11.0.4+ version: 11.0.4+ '@univerjs-infra/shared':+ specifier: workspace:*+ version: link:../common/shared+ detect-port:+ specifier: ^2.1.0+ version: 2.1.0+ esbuild:+ specifier: ^0.27.2+ version: 0.27.2+ esbuild-plugin-alias:+ specifier: ^0.2.1+ version: 0.2.1+ esbuild-plugin-clean:+ specifier: ^1.0.1+ version: 1.0.1([email protected])+ esbuild-plugin-copy:+ specifier: ^2.1.1+ version: 2.1.1([email protected])+ esbuild-plugin-vue3:+ specifier: ^0.5.1+ esbuild-style-plugin:+ specifier: ^1.6.3+ version: 1.6.3+ fs-extra:+ specifier: ^11.3.3+ version: 11.3.3+ minimist:+ specifier: ^1.2.8+ version: 1.2.8+ postcss:+ specifier: ^8.5.6+ version: 8.5.6tailwindcss:specifier: 3.4.18version: 3.4.18+ tailwindcss-animate:+ specifier: ^1.0.7+ version: 1.0.7([email protected])typescript:specifier: ^5.9.3version: 5.9.3- vite:- specifier: ^7.3.0- version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- vitest:- specifier: ^4.0.16- version: 4.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])packages/action-recorder:dependencies:@@ -3539,7 +3221,7 @@ importers:version: link:../../packages/engine-formula'@univerjs/mockdata':specifier: workspace:*- version: link:../../mockdata+ version: link:../../common/mockdata'@univerjs/rpc':specifier: workspace:*version: link:../../packages/rpc@@ -5681,24 +5363,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-BgT2szDXnVypgpNxOK8aL5SGjUdaQbC++WZNjF1Qge3Og2+zhHj+RWhmehLhYyvQwqAmvezruVfOf8+3m74W+g==}- '@types/[email protected]':- resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==}-- '@types/[email protected]':- resolution: {integrity: sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==}-- '@types/[email protected]':- resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==}-- '@types/[email protected]':- resolution: {integrity: sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==}-- '@types/[email protected]':- resolution: {integrity: sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==}-- '@types/[email protected]':- resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==}-'@types/[email protected]':resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}@@ -6135,15 +5799,6 @@ packages:'@xtuc/[email protected]':resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==}- '@xyflow/[email protected]':- resolution: {integrity: sha512-eOtz3whDMWrB4KWVatIBrKuxECHqip6PfA8fTpaS2RUGVpiEAe+nqDKsLqkViVWxDGreq0lWX71Xth/SPAzXiw==}- peerDependencies:- react: 19.2.3- react-dom: 19.2.3-- '@xyflow/[email protected]':- resolution: {integrity: sha512-7v7B/PkiVrkdZzSbL+inGAo6tkR/WQHHG0/jhSvLQToCsfa8YubOGmBYd1s08tpKpihdHDZFwzQZeR69QSBb4Q==}-'@zeit/[email protected]':resolution: {integrity: sha512-7kjMwcChYEzMKjeex9ZFXkt1AyNov9R5HZtjBKVsmVpw7pa7ZtlCGvCBC2vnnXctaYN+aRI61HjIqeetZW5ROg==}@@ -6613,9 +6268,6 @@ packages:resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}- resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==}-resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==}@@ -6898,44 +6550,6 @@ packages:resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}- resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==}- engines: {node: '>=12'}- peerDependencies:- d3-selection: 2 - 3-- resolution: {integrity: sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==}- engines: {node: '>=12'}-resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==}engines: {node: '>=12'}@@ -11113,21 +10727,6 @@ packages:resolution: {integrity: sha512-b8L8yn4rIVfiXyHAmnr52/ZEpDumlT0bmxiq3Ws1ybrinhflGpt12Hvv54kYnEsGPRs6o/Ka3/ppA2OWY21IVg==}- resolution: {integrity: sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==}- engines: {node: '>=12.7.0'}- peerDependencies:- '@types/react': 19.2.7- immer: '>=9.0.6'- react: 19.2.3- peerDependenciesMeta:- '@types/react':- optional: true- immer:- optional: true- react:- optional: true-resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}@@ -13375,27 +12974,6 @@ snapshots:dependencies:'@types/node': 25.0.3- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/d3-selection': 3.0.11-- '@types/[email protected]':- dependencies:- '@types/d3-color': 3.1.3-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/d3-selection': 3.0.11-- '@types/[email protected]':- dependencies:- '@types/d3-interpolate': 3.0.4- '@types/d3-selection': 3.0.11-'@types/[email protected]':dependencies:'@types/ms': 2.1.0@@ -13972,29 +13550,6 @@ snapshots:'@xtuc/[email protected]': {}- '@xyflow/[email protected](@types/[email protected])([email protected]([email protected]))([email protected])':- dependencies:- '@xyflow/system': 0.0.74- classcat: 5.0.5- react: 19.2.3- react-dom: 19.2.3([email protected])- zustand: 4.5.7(@types/[email protected])([email protected])- transitivePeerDependencies:- - '@types/react'- - immer-- '@xyflow/[email protected]':- dependencies:- '@types/d3-drag': 3.0.7- '@types/d3-interpolate': 3.0.4- '@types/d3-selection': 3.0.11- '@types/d3-transition': 3.0.9- '@types/d3-zoom': 3.0.8- d3-drag: 3.0.0- d3-interpolate: 3.0.1- d3-selection: 3.0.0- d3-zoom: 3.0.0-'@zeit/[email protected]': {}@@ -14468,8 +14023,6 @@ snapshots:dependencies:clsx: 2.1.1- [email protected]: {}-@@ -14751,42 +14304,6 @@ snapshots:- [email protected]: {}-- [email protected]: {}-- dependencies:- d3-dispatch: 3.0.1- d3-selection: 3.0.0-- [email protected]: {}-- dependencies:- d3-color: 3.1.0-- [email protected]: {}-- [email protected]: {}-- dependencies:- d3-color: 3.1.0- d3-dispatch: 3.0.1- d3-ease: 3.0.1- d3-interpolate: 3.0.1- d3-selection: 3.0.0- d3-timer: 3.0.1-- dependencies:- d3-dispatch: 3.0.1- d3-drag: 3.0.0- d3-interpolate: 3.0.1- d3-selection: 3.0.0- d3-transition: 3.0.1([email protected])-@@ -19636,11 +19153,4 @@ snapshots:- dependencies:- use-sync-external-store: 1.6.0([email protected])- optionalDependencies:- '@types/react': 19.2.7- react: 19.2.3-diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 6d50fc539f..fc76dec939 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -2,7 +2,6 @@ packages:- common/*- examples- mockdata- - packages-experimental/*- packages/*- tests/*publicHoistPattern:diff --git a/vitest.workspace.ts b/vitest.workspace.tsindex b7133b4c02..f0b415dade 100644--- a/vitest.workspace.ts+++ b/vitest.workspace.ts@@ -1,46 +1,7 @@-import path from 'node:path';-import { fileURLToPath } from 'node:url';-import fs from 'fs-extra';-import { defineWorkspace } from 'vitest/config';+import { defineConfig } from 'vitest/config';-const __dirname = path.dirname(fileURLToPath(import.meta.url));--function findVitestConfigs(): string[] {- const baseDirs = [- path.resolve(__dirname, './packages'),- path.resolve(__dirname, './packages-experimental'),- path.resolve(__dirname, './tests'),- ];-- const vitestConfigPaths: string[] = [];-- function traverseDir(dir: string) {- const entries = fs.readdirSync(dir, { withFileTypes: true });-- for (const entry of entries) {- const fullPath = path.join(dir, entry.name);-- if (entry.isDirectory()) {- const packageJsonPath = path.join(fullPath, 'package.json');- if (fs.existsSync(packageJsonPath)) {- const viteConfigPath = path.join(fullPath, 'vitest.config.ts');- if (fs.existsSync(viteConfigPath)) {- vitestConfigPaths.push(viteConfigPath);- }- } else {- traverseDir(fullPath);- }- }- }- }-- for (const baseDir of baseDirs) {- if (fs.existsSync(baseDir)) {- traverseDir(baseDir);- }- }-- return vitestConfigPaths;-}--export default defineWorkspace(findVitestConfigs());+export default defineConfig({+ test: {+ projects: ['packages/*'],+ },+});