tldraw/packages/editor
Steve Ruiz fd29006538
[feature] add meta property to records (#1627)
This PR adds a `meta` property to shapes and other records.

It adds it to:
- asset
- camera
- document
- instance
- instancePageState
- instancePresence
- page
- pointer
- rootShape

## Setting meta

This data can generally be added wherever you would normally update the
corresponding record.

An exception exists for shapes, which can be updated using a partial of
the `meta` in the same way that we update shapes with a partial of
`props`.

```ts
this.updateShapes([{
    id: myShape.id,
    type: "geo",
    meta: { 
      nemesis: "steve",
      special: true
    }
])
```

## `Editor.getInitialMetaForShape`

The `Editor.getInitialMetaForShape` method is kind of a hack to set the
initial meta property for newly created shapes. You can set it
externally. Escape hatch!

### Change Type

- [x] `minor` — New feature

### Test Plan

todo

- [ ] Unit Tests (todo)

### Release Notes

- todo
2023-06-28 14:24:05 +00:00
..
src [feature] add meta property to records (#1627) 2023-06-28 14:24:05 +00:00
api-extractor.json transfer-out: transfer out 2023-04-25 12:01:25 +01:00
api-report.md [feature] add meta property to records (#1627) 2023-06-28 14:24:05 +00:00
CHANGELOG.md Update CHANGELOG.md [skip ci] 2023-06-28 11:53:57 +01:00
editor.css Styles API follow-ups (#1636) 2023-06-24 13:46:04 +00:00
LICENSE transfer-out: transfer out 2023-04-25 12:01:25 +01:00
package.json Update CHANGELOG.md [skip ci] 2023-06-28 11:53:57 +01:00
README.md transfer-out: transfer out 2023-04-25 12:01:25 +01:00
setupTests.js Styles API follow-ups (#1636) 2023-06-24 13:46:04 +00:00
tsconfig.json Incorporate signia as @tldraw/state (#1620) 2023-06-20 13:31:26 +00:00

tldraw/tldraw

Benchmark

To run the benchmarks

yarn workspace @tldraw/tldraw benchmark

Or

yarn workspace @tldraw/tldraw benchmark "file_search_string"