@vibecook/ice 0.15.0-desk.4 → 0.15.0-desk.5

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,7 +78,7 @@ import {
78
78
  spring,
79
79
  themeFrom,
80
80
  tilted
81
- } from "./chunk-M7E6E7K5.js";
81
+ } from "./chunk-OHEHS2EM.js";
82
82
  import {
83
83
  BLEND_OVER,
84
84
  bindGroup,
@@ -158,12 +158,13 @@ import {
158
158
  trayTakeProps,
159
159
  widgetSpawnInits,
160
160
  widgetTypeFor
161
- } from "./chunk-PFJN3XN2.js";
161
+ } from "./chunk-HSIFKQNP.js";
162
162
  import {
163
+ clientToScreen,
163
164
  cubicBezierEase,
164
165
  specimenFit,
165
166
  trayScrollMax
166
- } from "./chunk-JS6PG6YD.js";
167
+ } from "./chunk-RE4GDHFJ.js";
167
168
 
168
169
  // ../desk/src/faults.ts
169
170
  var KIND_STRIKES = 3;
@@ -5879,6 +5880,7 @@ function createDeskReflector(opts) {
5879
5880
  look: (kind) => looks.get(kind),
5880
5881
  tray,
5881
5882
  traySpecimens: () => drawnSpecimens,
5883
+ drawsType: (type) => kindOn(objectKindOf(widgetTypeFor(world, type))) !== void 0,
5882
5884
  trayShows: (e) => trayDrawn.has(e),
5883
5885
  carry: carry2,
5884
5886
  trayCarried: () => drawnCarried,
@@ -6175,9 +6177,9 @@ function createDeskEditor(opts) {
6175
6177
  if (Math.hypot(ev.clientX - d.x, ev.clientY - d.y) > slop) return;
6176
6178
  const cam = world.getResource(Camera);
6177
6179
  if (cam === void 0) return;
6178
- const r = container.getBoundingClientRect();
6179
- const wx = cam.x + (ev.clientX - r.left) / cam.zoom;
6180
- const wy = cam.y + (ev.clientY - r.top) / cam.zoom;
6180
+ const at2 = clientToScreen(ev.clientX, ev.clientY, container.getBoundingClientRect(), container);
6181
+ const wx = cam.x + at2.x / cam.zoom;
6182
+ const wy = cam.y + at2.y / cam.zoom;
6181
6183
  const t = tapHit(world, d.type === "touch" ? `touch:${d.id}` : "mouse");
6182
6184
  const hit = t.hit !== void 0 && world.has(t.hit, Grab) ? void 0 : t.hit;
6183
6185
  if (t.found && t.hit !== void 0 && hit === void 0) return;
@@ -7605,7 +7607,7 @@ function deskLayer(opts) {
7605
7607
  };
7606
7608
  const heldPose2 = ctx.heldPose;
7607
7609
  if (heldPose2 !== void 0) heldPose2.current = poseSource;
7608
- const traySource = { frame: () => compose2.tray.frame() };
7610
+ const traySource = { frame: () => compose2.tray.frame(), draws: (type) => compose2.drawsType(type) };
7609
7611
  const trayPose = ctx.trayPose;
7610
7612
  if (trayPose !== void 0) trayPose.current = traySource;
7611
7613
  const detachTransition = ctx.transitions?.register({ id: "@ice/desk", plane: "ground", prepare: () => null }) ?? null;
@@ -8416,4 +8418,4 @@ export {
8416
8418
  STILL_PALETTE,
8417
8419
  createStill
8418
8420
  };
8419
- //# sourceMappingURL=chunk-E5ADZNMK.js.map
8421
+ //# sourceMappingURL=chunk-5QVYKU64.js.map