chore(editor): hide tweakpane for turbo renderer (#10846)

This commit is contained in:
doodlewind
2025-03-14 06:47:15 +00:00
parent f3ef9c4415
commit d1c10f5401
4 changed files with 2 additions and 24 deletions

View File

@@ -18,8 +18,7 @@
"@blocksuite/store": "workspace:*",
"@types/lodash-es": "^4.17.12",
"lodash-es": "^4.17.21",
"rxjs": "^7.8.1",
"tweakpane": "^4.0.5"
"rxjs": "^7.8.1"
},
"exports": {
".": "./src/index.ts",

View File

@@ -4,10 +4,8 @@ import {
GfxControllerIdentifier,
type Viewport,
} from '@blocksuite/block-std/gfx';
import { Pane } from 'tweakpane';
import { BlockLayoutHandlersIdentifier } from './layout/block-layout-provider';
import type { ViewportTurboRendererExtension } from './turbo-renderer';
import type { BlockLayout, RenderingState, ViewportLayout } from './types';
export function syncCanvasSize(canvas: HTMLCanvasElement, host: HTMLElement) {
@@ -89,22 +87,6 @@ export function getViewportLayout(
return layout;
}
export function initTweakpane(
renderer: ViewportTurboRendererExtension,
viewportElement: HTMLElement
) {
const debugPane = new Pane({ container: viewportElement });
const paneElement = debugPane.element;
paneElement.style.position = 'absolute';
paneElement.style.top = '10px';
paneElement.style.right = '10px';
paneElement.style.width = '250px';
debugPane.title = 'Viewport Turbo Renderer';
debugPane.addButton({ title: 'Invalidate' }).on('click', () => {
renderer.invalidate();
});
}
export function debugLog(message: string, state: RenderingState) {
console.log(
`%c[ViewportTurboRenderer]%c ${message} | state=${state}`,

View File

@@ -12,7 +12,6 @@ import debounce from 'lodash-es/debounce';
import {
debugLog,
getViewportLayout,
initTweakpane,
paintPlaceholder,
syncCanvasSize,
} from './renderer-utils';
@@ -83,7 +82,6 @@ export class ViewportTurboRendererExtension extends GfxExtension {
const mountPoint = document.querySelector('.affine-edgeless-viewport');
if (mountPoint) {
mountPoint.append(this.canvas);
initTweakpane(this, mountPoint as HTMLElement);
}
const subscription = this.viewport.elementReady.subscribe(element => {