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
feat(sheets-note): support attach note to cells (#5125)
ZhangWei1a58d80e5d61
diff --git a/common/shared/package.json b/common/shared/package.jsonindex eeb08eecb5..73ccf8e57a 100644--- a/common/shared/package.json+++ b/common/shared/package.json@@ -45,7 +45,7 @@},"devDependencies": {"@types/fs-extra": "^11.0.4",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/icons-svg": "^0.3.22","@univerjs/protocol": "0.1.45"}diff --git a/examples/package.json b/examples/package.jsonindex 61a664b777..53fce71212 100644--- a/examples/package.json+++ b/examples/package.json@@ -27,6 +27,7 @@"@univerjs/docs-drawing-ui": "workspace:*","@univerjs/docs-hyper-link-ui": "workspace:*","@univerjs/docs-mention-ui": "workspace:*",+"@univerjs/docs-quick-insert-ui": "workspace:*","@univerjs/docs-thread-comment-ui": "workspace:*","@univerjs/docs-ui": "workspace:*",@@ -55,6 +56,8 @@"@univerjs/sheets-formula-ui": "workspace:*","@univerjs/sheets-hyper-link": "workspace:*","@univerjs/sheets-hyper-link-ui": "workspace:*",+ "@univerjs/sheets-note": "workspace:*",+ "@univerjs/sheets-note-ui": "workspace:*","@univerjs/sheets-numfmt": "workspace:*","@univerjs/sheets-numfmt-ui": "workspace:*","@univerjs/sheets-sort": "workspace:*",diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex 3a4ba40dec..bded80ba8b 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -31,6 +31,8 @@ import { UniverSheetsDataValidationPlugin } from '@univerjs/sheets-data-validatiimport { UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula';import { UniverSheetsHyperLinkPlugin } from '@univerjs/sheets-hyper-link';+import { SheetsNotePlugin } from '@univerjs/sheets-note';+import { SheetsNoteUIPlugin } from '@univerjs/sheets-note-ui';import { UniverSheetsNumfmtPlugin } from '@univerjs/sheets-numfmt';import { UniverSheetsSortPlugin } from '@univerjs/sheets-sort';import { UniverSheetsBindingSourcePlugin } from '@univerjs/sheets-source-binding';@@ -38,13 +40,13 @@ import { UniverSheetTablePlugin } from '@univerjs/sheets-table';import { UniverSheetsThreadCommentPlugin } from '@univerjs/sheets-thread-comment';import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui';import { UniverSheetsZenEditorPlugin } from '@univerjs/sheets-zen-editor';+import { UniverUIPlugin } from '@univerjs/ui';import { enUS, faIR, frFR, ruRU, viVN, zhCN, zhTW } from '../locales';-import { UniverSheetsCustomMenuPlugin } from './custom-menu';-import ImportCSVButtonPlugin from './custom-plugin/import-csv-button';+import ImportCSVButtonPlugin from './custom-plugin/import-csv-button';import '@univerjs/sheets/facade';import '@univerjs/ui/facade';import '@univerjs/docs-ui/facade';@@ -131,7 +133,8 @@ function createNewInstance() {univer.registerPlugin(UniverSheetTablePlugin);univer.registerPlugin(UniverNetworkPlugin);-+ univer.registerPlugin(SheetsNotePlugin);+ univer.registerPlugin(SheetsNoteUIPlugin);univer.registerPlugin(ImportCSVButtonPlugin);// If we are running in e2e platform, we should immediately register the debugger plugin.diff --git a/mockdata/src/sheets/demo/default-workbook-data-demo.ts b/mockdata/src/sheets/demo/default-workbook-data-demo.tsindex 9649633b6b..3c4b910183 100644--- a/mockdata/src/sheets/demo/default-workbook-data-demo.ts+++ b/mockdata/src/sheets/demo/default-workbook-data-demo.ts@@ -24108,6 +24108,10 @@ export const DEFAULT_WORKBOOK_DATA_DEMO: IWorkbookData = {'dv-test': dv2,}),},+ {+ name: 'SHEET_NOTE_PLUGIN',+ data: '{"sheet-0011":{"8":{"7":{"width":160,"height":60,"note":"overlap"}},"10":{"9":{"width":160,"height":60,"note":"This is a note of sheet","show":true}},"26":{"9":{"width":160,"height":60,"note":"This is note 2"}}}}',+ },{name: 'SHEET_FILTER_PLUGIN',data: JSON.stringify({diff --git a/packages-experimental/action-recorder/package.json b/packages-experimental/action-recorder/package.jsonindex 9236fdec05..c73998499f 100644--- a/packages-experimental/action-recorder/package.json+++ b/packages-experimental/action-recorder/package.json@@ -68,7 +68,7 @@"dependencies": {"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-filter": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages-experimental/debugger/package.json b/packages-experimental/debugger/package.jsonindex 514f9fc07f..c5938a6004 100644--- a/packages-experimental/debugger/package.json+++ b/packages-experimental/debugger/package.json@@ -68,7 +68,7 @@"@univerjs/docs-drawing-ui": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/mockdata": "workspace:*","@univerjs/sheets": "workspace:*","@univerjs/sheets-drawing-ui": "workspace:*",diff --git a/packages-experimental/uni-formula-ui/package.json b/packages-experimental/uni-formula-ui/package.jsonindex b44dd471c1..9cb7898a0e 100644--- a/packages-experimental/uni-formula-ui/package.json+++ b/packages-experimental/uni-formula-ui/package.json@@ -70,7 +70,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/rpc": "workspace:*","@univerjs/sheets-formula": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages-experimental/uni-sheets-ui/package.json b/packages-experimental/uni-sheets-ui/package.jsonindex 4f94e60f00..cfa3191b23 100644--- a/packages-experimental/uni-sheets-ui/package.json+++ b/packages-experimental/uni-sheets-ui/package.json@@ -64,7 +64,7 @@"@univerjs/design": "workspace:*","@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-drawing-ui": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages-experimental/uni-slides-ui/package.json b/packages-experimental/uni-slides-ui/package.jsonindex 848a5552ec..42a142b69a 100644--- a/packages-experimental/uni-slides-ui/package.json+++ b/packages-experimental/uni-slides-ui/package.json@@ -62,7 +62,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/slides-ui": "workspace:*","@univerjs/ui": "workspace:*","@univerjs/uniui": "workspace:*"diff --git a/packages-experimental/uniui/package.json b/packages-experimental/uniui/package.jsonindex 4aea813c4d..716b8c27c0 100644--- a/packages-experimental/uniui/package.json+++ b/packages-experimental/uniui/package.json@@ -65,7 +65,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*",diff --git a/packages/design/package.json b/packages/design/package.jsonindex 4873db7396..387ca71a4f 100644--- a/packages/design/package.json+++ b/packages/design/package.json@@ -75,7 +75,7 @@"@radix-ui/react-slot": "^1.2.0","@radix-ui/react-tooltip": "^1.2.4","@rc-component/trigger": "^2.2.6",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","class-variance-authority": "^0.7.1","clsx": "^2.1.1","dayjs": "^1.11.13",diff --git a/packages/docs-drawing-ui/package.json b/packages/docs-drawing-ui/package.jsonindex e326de5c79..e981acf037 100644--- a/packages/docs-drawing-ui/package.json+++ b/packages/docs-drawing-ui/package.json@@ -74,7 +74,7 @@"@univerjs/drawing": "workspace:*","@univerjs/drawing-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/docs-hyper-link-ui/package.json b/packages/docs-hyper-link-ui/package.jsonindex d305443bf7..75f1bd7c2a 100644--- a/packages/docs-hyper-link-ui/package.json+++ b/packages/docs-hyper-link-ui/package.json@@ -72,7 +72,7 @@"@univerjs/docs-hyper-link": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/docs-quick-insert-ui/package.json b/packages/docs-quick-insert-ui/package.jsonindex 879cf46a10..befa63fea0 100644--- a/packages/docs-quick-insert-ui/package.json+++ b/packages/docs-quick-insert-ui/package.json@@ -75,7 +75,7 @@"@univerjs/drawing": "workspace:*","@univerjs/drawing-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/docs-thread-comment-ui/package.json b/packages/docs-thread-comment-ui/package.jsonindex 763ac78c3e..e8834ecfa5 100644--- a/packages/docs-thread-comment-ui/package.json+++ b/packages/docs-thread-comment-ui/package.json@@ -64,7 +64,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/thread-comment": "workspace:*","@univerjs/thread-comment-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.jsonindex 3d187401ee..99eb52f590 100644--- a/packages/docs-ui/package.json+++ b/packages/docs-ui/package.json@@ -84,7 +84,7 @@"@univerjs/docs": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/drawing-ui/package.json b/packages/drawing-ui/package.jsonindex 3b02f6ab34..58c1530cc0 100644--- a/packages/drawing-ui/package.json+++ b/packages/drawing-ui/package.json@@ -70,7 +70,7 @@"@univerjs/design": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/find-replace/package.json b/packages/find-replace/package.jsonindex d7a10aaea9..b64cda7b04 100644--- a/packages/find-replace/package.json+++ b/packages/find-replace/package.json@@ -71,7 +71,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/ui": "workspace:*"},"devDependencies": {diff --git a/packages/sheets-conditional-formatting-ui/package.json b/packages/sheets-conditional-formatting-ui/package.jsonindex f642bca819..f8a8603f0c 100644--- a/packages/sheets-conditional-formatting-ui/package.json+++ b/packages/sheets-conditional-formatting-ui/package.json@@ -73,7 +73,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-conditional-formatting": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-crosshair-highlight/package.json b/packages/sheets-crosshair-highlight/package.jsonindex 3f5ae99146..7dfa9faa4a 100644--- a/packages/sheets-crosshair-highlight/package.json+++ b/packages/sheets-crosshair-highlight/package.json@@ -80,7 +80,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/sheets-data-validation-ui/package.json b/packages/sheets-data-validation-ui/package.jsonindex 534b0d931e..aef8e60875 100644--- a/packages/sheets-data-validation-ui/package.json+++ b/packages/sheets-data-validation-ui/package.json@@ -75,7 +75,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-data-validation": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-drawing-ui/package.json b/packages/sheets-drawing-ui/package.jsonindex 8a7ebf1335..956cd2c181 100644--- a/packages/sheets-drawing-ui/package.json+++ b/packages/sheets-drawing-ui/package.json@@ -84,7 +84,7 @@"@univerjs/drawing": "workspace:*","@univerjs/drawing-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-drawing": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-filter-ui/package.json b/packages/sheets-filter-ui/package.jsonindex 803f79f462..8f8e8af9d5 100644--- a/packages/sheets-filter-ui/package.json+++ b/packages/sheets-filter-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/rpc": "workspace:*","@univerjs/sheets": "workspace:*","@univerjs/sheets-filter": "workspace:*",diff --git a/packages/sheets-formula-ui/package.json b/packages/sheets-formula-ui/package.jsonindex ae66e37d28..c892521eb3 100644--- a/packages/sheets-formula-ui/package.json+++ b/packages/sheets-formula-ui/package.json@@ -84,7 +84,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-formula": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-hyper-link-ui/package.json b/packages/sheets-hyper-link-ui/package.jsonindex db23bd2cc1..a518641d4f 100644--- a/packages/sheets-hyper-link-ui/package.json+++ b/packages/sheets-hyper-link-ui/package.json@@ -85,7 +85,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-data-validation": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*",diff --git a/packages/sheets-note-ui/README.md b/packages/sheets-note-ui/README.mdnew file mode 100644index 0000000000..7480584aff--- /dev/null+++ b/packages/sheets-note-ui/README.md@@ -0,0 +1,37 @@+# @univerjs/sheets-note-ui++| Package | Description | Version | License | Downloads | Continuous Integration | Coverage |+|---------|-------------|---------|----------|-----------|----------------------|----------|+| `@univerjs/sheets-note-ui` | `UniverSheetsNote` | [![][npm-version-shield]][npm-version-link] | ![][npm-license-shield] | ![][npm-downloads-shield] | ⭕️ | ⭕️ |++## Introduction++`@univerjs/sheets-note-ui` provides the note/annotation function of Univer Sheets.++## Usage++### Installation++```shell+npm install @univerjs/sheets-note-ui+```++or++```shell+pnpm add @univerjs/sheets-note-ui+```++### Example++```ts+import { UniverSheetsNotePlugin, INoteMentionDataService} from '@univerjs/sheets-note-ui';++// Register the plugin+univer.registerPlugin(UniverSheetsNotePlugin);+```++[npm-version-shield]: https://img.shields.io/npm/v/@univerjs/sheets-note-ui?style=flat-square+[npm-version-link]: https://npmjs.com/package/@univerjs/sheets-note-ui+[npm-license-shield]: https://img.shields.io/npm/l/@univerjs/sheets-note-ui?style=flat-square+[npm-downloads-shield]: https://img.shields.io/npm/dm/@univerjs/sheets-note-ui?style=flat-squarediff --git a/packages/sheets-note-ui/package.json b/packages/sheets-note-ui/package.jsonnew file mode 100644index 0000000000..a1b95f5932--- /dev/null+++ b/packages/sheets-note-ui/package.json@@ -0,0 +1,83 @@+{+ "name": "@univerjs/sheets-note-ui",+ "version": "0.6.10",+ "private": false,+ "description": "Univer sheets note UI plugin",+ "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",+ "./facade": "./src/facade/index.ts"+ },+ "main": "./lib/index.js",+ "module": "./lib/index.js",+ "types": "./lib/index.d.ts",+ "files": [+ "lib"+ ],+ "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/*"+ }+ },+ "scripts": {+ "test": "vitest run",+ "test:watch": "vitest",+ "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/engine-render": "workspace:*",+ "@univerjs/icons": "^0.3.24",+ "@univerjs/sheets": "workspace:*",+ "@univerjs/sheets-note": "workspace:*",+ "@univerjs/sheets-ui": "workspace:*",+ "@univerjs/ui": "workspace:*",+ "rxjs": "^7.8.1"+ },+ "devDependencies": {+ "@types/react": "^18.0.15",+ "@types/react-dom": "^18.0.6",+ "less": "^4.1.3",+ "typescript": "^5.4.3",+ "vite": "^4.5.2",+ "vitest": "^1.3.1"+ }+}diff --git a/packages/sheets-note-ui/postcss.config.mjs b/packages/sheets-note-ui/postcss.config.mjsnew file mode 100644index 0000000000..7d59f53133--- /dev/null+++ b/packages/sheets-note-ui/postcss.config.mjs@@ -0,0 +1 @@+export { default } from '@univerjs-infra/shared/postcss';diff --git a/packages/sheets-note-ui/src/commands/operations/add-note-popup.operation.ts b/packages/sheets-note-ui/src/commands/operations/add-note-popup.operation.tsnew file mode 100644index 0000000000..94720b5ea5--- /dev/null+++ b/packages/sheets-note-ui/src/commands/operations/add-note-popup.operation.ts@@ -0,0 +1,58 @@+/**+ * 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, Workbook } from '@univerjs/core';+import { CommandType, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';+import { SheetsSelectionsService } from '@univerjs/sheets';+import { SheetsNotePopupService } from '../../services/sheets-note-popup.service';++export interface IAddNotePopupOperationParams {+ trigger?: string;+}++export const AddNotePopupOperation: ICommand = {+ id: 'sheet.operation.add-note-popup',+ type: CommandType.OPERATION,+ handler: async (accessor: IAccessor, params?: IAddNotePopupOperationParams) => {+ const selectionService = accessor.get(SheetsSelectionsService);+ const notePopupService = accessor.get(SheetsNotePopupService);+ const univerInstanceService = accessor.get(IUniverInstanceService);++ const workbook = univerInstanceService.getCurrentUnitForType<Workbook>(UniverInstanceType.UNIVER_SHEET);+ if (!workbook) {+ return false;+ }++ const worksheet = workbook.getActiveSheet();+ const lastSelection = selectionService.getCurrentLastSelection();+ if (!lastSelection?.primary) {+ return false;+ }++ const { primary } = lastSelection;++ notePopupService.showPopup({+ unitId: workbook.getUnitId(),+ subUnitId: worksheet.getSheetId(),+ row: primary.actualRow,+ col: primary.actualColumn,+ temp: false,+ trigger: params?.trigger,+ });++ return true;+ },+};diff --git a/packages/sheets-note-ui/src/controllers/menu.schema.ts b/packages/sheets-note-ui/src/controllers/menu.schema.tsnew file mode 100644index 0000000000..05f6a0ede1--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/menu.schema.ts@@ -0,0 +1,41 @@+/**+ * 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 { SheetDeleteNoteCommand, SheetToggleNotePopupCommand } from '@univerjs/sheets-note';+import { ContextMenuGroup, ContextMenuPosition } from '@univerjs/ui';+import { AddNotePopupOperation } from '../commands/operations/add-note-popup.operation';+import { sheetDeleteNoteMenuFactory, sheetNoteContextMenuFactory, sheetNoteToggleMenuFactory } from './note.menu';++export const menuSchema: MenuSchemaType = {+ [ContextMenuPosition.MAIN_AREA]: {+ [ContextMenuGroup.OTHERS]: {+ order: 0,+ [AddNotePopupOperation.id]: {+ order: 0,+ menuItemFactory: sheetNoteContextMenuFactory,+ },+ [SheetDeleteNoteCommand.id]: {+ order: 0,+ menuItemFactory: sheetDeleteNoteMenuFactory,+ },+ [SheetToggleNotePopupCommand.id]: {+ order: 0,+ menuItemFactory: sheetNoteToggleMenuFactory,+ },+ },+ },+};diff --git a/packages/sheets-note-ui/src/controllers/note.menu.ts b/packages/sheets-note-ui/src/controllers/note.menu.tsnew file mode 100644index 0000000000..e7dcdac2ec--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/note.menu.ts@@ -0,0 +1,75 @@+/**+ * 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 { IMenuItem } from '@univerjs/ui';+import type { Observable } from 'rxjs';+import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';+import { getSheetCommandTarget, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission } from '@univerjs/sheets';+import { SheetDeleteNoteCommand, SheetsNoteModel, SheetToggleNotePopupCommand } from '@univerjs/sheets-note';+import { getCurrentRangeDisable$ } from '@univerjs/sheets-ui';+import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';+import { combineLatest, map } from 'rxjs';+import { AddNotePopupOperation } from '../commands/operations/add-note-popup.operation';++export const SHEET_NOTE_CONTEXT_MENU_ID = 'sheet.menu.note';++function getHasNote$(accessor: IAccessor): Observable<boolean> {+ const sheetsSelectionsService = accessor.get(SheetsSelectionsService);+ const univerInstanceService = accessor.get(IUniverInstanceService);+ return sheetsSelectionsService.selectionMoveEnd$.pipe(map(() => {+ const selection = sheetsSelectionsService.getCurrentLastSelection();+ if (!selection?.primary) return false;+ const target = getSheetCommandTarget(univerInstanceService);+ if (!target) return false;+ const { actualColumn, actualRow } = selection.primary;+ const noteModel = accessor.get(SheetsNoteModel);+ return Boolean(noteModel.getNote(target.unitId, target.subUnitId, actualRow, actualColumn));+ }));+}++export function sheetNoteContextMenuFactory(accessor: IAccessor): IMenuItem {+ return {+ id: AddNotePopupOperation.id,+ type: MenuItemType.BUTTON,+ title: 'rightClick.addNote',+ icon: 'AddNoteSingle',+ hidden$: combineLatest([getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET), getHasNote$(accessor)])+ .pipe(map(([hidden, hasNote]) => hidden || hasNote)),+ disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission] }),+ commandId: AddNotePopupOperation.id,+ };+}++export function sheetDeleteNoteMenuFactory(accessor: IAccessor): IMenuItem {+ return {+ id: SheetDeleteNoteCommand.id,+ type: MenuItemType.BUTTON,+ title: 'rightClick.deleteNote',+ icon: 'DeleteNoteSingle',+ hidden$: getHasNote$(accessor).pipe(map((hasNote) => !hasNote)),+ disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission] }),+ };+}+export function sheetNoteToggleMenuFactory(accessor: IAccessor): IMenuItem {+ return {+ id: SheetToggleNotePopupCommand.id,+ type: MenuItemType.BUTTON,+ title: 'rightClick.toggleNote',+ icon: 'HideNoteSingle',+ hidden$: getHasNote$(accessor).pipe(map((hasNote) => !hasNote)),+ };+}diff --git a/packages/sheets-note-ui/src/controllers/sheets-cell-content.controller.ts b/packages/sheets-note-ui/src/controllers/sheets-cell-content.controller.tsnew file mode 100644index 0000000000..6852a750d0--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/sheets-cell-content.controller.ts@@ -0,0 +1,79 @@+/**+ * 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 { Disposable, Inject, InterceptorEffectEnum, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';+import { IRenderManagerService } from '@univerjs/engine-render';+import { INTERCEPTOR_POINT, SheetInterceptorService } from '@univerjs/sheets';+import { SheetsNoteModel } from '@univerjs/sheets-note';+import { debounceTime } from 'rxjs';++export class SheetsCellContentController extends Disposable {+ constructor(+ @Inject(SheetInterceptorService) private readonly _sheetInterceptorService: SheetInterceptorService,+ @Inject(SheetsNoteModel) private readonly _sheetsNoteModel: SheetsNoteModel,+ @IRenderManagerService private readonly _renderManagerService: IRenderManagerService,+ @IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService+ ) {+ super();+ this._initViewModelIntercept();+ this._initSkeletonChange();+ }++ private _initViewModelIntercept() {+ this.disposeWithMe(+ this._sheetInterceptorService.intercept(+ INTERCEPTOR_POINT.CELL_CONTENT,+ {+ effect: InterceptorEffectEnum.Style,+ handler: (cell, pos, next) => {+ const { row, col, unitId, subUnitId } = pos;+ const note = this._sheetsNoteModel.getNote(unitId, subUnitId, row, col);+ if (note) {+ return next({+ ...cell,+ markers: {+ ...cell?.markers,+ tr: {+ color: '#FFBD37',+ size: 6,+ },+ },+ });+ }++ return next(cell);+ },+ priority: 100,+ }+ )+ );+ }++ private _initSkeletonChange() {+ const markSkeletonDirty = () => {+ const workbook = this._univerInstanceService.getCurrentUnitForType<Workbook>(UniverInstanceType.UNIVER_SHEET);+ if (!workbook) return;+ const unitId = workbook.getUnitId();+ const currentRender = this._renderManagerService.getRenderById(unitId);+ currentRender?.mainComponent?.makeForceDirty();+ };++ this.disposeWithMe(this._sheetsNoteModel.change$.pipe(debounceTime(16)).subscribe(() => {+ markSkeletonDirty();+ }));+ }+}diff --git a/packages/sheets-note-ui/src/controllers/sheets-note-attachment.controller.ts b/packages/sheets-note-ui/src/controllers/sheets-note-attachment.controller.tsnew file mode 100644index 0000000000..7f5740ff59--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/sheets-note-attachment.controller.ts@@ -0,0 +1,148 @@+/**+ * 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, Workbook } from '@univerjs/core';+import type { ISheetLocationBase } from '@univerjs/sheets';+import type { ISheetNote } from '@univerjs/sheets-note';+import { Disposable, Inject, IUniverInstanceService, ObjectMatrix, UniverInstanceType } from '@univerjs/core';+import { SheetsNoteModel } from '@univerjs/sheets-note';+import { CellPopupManagerService } from '@univerjs/sheets-ui';+import { of, switchMap } from 'rxjs';+import { SheetsNotePopupService } from '../services/sheets-note-popup.service';+import { SHEET_NOTE_COMPONENT } from '../views/config';++export class SheetsNoteAttachmentController extends Disposable {+ private _noteMatrix = new ObjectMatrix<IDisposable>();++ constructor(+ @Inject(SheetsNoteModel) private readonly _sheetsNoteModel: SheetsNoteModel,+ @Inject(IUniverInstanceService) private readonly _univerInstanceService: IUniverInstanceService,+ @Inject(CellPopupManagerService) private readonly _cellPopupManagerService: CellPopupManagerService,+ @Inject(SheetsNotePopupService) private readonly _sheetsNotePopupService: SheetsNotePopupService+ ) {+ super();++ this._initNoteChangeListener();+ }++ private _showPopup(unitId: string, sheetId: string, row: number, col: number) {+ this._sheetsNotePopupService.hidePopup(true);++ return this._cellPopupManagerService.showPopup(+ {+ unitId,+ subUnitId: sheetId,+ row,+ col,+ },+ {+ componentKey: SHEET_NOTE_COMPONENT,+ direction: 'horizontal',+ extraProps: {+ location: {+ unitId,+ subUnitId: sheetId,+ row,+ col,+ } as ISheetLocationBase,+ },+ priority: 3,+ }+ );+ }++ private _initSheet(targetUnitId: string, targetSheetId: string) {+ const oldMatrix = this._noteMatrix;+ oldMatrix.forValue((_, __, disposable) => {+ disposable.dispose();+ });++ this._noteMatrix = new ObjectMatrix();+ const handleNote = (unitId: string, sheetId: string, row: number, col: number, note: Nullable<ISheetNote>) => {+ const matrix = this._noteMatrix;+ const disposable = matrix.getValue(row, col);+ if (note?.show) {+ if (!disposable) {+ const newDisposable = this._showPopup(unitId, sheetId, row, col);+ if (newDisposable) {+ matrix.setValue(row, col, newDisposable);+ }+ }+ } else {+ if (disposable) {+ disposable.dispose();+ matrix.realDeleteValue(row, col);+ }+ }+ };++ this._sheetsNoteModel.getSheetNotes(targetUnitId, targetSheetId)?.forValue((row, col, note) => {+ handleNote(targetUnitId, targetSheetId, row, col, note);+ });++ return this._sheetsNoteModel.change$.subscribe((change) => {+ if (change.unitId !== targetUnitId || change.sheetId !== targetSheetId) {+ return;+ }+ switch (change.type) {+ case 'ref': {+ const { unitId, sheetId, row, col, newPosition, note } = change;+ const matrix = this._noteMatrix;+ if (!note.show) return;++ const disposable = matrix.getValue(row, col);+ if (disposable) {+ disposable.dispose();+ matrix.realDeleteValue(row, col);+ }+ const newDisposable = this._showPopup(unitId, sheetId, newPosition.row, newPosition.col);+ if (newDisposable) {+ matrix.setValue(newPosition.row, newPosition.col, newDisposable);+ }+ break;+ }++ case 'update': {+ const { unitId, sheetId, row, col, note } = change;+ handleNote(unitId, sheetId, row, col, note);+ break;+ }+ default:+ break;+ }+ });+ }++ private _initNoteChangeListener() {+ this.disposeWithMe(+ this._univerInstanceService.getCurrentTypeOfUnit$<Workbook>(UniverInstanceType.UNIVER_SHEET).pipe(+ switchMap((workbook) => workbook?.activeSheet$ ?? of(null))+ ).subscribe((sheet) => {+ if (sheet) {+ const disposable = this._initSheet(sheet.getUnitId(), sheet.getSheetId());+ return () => {+ disposable.unsubscribe();+ };+ } else {+ this._noteMatrix.forValue((_, __, disposable) => {+ disposable.dispose();+ });+ this._noteMatrix = new ObjectMatrix();+ }+ })+ );+ }+}diff --git a/packages/sheets-note-ui/src/controllers/sheets-note-popup.controller.ts b/packages/sheets-note-ui/src/controllers/sheets-note-popup.controller.tsnew file mode 100644index 0000000000..1bb8c5c644--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/sheets-note-popup.controller.ts@@ -0,0 +1,130 @@+/**+ * 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 { ISelectionWithStyle } from '@univerjs/sheets';+import type { IHoverCellPosition } from '@univerjs/sheets-ui';+import { Disposable, Inject, RANGE_TYPE, Rectangle } from '@univerjs/core';+import { IRenderManagerService } from '@univerjs/engine-render';+import { SheetsSelectionsService } from '@univerjs/sheets';+import { SheetsNoteModel } from '@univerjs/sheets-note';+import { HoverManagerService, IEditorBridgeService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';+import { debounceTime } from 'rxjs/operators';+import { SheetsNotePopupService } from '../services/sheets-note-popup.service';++export class SheetsNotePopupController extends Disposable {+ private _isSwitchingSheet = false;++ constructor(+ @Inject(SheetsNotePopupService) private readonly _sheetsNotePopupService: SheetsNotePopupService,+ @Inject(SheetsNoteModel) private readonly _sheetsNoteModel: SheetsNoteModel,+ @Inject(SheetsSelectionsService) private readonly _sheetSelectionService: SheetsSelectionsService,+ @IEditorBridgeService private readonly _editorBridgeService: IEditorBridgeService,+ @IRenderManagerService private readonly _renderManagerService: IRenderManagerService,+ @Inject(HoverManagerService) private readonly _hoverManagerService: HoverManagerService+ ) {+ super();++ this._initSelectionUpdateListener();+ this._initEditorBridge();+ this._initHoverEvent();+ }++ private _handleSelectionChange(selections: ISelectionWithStyle[], unitId: string, subUnitId: string) {+ const range = selections[0]?.range;+ const render = this._renderManagerService.getRenderById(unitId);+ const skeleton = render?.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId)?.skeleton;+ if (!skeleton) {+ return;+ }++ if (!range) {+ return;+ }+ const actualCell = skeleton.getCellWithCoordByIndex(range.startRow, range.startColumn);++ const rangeType = range.rangeType ?? RANGE_TYPE.NORMAL;+ if ((rangeType !== RANGE_TYPE.NORMAL || range.endColumn - range.startColumn > 0 || range.endRow - range.startRow > 0) && !((actualCell.isMerged || actualCell.isMergedMainCell) && Rectangle.equals(actualCell.mergeInfo, range))) {+ this._sheetsNotePopupService.hidePopup();+ return;+ }++ const row = actualCell.actualRow;+ const col = actualCell.actualColumn;+ const note = this._sheetsNoteModel.getNote(unitId, subUnitId, row, col);+ if (note?.show) return;++ if (note) {+ this._sheetsNotePopupService.showPopup({+ unitId,+ subUnitId,+ row,+ col,+ });+ } else {+ this._sheetsNotePopupService.hidePopup(true);+ }+ }++ private _initSelectionUpdateListener() {+ this.disposeWithMe(+ this._sheetSelectionService.selectionMoveEnd$.subscribe((selections) => {+ if (this._isSwitchingSheet) {+ return;+ }+ const current = this._sheetSelectionService.currentSelectionParam;+ if (!current) {+ return;+ }+ this._handleSelectionChange(selections, current.unitId, current.sheetId);+ })+ );+ }++ private _initEditorBridge() {+ this.disposeWithMe(+ this._editorBridgeService.visible$.subscribe((visible) => {+ if (visible.visible) {+ this._sheetsNotePopupService.hidePopup(true);+ }+ })+ );+ }++ private _initHoverEvent() {+ this.disposeWithMe(+ this._hoverManagerService.currentCell$.pipe(debounceTime(100)).subscribe((cell: Nullable<IHoverCellPosition>) => {+ if (!cell?.location) return;++ const { unitId, subUnitId, row, col } = cell.location;++ const note = this._sheetsNoteModel.getNote(unitId, subUnitId, row, col);+ if (note?.show) return;+ if (note) {+ this._sheetsNotePopupService.showPopup({+ unitId,+ subUnitId,+ row,+ col,+ temp: true,+ });+ } else {+ this._sheetsNotePopupService.hidePopup();+ }+ })+ );+ }+}diff --git a/packages/sheets-note-ui/src/controllers/sheets-note-ui.controller.ts b/packages/sheets-note-ui/src/controllers/sheets-note-ui.controller.tsnew file mode 100644index 0000000000..44a8d42547--- /dev/null+++ b/packages/sheets-note-ui/src/controllers/sheets-note-ui.controller.ts@@ -0,0 +1,52 @@+/**+ * 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 { AddNoteSingle, DeleteNoteSingle, HideNoteSingle } from '@univerjs/icons';+import { ComponentManager, IMenuManagerService } from '@univerjs/ui';+import { AddNotePopupOperation } from '../commands/operations/add-note-popup.operation';+import { SHEET_NOTE_COMPONENT } from '../views/config';+import { SheetsNote } from '../views/note';+import { menuSchema } from './menu.schema';++export class SheetsNoteUIController extends Disposable {+ constructor(+ @Inject(ComponentManager) private readonly _componentManager: ComponentManager,+ @Inject(IMenuManagerService) private readonly _menuManagerService: IMenuManagerService,+ @ICommandService private readonly _commandService: ICommandService+ ) {+ super();++ this._initComponents();+ this._initMenu();+ this._initCommands();+ }++ private _initComponents() {+ this.disposeWithMe(this._componentManager.register(SHEET_NOTE_COMPONENT, SheetsNote));+ this.disposeWithMe(this._componentManager.register('AddNoteSingle', AddNoteSingle));+ this.disposeWithMe(this._componentManager.register('DeleteNoteSingle', DeleteNoteSingle));+ this.disposeWithMe(this._componentManager.register('HideNoteSingle', HideNoteSingle));+ }++ private _initMenu() {+ this._menuManagerService.mergeMenu(menuSchema);+ }++ private _initCommands() {+ this._commandService.registerCommand(AddNotePopupOperation);+ }+}diff --git a/packages/sheets-note-ui/src/index.ts b/packages/sheets-note-ui/src/index.tsnew file mode 100644index 0000000000..ebc94d42b5--- /dev/null+++ b/packages/sheets-note-ui/src/index.ts@@ -0,0 +1,21 @@+/**+ * 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 * from './plugin';+export * from './services/sheets-note-popup.service';+export * from './views/note';+export * from './controllers/sheets-note-popup.controller';+export * from './controllers/sheets-cell-content.controller';diff --git a/packages/sheets-note-ui/src/locale/en-US.ts b/packages/sheets-note-ui/src/locale/en-US.tsnew file mode 100644index 0000000000..fe78f883d6--- /dev/null+++ b/packages/sheets-note-ui/src/locale/en-US.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: 'Add Note',+ deleteNote: 'Delete Note',+ toggleNote: 'Show/Hide Note',+ },+ note: {+ placeholder: 'Type here',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/fa-IR.ts b/packages/sheets-note-ui/src/locale/fa-IR.tsnew file mode 100644index 0000000000..38be5ea117--- /dev/null+++ b/packages/sheets-note-ui/src/locale/fa-IR.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: 'افزودن یادداشت',+ deleteNote: 'حذف یادداشت',+ toggleNote: 'نمایش/پنهان کردن یادداشت',+ },+ note: {+ placeholder: 'اینجا تایپ کنید',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/fr-FR.ts b/packages/sheets-note-ui/src/locale/fr-FR.tsnew file mode 100644index 0000000000..22a429cddb--- /dev/null+++ b/packages/sheets-note-ui/src/locale/fr-FR.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: 'Ajouter une note',+ deleteNote: 'Supprimer la note',+ toggleNote: 'Afficher/Masquer la note',+ },+ note: {+ placeholder: 'Écrivez ici',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/index.ts b/packages/sheets-note-ui/src/locale/index.tsnew file mode 100644index 0000000000..df49e1fc99--- /dev/null+++ b/packages/sheets-note-ui/src/locale/index.ts@@ -0,0 +1,23 @@+/**+ * 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 { default as enUS } from './en-US';+export { default as faIR } from './fa-IR';+export { default as frFR } from './fr-FR';+export { default as ruRU } from './ru-RU';+export { default as viVN } from './vi-VN';+export { default as zhCN } from './zh-CN';+export { default as zhTW } from './zh-TW';diff --git a/packages/sheets-note-ui/src/locale/ru-RU.ts b/packages/sheets-note-ui/src/locale/ru-RU.tsnew file mode 100644index 0000000000..db2ee6c201--- /dev/null+++ b/packages/sheets-note-ui/src/locale/ru-RU.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: 'Добавить примечание',+ deleteNote: 'Удалить примечание',+ toggleNote: 'Показать/Скрыть примечание',+ },+ note: {+ placeholder: 'Введите текст здесь',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/vi-VN.ts b/packages/sheets-note-ui/src/locale/vi-VN.tsnew file mode 100644index 0000000000..8896c6c4d4--- /dev/null+++ b/packages/sheets-note-ui/src/locale/vi-VN.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: 'Thêm ghi chú',+ deleteNote: 'Xóa ghi chú',+ toggleNote: 'Hiện/Ẩn ghi chú',+ },+ note: {+ placeholder: 'Nhập tại đây',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/zh-CN.ts b/packages/sheets-note-ui/src/locale/zh-CN.tsnew file mode 100644index 0000000000..59e0168abb--- /dev/null+++ b/packages/sheets-note-ui/src/locale/zh-CN.ts@@ -0,0 +1,28 @@+/**+ * 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 = {+ rightClick: {+ addNote: '添加批注',+ deleteNote: '删除批注',+ toggleNote: '显示/隐藏批注',+ },+ note: {+ placeholder: '在此输入',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/locale/zh-TW.ts b/packages/sheets-note-ui/src/locale/zh-TW.tsnew file mode 100644index 0000000000..be698a0584--- /dev/null+++ b/packages/sheets-note-ui/src/locale/zh-TW.ts@@ -0,0 +1,30 @@+/**+ * 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 zhCN from './zh-CN';++const locale: typeof zhCN = {+ rightClick: {+ addNote: '添加批註',+ deleteNote: '刪除批註',+ toggleNote: '顯示/隱藏批註',+ },+ note: {+ placeholder: '在此輸入',+ },+};++export default locale;diff --git a/packages/sheets-note-ui/src/plugin.ts b/packages/sheets-note-ui/src/plugin.tsnew file mode 100644index 0000000000..dbb8837cda--- /dev/null+++ b/packages/sheets-note-ui/src/plugin.ts@@ -0,0 +1,92 @@+/**+ * 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, IConfigService, Inject, Injector, merge, Plugin, touchDependencies, UniverInstanceType } from '@univerjs/core';+import { SheetsNotePlugin } from '@univerjs/sheets-note';+import { menuSchema } from './controllers/menu.schema';+import { SheetsCellContentController } from './controllers/sheets-cell-content.controller';+import { SheetsNoteAttachmentController } from './controllers/sheets-note-attachment.controller';+import { SheetsNotePopupController } from './controllers/sheets-note-popup.controller';+import { SheetsNoteUIController } from './controllers/sheets-note-ui.controller';+import { SheetsNotePopupService } from './services/sheets-note-popup.service';++export const PLUGIN_NAME = 'SHEET_NOTE_UI_PLUGIN';+export const SHEETS_NOTE_UI_PLUGIN_CONFIG_KEY = 'sheets-note-ui';++export interface IUniverSheetsNoteUIPluginConfig {+ menu?: {+ [key: string]: unknown;+ };+ defaultNoteSize?: {+ width: number;+ height: number;+ };+}++const defaultPluginConfig: IUniverSheetsNoteUIPluginConfig = {+ menu: menuSchema,+};++@DependentOn(SheetsNotePlugin)+export class SheetsNoteUIPlugin extends Plugin {+ static override pluginName = PLUGIN_NAME;+ static override type = UniverInstanceType.UNIVER_SHEET;++ constructor(+ private readonly _config: Partial<IUniverSheetsNoteUIPluginConfig> = defaultPluginConfig,+ @Inject(Injector) protected override readonly _injector: Injector,+ @IConfigService private readonly _configService: IConfigService+ ) {+ super();+ // Manage the plugin configuration.+ const { menu, ...rest } = merge(+ {},+ defaultPluginConfig,+ this._config+ );+ if (menu) {+ this._configService.setConfig('menu', menu, { merge: true });+ }+ this._configService.setConfig(SHEETS_NOTE_UI_PLUGIN_CONFIG_KEY, rest);+ }++ override onStarting(): void {+ ([+ [SheetsNotePopupService],+ [SheetsCellContentController],+ [SheetsNotePopupController],+ [SheetsNoteUIController],+ [SheetsNoteAttachmentController],+ ] as Dependency[]).forEach((dependency) => {+ this._injector.add(dependency);+ });+ }++ override onReady(): void {+ touchDependencies(this._injector, [+ [SheetsNoteUIController],+ [SheetsCellContentController],+ ]);+ }++ override onRendered(): void {+ touchDependencies(this._injector, [+ [SheetsNotePopupController],+ [SheetsNoteAttachmentController],+ ]);+ }+}diff --git a/packages/sheets-note-ui/src/services/sheets-note-popup.service.ts b/packages/sheets-note-ui/src/services/sheets-note-popup.service.tsnew file mode 100644index 0000000000..956e1d3eef--- /dev/null+++ b/packages/sheets-note-ui/src/services/sheets-note-popup.service.ts@@ -0,0 +1,145 @@+/**+ * 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 { ISheetLocationBase } from '@univerjs/sheets';+import { Disposable, DisposableCollection, Inject } from '@univerjs/core';+import { CellPopupManagerService } from '@univerjs/sheets-ui';+import { IZenZoneService } from '@univerjs/ui';+import { BehaviorSubject } from 'rxjs';+import { SHEET_NOTE_COMPONENT } from '../views/config';++export interface INotePopup extends ISheetLocationBase {+ noteId?: string;+ temp?: boolean;+ trigger?: string;+}++export class SheetsNotePopupService extends Disposable {+ private _lastPopup: Nullable<IDisposable> = null;+ private _activePopup: Nullable<INotePopup>;+ private _activePopup$ = new BehaviorSubject<Nullable<INotePopup>>(null);++ activePopup$ = this._activePopup$.asObservable();++ get activePopup() {+ return this._activePopup;+ }++ constructor(+ @IZenZoneService private readonly _zenZoneService: IZenZoneService,+ @Inject(CellPopupManagerService) private readonly _cellPopupManagerService: CellPopupManagerService+ ) {+ super();+ this._initZenVisible();++ this.disposeWithMe(() => {+ this._activePopup$.complete();+ });+ }++ private _initZenVisible() {+ this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {+ if (visible) {+ this.hidePopup();+ }+ }));+ }++ showPopup(location: INotePopup, onHide?: () => void) {+ const { row, col, unitId, subUnitId } = location;+ if (+ this._activePopup &&+ row === this._activePopup.row &&+ col === this._activePopup.col &&+ unitId === this._activePopup.unitId &&+ subUnitId === this.activePopup?.subUnitId+ ) {+ this._activePopup = location;+ this._activePopup$.next(location);+ return;+ }+ if (this._lastPopup) {+ this._lastPopup.dispose();+ };+ if (this._zenZoneService.visible) {+ return;+ }++ this._activePopup = location;+ this._activePopup$.next(location);++ const popupDisposable = this._cellPopupManagerService.showPopup(+ {+ unitId,+ subUnitId,+ row,+ col,+ },+ {+ componentKey: SHEET_NOTE_COMPONENT,+ onClickOutside: () => {+ this.hidePopup();+ },+ direction: 'horizontal',+ extraProps: {+ location,+ },+ priority: 3,+ }+ );++ if (!popupDisposable) {+ throw new Error('[SheetsNotePopupService]: cannot show popup!');+ }++ const disposableCollection = new DisposableCollection();+ disposableCollection.add(popupDisposable);+ disposableCollection.add({+ dispose: () => {+ onHide?.();+ },+ });++ this._lastPopup = disposableCollection;+ }++ hidePopup(force?: boolean) {+ if (!this._activePopup) {+ return;+ }+ if (!force && !this._activePopup.temp) return;+ if (this._lastPopup) {+ this._lastPopup.dispose();+ }+ this._lastPopup = null;++ this._activePopup = null;+ this._activePopup$.next(null);+ }++ persistPopup() {+ if (!this._activePopup || !this._activePopup.temp) {+ return;+ }+ this._activePopup = {+ ...this._activePopup,+ temp: false,+ };++ this._activePopup$.next(this._activePopup);+ }+}diff --git a/packages/sheets-note-ui/src/views/config.ts b/packages/sheets-note-ui/src/views/config.tsnew file mode 100644index 0000000000..6917202753--- /dev/null+++ b/packages/sheets-note-ui/src/views/config.ts@@ -0,0 +1,17 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++export const SHEET_NOTE_COMPONENT = 'SHEET_NOTE_COMPONENT';diff --git a/packages/sheets-note-ui/src/views/note.tsx b/packages/sheets-note-ui/src/views/note.tsxnew file mode 100644index 0000000000..25ae1ca79e--- /dev/null+++ b/packages/sheets-note-ui/src/views/note.tsx@@ -0,0 +1,126 @@+/**+ * 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 { ISheetLocationBase } from '@univerjs/sheets';+import type { ISheetNote } from '@univerjs/sheets-note';+import type { IPopup } from '@univerjs/ui';+import type { IUniverSheetsNoteUIPluginConfig } from '../plugin';+import { ICommandService, LocaleService } from '@univerjs/core';+import { SheetDeleteNoteCommand, SheetsNoteModel, SheetUpdateNoteCommand } from '@univerjs/sheets-note';+import { useConfigValue, useDebounceFn, useDependency } from '@univerjs/ui';+import { useEffect, useMemo, useRef, useState } from 'react';+import { of } from 'rxjs';+import { SHEETS_NOTE_UI_PLUGIN_CONFIG_KEY } from '../plugin';++export const SheetsNote = (props: { popup: IPopup<{ location: ISheetLocationBase }> }) => {+ const noteModel = useDependency(SheetsNoteModel);+ const localeService = useDependency(LocaleService);+ const config = useConfigValue<IUniverSheetsNoteUIPluginConfig>(SHEETS_NOTE_UI_PLUGIN_CONFIG_KEY);+ const [note, setNote] = useState<ISheetNote>({ width: config?.defaultNoteSize?.width || 216, height: config?.defaultNoteSize?.height || 92, note: '' });+ const activePopup = props.popup.extraProps?.location;+ const textareaRef = useRef<HTMLTextAreaElement>(null);+ const commandService = useDependency(ICommandService);+ const cellNoteChange$ = useMemo(() => activePopup ? noteModel.getCellNoteChange$(activePopup.unitId, activePopup.subUnitId!, activePopup.row, activePopup.col) : of(null), [activePopup]);++ const updateNote = useDebounceFn((newNote: ISheetNote) => {+ if (!activePopup) return;++ if (newNote.note) {+ commandService.executeCommand(SheetUpdateNoteCommand.id, {+ unitId: activePopup.unitId,+ sheetId: activePopup.subUnitId!,+ row: activePopup.row,+ col: activePopup.col,+ note: newNote,+ });+ } else {+ commandService.executeCommand(SheetDeleteNoteCommand.id, {+ unitId: activePopup.unitId,+ sheetId: activePopup.subUnitId!,+ row: activePopup.row,+ col: activePopup.col,+ });+ }+ });++ useEffect(() => {+ if (activePopup) {+ const existingNote = noteModel.getNote(activePopup.unitId, activePopup.subUnitId!, activePopup.row, activePopup.col);+ if (existingNote) {+ setNote(existingNote);+ } else {+ textareaRef.current?.focus();+ }+ }+ }, [activePopup, noteModel]);++ useEffect(() => {+ const sub = cellNoteChange$.subscribe(() => {+ if (!activePopup) return;+ const existingNote = noteModel.getNote(activePopup.unitId, activePopup.subUnitId!, activePopup.row, activePopup.col);+ if (existingNote) {+ setNote(existingNote);+ }+ });++ return () => sub.unsubscribe();+ }, [cellNoteChange$]);++ useEffect(() => {+ const textarea = textareaRef.current;+ if (!textarea) return;++ const resizeObserver = new ResizeObserver((entries) => {+ const entry = entries[0];+ if (!entry) return;++ const { width, height } = entry.contentRect;+ const newNote = { ...note, width, height };+ setNote(newNote);+ updateNote(newNote);+ });++ resizeObserver.observe(textarea);++ return () => {+ resizeObserver.disconnect();+ };+ }, [note.note]); // Only re-run when note content changes++ const handleNoteChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {+ const noteString = e.target.value;+ const newNote = { ...note, note: noteString };+ setNote(newNote);+ updateNote(newNote);+ };++ if (!activePopup) return null;++ return (+ <textarea+ style={{ width: note.width, height: note.height }}+ ref={textareaRef}+ className={`+ univer-note-textarea univer-resize-both univer-ml-[1px] univer-rounded univer-border univer-border-solid+ univer-border-gray-200 univer-p-2 univer-shadow+ focus:univer-outline-none+ `}+ value={note.note}+ onChange={handleNoteChange}+ placeholder={localeService.t('note.placeholder')}+ />+ );+};diff --git a/packages/sheets-note-ui/src/vite-env.d.ts b/packages/sheets-note-ui/src/vite-env.d.tsnew file mode 100644index 0000000000..11f02fe2a0--- /dev/null+++ b/packages/sheets-note-ui/src/vite-env.d.ts@@ -0,0 +1 @@+/// <reference types="vite/client" />diff --git a/packages/sheets-note-ui/tailwind.config.ts b/packages/sheets-note-ui/tailwind.config.tsnew file mode 100644index 0000000000..75967f186f--- /dev/null+++ b/packages/sheets-note-ui/tailwind.config.ts@@ -0,0 +1,27 @@+/**+ * 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/sheets-note-ui/tsconfig.json b/packages/sheets-note-ui/tsconfig.jsonnew file mode 100644index 0000000000..c62210cbad--- /dev/null+++ b/packages/sheets-note-ui/tsconfig.json@@ -0,0 +1,9 @@+{+ "extends": "@univerjs-infra/shared/tsconfigs/base",+ "compilerOptions": {+ "rootDir": "src",+ "outDir": "lib/types"+ },+ "references": [{ "path": "./tsconfig.node.json" }],+ "include": ["src"]+}diff --git a/packages/sheets-note-ui/tsconfig.node.json b/packages/sheets-note-ui/tsconfig.node.jsonnew file mode 100644index 0000000000..4947a09903--- /dev/null+++ b/packages/sheets-note-ui/tsconfig.node.json@@ -0,0 +1,4 @@+{+ "extends": "@univerjs-infra/shared/tsconfigs/node",+ "include": ["vitest.config.ts"]+}diff --git a/packages/sheets-note-ui/vitest.config.ts b/packages/sheets-note-ui/vitest.config.tsnew file mode 100644index 0000000000..af97c6d7a2--- /dev/null+++ b/packages/sheets-note-ui/vitest.config.ts@@ -0,0 +1,3 @@+import createConfig from '@univerjs-infra/shared/vitest';++export default createConfig();diff --git a/packages/sheets-note/README.md b/packages/sheets-note/README.mdnew file mode 100644index 0000000000..4e121ce31d--- /dev/null+++ b/packages/sheets-note/README.md@@ -0,0 +1,28 @@+# @univerjs/sheets-note++| Package | Description | Version | License | Downloads | Continuous Integration | Coverage |+|---------|-------------|---------|----------|-----------|----------------------|----------|+| `@univerjs/sheets-note` | `UniverSheetsNote` | [![][npm-version-shield]][npm-version-link] | ![][npm-license-shield] | ![][npm-downloads-shield] | ❌ | ❌ |++## Introduction++`@univerjs/sheets-note` core package for sheet note. For using, please refer to [@univerjs/sheets-note](../sheets-note/README.md)++## Usage++### Installation++```shell+npm install @univerjs/sheets-note+```++or++```shell+pnpm add @univerjs/sheets-note+```++[npm-version-shield]: https://img.shields.io/npm/v/@univerjs/sheets-note?style=flat-square+[npm-version-link]: https://npmjs.com/package/@univerjs/sheets-note+[npm-license-shield]: https://img.shields.io/npm/l/@univerjs/sheets-note?style=flat-square+[npm-downloads-shield]: https://img.shields.io/npm/dm/@univerjs/sheets-note?style=flat-squarediff --git a/packages/sheets-note/package.json b/packages/sheets-note/package.jsonnew file mode 100644index 0000000000..6fc78c3b79--- /dev/null+++ b/packages/sheets-note/package.json@@ -0,0 +1,83 @@+{+ "name": "@univerjs/sheets-note",+ "version": "0.6.10",+ "private": false,+ "description": "Univer sheets note base plugin",+ "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/*",+ "./facade": "./src/facade/index.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"+ },+ "./facade": {+ "import": "./lib/es/facade.js",+ "require": "./lib/cjs/facade.js",+ "types": "./lib/types/facade/index.d.ts"+ },+ "./lib/facade": {+ "import": "./lib/es/facade.js",+ "require": "./lib/cjs/facade.js",+ "types": "./lib/types/facade/index.d.ts"+ },+ "./lib/*": "./lib/*"+ }+ },+ "directories": {+ "lib": "lib"+ },+ "files": [+ "lib"+ ],+ "scripts": {+ "test": "vitest run",+ "test:watch": "vitest",+ "coverage": "vitest run --coverage",+ "lint:types": "tsc --noEmit",+ "build": "univer-cli build"+ },+ "peerDependencies": {+ "rxjs": ">=7.0.0"+ },+ "dependencies": {+ "@univerjs/core": "workspace:*",+ "@univerjs/sheets": "workspace:*"+ },+ "devDependencies": {+ "@univerjs-infra/shared": "workspace:*",+ "rxjs": "^7.8.1",+ "typescript": "^5.8.3",+ "vite": "^6.3.3",+ "vitest": "^3.1.2"+ }+}diff --git a/packages/sheets-note/src/commands/commands/note.command.ts b/packages/sheets-note/src/commands/commands/note.command.tsnew file mode 100644index 0000000000..b853311c60--- /dev/null+++ b/packages/sheets-note/src/commands/commands/note.command.ts@@ -0,0 +1,73 @@+/**+ * 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 type { IUpdateNoteMutationParams } from '../mutations/note.mutation';+import { CommandType, ICommandService, IUniverInstanceService } from '@univerjs/core';+import { getSheetCommandTarget, SheetsSelectionsService } from '@univerjs/sheets';+import { RemoveNoteMutation, ToggleNotePopupMutation, UpdateNoteMutation } from '../mutations/note.mutation';++export const SheetDeleteNoteCommand: ICommand = {+ id: 'sheet.command.delete-note',+ type: CommandType.COMMAND,+ handler: (accessor, params) => {+ const univerInstanceService = accessor.get(IUniverInstanceService);+ const target = getSheetCommandTarget(univerInstanceService);+ if (!target) return false;+ const sheetsSelectionsService = accessor.get(SheetsSelectionsService);+ const selection = sheetsSelectionsService.getCurrentLastSelection();+ if (!selection?.primary) return false;+ const { actualColumn, actualRow } = selection.primary;+ const commandService = accessor.get(ICommandService);++ return commandService.executeCommand(RemoveNoteMutation.id, {+ unitId: target.unitId,+ sheetId: target.subUnitId,+ row: actualRow,+ col: actualColumn,+ });+ },+};++export const SheetToggleNotePopupCommand: ICommand = {+ id: 'sheet.command.toggle-note-popup',+ type: CommandType.COMMAND,+ handler: (accessor, params) => {+ const univerInstanceService = accessor.get(IUniverInstanceService);+ const target = getSheetCommandTarget(univerInstanceService);+ if (!target) return false;+ const sheetsSelectionsService = accessor.get(SheetsSelectionsService);+ const selection = sheetsSelectionsService.getCurrentLastSelection();+ if (!selection?.primary) return false;+ const { actualColumn, actualRow } = selection.primary;+ const commandService = accessor.get(ICommandService);+ return commandService.executeCommand(ToggleNotePopupMutation.id, {+ unitId: target.unitId,+ sheetId: target.subUnitId,+ row: actualRow,+ col: actualColumn,+ });+ },+};++export const SheetUpdateNoteCommand: ICommand<IUpdateNoteMutationParams> = {+ id: 'sheet.command.update-note',+ type: CommandType.COMMAND,+ handler: (accessor, params) => {+ const commandService = accessor.get(ICommandService);+ return commandService.syncExecuteCommand(UpdateNoteMutation.id, params);+ },+};diff --git a/packages/sheets-note/src/commands/mutations/note.mutation.ts b/packages/sheets-note/src/commands/mutations/note.mutation.tsnew file mode 100644index 0000000000..3915b38605--- /dev/null+++ b/packages/sheets-note/src/commands/mutations/note.mutation.ts@@ -0,0 +1,101 @@+/**+ * 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, IMutation } from '@univerjs/core';+import type { ISheetNote } from '../../models/sheets-note.model';+import { CommandType } from '@univerjs/core';+import { SheetsNoteModel } from '../../models/sheets-note.model';++export interface IUpdateNoteMutationParams {+ unitId: string;+ sheetId: string;+ row: number;+ col: number;+ note: ISheetNote;+ silent?: boolean;+}++export const UpdateNoteMutation: IMutation<IUpdateNoteMutationParams> = {+ id: 'sheet.mutation.update-note',+ type: CommandType.MUTATION,+ handler: (accessor: IAccessor, params: IUpdateNoteMutationParams) => {+ const { unitId, sheetId, row, col, note, silent } = params;+ const sheetsNoteModel = accessor.get(SheetsNoteModel);+ sheetsNoteModel.updateNote(unitId, sheetId, row, col, note, silent);+ return true;+ },+};++export interface IRemoveNoteMutationParams {+ unitId: string;+ sheetId: string;+ row: number;+ col: number;+ silent?: boolean;+}++export const RemoveNoteMutation: IMutation<IRemoveNoteMutationParams> = {+ id: 'sheet.mutation.remove-note',+ type: CommandType.MUTATION,+ handler: (accessor: IAccessor, params: IRemoveNoteMutationParams) => {+ const { unitId, sheetId, row, col, silent } = params;+ const sheetsNoteModel = accessor.get(SheetsNoteModel);+ sheetsNoteModel.removeNote(unitId, sheetId, row, col, silent);+ return true;+ },+};++export interface IToggleNotePopupMutationParams {+ unitId: string;+ sheetId: string;+ row: number;+ col: number;+ silent?: boolean;+}++export const ToggleNotePopupMutation: IMutation<IToggleNotePopupMutationParams> = {+ id: 'sheet.mutation.toggle-note-popup',+ type: CommandType.MUTATION,+ handler: (accessor: IAccessor, params: IToggleNotePopupMutationParams) => {+ const { unitId, sheetId, row, col, silent } = params;+ const sheetsNoteModel = accessor.get(SheetsNoteModel);+ sheetsNoteModel.toggleNotePopup(unitId, sheetId, row, col, silent);+ return true;+ },+};++export interface IUpdateNotePositionMutationParams {+ unitId: string;+ sheetId: string;+ row: number;+ col: number;+ newPosition: {+ row: number;+ col: number;+ };+ silent?: boolean;+}++export const UpdateNotePositionMutation: IMutation<IUpdateNotePositionMutationParams> = {+ id: 'sheet.mutation.update-note-position',+ type: CommandType.MUTATION,+ handler: (accessor: IAccessor, params: IUpdateNotePositionMutationParams) => {+ const { unitId, sheetId, row, col, newPosition, silent } = params;+ const sheetsNoteModel = accessor.get(SheetsNoteModel);+ sheetsNoteModel.updateNotePosition(unitId, sheetId, row, col, newPosition.row, newPosition.col, silent);+ return true;+ },+};diff --git a/packages/sheets-note/src/controllers/sheets-note-ref-range.controller.ts b/packages/sheets-note/src/controllers/sheets-note-ref-range.controller.tsnew file mode 100644index 0000000000..aecaba4f34--- /dev/null+++ b/packages/sheets-note/src/controllers/sheets-note-ref-range.controller.ts@@ -0,0 +1,205 @@+/**+ * 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, IRange, Nullable } from '@univerjs/core';+import type { EffectRefRangeParams } from '@univerjs/sheets';+import type { ISheetNote } from '../models/sheets-note.model';+import { Disposable, ICommandService, Inject, sequenceExecuteAsync } from '@univerjs/core';+import { handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, RefRangeService, SheetsSelectionsService } from '@univerjs/sheets';+import { RemoveNoteMutation, UpdateNoteMutation, UpdateNotePositionMutation } from '../commands/mutations/note.mutation';+import { SheetsNoteModel } from '../models/sheets-note.model';++export class SheetsNoteRefRangeController extends Disposable {+ private _disposableMap = new Map<string, IDisposable>();+ private _watcherMap = new Map<string, IDisposable>();++ constructor(+ @Inject(RefRangeService) private readonly _refRangeService: RefRangeService,+ @Inject(SheetsNoteModel) private readonly _sheetsNoteModel: SheetsNoteModel,+ @Inject(SheetsSelectionsService) private readonly _selectionManagerService: SheetsSelectionsService,+ @ICommandService private readonly _commandService: ICommandService+ ) {+ super();+ this._initData();+ this._initRefRange();+ }++ private _getIdWithUnitId(unitId: string, subUnitId: string, row: number, col: number) {+ return `${unitId}-${subUnitId}-${row}-${col}`;+ }++ private _handleRangeChange = (unitId: string, subUnitId: string, note: ISheetNote, row: number, col: number, resultRange: Nullable<IRange>, silent?: boolean) => {+ if (!resultRange) {+ return {+ redos: [{+ id: RemoveNoteMutation.id,+ params: {+ unitId,+ sheetId: subUnitId,+ row,+ col,+ },+ }],+ undos: [{+ id: UpdateNoteMutation.id,+ params: {+ unitId,+ sheetId: subUnitId,+ row,+ col,+ note,+ },+ }],+ };+ }++ return {+ redos: [{+ id: UpdateNotePositionMutation.id,+ params: {+ unitId,+ sheetId: subUnitId,+ row,+ col,+ newPosition: {+ row: resultRange.startRow,+ col: resultRange.startColumn,+ },+ silent,+ },+ }],+ undos: [{+ id: UpdateNotePositionMutation.id,+ params: {+ unitId,+ sheetId: subUnitId,+ row: resultRange.startRow,+ col: resultRange.startColumn,+ newPosition: {+ row,+ col,+ },+ note,+ silent,+ },+ }],+ };+ };++ private _register(unitId: string, subUnitId: string, note: ISheetNote, row: number, col: number) {+ const oldRange: IRange = {+ startColumn: col,+ endColumn: col,+ startRow: row,+ endRow: row,+ };++ this._disposableMap.set(+ this._getIdWithUnitId(unitId, subUnitId, row, col),+ this._refRangeService.registerRefRange(oldRange, (commandInfo: EffectRefRangeParams) => {+ const resultRanges = handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests(oldRange, commandInfo, { selectionManagerService: this._selectionManagerService });+ const resultRange = Array.isArray(resultRanges) ? resultRanges[0] : resultRanges;+ if (resultRange && resultRange.startColumn === oldRange.startColumn && resultRange.startRow === oldRange.startRow) {+ return {+ undos: [],+ redos: [],+ };+ }+ const res = this._handleRangeChange(unitId, subUnitId, note, row, col, resultRange, false);+ return res;+ }, unitId, subUnitId)+ );+ }++ private _watch(unitId: string, subUnitId: string, note: ISheetNote, row: number, col: number) {+ const oldRange: IRange = {+ startColumn: col,+ endColumn: col,+ startRow: row,+ endRow: row,+ };++ this._watcherMap.set(+ this._getIdWithUnitId(unitId, subUnitId, row, col),+ this._refRangeService.watchRange(unitId, subUnitId, oldRange, (before, after) => {+ const { redos } = this._handleRangeChange(unitId, subUnitId, note, before.startRow, before.startColumn, after, true);+ sequenceExecuteAsync(redos, this._commandService, { onlyLocal: true });+ }, true)+ );+ }++ private _unwatch(unitId: string, subUnitId: string, row: number, col: number) {+ const id = this._getIdWithUnitId(unitId, subUnitId, row, col);+ this._watcherMap.get(id)?.dispose();+ this._watcherMap.delete(id);+ }++ private _unregister(unitId: string, subUnitId: string, row: number, col: number) {+ const id = this._getIdWithUnitId(unitId, subUnitId, row, col);+ this._disposableMap.get(id)?.dispose();+ this._disposableMap.delete(id);+ }++ private _initData() {+ const unitNotes = this._sheetsNoteModel.getNotes();+ for (const [unitId, unitNote] of unitNotes) {+ for (const [sheetId, matrix] of unitNote) {+ matrix.forValue((row: number, col: number, value: ISheetNote) => {+ if (value) {+ this._register(unitId, sheetId, value, row, col);+ this._watch(unitId, sheetId, value, row, col);+ }+ return true;+ });+ }+ }+ }++ private _initRefRange() {+ this.disposeWithMe(+ this._sheetsNoteModel.change$.subscribe((option) => {+ switch (option.type) {+ case 'update': {+ const { unitId, sheetId, row, col, note } = option;+ const id = this._getIdWithUnitId(unitId, sheetId, row, col);+ if (note) {+ if (!this._disposableMap.has(id)) {+ this._register(unitId, sheetId, note, row, col);+ this._watch(unitId, sheetId, note, row, col);+ }+ } else {+ this._unregister(unitId, sheetId, row, col);+ this._unwatch(unitId, sheetId, row, col);+ }+ break;+ }+ case 'ref': {+ const { unitId, sheetId, row, col, newPosition, note, silent } = option;+ this._unregister(unitId, sheetId, row, col);++ if (!silent) {+ this._unwatch(unitId, sheetId, row, col);+ this._watch(unitId, sheetId, note, newPosition.row, newPosition.col);+ }++ this._register(unitId, sheetId, note, newPosition.row, newPosition.col);+ break;+ }+ }+ })+ );+ }+}diff --git a/packages/sheets-note/src/controllers/sheets-note-resource.controller.ts b/packages/sheets-note/src/controllers/sheets-note-resource.controller.tsnew file mode 100644index 0000000000..9fffd8d782--- /dev/null+++ b/packages/sheets-note/src/controllers/sheets-note-resource.controller.ts@@ -0,0 +1,104 @@+/**+ * 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 { ISheetNote } from '../models/sheets-note.model';+import { Disposable, Inject, IResourceManagerService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';+import { SheetsNoteModel } from '../models/sheets-note.model';+import { PLUGIN_NAME } from '../plugin';++interface INoteData {+ [sheetId: string]: {+ [row: number]: {+ [col: number]: ISheetNote;+ };+ };+}++export class SheetsNoteResourceController extends Disposable {+ constructor(+ @IResourceManagerService private readonly _resourceManagerService: IResourceManagerService,+ @IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService,+ @Inject(SheetsNoteModel) private readonly _sheetsNoteModel: SheetsNoteModel+ ) {+ super();+ this._initSnapshot();+ }++ private _initSnapshot() {+ const toJson = (unitId: string) => {+ const unitMap = this._sheetsNoteModel.getUnitNotes(unitId);+ if (!unitMap) {+ return '';+ }++ const result: INoteData = {};+ unitMap.forEach((matrix, sheetId) => {+ const sheetNotes: INoteData[string] = {};+ matrix.forValue((row, col, note) => {+ if (!sheetNotes[row]) {+ sheetNotes[row] = {};+ }+ sheetNotes[row][col] = note;+ });+ if (Object.keys(sheetNotes).length > 0) {+ result[sheetId] = sheetNotes;+ }+ });++ return JSON.stringify(result);+ };++ const parseJson = (json: string): INoteData => {+ if (!json) {+ return {};+ }+ try {+ return JSON.parse(json);+ } catch (err) {+ return {};+ }+ };++ this.disposeWithMe(+ this._resourceManagerService.registerPluginResource<INoteData>({+ pluginName: PLUGIN_NAME,+ businesses: [UniverInstanceType.UNIVER_SHEET],+ toJson: (unitId) => toJson(unitId),+ parseJson: (json) => parseJson(json),+ onUnLoad: (unitId) => {+ // Clear all notes for this unit+ this._sheetsNoteModel.deleteUnitNotes(unitId);+ },+ onLoad: (unitId, value) => {+ // Load notes from the parsed data+ Object.entries(value).forEach(([sheetId, sheetNotes]) => {+ Object.entries(sheetNotes).forEach(([row, colNotes]) => {+ Object.entries(colNotes).forEach(([col, note]) => {+ this._sheetsNoteModel.updateNote(+ unitId,+ sheetId,+ Number(row),+ Number(col),+ note+ );+ });+ });+ });+ },+ })+ );+ }+}diff --git a/packages/sheets-note/src/controllers/sheets.note.controller.ts b/packages/sheets-note/src/controllers/sheets.note.controller.tsnew file mode 100644index 0000000000..dffd4bf99f--- /dev/null+++ b/packages/sheets-note/src/controllers/sheets.note.controller.ts@@ -0,0 +1,45 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import { Disposable, ICommandService } from '@univerjs/core';+import { SheetDeleteNoteCommand, SheetToggleNotePopupCommand, SheetUpdateNoteCommand } from '../commands/commands/note.command';+import { RemoveNoteMutation, ToggleNotePopupMutation, UpdateNoteMutation, UpdateNotePositionMutation } from '../commands/mutations/note.mutation';++export class SheetsNoteController extends Disposable {+ constructor(+ @ICommandService private readonly _commandService: ICommandService+ ) {+ super();++ this._initialize();+ }++ private _initialize(): void {+ [+ UpdateNotePositionMutation,+ ToggleNotePopupMutation,+ UpdateNoteMutation,+ RemoveNoteMutation,+ SheetDeleteNoteCommand,+ SheetToggleNotePopupCommand,+ SheetUpdateNoteCommand,+ ].forEach((command) => {+ this.disposeWithMe(+ this._commandService.registerCommand(command)+ );+ });+ }+}diff --git a/packages/sheets-note/src/facade/f-event.ts b/packages/sheets-note/src/facade/f-event.tsnew file mode 100644index 0000000000..fc19b8a627--- /dev/null+++ b/packages/sheets-note/src/facade/f-event.ts@@ -0,0 +1,279 @@+/**+ * 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 { ISheetNote } from '@univerjs/sheets-note';+import type { FWorkbook, FWorksheet } from '@univerjs/sheets/facade';+import { FEventName } from '@univerjs/core/facade';++export interface ISheetNoteAddEventParmas {+ workbook: FWorkbook;+ worksheet: FWorksheet;+ row: number;+ col: number;+ note: ISheetNote;+ cancel?: boolean;+}++export interface ISheetNoteDeleteEventParmas {+ workbook: FWorkbook;+ worksheet: FWorksheet;+ row: number;+ col: number;+ oldNote: ISheetNote;+ cancel?: boolean;+}++export interface ISheetNoteUpdateEventParmas {+ workbook: FWorkbook;+ worksheet: FWorksheet;+ row: number;+ col: number;+ note: ISheetNote;+ oldNote: ISheetNote;+ cancel?: boolean;+}++export interface ISheetNoteShowEventParmas {+ workbook: FWorkbook;+ worksheet: FWorksheet;+ row: number;+ col: number;+ cancel?: boolean;+}++export interface ISheetNoteHideEventParmas {+ workbook: FWorkbook;+ worksheet: FWorksheet;+ row: number;+ col: number;+ cancel?: boolean;+}++/**+ * @ignore+ */+export interface ISheetsNoteEventParamConfig {+ SheetNoteAdd: ISheetNoteAddEventParmas;+ SheetNoteDelete: ISheetNoteDeleteEventParmas;+ SheetNoteUpdate: ISheetNoteUpdateEventParmas;+ SheetNoteShow: ISheetNoteShowEventParmas;+ SheetNoteHide: ISheetNoteHideEventParmas;++ BeforeSheetNoteAdd: ISheetNoteAddEventParmas;+ BeforeSheetNoteDelete: ISheetNoteDeleteEventParmas;+ BeforeSheetNoteUpdate: ISheetNoteUpdateEventParmas;+ BeforeSheetNoteShow: ISheetNoteShowEventParmas;+ BeforeSheetNoteHide: ISheetNoteHideEventParmas;+}++/**+ * @ignore+ */+interface ISheetNoteEvent {+ /**+ * Event fired when a note is added+ * @see {@link ISheetNoteAddEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.SheetNoteAdd, (params) => {+ * const { workbook, worksheet, row, col, note } = params;+ * console.log(params);+ * });+ * ```+ */+ SheetNoteAdd: 'SheetNoteAdd';+ /**+ * Event fired when a note is deleted+ * @see {@link ISheetNoteDeleteEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.SheetNoteDelete, (params) => {+ * const { workbook, worksheet, row, col, oldNote } = params;+ * console.log(params);+ * });+ * ```+ */+ SheetNoteDelete: 'SheetNoteDelete';+ /**+ * Event fired when a note is updated+ * @see {@link ISheetNoteUpdateEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.SheetNoteUpdate, (params) => {+ * const { workbook, worksheet, row, col, note, oldNote } = params;+ * console.log(params);+ * });+ * ```+ */+ SheetNoteUpdate: 'SheetNoteUpdate';+ /**+ * Event fired when a note is shown+ * @see {@link ISheetNoteShowEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.SheetNoteShow, (params) => {+ * const { workbook, worksheet, row, col } = params;+ * console.log(params);+ * });+ * ```+ */+ SheetNoteShow: 'SheetNoteShow';+ /**+ * Event fired when a note is hidden+ * @see {@link ISheetNoteHideEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.SheetNoteHide, (params) => {+ * const { workbook, worksheet, row, col } = params;+ * console.log(params);+ * });+ * ```+ */+ SheetNoteHide: 'SheetNoteHide';++ /**+ * Event fired before a note is added+ * @see {@link ISheetNoteAddEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetNoteAdd, (params) => {+ * const { workbook, worksheet, row, col, note } = params;+ * console.log(params);+ * });+ * ```+ */+ BeforeSheetNoteAdd: 'BeforeSheetNoteAdd';+ /**+ * Event fired before a note is deleted+ * @see {@link ISheetNoteDeleteEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetNoteDelete, (params) => {+ * const { workbook, worksheet, row, col, oldNote } = params;+ * console.log(params);+ * });+ * ```+ */+ BeforeSheetNoteDelete: 'BeforeSheetNoteDelete';+ /**+ * Event fired before a note is updated+ * @see {@link ISheetNoteUpdateEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetNoteUpdate, (params) => {+ * const { workbook, worksheet, row, col, note, oldNote } = params;+ * console.log(params);+ * });+ * ```+ */+ BeforeSheetNoteUpdate: 'BeforeSheetNoteUpdate';+ /**+ * Event fired before a note is shown+ * @see {@link ISheetNoteShowEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetNoteShow, (params) => {+ * const { workbook, worksheet, row, col } = params;+ * console.log(params);+ * });+ * ```+ */+ BeforeSheetNoteShow: 'BeforeSheetNoteShow';+ /**+ * Event fired before a note is hidden+ * @see {@link ISheetNoteHideEventParmas}+ * @example+ * ```ts+ * const disposable = univerAPI.addEvent(univerAPI.Event.BeforeSheetNoteHide, (params) => {+ * const { workbook, worksheet, row, col } = params;+ * console.log(params);+ * });+ * ```+ */+ BeforeSheetNoteHide: 'BeforeSheetNoteHide';+}++/**+ * @ignore+ */+export class FSheetNoteEvent implements ISheetNoteEvent {+ get SheetNoteAdd(): 'SheetNoteAdd' {+ return 'SheetNoteAdd';+ }++ get SheetNoteDelete(): 'SheetNoteDelete' {+ return 'SheetNoteDelete';+ }++ get SheetNoteUpdate(): 'SheetNoteUpdate' {+ return 'SheetNoteUpdate';+ }++ get SheetNoteShow(): 'SheetNoteShow' {+ return 'SheetNoteShow';+ }++ get SheetNoteHide(): 'SheetNoteHide' {+ return 'SheetNoteHide';+ }++ get BeforeSheetNoteAdd(): 'BeforeSheetNoteAdd' {+ return 'BeforeSheetNoteAdd';+ }++ get BeforeSheetNoteDelete(): 'BeforeSheetNoteDelete' {+ return 'BeforeSheetNoteDelete';+ }++ get BeforeSheetNoteUpdate(): 'BeforeSheetNoteUpdate' {+ return 'BeforeSheetNoteUpdate';+ }++ get BeforeSheetNoteShow(): 'BeforeSheetNoteShow' {+ return 'BeforeSheetNoteShow';+ }++ get BeforeSheetNoteHide(): 'BeforeSheetNoteHide' {+ return 'BeforeSheetNoteHide';+ }+}++/**+ * @ignore+ */+export interface ISheetNoteEventConfig {+ SheetNoteAdd: ISheetNoteAddEventParmas;+ SheetNoteDelete: ISheetNoteDeleteEventParmas;+ SheetNoteUpdate: ISheetNoteUpdateEventParmas;+ SheetNoteShow: ISheetNoteShowEventParmas;+ SheetNoteHide: ISheetNoteHideEventParmas;++ BeforeSheetNoteAdd: ISheetNoteAddEventParmas;+ BeforeSheetNoteDelete: ISheetNoteDeleteEventParmas;+ BeforeSheetNoteUpdate: ISheetNoteUpdateEventParmas;+ BeforeSheetNoteShow: ISheetNoteShowEventParmas;+ BeforeSheetNoteHide: ISheetNoteHideEventParmas;+}++FEventName.extend(FSheetNoteEvent);+declare module '@univerjs/core/facade' {+ // eslint-disable-next-line ts/naming-convention+ interface FEventName extends ISheetNoteEvent {+ }++ interface IEventParamConfig extends ISheetNoteEventConfig {+ }+}diff --git a/packages/sheets-note/src/facade/f-range.ts b/packages/sheets-note/src/facade/f-range.tsnew file mode 100644index 0000000000..716f85e1a3--- /dev/null+++ b/packages/sheets-note/src/facade/f-range.ts@@ -0,0 +1,103 @@+/**+ * 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 { ISheetNote } from '@univerjs/sheets-note';+import { RemoveNoteMutation, SheetsNoteModel, UpdateNoteMutation } from '@univerjs/sheets-note';+import { FRange } from '@univerjs/sheets/facade';++export interface IFSheetsNoteRange {+ /**+ * get the note of the primary cell+ * @returns {Nullable<ISheetNote>} the note of the primary cell+ * @example+ * ```ts+ * const fWorkbook = univerAPI.getWorkbook();+ * const fWorksheet = fWorkbook.getWorksheet();+ * const fRange = fWorksheet.getRange(0, 0, 1, 1);+ * const note = fRange.getNote();+ * ```+ */+ getNote(): Nullable<ISheetNote>;+ /**+ * create a new note and attach to the primary cell+ * @param {ISheetNote} note the note to create+ * @returns {FRange} the range+ * @example+ * ```ts+ * const fWorkbook = univerAPI.getWorkbook();+ * const fWorksheet = fWorkbook.getWorksheet();+ * const fRange = fWorksheet.getRange(0, 0, 1, 1);+ * const note = fRange.createOrUpdateNote({});+ * ```+ */+ createOrUpdateNote(note: ISheetNote): FRange;+ /**+ * delete the note of the primary cell+ * @returns {FRange} the range+ * @example+ * ```ts+ * const fWorkbook = univerAPI.getWorkbook();+ * const fWorksheet = fWorkbook.getWorksheet();+ * const fRange = fWorksheet.getRange(0, 0, 1, 1);+ * fRange.deleteNote();+ * ```+ */+ deleteNote(): FRange;+}++export class FSheetsNoteRange extends FRange implements IFSheetsNoteRange {+ createOrUpdateNote(note: ISheetNote): FRange {+ this._commandService.syncExecuteCommand(+ UpdateNoteMutation.id,+ {+ unitId: this.getUnitId(),+ sheetId: this.getSheetId(),+ row: this.getRow(),+ col: this.getColumn(),+ note,+ }+ );++ return this;+ }++ deleteNote(): FRange {+ const model = this._injector.get(SheetsNoteModel);+ this._commandService.syncExecuteCommand(+ RemoveNoteMutation.id,+ {+ unitId: this.getUnitId(),+ sheetId: this.getSheetId(),+ row: this.getRow(),+ col: this.getColumn(),+ }+ );++ return this;+ }++ getNote(): Nullable<ISheetNote> {+ const model = this._injector.get(SheetsNoteModel);+ return model.getNote(this.getUnitId(), this.getSheetId(), this.getRow(), this.getColumn());+ }+}++declare module '@univerjs/sheets/facade' {+ interface IRange extends FSheetsNoteRange { }+}++FRange.extend(FSheetsNoteRange);diff --git a/packages/sheets-note/src/facade/f-univer.ts b/packages/sheets-note/src/facade/f-univer.tsnew file mode 100644index 0000000000..8b11e4f7cd--- /dev/null+++ b/packages/sheets-note/src/facade/f-univer.ts@@ -0,0 +1,311 @@+/**+ * 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 { Injector } from '@univerjs/core';+import type { IRemoveNoteMutationParams, IUpdateNoteMutationParams } from '@univerjs/sheets-note';+import { CanceledError, ICommandService } from '@univerjs/core';+import { FUniver } from '@univerjs/core/facade';+import { SheetDeleteNoteCommand, SheetsNoteModel, SheetToggleNotePopupCommand, SheetUpdateNoteCommand } from '@univerjs/sheets-note';++/**+ * @ignore+ */+export interface IFUniverSheetNoteMixin {+ // Add any note-specific methods here if needed+}++export class FUniverSheetNoteMixin extends FUniver implements IFUniverSheetNoteMixin {+ override _initialize(injector: Injector): void {+ this.registerEventHandler(+ this.Event.SheetNoteAdd,+ () => {+ const model = injector.get(SheetsNoteModel);+ return model.change$.subscribe((change) => {+ if (change.type === 'update' && !change.oldNote && change.note) {+ const { unitId, sheetId, row, col, note, oldNote } = change;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;++ this.fireEvent(this.Event.SheetNoteAdd, {+ workbook,+ worksheet,+ row,+ col,+ note,+ });+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.SheetNoteDelete,+ () => {+ const model = injector.get(SheetsNoteModel);+ return model.change$.subscribe((change) => {+ if (change.type === 'update' && change.oldNote && !change.note) {+ const { unitId, sheetId, row, col, note, oldNote } = change;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;++ this.fireEvent(this.Event.SheetNoteDelete, {+ workbook,+ worksheet,+ row,+ col,+ oldNote,+ });+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.SheetNoteUpdate,+ () => {+ const model = injector.get(SheetsNoteModel);+ return model.change$.subscribe((change) => {+ if (change.type === 'update' && change.oldNote && change.note) {+ const { unitId, sheetId, row, col, note, oldNote } = change;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;++ this.fireEvent(this.Event.SheetNoteUpdate, {+ workbook,+ worksheet,+ row,+ col,+ note,+ oldNote,+ });+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.SheetNoteShow,+ () => {+ const model = injector.get(SheetsNoteModel);+ return model.change$.subscribe((change) => {+ if (change.type === 'update' && change.oldNote && change.note && !change.oldNote.show && change.note.show) {+ const { unitId, sheetId, row, col } = change;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;++ this.fireEvent(this.Event.SheetNoteShow, {+ workbook,+ worksheet,+ row,+ col,+ });+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.SheetNoteHide,+ () => {+ const model = injector.get(SheetsNoteModel);+ return model.change$.subscribe((change) => {+ if (change.type === 'update' && change.oldNote && change.note && change.oldNote.show && !change.note.show) {+ const { unitId, sheetId, row, col } = change;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;++ this.fireEvent(this.Event.SheetNoteHide, {+ workbook,+ worksheet,+ row,+ col,+ });+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.BeforeSheetNoteAdd,+ () => {+ const commandService = injector.get(ICommandService);+ return commandService.beforeCommandExecuted((command) => {+ if (command.id === SheetUpdateNoteCommand.id) {+ const model = injector.get(SheetsNoteModel);+ const { unitId, sheetId, row, col, note } = command.params as IUpdateNoteMutationParams;+ const oldNote = model.getNote(unitId, sheetId, row, col);+ if (oldNote) return;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;+ const cancel = this.fireEvent(this.Event.BeforeSheetNoteAdd, {+ workbook,+ worksheet,+ row,+ col,+ note,+ });+ if (cancel) {+ throw new CanceledError();+ }+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.BeforeSheetNoteDelete,+ () => {+ const commandService = injector.get(ICommandService);+ return commandService.beforeCommandExecuted((command) => {+ if (command.id === SheetDeleteNoteCommand.id) {+ const model = injector.get(SheetsNoteModel);+ const { unitId, sheetId, row, col } = command.params as IRemoveNoteMutationParams;+ const oldNote = model.getNote(unitId, sheetId, row, col);+ if (!oldNote) return;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;+ const cancel = this.fireEvent(this.Event.BeforeSheetNoteDelete, {+ workbook,+ worksheet,+ row,+ col,+ oldNote,+ });+ if (cancel) {+ throw new CanceledError();+ }+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.BeforeSheetNoteUpdate,+ () => {+ const commandService = injector.get(ICommandService);+ return commandService.beforeCommandExecuted((command) => {+ if (command.id === SheetUpdateNoteCommand.id) {+ const model = injector.get(SheetsNoteModel);+ const { unitId, sheetId, row, col, note } = command.params as IUpdateNoteMutationParams;+ const oldNote = model.getNote(unitId, sheetId, row, col);+ if (!oldNote) return;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;+ const cancel = this.fireEvent(this.Event.BeforeSheetNoteUpdate, {+ workbook,+ worksheet,+ row,+ col,+ note,+ oldNote,+ });+ if (cancel) {+ throw new CanceledError();+ }+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.BeforeSheetNoteShow,+ () => {+ const commandService = injector.get(ICommandService);+ return commandService.beforeCommandExecuted((command) => {+ if (command.id === SheetToggleNotePopupCommand.id) {+ const model = injector.get(SheetsNoteModel);+ const { unitId, sheetId, row, col } = command.params as IUpdateNoteMutationParams;+ const oldNote = model.getNote(unitId, sheetId, row, col);+ if (oldNote?.show) return;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;+ const cancel = this.fireEvent(this.Event.BeforeSheetNoteShow, {+ workbook,+ worksheet,+ row,+ col,+ });+ if (cancel) {+ throw new CanceledError();+ }+ }+ });+ }+ );++ this.registerEventHandler(+ this.Event.BeforeSheetNoteHide,+ () => {+ const commandService = injector.get(ICommandService);+ return commandService.beforeCommandExecuted((command) => {+ if (command.id === SheetToggleNotePopupCommand.id) {+ const model = injector.get(SheetsNoteModel);+ const { unitId, sheetId, row, col } = command.params as IUpdateNoteMutationParams;+ const oldNote = model.getNote(unitId, sheetId, row, col);+ if (!oldNote?.show) return;+ const target = this.getSheetTarget(unitId, sheetId);+ if (!target) {+ return;+ }+ const { workbook, worksheet } = target;+ const cancel = this.fireEvent(this.Event.BeforeSheetNoteHide, {+ workbook,+ worksheet,+ row,+ col,+ });+ if (cancel) {+ throw new CanceledError();+ }+ }+ });+ }+ );+ }+}++FUniver.extend(FUniverSheetNoteMixin);+declare module '@univerjs/core/facade' {+ // eslint-disable-next-line ts/naming-convention+ interface FUniver extends IFUniverSheetNoteMixin {}+}diff --git a/packages/sheets-note/src/facade/f-worksheet.ts b/packages/sheets-note/src/facade/f-worksheet.tsnew file mode 100644index 0000000000..ceaefc6b81--- /dev/null+++ b/packages/sheets-note/src/facade/f-worksheet.ts@@ -0,0 +1,55 @@+/**+ * 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 { ISheetNote } from '@univerjs/sheets-note';+import { SheetsNoteModel } from '@univerjs/sheets-note';+import { FWorksheet } from '@univerjs/sheets/facade';++export interface ISheetNoteInfo extends ISheetNote {+ row: number;+ col: number;+}++export interface IFSheetsNoteWorksheet {+ /**+ * get the note of the primary cell+ */+ getNotes(): ISheetNoteInfo[];+}++export class FSheetsNoteWorksheet extends FWorksheet implements IFSheetsNoteWorksheet {+ getNotes(): ISheetNoteInfo[] {+ const model = this._injector.get(SheetsNoteModel);+ const notes = model.getSheetNotes(this.getWorkbook().getUnitId(), this.getSheetId());+ const arr: ISheetNoteInfo[] = [];++ notes?.forValue((row, col, note) => {+ arr.push({+ ...note,+ row,+ col,+ });+ });++ return arr;+ }+}++declare module '@univerjs/sheets/facade' {+ interface IWorksheet extends FSheetsNoteWorksheet { }+}++FWorksheet.extend(FSheetsNoteWorksheet);diff --git a/packages/sheets-note/src/facade/index.ts b/packages/sheets-note/src/facade/index.tsnew file mode 100644index 0000000000..b8b7fd8e03--- /dev/null+++ b/packages/sheets-note/src/facade/index.ts@@ -0,0 +1,25 @@+/**+ * 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 './f-event';+import './f-range';+import './f-univer';+import './f-worksheet';++export * from './f-event';+export * from './f-range';+export * from './f-univer';+export * from './f-worksheet';diff --git a/packages/sheets-note/src/index.ts b/packages/sheets-note/src/index.tsnew file mode 100644index 0000000000..41ed83c85c--- /dev/null+++ b/packages/sheets-note/src/index.ts@@ -0,0 +1,21 @@+/**+ * 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 * from './plugin';+export * from './models/sheets-note.model';+export * from './controllers/sheets-note-resource.controller';+export * from './commands/mutations/note.mutation';+export * from './commands/commands/note.command';diff --git a/packages/sheets-note/src/models/sheets-note.model.ts b/packages/sheets-note/src/models/sheets-note.model.tsnew file mode 100644index 0000000000..ff054e567a--- /dev/null+++ b/packages/sheets-note/src/models/sheets-note.model.ts@@ -0,0 +1,171 @@+/**+ * 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 { ISheetLocationBase } from '@univerjs/sheets';+import { Disposable, ObjectMatrix } from '@univerjs/core';+import { filter, map, Subject } from 'rxjs';++export interface ISheetNote {+ width: number;+ height: number;+ note: string;+ show?: boolean;+}++export type ISheetNoteChange = {+ unitId: string;+ sheetId: string;+ row: number;+ col: number;+ silent?: boolean;+} & ({+ type: 'update';+ note: Nullable<ISheetNote>;+ oldNote: Nullable<ISheetNote>;+} | {+ type: 'ref';+ newPosition: {+ row: number;+ col: number;+ };+ note: ISheetNote;+});++export class SheetsNoteModel extends Disposable {+ private _noteMatrix = new Map<string, Map<string, ObjectMatrix<ISheetNote>>>();+ private readonly _change$ = new Subject<ISheetNoteChange>();+ readonly change$ = this._change$.asObservable();++ private _ensureNoteMatrix(unitId: string, sheetId: string): ObjectMatrix<ISheetNote> {+ let unitMap = this._noteMatrix.get(unitId);+ if (!unitMap) {+ unitMap = new Map();+ this._noteMatrix.set(unitId, unitMap);+ }++ let matrix = unitMap.get(sheetId);+ if (!matrix) {+ matrix = new ObjectMatrix<ISheetNote>();+ unitMap.set(sheetId, matrix);+ }++ return matrix;+ }++ getSheetShowNotes$(unitId: string, sheetId: string) {+ return this._change$.pipe(+ filter(({ unitId: u, sheetId: s }) => u === unitId && s === sheetId),+ map(() => {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ const notes: { loc: ISheetLocationBase; note: ISheetNote }[] = [];++ matrix.forValue((row, col, note) => {+ if (note.show) {+ notes.push({ loc: { row, col, unitId, subUnitId: sheetId }, note });+ }+ });++ return notes;+ })+ );+ }++ getCellNoteChange$(unitId: string, sheetId: string, row: number, col: number) {+ return this._change$.pipe(+ filter(({ unitId: u, sheetId: s, row: r, col: c }) => u === unitId && s === sheetId && r === row && c === col),+ map(({ note }) => note)+ );+ }++ updateNote(unitId: string, sheetId: string, row: number, col: number, note: ISheetNote, silent?: boolean): void {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ const oldNote = matrix.getValue(row, col);+ matrix.setValue(row, col, note);+ this._change$.next({ unitId, sheetId, row, col, type: 'update', note, oldNote, silent });+ }++ removeNote(unitId: string, sheetId: string, row: number, col: number, silent?: boolean): void {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ const oldNote = matrix.getValue(row, col);+ matrix.realDeleteValue(row, col);+ this._change$.next({ unitId, sheetId, row, col, type: 'update', note: null, oldNote, silent });+ }++ toggleNotePopup(unitId: string, sheetId: string, row: number, col: number, silent?: boolean): void {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ const note = matrix.getValue(row, col);+ if (note) {+ note.show = !note.show;+ const newNote = { ...note, show: note.show };+ matrix.setValue(row, col, newNote);+ this._change$.next({+ unitId,+ sheetId,+ row,+ col,+ type: 'update',+ note: newNote,+ oldNote: note,+ silent,+ });+ }+ }++ updateNotePosition(unitId: string, sheetId: string, row: number, col: number, newRow: number, newCol: number, silent?: boolean): void {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ const note = matrix.getValue(row, col);+ if (note) {+ matrix.realDeleteValue(row, col);+ matrix.setValue(newRow, newCol, note);+ this._change$.next({+ unitId,+ sheetId,+ row,+ col,+ type: 'ref',+ newPosition: { row: newRow, col: newCol },+ note,+ silent,+ });+ }+ }++ getNote(unitId: string, sheetId: string, row: number, col: number): Nullable<ISheetNote> {+ const matrix = this._ensureNoteMatrix(unitId, sheetId);+ return matrix.getValue(row, col);+ }++ getUnitNotes(unitId: string): Map<string, ObjectMatrix<ISheetNote>> | undefined {+ return this._noteMatrix.get(unitId);+ }++ getSheetNotes(unitId: string, sheetId: string): ObjectMatrix<ISheetNote> | undefined {+ const unitMap = this._noteMatrix.get(unitId);+ if (!unitMap) {+ return undefined;+ }+ return unitMap.get(sheetId);+ }++ getNotes() {+ return this._noteMatrix;+ }++ deleteUnitNotes(unitId: string): void {+ this._noteMatrix.delete(unitId);+ }+}diff --git a/packages/sheets-note/src/plugin.ts b/packages/sheets-note/src/plugin.tsnew file mode 100644index 0000000000..18a9f3a41a--- /dev/null+++ b/packages/sheets-note/src/plugin.ts@@ -0,0 +1,61 @@+/**+ * 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, IConfigService, Inject, Injector, Plugin, touchDependencies, UniverInstanceType } from '@univerjs/core';+import { UniverSheetsPlugin } from '@univerjs/sheets';+import { SheetsNoteRefRangeController } from './controllers/sheets-note-ref-range.controller';+import { SheetsNoteResourceController } from './controllers/sheets-note-resource.controller';+import { SheetsNoteController } from './controllers/sheets.note.controller';+import { SheetsNoteModel } from './models/sheets-note.model';++export const PLUGIN_NAME = 'SHEET_NOTE_PLUGIN';++@DependentOn(UniverSheetsPlugin)+export class SheetsNotePlugin extends Plugin {+ static override pluginName = PLUGIN_NAME;+ static override type = UniverInstanceType.UNIVER_SHEET;++ constructor(+ @Inject(Injector) protected override readonly _injector: Injector,+ @IConfigService private readonly _configService: IConfigService+ ) {+ super();+ }++ override onStarting(): void {+ ([+ [SheetsNoteModel],+ [SheetsNoteController],+ [SheetsNoteResourceController],+ [SheetsNoteRefRangeController],+ ] as Dependency[]).forEach((dependency) => {+ this._injector.add(dependency);+ });++ touchDependencies(this._injector, [+ [SheetsNoteModel],+ [SheetsNoteController],+ [SheetsNoteResourceController],+ ]);+ }++ override onReady(): void {+ touchDependencies(this._injector, [+ [SheetsNoteRefRangeController],+ ]);+ }+}diff --git a/packages/sheets-note/tsconfig.json b/packages/sheets-note/tsconfig.jsonnew file mode 100644index 0000000000..c62210cbad--- /dev/null+++ b/packages/sheets-note/tsconfig.json@@ -0,0 +1,9 @@+{+ "extends": "@univerjs-infra/shared/tsconfigs/base",+ "compilerOptions": {+ "rootDir": "src",+ "outDir": "lib/types"+ },+ "references": [{ "path": "./tsconfig.node.json" }],+ "include": ["src"]+}diff --git a/packages/sheets-note/tsconfig.node.json b/packages/sheets-note/tsconfig.node.jsonnew file mode 100644index 0000000000..4947a09903--- /dev/null+++ b/packages/sheets-note/tsconfig.node.json@@ -0,0 +1,4 @@+{+ "extends": "@univerjs-infra/shared/tsconfigs/node",+ "include": ["vitest.config.ts"]+}diff --git a/packages/sheets-note/vitest.config.ts b/packages/sheets-note/vitest.config.tsnew file mode 100644index 0000000000..af97c6d7a2--- /dev/null+++ b/packages/sheets-note/vitest.config.ts@@ -0,0 +1,3 @@+import createConfig from '@univerjs-infra/shared/vitest';++export default createConfig();diff --git a/packages/sheets-numfmt-ui/package.json b/packages/sheets-numfmt-ui/package.jsonindex d24c767f42..daed6f861b 100644--- a/packages/sheets-numfmt-ui/package.json+++ b/packages/sheets-numfmt-ui/package.json@@ -73,7 +73,7 @@"@univerjs/engine-formula": "workspace:*","@univerjs/engine-numfmt": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-numfmt": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-sort-ui/package.json b/packages/sheets-sort-ui/package.jsonindex 21e703ca54..8161c5adfa 100644--- a/packages/sheets-sort-ui/package.json+++ b/packages/sheets-sort-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-sort": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-table-ui/package.json b/packages/sheets-table-ui/package.jsonindex 64f55f0c8a..6ae60f568b 100644--- a/packages/sheets-table-ui/package.json+++ b/packages/sheets-table-ui/package.json@@ -75,7 +75,7 @@"@univerjs/design": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-formula-ui": "workspace:*","@univerjs/sheets-sort": "workspace:*",diff --git a/packages/sheets-thread-comment-ui/package.json b/packages/sheets-thread-comment-ui/package.jsonindex 0f6df84615..f20ced6351 100644--- a/packages/sheets-thread-comment-ui/package.json+++ b/packages/sheets-thread-comment-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/engine-formula": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-thread-comment": "workspace:*","@univerjs/sheets-ui": "workspace:*",diff --git a/packages/sheets-thread-comment-ui/src/services/sheets-thread-comment-popup.service.ts b/packages/sheets-thread-comment-ui/src/services/sheets-thread-comment-popup.service.tsindex bb13b41506..6568d6e5c9 100644--- a/packages/sheets-thread-comment-ui/src/services/sheets-thread-comment-popup.service.ts+++ b/packages/sheets-thread-comment-ui/src/services/sheets-thread-comment-popup.service.ts@@ -17,7 +17,7 @@import type { IDisposable, Nullable } from '@univerjs/core';import type { ISheetLocationBase } from '@univerjs/sheets';import { Disposable, DisposableCollection, Inject } from '@univerjs/core';-import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';+import { CellPopupManagerService, SheetCanvasPopManagerService } from '@univerjs/sheets-ui';import { IZenZoneService } from '@univerjs/ui';import { BehaviorSubject } from 'rxjs';import { SHEETS_THREAD_COMMENT_MODAL } from '../types/const';@@ -42,7 +42,8 @@ export class SheetsThreadCommentPopupService extends Disposable {constructor(@Inject(SheetCanvasPopManagerService) private readonly _canvasPopupManagerService: SheetCanvasPopManagerService,- @IZenZoneService private readonly _zenZoneService: IZenZoneService+ @IZenZoneService private readonly _zenZoneService: IZenZoneService,+ @Inject(CellPopupManagerService) private readonly _cellPopupManagerService: CellPopupManagerService) {super();this._initZenVisible();@@ -83,9 +84,13 @@ export class SheetsThreadCommentPopupService extends Disposable {this._activePopup = location;this._activePopup$.next(location);- const popupDisposable = this._canvasPopupManagerService.attachPopupToCell(- row,- col,+ const popupDisposable = this._cellPopupManagerService.showPopup(+ {+ row,+ col,+ unitId,+ subUnitId,+ },{componentKey: SHEETS_THREAD_COMMENT_MODAL,onClickOutside: () => {@@ -96,6 +101,7 @@ export class SheetsThreadCommentPopupService extends Disposable {...Array.from(document.querySelectorAll('.univer-thread-comment')),document.getElementById('thread-comment-add'),].filter(Boolean) as HTMLElement[],+ priority: 2,});diff --git a/packages/sheets-ui/package.json b/packages/sheets-ui/package.jsonindex 0a300b271a..4d0e66e507 100644--- a/packages/sheets-ui/package.json+++ b/packages/sheets-ui/package.json@@ -86,7 +86,7 @@"@univerjs/engine-formula": "workspace:*","@univerjs/engine-numfmt": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/protocol": "0.1.45","@univerjs/sheets": "workspace:*","@univerjs/telemetry": "workspace:*",diff --git a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts b/packages/sheets-ui/src/controllers/sheet-ui.controller.tsindex 6c308863a4..00c4b209dc 100644--- a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts+++ b/packages/sheets-ui/src/controllers/sheet-ui.controller.ts@@ -104,6 +104,8 @@ import {} from '../components/font-family';import { FONT_SIZE_COMPONENT, FontSize } from '../components/font-size';import { MENU_ITEM_INPUT_COMPONENT, MenuItemInput } from '../components/menu-item-input';+import { CellPopup } from '../views/cell-popup';+import { CELL_POPUP_COMPONENT_KEY } from '../views/cell-popup/config';import { DEFINED_NAME_CONTAINER } from '../views/defined-name/component-name';import { DefinedNameContainer } from '../views/defined-name/DefinedNameContainer';import { RenderSheetContent, RenderSheetFooter, RenderSheetHeader } from '../views/sheet-container/SheetContainer';@@ -198,6 +200,7 @@ export class SheetUIController extends Disposable {this.disposeWithMe(componentManager.register(FONT_FAMILY_ITEM_COMPONENT, FontFamilyItem));this.disposeWithMe(componentManager.register(FONT_SIZE_COMPONENT, FontSize));this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, DefinedNameContainer));+ this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));// init iconsthis.disposeWithMe(componentManager.register('HideGridlines', HideGridlines));diff --git a/packages/sheets-ui/src/index.ts b/packages/sheets-ui/src/index.tsindex 18ddbe6f84..ed8906e704 100644--- a/packages/sheets-ui/src/index.ts+++ b/packages/sheets-ui/src/index.ts@@ -99,6 +99,7 @@ export { useKeyEventConfig } from './views/editor-container';export { type IDropdownParam, ISheetCellDropdownManagerService, SheetCellDropdownManagerService } from './services/cell-dropdown-manager.service';export { FormulaBar } from './views/formula-bar/FormulaBar';export { type IPermissionDetailUserPartProps } from './views/permission/panel-detail/PermissionDetailUserPart';+export { CellPopupManagerService } from './services/cell-popup-manager.service';// #region - all commandsexport { SetWorksheetColAutoWidthCommand } from './commands/commands/set-worksheet-auto-col-width.command';export { AutoClearContentCommand, AutoFillCommand } from './commands/commands/auto-fill.command';diff --git a/packages/sheets-ui/src/mobile-plugin.ts b/packages/sheets-ui/src/mobile-plugin.tsindex 162d224104..c87ba1b9bd 100644--- a/packages/sheets-ui/src/mobile-plugin.ts+++ b/packages/sheets-ui/src/mobile-plugin.ts@@ -53,6 +53,7 @@ import { AutoFillService, IAutoFillService } from './services/auto-fill/auto-filimport { SheetCanvasPopManagerService } from './services/canvas-pop-manager.service';import { CellAlertManagerService } from './services/cell-alert-manager.service';import { ISheetCellDropdownManagerService, SheetCellDropdownManagerService } from './services/cell-dropdown-manager.service';+import { CellPopupManagerService } from './services/cell-popup-manager.service';import { ISheetClipboardService, SheetClipboardService } from './services/clipboard/clipboard.service';import { DragManagerService } from './services/drag-manager.service';import { EditorBridgeService, IEditorBridgeService } from './services/editor-bridge.service';@@ -105,6 +106,7 @@ export class UniverSheetsMobileUIPlugin extends Plugin {[HoverManagerService],[DragManagerService],[SheetCanvasPopManagerService],+ [CellPopupManagerService],[CellAlertManagerService],[SelectAllService],[ISheetCellDropdownManagerService, { useClass: SheetCellDropdownManagerService }],diff --git a/packages/sheets-ui/src/plugin.ts b/packages/sheets-ui/src/plugin.tsindex 2030540427..be79a39e67 100644--- a/packages/sheets-ui/src/plugin.ts+++ b/packages/sheets-ui/src/plugin.ts@@ -68,6 +68,7 @@ import { AutoFillService, IAutoFillService } from './services/auto-fill/auto-filimport { SheetCanvasPopManagerService } from './services/canvas-pop-manager.service';import { CellAlertManagerService } from './services/cell-alert-manager.service';import { ISheetCellDropdownManagerService, SheetCellDropdownManagerService } from './services/cell-dropdown-manager.service';+import { CellPopupManagerService } from './services/cell-popup-manager.service';import { ISheetClipboardService, SheetClipboardService } from './services/clipboard/clipboard.service';import { DragManagerService } from './services/drag-manager.service';import { EditorBridgeService, IEditorBridgeService } from './services/editor-bridge.service';@@ -156,6 +157,7 @@ export class UniverSheetsUIPlugin extends Plugin {[HoverManagerService],[DragManagerService],[SheetCanvasPopManagerService],+ [CellPopupManagerService],[CellAlertManagerService],[SelectAllService],[ISheetCellDropdownManagerService, { useClass: SheetCellDropdownManagerService }],diff --git a/packages/sheets-ui/src/services/canvas-pop-manager.service.ts b/packages/sheets-ui/src/services/canvas-pop-manager.service.tsindex 135c040d19..66bb6b3501 100644--- a/packages/sheets-ui/src/services/canvas-pop-manager.service.ts+++ b/packages/sheets-ui/src/services/canvas-pop-manager.service.ts@@ -18,11 +18,11 @@ import type { DrawingTypeEnum, ICommandInfo, INeedCheckDisposable, IRange, Nullaimport type { BaseObject, IBoundRectNoAngle, IRender, SpreadsheetSkeleton, Viewport } from '@univerjs/engine-render';import type { ISetWorksheetRowAutoHeightMutationParams, ISheetLocationBase } from '@univerjs/sheets';import type { IPopup } from '@univerjs/ui';-import { Disposable, DisposableCollection, ICommandService, Inject, IUniverInstanceService, toDisposable, UniverInstanceType } from '@univerjs/core';+import { Disposable, DisposableCollection, fromEventSubject, ICommandService, Inject, IUniverInstanceService, toDisposable, UniverInstanceType } from '@univerjs/core';import { IRenderManagerService } from '@univerjs/engine-render';import { COMMAND_LISTENER_SKELETON_CHANGE, IRefSelectionsService, RefRangeService, SetFrozenMutation, SetWorksheetRowAutoHeightMutation, SheetsSelectionsService } from '@univerjs/sheets';import { ICanvasPopupService } from '@univerjs/ui';-import { BehaviorSubject, map } from 'rxjs';+import { BehaviorSubject, map, throttleTime } from 'rxjs';import { SetScrollOperation } from '../commands/operations/scroll.operation';import { SetZoomRatioOperation } from '../commands/operations/set-zoom-ratio.operation';import { getViewportByCell, transformBound2OffsetBound } from '../common/utils';@@ -181,11 +181,14 @@ export class SheetCanvasPopManagerService extends Disposable {disposable.add(this._commandService.onCommandExecuted((commandInfo) => {if (commandInfo.id === SetFrozenMutation.id) {- const newRects = calc();- rects$.next(newRects);+ rects$.next(calc());}}));+ disposable.add(fromEventSubject(currentRender.engine.onTransformChange$).pipe(throttleTime(16)).subscribe(() => {+ rects$.next(calc());+ }));+return {rects$,disposable,@@ -597,6 +600,7 @@ export class SheetCanvasPopManagerService extends Disposable {const disposable = new DisposableCollection();disposable.add(currentRender.engine.clientRect$.subscribe(() => updatePosition()));+ disposable.add(fromEventSubject(currentRender.engine.onTransformChange$).pipe(throttleTime(16)).subscribe(() => updatePosition()));disposable.add(this._commandService.onCommandExecuted((commandInfo) => {if (commandInfo.id === SetWorksheetRowAutoHeightMutation.id) {const params = commandInfo.params as ISetWorksheetRowAutoHeightMutationParams;diff --git a/packages/sheets-ui/src/services/cell-alert-manager.service.ts b/packages/sheets-ui/src/services/cell-alert-manager.service.tsindex a421f46b8a..ff6756a699 100644--- a/packages/sheets-ui/src/services/cell-alert-manager.service.ts+++ b/packages/sheets-ui/src/services/cell-alert-manager.service.ts@@ -21,6 +21,7 @@ import { IRenderManagerService } from '@univerjs/engine-render';import { Subject } from 'rxjs';import { CELL_ALERT_KEY } from '../views/cell-alert';import { SheetCanvasPopManagerService } from './canvas-pop-manager.service';+import { CellPopupManagerService } from './cell-popup-manager.service';export enum CellAlertType {INFO,@@ -50,7 +51,8 @@ export class CellAlertManagerService extends Disposable {constructor(@IRenderManagerService private readonly _renderManagerService: IRenderManagerService,- @Inject(SheetCanvasPopManagerService) private readonly _canvasPopManagerService: SheetCanvasPopManagerService+ @Inject(SheetCanvasPopManagerService) private readonly _canvasPopManagerService: SheetCanvasPopManagerService,+ @Inject(CellPopupManagerService) private readonly _cellPopupManagerService: CellPopupManagerService) {super();@@ -79,21 +81,29 @@ export class CellAlertManagerService extends Disposable {}const { location } = alert;- const { row, col, unitId } = location;+ const { row, col, unitId, subUnitId } = location;const currentRender = this._renderManagerService.getRenderById(unitId);if (!currentRender) {return;}- const disposable = this._canvasPopManagerService.attachPopupToCell(row, col, {- componentKey: CELL_ALERT_KEY,- direction: 'horizontal',- offset: [2, 0],- extraProps: {- alert,+ const disposable = this._cellPopupManagerService.showPopup(+ {+ unitId,+ subUnitId,+ row,+ col,},- });+ {+ componentKey: CELL_ALERT_KEY,+ direction: 'horizontal',+ extraProps: {+ alert,+ },+ priority: 1,+ }+ );if (disposable) {lastPopup.dispose = disposable;}diff --git a/packages/sheets-ui/src/services/cell-popup-manager.service.ts b/packages/sheets-ui/src/services/cell-popup-manager.service.tsnew file mode 100644index 0000000000..fb59c3f0a0--- /dev/null+++ b/packages/sheets-ui/src/services/cell-popup-manager.service.ts@@ -0,0 +1,144 @@+/**+ * 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 { ISheetLocationBase } from '@univerjs/sheets';+import type { ICanvasPopup } from './canvas-pop-manager.service';+import { Disposable, generateRandomId, Inject, ObjectMatrix, toDisposable } from '@univerjs/core';+import { Subject } from 'rxjs';+import { CELL_POPUP_COMPONENT_KEY } from '../views/cell-popup/config';+import { SheetCanvasPopManagerService } from './canvas-pop-manager.service';++export interface ICellPopup extends Omit<ICanvasPopup, 'direction' | 'offset' | 'mask'> {+ direction?: 'horizontal' | 'vertical';+ id?: string;+ priority: number;+}++export interface ICellPopupDirectionCache {+ popups: ICellPopup[];+ disposable: IDisposable;+}++export interface ICellPopupCache {+ horizontal?: ICellPopupDirectionCache;+ vertical?: ICellPopupDirectionCache;+}++export interface ICellPopupChange extends ISheetLocationBase {+ direction: 'horizontal' | 'vertical';+}++export class CellPopupManagerService extends Disposable {+ private readonly _cellPopupMap = new Map<string, Map<string, ObjectMatrix<ICellPopupCache>>>();+ private readonly _change$ = new Subject<ICellPopupChange>();+ readonly change$ = this._change$.asObservable();++ constructor(+ @Inject(SheetCanvasPopManagerService) private readonly _sheetCanvasPopManagerService: SheetCanvasPopManagerService+ ) {+ super();+ }++ private _ensureCellPopupMap(unitId: string, subUnitId: string) {+ let unitMap = this._cellPopupMap.get(unitId);+ if (!unitMap) {+ unitMap = new Map();+ this._cellPopupMap.set(unitId, unitMap);+ }+ let subUnitMap = unitMap.get(subUnitId);+ if (!subUnitMap) {+ subUnitMap = new ObjectMatrix<ICellPopupCache>();+ unitMap.set(subUnitId, subUnitMap);+ }+ return subUnitMap;+ }++ showPopup(location: ISheetLocationBase, popup: ICellPopup) {+ const { direction = 'horizontal' } = popup;+ const { unitId, subUnitId, row, col } = location;+ const subUnitMap = this._ensureCellPopupMap(unitId, subUnitId);+ const directionCache = subUnitMap.getValue(row, col)?.[direction];++ popup.id = popup.id ?? generateRandomId();++ const hidePopup = () => {+ const root = subUnitMap.getValue(row, col);+ if (!root) {+ return;+ }+ const directionCache = root[direction];+ if (!directionCache) {+ return;+ }++ const findIndex = directionCache?.popups.findIndex((p) => p.id === popup.id && p.componentKey === popup.componentKey);+ directionCache?.popups.splice(findIndex, 1);++ if (directionCache.popups.length === 0) {+ directionCache.disposable.dispose();+ root[direction] = undefined;+ }++ this._change$.next({+ ...location,+ direction,+ });+ };++ if (!directionCache) {+ const disposable = this._sheetCanvasPopManagerService.attachPopupToCell(+ row,+ col,+ {+ ...popup,+ direction,+ componentKey: CELL_POPUP_COMPONENT_KEY,+ extraProps: {+ ...location,+ direction,+ },+ noPushMinimumGap: true,+ },+ unitId,+ subUnitId+ );++ subUnitMap.setValue(row, col, {+ ...subUnitMap.getValue(row, col),+ [direction]: {+ disposable,+ popups: [popup],+ },+ });+ } else {+ directionCache.popups.push(popup);+ directionCache.popups.sort((a, b) => a.priority - b.priority);+ }++ this._change$.next({+ ...location,+ direction,+ });++ return toDisposable(hidePopup);+ }++ getPopups(unitId: string, subUnitId: string, row: number, col: number, direction: 'horizontal' | 'vertical') {+ const subUnitMap = this._ensureCellPopupMap(unitId, subUnitId);+ return subUnitMap.getValue(row, col)?.[direction]?.popups || [];+ }+}diff --git a/packages/sheets-ui/src/views/cell-popup/config.ts b/packages/sheets-ui/src/views/cell-popup/config.tsnew file mode 100644index 0000000000..9721c49fd3--- /dev/null+++ b/packages/sheets-ui/src/views/cell-popup/config.ts@@ -0,0 +1,17 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++export const CELL_POPUP_COMPONENT_KEY = 'sheets.component.cell-popup';diff --git a/packages/sheets-ui/src/views/cell-popup/index.tsx b/packages/sheets-ui/src/views/cell-popup/index.tsxnew file mode 100644index 0000000000..63e0bf9ac2--- /dev/null+++ b/packages/sheets-ui/src/views/cell-popup/index.tsx@@ -0,0 +1,42 @@+/**+ * 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 { ISheetLocationBase } from '@univerjs/sheets';+import type { IPopup } from '@univerjs/ui';+import { ComponentManager, useDependency, useObservable } from '@univerjs/ui';+import { useMemo } from 'react';+import { filter } from 'rxjs';+import { CellPopupManagerService } from '../../services/cell-popup-manager.service';++export const CellPopup = (props: { popup: IPopup<ISheetLocationBase & { direction: 'horizontal' | 'vertical' }> }) => {+ const { popup } = props;+ const location = popup.extraProps!;+ const { row, col, direction, unitId, subUnitId } = location;+ const cellPopupManagerService = useDependency(CellPopupManagerService);+ useObservable(useMemo(() => cellPopupManagerService.change$.pipe(filter((change) => change.row === row && change.col === col && change.direction === direction)), [cellPopupManagerService, row, col, direction]));+ const popups = cellPopupManagerService.getPopups(unitId, subUnitId, row, col, direction);+ const componentManager = useDependency(ComponentManager);++ return (+ <div className="univer-cell-popup univer-flex univer-flex-col univer-ml-[1px]">+ {popups.map((item) => {+ const popup = item;+ const Component = componentManager.get(popup.componentKey);+ return Component ? <Component popup={popup} /> : null;+ })}+ </div>+ );+};diff --git a/packages/sheets-zen-editor/package.json b/packages/sheets-zen-editor/package.jsonindex 6d4372154b..ebfc203fbc 100644--- a/packages/sheets-zen-editor/package.json+++ b/packages/sheets-zen-editor/package.json@@ -84,7 +84,7 @@"@univerjs/docs": "workspace:*","@univerjs/docs-ui": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/sheets": "workspace:*","@univerjs/sheets-ui": "workspace:*","@univerjs/ui": "workspace:*"diff --git a/packages/slides-ui/package.json b/packages/slides-ui/package.jsonindex 5f491668d0..f7e49cae98 100644--- a/packages/slides-ui/package.json+++ b/packages/slides-ui/package.json@@ -74,7 +74,7 @@"@univerjs/docs-ui": "workspace:*","@univerjs/drawing": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/slides": "workspace:*","@univerjs/ui": "workspace:*"},diff --git a/packages/thread-comment-ui/package.json b/packages/thread-comment-ui/package.jsonindex 5ceafa9a75..e353c24162 100644--- a/packages/thread-comment-ui/package.json+++ b/packages/thread-comment-ui/package.json@@ -69,7 +69,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/docs-ui": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@univerjs/thread-comment": "workspace:*","@univerjs/ui": "workspace:*"},diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex d1aa6176cc..2819e826ad 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -83,7 +83,7 @@"@univerjs/core": "workspace:*","@univerjs/design": "workspace:*","@univerjs/engine-render": "workspace:*",- "@univerjs/icons": "^0.3.22",+ "@univerjs/icons": "^0.3.24","@wendellhu/redi": "0.18.0","localforage": "^1.10.0"},diff --git a/packages/ui/src/components/hooks/index.ts b/packages/ui/src/components/hooks/index.tsindex 05bf1183e8..4a504f0ad9 100644--- a/packages/ui/src/components/hooks/index.ts+++ b/packages/ui/src/components/hooks/index.ts@@ -18,4 +18,5 @@ export { useEvent } from './event';export { useConfigValue } from './layout';export { useUpdateEffect } from './update-effect';export { useClickOutSide } from './use-click-out-side';+export { useDebounceFn } from './use-debounce';export { useVirtualList } from './virtual-list';diff --git a/packages/ui/src/components/hooks/use-debounce.ts b/packages/ui/src/components/hooks/use-debounce.tsnew file mode 100644index 0000000000..e741ebbf27--- /dev/null+++ b/packages/ui/src/components/hooks/use-debounce.ts@@ -0,0 +1,31 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import { useCallback, useRef } from 'react';++export function useDebounceFn<T extends (...args: any[]) => void>(fn: T, delay = 300) {+ const timeoutRef = useRef<NodeJS.Timeout | null>(null);++ return useCallback((...args: Parameters<T>) => {+ if (timeoutRef.current) {+ clearTimeout(timeoutRef.current);+ }++ timeoutRef.current = setTimeout(() => {+ fn(...args);+ }, delay);+ }, [fn, delay]) as T;+}diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.tsindex c11328bb4d..0cdddf077e 100644--- a/packages/ui/src/index.ts+++ b/packages/ui/src/index.ts@@ -127,7 +127,7 @@ export { MobileContextMenu } from './views/components/context-menu/MobileContextexport { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';export { FloatDom } from './views/components/dom/FloatDom';export { GlobalZone } from './views/components/global-zone/GlobalZone';-export { CanvasPopup } from './views/components/popup/CanvasPopup';+export { CanvasPopup, SingleCanvasPopup } from './views/components/popup/CanvasPopup';export { ToolbarButton } from './views/components/ribbon/Button/ToolbarButton';export { useToolbarItemStatus } from './views/components/ribbon/hook';export { Ribbon } from './views/components/ribbon/Ribbon';diff --git a/packages/ui/src/views/components/popup/CanvasPopup.tsx b/packages/ui/src/views/components/popup/CanvasPopup.tsxindex a666b1e201..40a8a553ff 100644--- a/packages/ui/src/views/components/popup/CanvasPopup.tsx+++ b/packages/ui/src/views/components/popup/CanvasPopup.tsx@@ -27,7 +27,7 @@ interface ISingleCanvasPopupProps {children?: React.ReactNode;}-const SingleCanvasPopup = ({ popup, children }: ISingleCanvasPopupProps) => {+export const SingleCanvasPopup = ({ popup, children }: ISingleCanvasPopupProps) => {const [hidden, setHidden] = useState(false);const anchorRect$ = useMemo(() => popup.anchorRect$.pipe(throttleTime(0, animationFrameScheduler),diff --git a/packages/ui/src/views/components/popup/RectPopup.tsx b/packages/ui/src/views/components/popup/RectPopup.tsxindex 5bc695f543..d2a43aca8c 100644--- a/packages/ui/src/views/components/popup/RectPopup.tsx+++ b/packages/ui/src/views/components/popup/RectPopup.tsx@@ -85,6 +85,7 @@ export interface IRectPopupProps {zIndex?: number;maskZIndex?: number;onMaskClick?: () => void;+ noPushMinimumGap?: boolean;}export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {@@ -93,33 +94,36 @@ export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {height: number;containerWidth: number;containerHeight: number;+ noPushMinimumGap?: boolean;}/** The popup should have a minimum edge to the boundary. */const PUSHING_MINIMUM_GAP = 8;function calcPopupPosition(layout: IPopupLayoutInfo): { top: number; left: number } {- const { position, width, height, containerHeight, containerWidth, direction = 'vertical' } = layout;+ const { position, width, height, containerHeight, containerWidth, direction = 'vertical', noPushMinimumGap = false } = layout;++ const minTop = noPushMinimumGap ? -Infinity : PUSHING_MINIMUM_GAP;+ const maxTop = noPushMinimumGap ? Infinity : containerHeight - height - PUSHING_MINIMUM_GAP;+ const minLeft = noPushMinimumGap ? -Infinity : PUSHING_MINIMUM_GAP;+ const maxLeft = noPushMinimumGap ? Infinity : containerWidth - width - PUSHING_MINIMUM_GAP;// In y-axisif (direction === 'vertical' || direction.indexOf('top') === 0 || direction.indexOf('bottom') === 0) {const { left: startX, top: startY, right: endX, bottom: endY } = position;- const verticalStyle = (direction === 'vertical' && endY > containerHeight - height - PUSHING_MINIMUM_GAP) || direction.indexOf('top') > -1+ const verticalStyle = (direction === 'vertical' && endY > maxTop) || direction.indexOf('top') > -1// top- ? { top: Math.max(startY - height, PUSHING_MINIMUM_GAP) }+ ? { top: Math.max(startY - height, minTop) }// bottom- : { top: Math.min(endY, containerHeight - height - PUSHING_MINIMUM_GAP) };+ : { top: Math.min(endY, maxTop) };let horizontalStyle;- const minLeft = PUSHING_MINIMUM_GAP;- const maxLeft = containerWidth - width - PUSHING_MINIMUM_GAP;-if (direction.includes('center')) {const rectWidth = endX - startX;const offsetX = (rectWidth - width) / 2;- horizontalStyle = (Math.max(startX + offsetX, PUSHING_MINIMUM_GAP) + width) > containerWidth+ horizontalStyle = (Math.max(startX + offsetX, minLeft) + width) > containerWidth? { left: Math.max(Math.min(maxLeft, endX - width - offsetX), minLeft) }: { left: Math.max(minLeft, Math.min(startX + offsetX, maxLeft)) };} else if (direction.includes('left')) {@@ -140,33 +144,31 @@ function calcPopupPosition(layout: IPopupLayoutInfo): { top: number; left: numbeconst { left: startX, top: startY, right: endX, bottom: endY } = position;// const horizontalStyle = ((endX + width) > containerWidth || direction === 'left')const horizontalStyle = direction.includes('left')- ? { left: Math.max(startX - width, PUSHING_MINIMUM_GAP) } // on left- : { left: Math.min(endX, containerWidth - width - PUSHING_MINIMUM_GAP) }; // on right+ ? { left: Math.max(startX - width, minLeft) } // on left+ : { left: Math.min(endX, maxLeft) }; // on rightlet verticalStyle;- const minTop = PUSHING_MINIMUM_GAP;- const maxTop = containerHeight - height - PUSHING_MINIMUM_GAP;if (direction.includes('center')) {const rectHeight = endY - startY;const offsetY = (rectHeight - height) / 2;- verticalStyle = (Math.max(startY + offsetY, PUSHING_MINIMUM_GAP) + height) > containerHeight+ verticalStyle = (Math.max(startY + offsetY, minTop) + height) > containerHeight? { top: Math.max(Math.min(maxTop, endY - height - offsetY), minTop) }: { top: Math.max(minTop, Math.min(startY + offsetY, maxTop)) };} else if (direction.includes('top')) {verticalStyle = {- top: Math.min(startY, containerHeight - height - PUSHING_MINIMUM_GAP),+ top: Math.min(startY, maxTop),};} else if (direction.includes('bottom')) {verticalStyle = {- top: Math.max(endY - height, PUSHING_MINIMUM_GAP),+ top: Math.max(endY - height, minTop),};} else {// If the popup element exceed the visible area. We should "push" it back.verticalStyle = ((startY + height) > containerHeight)- ? { top: Math.max(endY - height, PUSHING_MINIMUM_GAP) } // on top- : { top: Math.min(startY, containerHeight - height - PUSHING_MINIMUM_GAP) }; // on bottom+ ? { top: Math.max(endY - height, minTop) } // on top+ : { top: Math.min(startY, maxTop) }; // on bottom}return { ...verticalStyle, ...horizontalStyle };@@ -190,6 +192,7 @@ function RectPopup(props: IRectPopupProps) {zIndex = 1020,maskZIndex = 100,onMaskClick,+ noPushMinimumGap,} = props;const nodeRef = useRef<HTMLElement>(null);const clickOtherFn = useEvent(onClickOutside ?? (() => { /* empty */ }));@@ -220,6 +223,7 @@ function RectPopup(props: IRectPopupProps) {containerWidth: innerWidth,containerHeight: innerHeight,direction,+ noPushMinimumGap,});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 18780b5e25..986c49a3b7 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -184,8 +184,8 @@ importers:specifier: ^11.0.4version: 11.0.4'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/icons-svg':specifier: ^0.3.22version: 0.3.22@@ -397,6 +397,12 @@ importers:'@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@@ -601,8 +607,8 @@ importers:specifier: workspace:*version: link:../../packages/design'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../../packages/sheets@@ -656,8 +662,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/mockdata':specifier: workspace:*version: link:../../mockdata@@ -808,8 +814,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/rpc':specifier: workspace:*version: link:../../packages/rpc@@ -869,8 +875,8 @@ importers:specifier: workspace:*version: link:../../packages/docs-ui'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../../packages/sheets@@ -924,8 +930,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/slides-ui':specifier: workspace:*version: link:../../packages/slides-ui@@ -976,8 +982,8 @@ importers:specifier: workspace:*version: link:../../packages/engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../../packages/sheets@@ -1138,8 +1144,8 @@ importers:specifier: ^2.2.6'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24class-variance-authority:specifier: ^0.7.1version: 0.7.1@@ -1294,8 +1300,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1368,8 +1374,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1472,8 +1478,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1518,8 +1524,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/thread-comment':specifier: workspace:*version: link:../thread-comment@@ -1573,8 +1579,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1653,8 +1659,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1791,8 +1797,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/ui':specifier: workspace:*version: link:../ui@@ -1980,8 +1986,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2050,8 +2056,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2145,8 +2151,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2240,8 +2246,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2326,8 +2332,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/rpc':specifier: workspace:*version: link:../rpc@@ -2461,8 +2467,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2581,8 +2587,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2627,6 +2633,80 @@ importers:specifier: ^3.1.2version: 3.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ packages/sheets-note:+ dependencies:+ '@univerjs/core':+ specifier: workspace:*+ version: link:../core+ '@univerjs/sheets':+ specifier: workspace:*+ version: link:../sheets+ devDependencies:+ '@univerjs-infra/shared':+ specifier: workspace:*+ version: link:../../common/shared+ rxjs:+ specifier: ^7.8.1+ version: 7.8.1+ typescript:+ specifier: ^5.8.3+ version: 5.8.3+ vite:+ specifier: ^6.3.3+ version: 6.3.3(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vitest:+ specifier: ^3.1.2+ version: 3.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])++ packages/sheets-note-ui:+ dependencies:+ '@univerjs/core':+ specifier: workspace:*+ version: link:../core+ '@univerjs/engine-render':+ specifier: workspace:*+ version: link:../engine-render+ '@univerjs/icons':+ specifier: ^0.3.24+ '@univerjs/sheets':+ specifier: workspace:*+ version: link:../sheets+ '@univerjs/sheets-note':+ specifier: workspace:*+ version: link:../sheets-note+ '@univerjs/sheets-ui':+ specifier: workspace:*+ version: link:../sheets-ui+ '@univerjs/ui':+ specifier: workspace:*+ version: link:../ui+ react:+ specifier: '19'+ version: 19.0.0+ rxjs:+ specifier: ^7.8.1+ version: 7.8.1+ devDependencies:+ '@types/react':+ specifier: '19'+ version: 19.1.2+ '@types/react-dom':+ specifier: '19'+ version: 19.1.2(@types/[email protected])+ less:+ specifier: ^4.1.3+ version: 4.3.0+ typescript:+ specifier: ^5.4.3+ version: 5.8.3+ vite:+ specifier: ^4.5.2+ version: 4.5.13(@types/[email protected])([email protected])([email protected])([email protected])+ vitest:+ specifier: ^1.3.1+ version: 1.6.1(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+packages/sheets-numfmt:dependencies:'@univerjs/core':@@ -2676,8 +2756,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2756,8 +2836,8 @@ importers:specifier: workspace:*version: link:../engine-formula'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2842,8 +2922,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -2931,8 +3011,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -3001,8 +3081,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/protocol':specifier: 0.1.45version: 0.1.45(@grpc/[email protected])([email protected])@@ -3062,8 +3142,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/sheets':specifier: workspace:*version: link:../sheets@@ -3145,8 +3225,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/slides':specifier: workspace:*version: link:../slides@@ -3235,8 +3315,8 @@ importers:specifier: workspace:*version: link:../docs-ui'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@univerjs/thread-comment':specifier: workspace:*version: link:../thread-comment@@ -3284,8 +3364,8 @@ importers:specifier: workspace:*version: link:../engine-render'@univerjs/icons':- specifier: ^0.3.22+ specifier: ^0.3.24'@wendellhu/redi':specifier: 0.18.0version: 0.18.0@@ -4028,6 +4108,12 @@ packages:resolution: {integrity: sha512-+zZymuVLH6zVwXPtCAtC+bDymxmEwEqDftdAK+f407IF1bnX49anIxvBhCA1AqUIfD6egj1jM1vUnSuijjNyYg==}engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==}+ engines: {node: '>=12'}+ cpu: [ppc64]+ os: [aix]+'@esbuild/[email protected]':resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==}engines: {node: '>=18'}@@ -4040,6 +4126,18 @@ packages:cpu: [ppc64]os: [aix]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [android]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==}engines: {node: '>=18'}@@ -4052,6 +4150,18 @@ packages:cpu: [arm64]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}+ engines: {node: '>=12'}+ cpu: [arm]+ os: [android]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==}+ engines: {node: '>=12'}+ cpu: [arm]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==}engines: {node: '>=18'}@@ -4064,6 +4174,18 @@ packages:cpu: [arm]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [android]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==}engines: {node: '>=18'}@@ -4076,6 +4198,18 @@ packages:cpu: [x64]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [darwin]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [darwin]+'@esbuild/[email protected]':resolution: {integrity: sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==}engines: {node: '>=18'}@@ -4088,6 +4222,18 @@ packages:cpu: [arm64]os: [darwin]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [darwin]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [darwin]+'@esbuild/[email protected]':resolution: {integrity: sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==}engines: {node: '>=18'}@@ -4100,6 +4246,18 @@ packages:cpu: [x64]os: [darwin]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [freebsd]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [freebsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==}engines: {node: '>=18'}@@ -4112,6 +4270,18 @@ packages:cpu: [arm64]os: [freebsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [freebsd]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [freebsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==}engines: {node: '>=18'}@@ -4124,6 +4294,18 @@ packages:cpu: [x64]os: [freebsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==}engines: {node: '>=18'}@@ -4136,6 +4318,18 @@ packages:cpu: [arm64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}+ engines: {node: '>=12'}+ cpu: [arm]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==}+ engines: {node: '>=12'}+ cpu: [arm]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==}engines: {node: '>=18'}@@ -4148,6 +4342,18 @@ packages:cpu: [arm]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}+ engines: {node: '>=12'}+ cpu: [ia32]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==}+ engines: {node: '>=12'}+ cpu: [ia32]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==}engines: {node: '>=18'}@@ -4166,6 +4372,18 @@ packages:cpu: [loong64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}+ engines: {node: '>=12'}+ cpu: [loong64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==}+ engines: {node: '>=12'}+ cpu: [loong64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==}engines: {node: '>=18'}@@ -4178,6 +4396,18 @@ packages:cpu: [loong64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}+ engines: {node: '>=12'}+ cpu: [mips64el]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==}+ engines: {node: '>=12'}+ cpu: [mips64el]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==}engines: {node: '>=18'}@@ -4190,6 +4420,18 @@ packages:cpu: [mips64el]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}+ engines: {node: '>=12'}+ cpu: [ppc64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==}+ engines: {node: '>=12'}+ cpu: [ppc64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==}engines: {node: '>=18'}@@ -4202,6 +4444,18 @@ packages:cpu: [ppc64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}+ engines: {node: '>=12'}+ cpu: [riscv64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==}+ engines: {node: '>=12'}+ cpu: [riscv64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==}engines: {node: '>=18'}@@ -4214,6 +4468,18 @@ packages:cpu: [riscv64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}+ engines: {node: '>=12'}+ cpu: [s390x]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==}+ engines: {node: '>=12'}+ cpu: [s390x]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==}engines: {node: '>=18'}@@ -4226,6 +4492,18 @@ packages:cpu: [s390x]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==}engines: {node: '>=18'}@@ -4250,6 +4528,18 @@ packages:cpu: [arm64]os: [netbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [netbsd]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [netbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==}engines: {node: '>=18'}@@ -4274,6 +4564,18 @@ packages:cpu: [arm64]os: [openbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [openbsd]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [openbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==}engines: {node: '>=18'}@@ -4286,6 +4588,18 @@ packages:cpu: [x64]os: [openbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [sunos]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [sunos]+'@esbuild/[email protected]':resolution: {integrity: sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==}engines: {node: '>=18'}@@ -4298,6 +4612,18 @@ packages:cpu: [x64]os: [sunos]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [win32]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==}+ engines: {node: '>=12'}+ cpu: [arm64]+ os: [win32]+'@esbuild/[email protected]':resolution: {integrity: sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==}engines: {node: '>=18'}@@ -4310,6 +4636,18 @@ packages:cpu: [arm64]os: [win32]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}+ engines: {node: '>=12'}+ cpu: [ia32]+ os: [win32]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==}+ engines: {node: '>=12'}+ cpu: [ia32]+ os: [win32]+'@esbuild/[email protected]':resolution: {integrity: sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==}engines: {node: '>=18'}@@ -4322,6 +4660,18 @@ packages:cpu: [ia32]os: [win32]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [win32]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==}+ engines: {node: '>=12'}+ cpu: [x64]+ os: [win32]+'@esbuild/[email protected]':resolution: {integrity: sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==}engines: {node: '>=18'}@@ -4515,6 +4865,10 @@ packages:resolution: {integrity: sha512-CZFX7UZVN9VopGbjTx4UXaXsi9ewoM1buL0kY7j1ftYdSs7p2spv9opxFjHlQ/QGTgh4UqufYqJJ0WKLml7b6w==}engines: {node: '>=4.0'}+ '@jest/[email protected]':+ resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}+'@jridgewell/[email protected]':resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==}engines: {node: '>=6.0.0'}@@ -5181,6 +5535,9 @@ packages:'@rushstack/[email protected]':resolution: {integrity: sha512-jg70HfoK44KfSP3MTiL5rxsZH7X1ktX3cZs9Sl8eDu1/LxJSbPsh0MOFRC710lIuYYSgxWjI5AjbCBAl7u3RxA==}+ '@sinclair/[email protected]':+ resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}+'@sindresorhus/[email protected]':resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}engines: {node: '>=18'}@@ -5753,14 +6110,14 @@ packages:'@univerjs/[email protected]':resolution: {integrity: sha512-jVLFpjAIj+LureEEmovOKpPNLN7/z4fUPY7aOOZ+qpiEXjhMpUKX5S+7REGOeG5LHRL4pQpB9tb4GRUb7PTZ8A==}- '@univerjs/[email protected]':- resolution: {integrity: sha512-DBc3Mq7S1S/2bIy6wzF1zJu78Bt82Zx6VWbgww7o+d7VU+kwUoRfEoiFuwymz9DwL9MVeKdAbdsamKLiFv32hQ==}+ '@univerjs/[email protected]':+ resolution: {integrity: sha512-/LPKDxGUGTYgY21SJzEDzx+3zU9bQNidWoOMYHpRyi/BUgqPbLHoS9VLD1rg49z+Z5XfnpavKr2RbGSfgZ7evg==}peerDependencies:react: '19'react-dom: '19'- '@univerjs/[email protected]':- resolution: {integrity: sha512-/LPKDxGUGTYgY21SJzEDzx+3zU9bQNidWoOMYHpRyi/BUgqPbLHoS9VLD1rg49z+Z5XfnpavKr2RbGSfgZ7evg==}+ '@univerjs/[email protected]':+ resolution: {integrity: sha512-ClGOKE0GS+hgvtP4XAI0ekKCmcrs4VZqZUVQddunuP7h+prCr01vMEuoLax9I/PrjOrSrl2u/xpvs9iGtXP1xw==}peerDependencies:react: '19'react-dom: '19'@@ -5877,6 +6234,9 @@ packages:vitest:optional: true+ '@vitest/[email protected]':+ resolution: {integrity: sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==}+'@vitest/[email protected]':resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==}@@ -5903,18 +6263,30 @@ packages:'@vitest/[email protected]':resolution: {integrity: sha512-R0xAiHuWeDjTSB3kQ3OQpT8Rx3yhdOAIm/JM4axXxnG7Q/fS8XUwggv/A4xzbQA+drYRjzkMnpYnOGAc4oeq8w==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==}+'@vitest/[email protected]':resolution: {integrity: sha512-bhLib9l4xb4sUMPXnThbnhX2Yi8OutBMA8Yahxa7yavQsFDtwY/jrUZwpKp2XH9DhRFJIeytlyGpXCqZ65nR+g==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==}+'@vitest/[email protected]':resolution: {integrity: sha512-Q1qkpazSF/p4ApZg1vfZSQ5Yw6OCQxVMVrLjslbLFA1hMDrT2uxtqMaw8Tc/jy5DLka1sNs1Y7rBcftMiaSH/Q==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==}+'@vitest/[email protected]':resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==}'@vitest/[email protected]':resolution: {integrity: sha512-OEc5fSXMws6sHVe4kOFyDSj/+4MSwst0ib4un0DlcYgQvRuYQ0+M2HyqGaauUMnjq87tmUaMNDxKQx7wNfVqPA==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==}+'@vitest/[email protected]':resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==}@@ -6067,6 +6439,10 @@ packages:peerDependencies:acorn: ^6.0.0 || ^7.0.0 || ^8.0.0+ resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==}+ engines: {node: '>=0.4.0'}+resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}engines: {node: '>=0.4.0'}@@ -6270,6 +6646,9 @@ packages:resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==}+ resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}+resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}engines: {node: '>=12'}@@ -6455,6 +6834,10 @@ packages:resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}+ resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==}+ engines: {node: '>=4'}+resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==}engines: {node: '>=12'}@@ -6499,6 +6882,9 @@ packages:resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==}+ resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==}+resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==}engines: {node: '>= 16'}@@ -6996,6 +7382,10 @@ packages:resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==}+ resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}engines: {node: '>=6'}@@ -7079,6 +7469,10 @@ packages:resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}+ resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==}+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}+resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}engines: {node: '>=8'}@@ -7403,6 +7797,16 @@ packages:engines: {node: '>=12'}hasBin: true+ resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}+ engines: {node: '>=12'}+ hasBin: true++ resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}+ engines: {node: '>=12'}+ hasBin: true+resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==}engines: {node: '>=18'}@@ -7992,6 +8396,9 @@ packages:resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==}engines: {node: '>=18'}+ resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==}+resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}engines: {node: '>= 0.4'}@@ -8660,6 +9067,9 @@ packages:resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}+ resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==}+resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}hasBin: true@@ -8798,6 +9208,10 @@ packages:resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==}engines: {node: '>= 12.13.0'}+ resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==}+ engines: {node: '>=14'}+resolution: {integrity: sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==}engines: {node: '>=14'}@@ -8884,6 +9298,9 @@ packages:resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}hasBin: true+ resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==}+resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==}@@ -9405,6 +9822,10 @@ packages:resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+ resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}engines: {node: '>=8'}@@ -9536,12 +9957,18 @@ packages:resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==}engines: {node: '>=12'}+ resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==}+resolution: {integrity: sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==}resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}+ resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}+resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==}engines: {node: '>= 14.16'}@@ -9901,6 +10328,10 @@ packages:resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}+ resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}+resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}engines: {node: '>= 0.6.0'}@@ -10349,6 +10780,11 @@ packages:deprecated: Rimraf versions prior to v4 are no longer supportedhasBin: true+ resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==}+ engines: {node: '>=14.18.0', npm: '>=8.0.0'}+ hasBin: true+resolution: {integrity: sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==}engines: {node: '>=18.0.0', npm: '>=8.0.0'}@@ -10715,6 +11151,9 @@ packages:resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}engines: {node: '>=8'}+ resolution: {integrity: sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==}+resolution: {integrity: sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==}@@ -10859,6 +11298,10 @@ packages:resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==}engines: {node: '>=12.0.0'}+ resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==}+ engines: {node: '>=14.0.0'}+resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}engines: {node: ^18.0.0 || >=20.0.0}@@ -10871,6 +11314,10 @@ packages:resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}engines: {node: '>=14.0.0'}+ resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==}+ engines: {node: '>=14.0.0'}+resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==}engines: {node: '>=14.0.0'}@@ -10987,6 +11434,10 @@ packages:resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}engines: {node: '>= 0.8.0'}+ resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==}+ engines: {node: '>=4'}+resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}engines: {node: '>=10'}@@ -11174,23 +11625,87 @@ packages:resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}engines: {node: '>= 0.8'}+ resolution: {integrity: sha512-YAXkfvGtuTzwWbDSACdJSg4A4DZiAqckWe90Zapc/sEX3XvHcw1NdurM/6od8J207tSDqNbSsgdCacBgvJKFuA==}+ engines: {node: ^18.0.0 || >=20.0.0}+ hasBin: true+resolution: {integrity: sha512-/8iMryv46J3aK13iUXsei5G/A3CUlW4665THCPS+K8xAaqrVWiGB4RfXMQXCLjpK9P2eK//BczrVkn5JLAk6DA==}engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}hasBin: true- resolution: {integrity: sha512-P64VnD00dR+e8S26ESoFELqc17+w7pKkwlBpgXteOljFyT0zDwD8hH4zXp49M/kciy//7ZbVXIwQCekBJjfWzA==}+ resolution: {integrity: sha512-P64VnD00dR+e8S26ESoFELqc17+w7pKkwlBpgXteOljFyT0zDwD8hH4zXp49M/kciy//7ZbVXIwQCekBJjfWzA==}+ peerDependencies:+ typescript: '*'+ vite: '*'+ peerDependenciesMeta:+ vite:+ optional: true++ resolution: {integrity: sha512-5OOg0H0AAPE1ew8DumHP0PnVdhbJncgpxWH4rvyrCt+Sw48ar5+/pCDeQbV3DcZwz7qL/A0JYeRoluPmvz+MMQ==}+ engines: {node: '>=14.18.0', vite: '>=3.1.0'}++ resolution: {integrity: sha512-Hgp8IF/yZDzKsN1hQWOuQZbrKiaFsbQud+07jJ8h9m9PaHWkpvZ5u55Xw5yYjWRXwRQ4jwFlJvY7T7FUJG9MCA==}+ engines: {node: ^14.18.0 || >=16.0.0}+ hasBin: true+ peerDependencies:+ '@types/node': '>= 14'+ less: '*'+ lightningcss: ^1.21.0+ sass: '*'+ stylus: '*'+ sugarss: '*'+ terser: ^5.4.0+ peerDependenciesMeta:+ '@types/node':+ optional: true+ less:+ optional: true+ lightningcss:+ optional: true+ sass:+ optional: true+ stylus:+ optional: true+ sugarss:+ optional: true+ terser:+ optional: true++ resolution: {integrity: sha512-1oDcnEp3lVyHCuQ2YFelM4Alm2o91xNoMncRm1U7S+JdYfYOvbiGZ3/CxGttrOu2M/KcGz7cRC2DoNUA6urmMA==}+ engines: {node: ^18.0.0 || >=20.0.0}+ hasBin: truepeerDependencies:- typescript: '*'- vite: '*'+ '@types/node': ^18.0.0 || >=20.0.0+ less: '*'+ lightningcss: ^1.21.0+ sass: '*'+ sass-embedded: '*'+ stylus: '*'+ sugarss: '*'+ terser: ^5.4.0peerDependenciesMeta:- vite:+ '@types/node':+ optional: true+ less:+ optional: true+ lightningcss:+ optional: true+ sass:+ optional: true+ sass-embedded:+ optional: true+ stylus:+ optional: true+ sugarss:+ optional: true+ terser:optional: true-- resolution: {integrity: sha512-5OOg0H0AAPE1ew8DumHP0PnVdhbJncgpxWH4rvyrCt+Sw48ar5+/pCDeQbV3DcZwz7qL/A0JYeRoluPmvz+MMQ==}- engines: {node: '>=14.18.0', vite: '>=3.1.0'}resolution: {integrity: sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==}@@ -11232,6 +11747,31 @@ packages:yaml:optional: true+ resolution: {integrity: sha512-Ljb1cnSJSivGN0LqXd/zmDbWEM0RNNg2t1QW/XUhYl/qPqyu7CsqeWtqQXHVaJsecLPuDoak2oJcZN2QoRIOag==}+ engines: {node: ^18.0.0 || >=20.0.0}+ hasBin: true+ peerDependencies:+ '@edge-runtime/vm': '*'+ '@types/node': ^18.0.0 || >=20.0.0+ '@vitest/browser': 1.6.1+ '@vitest/ui': 1.6.1+ happy-dom: '*'+ jsdom: '*'+ peerDependenciesMeta:+ '@edge-runtime/vm':+ optional: true+ '@types/node':+ optional: true+ '@vitest/browser':+ optional: true+ '@vitest/ui':+ optional: true+ happy-dom:+ optional: true+ jsdom:+ optional: true+resolution: {integrity: sha512-WaxpJe092ID1C0mr+LH9MmNrhfzi8I65EX/NRU/Ld016KqQNRgxSOlGNP1hHN+a/F8L15Mh8klwaF77zR3GeDQ==}engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}@@ -12204,66 +12744,129 @@ snapshots:esquery: 1.6.0jsdoc-type-pratt-parser: 4.1.0+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -12273,36 +12876,72 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -12315,6 +12954,12 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -12327,30 +12972,60 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -12603,6 +13278,10 @@ snapshots:'@javascript-obfuscator/[email protected]': {}+ '@jest/[email protected]':+ dependencies:+ '@sinclair/typebox': 0.27.8+'@jridgewell/[email protected]':dependencies:'@jridgewell/set-array': 1.2.1@@ -13269,6 +13948,8 @@ snapshots:transitivePeerDependencies:- '@types/node'+ '@sinclair/[email protected]': {}+'@sindresorhus/[email protected]': {}@@ -13977,12 +14658,12 @@ snapshots:'@univerjs/[email protected]': {}dependencies:react: 19.0.0react-dom: 19.0.0([email protected])dependencies:react: 19.0.0react-dom: 19.0.0([email protected])@@ -14078,6 +14759,12 @@ snapshots:typescript: 5.8.3vitest: 3.1.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ '@vitest/[email protected]':+ dependencies:+ '@vitest/spy': 1.6.1+ '@vitest/utils': 1.6.1+ chai: 4.5.0+'@vitest/[email protected]':dependencies:'@vitest/spy': 2.0.5@@ -14112,17 +14799,33 @@ snapshots:dependencies:tinyrainbow: 2.0.0+ '@vitest/[email protected]':+ dependencies:+ '@vitest/utils': 1.6.1+ p-limit: 5.0.0+ pathe: 1.1.2+'@vitest/[email protected]':dependencies:'@vitest/utils': 3.1.2pathe: 2.0.3+ '@vitest/[email protected]':+ dependencies:+ magic-string: 0.30.17+ pathe: 1.1.2+ pretty-format: 29.7.0+'@vitest/[email protected]':dependencies:'@vitest/pretty-format': 3.1.2magic-string: 0.30.17pathe: 2.0.3+ '@vitest/[email protected]':+ dependencies:+ tinyspy: 2.2.1+'@vitest/[email protected]':dependencies:tinyspy: 3.0.2@@ -14131,6 +14834,13 @@ snapshots:dependencies:tinyspy: 3.0.2+ '@vitest/[email protected]':+ dependencies:+ diff-sequences: 29.6.3+ estree-walker: 3.0.3+ loupe: 2.3.7+ pretty-format: 29.7.0+'@vitest/[email protected]':dependencies:'@vitest/pretty-format': 2.0.5@@ -14374,6 +15084,10 @@ snapshots:dependencies:acorn: 8.14.1+ dependencies:+ acorn: 8.14.1+@@ -14573,6 +15287,8 @@ snapshots:object-is: 1.1.6util: 0.12.5+ [email protected]: {}+@@ -14781,6 +15497,16 @@ snapshots:+ dependencies:+ assertion-error: 1.1.0+ check-error: 1.0.3+ deep-eql: 4.1.4+ get-func-name: 2.0.2+ loupe: 2.3.7+ pathval: 1.1.1+ type-detect: 4.1.0+dependencies:assertion-error: 2.0.1@@ -14823,6 +15549,10 @@ snapshots:+ dependencies:+ get-func-name: 2.0.2+@@ -15298,6 +16028,10 @@ snapshots:+ dependencies:+ type-detect: 4.1.0+@@ -15372,6 +16106,8 @@ snapshots:+ [email protected]: {}+dependencies:path-type: 4.0.0@@ -15725,6 +16461,57 @@ snapshots:esbuild-windows-64: 0.14.54esbuild-windows-arm64: 0.14.54+ optionalDependencies:+ '@esbuild/android-arm': 0.18.20+ '@esbuild/android-arm64': 0.18.20+ '@esbuild/android-x64': 0.18.20+ '@esbuild/darwin-arm64': 0.18.20+ '@esbuild/darwin-x64': 0.18.20+ '@esbuild/freebsd-arm64': 0.18.20+ '@esbuild/freebsd-x64': 0.18.20+ '@esbuild/linux-arm': 0.18.20+ '@esbuild/linux-arm64': 0.18.20+ '@esbuild/linux-ia32': 0.18.20+ '@esbuild/linux-loong64': 0.18.20+ '@esbuild/linux-mips64el': 0.18.20+ '@esbuild/linux-ppc64': 0.18.20+ '@esbuild/linux-riscv64': 0.18.20+ '@esbuild/linux-s390x': 0.18.20+ '@esbuild/linux-x64': 0.18.20+ '@esbuild/netbsd-x64': 0.18.20+ '@esbuild/openbsd-x64': 0.18.20+ '@esbuild/sunos-x64': 0.18.20+ '@esbuild/win32-arm64': 0.18.20+ '@esbuild/win32-ia32': 0.18.20+ '@esbuild/win32-x64': 0.18.20++ optionalDependencies:+ '@esbuild/aix-ppc64': 0.21.5+ '@esbuild/android-arm': 0.21.5+ '@esbuild/android-arm64': 0.21.5+ '@esbuild/android-x64': 0.21.5+ '@esbuild/darwin-arm64': 0.21.5+ '@esbuild/darwin-x64': 0.21.5+ '@esbuild/freebsd-arm64': 0.21.5+ '@esbuild/freebsd-x64': 0.21.5+ '@esbuild/linux-arm': 0.21.5+ '@esbuild/linux-arm64': 0.21.5+ '@esbuild/linux-ia32': 0.21.5+ '@esbuild/linux-loong64': 0.21.5+ '@esbuild/linux-mips64el': 0.21.5+ '@esbuild/linux-ppc64': 0.21.5+ '@esbuild/linux-riscv64': 0.21.5+ '@esbuild/linux-s390x': 0.21.5+ '@esbuild/linux-x64': 0.21.5+ '@esbuild/netbsd-x64': 0.21.5+ '@esbuild/openbsd-x64': 0.21.5+ '@esbuild/sunos-x64': 0.21.5+ '@esbuild/win32-arm64': 0.21.5+ '@esbuild/win32-ia32': 0.21.5+ '@esbuild/win32-x64': 0.21.5+optionalDependencies:'@esbuild/aix-ppc64': 0.25.2@@ -16541,6 +17328,8 @@ snapshots:+ [email protected]: {}+dependencies:es-errors: 1.3.0@@ -17247,6 +18036,8 @@ snapshots:+ [email protected]: {}+dependencies:argparse: 2.0.1@@ -17403,6 +18194,11 @@ snapshots:+ dependencies:+ mlly: 1.7.4+ pkg-types: 1.3.1+dependencies:mlly: 1.7.4@@ -17481,6 +18277,10 @@ snapshots:dependencies:js-tokens: 4.0.0+ dependencies:+ get-func-name: 2.0.2+@@ -18171,6 +18971,10 @@ snapshots:dependencies:yocto-queue: 1.2.0+ dependencies:+ yocto-queue: 1.2.0+dependencies:p-limit: 2.3.0@@ -18302,10 +19106,14 @@ snapshots:+ [email protected]: {}++ [email protected]: {}+@@ -18709,6 +19517,12 @@ snapshots:ansi-styles: 5.2.0react-is: 17.0.2+ dependencies:+ '@jest/schemas': 29.6.3+ ansi-styles: 5.2.0+ react-is: 18.3.1+@@ -19255,6 +20069,10 @@ snapshots:dependencies:glob: 7.2.3+ optionalDependencies:+ fsevents: 2.3.3+dependencies:'@types/estree': 1.0.7@@ -19679,6 +20497,10 @@ snapshots:+ dependencies:+ js-tokens: 9.0.1+@@ -19836,12 +20658,16 @@ snapshots:fdir: 6.4.4([email protected])picomatch: 4.0.2+ [email protected]: {}++ [email protected]: {}+@@ -19950,6 +20776,8 @@ snapshots:dependencies:prelude-ls: 1.2.1+ [email protected]: {}+@@ -20158,6 +20986,24 @@ snapshots:+ [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ dependencies:+ cac: 6.7.14+ debug: 4.4.0+ pathe: 1.1.2+ picocolors: 1.1.1+ transitivePeerDependencies:+ - '@types/node'+ - less+ - lightningcss+ - sass+ - sass-embedded+ - stylus+ - sugarss+ - supports-color+ - terser+[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:cac: 6.7.14@@ -20206,6 +21052,30 @@ snapshots:transitivePeerDependencies:- supports-color+ [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ dependencies:+ esbuild: 0.18.20+ postcss: 8.5.3+ rollup: 3.29.5+ optionalDependencies:+ '@types/node': 22.15.3+ fsevents: 2.3.3+ less: 4.3.0+ sass: 1.77.5+ terser: 5.39.0++ [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ dependencies:+ esbuild: 0.21.5+ postcss: 8.5.3+ rollup: 4.40.0+ optionalDependencies:+ '@types/node': 22.15.3+ fsevents: 2.3.3+ less: 4.3.0+ sass: 1.77.5+ terser: 5.39.0+[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:esbuild: 0.25.2@@ -20224,6 +21094,42 @@ snapshots:tsx: 4.19.4yaml: 2.7.1+ [email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):+ dependencies:+ '@vitest/expect': 1.6.1+ '@vitest/runner': 1.6.1+ '@vitest/snapshot': 1.6.1+ '@vitest/spy': 1.6.1+ '@vitest/utils': 1.6.1+ acorn-walk: 8.3.4+ chai: 4.5.0+ debug: 4.4.0+ execa: 8.0.1+ local-pkg: 0.5.1+ magic-string: 0.30.17+ pathe: 1.1.2+ picocolors: 1.1.1+ std-env: 3.9.0+ strip-literal: 2.1.1+ tinybench: 2.9.0+ tinypool: 0.8.4+ vite-node: 1.6.1(@types/[email protected])([email protected])([email protected])([email protected])+ why-is-node-running: 2.3.0+ optionalDependencies:+ '@types/node': 22.15.3+ happy-dom: 17.4.4+ jsdom: 24.1.1+ transitivePeerDependencies:+ - less+ - lightningcss+ - sass+ - sass-embedded+ - stylus+ - sugarss+ - supports-color+ - terser+[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:'@vitest/expect': 3.1.2