Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sheets-drawing): sheet-drawing error depend on renderManagerService #3030

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import { Disposable, Inject, LifecycleService, LifecycleStages, UniverInstanceType } from '@univerjs/core';
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
import { filter, first } from 'rxjs';
import { ISheetDrawingService } from '../../services/sheet-drawing.service';

export class SheetsDrawingRenderController extends Disposable implements IRenderModule {
constructor(
Expand Down
2 changes: 2 additions & 0 deletions packages/sheets-drawing-ui/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { SheetCanvasFloatDomManagerService } from './services/canvas-float-dom-m
import { SheetDrawingPrintingController } from './controllers/sheet-drawing-printing.controller';
import { SheetDrawingPermissionController } from './controllers/sheet-drawing-permission.controller';
import { SheetsDrawingCopyPasteController } from './controllers/sheet-drawing-copy-paste.controller';
import { SheetsDrawingRenderController } from './controllers/render-controllers/sheet-drawing.render-controller';

const PLUGIN_NAME = 'SHEET_IMAGE_UI_PLUGIN';

Expand Down Expand Up @@ -76,6 +77,7 @@ export class UniverSheetsDrawingUIPlugin extends Plugin {
([
[SheetDrawingUpdateController],
[SheetDrawingTransformAffectedController],
[SheetsDrawingRenderController],
] as Dependency[]).forEach((m) => {
this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, m));
});
Expand Down
2 changes: 0 additions & 2 deletions packages/sheets-drawing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@
"peerDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"rxjs": ">=7.0.0"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"typescript": "^5.5.4",
Expand Down
11 changes: 1 addition & 10 deletions packages/sheets-drawing/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@

import { Inject, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
import type { Dependency } from '@univerjs/core';
import { IRenderManagerService } from '@univerjs/engine-render';
import { SHEET_DRAWING_PLUGIN, SheetsDrawingLoadController } from './controllers/sheet-drawing.controller';
import { ISheetDrawingService, SheetDrawingService } from './services/sheet-drawing.service';
import { SheetsDrawingRenderController } from './controllers/render-controllers/sheet-drawing.render-controller';

export class UniverSheetsDrawingPlugin extends Plugin {
static override pluginName = SHEET_DRAWING_PLUGIN;
static override type = UniverInstanceType.UNIVER_SHEET;

constructor(
private readonly _config: unknown,
@Inject(Injector) override readonly _injector: Injector,
@IRenderManagerService private readonly _renderManagerService: IRenderManagerService
@Inject(Injector) override readonly _injector: Injector
) {
super();
}
Expand All @@ -39,10 +36,4 @@ export class UniverSheetsDrawingPlugin extends Plugin {
[ISheetDrawingService, { useClass: SheetDrawingService }],
] as Dependency[]).forEach((dependency) => this._injector.add(dependency));
}

override onRendered(): void {
([[SheetsDrawingRenderController]] as Dependency[]).forEach((m) => {
this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, m));
});
}
}
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading