Tldraw/packages/tldraw/package.json

92 wiersze
2.3 KiB
JSON
Czysty Zwykły widok Historia

2023-04-25 11:01:25 +00:00
{
"name": "@tldraw/tldraw",
"description": "A tiny little drawing editor.",
2023-07-04 14:21:37 +00:00
"version": "2.0.0-alpha.14",
2023-04-25 11:01:25 +00:00
"packageManager": "yarn@3.5.0",
"author": {
"name": "tldraw GB Ltd.",
"email": "hello@tldraw.com"
},
"homepage": "https://tldraw.dev",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/tldraw/tldraw"
},
"bugs": {
"url": "https://github.com/tldraw/tldraw/issues"
},
"keywords": [
"tldraw",
"drawing",
"app",
"development",
"whiteboard",
"canvas",
"infinite"
],
"/* NOTE */": "These `main` and `types` fields are rewritten by the build script. They are not the actual values we publish",
"main": "./src/index.ts",
"types": "./.tsbuild/index.d.ts",
"scripts": {
"test": "lazy inherit",
2023-05-02 12:25:26 +00:00
"test-coverage": "lazy inherit",
2023-04-25 11:01:25 +00:00
"dev": "chokidar '../{editor,ui}/*.css' -c 'node ./scripts/copy-css-files.mjs' --initial",
"prebuild": "node ./scripts/copy-css-files.mjs",
"build": "yarn run -T tsx ../../scripts/build-package.ts",
2023-05-02 12:25:26 +00:00
"build-api": "yarn run -T tsx ../../scripts/build-api.ts",
2023-04-25 11:01:25 +00:00
"prepack": "yarn run -T tsx ../../scripts/prepack.ts",
"postpack": "../../scripts/postpack.sh",
"pack-tarball": "yarn pack",
"lint": "yarn run -T tsx ../../scripts/lint.ts"
},
"files": [
"tldraw.css"
2023-04-25 11:01:25 +00:00
],
"dependencies": {
"@tldraw/editor": "workspace:*",
"@tldraw/polyfills": "workspace:*",
`ShapeUtil` refactor, `Editor` cleanup (#1611) This PR improves the ergonomics of `ShapeUtil` classes. ### Cached methods First, I've remove the cached methods (such as `bounds`) from the `ShapeUtil` class and lifted this to the `Editor` class. Previously, calling `ShapeUtil.getBounds` would return the un-cached bounds of a shape, while calling `ShapeUtil.bounds` would return the cached bounds of a shape. We also had `Editor.getBounds`, which would call `ShapeUtil.bounds`. It was confusing. The cached methods like `outline` were also marked with "please don't override", which suggested the architecture was just wrong. The only weirdness from this is that utils sometimes reach out to the editor for cached versions of data rather than calling their own cached methods. It's still an easier story to tell than what we had before. ### More defaults We now have three and only three `abstract` methods for a `ShapeUtil`: - `getDefaultProps` (renamed from `defaultProps`) - `getBounds`, - `component` - `indicator` Previously, we also had `getCenter` as an abstract method, though this was usually just the middle of the bounds anyway. ### Editing bounds This PR removes the concept of editingBounds. The viewport will no longer animate to editing shapes. ### Active area manager This PR also removes the active area manager, which was not being used in the way we expected it to be. ### Dpr manager This PR removes the dpr manager and uses a hook instead to update it from React. This is one less runtime browser dependency in the app, one less thing to document. ### Moving things around This PR also continues to try to organize related methods and properties in the editor. ### Change Type - [x] `major` — Breaking change ### Release Notes - [editor] renames `defaultProps` to `getDefaultProps` - [editor] removes `outline`, `outlineSegments`, `handles`, `bounds` - [editor] renames `renderBackground` to `backgroundComponent`
2023-06-19 14:01:18 +00:00
"@tldraw/primitives": "workspace:*",
"@tldraw/store": "workspace:*",
2023-04-25 11:01:25 +00:00
"@tldraw/ui": "workspace:*"
},
"peerDependencies": {
"react": "^18",
"react-dom": "^18"
2023-04-25 11:01:25 +00:00
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.0",
"@testing-library/jest-dom": "^5.14.1",
2023-04-25 11:01:25 +00:00
"@testing-library/react": "^14.0.0",
"chokidar-cli": "^3.0.0",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^28.1.2",
2023-06-05 17:32:32 +00:00
"lazyrepo": "0.0.0-alpha.27",
2023-04-25 11:01:25 +00:00
"resize-observer-polyfill": "^1.5.1"
},
"jest": {
"preset": "config/jest/node",
"testEnvironment": "jsdom",
"fakeTimers": {
"enableGlobally": true
},
"testPathIgnorePatterns": [
"^.+\\.*.css$"
],
"transformIgnorePatterns": [
"node_modules/(?!(nanoid|escape-string-regexp)/)"
],
"moduleNameMapper": {
"^~(.*)": "<rootDir>/src/$1",
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
},
"setupFiles": [
"raf/polyfill",
"<rootDir>/setupTests.js"
],
"setupFilesAfterEnv": [
"../../config/setupJest.ts"
]
}
}