strata-react 1.0.28 → 1.0.31

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.
@@ -27,3 +27,29 @@ export declare function zoomAt(v: Viewport, nextScale: number, at: {
27
27
  export declare function actualPixelsScale(naturalWidth: number, fittedWidth: number): number;
28
28
  /** The CSS transform for a viewport. */
29
29
  export declare function viewportTransform(v: Viewport): string;
30
+ /** A box in a picture, as shares (0 to 1) of its width and height from the top left: `[x, y, width, height]`. */
31
+ export type ShareBox = readonly [number, number, number, number];
32
+ /** A named box in the source's coordinates: `of` is the reference size in pixels, and without it the box is already shares. */
33
+ export type Region = {
34
+ id: string;
35
+ label: string;
36
+ box: readonly [number, number, number, number];
37
+ of?: readonly [number, number];
38
+ };
39
+ /** A region as shares of the frame, so it lands on the same part of every candidate whatever its pixel size. */
40
+ export declare function regionShares(region: Region): ShareBox;
41
+ /** The viewport that fills the frame with a box (as much of it as fits, centred): the scale that fits the box, the offset that puts its centre at the frame's centre. */
42
+ export declare function boxViewport(box: ShareBox, frame: {
43
+ width: number;
44
+ height: number;
45
+ }): Viewport;
46
+ /** A rectangle drawn on the frame (pixels from its top left) as shares of the picture under the viewport now. */
47
+ export declare function frameBoxToShares(rect: {
48
+ x0: number;
49
+ y0: number;
50
+ x1: number;
51
+ y1: number;
52
+ }, v: Viewport, frame: {
53
+ width: number;
54
+ height: number;
55
+ }): ShareBox;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-react",
3
- "version": "1.0.28",
3
+ "version": "1.0.31",
4
4
  "description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
5
5
  "repository": {
6
6
  "type": "git",