@weasel-js/core 1.4.3 → 1.5.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +1299 -2197
  2. package/README.md +118 -75
  3. package/dist/{pointSnapToGrid-D1bRdq-j.d.ts → autoPoseDescriptor-CvjflWJK.d.ts} +35 -17
  4. package/dist/{chunk-ORZNKVXM.js → chunk-BDWAA634.js} +4 -22
  5. package/dist/chunk-BDWAA634.js.map +1 -0
  6. package/dist/{chunk-WYPSGIYS.js → chunk-MG7OXCAI.js} +4149 -5316
  7. package/dist/chunk-MG7OXCAI.js.map +1 -0
  8. package/dist/{chunk-BLJNRMKB.js → chunk-MQI4PIX3.js} +3 -3
  9. package/dist/chunk-MQI4PIX3.js.map +1 -0
  10. package/dist/{chunk-SBFC6J3C.js → chunk-UCPV7JXC.js} +201 -256
  11. package/dist/chunk-UCPV7JXC.js.map +1 -0
  12. package/dist/clipboard.d.ts +2 -3
  13. package/dist/clone.d.ts +3 -2
  14. package/dist/depSchema-nMqj_qTM.d.ts +3490 -0
  15. package/dist/{grid-Bw8cSde-.d.ts → grid-BrIa38gG.d.ts} +7 -23
  16. package/dist/index.d.ts +2134 -1210
  17. package/dist/index.js +4 -5
  18. package/dist/insert.d.ts +4 -4
  19. package/dist/insert.js +1 -1
  20. package/dist/move.d.ts +5 -6
  21. package/dist/move.js +3 -6
  22. package/dist/move.js.map +1 -1
  23. package/dist/{options-DYfUlZxk.d.ts → options-BDyCnrp8.d.ts} +3 -2
  24. package/dist/poseDescriptor-CGOgIgf8.d.ts +134 -0
  25. package/dist/renderer.d.ts +10 -4
  26. package/dist/renderer.js +4 -5
  27. package/dist/resize.d.ts +10 -11
  28. package/dist/resize.js +2 -2
  29. package/dist/routing.d.ts +1 -142
  30. package/dist/routing.js +1 -1
  31. package/dist/routing.js.map +1 -1
  32. package/dist/{types-BJqsTlXl.d.ts → types-DMyo7dnM.d.ts} +12 -41
  33. package/dist/{types-CoVTbo_y.d.ts → types-DtjCJA5r.d.ts} +10 -9
  34. package/package.json +13 -10
  35. package/dist/DrawCommand-CD-ug3d9.d.ts +0 -332
  36. package/dist/builtins-CtGORLCG.d.ts +0 -740
  37. package/dist/chunk-BLJNRMKB.js.map +0 -1
  38. package/dist/chunk-LEURURX3.js +0 -561
  39. package/dist/chunk-LEURURX3.js.map +0 -1
  40. package/dist/chunk-ORZNKVXM.js.map +0 -1
  41. package/dist/chunk-SBFC6J3C.js.map +0 -1
  42. package/dist/chunk-WYPSGIYS.js.map +0 -1
  43. package/dist/geometry-CHR36Ub_.d.ts +0 -114
  44. package/dist/path-JEV2c5If.d.ts +0 -48
  45. package/dist/registry-DnoTWGED.d.ts +0 -4003
  46. package/dist/types-BHK2dkMu.d.ts +0 -172
  47. package/dist/types-H7o6MaPo.d.ts +0 -512
  48. package/dist/view-DSQgxBJB.d.ts +0 -63
@@ -1,63 +0,0 @@
1
- /** Pan offset (in pixels) plus per-axis zoom (pixels per content unit). */
2
- interface ViewTransform {
3
- panX: number;
4
- panY: number;
5
- zoom: {
6
- x: number;
7
- y: number;
8
- };
9
- }
10
- /** Project a world-space point to screen-space pixels through a `ViewTransform`. */
11
- declare function worldToScreen(worldX: number, worldY: number, view: ViewTransform): [number, number];
12
- /** Inverse of `worldToScreen` — recover the world-space point under a screen-space pixel. */
13
- declare function screenToWorld(screenX: number, screenY: number, view: ViewTransform): [number, number];
14
-
15
- /**
16
- * Viewport state. `(view.x, view.y)` is the **world point currently
17
- * rendered at the canvas top-left**; `view.scale.x` / `view.scale.y` is
18
- * pixels per world unit on each axis (default `{ x: 1, y: 1 }`). So:
19
- *
20
- * screenX = (worldX - view.x) * view.scale.x
21
- * screenY = (worldY - view.y) * view.scale.y
22
- * worldX = screenX / view.scale.x + view.x
23
- * worldY = screenY / view.scale.y + view.y
24
- *
25
- * `scale` is always a 2-vector. Input convenience types
26
- * {@link ZoomFactor} and {@link ZoomBound} let callers pass a scalar
27
- * when they want both axes treated the same.
28
- */
29
- interface View {
30
- x: number;
31
- y: number;
32
- scale: {
33
- x: number;
34
- y: number;
35
- };
36
- }
37
- /**
38
- * Input convenience for zoom primitives. A `number` is treated as a
39
- * uniform factor applied to both axes; a `{x, y}` vector applies
40
- * per-axis factors.
41
- */
42
- type ZoomFactor = number | {
43
- x: number;
44
- y: number;
45
- };
46
- /**
47
- * Input convenience for zoom-clamp ranges. A `number` is applied as the
48
- * same bound on both axes; a `{x, y}` vector applies per-axis bounds.
49
- */
50
- type ZoomBound = number | {
51
- x: number;
52
- y: number;
53
- };
54
- /**
55
- * Bridge `View` into the legacy `ViewTransform` shape so chrome can keep
56
- * calling `worldToScreen` / `screenToWorld`. `View` and `ViewTransform`
57
- * use opposite sign conventions for the translation half (`view.x` is
58
- * camera position; `panX` is canvas translation), so the adapter flips
59
- * the sign and multiplies by per-axis scale.
60
- */
61
- declare function viewToTransform(view: View): ViewTransform;
62
-
63
- export { type View as V, type ZoomBound as Z, type ViewTransform as a, type ZoomFactor as b, screenToWorld as s, viewToTransform as v, worldToScreen as w };