Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(sheet): sheet cell copy cut paste (#465)

Ran Luo63381079d5e1
diff --git a/packages/base-docs/package.json b/packages/base-docs/package.json
index f8204b71bc..5bd2335dc7 100644
--- a/packages/base-docs/package.json
+++ b/packages/base-docs/package.json
@@ -35,6 +35,7 @@
"esbuild": "node ./esbuild.config.mjs && tsc -p tsconfig.esbuild.json"
},
"dependencies": {
+ "@ctrl/tinycolor": "^4.0.2",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-sheets": "workspace:*",
"@univerjs/base-ui": "workspace:*",
@@ -46,6 +47,7 @@
"@types/node": "^20.9.0",
"@vitest/coverage-istanbul": "^0.34.6",
"esbuild": "^0.19.5",
+ "happy-dom": "^12.10.3",
"less": "^4.2.0",
"ts-node": "^10.9.1",
"vitest": "^0.34.6"
diff --git a/packages/ui-plugin-docs/src/commands/commands/__test__/clipboard.command.spec.ts b/packages/base-docs/src/commands/commands/__tests__/clipboard.command.spec.ts
similarity index 70%
rename from packages/ui-plugin-docs/src/commands/commands/__test__/clipboard.command.spec.ts
rename to packages/base-docs/src/commands/commands/__tests__/clipboard.command.spec.ts
index e552babb76..a8d3ad6378 100644
--- a/packages/ui-plugin-docs/src/commands/commands/__test__/clipboard.command.spec.ts
+++ b/packages/base-docs/src/commands/commands/__tests__/clipboard.command.spec.ts
@@ -1,14 +1,10 @@
/* eslint-disable no-magic-numbers */
-import {
- NORMAL_TEXT_SELECTION_PLUGIN_NAME,
- RichTextEditingMutation,
- TextSelectionManagerService,
-} from '@univerjs/base-docs';
import {
BooleanNumber,
ICommand,
ICommandService,
+ IDocumentData,
IStyleBase,
IUniverInstanceService,
UndoCommand,
@@ -17,14 +13,72 @@ import {
import { Injector } from '@wendellhu/redi';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
+import { NORMAL_TEXT_SELECTION_PLUGIN_NAME } from '../../../basics/docs-view-key';
+import { TextSelectionManagerService } from '../../../services/text-selection-manager.service';
+import { RichTextEditingMutation } from '../../mutations/core-editing.mutation';
import {
IInnerCutCommandParams,
IInnerPasteCommandParams,
InnerCutCommand,
InnerPasteCommand,
-} from '../clipboard.command';
+} from '../clipboard.inner.command';
import { createCommandTestBed } from './create-command-test-bed';
+const TEST_DOCUMENT_DATA_EN: IDocumentData = {
+ id: 'test-doc',
+ body: {
+ dataStream: 'What’s New in the 2022\r Gartner Hype Cycle for Emerging Technologies\r\n',
+ textRuns: [
+ {
+ st: 0,
+ ed: 22,
+ ts: {
+ bl: BooleanNumber.FALSE,
+ fs: 24,
+ cl: {
+ rgb: 'rgb(0, 40, 86)',
+ },
+ },
+ },
+ {
+ st: 23,
+ ed: 68,
+ ts: {
+ bl: BooleanNumber.TRUE,
+ fs: 24,
+ cl: {
+ rgb: 'rgb(0, 40, 86)',
+ },
+ },
+ },
+ ],
+ paragraphs: [
+ {
+ startIndex: 22,
+ },
+ {
+ startIndex: 68,
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
+ },
+ },
+ ],
+ sectionBreaks: [],
+ customBlocks: [],
+ },
+ documentStyle: {
+ pageSize: {
+ width: 594.3,
+ height: 840.51,
+ },
+ marginTop: 72,
+ marginBottom: 72,
+ marginRight: 90,
+ marginLeft: 90,
+ },
+};
+
describe('test cases in clipboard', () => {
let univer: Univer;
let get: Injector['get'];
@@ -55,7 +109,7 @@ describe('test cases in clipboard', () => {
}
beforeEach(() => {
- const testBed = createCommandTestBed();
+ const testBed = createCommandTestBed(TEST_DOCUMENT_DATA_EN);
univer = testBed.univer;
get = testBed.get;
diff --git a/packages/base-docs/src/commands/commands/clipboard.command.ts b/packages/base-docs/src/commands/commands/clipboard.command.ts
new file mode 100644
index 0000000000..944b14068f
--- /dev/null
+++ b/packages/base-docs/src/commands/commands/clipboard.command.ts
@@ -0,0 +1,35 @@
+import { CopyCommand, CutCommand, PasteCommand } from '@univerjs/base-ui';
+import { CommandType, FOCUSING_DOC, FOCUSING_EDITOR, IMultiCommand } from '@univerjs/core';
+
+export const DocCopyCommand: IMultiCommand = {
+ id: CopyCommand.id,
+ name: 'doc.command.copy',
+ type: CommandType.COMMAND,
+ multi: true,
+ priority: 999,
+ preconditions: (contextService) =>
+ contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(FOCUSING_EDITOR),
+ handler: async () => true,
+};
+
+export const DocCutCommand: IMultiCommand = {
+ id: CutCommand.id,
+ name: 'doc.command.cut',
+ type: CommandType.COMMAND,
+ multi: true,
+ priority: 999,
+ preconditions: (contextService) =>
+ contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(FOCUSING_EDITOR),
+ handler: async () => true,
+};
+
+export const DocPasteCommand: IMultiCommand = {
+ id: PasteCommand.id,
+ name: 'doc.command.paste',
+ type: CommandType.COMMAND,
+ multi: true,
+ priority: 999,
+ preconditions: (contextService) =>
+ contextService.getContextValue(FOCUSING_DOC) || contextService.getContextValue(FOCUSING_EDITOR),
+ handler: async () => true,
+};
diff --git a/packages/ui-plugin-docs/src/commands/commands/clipboard.command.ts b/packages/base-docs/src/commands/commands/clipboard.inner.command.ts
similarity index 81%
rename from packages/ui-plugin-docs/src/commands/commands/clipboard.command.ts
rename to packages/base-docs/src/commands/commands/clipboard.inner.command.ts
index 6984c376cd..9abadf4b43 100644
--- a/packages/ui-plugin-docs/src/commands/commands/clipboard.command.ts
+++ b/packages/base-docs/src/commands/commands/clipboard.inner.command.ts
@@ -1,52 +1,17 @@
-import {
- getRetainAndDeleteFromReplace,
- IRichTextEditingMutationParams,
- MemoryCursor,
- RichTextEditingMutation,
- TextSelectionManagerService,
-} from '@univerjs/base-docs';
-import { CopyCommand, CutCommand, PasteCommand } from '@univerjs/base-ui';
import {
CommandType,
- FOCUSING_DOC,
ICommand,
ICommandInfo,
ICommandService,
IDocumentBody,
- IMultiCommand,
IUndoRedoService,
IUniverInstanceService,
} from '@univerjs/core';
-export const DocCopyCommand: IMultiCommand = {
- id: CopyCommand.id,
- name: 'doc.command.copy',
- type: CommandType.COMMAND,
- multi: true,
- priority: 1100,
- preconditions: (contextService) => contextService.getContextValue(FOCUSING_DOC),
- handler: async () => true,
-};
-
-export const DocCutCommand: IMultiCommand = {
- id: CutCommand.id,
- name: 'doc.command.cut',
- type: CommandType.COMMAND,
- multi: true,
- priority: 1100,
- preconditions: (contextService) => contextService.getContextValue(FOCUSING_DOC),
- handler: async () => true,
-};
-
-export const DocPasteCommand: IMultiCommand = {
- id: PasteCommand.id,
- name: 'doc.command.paste',
- type: CommandType.COMMAND,
- multi: true,
- priority: 1100,
- preconditions: (contextService) => contextService.getContextValue(FOCUSING_DOC),
- handler: async () => true,
-};
+import { MemoryCursor } from '../../basics/memory-cursor';
+import { TextSelectionManagerService } from '../../services/text-selection-manager.service';
+import { IRichTextEditingMutationParams, RichTextEditingMutation } from '../mutations/core-editing.mutation';
+import { getRetainAndDeleteFromReplace } from './core-editing.command';
export interface IInnerPasteCommandParams {
segmentId: string;
diff --git a/packages/ui-plugin-docs/src/controllers/clipboard.controller.ts b/packages/base-docs/src/controllers/clipboard.controller.ts
similarity index 94%
rename from packages/ui-plugin-docs/src/controllers/clipboard.controller.ts
rename to packages/base-docs/src/controllers/clipboard.controller.ts
index 3d2e769681..53cb5d109e 100644
--- a/packages/ui-plugin-docs/src/controllers/clipboard.controller.ts
+++ b/packages/base-docs/src/controllers/clipboard.controller.ts
@@ -1,4 +1,3 @@
-import { DocSkeletonManagerService, TextSelectionManagerService } from '@univerjs/base-docs';
import { ITextSelectionRenderManager } from '@univerjs/base-render';
import {
Disposable,
@@ -9,19 +8,19 @@ import {
IParagraph,
ITextRun,
IUniverInstanceService,
+ LifecycleStages,
+ OnLifecycle,
Tools,
} from '@univerjs/core';
import { Inject } from '@wendellhu/redi';
-import {
- DocCopyCommand,
- DocCutCommand,
- DocPasteCommand,
- InnerCutCommand,
- InnerPasteCommand,
-} from '../commands/commands/clipboard.command';
+import { DocCopyCommand, DocCutCommand, DocPasteCommand } from '../commands/commands/clipboard.command';
+import { InnerCutCommand, InnerPasteCommand } from '../commands/commands/clipboard.inner.command';
import { IDocClipboardService } from '../services/clipboard/clipboard.service';
+import { DocSkeletonManagerService } from '../services/doc-skeleton-manager.service';
+import { TextSelectionManagerService } from '../services/text-selection-manager.service';
+@OnLifecycle(LifecycleStages.Rendered, DocClipboardController)
export class DocClipboardController extends Disposable {
constructor(
@ILogService private readonly _logService: ILogService,
@@ -34,6 +33,7 @@ export class DocClipboardController extends Disposable {
) {
super();
this._commandExecutedListener();
+ this.initialize();
}
initialize() {
diff --git a/packages/base-docs/src/controllers/inline-format.controller.ts b/packages/base-docs/src/controllers/inline-format.controller.ts
index 86fbd4ad0a..e834262f91 100644
--- a/packages/base-docs/src/controllers/inline-format.controller.ts
+++ b/packages/base-docs/src/controllers/inline-format.controller.ts
@@ -56,12 +56,12 @@ export class InlineFormatController extends Disposable {
return;
}
- this.handleInlineFormat(command);
+ this._handleInlineFormat(command);
})
);
}
- private handleInlineFormat(command: ICommandInfo) {
+ private _handleInlineFormat(command: ICommandInfo) {
const { segmentId } = this._textSelectionRenderManager.getActiveRange() ?? {};
if (segmentId == null) {
diff --git a/packages/base-docs/src/doc-plugin.ts b/packages/base-docs/src/doc-plugin.ts
index c9a3f9b2cb..2131ec30ed 100644
--- a/packages/base-docs/src/doc-plugin.ts
+++ b/packages/base-docs/src/doc-plugin.ts
@@ -36,6 +36,7 @@ import { RichTextEditingMutation } from './commands/mutations/core-editing.mutat
import { MoveCursorOperation, MoveSelectionOperation } from './commands/operations/cursor.operation';
import { SetDocZoomRatioOperation } from './commands/operations/set-doc-zoom-ratio.operation';
import { SetTextSelectionsOperation } from './commands/operations/text-selection.operation';
+import { DocClipboardController } from './controllers/clipboard.controller';
import { DeleteLeftInputController } from './controllers/delete-left-input.controller';
import { DocRenderController } from './controllers/doc-render.controller';
import { FloatingObjectController } from './controllers/floating-object.controller';
@@ -48,6 +49,7 @@ import { PageRenderController } from './controllers/page-render.controller';
import { TextSelectionController } from './controllers/text-selection.controller';
import { ZoomController } from './controllers/zoom.cotroller';
import { enUS } from './locale';
+import { DocClipboardService, IDocClipboardService } from './services/clipboard/clipboard.service';
import { DocSkeletonManagerService } from './services/doc-skeleton-manager.service';
import { TextSelectionManagerService } from './services/text-selection-manager.service';
import { BreakLineShortcut, DeleteLeftShortcut } from './shortcuts/core-editing.shortcut';
@@ -87,7 +89,7 @@ export class DocPlugin extends Plugin {
this._config = Object.assign(DEFAULT_DOCUMENT_PLUGIN_DATA, config);
- this.initialConfig(config);
+ this._initialConfig(config);
this._initializeDependencies(_injector);
@@ -151,7 +153,7 @@ export class DocPlugin extends Plugin {
});
}
- private initialConfig(config: IDocPluginConfig) {
+ private _initialConfig(config: IDocPluginConfig) {
this._currentUniverService.docAdded$.subscribe((documentModel) => {
if (documentModel == null) {
throw new Error('documentModel is null');
@@ -186,6 +188,12 @@ export class DocPlugin extends Plugin {
// services
[DocSkeletonManagerService],
+ [
+ IDocClipboardService,
+ {
+ useClass: DocClipboardService,
+ },
+ ],
[
ITextSelectionRenderManager,
{
@@ -201,6 +209,7 @@ export class DocPlugin extends Plugin {
[IMEInputController],
[DeleteLeftInputController],
[InlineFormatController],
+ [DocClipboardController],
[LineBreakInputController],
[MoveCursorController],
[ZoomController],
diff --git a/packages/base-docs/src/index.ts b/packages/base-docs/src/index.ts
index a60ee75b84..e30bcb6899 100644
--- a/packages/base-docs/src/index.ts
+++ b/packages/base-docs/src/index.ts
@@ -1,6 +1,7 @@
export { getDocObject } from './basics/component-tools';
export * from './basics/docs-view-key';
export { MemoryCursor } from './basics/memory-cursor';
+export { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/commands/clipboard.command';
export {
CoverCommand,
DeleteCommand,
diff --git a/packages/ui-plugin-docs/src/services/clipboard/__test__/html-and-udm-convert.spec.ts b/packages/base-docs/src/services/clipboard/__test__/html-and-udm-convert.spec.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/__test__/html-and-udm-convert.spec.ts
rename to packages/base-docs/src/services/clipboard/__test__/html-and-udm-convert.spec.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/clipboard.service.ts b/packages/base-docs/src/services/clipboard/clipboard.service.ts
similarity index 94%
rename from packages/ui-plugin-docs/src/services/clipboard/clipboard.service.ts
rename to packages/base-docs/src/services/clipboard/clipboard.service.ts
index 186619ba49..4ea89695ad 100644
--- a/packages/ui-plugin-docs/src/services/clipboard/clipboard.service.ts
+++ b/packages/base-docs/src/services/clipboard/clipboard.service.ts
@@ -34,8 +34,8 @@ export const IDocClipboardService = createIdentifier<IDocClipboardService>('doc.
export class DocClipboardService extends Disposable implements IDocClipboardService {
private _clipboardHooks: IDocClipboardHook[] = [];
- private htmlToUDM = new HtmlToUDMService();
- private UDMToHtml = new UDMToHtmlService();
+ private _htmlToUDM = new HtmlToUDMService();
+ private _umdToHtml = new UDMToHtmlService();
constructor(
@IUniverInstanceService private readonly _currentUniverService: IUniverInstanceService,
@@ -71,7 +71,7 @@ export class DocClipboardService extends Disposable implements IDocClipboardServ
}
}
- return this.htmlToUDM.convert(html);
+ return this._htmlToUDM.convert(html);
}
async setClipboardData(documentBodyList: IDocumentBody[]): Promise<void> {
@@ -80,7 +80,7 @@ export class DocClipboardService extends Disposable implements IDocClipboardServ
documentBodyList.length > 1
? documentBodyList.map((body) => body.dataStream).join('\n')
: documentBodyList[0].dataStream;
- let html = this.UDMToHtml.convert(documentBodyList);
+ let html = this._umdToHtml.convert(documentBodyList);
// Only cache copy content when the range is 1.
if (documentBodyList.length === 1) {
diff --git a/packages/ui-plugin-docs/src/services/clipboard/copy-content-cache.ts b/packages/base-docs/src/services/clipboard/copy-content-cache.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/copy-content-cache.ts
rename to packages/base-docs/src/services/clipboard/copy-content-cache.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/converter.ts b/packages/base-docs/src/services/clipboard/html-to-udm/converter.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/converter.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/converter.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/parse-node-style.ts b/packages/base-docs/src/services/clipboard/html-to-udm/parse-node-style.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/parse-node-style.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/parse-node-style.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/parse-to-dom.ts b/packages/base-docs/src/services/clipboard/html-to-udm/parse-to-dom.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/parse-to-dom.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/parse-to-dom.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts b/packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts b/packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/type.ts b/packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/type.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/paste-plugins/type.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/paste-plugins/type.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/html-to-udm/utils.ts b/packages/base-docs/src/services/clipboard/html-to-udm/utils.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/html-to-udm/utils.ts
rename to packages/base-docs/src/services/clipboard/html-to-udm/utils.ts
diff --git a/packages/ui-plugin-docs/src/services/clipboard/udm-to-html/convertor.ts b/packages/base-docs/src/services/clipboard/udm-to-html/convertor.ts
similarity index 100%
rename from packages/ui-plugin-docs/src/services/clipboard/udm-to-html/convertor.ts
rename to packages/base-docs/src/services/clipboard/udm-to-html/convertor.ts
diff --git a/packages/base-docs/vitest.config.ts b/packages/base-docs/vitest.config.ts
index 3c74cf802f..e840ca961a 100644
--- a/packages/base-docs/vitest.config.ts
+++ b/packages/base-docs/vitest.config.ts
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
+ environment: 'happy-dom',
coverage: {
provider: 'istanbul',
},
diff --git a/packages/ui-plugin-docs/package.json b/packages/ui-plugin-docs/package.json
index 0255ca267d..ae4ba146ee 100644
--- a/packages/ui-plugin-docs/package.json
+++ b/packages/ui-plugin-docs/package.json
@@ -33,7 +33,6 @@
"esbuild": "node ./esbuild.config.mjs && tsc -p tsconfig.esbuild.json"
},
"dependencies": {
- "@ctrl/tinycolor": "^4.0.2",
"@univerjs/base-docs": "workspace:*",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-ui": "workspace:*",
diff --git a/packages/ui-plugin-docs/src/commands/commands/__test__/create-command-test-bed.ts b/packages/ui-plugin-docs/src/commands/commands/__test__/create-command-test-bed.ts
deleted file mode 100644
index 4453722cb0..0000000000
--- a/packages/ui-plugin-docs/src/commands/commands/__test__/create-command-test-bed.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { createCommandTestBed as createTestBed } from '@univerjs/base-docs/commands/commands/__tests__/create-command-test-bed.js';
-import { BooleanNumber, IDocumentData } from '@univerjs/core';
-
-const TEST_DOCUMENT_DATA_EN: IDocumentData = {
- id: 'test-doc',
- body: {
- dataStream: 'What’s New in the 2022\r Gartner Hype Cycle for Emerging Technologies\r\n',
- textRuns: [
- {
- st: 0,
- ed: 22,
- ts: {
- bl: BooleanNumber.FALSE,
- fs: 24,
- cl: {
- rgb: 'rgb(0, 40, 86)',
- },
- },
- },
- {
- st: 23,
- ed: 68,
- ts: {
- bl: BooleanNumber.TRUE,
- fs: 24,
- cl: {
- rgb: 'rgb(0, 40, 86)',
- },
- },
- },
- ],
- paragraphs: [
- {
- startIndex: 22,
- },
- {
- startIndex: 68,
- paragraphStyle: {
- spaceAbove: 20,
- indentFirstLine: 20,
- },
- },
- ],
- sectionBreaks: [],
- customBlocks: [],
- },
- documentStyle: {
- pageSize: {
- width: 594.3,
- height: 840.51,
- },
- marginTop: 72,
- marginBottom: 72,
- marginRight: 90,
- marginLeft: 90,
- },
-};
-
-export function createCommandTestBed() {
- const { univer, get, doc } = createTestBed(TEST_DOCUMENT_DATA_EN);
-
- return { univer, get, doc };
-}
diff --git a/packages/ui-plugin-docs/src/doc-ui-plugin.ts b/packages/ui-plugin-docs/src/doc-ui-plugin.ts
index 5020cd7450..ab649cee3c 100644
--- a/packages/ui-plugin-docs/src/doc-ui-plugin.ts
+++ b/packages/ui-plugin-docs/src/doc-ui-plugin.ts
@@ -5,10 +5,8 @@ import { Dependency, Inject, Injector } from '@wendellhu/redi';
import { DefaultDocUiConfig, IDocUIPluginConfig } from './basics';
import { DOC_UI_PLUGIN_NAME } from './basics/const/plugin-name';
import { AppUIController } from './controllers';
-import { DocClipboardController } from './controllers/clipboard.controller';
import { DocUIController } from './controllers/doc-ui.controller';
import { enUS } from './locale';
-import { DocClipboardService, IDocClipboardService } from './services/clipboard/clipboard.service';
export class DocUIPlugin extends Plugin {
static override type = PluginType.Doc;
@@ -37,8 +35,6 @@ export class DocUIPlugin extends Plugin {
private _initDependencies(injector: Injector) {
const dependencies: Dependency[] = [
- [IDocClipboardService, { useClass: DocClipboardService }],
- [DocClipboardController],
[DocUIController],
[
// controllers
@@ -66,6 +62,5 @@ export class DocUIPlugin extends Plugin {
private _initModules(): void {
this._injector.get(AppUIController);
- this._injector.get(DocClipboardController).initialize();
}
}
diff --git a/packages/ui-plugin-docs/tsconfig.json b/packages/ui-plugin-docs/tsconfig.json
index 56379c3a55..064da5bfe8 100644
--- a/packages/ui-plugin-docs/tsconfig.json
+++ b/packages/ui-plugin-docs/tsconfig.json
@@ -7,8 +7,5 @@
"esModuleInterop": true,
"strictPropertyInitialization": false
},
- "include": [
- "src/**/*",
- "test/**/*.test.(ts|tsx|js)"
- ]
-}
\ No newline at end of file
+ "include": ["src/**/*", "test/**/*.test.(ts|tsx|js)"]
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 929bbd7161..606ae56d66 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -362,6 +362,9 @@ importers:
packages/base-docs:
dependencies:
+ '@ctrl/tinycolor':
+ specifier: ^4.0.2
+ version: 4.0.2
'@univerjs/base-render':
specifier: workspace:*
version: link:../base-render
@@ -390,6 +393,9 @@ importers:
esbuild:
specifier: ^0.19.5
version: 0.19.5
+ happy-dom:
+ specifier: ^12.10.3
+ version: 12.10.3
less:
specifier: ^4.2.0
version: 4.2.0
@@ -1081,9 +1087,6 @@ importers:
packages/ui-plugin-docs:
dependencies:
- '@ctrl/tinycolor':
- specifier: ^4.0.2
- version: 4.0.2
'@univerjs/base-docs':
specifier: workspace:*
version: link:../base-docs