Adds most of text feature, except creation

This commit is contained in:
Steve Ruiz 2021-06-15 12:58:51 +01:00
parent 94fcca1685
commit 027815f199
40 changed files with 718 additions and 124 deletions

View file

@ -9,6 +9,8 @@ export default function Defs() {
const currentPageShapeIds = useSelector(({ data }) => {
return Object.values(getPage(data).shapes)
.filter(Boolean)
.filter((shape) => !getShapeUtils(shape).isForeignObject)
.sort((a, b) => a.childIndex - b.childIndex)
.map((shape) => shape.id)
}, deepCompareArrays)
@ -29,6 +31,7 @@ export default function Defs() {
const Def = memo(function Def({ id }: { id: string }) {
const shape = useSelector((s) => getPage(s.data).shapes[id])
if (!shape) return null
return getShapeUtils(shape).render(shape)
return getShapeUtils(shape).render(shape, { isEditing: false })
})