venuekit 0.10.2 → 0.10.3

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/dist/react.d.cts CHANGED
@@ -591,6 +591,6 @@ type UseImageResult = {
591
591
  */
592
592
  declare function useImage(src: string | null): UseImageResult;
593
593
 
594
- declare const VERSION = "0.10.2";
594
+ declare const VERSION = "0.10.3";
595
595
 
596
596
  export { type CapacityRejection, DESIGNER_CSS, type DesignerHostApi, type DesignerMessages, type DesignerOverrides, type DesignerRejection, type MessageOverrides, type Messages, PICKER_CSS, type PlacedCount, SeatMap, type SeatMapPlaceType, type SeatMapProps, type UseImageResult, VERSION, VenueDesigner, type VenueDesignerProps, VenueOverview, type VenueOverviewPlaceType, type VenueOverviewProps, designerEn, designerEs, en, es, format, mergeDesignerMessages, mergeMessages, selectionSummary, useImage };
package/dist/react.d.ts CHANGED
@@ -591,6 +591,6 @@ type UseImageResult = {
591
591
  */
592
592
  declare function useImage(src: string | null): UseImageResult;
593
593
 
594
- declare const VERSION = "0.10.2";
594
+ declare const VERSION = "0.10.3";
595
595
 
596
596
  export { type CapacityRejection, DESIGNER_CSS, type DesignerHostApi, type DesignerMessages, type DesignerOverrides, type DesignerRejection, type MessageOverrides, type Messages, PICKER_CSS, type PlacedCount, SeatMap, type SeatMapPlaceType, type SeatMapProps, type UseImageResult, VERSION, VenueDesigner, type VenueDesignerProps, VenueOverview, type VenueOverviewPlaceType, type VenueOverviewProps, designerEn, designerEs, en, es, format, mergeDesignerMessages, mergeMessages, selectionSummary, useImage };
package/dist/react.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  zoneLocalSize,
46
46
  zoneOutline,
47
47
  zoneWithLocalSize
48
- } from "./chunk-QQQM6AFF.js";
48
+ } from "./chunk-TDC5G7L7.js";
49
49
 
50
50
  // ../canvas/src/camera.ts
51
51
  var MIN_ZOOM = 0.05;
@@ -296,12 +296,16 @@ function computeBounds(element) {
296
296
  }
297
297
  return own;
298
298
  }
299
- function elementAt(layout, screen, camera, viewport) {
299
+ var EDIT_HIT_SLOP_PX = 4;
300
+ function elementAt(layout, screen, camera, viewport, options = {}) {
300
301
  const world = screenToWorld(camera, viewport, screen);
302
+ const slop = (options.slopPx ?? 0) / camera.zoom;
301
303
  for (let i = layout.elements.length - 1; i >= 0; i -= 1) {
302
304
  const element = layout.elements[i];
303
305
  const box = elementBounds(layout, element);
304
- if (box && world.x >= box.minX && world.x <= box.maxX && world.y >= box.minY && world.y <= box.maxY) {
306
+ const ownsRadius = element.type === "seatBlock" || element.type === "table" && element.mode === "perPlace";
307
+ const pad = element.type === "seatBlock" || element.type === "table" ? (ownsRadius ? options.radii?.get(element.id) ?? 0 : 0) + slop : 0;
308
+ if (box && world.x >= box.minX - pad && world.x <= box.maxX + pad && world.y >= box.minY - pad && world.y <= box.maxY + pad) {
305
309
  if (element.type === "zone" && !pointInZone(element, world)) continue;
306
310
  return element;
307
311
  }
@@ -3007,7 +3011,7 @@ var DesignerCanvas = forwardRef(function DesignerCanvas2({ designer, placeTypes,
3007
3011
  }
3008
3012
  const d = latest.current.designer;
3009
3013
  const { camera: c, viewport: v } = latest.current;
3010
- const hit = kind === "down" ? backgroundAt(d.layout.meta.background, screenToWorld(c, v, p), d.ui.backgroundEditing) ?? elementAt(d.layout, p, c, v)?.id ?? null : null;
3014
+ const hit = kind === "down" ? backgroundAt(d.layout.meta.background, screenToWorld(c, v, p), d.ui.backgroundEditing) ?? elementAt(d.layout, p, c, v, { radii, slopPx: EDIT_HIT_SLOP_PX })?.id ?? null : null;
3011
3015
  const elementLocked = d.ui.armed !== null || hit !== null && hit === d.ui.seatEditId;
3012
3016
  if (kind !== "down") {
3013
3017
  feed({ kind, p, hitElementId: hit, elementLocked });
@@ -6098,7 +6102,7 @@ function VenueDesigner(props) {
6098
6102
  }
6099
6103
 
6100
6104
  // ../react/src/index.ts
6101
- var VERSION = "0.10.2";
6105
+ var VERSION = "0.10.3";
6102
6106
  export {
6103
6107
  DESIGNER_CSS,
6104
6108
  PICKER_CSS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venuekit",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "VenueKit: editor y mapa de butacas. `venuekit` es el núcleo (sin DOM, para el servidor); `venuekit/react` trae <VenueDesigner /> y <SeatMap />.",
5
5
  "keywords": [
6
6
  "venue",