elements-kit 0.27.7 → 0.27.8

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.
@@ -78,12 +78,17 @@ type NoInline = {
78
78
  * both edges of one axis.
79
79
  */
80
80
  type Boundary = (BlockEdge & InlineEdge) | (BlockEdge & NoInline) | (NoBlock & InlineEdge);
81
+ /** Where {@link Region.place} puts a box's top-left corner. */
82
+ interface Placement {
83
+ readonly x: number;
84
+ readonly y: number;
85
+ }
81
86
  /**
82
87
  * Somewhere a box may go: a semi-bounded plane, each axis pinned or free.
83
88
  * `place` is the only operation: it never writes, so the caller picks which
84
89
  * channels to take — `box.x = region.place(box).x` moves one axis and leaves
85
- * the rest. The box is placed as given: one larger than its room overflows
86
- * rather than shrinks, as CSS does.
90
+ * the rest. Size is never returned: the box is placed as given, so one larger
91
+ * than its room overflows rather than shrinks, as CSS does.
87
92
  *
88
93
  * The four insets read back as CSS would want them: the pinned edge's
89
94
  * coordinate, `null` for the other three (`auto`). A centred axis is not an
@@ -94,7 +99,7 @@ interface Region {
94
99
  readonly right: number | null;
95
100
  readonly top: number | null;
96
101
  readonly bottom: number | null;
97
- place(box: ReadonlyBox): Box;
102
+ place(box: ReadonlyBox): Placement;
98
103
  }
99
104
  /**
100
105
  * A {@link Region} driven by writes — for gestures, where the box grows away
@@ -112,7 +117,7 @@ declare class MutableRegion implements Region {
112
117
  set right(v: number | null);
113
118
  set top(v: number | null);
114
119
  set bottom(v: number | null);
115
- place(box: ReadonlyBox): Box;
120
+ place(box: ReadonlyBox): Placement;
116
121
  }
117
122
  //#endregion
118
123
  //#region src/ui/overlay/anchor.d.ts
@@ -172,7 +177,7 @@ declare class PositionArea implements Region, ReadonlyBox {
172
177
  get top(): number | null;
173
178
  get bottom(): number | null;
174
179
  /** Every axis is pinned, so only the box's size is read. */
175
- place(box: Pick<ReadonlyBox, "w" | "h">): Box;
180
+ place(box: Pick<ReadonlyBox, "w" | "h">): Placement;
176
181
  }
177
182
  //#endregion
178
183
  //#region src/ui/overlay/overlay.d.ts
@@ -261,4 +266,4 @@ declare class Motion implements IMotion {
261
266
  abort(initial?: number): void;
262
267
  }
263
268
  //#endregion
264
- export { type Align, type Axis, type BlockSide, type Boundary, ElementBox, gestures_d_exports as Gestures, type IDirection, type IMotion, type InlineSide, type Inset, Motion, MutableRegion, OverlayBox, type PhysicalInset, type Pin, PositionArea, type ReadonlyBox, type Region, WINDOW_BOX, WindowBox, anchor_length };
269
+ export { type Align, type Axis, type BlockSide, type Boundary, ElementBox, gestures_d_exports as Gestures, type IDirection, type IMotion, type InlineSide, type Inset, Motion, MutableRegion, OverlayBox, type PhysicalInset, type Pin, type Placement, PositionArea, type ReadonlyBox, type Region, WINDOW_BOX, WindowBox, anchor_length };
@@ -74,9 +74,7 @@ var MutableRegion = class {
74
74
  place(box) {
75
75
  return {
76
76
  x: placeAxis(this.#x(), box.x, box.w),
77
- y: placeAxis(this.#y(), box.y, box.h),
78
- w: box.w,
79
- h: box.h
77
+ y: placeAxis(this.#y(), box.y, box.h)
80
78
  };
81
79
  }
82
80
  };
@@ -370,9 +368,7 @@ var PositionArea = class {
370
368
  place(box) {
371
369
  return {
372
370
  x: placePinned(this.#px, box.w),
373
- y: placePinned(this.#py, box.h),
374
- w: box.w,
375
- h: box.h
371
+ y: placePinned(this.#py, box.h)
376
372
  };
377
373
  }
378
374
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elements-kit",
3
3
  "type": "module",
4
- "version": "0.27.7",
4
+ "version": "0.27.8",
5
5
  "description": "A lightweight reactive UI library that transforms native HTMLElements into reactive components with signals. Ideal for framework-agnostic applications and web components.",
6
6
  "keywords": [
7
7
  "webcomponents",