New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More โ†’
Socket
Sign inDemoInstall
Socket

@tldraw/primitives

Package Overview
Dependencies
Maintainers
4
Versions
461
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tldraw/primitives - npm Package Compare versions

Comparing version

to
2.0.0-canary.f07b91571698

dist-cjs/index.d.ts

88

CHANGELOG.md

@@ -0,1 +1,89 @@

# v2.0.0-alpha.13 (Wed Jun 28 2023)
### Release Notes
#### [refactor] snapping ([#1589](https://github.com/tldraw/tldraw/pull/1589))
- [editor] fix bug in snapping
#### Fix arrows with weird bends crashing ([#1540](https://github.com/tldraw/tldraw/pull/1540))
- Fixed a rare crash that could happen when you try to curve an arrow with zero distance.
#### [2/3] renderer changes to support "sandwich mode" highlighting ([#1418](https://github.com/tldraw/tldraw/pull/1418))
[not yet!]
#### Measure individual words instead of just line breaks for text exports ([#1397](https://github.com/tldraw/tldraw/pull/1397))
- Add a brief release note for your PR here.
#### avoid lazy race conditions ([#1364](https://github.com/tldraw/tldraw/pull/1364))
[internal only]
---
#### ๐Ÿš€ Enhancement
- [2/3] renderer changes to support "sandwich mode" highlighting [#1418](https://github.com/tldraw/tldraw/pull/1418) ([@SomeHats](https://github.com/SomeHats))
#### ๐Ÿ› Bug Fix
- [refactor] snapping [#1589](https://github.com/tldraw/tldraw/pull/1589) ([@steveruizok](https://github.com/steveruizok))
- Fix arrows with weird bends crashing [#1540](https://github.com/tldraw/tldraw/pull/1540) ([@TodePond](https://github.com/TodePond))
- ensure that fixed points stay fixed [#1523](https://github.com/tldraw/tldraw/pull/1523) ([@steveruizok](https://github.com/steveruizok))
- Measure individual words instead of just line breaks for text exports [#1397](https://github.com/tldraw/tldraw/pull/1397) ([@SomeHats](https://github.com/SomeHats))
- readmes [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@steveruizok](https://github.com/steveruizok))
- [chore] update lazyrepo [#1211](https://github.com/tldraw/tldraw/pull/1211) ([@ds300](https://github.com/ds300))
- Use `strokePathData` for `<ShapeFill/>` path to avoid bugs in the inner path algo [#1207](https://github.com/tldraw/tldraw/pull/1207) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok))
- [lite] upgrade lazyrepo [#1198](https://github.com/tldraw/tldraw/pull/1198) ([@ds300](https://github.com/ds300))
- transfer-out: transfer out [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats))
#### โš ๏ธ Pushed to `main`
- update lazyrepo ([@ds300](https://github.com/ds300))
#### ๐Ÿ  Internal
- replace console.log with nicelog [#1496](https://github.com/tldraw/tldraw/pull/1496) ([@steveruizok](https://github.com/steveruizok))
- [chore] remove benchmark [#1489](https://github.com/tldraw/tldraw/pull/1489) ([@steveruizok](https://github.com/steveruizok))
- avoid lazy race conditions [#1364](https://github.com/tldraw/tldraw/pull/1364) ([@SomeHats](https://github.com/SomeHats))
#### Authors: 5
- alex ([@SomeHats](https://github.com/SomeHats))
- David Sheldrick ([@ds300](https://github.com/ds300))
- Lu Wilson ([@TodePond](https://github.com/TodePond))
- Orange Mug ([@orangemug](https://github.com/orangemug))
- Steve Ruiz ([@steveruizok](https://github.com/steveruizok))
---
# v2.0.0-alpha.12 (Mon Apr 03 2023)
#### ๐Ÿ› Bug Fix
- Make sure all types and build stuff get run in CI [#1548](https://github.com/tldraw/tldraw-lite/pull/1548) ([@SomeHats](https://github.com/SomeHats))
- add pre-commit api report generation [#1517](https://github.com/tldraw/tldraw-lite/pull/1517) ([@SomeHats](https://github.com/SomeHats))
- Fix back to content button. [#1519](https://github.com/tldraw/tldraw-lite/pull/1519) ([@MitjaBezensek](https://github.com/MitjaBezensek) [@steveruizok](https://github.com/steveruizok))
- [chore] restore api extractor [#1500](https://github.com/tldraw/tldraw-lite/pull/1500) ([@steveruizok](https://github.com/steveruizok))
- David/publish good [#1488](https://github.com/tldraw/tldraw-lite/pull/1488) ([@ds300](https://github.com/ds300))
- [chore] alpha 10 [#1486](https://github.com/tldraw/tldraw-lite/pull/1486) ([@ds300](https://github.com/ds300))
- [chore] package build improvements [#1484](https://github.com/tldraw/tldraw-lite/pull/1484) ([@ds300](https://github.com/ds300))
- [chore] bump for alpha 8 [#1485](https://github.com/tldraw/tldraw-lite/pull/1485) ([@steveruizok](https://github.com/steveruizok))
- stop using broken-af turbo for publishing [#1476](https://github.com/tldraw/tldraw-lite/pull/1476) ([@ds300](https://github.com/ds300))
- [chore] add canary release script [#1423](https://github.com/tldraw/tldraw-lite/pull/1423) ([@ds300](https://github.com/ds300) [@steveruizok](https://github.com/steveruizok))
- [chore] upgrade yarn [#1430](https://github.com/tldraw/tldraw-lite/pull/1430) ([@ds300](https://github.com/ds300))
- repo cleanup [#1426](https://github.com/tldraw/tldraw-lite/pull/1426) ([@steveruizok](https://github.com/steveruizok))
#### Authors: 4
- alex ([@SomeHats](https://github.com/SomeHats))
- David Sheldrick ([@ds300](https://github.com/ds300))
- Mitja Bezenลกek ([@MitjaBezensek](https://github.com/MitjaBezensek))
- Steve Ruiz ([@steveruizok](https://github.com/steveruizok))
---
# @tldraw/primitives

@@ -2,0 +90,0 @@

103

dist-cjs/index.js

@@ -6,2 +6,6 @@ "use strict";

var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {

@@ -15,7 +19,102 @@ if (from && typeof from === "object" || typeof from === "function") {

};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export(src_exports, {
Box2d: () => import_Box2d.Box2d,
CubicSegment2d: () => import_CubicSegment2d.CubicSegment2d,
CubicSpline2d: () => import_CubicSpline2d.CubicSpline2d,
EASINGS: () => import_easings.EASINGS,
EPSILON: () => import_utils.EPSILON,
LineSegment2d: () => import_LineSegment2d.LineSegment2d,
Matrix2d: () => import_Matrix2d.Matrix2d,
PI: () => import_utils.PI,
PI2: () => import_utils.PI2,
Polyline2d: () => import_Polyline2d.Polyline2d,
ROTATE_CORNER_TO_SELECTION_CORNER: () => import_Box2d.ROTATE_CORNER_TO_SELECTION_CORNER,
SIN: () => import_utils.SIN,
TAU: () => import_utils.TAU,
Vec2d: () => import_Vec2d.Vec2d,
angleDelta: () => import_utils.angleDelta,
approximately: () => import_utils.approximately,
areAnglesCompatible: () => import_utils.areAnglesCompatible,
canolicalizeRotation: () => import_utils.canolicalizeRotation,
clamp: () => import_utils.clamp,
clampRadians: () => import_utils.clampRadians,
decomposeMatrix2d: () => import_Matrix2d.decomposeMatrix2d,
degreesToRadians: () => import_utils.degreesToRadians,
flipSelectionHandleX: () => import_Box2d.flipSelectionHandleX,
flipSelectionHandleY: () => import_Box2d.flipSelectionHandleY,
getArcLength: () => import_utils.getArcLength,
getDrawLinePathData: () => import_polygon_helpers.getDrawLinePathData,
getHeight: () => import_utils.getHeight,
getMaxX: () => import_utils.getMaxX,
getMaxY: () => import_utils.getMaxY,
getMidX: () => import_utils.getMidX,
getMidY: () => import_utils.getMidY,
getMinX: () => import_utils.getMinX,
getMinY: () => import_utils.getMinY,
getPointOnCircle: () => import_utils.getPointOnCircle,
getPolygonVertices: () => import_utils.getPolygonVertices,
getRoundedInkyPolygonPath: () => import_polygon_helpers.getRoundedInkyPolygonPath,
getRoundedPolygonPoints: () => import_polygon_helpers.getRoundedPolygonPoints,
getStarBounds: () => import_utils.getStarBounds,
getStroke: () => import_getStroke.getStroke,
getStrokeOutlinePoints: () => import_getStrokeOutlinePoints.getStrokeOutlinePoints,
getStrokePoints: () => import_getStrokePoints.getStrokePoints,
getSweep: () => import_utils.getSweep,
getWidth: () => import_utils.getWidth,
intersectCircleCircle: () => import_intersect.intersectCircleCircle,
intersectCirclePolygon: () => import_intersect.intersectCirclePolygon,
intersectCirclePolyline: () => import_intersect.intersectCirclePolyline,
intersectLineSegmentCircle: () => import_intersect.intersectLineSegmentCircle,
intersectLineSegmentLineSegment: () => import_intersect.intersectLineSegmentLineSegment,
intersectLineSegmentPolygon: () => import_intersect.intersectLineSegmentPolygon,
intersectLineSegmentPolyline: () => import_intersect.intersectLineSegmentPolyline,
intersectPolygonBounds: () => import_intersect.intersectPolygonBounds,
intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
isAngleBetween: () => import_utils.isAngleBetween,
isSafeFloat: () => import_utils.isSafeFloat,
isSelectionCorner: () => import_Box2d.isSelectionCorner,
lerpAngles: () => import_utils.lerpAngles,
linesIntersect: () => import_intersect.linesIntersect,
longAngleDist: () => import_utils.longAngleDist,
perimeterOfEllipse: () => import_utils.perimeterOfEllipse,
pointInBounds: () => import_utils.pointInBounds,
pointInCircle: () => import_utils.pointInCircle,
pointInEllipse: () => import_utils.pointInEllipse,
pointInPolygon: () => import_utils.pointInPolygon,
pointInPolyline: () => import_utils.pointInPolyline,
pointInRect: () => import_utils.pointInRect,
pointNearToLineSegment: () => import_utils.pointNearToLineSegment,
pointNearToPolyline: () => import_utils.pointNearToPolyline,
polygonsIntersect: () => import_intersect.polygonsIntersect,
radiansToDegrees: () => import_utils.radiansToDegrees,
rangeIntersection: () => import_utils.rangeIntersection,
rangesOverlap: () => import_utils.rangesOverlap,
rotateSelectionHandle: () => import_Box2d.rotateSelectionHandle,
setStrokePointRadii: () => import_setStrokePointRadii.setStrokePointRadii,
shortAngleDist: () => import_utils.shortAngleDist,
simplify: () => import_utils.simplify,
simplify2: () => import_utils.simplify2,
snapAngle: () => import_utils.snapAngle,
toDomPrecision: () => import_utils.toDomPrecision,
toFixed: () => import_utils.toFixed,
toPrecision: () => import_utils.toPrecision
});
module.exports = __toCommonJS(src_exports);
__reExport(src_exports, require("./lib"), module.exports);
var import_Box2d = require("./lib/Box2d");
var import_CubicSegment2d = require("./lib/CubicSegment2d");
var import_CubicSpline2d = require("./lib/CubicSpline2d");
var import_LineSegment2d = require("./lib/LineSegment2d");
var import_Matrix2d = require("./lib/Matrix2d");
var import_Polyline2d = require("./lib/Polyline2d");
var import_Vec2d = require("./lib/Vec2d");
var import_easings = require("./lib/easings");
var import_getStroke = require("./lib/freehand/getStroke");
var import_getStrokeOutlinePoints = require("./lib/freehand/getStrokeOutlinePoints");
var import_getStrokePoints = require("./lib/freehand/getStrokePoints");
var import_setStrokePointRadii = require("./lib/freehand/setStrokePointRadii");
var import_intersect = require("./lib/intersect");
var import_polygon_helpers = require("./lib/polygon-helpers");
var import_utils = require("./lib/utils");
//# sourceMappingURL=index.js.map

19

package.json
{
"name": "@tldraw/primitives",
"description": "A tiny little drawing app (primitives).",
"version": "2.0.0-canary.ee58578a",
"version": "2.0.0-canary.f07b91571698",
"packageManager": "yarn@3.5.0",
"author": {

@@ -29,15 +30,18 @@ "name": "tldraw GB Ltd.",

"files": [
"dist/**/*"
"dist-esm",
"dist-cjs",
"src"
],
"scripts": {
"test": "yarn run -T jest",
"test:coverage": "yarn run -T jest --coverage",
"typecheck": "yarn run -T tsc --build",
"test": "lazy inherit",
"test-coverage": "lazy inherit",
"build": "yarn run -T tsx ../../scripts/build-package.ts",
"build-api": "yarn run -T tsx ../../scripts/build-api.ts",
"prepack": "yarn run -T tsx ../../scripts/prepack.ts",
"postpack": "../../scripts/postpack.sh",
"pack-tarball": "yarn pack",
"lint": "yarn run -T tsx ../../scripts/lint.ts"
},
"dependencies": {
"@tldraw/tlschema": "2.0.0-canary.ee58578a"
"@tldraw/tlschema": "2.0.0-canary.f07b91571698"
},

@@ -53,2 +57,5 @@ "jest": {

},
"devDependencies": {
"lazyrepo": "0.0.0-alpha.27"
},
"module": "dist-esm/index.mjs",

@@ -55,0 +62,0 @@ "source": "src/index.ts",

# @tldraw/primitives
## License
The source code 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](mailto://hello@tldraw.com).

Sorry, the diff of this file is not supported yet