venuekit 0.10.1 → 0.10.2

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/README.md CHANGED
@@ -193,7 +193,8 @@ without touching locked units.
193
193
 
194
194
  **Limits.** Plans are untrusted input, so the schema has hard limits (exported as constants):
195
195
  `MAX_UNITS`, `MAX_ELEMENTS`, `MAX_ID_LENGTH`, `MAX_NAME_LENGTH`, `MAX_REF_LENGTH`,
196
- `MAX_TABLE_LABEL_LENGTH`, `MAX_SRC_LENGTH`, `MAX_SKIP`, `MAX_LETTERS_START`.
196
+ `MAX_TABLE_LABEL_LENGTH`, `MAX_SRC_LENGTH`, `MAX_SKIP`, `MAX_LETTERS_START`, `MAX_ROWS`,
197
+ `MAX_COLS`, `MAX_COORD`, `MAX_SPACING`, `MAX_SIZE`.
197
198
 
198
199
  ## API
199
200
 
@@ -250,11 +250,18 @@ var MAX_LETTERS_START = 3;
250
250
  var MAX_SKIP = 100;
251
251
  var MIN_SCALE = 0.4;
252
252
  var MAX_SCALE = 2;
253
+ var MAX_ROWS = 500;
254
+ var MAX_COLS = 1e3;
255
+ var MAX_COORD = 1e6;
256
+ var MAX_SPACING = 1e3;
257
+ var MAX_SIZE = 1e5;
258
+ var coord = () => z.number().min(-MAX_COORD).max(MAX_COORD);
259
+ var size = () => z.number().positive().max(MAX_SIZE);
253
260
  var idSchema = z.string().max(MAX_ID_LENGTH).regex(/^[A-Za-z0-9_-]+$/, "El id s\xF3lo admite letras, n\xFAmeros, _ y -");
254
261
  var rotationSchema = z.union([z.literal(0), z.literal(90), z.literal(180), z.literal(270)]);
255
262
  var transformSchema = z.object({
256
- x: z.number(),
257
- y: z.number(),
263
+ x: coord(),
264
+ y: coord(),
258
265
  rotation: rotationSchema.default(0)
259
266
  });
260
267
  var LETTERS_RE = /^[A-Za-z]{1,3}$/;
