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
@@ -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",
@@ -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}`,
@@ -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 => {
+1 -2
View File
@@ -2907,7 +2907,6 @@ __metadata:
"@types/lodash-es": "npm:^4.17.12"
lodash-es: "npm:^4.17.21"
rxjs: "npm:^7.8.1"
tweakpane: "npm:^4.0.5"
languageName: unknown
linkType: soft
@@ -32216,7 +32215,7 @@ __metadata:
languageName: node
linkType: hard
"tweakpane@npm:^4.0.4, tweakpane@npm:^4.0.5":
"tweakpane@npm:^4.0.4":
version: 4.0.5
resolution: "tweakpane@npm:4.0.5"
checksum: 10/7719a15ce96dd2b936b277239ccb18ee6a75ed2416a6bdacfc537515d909da6edd50161b12e91441ace5243efad3a14a98fe6e5475cae2617d7647a197117e64