mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
chore(editor): hide tweakpane for turbo renderer (#10846)
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user