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
fix(thread-comment): thread-comment build types (#3802)
zhangw417fdee72933
diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex 90dc03b558..596c27d1f0 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -16,7 +16,7 @@import type { Nullable } from '@univerjs/core';import type { IUniverRPCMainThreadConfig } from '@univerjs/rpc';-import type { IThreadCommentMentionDataSource } from '@univerjs/thread-comment';+import type { IThreadCommentMentionDataSource } from '@univerjs/thread-comment-ui';import { LocaleType, LogLevel, Univer, UniverInstanceType, UserManagerService } from '@univerjs/core';import { UniverDebuggerPlugin } from '@univerjs/debugger';import { defaultTheme } from '@univerjs/design';diff --git a/examples/src/uni/main.ts b/examples/src/uni/main.tsindex afa9601ed3..ead32bcc42 100644--- a/examples/src/uni/main.ts+++ b/examples/src/uni/main.ts@@ -16,7 +16,7 @@import type { Nullable } from '@univerjs/core';import type { IUniverRPCMainThreadConfig } from '@univerjs/rpc';-import type { IThreadCommentMentionDataSource } from '@univerjs/thread-comment';+import type { IThreadCommentMentionDataSource } from '@univerjs/thread-comment-ui';import { Injector, LocaleType, LogLevel, Univer, UniverInstanceType } from '@univerjs/core';import { UniverDebuggerPlugin } from '@univerjs/debugger';import { defaultTheme } from '@univerjs/design';@@ -40,8 +40,7 @@ import { UniverSheetsThreadCommentPlugin } from '@univerjs/sheets-thread-commentimport { SheetUIController, UniverSheetsUIPlugin } from '@univerjs/sheets-ui';import { UniverSlidesPlugin } from '@univerjs/slides';import { SlidesUIController, UniverSlidesUIPlugin } from '@univerjs/slides-ui';-import { IThreadCommentMentionDataService } from '@univerjs/thread-comment';-import { UniverThreadCommentUIPlugin } from '@univerjs/thread-comment-ui';+import { IThreadCommentMentionDataService, UniverThreadCommentUIPlugin } from '@univerjs/thread-comment-ui';import { UniDocsUIController } from '@univerjs/uni-docs-ui';import { UniverDocUniFormulaPlugin } from '@univerjs/uni-formula';import { UniSheetsUIController } from '@univerjs/uni-sheets-ui';diff --git a/package.json b/package.jsonindex 130ca4c500..8407cb6670 100644--- a/package.json+++ b/package.json@@ -62,7 +62,7 @@"eslint-plugin-no-barrel-import": "^0.0.2","eslint-plugin-no-penetrating-import": "^0.0.1","eslint-plugin-react": "^7.37.1",- "eslint-plugin-react-hooks": "5.1.0-rc-107a2f8c3e-20240617",+ "eslint-plugin-react-hooks": "5.0.0","eslint-plugin-react-refresh": "^0.4.12","husky": "^9.1.6","lint-staged": "^15.2.10",diff --git a/packages/sheets-formula/package.json b/packages/sheets-formula/package.jsonindex ee4ab874c7..5393e87f51 100644--- a/packages/sheets-formula/package.json+++ b/packages/sheets-formula/package.json@@ -62,10 +62,8 @@},"dependencies": {"@univerjs/core": "workspace:*",- "@univerjs/design": "workspace:*","@univerjs/docs": "workspace:*","@univerjs/engine-formula": "workspace:*",- "@univerjs/icons": "^0.1.79","@univerjs/rpc": "workspace:*","@univerjs/sheets": "workspace:*","@univerjs/sheets-numfmt": "workspace:*"diff --git a/packages/sheets-thread-comment/src/index.ts b/packages/sheets-thread-comment/src/index.tsindex d4ace84e50..9754967a1b 100644--- a/packages/sheets-thread-comment/src/index.ts+++ b/packages/sheets-thread-comment/src/index.ts@@ -39,6 +39,6 @@ export type {IUpdateCommentCommandParams,} from '@univerjs/thread-comment';export { UniverThreadCommentUIPlugin } from '@univerjs/thread-comment-ui';-export { IThreadCommentMentionDataService } from '@univerjs/thread-comment';+export { IThreadCommentMentionDataService } from '@univerjs/thread-comment-ui';// #endregiondiff --git a/packages/thread-comment-ui/src/index.ts b/packages/thread-comment-ui/src/index.tsindex 500ebeb2de..074246225a 100644--- a/packages/thread-comment-ui/src/index.ts+++ b/packages/thread-comment-ui/src/index.ts@@ -22,6 +22,7 @@ export type { IThreadCommentPanelProps } from './views/thread-comment-panel';export { ThreadCommentTree } from './views/thread-comment-tree';export type { IThreadCommentTreeProps } from './views/thread-comment-tree';export { THREAD_COMMENT_PANEL } from './types/const';+export { IThreadCommentMentionDataService, type IThreadCommentMentionDataSource } from './services/thread-comment-mention-data.service';// #region - all commandsdiff --git a/packages/thread-comment-ui/src/plugin.ts b/packages/thread-comment-ui/src/plugin.tsindex ff51a491bb..73aff900f3 100644--- a/packages/thread-comment-ui/src/plugin.ts+++ b/packages/thread-comment-ui/src/plugin.ts@@ -14,14 +14,15 @@* limitations under the License.*/-import { UniverThreadCommentPlugin } from '@univerjs/thread-comment';import type { Dependency } from '@univerjs/core';+import type { IUniverThreadCommentUIConfig } from './controllers/config.schema';import { DependentOn, ICommandService, IConfigService, Inject, Injector, mergeOverrideWithDependencies, Plugin, UniverInstanceType } from '@univerjs/core';-import { PLUGIN_NAME } from './types/const';-import { ThreadCommentPanelService } from './services/thread-comment-panel.service';+import { UniverThreadCommentPlugin } from '@univerjs/thread-comment';import { SetActiveCommentOperation, ToggleSheetCommentPanelOperation } from './commands/operations/comment.operations';-import type { IUniverThreadCommentUIConfig } from './controllers/config.schema';import { defaultPluginConfig, PLUGIN_CONFIG_KEY } from './controllers/config.schema';+import { IThreadCommentMentionDataService, ThreadCommentMentionDataService } from './services/thread-comment-mention-data.service';+import { ThreadCommentPanelService } from './services/thread-comment-panel.service';+import { PLUGIN_NAME } from './types/const';@DependentOn(UniverThreadCommentPlugin)export class UniverThreadCommentUIPlugin extends Plugin {@@ -47,6 +48,7 @@ export class UniverThreadCommentUIPlugin extends Plugin {override onStarting(): void {(mergeOverrideWithDependencies([[ThreadCommentPanelService],+ [IThreadCommentMentionDataService, { useClass: ThreadCommentMentionDataService }],], this._config?.overrides) as Dependency[]).forEach((dep) => {this._injector.add(dep);});diff --git a/packages/thread-comment/src/services/thread-comment-mention-data.service.ts b/packages/thread-comment-ui/src/services/thread-comment-mention-data.service.tssimilarity index 100%rename from packages/thread-comment/src/services/thread-comment-mention-data.service.tsrename to packages/thread-comment-ui/src/services/thread-comment-mention-data.service.tsdiff --git a/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx b/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsxindex 42d2f64ccd..3636cce33e 100644--- a/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx+++ b/packages/thread-comment-ui/src/views/thread-comment-editor/index.tsx@@ -14,17 +14,17 @@* limitations under the License.*/+import type { IDocumentBody } from '@univerjs/core';+import type { MentionProps } from '@univerjs/design';+import type { IThreadComment } from '@univerjs/thread-comment';import { ICommandService, LocaleService, UniverInstanceType, useDependency } from '@univerjs/core';import { Button, Mention, Mentions } from '@univerjs/design';import { DocSelectionManagerService } from '@univerjs/docs';import { DocSelectionRenderService } from '@univerjs/docs-ui';import { IRenderManagerService } from '@univerjs/engine-render';+import { IThreadCommentMentionDataService } from '@univerjs/thread-comment-ui';import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';-import type { IDocumentBody } from '@univerjs/core';-import type { MentionProps } from '@univerjs/design';-import type { IThreadComment } from '@univerjs/thread-comment';import { SetActiveCommentOperation } from '../../commands/operations/comment.operations';-import { IThreadCommentMentionDataService } from '@univerjs/thread-comment';import styles from './index.module.less';import { parseMentions, transformDocument2TextNodes, transformMention, transformTextNode2Text, transformTextNodes2Document } from './util';diff --git a/packages/thread-comment/src/index.ts b/packages/thread-comment/src/index.tsindex e328002d4c..21ed1da294 100644--- a/packages/thread-comment/src/index.ts+++ b/packages/thread-comment/src/index.ts@@ -26,11 +26,6 @@ export {ThreadCommentDataSourceService,type ThreadCommentJSON,} from './services/tc-datasource.service';-export {- type IThreadCommentMentionDataSource,- IThreadCommentMentionDataService,- ThreadCommentMentionDataService,-} from './services/thread-comment-mention-data.service';// #region - all commandsexport {diff --git a/packages/thread-comment/src/plugin.ts b/packages/thread-comment/src/plugin.tsindex 484bfad4d9..8952d65522 100644--- a/packages/thread-comment/src/plugin.ts+++ b/packages/thread-comment/src/plugin.ts@@ -24,7 +24,6 @@ import { ThreadCommentResourceController } from './controllers/tc-resource.contrimport { ThreadCommentModel } from './models/thread-comment.model';import { IThreadCommentDataSourceService, ThreadCommentDataSourceService } from './services/tc-datasource.service';import { TC_PLUGIN_NAME } from './types/const';-import { IThreadCommentMentionDataService, ThreadCommentMentionDataService } from './services/thread-comment-mention-data.service';export class UniverThreadCommentPlugin extends Plugin {static override pluginName = TC_PLUGIN_NAME;@@ -46,7 +45,6 @@ export class UniverThreadCommentPlugin extends Plugin {override onStarting(): void {(mergeOverrideWithDependencies([[IThreadCommentDataSourceService, { useClass: ThreadCommentDataSourceService }],- [IThreadCommentMentionDataService, { useClass: ThreadCommentMentionDataService }],[ThreadCommentModel],[ThreadCommentResourceController],], this._config?.overrides) as Dependency[]).forEach(diff --git a/packages/thread-comment/vite.config.ts b/packages/thread-comment/vite.config.tsindex 04e4e3b060..62c3c4fab3 100644--- a/packages/thread-comment/vite.config.ts+++ b/packages/thread-comment/vite.config.ts@@ -4,9 +4,4 @@ import pkg from './package.json';export default ({ mode }) => createViteConfig({}, {mode,pkg,- features: {- react: false,- css: true,- dom: true,- },});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 3f6127028f..6d448d6cd3 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -10,7 +10,7 @@ importers:devDependencies:'@antfu/eslint-config':specifier: 3.7.3- version: 3.7.3(@eslint-react/[email protected]([email protected]([email protected]))([email protected]))(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 3.7.3(@eslint-react/[email protected]([email protected]([email protected]))([email protected]))(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))'@commitlint/cli':specifier: ^19.5.0version: 19.5.0(@types/[email protected])([email protected])@@ -66,8 +66,8 @@ importers:specifier: ^7.37.1version: 7.37.1([email protected]([email protected]))eslint-plugin-react-hooks:- specifier: 5.1.0-rc-107a2f8c3e-20240617- version: 5.1.0-rc-107a2f8c3e-20240617([email protected]([email protected]))+ specifier: 5.0.0+ version: 5.0.0([email protected]([email protected]))eslint-plugin-react-refresh:specifier: ^0.4.12version: 0.4.12([email protected]([email protected]))@@ -2337,18 +2337,12 @@ importers:'@univerjs/core':specifier: workspace:*version: link:../core- '@univerjs/design':- specifier: workspace:*- version: link:../design'@univerjs/docs':specifier: workspace:*version: link:../docs'@univerjs/engine-formula':specifier: workspace:*version: link:../engine-formula- '@univerjs/icons':- specifier: ^0.1.79'@univerjs/rpc':specifier: workspace:*version: link:../rpc@@ -6828,8 +6822,8 @@ packages:typescript:optional: true- resolution: {integrity: sha512-FqbGPZg0U97cOqiZuGm8yplPYtTNTa2YhEDFyL/8qtxQjwQX7KVbCWA1DiAdiNOUi37KrAqZ0TiqrnbQ4QOSTQ==}+ resolution: {integrity: sha512-hIOwI+5hYGpJEc4uPRmz2ulCjAGD/N13Lukkh8cLV0i2IRk/bdZDYjgLVHj+U9Z704kLIdIO6iueGvxNur0sgw==}engines: {node: '>=10'}peerDependencies:eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0@@ -10497,7 +10491,7 @@ snapshots:dependencies:'@babel/runtime': 7.25.0- '@antfu/[email protected](@eslint-react/[email protected]([email protected]([email protected]))([email protected]))(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@antfu/[email protected](@eslint-react/[email protected]([email protected]([email protected]))([email protected]))(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))':dependencies:'@antfu/install-pkg': 0.4.1'@clack/prompts': 0.7.0@@ -10538,7 +10532,7 @@ snapshots:optionalDependencies:eslint-plugin-format: 0.1.2([email protected]([email protected]))- eslint-plugin-react-hooks: 5.1.0-rc-107a2f8c3e-20240617([email protected]([email protected]))+ eslint-plugin-react-hooks: 5.0.0([email protected]([email protected]))eslint-plugin-react-refresh: 0.4.12([email protected]([email protected]))transitivePeerDependencies:- '@typescript-eslint/utils'@@ -14277,7 +14271,7 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:eslint: 9.12.0([email protected])