25328f98d0
In #2198, we introduced a regression on ios around image exports. ios will block copys if they're not called syncronously in a UI event. It's important to make ios copys like this: ```ts navigator.clipboard.write(new ClipboardItem(getStuffToCopyAsAPromise()) ``` instead of ```ts getStuffToCopyAsAPromise().then(stuff => { navigator.clipboard.write(new ClipboardItem(stuff)) }) ``` We've written and fixed this bug a few times, which i think is because of how our export/copy code is written: the formatting is interspersed with interacting with the browser APIs, which makes it hard to change one without accidentally affecting the other. This diff fixes the bug, but also restructures our export/copy code: all the formatting is handled by `exportToBlob` and related which just return `Blob`s. This leaves `copyAs`, `exportAs` etc. to just handle interacting with the browser APIs. Fixes #2312 ### Change Type - [x] `patch` — Bug fix ### Test Plan 1. Test copy/export as on all browsers ### Release Notes - Fix a bug preventing copying as an image on iOS --------- Co-authored-by: huppy-bot[bot] <128400622+huppy-bot[bot]@users.noreply.github.com> |
||
---|---|---|
.github | ||
.husky | ||
.yarn | ||
apps | ||
assets | ||
config | ||
packages | ||
scripts | ||
.eslintignore | ||
.eslintplugin.js | ||
.eslintrc.js | ||
.gitignore | ||
.ignore | ||
.prettierignore | ||
.prettierrc | ||
.yarnrc.yml | ||
CHANGELOG.md | ||
CLA.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
lazy.config.ts | ||
lerna.json | ||
LICENSE.md | ||
package.json | ||
public-yarn.lock | ||
README.md | ||
TRADEMARKS.md | ||
vercel.json |
tldraw
Welcome to the public monorepo for tldraw. tldraw is an open source library for creating infinite canvas experiences in React. It's the software behind the digital whiteboard tldraw.com.
👉 Read the docs and learn more at tldraw.dev.
Local development
To run the local development server, first clone this repo.
Install dependencies:
yarn
Start the local development server:
yarn dev
Open the example project at localhost:5420
.
License
tldraw's source code and distributed packages are provided under the non-commercial tldraw license.
This license does not permit commercial use. If you wish to use tldraw in a commercial product or enterprise, you will need to purchase a commercial license. To obtain a commercial license, please contact us at hello@tldraw.com.
To learn more, see our license page.
Trademarks
The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.
Community
Have questions, comments or feedback? Join our discord or start a discussion.
Contribution
Please see our contributing guide. Found a bug? Please submit an issue.
Contact
Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.