diff --git a/apps/examples/src/examples/ui-components-hidden/UiComponentsHiddenExample.tsx b/apps/examples/src/examples/ui-components-hidden/UiComponentsHiddenExample.tsx index d58e118df..beabe1a70 100644 --- a/apps/examples/src/examples/ui-components-hidden/UiComponentsHiddenExample.tsx +++ b/apps/examples/src/examples/ui-components-hidden/UiComponentsHiddenExample.tsx @@ -16,6 +16,7 @@ const components: Required = { KeyboardShortcutsDialog: null, QuickActions: null, HelperButtons: null, + DebugPanel: null, DebugMenu: null, SharePanel: null, MenuPanel: null, diff --git a/packages/tldraw/api-report.md b/packages/tldraw/api-report.md index 6f06c3328..60730cd6d 100644 --- a/packages/tldraw/api-report.md +++ b/packages/tldraw/api-report.md @@ -1493,6 +1493,7 @@ export const TldrawUi: React_2.NamedExoticComponent<{ KeyboardShortcutsDialog: null | React_2.ComponentType; QuickActions: null | React_2.ComponentType; HelperButtons: null | React_2.ComponentType; + DebugPanel: null | React_2.ComponentType; DebugMenu: null | React_2.ComponentType; MenuPanel: null | React_2.ComponentType; TopPanel: null | React_2.ComponentType; @@ -2520,6 +2521,7 @@ export function useTldrawUiComponents(): Partial<{ KeyboardShortcutsDialog: ComponentType | null; QuickActions: ComponentType | null; HelperButtons: ComponentType | null; + DebugPanel: ComponentType | null; DebugMenu: ComponentType | null; MenuPanel: ComponentType | null; TopPanel: ComponentType | null; diff --git a/packages/tldraw/api/api.json b/packages/tldraw/api/api.json index 9f1417e53..332f1fa42 100644 --- a/packages/tldraw/api/api.json +++ b/packages/tldraw/api/api.json @@ -17198,7 +17198,16 @@ }, { "kind": "Content", - "text": ">;\n DebugMenu: null | " + "text": ">;\n DebugPanel: null | " + }, + { + "kind": "Reference", + "text": "React.ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": ";\n DebugMenu: null | " }, { "kind": "Reference", @@ -17639,7 +17648,7 @@ "name": "TldrawUi", "variableTypeTokenRange": { "startIndex": 1, - "endIndex": 147 + "endIndex": 149 } }, { @@ -27963,7 +27972,16 @@ }, { "kind": "Content", - "text": "> | null;\n DebugMenu: " + "text": "> | null;\n DebugPanel: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": " | null;\n DebugMenu: " }, { "kind": "Reference", @@ -28009,7 +28027,7 @@ "fileUrlPath": "packages/tldraw/src/lib/ui/context/components.tsx", "returnTypeTokenRange": { "startIndex": 1, - "endIndex": 55 + "endIndex": 57 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/packages/tldraw/src/lib/ui/TldrawUi.tsx b/packages/tldraw/src/lib/ui/TldrawUi.tsx index 99311f54d..d701d4e4b 100644 --- a/packages/tldraw/src/lib/ui/TldrawUi.tsx +++ b/packages/tldraw/src/lib/ui/TldrawUi.tsx @@ -3,7 +3,6 @@ import { Expand, useEditor, useValue } from '@tldraw/editor' import classNames from 'classnames' import React, { ReactNode } from 'react' import { TLUiAssetUrlOverrides } from './assetUrls' -import { DebugPanel } from './components/DebugPanel' import { Dialogs } from './components/Dialogs' import { FollowingIndicator } from './components/FollowingIndicator' import { ToastViewport, Toasts } from './components/Toasts' @@ -120,6 +119,7 @@ const TldrawUiContent = React.memo(function TldrawUI() { HelpMenu, NavigationPanel, HelperButtons, + DebugPanel, } = useTldrawUiComponents() useKeyboardShortcuts() @@ -168,7 +168,7 @@ const TldrawUiContent = React.memo(function TldrawUI() { {Toolbar && } {HelpMenu && } - {isDebugMode && } + {isDebugMode && DebugPanel && } )} diff --git a/packages/tldraw/src/lib/ui/components/DebugPanel.tsx b/packages/tldraw/src/lib/ui/components/DefaultDebugPanel.tsx similarity index 98% rename from packages/tldraw/src/lib/ui/components/DebugPanel.tsx rename to packages/tldraw/src/lib/ui/components/DefaultDebugPanel.tsx index 49349532e..030a0719c 100644 --- a/packages/tldraw/src/lib/ui/components/DebugPanel.tsx +++ b/packages/tldraw/src/lib/ui/components/DefaultDebugPanel.tsx @@ -3,7 +3,7 @@ import { memo, useEffect, useRef, useState } from 'react' import { useTldrawUiComponents } from '../context/components' /** @internal */ -export const DebugPanel = memo(function DebugPanel() { +export const DefaultDebugPanel = memo(function DefaultDebugPanel() { const { DebugMenu } = useTldrawUiComponents() return ( diff --git a/packages/tldraw/src/lib/ui/context/components.tsx b/packages/tldraw/src/lib/ui/context/components.tsx index c040496f2..4c09d5dff 100644 --- a/packages/tldraw/src/lib/ui/context/components.tsx +++ b/packages/tldraw/src/lib/ui/context/components.tsx @@ -9,6 +9,7 @@ import { TLUiContextMenuProps, } from '../components/ContextMenu/DefaultContextMenu' import { DefaultDebugMenu } from '../components/DebugMenu/DefaultDebugMenu' +import { DefaultDebugPanel } from '../components/DefaultDebugPanel' import { DefaultHelpMenu, TLUiHelpMenuProps } from '../components/HelpMenu/DefaultHelpMenu' import { DefaultHelperButtons, @@ -45,6 +46,7 @@ export interface BaseTLUiComponents { KeyboardShortcutsDialog: ComponentType QuickActions: ComponentType HelperButtons: ComponentType + DebugPanel: ComponentType DebugMenu: ComponentType MenuPanel: ComponentType TopPanel: ComponentType @@ -88,6 +90,7 @@ export function TldrawUiComponentsProvider({ KeyboardShortcutsDialog: DefaultKeyboardShortcutsDialog, QuickActions: DefaultQuickActions, HelperButtons: DefaultHelperButtons, + DebugPanel: DefaultDebugPanel, DebugMenu: DefaultDebugMenu, MenuPanel: DefaultMenuPanel, ..._overrides,