@hadoku/ui-shell 0.1.271 → 0.1.272

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.
@@ -0,0 +1,22 @@
1
+ export interface Point {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ }
5
+ export interface Box {
6
+ left: number;
7
+ top: number;
8
+ width: number;
9
+ height: number;
10
+ }
11
+ export interface Rect {
12
+ left: number;
13
+ top: number;
14
+ right: number;
15
+ bottom: number;
16
+ }
17
+ /** `r` as a box relative to `to`. */
18
+ export declare const rel: (r: DOMRect, to: DOMRect) => Box;
19
+ /** The middle of `r`. */
20
+ export declare const centre: (r: Box) => Point;
21
+ /** Whether `p` is on `r`, its edges included. */
22
+ export declare const inside: (r: Rect, p: Point) => boolean;
@@ -0,0 +1,7 @@
1
+ /* One geometry for every overlay: a point, a box (where something is drawn) and a rect (its edges). */
2
+ /** `r` as a box relative to `to`. */
3
+ export const rel = (r, to) => ({ left: r.left - to.left, top: r.top - to.top, width: r.width, height: r.height });
4
+ /** The middle of `r`. */
5
+ export const centre = (r) => ({ x: r.left + r.width / 2, y: r.top + r.height / 2 });
6
+ /** Whether `p` is on `r`, its edges included. */
7
+ export const inside = (r, p) => p.x >= r.left && p.x <= r.right && p.y >= r.top && p.y <= r.bottom;
@@ -5,4 +5,5 @@ export { flip, type FlipOptions } from './flip.js';
5
5
  export { everyFrame, nextFrame, perFrame, resetFrames, type FrameStep } from './frame.js';
6
6
  export { claimParticles, PARTICLE_BUDGET, particlePool, particleShare, shared, type ParticlePool } from './particles.js';
7
7
  export { animationName, Stage, type StageHold, type StageOptions, type TrackOptions } from './stage.js';
8
- export { afterGlide, rel, standIn, type Box, type StandInOptions } from './stand-in.js';
8
+ export { centre, inside, rel, type Box, type Point, type Rect } from './box.js';
9
+ export { afterGlide, standIn, type StandInOptions } from './stand-in.js';
@@ -6,4 +6,5 @@ export { flip } from "./flip.js";
6
6
  export { everyFrame, nextFrame, perFrame, resetFrames } from "./frame.js";
7
7
  export { claimParticles, PARTICLE_BUDGET, particlePool, particleShare, shared } from "./particles.js";
8
8
  export { animationName, Stage } from "./stage.js";
9
- export { afterGlide, rel, standIn } from "./stand-in.js";
9
+ export { centre, inside, rel } from "./box.js";
10
+ export { afterGlide, standIn } from "./stand-in.js";
@@ -1,11 +1,5 @@
1
- export interface Box {
2
- left: number;
3
- top: number;
4
- width: number;
5
- height: number;
6
- }
7
- /** `r` as a box relative to `to`. */
8
- export declare const rel: (r: DOMRect, to: DOMRect) => Box;
1
+ import { type Box } from './box.js';
2
+ export type { Box } from './box.js';
9
3
  export interface StandInOptions {
10
4
  cls: string;
11
5
  /** The piece inside it that carries the copy, and `data-stand-in`'s value. */
@@ -1,7 +1,6 @@
1
1
  /* Stand-ins: a copy of an element in an overlay, moving where the element must not (a transform in a laid-out row counts toward its overflow). */
2
+ import { rel } from "./box.js";
2
3
  import { everyFrame } from "./frame.js";
3
- /** `r` as a box relative to `to`. */
4
- export const rel = (r, to) => ({ left: r.left - to.left, top: r.top - to.top, width: r.width, height: r.height });
5
4
  /**
6
5
  * A copy of `el` in `overlay`, kept on `el`'s box every frame until `stop`. Mounted, the copy's face is lined up
7
6
  * on `el`'s exactly, so handing over either way never jumps. An `el` drawn again meanwhile is followed, and hidden.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/ui-shell",
3
- "version": "0.1.271",
4
- "gitHead": "deb19430548a53dd978951b35e1e800cf1aec80b",
3
+ "version": "0.1.272",
4
+ "gitHead": "0521d0d9654680f3a188647dc9122a8c217604e4",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "The parts of a game's UI any game keeps: chrome, trim, room shell, embed mount, theme and settings frame, UI scale, usage counting, the sound mixer, motion and generic components. One appId parameterizes its storage keys, events and chat prefix. MIT; imports only react, react-dom, platform-wire and @wolffm/*.",
@@ -72,7 +72,7 @@
72
72
  "react-dom": "^19.2.8"
73
73
  },
74
74
  "dependencies": {
75
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.271",
75
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.272",
76
76
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.4",
77
77
  "@wolffm/themes": "npm:@hadoku/themes@^5.14.22",
78
78
  "zod": "^4.6.7"