Roundup fixes (#2862)

This one is a roundup of superficial changes, apologies for having them
in a single PR.

This PR:
- does some chair re-arranging for one of our hotter paths related to
updating shapes
- changes our type exports for editor components
- adds shape indicator to editor components
- moves canvas to be an editor component
- fixes a CSS bug with hinted buttons
- fixes CSS bugs with the menus
- fixes bad imports in examples

### Change Type

- [x] `major`
This commit is contained in:
Steve Ruiz 2024-02-19 14:52:43 +00:00 committed by GitHub
parent b3d6af4454
commit 9fc5f4459f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 2191 additions and 1825 deletions

View file

@ -1,19 +1,18 @@
import { TLHandle, TLShapeId } from '@tldraw/tlschema'
import classNames from 'classnames'
import { ComponentType } from 'react'
import { COARSE_HANDLE_RADIUS, HANDLE_RADIUS } from '../../constants'
/** @public */
export type TLHandleComponent = ComponentType<{
export type TLHandleProps = {
shapeId: TLShapeId
handle: TLHandle
zoom: number
isCoarse: boolean
className?: string
}>
}
/** @public */
export const DefaultHandle: TLHandleComponent = ({ handle, isCoarse, className, zoom }) => {
export function DefaultHandle({ handle, isCoarse, className, zoom }: TLHandleProps) {
const bgRadius = (isCoarse ? COARSE_HANDLE_RADIUS : HANDLE_RADIUS) / zoom
const fgRadius = (handle.type === 'create' && isCoarse ? 3 : 4) / zoom