@@ -300,11 +307,11 @@ var seatBlockSchema = z.object({
300
307
  id: idSchema,
301
308
  type: z.literal("seatBlock"),
302
309
  transform: transformSchema,
303
- rows: z.number().int().min(1).max(500),
304
- cols: z.number().int().min(1).max(1e3),
310
+ rows: z.number().int().min(1).max(MAX_ROWS),
311
+ cols: z.number().int().min(1).max(MAX_COLS),
305
312
  rowLabels: labelRuleSchema,
306
313
  seatLabels: labelRuleSchema,
307
- spacing: z.object({ x: z.number().positive(), y: z.number().positive() }),
314
+ spacing: z.object({ x: z.number().positive().max(MAX_SPACING), y: z.number().positive().max(MAX_SPACING) }),
308
315
  curve: z.number().min(0).max(180).default(0),
309
316
  scale: z.number().min(MIN_SCALE).max(MAX_SCALE).default(1),
310
317
  removed: z.array(z.string().max(MAX_ID_LENGTH * 2)).max(MAX_UNITS).default([]),
@@ -327,15 +334,15 @@ var landmarkSchema = z.object({
327
334
  transform: transformSchema,
328
335
  kind: z.string().refine((k) => landmarkById(k) !== null, "El tipo de referencia no existe en el cat\xE1logo"),
329
336
  name: z.string().min(1).max(60),
330
- width: z.number().positive(),
331
- height: z.number().positive()
337
+ width: size(),
338
+ height: size()
332
339
  });
333
340
  var zoneSchema = z.object({
334
341
  id: idSchema,
335
342
  type: z.literal("zone"),
336
343
  transform: transformSchema,
337
- width: z.number().positive(),
338
- height: z.number().positive(),
344
+ width: size(),
345
+ height: size(),
339
346
  /** Grados de arco, como `seatBlock.curve`: con curva la zona es una banda (tribuna curva). */
340
347
  curve: z.number().min(0).max(180).default(0),
341
348
  placeType: placeTypeLinkSchema.nullable().default(null)
@@ -343,10 +350,10 @@ var zoneSchema = z.object({
343
350
  var elementSchema = z.discriminatedUnion("type", [seatBlockSchema, tableSchema, landmarkSchema, zoneSchema]);
344
351
  var backgroundSchema = z.object({
345
352
  src: z.string().min(1).max(MAX_SRC_LENGTH),
346
- x: z.number(),
347
- y: z.number(),
348
- width: z.number().positive(),
349
- height: z.number().positive(),
353
+ x: coord(),
354
+ y: coord(),
355
+ width: size(),
356
+ height: size(),
350
357
  opacity: z.number().min(0.1).max(1),
351
358
  locked: z.boolean()
352
359
  });
@@ -354,8 +361,8 @@ var metaSchema = z.object({
354
361
  id: idSchema,
355
362
  name: z.string().max(MAX_NAME_LENGTH),
356
363
  version: z.literal(2),
357
- width: z.number().positive(),
358
- height: z.number().positive(),
364
+ width: size(),
365
+ height: size(),
359
366
  background: backgroundSchema.nullable().default(null)
360
367
  });
361
368
  var layoutSchema = z.object({
@@ -806,7 +813,13 @@ var History = class {
806
813
  * corresponde a dibujar, borrar o mover.
807
814
  */
808
815
  apply(cmd, key) {
809
- const next = applyCommand(this.present, cmd);
816
+ return this.commit(applyCommand(this.present, cmd), key);
817
+ }
818
+ /**
819
+ * Como `apply`, con el resultado ya calculado y validado por `applyCommand` sobre
820
+ * `present`: quien chequea antes (el candado, el cupo) no paga la validación dos veces.
821
+ */
822
+ commit(next, key) {
810
823
  if (key !== void 0 && key === this.lastKey) {
811
824
  this.future = [];
812
825
  this.present = next;
@@ -929,10 +942,12 @@ function nextTableLabel(layout) {
929
942
  }
930
943
  function blockCols(n) {
931
944
  if (n <= 60) return BLOCK_COLS.find((c) => n % c === 0) ?? 10;
932
- const target = Math.min(BLOCK_COLS_MAX, Math.max(10, Math.round(Math.sqrt(n * 2.5))));
945
+ const min = Math.max(10, Math.ceil(n / MAX_ROWS));
946
+ const max = Math.min(MAX_COLS, Math.max(BLOCK_COLS_MAX, min));
947
+ const target = Math.min(max, Math.max(min, Math.round(Math.sqrt(n * 2.5))));
933
948
  for (let d = 0; d <= 5; d++) {
934
949
  for (const c of d === 0 ? [target] : [target - d, target + d]) {
935
- if (c >= 10 && c <= BLOCK_COLS_MAX && n % c === 0) return c;
950
+ if (c >= min && c <= max && n % c === 0) return c;
936
951
  }
937
952
  }
938
953
  return target;
@@ -1001,8 +1016,8 @@ function worldWidth(el) {
1001
1016
  return ((swap ? s.height : s.width) + 2 * PLACE_OFFSET) * k;
1002
1017
  }
1003
1018
  if (el.type === "zone") {
1004
- const size = zoneLocalSize(el);
1005
- return swap ? size.height : size.width;
1019
+ const size2 = zoneLocalSize(el);
1020
+ return swap ? size2.height : size2.width;
1006
1021
  }
1007
1022
  return swap ? el.height : el.width;
1008
1023
  }
@@ -1029,7 +1044,13 @@ function duplicatePiece(el, id, layout) {
1029
1044
  }
1030
1045
  function rotatePiece(el) {
1031
1046
  const rotation = (el.transform.rotation + 90) % 360;
1032
- return { ...el, transform: { ...el.transform, rotation } };
1047
+ if (el.type !== "seatBlock") return { ...el, transform: { ...el.transform, rotation } };
1048
+ const local = bbox(expandSeatBlock({ ...el, removed: [], transform: { x: 0, y: 0, rotation: 0 } }));
1049
+ const centre = { x: (local.minX + local.maxX) / 2, y: (local.minY + local.maxY) / 2 };
1050
+ const was = applyTransform(centre, { x: 0, y: 0, rotation: el.transform.rotation });
1051
+ const now = applyTransform(centre, { x: 0, y: 0, rotation });
1052
+ const round = (v) => Math.round(v * 1e6) / 1e6;
1053
+ return { ...el, transform: { x: round(el.transform.x + was.x - now.x), y: round(el.transform.y + was.y - now.y), rotation } };
1033
1054
  }
1034
1055
  function toggleRemovedSeat(block, unitId) {
1035
1056
  const removed = block.removed.includes(unitId) ? block.removed.filter((r) => r !== unitId) : [...block.removed, unitId];
@@ -1108,6 +1129,7 @@ function summarize(layout) {
1108
1129
  const byRef = {};
1109
1130
  const slot = (ref) => byRef[ref] ??= { units: 0, seats: 0, tables: 0, places: 0, zones: 0, duplicates: { seats: [], tables: [] } };
1110
1131
  const seen = /* @__PURE__ */ new Map();
1132
+ const reported = /* @__PURE__ */ new Set();
1111
1133
  const repeated = (ref, key, out, name) => {
1112
1134
  let set = seen.get(ref);
1113
1135
  if (!set) seen.set(ref, set = /* @__PURE__ */ new Set());
@@ -1115,7 +1137,10 @@ function summarize(layout) {
1115
1137
  set.add(key);
1116
1138
  return;
1117
1139
  }
1118
- if (!out.includes(name)) out.push(name);
1140
+ const once = `${ref}\0${key}`;
1141
+ if (reported.has(once)) return;
1142
+ reported.add(once);
1143
+ out.push(name);
1119
1144
  };
1120
1145
  let seats = 0;
1121
1146
  let places = 0;
@@ -1217,7 +1242,7 @@ function migrate(input) {
1217
1242
  }
1218
1243
 
1219
1244
  // ../core/src/index.ts
1220
- var VERSION = "0.10.1";
1245
+ var VERSION = "0.10.2";
1221
1246
 
1222
1247
  export {
1223
1248
  LATIN_ALPHABET,
@@ -1243,6 +1268,11 @@ export {
1243
1268
  MAX_SKIP,
1244
1269
  MIN_SCALE,
1245
1270
  MAX_SCALE,
1271
+ MAX_ROWS,
1272
+ MAX_COLS,
1273
+ MAX_COORD,
1274
+ MAX_SPACING,
1275
+ MAX_SIZE,
1246
1276
  idSchema,
1247
1277
  rotationSchema,
1248
1278
  transformSchema,
@@ -250,11 +250,18 @@ var MAX_LETTERS_START = 3;
250
250
  var MAX_SKIP = 100;
251
251
  var MIN_SCALE = 0.4;
252
252
  var MAX_SCALE = 2;
253
+ var MAX_ROWS = 500;
254
+ var MAX_COLS = 1e3;
255
+ var MAX_COORD = 1e6;
256
+ var MAX_SPACING = 1e3;
257
+ var MAX_SIZE = 1e5;
258
+ var coord = () => _zod.z.number().min(-MAX_COORD).max(MAX_COORD);
259
+ var size = () => _zod.z.number().positive().max(MAX_SIZE);
253
260
  var idSchema = _zod.z.string().max(MAX_ID_LENGTH).regex(/^[A-Za-z0-9_-]+$/, "El id s\xF3lo admite letras, n\xFAmeros, _ y -");
254
261
  var rotationSchema = _zod.z.union([_zod.z.literal(0), _zod.z.literal(90), _zod.z.literal(180), _zod.z.literal(270)]);
255
262
  var transformSchema = _zod.z.object({
256
- x: _zod.z.number(),
257
- y: _zod.z.number(),
263
+ x: coord(),
264
+ y: coord(),
258
265
  rotation: rotationSchema.default(0)
259
266
  });
260
267
  var LETTERS_RE = /^[A-Za-z]{1,3}$/;
@@ -300,11 +307,11 @@ var seatBlockSchema = _zod.z.object({
300
307
  id: idSchema,
301
308
  type: _zod.z.literal("seatBlock"),
302
309
  transform: transformSchema,
303
- rows: _zod.z.number().int().min(1).max(500),
304
- cols: _zod.z.number().int().min(1).max(1e3),
310
+ rows: _zod.z.number().int().min(1).max(MAX_ROWS),
311
+ cols: _zod.z.number().int().min(1).max(MAX_COLS),
305
312
  rowLabels: labelRuleSchema,
306
313
  seatLabels: labelRuleSchema,
307
- spacing: _zod.z.object({ x: _zod.z.number().positive(), y: _zod.z.number().positive() }),
314
+ spacing: _zod.z.object({ x: _zod.z.number().positive().max(MAX_SPACING), y: _zod.z.number().positive().max(MAX_SPACING) }),
308
315
  curve: _zod.z.number().min(0).max(180).default(0),
309
316
  scale: _zod.z.number().min(MIN_SCALE).max(MAX_SCALE).default(1),
310
317
  removed: _zod.z.array(_zod.z.string().max(MAX_ID_LENGTH * 2)).max(MAX_UNITS).default([]),
@@ -327,15 +334,15 @@ var landmarkSchema = _zod.z.object({
327
334
  transform: transformSchema,
328
335
  kind: _zod.z.string().refine((k) => landmarkById(k) !== null, "El tipo de referencia no existe en el cat\xE1logo"),
329
336
  name: _zod.z.string().min(1).max(60),
330
- width: _zod.z.number().positive(),
331
- height: _zod.z.number().positive()
337
+ width: size(),
338
+ height: size()
332
339
  });
333
340
  var zoneSchema = _zod.z.object({
334
341
  id: idSchema,
335
342
  type: _zod.z.literal("zone"),
336
343
  transform: transformSchema,
337
- width: _zod.z.number().positive(),
338
- height: _zod.z.number().positive(),
344
+ width: size(),
345
+ height: size(),
339
346
  /** Grados de arco, como `seatBlock.curve`: con curva la zona es una banda (tribuna curva). */
340
347
  curve: _zod.z.number().min(0).max(180).default(0),
341
348
  placeType: placeTypeLinkSchema.nullable().default(null)
@@ -343,10 +350,10 @@ var zoneSchema = _zod.z.object({
343
350
  var elementSchema = _zod.z.discriminatedUnion("type", [seatBlockSchema, tableSchema, landmarkSchema, zoneSchema]);
344
351
  var backgroundSchema = _zod.z.object({
345
352
  src: _zod.z.string().min(1).max(MAX_SRC_LENGTH),
346
- x: _zod.z.number(),
347
- y: _zod.z.number(),
348
- width: _zod.z.number().positive(),
349
- height: _zod.z.number().positive(),
353
+ x: coord(),
354
+ y: coord(),
355
+ width: size(),
356
+ height: size(),
350
357
  opacity: _zod.z.number().min(0.1).max(1),
351
358
  locked: _zod.z.boolean()
352
359
  });
@@ -354,8 +361,8 @@ var metaSchema = _zod.z.object({
354
361
  id: idSchema,
355
362
  name: _zod.z.string().max(MAX_NAME_LENGTH),
356
363
  version: _zod.z.literal(2),
357
- width: _zod.z.number().positive(),
358
- height: _zod.z.number().positive(),
364
+ width: size(),
365
+ height: size(),
359
366
  background: backgroundSchema.nullable().default(null)
360
367
  });
361
368
  var layoutSchema = _zod.z.object({
@@ -806,7 +813,13 @@ var History = (_class2 = class {
806
813
  * corresponde a dibujar, borrar o mover.
807
814
  */
808
815
  apply(cmd, key) {
809
- const next = applyCommand(this.present, cmd);
816
+ return this.commit(applyCommand(this.present, cmd), key);
817
+ }
818
+ /**
819
+ * Como `apply`, con el resultado ya calculado y validado por `applyCommand` sobre
820
+ * `present`: quien chequea antes (el candado, el cupo) no paga la validación dos veces.
821
+ */
822
+ commit(next, key) {
810
823
  if (key !== void 0 && key === this.lastKey) {
811
824
  this.future = [];
812
825
  this.present = next;
@@ -929,10 +942,12 @@ function nextTableLabel(layout) {
929
942
  }
930
943
  function blockCols(n) {
931
944
  if (n <= 60) return _nullishCoalesce(BLOCK_COLS.find((c) => n % c === 0), () => ( 10));
932
- const target = Math.min(BLOCK_COLS_MAX, Math.max(10, Math.round(Math.sqrt(n * 2.5))));
945
+ const min = Math.max(10, Math.ceil(n / MAX_ROWS));
946
+ const max = Math.min(MAX_COLS, Math.max(BLOCK_COLS_MAX, min));
947
+ const target = Math.min(max, Math.max(min, Math.round(Math.sqrt(n * 2.5))));
933
948
  for (let d = 0; d <= 5; d++) {
934
949
  for (const c of d === 0 ? [target] : [target - d, target + d]) {
935
- if (c >= 10 && c <= BLOCK_COLS_MAX && n % c === 0) return c;
950
+ if (c >= min && c <= max && n % c === 0) return c;
936
951
  }
937
952
  }
938
953
  return target;
@@ -1001,8 +1016,8 @@ function worldWidth(el) {
1001
1016
  return ((swap ? s.height : s.width) + 2 * PLACE_OFFSET) * k;
1002
1017
  }
1003
1018
  if (el.type === "zone") {
1004
- const size = zoneLocalSize(el);
1005
- return swap ? size.height : size.width;
1019
+ const size2 = zoneLocalSize(el);
1020
+ return swap ? size2.height : size2.width;
1006
1021
  }
1007
1022
  return swap ? el.height : el.width;
1008
1023
  }
@@ -1029,7 +1044,13 @@ function duplicatePiece(el, id, layout) {
1029
1044
  }
1030
1045
  function rotatePiece(el) {
1031
1046
  const rotation = (el.transform.rotation + 90) % 360;
1032
- return { ...el, transform: { ...el.transform, rotation } };
1047
+ if (el.type !== "seatBlock") return { ...el, transform: { ...el.transform, rotation } };
1048
+ const local = bbox(expandSeatBlock({ ...el, removed: [], transform: { x: 0, y: 0, rotation: 0 } }));
1049
+ const centre = { x: (local.minX + local.maxX) / 2, y: (local.minY + local.maxY) / 2 };
1050
+ const was = applyTransform(centre, { x: 0, y: 0, rotation: el.transform.rotation });
1051
+ const now = applyTransform(centre, { x: 0, y: 0, rotation });
1052
+ const round = (v) => Math.round(v * 1e6) / 1e6;
1053
+ return { ...el, transform: { x: round(el.transform.x + was.x - now.x), y: round(el.transform.y + was.y - now.y), rotation } };
1033
1054
  }
1034
1055
  function toggleRemovedSeat(block, unitId) {
1035
1056
  const removed = block.removed.includes(unitId) ? block.removed.filter((r) => r !== unitId) : [...block.removed, unitId];
@@ -1108,6 +1129,7 @@ function summarize(layout) {
1108
1129
  const byRef = {};
1109
1130
  const slot = (ref) => byRef[ref] ??= { units: 0, seats: 0, tables: 0, places: 0, zones: 0, duplicates: { seats: [], tables: [] } };
1110
1131
  const seen = /* @__PURE__ */ new Map();
1132
+ const reported = /* @__PURE__ */ new Set();
1111
1133
  const repeated = (ref, key, out, name) => {
1112
1134
  let set = seen.get(ref);
1113
1135
  if (!set) seen.set(ref, set = /* @__PURE__ */ new Set());
@@ -1115,7 +1137,10 @@ function summarize(layout) {
1115
1137
  set.add(key);
1116
1138
  return;
1117
1139
  }
1118
- if (!out.includes(name)) out.push(name);
1140
+ const once = `${ref}\0${key}`;
1141
+ if (reported.has(once)) return;
1142
+ reported.add(once);
1143
+ out.push(name);
1119
1144
  };
1120
1145
  let seats = 0;
1121
1146
  let places = 0;
@@ -1217,7 +1242,12 @@ function migrate(input) {
1217
1242
  }
1218
1243
 
1219
1244
  // ../core/src/index.ts
1220
- var VERSION = "0.10.1";
1245
+ var VERSION = "0.10.2";
1246
+
1247
+
1248
+
1249
+
1250
+
1221
1251
 
1222
1252
 
1223
1253
 
@@ -1308,4 +1338,4 @@ var VERSION = "0.10.1";
1308
1338
 
1309
1339
 
1310
1340
 
1311
- exports.LATIN_ALPHABET = LATIN_ALPHABET; exports.SPANISH_ALPHABET = SPANISH_ALPHABET; exports.letterLabel = letterLabel; exports.letterIndex = letterIndex; exports.labelSequence = labelSequence; exports.expandLabels = expandLabels; exports.ID_SEP = ID_SEP; exports.seatUnitId = seatUnitId; exports.placeUnitId = placeUnitId; exports.parseUnitId = parseUnitId; exports.landmarks = landmarks; exports.landmarkById = landmarkById; exports.MAX_UNITS = MAX_UNITS; exports.MAX_ID_LENGTH = MAX_ID_LENGTH; exports.MAX_NAME_LENGTH = MAX_NAME_LENGTH; exports.MAX_REF_LENGTH = MAX_REF_LENGTH; exports.MAX_TABLE_LABEL_LENGTH = MAX_TABLE_LABEL_LENGTH; exports.MAX_SRC_LENGTH = MAX_SRC_LENGTH; exports.MAX_ELEMENTS = MAX_ELEMENTS; exports.MAX_LETTERS_START = MAX_LETTERS_START; exports.MAX_SKIP = MAX_SKIP; exports.MIN_SCALE = MIN_SCALE; exports.MAX_SCALE = MAX_SCALE; exports.idSchema = idSchema; exports.rotationSchema = rotationSchema; exports.transformSchema = transformSchema; exports.labelRuleSchema = labelRuleSchema; exports.placeTypeLinkSchema = placeTypeLinkSchema; exports.seatBlockSchema = seatBlockSchema; exports.tableSchema = tableSchema; exports.landmarkSchema = landmarkSchema; exports.zoneSchema = zoneSchema; exports.elementSchema = elementSchema; exports.backgroundSchema = backgroundSchema; exports.metaSchema = metaSchema; exports.layoutSchema = layoutSchema; exports.spanishParseOptions = spanishParseOptions; exports.applyTransform = applyTransform; exports.bbox = bbox; exports.pointInPolygon = pointInPolygon; exports.distance = distance; exports.placeTypeBounds = placeTypeBounds; exports.zoneArc = zoneArc; exports.zoneLocalSize = zoneLocalSize; exports.zoneBounds = zoneBounds; exports.pointInZone = pointInZone; exports.zoneOutline = zoneOutline; exports.zoneLabelSize = zoneLabelSize; exports.zoneWithLocalSize = zoneWithLocalSize; exports.expandSeatBlock = expandSeatBlock; exports.TABLE_RADIUS = TABLE_RADIUS; exports.TABLE_WIDTH = TABLE_WIDTH; exports.TABLE_HEIGHT = TABLE_HEIGHT; exports.PLACE_OFFSET = PLACE_OFFSET; exports.expandTable = expandTable; exports.expand = expand; exports.SpatialIndex = SpatialIndex; exports.CommandError = CommandError; exports.applyCommand = applyCommand; exports.HISTORY_LIMIT = HISTORY_LIMIT; exports.History = History; exports.findLockViolations = findLockViolations; exports.DEFAULT_BLOCK = DEFAULT_BLOCK; exports.DEFAULT_TABLE_PLACES = DEFAULT_TABLE_PLACES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.newElementId = newElementId; exports.tableSize = tableSize; exports.blockShape = blockShape; exports.createPiece = createPiece; exports.duplicatePiece = duplicatePiece; exports.rotatePiece = rotatePiece; exports.toggleRemovedSeat = toggleRemovedSeat; exports.snapScale = snapScale; exports.scalePiece = scalePiece; exports.canAssign = canAssign; exports.placeTypeCapacity = placeTypeCapacity; exports.nextBlockUnits = nextBlockUnits; exports.capacityViolations = capacityViolations; exports.assignPlaceType = assignPlaceType; exports.rebindPlaceTypes = rebindPlaceTypes; exports.summarize = summarize; exports.DEFAULT_MAX_SELECTION = DEFAULT_MAX_SELECTION; exports.unitStates = unitStates; exports.toggleUnit = toggleUnit; exports.CURRENT_VERSION = CURRENT_VERSION; exports.LayoutError = LayoutError; exports.migrate = migrate; exports.VERSION = VERSION;
1341
+ exports.LATIN_ALPHABET = LATIN_ALPHABET; exports.SPANISH_ALPHABET = SPANISH_ALPHABET; exports.letterLabel = letterLabel; exports.letterIndex = letterIndex; exports.labelSequence = labelSequence; exports.expandLabels = expandLabels; exports.ID_SEP = ID_SEP; exports.seatUnitId = seatUnitId; exports.placeUnitId = placeUnitId; exports.parseUnitId = parseUnitId; exports.landmarks = landmarks; exports.landmarkById = landmarkById; exports.MAX_UNITS = MAX_UNITS; exports.MAX_ID_LENGTH = MAX_ID_LENGTH; exports.MAX_NAME_LENGTH = MAX_NAME_LENGTH; exports.MAX_REF_LENGTH = MAX_REF_LENGTH; exports.MAX_TABLE_LABEL_LENGTH = MAX_TABLE_LABEL_LENGTH; exports.MAX_SRC_LENGTH = MAX_SRC_LENGTH; exports.MAX_ELEMENTS = MAX_ELEMENTS; exports.MAX_LETTERS_START = MAX_LETTERS_START; exports.MAX_SKIP = MAX_SKIP; exports.MIN_SCALE = MIN_SCALE; exports.MAX_SCALE = MAX_SCALE; exports.MAX_ROWS = MAX_ROWS; exports.MAX_COLS = MAX_COLS; exports.MAX_COORD = MAX_COORD; exports.MAX_SPACING = MAX_SPACING; exports.MAX_SIZE = MAX_SIZE; exports.idSchema = idSchema; exports.rotationSchema = rotationSchema; exports.transformSchema = transformSchema; exports.labelRuleSchema = labelRuleSchema; exports.placeTypeLinkSchema = placeTypeLinkSchema; exports.seatBlockSchema = seatBlockSchema; exports.tableSchema = tableSchema; exports.landmarkSchema = landmarkSchema; exports.zoneSchema = zoneSchema; exports.elementSchema = elementSchema; exports.backgroundSchema = backgroundSchema; exports.metaSchema = metaSchema; exports.layoutSchema = layoutSchema; exports.spanishParseOptions = spanishParseOptions; exports.applyTransform = applyTransform; exports.bbox = bbox; exports.pointInPolygon = pointInPolygon; exports.distance = distance; exports.placeTypeBounds = placeTypeBounds; exports.zoneArc = zoneArc; exports.zoneLocalSize = zoneLocalSize; exports.zoneBounds = zoneBounds; exports.pointInZone = pointInZone; exports.zoneOutline = zoneOutline; exports.zoneLabelSize = zoneLabelSize; exports.zoneWithLocalSize = zoneWithLocalSize; exports.expandSeatBlock = expandSeatBlock; exports.TABLE_RADIUS = TABLE_RADIUS; exports.TABLE_WIDTH = TABLE_WIDTH; exports.TABLE_HEIGHT = TABLE_HEIGHT; exports.PLACE_OFFSET = PLACE_OFFSET; exports.expandTable = expandTable; exports.expand = expand; exports.SpatialIndex = SpatialIndex; exports.CommandError = CommandError; exports.applyCommand = applyCommand; exports.HISTORY_LIMIT = HISTORY_LIMIT; exports.History = History; exports.findLockViolations = findLockViolations; exports.DEFAULT_BLOCK = DEFAULT_BLOCK; exports.DEFAULT_TABLE_PLACES = DEFAULT_TABLE_PLACES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.newElementId = newElementId; exports.tableSize = tableSize; exports.blockShape = blockShape; exports.createPiece = createPiece; exports.duplicatePiece = duplicatePiece; exports.rotatePiece = rotatePiece; exports.toggleRemovedSeat = toggleRemovedSeat; exports.snapScale = snapScale; exports.scalePiece = scalePiece; exports.canAssign = canAssign; exports.placeTypeCapacity = placeTypeCapacity; exports.nextBlockUnits = nextBlockUnits; exports.capacityViolations = capacityViolations; exports.assignPlaceType = assignPlaceType; exports.rebindPlaceTypes = rebindPlaceTypes; exports.summarize = summarize; exports.DEFAULT_MAX_SELECTION = DEFAULT_MAX_SELECTION; exports.unitStates = unitStates; exports.toggleUnit = toggleUnit; exports.CURRENT_VERSION = CURRENT_VERSION; exports.LayoutError = LayoutError; exports.migrate = migrate; exports.VERSION = VERSION;
package/dist/index.cjs CHANGED
@@ -87,12 +87,12 @@
87
87
 
88
88
 
89
89
 
90
- var _chunkLFRA3GBPcjs = require('./chunk-LFRA3GBP.cjs');
91
90
 
92
91
 
93
92
 
94
93
 
95
94
 
95
+ var _chunkZ47OPTEPcjs = require('./chunk-Z47OPTEP.cjs');
96
96
 
97
97
 
98
98
 
@@ -177,4 +177,14 @@ var _chunkLFRA3GBPcjs = require('./chunk-LFRA3GBP.cjs');
177
177
 
178
178
 
179
179
 
180
- exports.CURRENT_VERSION = _chunkLFRA3GBPcjs.CURRENT_VERSION; exports.CommandError = _chunkLFRA3GBPcjs.CommandError; exports.DEFAULT_BLOCK = _chunkLFRA3GBPcjs.DEFAULT_BLOCK; exports.DEFAULT_MAX_SELECTION = _chunkLFRA3GBPcjs.DEFAULT_MAX_SELECTION; exports.DEFAULT_TABLE_PLACES = _chunkLFRA3GBPcjs.DEFAULT_TABLE_PLACES; exports.DEFAULT_ZONE = _chunkLFRA3GBPcjs.DEFAULT_ZONE; exports.HISTORY_LIMIT = _chunkLFRA3GBPcjs.HISTORY_LIMIT; exports.History = _chunkLFRA3GBPcjs.History; exports.ID_SEP = _chunkLFRA3GBPcjs.ID_SEP; exports.LATIN_ALPHABET = _chunkLFRA3GBPcjs.LATIN_ALPHABET; exports.LayoutError = _chunkLFRA3GBPcjs.LayoutError; exports.MAX_ELEMENTS = _chunkLFRA3GBPcjs.MAX_ELEMENTS; exports.MAX_ID_LENGTH = _chunkLFRA3GBPcjs.MAX_ID_LENGTH; exports.MAX_LETTERS_START = _chunkLFRA3GBPcjs.MAX_LETTERS_START; exports.MAX_NAME_LENGTH = _chunkLFRA3GBPcjs.MAX_NAME_LENGTH; exports.MAX_REF_LENGTH = _chunkLFRA3GBPcjs.MAX_REF_LENGTH; exports.MAX_SCALE = _chunkLFRA3GBPcjs.MAX_SCALE; exports.MAX_SKIP = _chunkLFRA3GBPcjs.MAX_SKIP; exports.MAX_SRC_LENGTH = _chunkLFRA3GBPcjs.MAX_SRC_LENGTH; exports.MAX_TABLE_LABEL_LENGTH = _chunkLFRA3GBPcjs.MAX_TABLE_LABEL_LENGTH; exports.MAX_UNITS = _chunkLFRA3GBPcjs.MAX_UNITS; exports.MIN_SCALE = _chunkLFRA3GBPcjs.MIN_SCALE; exports.PLACE_OFFSET = _chunkLFRA3GBPcjs.PLACE_OFFSET; exports.SPANISH_ALPHABET = _chunkLFRA3GBPcjs.SPANISH_ALPHABET; exports.SpatialIndex = _chunkLFRA3GBPcjs.SpatialIndex; exports.TABLE_HEIGHT = _chunkLFRA3GBPcjs.TABLE_HEIGHT; exports.TABLE_RADIUS = _chunkLFRA3GBPcjs.TABLE_RADIUS; exports.TABLE_WIDTH = _chunkLFRA3GBPcjs.TABLE_WIDTH; exports.VERSION = _chunkLFRA3GBPcjs.VERSION; exports.applyCommand = _chunkLFRA3GBPcjs.applyCommand; exports.applyTransform = _chunkLFRA3GBPcjs.applyTransform; exports.assignPlaceType = _chunkLFRA3GBPcjs.assignPlaceType; exports.backgroundSchema = _chunkLFRA3GBPcjs.backgroundSchema; exports.bbox = _chunkLFRA3GBPcjs.bbox; exports.blockShape = _chunkLFRA3GBPcjs.blockShape; exports.canAssign = _chunkLFRA3GBPcjs.canAssign; exports.capacityViolations = _chunkLFRA3GBPcjs.capacityViolations; exports.createPiece = _chunkLFRA3GBPcjs.createPiece; exports.distance = _chunkLFRA3GBPcjs.distance; exports.duplicatePiece = _chunkLFRA3GBPcjs.duplicatePiece; exports.elementSchema = _chunkLFRA3GBPcjs.elementSchema; exports.expand = _chunkLFRA3GBPcjs.expand; exports.expandLabels = _chunkLFRA3GBPcjs.expandLabels; exports.expandSeatBlock = _chunkLFRA3GBPcjs.expandSeatBlock; exports.expandTable = _chunkLFRA3GBPcjs.expandTable; exports.findLockViolations = _chunkLFRA3GBPcjs.findLockViolations; exports.idSchema = _chunkLFRA3GBPcjs.idSchema; exports.labelRuleSchema = _chunkLFRA3GBPcjs.labelRuleSchema; exports.labelSequence = _chunkLFRA3GBPcjs.labelSequence; exports.landmarkById = _chunkLFRA3GBPcjs.landmarkById; exports.landmarkSchema = _chunkLFRA3GBPcjs.landmarkSchema; exports.landmarks = _chunkLFRA3GBPcjs.landmarks; exports.layoutSchema = _chunkLFRA3GBPcjs.layoutSchema; exports.letterIndex = _chunkLFRA3GBPcjs.letterIndex; exports.letterLabel = _chunkLFRA3GBPcjs.letterLabel; exports.metaSchema = _chunkLFRA3GBPcjs.metaSchema; exports.migrate = _chunkLFRA3GBPcjs.migrate; exports.newElementId = _chunkLFRA3GBPcjs.newElementId; exports.nextBlockUnits = _chunkLFRA3GBPcjs.nextBlockUnits; exports.parseUnitId = _chunkLFRA3GBPcjs.parseUnitId; exports.placeTypeBounds = _chunkLFRA3GBPcjs.placeTypeBounds; exports.placeTypeCapacity = _chunkLFRA3GBPcjs.placeTypeCapacity; exports.placeTypeLinkSchema = _chunkLFRA3GBPcjs.placeTypeLinkSchema; exports.placeUnitId = _chunkLFRA3GBPcjs.placeUnitId; exports.pointInPolygon = _chunkLFRA3GBPcjs.pointInPolygon; exports.pointInZone = _chunkLFRA3GBPcjs.pointInZone; exports.rebindPlaceTypes = _chunkLFRA3GBPcjs.rebindPlaceTypes; exports.rotatePiece = _chunkLFRA3GBPcjs.rotatePiece; exports.rotationSchema = _chunkLFRA3GBPcjs.rotationSchema; exports.scalePiece = _chunkLFRA3GBPcjs.scalePiece; exports.seatBlockSchema = _chunkLFRA3GBPcjs.seatBlockSchema; exports.seatUnitId = _chunkLFRA3GBPcjs.seatUnitId; exports.snapScale = _chunkLFRA3GBPcjs.snapScale; exports.spanishParseOptions = _chunkLFRA3GBPcjs.spanishParseOptions; exports.summarize = _chunkLFRA3GBPcjs.summarize; exports.tableSchema = _chunkLFRA3GBPcjs.tableSchema; exports.tableSize = _chunkLFRA3GBPcjs.tableSize; exports.toggleRemovedSeat = _chunkLFRA3GBPcjs.toggleRemovedSeat; exports.toggleUnit = _chunkLFRA3GBPcjs.toggleUnit; exports.transformSchema = _chunkLFRA3GBPcjs.transformSchema; exports.unitStates = _chunkLFRA3GBPcjs.unitStates; exports.zoneArc = _chunkLFRA3GBPcjs.zoneArc; exports.zoneBounds = _chunkLFRA3GBPcjs.zoneBounds; exports.zoneLabelSize = _chunkLFRA3GBPcjs.zoneLabelSize; exports.zoneLocalSize = _chunkLFRA3GBPcjs.zoneLocalSize; exports.zoneOutline = _chunkLFRA3GBPcjs.zoneOutline; exports.zoneSchema = _chunkLFRA3GBPcjs.zoneSchema; exports.zoneWithLocalSize = _chunkLFRA3GBPcjs.zoneWithLocalSize;
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ exports.CURRENT_VERSION = _chunkZ47OPTEPcjs.CURRENT_VERSION; exports.CommandError = _chunkZ47OPTEPcjs.CommandError; exports.DEFAULT_BLOCK = _chunkZ47OPTEPcjs.DEFAULT_BLOCK; exports.DEFAULT_MAX_SELECTION = _chunkZ47OPTEPcjs.DEFAULT_MAX_SELECTION; exports.DEFAULT_TABLE_PLACES = _chunkZ47OPTEPcjs.DEFAULT_TABLE_PLACES; exports.DEFAULT_ZONE = _chunkZ47OPTEPcjs.DEFAULT_ZONE; exports.HISTORY_LIMIT = _chunkZ47OPTEPcjs.HISTORY_LIMIT; exports.History = _chunkZ47OPTEPcjs.History; exports.ID_SEP = _chunkZ47OPTEPcjs.ID_SEP; exports.LATIN_ALPHABET = _chunkZ47OPTEPcjs.LATIN_ALPHABET; exports.LayoutError = _chunkZ47OPTEPcjs.LayoutError; exports.MAX_COLS = _chunkZ47OPTEPcjs.MAX_COLS; exports.MAX_COORD = _chunkZ47OPTEPcjs.MAX_COORD; exports.MAX_ELEMENTS = _chunkZ47OPTEPcjs.MAX_ELEMENTS; exports.MAX_ID_LENGTH = _chunkZ47OPTEPcjs.MAX_ID_LENGTH; exports.MAX_LETTERS_START = _chunkZ47OPTEPcjs.MAX_LETTERS_START; exports.MAX_NAME_LENGTH = _chunkZ47OPTEPcjs.MAX_NAME_LENGTH; exports.MAX_REF_LENGTH = _chunkZ47OPTEPcjs.MAX_REF_LENGTH; exports.MAX_ROWS = _chunkZ47OPTEPcjs.MAX_ROWS; exports.MAX_SCALE = _chunkZ47OPTEPcjs.MAX_SCALE; exports.MAX_SIZE = _chunkZ47OPTEPcjs.MAX_SIZE; exports.MAX_SKIP = _chunkZ47OPTEPcjs.MAX_SKIP; exports.MAX_SPACING = _chunkZ47OPTEPcjs.MAX_SPACING; exports.MAX_SRC_LENGTH = _chunkZ47OPTEPcjs.MAX_SRC_LENGTH; exports.MAX_TABLE_LABEL_LENGTH = _chunkZ47OPTEPcjs.MAX_TABLE_LABEL_LENGTH; exports.MAX_UNITS = _chunkZ47OPTEPcjs.MAX_UNITS; exports.MIN_SCALE = _chunkZ47OPTEPcjs.MIN_SCALE; exports.PLACE_OFFSET = _chunkZ47OPTEPcjs.PLACE_OFFSET; exports.SPANISH_ALPHABET = _chunkZ47OPTEPcjs.SPANISH_ALPHABET; exports.SpatialIndex = _chunkZ47OPTEPcjs.SpatialIndex; exports.TABLE_HEIGHT = _chunkZ47OPTEPcjs.TABLE_HEIGHT; exports.TABLE_RADIUS = _chunkZ47OPTEPcjs.TABLE_RADIUS; exports.TABLE_WIDTH = _chunkZ47OPTEPcjs.TABLE_WIDTH; exports.VERSION = _chunkZ47OPTEPcjs.VERSION; exports.applyCommand = _chunkZ47OPTEPcjs.applyCommand; exports.applyTransform = _chunkZ47OPTEPcjs.applyTransform; exports.assignPlaceType = _chunkZ47OPTEPcjs.assignPlaceType; exports.backgroundSchema = _chunkZ47OPTEPcjs.backgroundSchema; exports.bbox = _chunkZ47OPTEPcjs.bbox; exports.blockShape = _chunkZ47OPTEPcjs.blockShape; exports.canAssign = _chunkZ47OPTEPcjs.canAssign; exports.capacityViolations = _chunkZ47OPTEPcjs.capacityViolations; exports.createPiece = _chunkZ47OPTEPcjs.createPiece; exports.distance = _chunkZ47OPTEPcjs.distance; exports.duplicatePiece = _chunkZ47OPTEPcjs.duplicatePiece; exports.elementSchema = _chunkZ47OPTEPcjs.elementSchema; exports.expand = _chunkZ47OPTEPcjs.expand; exports.expandLabels = _chunkZ47OPTEPcjs.expandLabels; exports.expandSeatBlock = _chunkZ47OPTEPcjs.expandSeatBlock; exports.expandTable = _chunkZ47OPTEPcjs.expandTable; exports.findLockViolations = _chunkZ47OPTEPcjs.findLockViolations; exports.idSchema = _chunkZ47OPTEPcjs.idSchema; exports.labelRuleSchema = _chunkZ47OPTEPcjs.labelRuleSchema; exports.labelSequence = _chunkZ47OPTEPcjs.labelSequence; exports.landmarkById = _chunkZ47OPTEPcjs.landmarkById; exports.landmarkSchema = _chunkZ47OPTEPcjs.landmarkSchema; exports.landmarks = _chunkZ47OPTEPcjs.landmarks; exports.layoutSchema = _chunkZ47OPTEPcjs.layoutSchema; exports.letterIndex = _chunkZ47OPTEPcjs.letterIndex; exports.letterLabel = _chunkZ47OPTEPcjs.letterLabel; exports.metaSchema = _chunkZ47OPTEPcjs.metaSchema; exports.migrate = _chunkZ47OPTEPcjs.migrate; exports.newElementId = _chunkZ47OPTEPcjs.newElementId; exports.nextBlockUnits = _chunkZ47OPTEPcjs.nextBlockUnits; exports.parseUnitId = _chunkZ47OPTEPcjs.parseUnitId; exports.placeTypeBounds = _chunkZ47OPTEPcjs.placeTypeBounds; exports.placeTypeCapacity = _chunkZ47OPTEPcjs.placeTypeCapacity; exports.placeTypeLinkSchema = _chunkZ47OPTEPcjs.placeTypeLinkSchema; exports.placeUnitId = _chunkZ47OPTEPcjs.placeUnitId; exports.pointInPolygon = _chunkZ47OPTEPcjs.pointInPolygon; exports.pointInZone = _chunkZ47OPTEPcjs.pointInZone; exports.rebindPlaceTypes = _chunkZ47OPTEPcjs.rebindPlaceTypes; exports.rotatePiece = _chunkZ47OPTEPcjs.rotatePiece; exports.rotationSchema = _chunkZ47OPTEPcjs.rotationSchema; exports.scalePiece = _chunkZ47OPTEPcjs.scalePiece; exports.seatBlockSchema = _chunkZ47OPTEPcjs.seatBlockSchema; exports.seatUnitId = _chunkZ47OPTEPcjs.seatUnitId; exports.snapScale = _chunkZ47OPTEPcjs.snapScale; exports.spanishParseOptions = _chunkZ47OPTEPcjs.spanishParseOptions; exports.summarize = _chunkZ47OPTEPcjs.summarize; exports.tableSchema = _chunkZ47OPTEPcjs.tableSchema; exports.tableSize = _chunkZ47OPTEPcjs.tableSize; exports.toggleRemovedSeat = _chunkZ47OPTEPcjs.toggleRemovedSeat; exports.toggleUnit = _chunkZ47OPTEPcjs.toggleUnit; exports.transformSchema = _chunkZ47OPTEPcjs.transformSchema; exports.unitStates = _chunkZ47OPTEPcjs.unitStates; exports.zoneArc = _chunkZ47OPTEPcjs.zoneArc; exports.zoneBounds = _chunkZ47OPTEPcjs.zoneBounds; exports.zoneLabelSize = _chunkZ47OPTEPcjs.zoneLabelSize; exports.zoneLocalSize = _chunkZ47OPTEPcjs.zoneLocalSize; exports.zoneOutline = _chunkZ47OPTEPcjs.zoneOutline; exports.zoneSchema = _chunkZ47OPTEPcjs.zoneSchema; exports.zoneWithLocalSize = _chunkZ47OPTEPcjs.zoneWithLocalSize;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LabelRule, a as Layout, S as SellableUnit, B as Box, Z as Zone, P as Point, E as Element, b as Background } from './place-types-CeTjPHTF.cjs';
2
- export { C as CapacityViolation, D as DEFAULT_BLOCK, c as DEFAULT_TABLE_PLACES, d as DEFAULT_ZONE, e as Landmark, f as LockViolation, M as MAX_ELEMENTS, g as MAX_ID_LENGTH, h as MAX_LETTERS_START, i as MAX_NAME_LENGTH, j as MAX_REF_LENGTH, k as MAX_SCALE, l as MAX_SKIP, m as MAX_SRC_LENGTH, n as MAX_TABLE_LABEL_LENGTH, o as MAX_UNITS, p as MIN_SCALE, q as PLACE_OFFSET, r as PieceKind, s as PieceOptions, t as PlaceTypeAccepts, u as PlaceTypeLink, v as PlaceTypeOption, w as PlanSummary, R as Rotation, x as SeatBlock, T as TABLE_HEIGHT, y as TABLE_RADIUS, z as TABLE_WIDTH, A as Table, F as Transform, G as applyTransform, H as assignPlaceType, I as backgroundSchema, J as bbox, K as blockShape, N as canAssign, O as capacityViolations, Q as createPiece, U as distance, V as duplicatePiece, W as elementSchema, X as expand, Y as expandSeatBlock, _ as expandTable, $ as findLockViolations, a0 as idSchema, a1 as labelRuleSchema, a2 as landmarkSchema, a3 as layoutSchema, a4 as metaSchema, a5 as newElementId, a6 as nextBlockUnits, a7 as placeTypeCapacity, a8 as placeTypeLinkSchema, a9 as pointInPolygon, aa as rebindPlaceTypes, ab as rotatePiece, ac as rotationSchema, ad as scalePiece, ae as seatBlockSchema, af as snapScale, ag as spanishParseOptions, ah as summarize, ai as tableSchema, aj as tableSize, ak as toggleRemovedSeat, al as transformSchema, am as zoneSchema } from './place-types-CeTjPHTF.cjs';
1
+ import { L as LabelRule, a as Layout, S as SellableUnit, B as Box, Z as Zone, P as Point, E as Element, b as Background } from './place-types-Dc0eabAi.cjs';
2
+ export { C as CapacityViolation, D as DEFAULT_BLOCK, c as DEFAULT_TABLE_PLACES, d as DEFAULT_ZONE, e as Landmark, f as LockViolation, M as MAX_COLS, g as MAX_COORD, h as MAX_ELEMENTS, i as MAX_ID_LENGTH, j as MAX_LETTERS_START, k as MAX_NAME_LENGTH, l as MAX_REF_LENGTH, m as MAX_ROWS, n as MAX_SCALE, o as MAX_SIZE, p as MAX_SKIP, q as MAX_SPACING, r as MAX_SRC_LENGTH, s as MAX_TABLE_LABEL_LENGTH, t as MAX_UNITS, u as MIN_SCALE, v as PLACE_OFFSET, w as PieceKind, x as PieceOptions, y as PlaceTypeAccepts, z as PlaceTypeLink, A as PlaceTypeOption, F as PlanSummary, R as Rotation, G as SeatBlock, T as TABLE_HEIGHT, H as TABLE_RADIUS, I as TABLE_WIDTH, J as Table, K as Transform, N as applyTransform, O as assignPlaceType, Q as backgroundSchema, U as bbox, V as blockShape, W as canAssign, X as capacityViolations, Y as createPiece, _ as distance, $ as duplicatePiece, a0 as elementSchema, a1 as expand, a2 as expandSeatBlock, a3 as expandTable, a4 as findLockViolations, a5 as idSchema, a6 as labelRuleSchema, a7 as landmarkSchema, a8 as layoutSchema, a9 as metaSchema, aa as newElementId, ab as nextBlockUnits, ac as placeTypeCapacity, ad as placeTypeLinkSchema, ae as pointInPolygon, af as rebindPlaceTypes, ag as rotatePiece, ah as rotationSchema, ai as scalePiece, aj as seatBlockSchema, ak as snapScale, al as spanishParseOptions, am as summarize, an as tableSchema, ao as tableSize, ap as toggleRemovedSeat, aq as transformSchema, ar as zoneSchema } from './place-types-Dc0eabAi.cjs';
3
3
  import 'zod';
4
4
 
5
5
  declare const LATIN_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -152,6 +152,11 @@ declare class History {
152
152
  * corresponde a dibujar, borrar o mover.
153
153
  */
154
154
  apply(cmd: Command, key?: string): Layout;
155
+ /**
156
+ * Como `apply`, con el resultado ya calculado y validado por `applyCommand` sobre
157
+ * `present`: quien chequea antes (el candado, el cupo) no paga la validación dos veces.
158
+ */
159
+ commit(next: Layout, key?: string): Layout;
155
160
  /**
156
161
  * Reemplaza el documento entero, y se puede deshacer.
157
162
  *
@@ -251,6 +256,6 @@ interface LandmarkDef {
251
256
  declare const landmarks: readonly LandmarkDef[];
252
257
  declare function landmarkById(id: string): LandmarkDef | null;
253
258
 
254
- declare const VERSION = "0.10.1";
259
+ declare const VERSION = "0.10.2";
255
260
 
256
261
  export { Background, Box, CURRENT_VERSION, type Command, CommandError, DEFAULT_MAX_SELECTION, Element, HISTORY_LIMIT, History, ID_SEP, LATIN_ALPHABET, type LabelAlphabet, type LabelPattern, LabelRule, type LandmarkDef, type LandmarkGroup, Layout, LayoutError, Point, SPANISH_ALPHABET, SellableUnit, SpatialIndex, type ToggleResult, type UnitState, VERSION, Zone, type ZoneArc, applyCommand, expandLabels, labelSequence, landmarkById, landmarks, letterIndex, letterLabel, migrate, parseUnitId, placeTypeBounds, placeUnitId, pointInZone, seatUnitId, toggleUnit, unitStates, zoneArc, zoneBounds, zoneLabelSize, zoneLocalSize, zoneOutline, zoneWithLocalSize };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as LabelRule, a as Layout, S as SellableUnit, B as Box, Z as Zone, P as Point, E as Element, b as Background } from './place-types-CeTjPHTF.js';
2
- export { C as CapacityViolation, D as DEFAULT_BLOCK, c as DEFAULT_TABLE_PLACES, d as DEFAULT_ZONE, e as Landmark, f as LockViolation, M as MAX_ELEMENTS, g as MAX_ID_LENGTH, h as MAX_LETTERS_START, i as MAX_NAME_LENGTH, j as MAX_REF_LENGTH, k as MAX_SCALE, l as MAX_SKIP, m as MAX_SRC_LENGTH, n as MAX_TABLE_LABEL_LENGTH, o as MAX_UNITS, p as MIN_SCALE, q as PLACE_OFFSET, r as PieceKind, s as PieceOptions, t as PlaceTypeAccepts, u as PlaceTypeLink, v as PlaceTypeOption, w as PlanSummary, R as Rotation, x as SeatBlock, T as TABLE_HEIGHT, y as TABLE_RADIUS, z as TABLE_WIDTH, A as Table, F as Transform, G as applyTransform, H as assignPlaceType, I as backgroundSchema, J as bbox, K as blockShape, N as canAssign, O as capacityViolations, Q as createPiece, U as distance, V as duplicatePiece, W as elementSchema, X as expand, Y as expandSeatBlock, _ as expandTable, $ as findLockViolations, a0 as idSchema, a1 as labelRuleSchema, a2 as landmarkSchema, a3 as layoutSchema, a4 as metaSchema, a5 as newElementId, a6 as nextBlockUnits, a7 as placeTypeCapacity, a8 as placeTypeLinkSchema, a9 as pointInPolygon, aa as rebindPlaceTypes, ab as rotatePiece, ac as rotationSchema, ad as scalePiece, ae as seatBlockSchema, af as snapScale, ag as spanishParseOptions, ah as summarize, ai as tableSchema, aj as tableSize, ak as toggleRemovedSeat, al as transformSchema, am as zoneSchema } from './place-types-CeTjPHTF.js';
1
+ import { L as LabelRule, a as Layout, S as SellableUnit, B as Box, Z as Zone, P as Point, E as Element, b as Background } from './place-types-Dc0eabAi.js';
2
+ export { C as CapacityViolation, D as DEFAULT_BLOCK, c as DEFAULT_TABLE_PLACES, d as DEFAULT_ZONE, e as Landmark, f as LockViolation, M as MAX_COLS, g as MAX_COORD, h as MAX_ELEMENTS, i as MAX_ID_LENGTH, j as MAX_LETTERS_START, k as MAX_NAME_LENGTH, l as MAX_REF_LENGTH, m as MAX_ROWS, n as MAX_SCALE, o as MAX_SIZE, p as MAX_SKIP, q as MAX_SPACING, r as MAX_SRC_LENGTH, s as MAX_TABLE_LABEL_LENGTH, t as MAX_UNITS, u as MIN_SCALE, v as PLACE_OFFSET, w as PieceKind, x as PieceOptions, y as PlaceTypeAccepts, z as PlaceTypeLink, A as PlaceTypeOption, F as PlanSummary, R as Rotation, G as SeatBlock, T as TABLE_HEIGHT, H as TABLE_RADIUS, I as TABLE_WIDTH, J as Table, K as Transform, N as applyTransform, O as assignPlaceType, Q as backgroundSchema, U as bbox, V as blockShape, W as canAssign, X as capacityViolations, Y as createPiece, _ as distance, $ as duplicatePiece, a0 as elementSchema, a1 as expand, a2 as expandSeatBlock, a3 as expandTable, a4 as findLockViolations, a5 as idSchema, a6 as labelRuleSchema, a7 as landmarkSchema, a8 as layoutSchema, a9 as metaSchema, aa as newElementId, ab as nextBlockUnits, ac as placeTypeCapacity, ad as placeTypeLinkSchema, ae as pointInPolygon, af as rebindPlaceTypes, ag as rotatePiece, ah as rotationSchema, ai as scalePiece, aj as seatBlockSchema, ak as snapScale, al as spanishParseOptions, am as summarize, an as tableSchema, ao as tableSize, ap as toggleRemovedSeat, aq as transformSchema, ar as zoneSchema } from './place-types-Dc0eabAi.js';
3
3
  import 'zod';
4
4
 
5
5
  declare const LATIN_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -152,6 +152,11 @@ declare class History {
152
152
  * corresponde a dibujar, borrar o mover.
153
153
  */
154
154
  apply(cmd: Command, key?: string): Layout;
155
+ /**
156
+ * Como `apply`, con el resultado ya calculado y validado por `applyCommand` sobre
157
+ * `present`: quien chequea antes (el candado, el cupo) no paga la validación dos veces.
158
+ */
159
+ commit(next: Layout, key?: string): Layout;
155
160
  /**
156
161
  * Reemplaza el documento entero, y se puede deshacer.
157
162
  *
@@ -251,6 +256,6 @@ interface LandmarkDef {
251
256
  declare const landmarks: readonly LandmarkDef[];
252
257
  declare function landmarkById(id: string): LandmarkDef | null;
253
258
 
254
- declare const VERSION = "0.10.1";
259
+ declare const VERSION = "0.10.2";
255
260
 
256
261
  export { Background, Box, CURRENT_VERSION, type Command, CommandError, DEFAULT_MAX_SELECTION, Element, HISTORY_LIMIT, History, ID_SEP, LATIN_ALPHABET, type LabelAlphabet, type LabelPattern, LabelRule, type LandmarkDef, type LandmarkGroup, Layout, LayoutError, Point, SPANISH_ALPHABET, SellableUnit, SpatialIndex, type ToggleResult, type UnitState, VERSION, Zone, type ZoneArc, applyCommand, expandLabels, labelSequence, landmarkById, landmarks, letterIndex, letterLabel, migrate, parseUnitId, placeTypeBounds, placeUnitId, pointInZone, seatUnitId, toggleUnit, unitStates, zoneArc, zoneBounds, zoneLabelSize, zoneLocalSize, zoneOutline, zoneWithLocalSize };
package/dist/index.js CHANGED
@@ -10,13 +10,18 @@ import {
10
10
  ID_SEP,
11
11
  LATIN_ALPHABET,
12
12
  LayoutError,
13
+ MAX_COLS,
14
+ MAX_COORD,
13
15
  MAX_ELEMENTS,
14
16
  MAX_ID_LENGTH,
15
17
  MAX_LETTERS_START,
16
18
  MAX_NAME_LENGTH,
17
19
  MAX_REF_LENGTH,
20
+ MAX_ROWS,
18
21
  MAX_SCALE,
22
+ MAX_SIZE,
19
23
  MAX_SKIP,
24
+ MAX_SPACING,
20
25
  MAX_SRC_LENGTH,
21
26
  MAX_TABLE_LABEL_LENGTH,
22
27
  MAX_UNITS,
@@ -87,7 +92,7 @@ import {
87
92
  zoneOutline,
88
93
  zoneSchema,
89
94
  zoneWithLocalSize
90
- } from "./chunk-4FCSKCFJ.js";
95
+ } from "./chunk-QQQM6AFF.js";
91
96
  export {
92
97
  CURRENT_VERSION,
93
98
  CommandError,
@@ -100,13 +105,18 @@ export {
100
105
  ID_SEP,
101
106
  LATIN_ALPHABET,
102
107
  LayoutError,
108
+ MAX_COLS,
109
+ MAX_COORD,
103
110
  MAX_ELEMENTS,
104
111
  MAX_ID_LENGTH,
105
112
  MAX_LETTERS_START,
106
113
  MAX_NAME_LENGTH,
107
114
  MAX_REF_LENGTH,
115
+ MAX_ROWS,
108
116
  MAX_SCALE,
117
+ MAX_SIZE,
109
118
  MAX_SKIP,
119
+ MAX_SPACING,
110
120
  MAX_SRC_LENGTH,
111
121
  MAX_TABLE_LABEL_LENGTH,
112
122
  MAX_UNITS,
@@ -19,6 +19,16 @@ declare const MAX_SKIP = 100;
19
19
  /** Tamaño de un bloque o una mesa respecto del de fábrica: sólo cambia el dibujo, nunca las unidades. */
20
20
  declare const MIN_SCALE = 0.4;
21
21
  declare const MAX_SCALE = 2;
22
+ /** Filas y butacas por fila de un bloque. */
23
+ declare const MAX_ROWS = 500;
24
+ declare const MAX_COLS = 1000;
25
+ /**
26
+ * Techo de coordenadas, espaciado y medidas: sin esto un número finito pero enorme
27
+ * (1e308) da `Infinity` al expandir y el encuadre queda en `NaN` (mapa en blanco).
28
+ */
29
+ declare const MAX_COORD = 1000000;
30
+ declare const MAX_SPACING = 1000;
31
+ declare const MAX_SIZE = 100000;
22
32
  /** IDs de elementos. Nunca ":" — es el separador de IDs de unidad. */
23
33
  declare const idSchema: z.ZodString;
24
34
  /** Sólo pasos de 90°, sentido horario. */
@@ -586,6 +596,7 @@ declare function createPiece(kind: PieceKind, id: string, at: Point, layout: Lay
586
596
  * así quien compra no ve dos "fila A, butaca 1". Los huecos se copian fila por fila.
587
597
  */
588
598
  declare function duplicatePiece(el: Element, id: string, layout: Layout): Element;
599
+ /** Un cuarto de vuelta sobre su centro. El bloque se ancla en su primera butaca: hay que corregirle el ancla. */
589
600
  declare function rotatePiece(el: Element): Element;
590
601
  declare function toggleRemovedSeat(block: SeatBlock, unitId: string): SeatBlock;
591
602
  /** El tamaño al paso más cercano (0.05 = 5 %), dentro de lo que acepta el esquema. */
@@ -667,4 +678,4 @@ type PlanSummary = {
667
678
  };
668
679
  declare function summarize(layout: Layout): PlanSummary;
669
680
 
670
- export { findLockViolations as $, type Table as A, type Box as B, type CapacityViolation as C, DEFAULT_BLOCK as D, type Element as E, type Transform as F, applyTransform as G, assignPlaceType as H, backgroundSchema as I, bbox as J, blockShape as K, type LabelRule as L, MAX_ELEMENTS as M, canAssign as N, capacityViolations as O, type Point as P, createPiece as Q, type Rotation as R, type SellableUnit as S, TABLE_HEIGHT as T, distance as U, duplicatePiece as V, elementSchema as W, expand as X, expandSeatBlock as Y, type Zone as Z, expandTable as _, type Layout as a, idSchema as a0, labelRuleSchema as a1, landmarkSchema as a2, layoutSchema as a3, metaSchema as a4, newElementId as a5, nextBlockUnits as a6, placeTypeCapacity as a7, placeTypeLinkSchema as a8, pointInPolygon as a9, rebindPlaceTypes as aa, rotatePiece as ab, rotationSchema as ac, scalePiece as ad, seatBlockSchema as ae, snapScale as af, spanishParseOptions as ag, summarize as ah, tableSchema as ai, tableSize as aj, toggleRemovedSeat as ak, transformSchema as al, zoneSchema as am, type Background as b, DEFAULT_TABLE_PLACES as c, DEFAULT_ZONE as d, type Landmark as e, type LockViolation as f, MAX_ID_LENGTH as g, MAX_LETTERS_START as h, MAX_NAME_LENGTH as i, MAX_REF_LENGTH as j, MAX_SCALE as k, MAX_SKIP as l, MAX_SRC_LENGTH as m, MAX_TABLE_LABEL_LENGTH as n, MAX_UNITS as o, MIN_SCALE as p, PLACE_OFFSET as q, type PieceKind as r, type PieceOptions as s, type PlaceTypeAccepts as t, type PlaceTypeLink as u, type PlaceTypeOption as v, type PlanSummary as w, type SeatBlock as x, TABLE_RADIUS as y, TABLE_WIDTH as z };
681
+ export { duplicatePiece as $, type PlaceTypeOption as A, type Box as B, type CapacityViolation as C, DEFAULT_BLOCK as D, type Element as E, type PlanSummary as F, type SeatBlock as G, TABLE_RADIUS as H, TABLE_WIDTH as I, type Table as J, type Transform as K, type LabelRule as L, MAX_COLS as M, applyTransform as N, assignPlaceType as O, type Point as P, backgroundSchema as Q, type Rotation as R, type SellableUnit as S, TABLE_HEIGHT as T, bbox as U, blockShape as V, canAssign as W, capacityViolations as X, createPiece as Y, type Zone as Z, distance as _, type Layout as a, elementSchema as a0, expand as a1, expandSeatBlock as a2, expandTable as a3, findLockViolations as a4, idSchema as a5, labelRuleSchema as a6, landmarkSchema as a7, layoutSchema as a8, metaSchema as a9, newElementId as aa, nextBlockUnits as ab, placeTypeCapacity as ac, placeTypeLinkSchema as ad, pointInPolygon as ae, rebindPlaceTypes as af, rotatePiece as ag, rotationSchema as ah, scalePiece as ai, seatBlockSchema as aj, snapScale as ak, spanishParseOptions as al, summarize as am, tableSchema as an, tableSize as ao, toggleRemovedSeat as ap, transformSchema as aq, zoneSchema as ar, type Background as b, DEFAULT_TABLE_PLACES as c, DEFAULT_ZONE as d, type Landmark as e, type LockViolation as f, MAX_COORD as g, MAX_ELEMENTS as h, MAX_ID_LENGTH as i, MAX_LETTERS_START as j, MAX_NAME_LENGTH as k, MAX_REF_LENGTH as l, MAX_ROWS as m, MAX_SCALE as n, MAX_SIZE as o, MAX_SKIP as p, MAX_SPACING as q, MAX_SRC_LENGTH as r, MAX_TABLE_LABEL_LENGTH as s, MAX_UNITS as t, MIN_SCALE as u, PLACE_OFFSET as v, type PieceKind as w, type PieceOptions as x, type PlaceTypeAccepts as y, type PlaceTypeLink as z };
@@ -19,6 +19,16 @@ declare const MAX_SKIP = 100;
19
19
  /** Tamaño de un bloque o una mesa respecto del de fábrica: sólo cambia el dibujo, nunca las unidades. */
20
20
  declare const MIN_SCALE = 0.4;
21
21
  declare const MAX_SCALE = 2;
22
+ /** Filas y butacas por fila de un bloque. */
23
+ declare const MAX_ROWS = 500;
24
+ declare const MAX_COLS = 1000;
25
+ /**
26
+ * Techo de coordenadas, espaciado y medidas: sin esto un número finito pero enorme
27
+ * (1e308) da `Infinity` al expandir y el encuadre queda en `NaN` (mapa en blanco).
28
+ */
29
+ declare const MAX_COORD = 1000000;
30
+ declare const MAX_SPACING = 1000;
31
+ declare const MAX_SIZE = 100000;
22
32
  /** IDs de elementos. Nunca ":" — es el separador de IDs de unidad. */
23
33
  declare const idSchema: z.ZodString;
24
34
  /** Sólo pasos de 90°, sentido horario. */
@@ -586,6 +596,7 @@ declare function createPiece(kind: PieceKind, id: string, at: Point, layout: Lay
586
596
  * así quien compra no ve dos "fila A, butaca 1". Los huecos se copian fila por fila.
587
597
  */
588
598
  declare function duplicatePiece(el: Element, id: string, layout: Layout): Element;
599
+ /** Un cuarto de vuelta sobre su centro. El bloque se ancla en su primera butaca: hay que corregirle el ancla. */
589
600
  declare function rotatePiece(el: Element): Element;
590
601
  declare function toggleRemovedSeat(block: SeatBlock, unitId: string): SeatBlock;
591
602
  /** El tamaño al paso más cercano (0.05 = 5 %), dentro de lo que acepta el esquema. */
@@ -667,4 +678,4 @@ type PlanSummary = {
667
678
  };
668
679
  declare function summarize(layout: Layout): PlanSummary;
669
680
 
670
- export { findLockViolations as $, type Table as A, type Box as B, type CapacityViolation as C, DEFAULT_BLOCK as D, type Element as E, type Transform as F, applyTransform as G, assignPlaceType as H, backgroundSchema as I, bbox as J, blockShape as K, type LabelRule as L, MAX_ELEMENTS as M, canAssign as N, capacityViolations as O, type Point as P, createPiece as Q, type Rotation as R, type SellableUnit as S, TABLE_HEIGHT as T, distance as U, duplicatePiece as V, elementSchema as W, expand as X, expandSeatBlock as Y, type Zone as Z, expandTable as _, type Layout as a, idSchema as a0, labelRuleSchema as a1, landmarkSchema as a2, layoutSchema as a3, metaSchema as a4, newElementId as a5, nextBlockUnits as a6, placeTypeCapacity as a7, placeTypeLinkSchema as a8, pointInPolygon as a9, rebindPlaceTypes as aa, rotatePiece as ab, rotationSchema as ac, scalePiece as ad, seatBlockSchema as ae, snapScale as af, spanishParseOptions as ag, summarize as ah, tableSchema as ai, tableSize as aj, toggleRemovedSeat as ak, transformSchema as al, zoneSchema as am, type Background as b, DEFAULT_TABLE_PLACES as c, DEFAULT_ZONE as d, type Landmark as e, type LockViolation as f, MAX_ID_LENGTH as g, MAX_LETTERS_START as h, MAX_NAME_LENGTH as i, MAX_REF_LENGTH as j, MAX_SCALE as k, MAX_SKIP as l, MAX_SRC_LENGTH as m, MAX_TABLE_LABEL_LENGTH as n, MAX_UNITS as o, MIN_SCALE as p, PLACE_OFFSET as q, type PieceKind as r, type PieceOptions as s, type PlaceTypeAccepts as t, type PlaceTypeLink as u, type PlaceTypeOption as v, type PlanSummary as w, type SeatBlock as x, TABLE_RADIUS as y, TABLE_WIDTH as z };
681
+ export { duplicatePiece as $, type PlaceTypeOption as A, type Box as B, type CapacityViolation as C, DEFAULT_BLOCK as D, type Element as E, type PlanSummary as F, type SeatBlock as G, TABLE_RADIUS as H, TABLE_WIDTH as I, type Table as J, type Transform as K, type LabelRule as L, MAX_COLS as M, applyTransform as N, assignPlaceType as O, type Point as P, backgroundSchema as Q, type Rotation as R, type SellableUnit as S, TABLE_HEIGHT as T, bbox as U, blockShape as V, canAssign as W, capacityViolations as X, createPiece as Y, type Zone as Z, distance as _, type Layout as a, elementSchema as a0, expand as a1, expandSeatBlock as a2, expandTable as a3, findLockViolations as a4, idSchema as a5, labelRuleSchema as a6, landmarkSchema as a7, layoutSchema as a8, metaSchema as a9, newElementId as aa, nextBlockUnits as ab, placeTypeCapacity as ac, placeTypeLinkSchema as ad, pointInPolygon as ae, rebindPlaceTypes as af, rotatePiece as ag, rotationSchema as ah, scalePiece as ai, seatBlockSchema as aj, snapScale as ak, spanishParseOptions as al, summarize as am, tableSchema as an, tableSize as ao, toggleRemovedSeat as ap, transformSchema as aq, zoneSchema as ar, type Background as b, DEFAULT_TABLE_PLACES as c, DEFAULT_ZONE as d, type Landmark as e, type LockViolation as f, MAX_COORD as g, MAX_ELEMENTS as h, MAX_ID_LENGTH as i, MAX_LETTERS_START as j, MAX_NAME_LENGTH as k, MAX_REF_LENGTH as l, MAX_ROWS as m, MAX_SCALE as n, MAX_SIZE as o, MAX_SKIP as p, MAX_SPACING as q, MAX_SRC_LENGTH as r, MAX_TABLE_LABEL_LENGTH as s, MAX_UNITS as t, MIN_SCALE as u, PLACE_OFFSET as v, type PieceKind as w, type PieceOptions as x, type PlaceTypeAccepts as y, type PlaceTypeLink as z };