diff --git a/packages/editor/editor.css b/packages/editor/editor.css index 2c668be97..3b25671f6 100644 --- a/packages/editor/editor.css +++ b/packages/editor/editor.css @@ -41,7 +41,6 @@ --layer-collaborator-cursor: 130; --layer-grid: 150; --layer-culled-shapes: 175; - --layer-canvas: 200; --layer-shapes: 300; --layer-overlays: 400; --layer-in-front-overlay: 500; @@ -257,7 +256,6 @@ input, height: 100%; width: 100%; color: var(--color-text); - z-index: var(--layer-canvas); cursor: var(--tl-cursor); overflow: clip; content-visibility: auto; @@ -313,17 +311,6 @@ input, pointer-events: none; } -.tl-front { - z-index: var(--layer-in-front); - position: absolute; - inset: 0px; - height: 100%; - width: 100%; - overflow: clip; - content-visibility: auto; - touch-action: none; - pointer-events: none; -} /* ------------------- Background ------------------- */ .tl-background__wrapper { @@ -1068,7 +1055,7 @@ input, display: flex; align-items: center; justify-content: center; - z-index: var(--layer-canvas); + z-index: 200; font-size: 12px; font-weight: 400; color: var(--color-text-1); diff --git a/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx b/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx index 99e650898..668abd686 100644 --- a/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx +++ b/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx @@ -125,53 +125,62 @@ export function DefaultCanvas({ className }: TLCanvasComponentProps) { ) return ( -
- - - {shapeSvgDefs} - - - {SvgDefs && } - - - {Background && ( -
- + <> +
+ + + {shapeSvgDefs} + + + {SvgDefs && } + + + {Background && ( +
+ +
+ )} + +
+ + + {hideShapes ? null : debugSvg ? : }
- )} - -
- - - {hideShapes ? null : debugSvg ? : } -
-
-
- {debugGeometry ? : null} - - - - - - - - - +
+
+ {debugGeometry ? : null} + + + + + + + + + +
+
- -
+ + ) } +function InFrontOfTheCanvasWrapper() { + const { InFrontOfTheCanvas } = useEditorComponents() + if (!InFrontOfTheCanvas) return null + return +} + function GridWrapper() { const editor = useEditor() const gridSize = useValue('gridSize', () => editor.getDocumentSettings().gridSize, [editor]) diff --git a/packages/tldraw/src/lib/ui/TldrawUi.tsx b/packages/tldraw/src/lib/ui/TldrawUi.tsx index 637eb223b..37f42a4c1 100644 --- a/packages/tldraw/src/lib/ui/TldrawUi.tsx +++ b/packages/tldraw/src/lib/ui/TldrawUi.tsx @@ -1,4 +1,4 @@ -import { useEditor, useEditorComponents, useValue } from '@tldraw/editor' +import { useEditor, useValue } from '@tldraw/editor' import classNames from 'classnames' import React, { ReactNode } from 'react' import { TLUiAssetUrlOverrides } from './assetUrls' @@ -87,21 +87,10 @@ const TldrawUiInner = React.memo(function TldrawUiInner({ <> {children} {hideUi ? null : } - ) }) -function InFrontOfTheCanvasWrapper() { - const { InFrontOfTheCanvas } = useEditorComponents() - if (!InFrontOfTheCanvas) return null - return ( -
- -
- ) -} - const TldrawUiContent = React.memo(function TldrawUI() { const editor = useEditor() const msg = useTranslation()