[refactor] Remove TLShapeDef
, getShapeUtilByType
. (#1432)
This PR removes `TLShapeDef` and associated helpers / references. It purposely loosens the configuration and typings to better support customization. ### Change Type - [x] `major` — Breaking Change ### Test Plan 1. Use the app! ### Release Notes - [tlschema] Update props of `createTLSchema` - [editor] Update props of `TldrawEditorConfig` - [editor] Remove `App.getShapeUtilByType` - [editor] Update `App.getShapeUtil` to take a type rather than a shape --------- Co-authored-by: alex <alex@dytry.ch>
This commit is contained in:
parent
3ce18c0c31
commit
649125cdad
55 changed files with 527 additions and 690 deletions
|
@ -1,4 +1,4 @@
|
|||
import { App, TLArrowShapeDef, useApp } from '@tldraw/editor'
|
||||
import { App, TLArrowUtil, useApp } from '@tldraw/editor'
|
||||
import { assert, exhaustiveSwitchError } from '@tldraw/utils'
|
||||
import { useValue } from 'signia-react'
|
||||
import { ActionItem } from './useActions'
|
||||
|
@ -136,10 +136,10 @@ function shapesWithUnboundArrows(app: App) {
|
|||
|
||||
return selectedShapes.filter((shape) => {
|
||||
if (!shape) return false
|
||||
if (TLArrowShapeDef.is(shape) && shape.props.start.type === 'binding') {
|
||||
if (app.isShapeOfType(shape, TLArrowUtil) && shape.props.start.type === 'binding') {
|
||||
return false
|
||||
}
|
||||
if (TLArrowShapeDef.is(shape) && shape.props.end.type === 'binding') {
|
||||
if (app.isShapeOfType(shape, TLArrowUtil) && shape.props.end.type === 'binding') {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue