@seatmap-fyi/map-domain 0.1.0-alpha.48 → 0.1.0-alpha.50
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/arc-fan-rebuild.d.ts +9 -5
- package/dist/arc-fan-rebuild.js +78 -14
- package/dist/arc-fan-section-layout.d.ts +11 -0
- package/dist/arc-fan-section-layout.js +54 -0
- package/dist/arc-fan.interface.d.ts +18 -1
- package/dist/categories.d.ts +11 -2
- package/dist/categories.js +42 -10
- package/dist/floors.d.ts +1 -1
- package/dist/floors.js +4 -9
- package/dist/geometry/geometry.d.ts +3 -0
- package/dist/geometry/geometry.js +36 -10
- package/dist/geometry/inventory-outline.d.ts +8 -0
- package/dist/geometry/inventory-outline.js +46 -0
- package/dist/geometry/seat-shape.js +4 -4
- package/dist/geometry/seating-layout.d.ts +1 -0
- package/dist/geometry/seating-layout.js +7 -0
- package/dist/geometry/venue-outline.js +44 -9
- package/dist/issues.d.ts +1 -0
- package/dist/issues.js +1 -0
- package/dist/physical-document.interface.d.ts +25 -6
- package/dist/physical-document.interface.js +6 -0
- package/dist/schema.d.ts +90 -5
- package/dist/schema.js +33 -11
- package/dist/section-growth.d.ts +3 -3
- package/dist/section-growth.interface.d.ts +10 -2
- package/dist/section-growth.js +83 -36
- package/dist/section-layout.d.ts +9 -3
- package/dist/section-layout.js +2 -0
- package/dist/table-layout.d.ts +2 -1
- package/dist/table-layout.js +21 -13
- package/package.json +9 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { polygonContour } from "./polygon-curves.js";
|
|
1
|
+
import { PolygonVertexLimit, polygonContour, sideCurvePoint } from "./polygon-curves.js";
|
|
2
2
|
import { pointsBounds, containsPoint } from "./primitives.js";
|
|
3
3
|
import { ellipseSegments } from "./ellipse.js";
|
|
4
4
|
import TinyQueue from "tinyqueue";
|
|
@@ -72,9 +72,36 @@ export function memberEnvelope(points, paddingM = 0.15) {
|
|
|
72
72
|
return { outer, holes: [] };
|
|
73
73
|
}
|
|
74
74
|
const labelSearchPrecisionM = 1.5 * LayoutUnitM;
|
|
75
|
+
const curvedLabelSearchPrecisionM = 1.25 * LayoutUnitM;
|
|
76
|
+
const labelCurveSampleSpacingM = 2 * LayoutUnitM;
|
|
75
77
|
const labelInitialCellLimit = 64;
|
|
76
78
|
const labelSearchRoundoff = 16 * Number.EPSILON;
|
|
77
79
|
const labelPoints = new WeakMap();
|
|
80
|
+
function curvedLabelContour(source) {
|
|
81
|
+
const { edgeCurvature, outer, holes, cornerRounding, cornerRadiusM } = source;
|
|
82
|
+
if (!edgeCurvature?.some(Boolean) || cornerRounding || cornerRadiusM)
|
|
83
|
+
return null;
|
|
84
|
+
const segments = outer.map((start, index) => {
|
|
85
|
+
const curvature = edgeCurvature[index];
|
|
86
|
+
if (!curvature)
|
|
87
|
+
return 1;
|
|
88
|
+
const end = outer[(index + 1) % outer.length];
|
|
89
|
+
const chord = Math.hypot(end.x - start.x, end.y - start.y);
|
|
90
|
+
// The two outer legs of the equivalent cubic share a normal offset.
|
|
91
|
+
const controlLength = (chord * (1 + 2 * Math.hypot(1, (2 * curvature) / 100))) / 3;
|
|
92
|
+
return Math.max(1, Math.ceil(controlLength / labelCurveSampleSpacingM));
|
|
93
|
+
});
|
|
94
|
+
if (segments.reduce((count, side) => count + side, 0) > PolygonVertexLimit)
|
|
95
|
+
return null;
|
|
96
|
+
const contour = outer.flatMap((start, index) => {
|
|
97
|
+
const count = segments[index];
|
|
98
|
+
if (count === 1)
|
|
99
|
+
return [start];
|
|
100
|
+
const end = outer[(index + 1) % outer.length];
|
|
101
|
+
return Array.from({ length: count }, (_, step) => sideCurvePoint(start, end, edgeCurvature[index], step / count));
|
|
102
|
+
});
|
|
103
|
+
return { outer: contour, holes };
|
|
104
|
+
}
|
|
78
105
|
function outlineClearance(polygon, point) {
|
|
79
106
|
let distanceSquared = Infinity;
|
|
80
107
|
for (const ring of [polygon.outer, ...polygon.holes]) {
|
|
@@ -112,23 +139,31 @@ export function interiorLabelPoint(source) {
|
|
|
112
139
|
const cached = labelPoints.get(source);
|
|
113
140
|
if (cached)
|
|
114
141
|
return cached;
|
|
115
|
-
const
|
|
142
|
+
const labelContour = curvedLabelContour(source);
|
|
143
|
+
const polygon = labelContour ?? polygonContour(source);
|
|
144
|
+
const precisionM = labelContour ? curvedLabelSearchPrecisionM : labelSearchPrecisionM;
|
|
116
145
|
const bounds = pointsBounds(polygon.outer);
|
|
117
146
|
const width = bounds.maxX - bounds.minX, height = bounds.maxY - bounds.minY;
|
|
118
147
|
const roundoffM = Math.max(width, height, Math.abs(bounds.minX), Math.abs(bounds.minY), Math.abs(bounds.maxX), Math.abs(bounds.maxY)) * labelSearchRoundoff;
|
|
119
148
|
const cell = (center, halfWidthM, halfHeightM) => {
|
|
120
149
|
const distanceM = outlineClearance(polygon, center);
|
|
121
|
-
return {
|
|
150
|
+
return {
|
|
151
|
+
center,
|
|
152
|
+
halfWidthM,
|
|
153
|
+
halfHeightM,
|
|
154
|
+
distanceM,
|
|
155
|
+
maximumM: distanceM + Math.hypot(halfWidthM, halfHeightM),
|
|
156
|
+
};
|
|
122
157
|
};
|
|
123
|
-
let best = cell(outlineCentroid(polygon), 0, 0);
|
|
124
158
|
const center = cell({ x: (bounds.minX + bounds.maxX) / 2, y: (bounds.minY + bounds.maxY) / 2 }, 0, 0);
|
|
159
|
+
let best = labelContour ? center : cell(outlineCentroid(polygon), 0, 0);
|
|
125
160
|
if (center.distanceM > best.distanceM + roundoffM)
|
|
126
161
|
best = center;
|
|
127
|
-
// A boundary vertex is
|
|
162
|
+
// A boundary vertex is admissible when the initial candidate falls in a void.
|
|
128
163
|
if (best.distanceM < 0)
|
|
129
164
|
best = cell(polygon.outer[0], 0, 0);
|
|
130
165
|
// No inscribed circle can exceed half the smaller bounding-box dimension.
|
|
131
|
-
if (Math.min(width, height) / 2 - best.distanceM <=
|
|
166
|
+
if (Math.min(width, height) / 2 - best.distanceM <= precisionM) {
|
|
132
167
|
labelPoints.set(source, best.center);
|
|
133
168
|
return best.center;
|
|
134
169
|
}
|
|
@@ -139,7 +174,7 @@ export function interiorLabelPoint(source) {
|
|
|
139
174
|
});
|
|
140
175
|
const smallerSpanM = Math.min(width, height);
|
|
141
176
|
const coarsening = 2 ** Math.max(0, Math.ceil(Math.log2(Math.max(width, height) / smallerSpanM / labelInitialCellLimit)));
|
|
142
|
-
const sizeM = Math.max(
|
|
177
|
+
const sizeM = Math.max(precisionM, smallerSpanM * coarsening);
|
|
143
178
|
const halfWidthM = Math.min(sizeM, width) / 2, halfHeightM = Math.min(sizeM, height) / 2;
|
|
144
179
|
for (let x = bounds.minX; x < bounds.maxX; x += sizeM) {
|
|
145
180
|
for (let y = bounds.minY; y < bounds.maxY; y += sizeM) {
|
|
@@ -150,9 +185,9 @@ export function interiorLabelPoint(source) {
|
|
|
150
185
|
const current = queue.pop();
|
|
151
186
|
if (current.distanceM > best.distanceM + roundoffM)
|
|
152
187
|
best = current;
|
|
153
|
-
if (smallerSpanM / 2 - best.distanceM <=
|
|
188
|
+
if (smallerSpanM / 2 - best.distanceM <= precisionM)
|
|
154
189
|
break;
|
|
155
|
-
if (current.maximumM - best.distanceM <=
|
|
190
|
+
if (current.maximumM - best.distanceM <= precisionM)
|
|
156
191
|
continue;
|
|
157
192
|
const halfWidth = current.halfWidthM / 2, halfHeight = current.halfHeightM / 2;
|
|
158
193
|
if (current.halfWidthM > current.halfHeightM) {
|
package/dist/issues.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare enum IssueCode {
|
|
|
14
14
|
UnknownSeatCategory = "UNKNOWN_SEAT_CATEGORY",
|
|
15
15
|
MissingCategory = "MISSING_CATEGORY",
|
|
16
16
|
MissingCategoryPrice = "MISSING_CATEGORY_PRICE",
|
|
17
|
+
MixedCategoryInventory = "MIXED_CATEGORY_INVENTORY",
|
|
17
18
|
UnsupportedVersion = "UNSUPPORTED_VERSION",
|
|
18
19
|
WorldBounds = "WORLD_BOUNDS",
|
|
19
20
|
DuplicateLabel = "DUPLICATE_LABEL",
|
package/dist/issues.js
CHANGED
|
@@ -14,6 +14,7 @@ export var IssueCode;
|
|
|
14
14
|
IssueCode["UnknownSeatCategory"] = "UNKNOWN_SEAT_CATEGORY";
|
|
15
15
|
IssueCode["MissingCategory"] = "MISSING_CATEGORY";
|
|
16
16
|
IssueCode["MissingCategoryPrice"] = "MISSING_CATEGORY_PRICE";
|
|
17
|
+
IssueCode["MixedCategoryInventory"] = "MIXED_CATEGORY_INVENTORY";
|
|
17
18
|
IssueCode["UnsupportedVersion"] = "UNSUPPORTED_VERSION";
|
|
18
19
|
IssueCode["WorldBounds"] = "WORLD_BOUNDS";
|
|
19
20
|
IssueCode["DuplicateLabel"] = "DUPLICATE_LABEL";
|
|
@@ -282,8 +282,21 @@ export type InventoryNaming = {
|
|
|
282
282
|
code: string;
|
|
283
283
|
name?: string;
|
|
284
284
|
};
|
|
285
|
+
export declare enum TableChairNumberFormat {
|
|
286
|
+
Prefixed = "prefixed",
|
|
287
|
+
Number = "number",
|
|
288
|
+
Letter = "letter"
|
|
289
|
+
}
|
|
290
|
+
export type TableChairNumbering = {
|
|
291
|
+
startAt: number;
|
|
292
|
+
direction: LabelDirection.Forward | LabelDirection.Reverse;
|
|
293
|
+
format: TableChairNumberFormat;
|
|
294
|
+
};
|
|
285
295
|
export type TableLabels = InventoryNaming & {
|
|
296
|
+
/** The physical booking sequence is independent of buyer-facing numbering. */
|
|
286
297
|
chairs: LabelSequence;
|
|
298
|
+
chairNumbering?: TableChairNumbering;
|
|
299
|
+
buyerNoun?: string;
|
|
287
300
|
tableStyle: LabelStyle;
|
|
288
301
|
};
|
|
289
302
|
export declare enum TableBookingMode {
|
|
@@ -330,18 +343,22 @@ export type RoundTableRecipe = {
|
|
|
330
343
|
automaticSize?: boolean;
|
|
331
344
|
seatArcDeg?: number;
|
|
332
345
|
};
|
|
346
|
+
export type TableChairSideSelection = {
|
|
347
|
+
top: boolean;
|
|
348
|
+
bottom: boolean;
|
|
349
|
+
left: boolean;
|
|
350
|
+
right: boolean;
|
|
351
|
+
};
|
|
333
352
|
export type LongTableLayout = {
|
|
334
353
|
recipe: RectangularTableRecipe;
|
|
335
|
-
sides
|
|
336
|
-
top: boolean;
|
|
337
|
-
bottom: boolean;
|
|
338
|
-
left: boolean;
|
|
339
|
-
right: boolean;
|
|
340
|
-
};
|
|
354
|
+
sides?: TableChairSideSelection;
|
|
341
355
|
};
|
|
342
356
|
export type RectangularTable = GroupBase & {
|
|
357
|
+
surfaceColor?: string;
|
|
343
358
|
selling?: TableSelling;
|
|
344
359
|
roundLayout?: RoundTableRecipe;
|
|
360
|
+
/** Side preference set by editing the saved table, independent of the placed chair counts. */
|
|
361
|
+
conversionSides?: TableChairSideSelection;
|
|
345
362
|
kind: SeatingKind.Rectangular;
|
|
346
363
|
recipe: RectangularTableRecipe;
|
|
347
364
|
labels: TableLabels;
|
|
@@ -353,6 +370,7 @@ export type RectangularTable = GroupBase & {
|
|
|
353
370
|
};
|
|
354
371
|
};
|
|
355
372
|
export type RoundTable = GroupBase & {
|
|
373
|
+
surfaceColor?: string;
|
|
356
374
|
selling?: TableSelling;
|
|
357
375
|
longLayout?: LongTableLayout;
|
|
358
376
|
kind: SeatingKind.Round;
|
|
@@ -521,6 +539,7 @@ export type PhysicalDocumentV1 = {
|
|
|
521
539
|
schemaVersion: 1;
|
|
522
540
|
mapId: UUID;
|
|
523
541
|
name: string;
|
|
542
|
+
venueName?: string;
|
|
524
543
|
coordinateSystem: {
|
|
525
544
|
unit: "metre";
|
|
526
545
|
xAxis: "right";
|
|
@@ -91,6 +91,12 @@ export var RowJoin;
|
|
|
91
91
|
RowJoin["Aisle"] = "aisle";
|
|
92
92
|
RowJoin["Continuous"] = "continuous";
|
|
93
93
|
})(RowJoin || (RowJoin = {}));
|
|
94
|
+
export var TableChairNumberFormat;
|
|
95
|
+
(function (TableChairNumberFormat) {
|
|
96
|
+
TableChairNumberFormat["Prefixed"] = "prefixed";
|
|
97
|
+
TableChairNumberFormat["Number"] = "number";
|
|
98
|
+
TableChairNumberFormat["Letter"] = "letter";
|
|
99
|
+
})(TableChairNumberFormat || (TableChairNumberFormat = {}));
|
|
94
100
|
export var TableBookingMode;
|
|
95
101
|
(function (TableBookingMode) {
|
|
96
102
|
TableBookingMode["Individual"] = "individual";
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArcFanFacing, ArcFanFit, ArcFanSectionOrigin } from "./arc-fan.interface.js";
|
|
2
2
|
import { EntranceKind, GateUse, LineCap, LineJoin, LineEnding } from "./wayfinding.interface.js";
|
|
3
|
-
import { TicketRestriction, TableBookingMode, TableChairDistribution, StandingBookingMode, SeatShape, type PhysicalDocumentV1, type SeatingGroup, type SeatSlot, type UUID, NumberingScheme, LabelDirection, RowLabelPosition, AccessNeed, SeatingKind, CurveMode, DecorationKind, LabelAlignment, RowAlignment, RowStagger, RowEnds, RowJoin, SectionOutlineRole, SectionTier, AreaKind, ShapeKind, VenueGlyph } from "./physical-document.interface.js";
|
|
3
|
+
import { TicketRestriction, TableBookingMode, TableChairDistribution, StandingBookingMode, SeatShape, type PhysicalDocumentV1, type SeatingGroup, type SeatSlot, type UUID, NumberingScheme, LabelDirection, TableChairNumberFormat, RowLabelPosition, AccessNeed, SeatingKind, CurveMode, DecorationKind, LabelAlignment, RowAlignment, RowStagger, RowEnds, RowJoin, SectionOutlineRole, SectionTier, AreaKind, ShapeKind, VenueGlyph } from "./physical-document.interface.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { type DomainIssue } from "./issues.js";
|
|
6
6
|
export declare const storedLabelSchema: z.ZodString;
|
|
@@ -86,6 +86,15 @@ export declare const segmentedRowSchema: z.ZodObject<{
|
|
|
86
86
|
labelOverride: z.ZodOptional<z.ZodString>;
|
|
87
87
|
}, z.core.$strict>>;
|
|
88
88
|
}, z.core.$strict>;
|
|
89
|
+
export declare const tableChairNumberingSchema: z.ZodObject<{
|
|
90
|
+
startAt: z.ZodNumber;
|
|
91
|
+
direction: z.ZodEnum<{
|
|
92
|
+
forward: LabelDirection.Forward;
|
|
93
|
+
reverse: LabelDirection.Reverse;
|
|
94
|
+
}>;
|
|
95
|
+
format: z.ZodEnum<typeof TableChairNumberFormat>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export declare const tableBuyerNounSchema: z.ZodString;
|
|
89
98
|
export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
99
|
kind: z.ZodLiteral<SeatingKind.Straight>;
|
|
91
100
|
recipe: z.ZodObject<{
|
|
@@ -115,6 +124,10 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
115
124
|
}, z.core.$strict>;
|
|
116
125
|
sectionId: z.ZodNullable<z.ZodString>;
|
|
117
126
|
sectionOrigin: z.ZodEnum<typeof ArcFanSectionOrigin>;
|
|
127
|
+
sectionOutlineGridOriginM: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
x: z.ZodNumber;
|
|
129
|
+
y: z.ZodNumber;
|
|
130
|
+
}, z.core.$strict>>;
|
|
118
131
|
members: z.ZodArray<z.ZodObject<{
|
|
119
132
|
rowId: z.ZodString;
|
|
120
133
|
bookingLabel: z.ZodString;
|
|
@@ -352,6 +365,10 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
352
365
|
}, z.core.$strict>;
|
|
353
366
|
sectionId: z.ZodNullable<z.ZodString>;
|
|
354
367
|
sectionOrigin: z.ZodEnum<typeof ArcFanSectionOrigin>;
|
|
368
|
+
sectionOutlineGridOriginM: z.ZodOptional<z.ZodObject<{
|
|
369
|
+
x: z.ZodNumber;
|
|
370
|
+
y: z.ZodNumber;
|
|
371
|
+
}, z.core.$strict>>;
|
|
355
372
|
members: z.ZodArray<z.ZodObject<{
|
|
356
373
|
rowId: z.ZodString;
|
|
357
374
|
bookingLabel: z.ZodString;
|
|
@@ -554,6 +571,7 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
554
571
|
}, z.core.$strict>], "kind">>;
|
|
555
572
|
}, z.core.$strict>, z.ZodObject<{
|
|
556
573
|
kind: z.ZodLiteral<SeatingKind.Rectangular>;
|
|
574
|
+
surfaceColor: z.ZodOptional<z.ZodString>;
|
|
557
575
|
selling: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
558
576
|
mode: z.ZodEnum<{
|
|
559
577
|
individual: TableBookingMode.Individual;
|
|
@@ -578,7 +596,14 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
578
596
|
automaticSize: z.ZodOptional<z.ZodBoolean>;
|
|
579
597
|
seatArcDeg: z.ZodOptional<z.ZodNumber>;
|
|
580
598
|
}, z.core.$strict>>;
|
|
599
|
+
conversionSides: z.ZodOptional<z.ZodObject<{
|
|
600
|
+
top: z.ZodBoolean;
|
|
601
|
+
bottom: z.ZodBoolean;
|
|
602
|
+
left: z.ZodBoolean;
|
|
603
|
+
right: z.ZodBoolean;
|
|
604
|
+
}, z.core.$strict>>;
|
|
581
605
|
labels: z.ZodObject<{
|
|
606
|
+
buyerNoun: z.ZodOptional<z.ZodString>;
|
|
582
607
|
chairs: z.ZodObject<{
|
|
583
608
|
scheme: z.ZodEnum<typeof NumberingScheme>;
|
|
584
609
|
startAt: z.ZodNumber;
|
|
@@ -591,6 +616,14 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
591
616
|
}>>;
|
|
592
617
|
lastAt: z.ZodOptional<z.ZodNumber>;
|
|
593
618
|
}, z.core.$strict>;
|
|
619
|
+
chairNumbering: z.ZodOptional<z.ZodObject<{
|
|
620
|
+
startAt: z.ZodNumber;
|
|
621
|
+
direction: z.ZodEnum<{
|
|
622
|
+
forward: LabelDirection.Forward;
|
|
623
|
+
reverse: LabelDirection.Reverse;
|
|
624
|
+
}>;
|
|
625
|
+
format: z.ZodEnum<typeof TableChairNumberFormat>;
|
|
626
|
+
}, z.core.$strict>>;
|
|
594
627
|
tableStyle: z.ZodObject<{
|
|
595
628
|
visible: z.ZodBoolean;
|
|
596
629
|
fontSizeM: z.ZodNumber;
|
|
@@ -831,6 +864,7 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
831
864
|
}, z.core.$strict>], "kind">>;
|
|
832
865
|
}, z.core.$strict>, z.ZodObject<{
|
|
833
866
|
kind: z.ZodLiteral<SeatingKind.Round>;
|
|
867
|
+
surfaceColor: z.ZodOptional<z.ZodString>;
|
|
834
868
|
selling: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
835
869
|
mode: z.ZodEnum<{
|
|
836
870
|
individual: TableBookingMode.Individual;
|
|
@@ -856,14 +890,15 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
856
890
|
chairPitchM: z.ZodOptional<z.ZodNumber>;
|
|
857
891
|
chairDistribution: z.ZodOptional<z.ZodEnum<typeof TableChairDistribution>>;
|
|
858
892
|
}, z.core.$strict>;
|
|
859
|
-
sides: z.ZodObject<{
|
|
893
|
+
sides: z.ZodOptional<z.ZodObject<{
|
|
860
894
|
top: z.ZodBoolean;
|
|
861
895
|
bottom: z.ZodBoolean;
|
|
862
896
|
left: z.ZodBoolean;
|
|
863
897
|
right: z.ZodBoolean;
|
|
864
|
-
}, z.core.$strict
|
|
898
|
+
}, z.core.$strict>>;
|
|
865
899
|
}, z.core.$strict>>;
|
|
866
900
|
labels: z.ZodObject<{
|
|
901
|
+
buyerNoun: z.ZodOptional<z.ZodString>;
|
|
867
902
|
chairs: z.ZodObject<{
|
|
868
903
|
scheme: z.ZodEnum<typeof NumberingScheme>;
|
|
869
904
|
startAt: z.ZodNumber;
|
|
@@ -876,6 +911,14 @@ export declare const groupSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
876
911
|
}>>;
|
|
877
912
|
lastAt: z.ZodOptional<z.ZodNumber>;
|
|
878
913
|
}, z.core.$strict>;
|
|
914
|
+
chairNumbering: z.ZodOptional<z.ZodObject<{
|
|
915
|
+
startAt: z.ZodNumber;
|
|
916
|
+
direction: z.ZodEnum<{
|
|
917
|
+
forward: LabelDirection.Forward;
|
|
918
|
+
reverse: LabelDirection.Reverse;
|
|
919
|
+
}>;
|
|
920
|
+
format: z.ZodEnum<typeof TableChairNumberFormat>;
|
|
921
|
+
}, z.core.$strict>>;
|
|
879
922
|
tableStyle: z.ZodObject<{
|
|
880
923
|
visible: z.ZodBoolean;
|
|
881
924
|
fontSizeM: z.ZodNumber;
|
|
@@ -1039,6 +1082,7 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1039
1082
|
schemaVersion: z.ZodLiteral<1>;
|
|
1040
1083
|
mapId: z.ZodString;
|
|
1041
1084
|
name: z.ZodString;
|
|
1085
|
+
venueName: z.ZodOptional<z.ZodString>;
|
|
1042
1086
|
coordinateSystem: z.ZodObject<{
|
|
1043
1087
|
unit: z.ZodLiteral<"metre">;
|
|
1044
1088
|
xAxis: z.ZodLiteral<"right">;
|
|
@@ -1198,6 +1242,10 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1198
1242
|
}, z.core.$strict>;
|
|
1199
1243
|
sectionId: z.ZodNullable<z.ZodString>;
|
|
1200
1244
|
sectionOrigin: z.ZodEnum<typeof ArcFanSectionOrigin>;
|
|
1245
|
+
sectionOutlineGridOriginM: z.ZodOptional<z.ZodObject<{
|
|
1246
|
+
x: z.ZodNumber;
|
|
1247
|
+
y: z.ZodNumber;
|
|
1248
|
+
}, z.core.$strict>>;
|
|
1201
1249
|
members: z.ZodArray<z.ZodObject<{
|
|
1202
1250
|
rowId: z.ZodString;
|
|
1203
1251
|
bookingLabel: z.ZodString;
|
|
@@ -1435,6 +1483,10 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1435
1483
|
}, z.core.$strict>;
|
|
1436
1484
|
sectionId: z.ZodNullable<z.ZodString>;
|
|
1437
1485
|
sectionOrigin: z.ZodEnum<typeof ArcFanSectionOrigin>;
|
|
1486
|
+
sectionOutlineGridOriginM: z.ZodOptional<z.ZodObject<{
|
|
1487
|
+
x: z.ZodNumber;
|
|
1488
|
+
y: z.ZodNumber;
|
|
1489
|
+
}, z.core.$strict>>;
|
|
1438
1490
|
members: z.ZodArray<z.ZodObject<{
|
|
1439
1491
|
rowId: z.ZodString;
|
|
1440
1492
|
bookingLabel: z.ZodString;
|
|
@@ -1637,6 +1689,7 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1637
1689
|
}, z.core.$strict>], "kind">>;
|
|
1638
1690
|
}, z.core.$strict>, z.ZodObject<{
|
|
1639
1691
|
kind: z.ZodLiteral<SeatingKind.Rectangular>;
|
|
1692
|
+
surfaceColor: z.ZodOptional<z.ZodString>;
|
|
1640
1693
|
selling: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1641
1694
|
mode: z.ZodEnum<{
|
|
1642
1695
|
individual: TableBookingMode.Individual;
|
|
@@ -1661,7 +1714,14 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1661
1714
|
automaticSize: z.ZodOptional<z.ZodBoolean>;
|
|
1662
1715
|
seatArcDeg: z.ZodOptional<z.ZodNumber>;
|
|
1663
1716
|
}, z.core.$strict>>;
|
|
1717
|
+
conversionSides: z.ZodOptional<z.ZodObject<{
|
|
1718
|
+
top: z.ZodBoolean;
|
|
1719
|
+
bottom: z.ZodBoolean;
|
|
1720
|
+
left: z.ZodBoolean;
|
|
1721
|
+
right: z.ZodBoolean;
|
|
1722
|
+
}, z.core.$strict>>;
|
|
1664
1723
|
labels: z.ZodObject<{
|
|
1724
|
+
buyerNoun: z.ZodOptional<z.ZodString>;
|
|
1665
1725
|
chairs: z.ZodObject<{
|
|
1666
1726
|
scheme: z.ZodEnum<typeof NumberingScheme>;
|
|
1667
1727
|
startAt: z.ZodNumber;
|
|
@@ -1674,6 +1734,14 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1674
1734
|
}>>;
|
|
1675
1735
|
lastAt: z.ZodOptional<z.ZodNumber>;
|
|
1676
1736
|
}, z.core.$strict>;
|
|
1737
|
+
chairNumbering: z.ZodOptional<z.ZodObject<{
|
|
1738
|
+
startAt: z.ZodNumber;
|
|
1739
|
+
direction: z.ZodEnum<{
|
|
1740
|
+
forward: LabelDirection.Forward;
|
|
1741
|
+
reverse: LabelDirection.Reverse;
|
|
1742
|
+
}>;
|
|
1743
|
+
format: z.ZodEnum<typeof TableChairNumberFormat>;
|
|
1744
|
+
}, z.core.$strict>>;
|
|
1677
1745
|
tableStyle: z.ZodObject<{
|
|
1678
1746
|
visible: z.ZodBoolean;
|
|
1679
1747
|
fontSizeM: z.ZodNumber;
|
|
@@ -1914,6 +1982,7 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1914
1982
|
}, z.core.$strict>], "kind">>;
|
|
1915
1983
|
}, z.core.$strict>, z.ZodObject<{
|
|
1916
1984
|
kind: z.ZodLiteral<SeatingKind.Round>;
|
|
1985
|
+
surfaceColor: z.ZodOptional<z.ZodString>;
|
|
1917
1986
|
selling: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1918
1987
|
mode: z.ZodEnum<{
|
|
1919
1988
|
individual: TableBookingMode.Individual;
|
|
@@ -1939,14 +2008,15 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1939
2008
|
chairPitchM: z.ZodOptional<z.ZodNumber>;
|
|
1940
2009
|
chairDistribution: z.ZodOptional<z.ZodEnum<typeof TableChairDistribution>>;
|
|
1941
2010
|
}, z.core.$strict>;
|
|
1942
|
-
sides: z.ZodObject<{
|
|
2011
|
+
sides: z.ZodOptional<z.ZodObject<{
|
|
1943
2012
|
top: z.ZodBoolean;
|
|
1944
2013
|
bottom: z.ZodBoolean;
|
|
1945
2014
|
left: z.ZodBoolean;
|
|
1946
2015
|
right: z.ZodBoolean;
|
|
1947
|
-
}, z.core.$strict
|
|
2016
|
+
}, z.core.$strict>>;
|
|
1948
2017
|
}, z.core.$strict>>;
|
|
1949
2018
|
labels: z.ZodObject<{
|
|
2019
|
+
buyerNoun: z.ZodOptional<z.ZodString>;
|
|
1950
2020
|
chairs: z.ZodObject<{
|
|
1951
2021
|
scheme: z.ZodEnum<typeof NumberingScheme>;
|
|
1952
2022
|
startAt: z.ZodNumber;
|
|
@@ -1959,6 +2029,14 @@ export declare const documentSchema: z.ZodObject<{
|
|
|
1959
2029
|
}>>;
|
|
1960
2030
|
lastAt: z.ZodOptional<z.ZodNumber>;
|
|
1961
2031
|
}, z.core.$strict>;
|
|
2032
|
+
chairNumbering: z.ZodOptional<z.ZodObject<{
|
|
2033
|
+
startAt: z.ZodNumber;
|
|
2034
|
+
direction: z.ZodEnum<{
|
|
2035
|
+
forward: LabelDirection.Forward;
|
|
2036
|
+
reverse: LabelDirection.Reverse;
|
|
2037
|
+
}>;
|
|
2038
|
+
format: z.ZodEnum<typeof TableChairNumberFormat>;
|
|
2039
|
+
}, z.core.$strict>>;
|
|
1962
2040
|
tableStyle: z.ZodObject<{
|
|
1963
2041
|
visible: z.ZodBoolean;
|
|
1964
2042
|
fontSizeM: z.ZodNumber;
|
|
@@ -3014,6 +3092,7 @@ export declare const labelSequenceSchema: z.ZodObject<{
|
|
|
3014
3092
|
lastAt: z.ZodOptional<z.ZodNumber>;
|
|
3015
3093
|
}, z.core.$strict>;
|
|
3016
3094
|
export declare const inventoryLabelSchema: z.ZodString;
|
|
3095
|
+
export declare const authoredSectionDisplayLabelSchema: z.ZodString;
|
|
3017
3096
|
export declare const attributesSchema: z.ZodOptional<z.ZodObject<{
|
|
3018
3097
|
wheelchair: z.ZodOptional<z.ZodEnum<{
|
|
3019
3098
|
seat: "seat";
|
|
@@ -3112,6 +3191,12 @@ export declare function validateSequences(group: SeatingGroup): z.ZodSafeParseRe
|
|
|
3112
3191
|
color?: string | undefined;
|
|
3113
3192
|
};
|
|
3114
3193
|
code: string;
|
|
3194
|
+
buyerNoun?: string | undefined;
|
|
3195
|
+
chairNumbering?: {
|
|
3196
|
+
startAt: number;
|
|
3197
|
+
direction: LabelDirection.Forward | LabelDirection.Reverse;
|
|
3198
|
+
format: TableChairNumberFormat;
|
|
3199
|
+
} | undefined;
|
|
3115
3200
|
name?: string | undefined;
|
|
3116
3201
|
}>;
|
|
3117
3202
|
export declare enum DocumentParseStatus {
|
package/dist/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArcFanFacing, ArcFanFit, ArcFanMaximumRows, ArcFanMaximumPartsPerRow, ArcFanSectionOrigin, } from "./arc-fan.interface.js";
|
|
2
2
|
import { EntranceKind, GateUse, LineCap, LineJoin, LineEnding } from "./wayfinding.interface.js";
|
|
3
3
|
import { polygonContour, polygonContourVertexCount, PolygonVertexLimit, PolygonCornerRadiusMaxM, } from "./geometry/polygon-curves.js";
|
|
4
|
-
import { DocumentLimits, TicketRestriction, TableBookingMode, TableChairDistribution, StandingBookingMode, SeatShape, TicketOptionLimit, NumberingScheme, LabelDirection, RowLabelPosition, AccessNeed, SeatingKind, CurveMode, DecorationKind, LabelAlignment, RowAlignment, RowStagger, RowEnds, RowJoin, SectionOutlineRole, RowRefitStrength, SectionRotation, SectionScale, SectionTier, SectionRake, SectionFrontRowHeight, AreaKind, ShapeKind, VenueGlyph, } from "./physical-document.interface.js";
|
|
4
|
+
import { DocumentLimits, TicketRestriction, TableBookingMode, TableChairDistribution, StandingBookingMode, SeatShape, TicketOptionLimit, NumberingScheme, LabelDirection, TableChairNumberFormat, RowLabelPosition, AccessNeed, SeatingKind, CurveMode, DecorationKind, LabelAlignment, RowAlignment, RowStagger, RowEnds, RowJoin, SectionOutlineRole, RowRefitStrength, SectionRotation, SectionScale, SectionTier, SectionRake, SectionFrontRowHeight, AreaKind, ShapeKind, VenueGlyph, } from "./physical-document.interface.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { tableSellingValid, standingSellingValid } from "./selling.js";
|
|
7
7
|
import { ticketOptionNameKey } from "./categories.js";
|
|
@@ -260,9 +260,20 @@ export const segmentedRowSchema = z.strictObject({
|
|
|
260
260
|
.max(DocumentLimits.PhysicalSeats),
|
|
261
261
|
});
|
|
262
262
|
const inventoryNaming = { code: label, name: label.optional() };
|
|
263
|
+
export const tableChairNumberingSchema = z.strictObject({
|
|
264
|
+
startAt: z.number().int().min(0).max(999),
|
|
265
|
+
direction: z.enum([LabelDirection.Forward, LabelDirection.Reverse]),
|
|
266
|
+
format: z.enum(TableChairNumberFormat),
|
|
267
|
+
});
|
|
268
|
+
export const tableBuyerNounSchema = z
|
|
269
|
+
.string()
|
|
270
|
+
.min(1)
|
|
271
|
+
.refine((value) => value === value.trim() && !unsupportedText.test(value), "Use trimmed text without unsupported characters.");
|
|
263
272
|
const tableLabels = z.strictObject({
|
|
264
273
|
...inventoryNaming,
|
|
274
|
+
buyerNoun: tableBuyerNounSchema.optional(),
|
|
265
275
|
chairs: sequence,
|
|
276
|
+
chairNumbering: tableChairNumberingSchema.optional(),
|
|
266
277
|
tableStyle: labelStyle,
|
|
267
278
|
});
|
|
268
279
|
const roundTableRecipe = z.strictObject({
|
|
@@ -279,17 +290,18 @@ const rectangularTableRecipe = z.strictObject({
|
|
|
279
290
|
chairPitchM: dimension.optional(),
|
|
280
291
|
chairDistribution: z.enum(TableChairDistribution).optional(),
|
|
281
292
|
});
|
|
282
|
-
const
|
|
293
|
+
const tableChairSideSelection = z
|
|
283
294
|
.strictObject({
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
left: z.boolean(),
|
|
289
|
-
right: z.boolean(),
|
|
290
|
-
}),
|
|
295
|
+
top: z.boolean(),
|
|
296
|
+
bottom: z.boolean(),
|
|
297
|
+
left: z.boolean(),
|
|
298
|
+
right: z.boolean(),
|
|
291
299
|
})
|
|
292
|
-
.refine((value) => Object.values(value
|
|
300
|
+
.refine((value) => Object.values(value).some(Boolean), "Choose at least one table side.");
|
|
301
|
+
const longTableLayout = z.strictObject({
|
|
302
|
+
recipe: rectangularTableRecipe,
|
|
303
|
+
sides: tableChairSideSelection.optional(),
|
|
304
|
+
});
|
|
293
305
|
const arcFanRecipeSchema = z
|
|
294
306
|
.strictObject({
|
|
295
307
|
rowCount: finite.int().min(1).max(ArcFanMaximumRows),
|
|
@@ -310,6 +322,7 @@ const arcFanGenerationSchema = z.strictObject({
|
|
|
310
322
|
recipe: arcFanRecipeSchema,
|
|
311
323
|
sectionId: uuid.nullable(),
|
|
312
324
|
sectionOrigin: z.enum(ArcFanSectionOrigin),
|
|
325
|
+
sectionOutlineGridOriginM: point.optional(),
|
|
313
326
|
members: z
|
|
314
327
|
.array(z.strictObject({ rowId: uuid, bookingLabel: storedLabelSchema, labelOverride: storedLabelSchema.optional() }))
|
|
315
328
|
.min(1)
|
|
@@ -361,9 +374,11 @@ export const groupSchema = z.discriminatedUnion("kind", [
|
|
|
361
374
|
.strictObject({
|
|
362
375
|
...groupBase,
|
|
363
376
|
kind: z.literal(SeatingKind.Rectangular),
|
|
377
|
+
surfaceColor: hexColourSchema.optional(),
|
|
364
378
|
selling: tableSelling.optional(),
|
|
365
379
|
recipe: rectangularTableRecipe,
|
|
366
380
|
roundLayout: roundTableRecipe.optional(),
|
|
381
|
+
conversionSides: tableChairSideSelection.optional(),
|
|
367
382
|
labels: tableLabels,
|
|
368
383
|
chairsBySide: z.strictObject({
|
|
369
384
|
top: z.array(seat).max(DocumentLimits.PhysicalSeats),
|
|
@@ -378,6 +393,7 @@ export const groupSchema = z.discriminatedUnion("kind", [
|
|
|
378
393
|
.strictObject({
|
|
379
394
|
...groupBase,
|
|
380
395
|
kind: z.literal(SeatingKind.Round),
|
|
396
|
+
surfaceColor: hexColourSchema.optional(),
|
|
381
397
|
selling: tableSelling.optional(),
|
|
382
398
|
recipe: roundTableRecipe,
|
|
383
399
|
longLayout: longTableLayout.optional(),
|
|
@@ -532,6 +548,7 @@ export const documentSchema = z.strictObject({
|
|
|
532
548
|
schemaVersion: z.literal(1),
|
|
533
549
|
mapId: uuid,
|
|
534
550
|
name,
|
|
551
|
+
venueName: name.optional(),
|
|
535
552
|
coordinateSystem: z.strictObject({
|
|
536
553
|
unit: z.literal("metre"),
|
|
537
554
|
xAxis: z.literal("right"),
|
|
@@ -568,7 +585,11 @@ export const documentSchema = z.strictObject({
|
|
|
568
585
|
.describe("Authored section slope and front-row elevation relative to its floor.")
|
|
569
586
|
.optional(),
|
|
570
587
|
categoryId: uuid.nullable().optional(),
|
|
571
|
-
displayLabel:
|
|
588
|
+
displayLabel: z
|
|
589
|
+
.string()
|
|
590
|
+
.refine((value) => !unsupportedText.test(value.replace(/\n/g, "")), "Use text without unsupported characters.")
|
|
591
|
+
.describe("Stored section display name. LF is permitted and generated copy names retain their full text.")
|
|
592
|
+
.optional(),
|
|
572
593
|
outline: polygon.optional(),
|
|
573
594
|
outlineRole: z.enum(SectionOutlineRole).optional(),
|
|
574
595
|
rotationDeg: z.number().int().min(SectionRotation.min).max(SectionRotation.max).optional(),
|
|
@@ -622,6 +643,7 @@ export const rotationSchema = angle;
|
|
|
622
643
|
export const positiveCountSchema = finite.int().min(1).max(DocumentLimits.PhysicalSeats);
|
|
623
644
|
export const labelSequenceSchema = sequence;
|
|
624
645
|
export const inventoryLabelSchema = label;
|
|
646
|
+
export const authoredSectionDisplayLabelSchema = text(80, true);
|
|
625
647
|
export const attributesSchema = seat.shape.attributes;
|
|
626
648
|
export const seatOverrideSchema = seat.shape.override;
|
|
627
649
|
export function validateRecipe(group) {
|
package/dist/section-growth.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { ExpandedInventorySection } from "./section-growth.interface.js";
|
|
|
3
3
|
import { type PhysicalDocumentV1, type UUID } from "./physical-document.interface.js";
|
|
4
4
|
export declare const sectionInventoryGrowthInputSchema: z.ZodObject<{
|
|
5
5
|
inventory: z.ZodArray<z.ZodString>;
|
|
6
|
-
|
|
6
|
+
workspaceSectionId: z.ZodNullable<z.ZodString>;
|
|
7
7
|
}, z.core.$strict>;
|
|
8
|
-
/**
|
|
9
|
-
export declare function expandedInventorySections(before: PhysicalDocumentV1, after: PhysicalDocumentV1, changed: ReadonlySet<UUID>,
|
|
8
|
+
/** Grow the entered workspace for its edited inventory, or the primary boundary for chart-wide edits. */
|
|
9
|
+
export declare function expandedInventorySections(before: PhysicalDocumentV1, after: PhysicalDocumentV1, changed: ReadonlySet<UUID>, workspaceSectionId: UUID | null): ReadonlyMap<UUID, ExpandedInventorySection> | null;
|
|
10
10
|
/** Apply only computed outlines; every other locked section property stays with its source. */
|
|
11
11
|
export declare function projectInventorySectionGrowth(document: PhysicalDocumentV1, grown: ReadonlyMap<UUID, ExpandedInventorySection>): PhysicalDocumentV1;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import type { sectionInventoryGrowthInputSchema } from "./section-growth.js";
|
|
3
|
-
import type { Bounds } from "./geometry/geometry.js";
|
|
3
|
+
import type { Bounds, Matrix } from "./geometry/geometry.js";
|
|
4
4
|
import type { UUID, Section, PolygonM } from "./physical-document.interface.js";
|
|
5
|
-
export interface
|
|
5
|
+
export interface InventoryFootprint {
|
|
6
6
|
bounds: Bounds;
|
|
7
|
+
rowMarkers?: Matrix[];
|
|
8
|
+
}
|
|
9
|
+
export interface InventoryLayout extends InventoryFootprint {
|
|
7
10
|
floorId: UUID | null;
|
|
8
11
|
}
|
|
12
|
+
export interface InventoryGrowthRequest {
|
|
13
|
+
bounds: Bounds;
|
|
14
|
+
rowMarkers: Matrix[];
|
|
15
|
+
otherBounds?: Bounds;
|
|
16
|
+
}
|
|
9
17
|
export type SectionInventoryGrowthInput = z.infer<typeof sectionInventoryGrowthInputSchema>;
|
|
10
18
|
export interface ExpandedInventorySection extends Section {
|
|
11
19
|
outline: PolygonM;
|