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

refactor(docs-ui): refactor to RenderUnit #2539

Merged
merged 25 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f0bc90b
refactor: rename basic files
wzhudev Jun 17, 2024
43f0031
refactor(docs-ui): refactor doc rendering to render unit
wzhudev Jun 17, 2024
a687e84
fix: fix error emitted
wzhudev Jun 17, 2024
d3c13ae
refactor: refactor zoom controller
wzhudev Jun 17, 2024
1b2a7fc
refactor: refactor back scroll render controller
wzhudev Jun 17, 2024
a270e80
refactor: move doc skeleton manager into render unit
wzhudev Jun 17, 2024
5127019
refactor: refactor doc drawing
wzhudev Jun 18, 2024
721f501
refactor: refactor editor related modules
wzhudev Jun 18, 2024
e0fda40
fix: fix type error
wzhudev Jun 18, 2024
64f55c4
WIP
wzhudev Jun 18, 2024
a55b62d
refactor: refactor doc view model
wzhudev Jun 18, 2024
44d59f1
test: fix docs test
wzhudev Jun 18, 2024
45efb13
fix: fix import error
wzhudev Jun 18, 2024
b1e4042
test: fix facade test
wzhudev Jun 18, 2024
48a1c9f
fix: fix e2e test
wzhudev Jun 18, 2024
2d44a24
chore: change editor unit name
wzhudev Jun 18, 2024
eb2b0c5
chore: update code style
wzhudev Jun 18, 2024
c2d944b
fix: fix formula editor cannot be activated
wzhudev Jun 18, 2024
472c540
fix: fix render blinking
wzhudev Jun 18, 2024
36ddccf
fix: fix sheet editor cannot be updated
wzhudev Jun 19, 2024
61fc0dc
Merge remote-tracking branch 'origin/dev' into wzhudev/refactor/doc-r…
wzhudev Jun 19, 2024
d824547
Merge remote-tracking branch 'origin/dev' into wzhudev/refactor/doc-r…
wzhudev Jun 20, 2024
65ccd77
docs: fix cannot input on fx bar
wzhudev Jun 22, 2024
d7b5411
Merge branch 'dev' into wzhudev/refactor/doc-render-unit
wzhudev Jun 22, 2024
05f220d
fix: fix types
wzhudev Jun 22, 2024
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
Prev Previous commit
Next Next commit
fix: fix sheet editor cannot be updated
  • Loading branch information
wzhudev committed Jun 19, 2024
commit 36ddccf15817d6633809a94e38e9562c61d5722c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class DocRenderController extends RxDisposable implements IRenderModule {
}
});

// TODO@wzhudev: this shouldn't be a config, because we may render different units at the same time.
const hasScroll = this._configService.getConfig('hasScroll') as Nullable<boolean>;

if (hasScroll !== false) {
new ScrollBar(viewMain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class DocZoomRenderController extends Disposable implements IRenderModule
this._initSkeletonListener();
this._initCommandExecutedListener();
this._initRenderRefresher();

setTimeout(() => this._updateViewZoom(1, true), 20);
}

private _initRenderRefresher() {
Expand Down
15 changes: 12 additions & 3 deletions packages/docs-ui/src/docs-ui-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import {
ILogService,
IUniverInstanceService,
LocaleService,
Plugin,
Tools,
UniverInstanceType,
Expand Down Expand Up @@ -65,7 +64,6 @@ export class UniverDocsUIPlugin extends Plugin {
constructor(
private readonly _config: IUniverDocsUIConfig,
@Inject(Injector) override _injector: Injector,
@Inject(LocaleService) private readonly _localeService: LocaleService,
@IRenderManagerService private readonly _renderManagerSrv: IRenderManagerService,
@ILogService private _logService: ILogService
) {
Expand All @@ -76,6 +74,10 @@ export class UniverDocsUIPlugin extends Plugin {
this._initializeCommands();
}

override onReady(): void {
this._initRenderBasics();
}

override onRendered(): void {
this._initUI();
this._initRenderModules();
Expand Down Expand Up @@ -135,11 +137,18 @@ export class UniverDocsUIPlugin extends Plugin {
this._injector.get(AppUIController);
}

private _initRenderModules(): void {
private _initRenderBasics(): void {
([
DocSkeletonManagerService,
DocRenderController,
DocZoomRenderController,
]).forEach((m) => {
this._renderManagerSrv.registerRenderModule(UniverInstanceType.UNIVER_DOC, m);
});
}

private _initRenderModules(): void {
([
DocBackScrollRenderController,
DocFloatingObjectRenderController,
DocTextSelectionRenderController,
Expand Down
Loading