@edv4h/usketch-shape-utils 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/gpu.d.ts +0 -6
- package/dist/gpu.d.ts.map +0 -1
- package/dist/gpu.js +0 -50
- package/dist/gpu.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { getBounds } from "./bounds.js";
|
|
2
|
-
export { ellipseGpuPrimitive, lineGpuPrimitive, rectGpuPrimitive, roundedRectGpuPrimitive, } from "./gpu.js";
|
|
3
2
|
export { aabbHitTest, ellipseHitTest, lineHitTest, pointInPolygon } from "./hit-test.js";
|
|
4
3
|
export { createResize } from "./resize.js";
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { getBounds } from "./bounds.js";
|
|
2
|
-
export { ellipseGpuPrimitive, lineGpuPrimitive, rectGpuPrimitive, roundedRectGpuPrimitive, } from "./gpu.js";
|
|
3
2
|
export { aabbHitTest, ellipseHitTest, lineHitTest, pointInPolygon } from "./hit-test.js";
|
|
4
3
|
export { createResize } from "./resize.js";
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edv4h/usketch-shape-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@edv4h/usketch-shared": "
|
|
15
|
+
"@edv4h/usketch-shared": "2.0.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"typescript": "5.9.3",
|
package/dist/gpu.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type GpuPrimitive, type ShapeData } from "@edv4h/usketch-shared";
|
|
2
|
-
export declare function rectGpuPrimitive(data: ShapeData): GpuPrimitive;
|
|
3
|
-
export declare function roundedRectGpuPrimitive(data: ShapeData): GpuPrimitive;
|
|
4
|
-
export declare function ellipseGpuPrimitive(data: ShapeData): GpuPrimitive;
|
|
5
|
-
export declare function lineGpuPrimitive(data: ShapeData): GpuPrimitive;
|
|
6
|
-
//# sourceMappingURL=gpu.d.ts.map
|
package/dist/gpu.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gpu.d.ts","sourceRoot":"","sources":["../src/gpu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEnG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAW9D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAYrE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAUjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAW9D"}
|
package/dist/gpu.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { cssColorToRgbaOrDefault } from "@edv4h/usketch-shared";
|
|
2
|
-
export function rectGpuPrimitive(data) {
|
|
3
|
-
return {
|
|
4
|
-
kind: "rect",
|
|
5
|
-
bounds: { x: data.x, y: data.y, width: data.width, height: data.height },
|
|
6
|
-
cornerRadius: data.cornerRadius ?? 0,
|
|
7
|
-
fill: cssColorToRgbaOrDefault(data.style.fill),
|
|
8
|
-
stroke: cssColorToRgbaOrDefault(data.style.stroke),
|
|
9
|
-
strokeWidth: data.style.strokeWidth,
|
|
10
|
-
opacity: data.style.opacity,
|
|
11
|
-
rotation: data.rotation,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function roundedRectGpuPrimitive(data) {
|
|
15
|
-
const cornerRadius = Math.min(data.width, data.height) / 4;
|
|
16
|
-
return {
|
|
17
|
-
kind: "rect",
|
|
18
|
-
bounds: { x: data.x, y: data.y, width: data.width, height: data.height },
|
|
19
|
-
cornerRadius,
|
|
20
|
-
fill: cssColorToRgbaOrDefault(data.style.fill),
|
|
21
|
-
stroke: cssColorToRgbaOrDefault(data.style.stroke),
|
|
22
|
-
strokeWidth: data.style.strokeWidth,
|
|
23
|
-
opacity: data.style.opacity,
|
|
24
|
-
rotation: data.rotation,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function ellipseGpuPrimitive(data) {
|
|
28
|
-
return {
|
|
29
|
-
kind: "ellipse",
|
|
30
|
-
bounds: { x: data.x, y: data.y, width: data.width, height: data.height },
|
|
31
|
-
fill: cssColorToRgbaOrDefault(data.style.fill),
|
|
32
|
-
stroke: cssColorToRgbaOrDefault(data.style.stroke),
|
|
33
|
-
strokeWidth: data.style.strokeWidth,
|
|
34
|
-
opacity: data.style.opacity,
|
|
35
|
-
rotation: data.rotation,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export function lineGpuPrimitive(data) {
|
|
39
|
-
const vertices = new Float32Array([data.x, data.y, data.x + data.width, data.y + data.height]);
|
|
40
|
-
return {
|
|
41
|
-
kind: "polyline",
|
|
42
|
-
bounds: { x: data.x, y: data.y, width: data.width, height: data.height },
|
|
43
|
-
vertices,
|
|
44
|
-
fill: [0, 0, 0, 0],
|
|
45
|
-
stroke: cssColorToRgbaOrDefault(data.style.stroke),
|
|
46
|
-
strokeWidth: data.style.strokeWidth,
|
|
47
|
-
opacity: data.style.opacity,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=gpu.js.map
|
package/dist/gpu.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gpu.js","sourceRoot":"","sources":["../src/gpu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAqC,MAAM,uBAAuB,CAAC;AAEnG,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC/C,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EA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