Stricter ID types (#1439)
We noticed that when inferring the type of a shape from its ID, it was getting inferred as `any` which was hiding some issues. This diff switches `BaseRecord`'s automatic ID to an explicit one, which lets us pass in our correct `TLShapeId` definition and still have it play nicely with other places. ### Change Type - [x] `patch` — Bug Fix ### Release Notes [internal only, covered by #1432 changelog] --------- Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
parent
eb26964130
commit
0375b5d86d
40 changed files with 331 additions and 286 deletions
|
@ -211,21 +211,22 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
|
|||
trackEvent('toggle-auto-size', { source })
|
||||
app.mark()
|
||||
app.updateShapes(
|
||||
(
|
||||
app.selectedShapes.filter(
|
||||
(shape) => app.isShapeOfType(shape, TLTextUtil) && shape.props.autoSize === false
|
||||
) as TLTextShape[]
|
||||
).map((shape) => {
|
||||
return {
|
||||
id: shape.id,
|
||||
type: shape.type,
|
||||
props: {
|
||||
...shape.props,
|
||||
w: 8,
|
||||
autoSize: true,
|
||||
},
|
||||
}
|
||||
})
|
||||
app.selectedShapes
|
||||
.filter(
|
||||
(shape): shape is TLTextShape =>
|
||||
app.isShapeOfType(shape, TLTextUtil) && shape.props.autoSize === false
|
||||
)
|
||||
.map((shape) => {
|
||||
return {
|
||||
id: shape.id,
|
||||
type: shape.type,
|
||||
props: {
|
||||
...shape.props,
|
||||
w: 8,
|
||||
autoSize: true,
|
||||
},
|
||||
}
|
||||
})
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue