@weasel-js/core 0.6.0 → 0.7.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/CHANGELOG.md +139 -0
- package/dist/{DrawCommand-Dl0bXNfS.d.ts → DrawCommand-CJtqqt8H.d.ts} +26 -2
- package/dist/{chunk-7V6JEOXE.js → chunk-7F3SDUJ4.js} +7884 -9167
- package/dist/chunk-7F3SDUJ4.js.map +1 -0
- package/dist/chunk-FSZEXVCR.js +171 -0
- package/dist/chunk-FSZEXVCR.js.map +1 -0
- package/dist/clone.d.ts +1 -1
- package/dist/geometry-D9BDMiQi.d.ts +114 -0
- package/dist/{grid-Cf87knjU.d.ts → grid-CaSK9bHV.d.ts} +1 -1
- package/dist/index-D31EADQG.d.ts +2847 -0
- package/dist/index.css +0 -35
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +913 -2546
- package/dist/index.js +2 -2
- package/dist/insert.d.ts +2 -2
- package/dist/move.d.ts +3 -3
- package/dist/{options-BPPBWMa7.d.ts → options-DMWeTELe.d.ts} +1 -1
- package/dist/{pointSnapToGrid-D7s7QmOF.d.ts → pointSnapToGrid-C3EruUwt.d.ts} +3 -54
- package/dist/renderer.css +0 -35
- package/dist/renderer.css.map +1 -1
- package/dist/renderer.d.ts +5 -4
- package/dist/renderer.js +2 -2
- package/dist/resize.d.ts +3 -3
- package/dist/routing.d.ts +10 -8
- package/dist/routing.js +1 -1
- package/dist/{types-BjUi2vA-.d.ts → types-Dcaa0tPq.d.ts} +1 -25
- package/dist/{registerFont-CP-wCsrz.d.ts → viewToMat3-D4lrBigW.d.ts} +2 -44
- package/package.json +6 -5
- package/dist/chunk-7V6JEOXE.js.map +0 -1
- package/dist/chunk-AM6ARSPN.js +0 -517
- package/dist/chunk-AM6ARSPN.js.map +0 -1
- package/dist/fitViewToBounds-evGsnR8Q.d.ts +0 -62
- package/dist/index-DZBYMsHI.d.ts +0 -1555
- package/dist/routing.css +0 -35
- package/dist/routing.css.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { V as View } from './view-DSQgxBJB.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Axis-aligned rectangle in world space. Kit-wide `Bounds` shape used by
|
|
5
|
-
* selection, group, and viewport helpers. The optional `rotation` field
|
|
6
|
-
* (radians, around the AABB center) lets selection chrome attach a rotated
|
|
7
|
-
* orientation to an otherwise axis-aligned rect without needing a parallel
|
|
8
|
-
* type.
|
|
9
|
-
*/
|
|
10
|
-
interface Bounds {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
rotation?: number;
|
|
16
|
-
}
|
|
17
|
-
/** Pixel dimensions of the canvas viewport. */
|
|
18
|
-
interface ViewportDims {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
}
|
|
22
|
-
/** Options for {@link fitViewToBounds}. */
|
|
23
|
-
interface FitViewToBoundsOptions {
|
|
24
|
-
/** Inset (in CSS px) around the bounds. Default 16. */
|
|
25
|
-
padding?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Override the kit's system max scale. Defaults to the kit-wide max zoom
|
|
28
|
-
* used by `computeWheelAction` / `useZoom` (currently `10`).
|
|
29
|
-
*/
|
|
30
|
-
maxScale?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Override the kit's system min scale. Defaults to the kit-wide min zoom
|
|
33
|
-
* used by `computeWheelAction` / `useZoom` (currently `0.1`).
|
|
34
|
-
*/
|
|
35
|
-
minScale?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Fit mode:
|
|
38
|
-
* - `'contain'` (default): uniform scale = `min(availW/w, availH/h)`. Bounds fit entirely; one axis has letterboxing.
|
|
39
|
-
* - `'fill'`: uniform scale = `max(...)`. Bounds overflow viewport on one axis.
|
|
40
|
-
* - `'stretch'`: per-axis scale. Bounds match viewport exactly; scale is non-uniform.
|
|
41
|
-
*/
|
|
42
|
-
mode?: 'contain' | 'fill' | 'stretch';
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Compute the target {@link View} that fits `bounds` (world space) inside
|
|
46
|
-
* `viewportDims` (CSS px). The bounds are centered in the viewport with
|
|
47
|
-
* uniform padding on all sides; the resulting scale is clamped to the
|
|
48
|
-
* configured min/max.
|
|
49
|
-
*
|
|
50
|
-
* View semantics: `view.x` / `view.y` is the world point currently drawn at
|
|
51
|
-
* the canvas top-left, and `view.scale.{x,y}` is pixels per world unit on
|
|
52
|
-
* each axis (see `view.ts`). So:
|
|
53
|
-
* screenX = (worldX - view.x) * view.scale.x
|
|
54
|
-
* screenY = (worldY - view.y) * view.scale.y
|
|
55
|
-
*
|
|
56
|
-
* Empty / zero-sized bounds or viewports cannot be fit — in that case this
|
|
57
|
-
* returns `currentView` unchanged and logs a `console.warn`. Callers that
|
|
58
|
-
* want to no-op silently can detect zero area themselves before calling.
|
|
59
|
-
*/
|
|
60
|
-
declare function fitViewToBounds(bounds: Bounds, viewportDims: ViewportDims, currentView: View, opts?: FitViewToBoundsOptions): View;
|
|
61
|
-
|
|
62
|
-
export { type Bounds as B, type FitViewToBoundsOptions as F, type ViewportDims as V, fitViewToBounds as f };
|