collaboration Drawing app
 
 
 
Go to file
Mitja Bezenšek 6bd7f4fcc9
Allow dragging on top of locked shapes. (#2337)
This PR allows dragging a selection on top of a locked shape. This
should work when clicking inside of the selection, but not directly on a
shape.

Before:


https://github.com/tldraw/tldraw/assets/2523721/53583ae9-9ed7-455e-bdc4-ba13804dd8a3

After:


https://github.com/tldraw/tldraw/assets/2523721/81d8f8bf-5474-4a09-abac-75059a089851



Fixes https://github.com/tldraw/tldraw/issues/2316
Fixes https://github.com/tldraw/tldraw/issues/2315

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Create a big shape and lock it.
2. Create two shapes on top of the locked shape and select them.
3. Start dragging the selected shapes by clicking inside the selection
(but not directly on any of the shapes). This should allow you to
translate the selection.
4. Should also work if the shapes are behind the locked shape.

- [x] Unit Tests
- [ ] End to end tests

### Release Notes

- Allow translating of shapes on top of a locked shape by clicking
inside of selection and moving the mouse.
2023-12-19 10:40:50 +00:00
.github Revert "zoom to affected shapes after undo/redo" (#2310) 2023-12-12 11:36:52 +00:00
.husky
.yarn
apps VS Code 2.0.19 (#2324) 2023-12-14 08:49:10 +00:00
assets Lokalise: Translations update (#2342) 2023-12-19 10:33:17 +00:00
config
packages Allow dragging on top of locked shapes. (#2337) 2023-12-19 10:40:50 +00:00
scripts
.eslintignore
.eslintplugin.js
.eslintrc.js
.gitignore
.ignore
.prettierignore
.prettierrc
.yarnrc.yml
CHANGELOG.md Update CHANGELOG.md [skip ci] 2023-12-12 14:50:43 +00:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
lazy.config.ts
lerna.json Start scrolling if we are dragging close to the window edges. (#2299) 2023-12-15 23:37:03 +00:00
package.json
public-yarn.lock
vercel.json

README.md

tldraw

tldraw

Welcome to the public monorepo for tldraw.

What is tldraw?

tldraw is a collaborative digital whiteboard available at tldraw.com. Its editor, user interface, and other underlying libraries are open source and available in this repository. They are also distributed on npm. You can use tldraw to create a drop-in whiteboard for your product or as the foundation on which to build your own infinite canvas applications.

Learn more at tldraw.dev.

Note This repo contains source code for the current version of tldraw. You can find the source for the original version here.

Installation & Usage

To learn more about using tldraw in your React application, follow our guide here or see the examples sandbox.

import { Tldraw } from '@tldraw/tldraw'
import '@tldraw/tldraw/tldraw.css'

export default function () {
	return (
		<div style={{ position: 'fixed', inset: 0 }}>
			<Tldraw />
		</div>
	)
}

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.

Examples

Our development server contains several examples that demonstrates different ways that you can customize tldraw or use its APIs. Each example is found in the apps/examples folder.

  • eg: localhost:5420 for the basic example.
  • eg: localhost:5420/api for the API example.

To learn more about using tldraw, visit our docs.

About this repository

Top-level layout

This repository's contents is divided across four primary sections:

  • /apps contains the source for our applications
  • /packages contains the source for our public packages
  • /scripts contains scripts used for building and publishing
  • /assets contains icons and translations relied on by the app
  • /docs contains the content for our docs site at tldraw.dev

Applications

Packages

  • assets: a library for working with tldraw's fonts and translations
  • editor: the tldraw editor
  • state: a signals library, also known as signia
  • store: an in-memory reactive database
  • tldraw: the main tldraw package containing both the editor and the UI
  • tlschema: shape definitions and migrations
  • utils: low-level data utilities shared by other libraries
  • validate: a validation library used for run-time validation

Community

Have questions, comments or feedback? Join our discord or start a discussion.

Distributions

You can find tldraw on npm here.

At the moment the tldraw package is in alpha. We also ship a canary version which is always up to date with the main branch of this repo.

License

The source code for various apps and packages in this repository (as well as our 2.0+ distributions and releases) are currently licensed under Apache-2.0. These licenses are subject to change in our upcoming 2.0 release. If you are planning to use tldraw in a commercial product, please reach out at hello@tldraw.com.

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.