@seatmap-fyi/map-domain 0.1.0-alpha.4 → 0.1.0-alpha.48
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 +13 -0
- package/dist/arc-fan-rebuild.js +163 -0
- package/dist/arc-fan.d.ts +27 -0
- package/dist/arc-fan.interface.d.ts +83 -0
- package/dist/arc-fan.interface.js +30 -0
- package/dist/arc-fan.js +182 -0
- package/dist/catalog.d.ts +6 -4
- package/dist/catalog.js +31 -17
- package/dist/categories.d.ts +5 -3
- package/dist/categories.js +104 -25
- package/dist/editor-state.d.ts +4 -1
- package/dist/editor-state.js +53 -30
- package/dist/floors.d.ts +22 -0
- package/dist/floors.js +77 -0
- package/dist/geometry/boundary.d.ts +1 -1
- package/dist/geometry/boundary.js +16 -12
- package/dist/geometry/curve-warnings.d.ts +1 -1
- package/dist/geometry/curve-warnings.js +3 -5
- package/dist/geometry/decoration-bounds.d.ts +4 -0
- package/dist/geometry/decoration-bounds.js +42 -0
- package/dist/geometry/ellipse.js +4 -12
- package/dist/geometry/geometry.d.ts +6 -3
- package/dist/geometry/geometry.js +28 -30
- package/dist/geometry/layout-transform.d.ts +10 -0
- package/dist/geometry/layout-transform.interface.d.ts +6 -0
- package/dist/geometry/layout-transform.interface.js +1 -0
- package/dist/geometry/layout-transform.js +206 -0
- package/dist/geometry/polygon-curves.d.ts +17 -0
- package/dist/geometry/polygon-curves.interface.d.ts +21 -0
- package/dist/geometry/polygon-curves.interface.js +5 -0
- package/dist/geometry/polygon-curves.js +169 -0
- package/dist/geometry/primitives.d.ts +1 -1
- package/dist/geometry/primitives.js +2 -3
- package/dist/geometry/seat-shape.d.ts +1 -1
- package/dist/geometry/seat-shape.js +1 -1
- package/dist/geometry/seating-layout.d.ts +9 -1
- package/dist/geometry/seating-layout.js +66 -57
- package/dist/geometry/units.d.ts +8 -0
- package/dist/geometry/units.js +13 -0
- package/dist/geometry/venue-outline.d.ts +4 -18
- package/dist/geometry/venue-outline.interface.d.ts +23 -0
- package/dist/geometry/venue-outline.interface.js +7 -0
- package/dist/geometry/venue-outline.js +107 -49
- package/dist/identity.d.ts +3 -1
- package/dist/identity.js +32 -17
- package/dist/issues.d.ts +15 -2
- package/dist/issues.js +16 -6
- package/dist/labels.d.ts +6 -1
- package/dist/labels.js +20 -18
- package/dist/layers.d.ts +26 -0
- package/dist/layers.js +86 -0
- package/dist/media.d.ts +27 -0
- package/dist/media.js +89 -0
- package/dist/{types.d.ts → physical-document.interface.d.ts} +117 -4
- package/dist/{types.js → physical-document.interface.js} +17 -0
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +39 -29
- package/dist/reference.js +1 -1
- package/dist/row-segments.d.ts +5 -1
- package/dist/row-segments.js +10 -9
- package/dist/schema.d.ts +591 -14
- package/dist/schema.js +238 -102
- package/dist/seat-proximity.d.ts +4 -0
- package/dist/seat-proximity.js +119 -0
- package/dist/section-elevation.d.ts +5 -0
- package/dist/section-elevation.interface.d.ts +26 -0
- package/dist/section-elevation.interface.js +8 -0
- package/dist/section-elevation.js +53 -0
- package/dist/section-fill-rebuild.d.ts +10 -0
- package/dist/section-fill-rebuild.js +64 -0
- package/dist/section-fill.d.ts +84 -0
- package/dist/section-fill.interface.d.ts +94 -0
- package/dist/section-fill.interface.js +22 -0
- package/dist/section-fill.js +306 -0
- package/dist/section-growth.d.ts +11 -0
- package/dist/section-growth.interface.d.ts +12 -0
- package/dist/section-growth.interface.js +1 -0
- package/dist/section-growth.js +198 -0
- package/dist/section-layout.d.ts +95 -0
- package/dist/section-layout.interface.d.ts +8 -0
- package/dist/section-layout.interface.js +5 -0
- package/dist/section-layout.js +70 -0
- package/dist/section-outline-refit.d.ts +8 -0
- package/dist/section-outline-refit.js +246 -0
- package/dist/section-refit.d.ts +22 -0
- package/dist/section-refit.interface.d.ts +49 -0
- package/dist/section-refit.interface.js +6 -0
- package/dist/section-refit.js +179 -0
- package/dist/section-scale.d.ts +2 -0
- package/dist/section-scale.js +128 -0
- package/dist/sections.d.ts +23 -0
- package/dist/sections.js +144 -0
- package/dist/selling.d.ts +1 -1
- package/dist/selling.js +11 -26
- package/dist/spacing-repairs.d.ts +31 -0
- package/dist/spacing-repairs.js +168 -0
- package/dist/table-layout.d.ts +1 -2
- package/dist/table-layout.js +14 -22
- package/dist/validation.d.ts +7 -2
- package/dist/validation.interface.d.ts +20 -0
- package/dist/validation.interface.js +9 -0
- package/dist/validation.js +221 -85
- package/dist/wayfinding.d.ts +10 -0
- package/dist/wayfinding.interface.d.ts +52 -0
- package/dist/wayfinding.interface.js +28 -0
- package/dist/wayfinding.js +63 -0
- package/package.json +89 -4
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { authoredFloorFocalPoint, DefaultFloorFocalPoint } from "./floors.js";
|
|
3
|
+
import { BoundaryLocation, classifyBoundary, prepareBoundary } from "./geometry/boundary.js";
|
|
4
|
+
import { normalizeAngle } from "./geometry/geometry.js";
|
|
5
|
+
import { sectionOutlineSampleContour, sectionOutlineSamplingScale } from "./section-outline-refit.js";
|
|
6
|
+
import { pointsBounds } from "./geometry/primitives.js";
|
|
7
|
+
import { rowSeatGeometry } from "./geometry/seating-layout.js";
|
|
8
|
+
import { LayoutUnitM } from "./geometry/units.js";
|
|
9
|
+
import { LabelDirection, SeatingKind, SectionOutlineRole, } from "./physical-document.interface.js";
|
|
10
|
+
import { SectionFillDirection, SectionFillNumbering, SectionFillStatus, } from "./section-fill.interface.js";
|
|
11
|
+
export { SectionFillDirection, SectionFillNumbering, SectionFillStatus } from "./section-fill.interface.js";
|
|
12
|
+
export { sectionOutlineSampleContour, sectionOutlineSamplingScale } from "./section-outline-refit.js";
|
|
13
|
+
export { sectionFillRows, reviewSectionFill, sectionFillRowNames } from "./section-fill-rebuild.js";
|
|
14
|
+
const ClearanceM = 18 * LayoutUnitM;
|
|
15
|
+
const GridPhases = 16;
|
|
16
|
+
const BendSteps = 32;
|
|
17
|
+
const GrowAttempts = 8;
|
|
18
|
+
const GrowSlack = 1.04;
|
|
19
|
+
const GrowRetryFactor = 1.08;
|
|
20
|
+
const MinimumPitchM = 20.7 * LayoutUnitM;
|
|
21
|
+
const DegreesPerRadian = 180 / Math.PI;
|
|
22
|
+
const GeometryToleranceM = 1e-9;
|
|
23
|
+
const fillGrids = new WeakMap();
|
|
24
|
+
export const sectionFillDefaults = {
|
|
25
|
+
direction: SectionFillDirection.Straight,
|
|
26
|
+
numbering: SectionFillNumbering.Snake,
|
|
27
|
+
seatPitchM: 24 * LayoutUnitM,
|
|
28
|
+
rowPitchM: 28 * LayoutUnitM,
|
|
29
|
+
};
|
|
30
|
+
export const SectionFillLimits = {
|
|
31
|
+
seats: { min: 1, max: 10_000 },
|
|
32
|
+
rows: { min: 1, max: 100 },
|
|
33
|
+
seatPitchM: { min: 0.25, max: 1.2 },
|
|
34
|
+
rowPitchM: { min: 0.3, max: 1.5 },
|
|
35
|
+
};
|
|
36
|
+
export const sectionFillInputSchema = z.strictObject({
|
|
37
|
+
targetSeats: z.number().int().min(SectionFillLimits.seats.min).max(SectionFillLimits.seats.max),
|
|
38
|
+
rowCount: z.number().int().min(SectionFillLimits.rows.min).max(SectionFillLimits.rows.max).optional(),
|
|
39
|
+
direction: z.enum(SectionFillDirection),
|
|
40
|
+
numbering: z.enum(SectionFillNumbering),
|
|
41
|
+
seatPitchM: z.number().min(SectionFillLimits.seatPitchM.min).max(SectionFillLimits.seatPitchM.max),
|
|
42
|
+
rowPitchM: z.number().min(SectionFillLimits.rowPitchM.min).max(SectionFillLimits.rowPitchM.max),
|
|
43
|
+
});
|
|
44
|
+
export const sectionGrowInputSchema = z.strictObject({
|
|
45
|
+
sectionId: z.uuid(),
|
|
46
|
+
fill: sectionFillInputSchema,
|
|
47
|
+
});
|
|
48
|
+
export function sectionFillFocalPoint(document, section) {
|
|
49
|
+
const zone = document.zones?.find(({ id }) => id === section.zoneId);
|
|
50
|
+
return zone?.focalPoint ?? authoredFloorFocalPoint(document, section.floorId ?? null) ?? DefaultFloorFocalPoint;
|
|
51
|
+
}
|
|
52
|
+
export function planSectionGrowth(document, { sectionId, fill }) {
|
|
53
|
+
const section = document.sections.find(({ id }) => id === sectionId);
|
|
54
|
+
if (!section?.outline || section.outlineRole === SectionOutlineRole.Overview)
|
|
55
|
+
return;
|
|
56
|
+
const focalPoint = sectionFillFocalPoint(document, section);
|
|
57
|
+
const { maximumSeats } = planSectionFill(section.outline, fill, focalPoint, sectionOutlineSamplingScale(section));
|
|
58
|
+
const original = { ...section, outline: section.outline };
|
|
59
|
+
const grown = growSectionOutline(original, fill, focalPoint, maximumSeats);
|
|
60
|
+
return grown ? { section: original, grown } : undefined;
|
|
61
|
+
}
|
|
62
|
+
function scanEdges(rings) {
|
|
63
|
+
const edges = [];
|
|
64
|
+
for (const ring of rings) {
|
|
65
|
+
ring.forEach((point, index) => {
|
|
66
|
+
const next = ring[(index + 1) % ring.length];
|
|
67
|
+
if (point.y === next.y)
|
|
68
|
+
return;
|
|
69
|
+
const [low, high] = point.y < next.y ? [point, next] : [next, point];
|
|
70
|
+
edges.push({ low, high, slope: (high.x - low.x) / (high.y - low.y) });
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return edges.sort((a, b) => a.low.y - b.low.y);
|
|
74
|
+
}
|
|
75
|
+
function scanBands(edges, top, bottom, { rowPitchM, seatPitchM }) {
|
|
76
|
+
let cursor = 0;
|
|
77
|
+
let active = [];
|
|
78
|
+
const bands = [];
|
|
79
|
+
for (let index = 0; top + index * rowPitchM <= bottom + GeometryToleranceM; index++) {
|
|
80
|
+
const y = top + index * rowPitchM;
|
|
81
|
+
active = active.filter((edge) => edge.high.y > y);
|
|
82
|
+
while (cursor < edges.length && edges[cursor].low.y <= y) {
|
|
83
|
+
const edge = edges[cursor++];
|
|
84
|
+
if (edge.high.y > y)
|
|
85
|
+
active.push(edge);
|
|
86
|
+
}
|
|
87
|
+
const crossings = active.map(({ low, slope }) => low.x + (y - low.y) * slope).sort((a, b) => a - b);
|
|
88
|
+
const intervals = [];
|
|
89
|
+
let capacity = 0;
|
|
90
|
+
for (let i = 0; i + 1 < crossings.length; i += 2) {
|
|
91
|
+
const start = crossings[i] + ClearanceM;
|
|
92
|
+
const end = crossings[i + 1] - ClearanceM;
|
|
93
|
+
if (end < start - GeometryToleranceM)
|
|
94
|
+
continue;
|
|
95
|
+
const seats = 1 + Math.floor((end - start + GeometryToleranceM) / seatPitchM);
|
|
96
|
+
intervals.push({ start, end, capacity: seats });
|
|
97
|
+
capacity += seats;
|
|
98
|
+
}
|
|
99
|
+
if (capacity)
|
|
100
|
+
bands.push({ y, intervals, capacity });
|
|
101
|
+
}
|
|
102
|
+
return bands;
|
|
103
|
+
}
|
|
104
|
+
/** Split one track proportionally across its physical parts. */
|
|
105
|
+
function allocateParts(total, capacities) {
|
|
106
|
+
const capacity = capacities.reduce((sum, value) => sum + value, 0);
|
|
107
|
+
const quotas = capacities.map((value) => total * value);
|
|
108
|
+
const counts = quotas.map((quota) => Math.floor(quota / capacity));
|
|
109
|
+
const remaining = total - counts.reduce((sum, value) => sum + value, 0);
|
|
110
|
+
const ranked = quotas
|
|
111
|
+
.map((quota, index) => ({ index, remainder: quota % capacity }))
|
|
112
|
+
.sort((a, b) => b.remainder - a.remainder);
|
|
113
|
+
for (let i = 0; i < remaining; i++)
|
|
114
|
+
counts[ranked[i].index]++;
|
|
115
|
+
return counts;
|
|
116
|
+
}
|
|
117
|
+
/** Fill the least occupied track by capacity, preserving spatial order on ties. */
|
|
118
|
+
function allocateRows(total, capacities) {
|
|
119
|
+
const capacity = capacities.reduce((sum, value) => sum + value, 0);
|
|
120
|
+
const unreserved = total - capacities.length;
|
|
121
|
+
// Take all slots strictly below a common fill ratio before comparing the remaining slots.
|
|
122
|
+
const counts = capacities.map((value) => Math.max(1, Math.ceil((unreserved * value) / capacity)));
|
|
123
|
+
for (let remaining = total - counts.reduce((sum, value) => sum + value, 0); remaining > 0; remaining--) {
|
|
124
|
+
let next = -1;
|
|
125
|
+
for (let i = 0; i < counts.length; i++) {
|
|
126
|
+
if (counts[i] < capacities[i] && (next === -1 || counts[i] * capacities[next] < counts[next] * capacities[i]))
|
|
127
|
+
next = i;
|
|
128
|
+
}
|
|
129
|
+
counts[next]++;
|
|
130
|
+
}
|
|
131
|
+
return counts;
|
|
132
|
+
}
|
|
133
|
+
function fillGrid(contour, angle, input, project) {
|
|
134
|
+
const cached = fillGrids.get(contour);
|
|
135
|
+
if (cached?.angle === angle && cached.seatPitchM === input.seatPitchM && cached.rowPitchM === input.rowPitchM)
|
|
136
|
+
return cached;
|
|
137
|
+
const outer = contour.outer.map(project);
|
|
138
|
+
const { minY, maxY } = pointsBounds(outer);
|
|
139
|
+
const edges = scanEdges([outer, ...contour.holes.map((ring) => ring.map(project))]);
|
|
140
|
+
let best = [];
|
|
141
|
+
let maximum = 0;
|
|
142
|
+
for (let phase = 0; phase < GridPhases; phase++) {
|
|
143
|
+
const top = minY + ClearanceM + (phase * input.rowPitchM) / GridPhases;
|
|
144
|
+
const bands = scanBands(edges, top, maxY - ClearanceM, input)
|
|
145
|
+
.sort((first, second) => second.capacity - first.capacity)
|
|
146
|
+
.slice(0, SectionFillLimits.rows.max);
|
|
147
|
+
const capacity = bands.reduce((sum, band) => sum + band.capacity, 0);
|
|
148
|
+
if (capacity > maximum) {
|
|
149
|
+
best = bands;
|
|
150
|
+
maximum = capacity;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const grid = {
|
|
154
|
+
angle,
|
|
155
|
+
seatPitchM: input.seatPitchM,
|
|
156
|
+
rowPitchM: input.rowPitchM,
|
|
157
|
+
bands: best,
|
|
158
|
+
capacity: maximum,
|
|
159
|
+
};
|
|
160
|
+
fillGrids.set(contour, grid);
|
|
161
|
+
return grid;
|
|
162
|
+
}
|
|
163
|
+
function bendPart(layout, midpoint, seats, bend) {
|
|
164
|
+
const { focalPoint, boundary, normal, clearanceM } = bend;
|
|
165
|
+
const dx = midpoint.x - focalPoint.x;
|
|
166
|
+
const dy = midpoint.y - focalPoint.y;
|
|
167
|
+
const radiusM = Math.hypot(dx, dy);
|
|
168
|
+
const pitchM = layout.seatPitchM;
|
|
169
|
+
if (radiusM < pitchM / 2)
|
|
170
|
+
return layout;
|
|
171
|
+
const tangent = Math.atan2(-dx, dy);
|
|
172
|
+
const tangentDeg = tangent * DegreesPerRadian;
|
|
173
|
+
const facing = Math.abs(normalizeAngle(tangentDeg - layout.rotationDeg)) > 90 ? -1 : 1;
|
|
174
|
+
const halfSweep = Math.min(Math.PI, (seats - 1) * Math.asin(pitchM / (2 * radiusM)));
|
|
175
|
+
const cos = Math.cos(tangent);
|
|
176
|
+
const sin = Math.sin(tangent);
|
|
177
|
+
const geometry = {
|
|
178
|
+
kind: SeatingKind.Straight,
|
|
179
|
+
recipe: { seatPitchM: pitchM, rowPitchM: MinimumPitchM },
|
|
180
|
+
};
|
|
181
|
+
// A bend keeps the part on its original track and seat centers inside the outline and openings.
|
|
182
|
+
for (let step = BendSteps; step > 0; step--) {
|
|
183
|
+
const half = (halfSweep * step) / BendSteps;
|
|
184
|
+
const radius = pitchM / (2 * Math.sin(half / (seats - 1)));
|
|
185
|
+
const along = -facing * radius * Math.sin(half);
|
|
186
|
+
const across = -2 * radius * Math.sin(half / 2) ** 2;
|
|
187
|
+
const candidate = {
|
|
188
|
+
originM: {
|
|
189
|
+
x: midpoint.x + along * cos - across * sin,
|
|
190
|
+
y: midpoint.y + along * sin + across * cos,
|
|
191
|
+
},
|
|
192
|
+
seatPitchM: pitchM,
|
|
193
|
+
curveDeg: 2 * facing * half * DegreesPerRadian,
|
|
194
|
+
rotationDeg: normalizeAngle(tangentDeg + facing * half * DegreesPerRadian + (facing < 0 ? 180 : 0)),
|
|
195
|
+
...(facing < 0 && { seatRotationOffsetDeg: -180 }),
|
|
196
|
+
};
|
|
197
|
+
let seat = 0;
|
|
198
|
+
for (; seat < seats; seat++) {
|
|
199
|
+
const { position } = rowSeatGeometry(geometry, 0, seat, seats, seats, candidate);
|
|
200
|
+
const acrossTrack = (position.x - midpoint.x) * normal.x + (position.y - midpoint.y) * normal.y;
|
|
201
|
+
if (Math.abs(acrossTrack) > clearanceM + GeometryToleranceM ||
|
|
202
|
+
classifyBoundary(boundary, position) === BoundaryLocation.Outside)
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (seat === seats)
|
|
206
|
+
return candidate;
|
|
207
|
+
}
|
|
208
|
+
return layout;
|
|
209
|
+
}
|
|
210
|
+
function outlineCenter(outer) {
|
|
211
|
+
const center = { x: 0, y: 0 };
|
|
212
|
+
for (const point of outer) {
|
|
213
|
+
center.x += point.x / outer.length;
|
|
214
|
+
center.y += point.y / outer.length;
|
|
215
|
+
}
|
|
216
|
+
return center;
|
|
217
|
+
}
|
|
218
|
+
/** Preview a section fill without allocating inventory identities or editing the outline. */
|
|
219
|
+
export function planSectionFill(outline, request, focalPoint, sampleScale = 1) {
|
|
220
|
+
const input = sectionFillInputSchema.parse(request);
|
|
221
|
+
const contour = sectionOutlineSampleContour(outline, sampleScale);
|
|
222
|
+
const recipe = {
|
|
223
|
+
seatPitchM: Math.max(input.seatPitchM, MinimumPitchM),
|
|
224
|
+
rowPitchM: Math.max(input.rowPitchM, MinimumPitchM),
|
|
225
|
+
};
|
|
226
|
+
const center = outlineCenter(contour.outer);
|
|
227
|
+
const dx = center.x - focalPoint.x;
|
|
228
|
+
const dy = center.y - focalPoint.y;
|
|
229
|
+
const angle = input.direction === SectionFillDirection.Focal && (dx || dy) ? Math.atan2(-dx, dy) : 0;
|
|
230
|
+
const cos = Math.cos(angle);
|
|
231
|
+
const sin = Math.sin(angle);
|
|
232
|
+
const project = ({ x, y }) => ({
|
|
233
|
+
x: (x - center.x) * cos + (y - center.y) * sin,
|
|
234
|
+
y: (y - center.y) * cos - (x - center.x) * sin,
|
|
235
|
+
});
|
|
236
|
+
const grid = fillGrid(contour, angle, recipe, project);
|
|
237
|
+
const selected = grid.bands.slice(0, input.rowCount ?? input.targetSeats).sort((a, b) => a.y - b.y);
|
|
238
|
+
const maximumSeats = input.rowCount === undefined ? grid.capacity : selected.reduce((sum, band) => sum + band.capacity, 0);
|
|
239
|
+
const limits = { maximumRows: grid.bands.length, maximumSeats, recipe };
|
|
240
|
+
if (input.rowCount !== undefined && (input.rowCount > grid.bands.length || input.rowCount > input.targetSeats))
|
|
241
|
+
return { ...limits, status: SectionFillStatus.Rows, rows: [] };
|
|
242
|
+
if (input.targetSeats > maximumSeats)
|
|
243
|
+
return { ...limits, status: SectionFillStatus.Capacity, rows: [] };
|
|
244
|
+
const distribution = allocateRows(input.targetSeats, selected.map((band) => band.capacity));
|
|
245
|
+
const rotationDeg = normalizeAngle(angle * DegreesPerRadian);
|
|
246
|
+
const clearanceM = recipe.rowPitchM - MinimumPitchM;
|
|
247
|
+
const bend = input.direction === SectionFillDirection.Focal && clearanceM > 0
|
|
248
|
+
? { focalPoint, clearanceM, boundary: prepareBoundary(contour), normal: { x: -sin, y: cos } }
|
|
249
|
+
: null;
|
|
250
|
+
const world = (x, y) => ({
|
|
251
|
+
x: center.x + x * cos - y * sin,
|
|
252
|
+
y: center.y + x * sin + y * cos,
|
|
253
|
+
});
|
|
254
|
+
const rows = selected.map((band, index) => {
|
|
255
|
+
const counts = allocateParts(distribution[index], band.intervals.map((interval) => interval.capacity));
|
|
256
|
+
const parts = band.intervals.flatMap((interval, part) => {
|
|
257
|
+
const seats = counts[part];
|
|
258
|
+
if (!seats)
|
|
259
|
+
return [];
|
|
260
|
+
const midpoint = (interval.start + interval.end) / 2;
|
|
261
|
+
const layout = {
|
|
262
|
+
originM: world(midpoint - ((seats - 1) * recipe.seatPitchM) / 2, band.y),
|
|
263
|
+
seatPitchM: recipe.seatPitchM,
|
|
264
|
+
curveDeg: 0,
|
|
265
|
+
rotationDeg,
|
|
266
|
+
};
|
|
267
|
+
return [{ layout: bend && seats > 2 ? bendPart(layout, world(midpoint, band.y), seats, bend) : layout, seats }];
|
|
268
|
+
});
|
|
269
|
+
const reversed = input.numbering === SectionFillNumbering.RightToLeft ||
|
|
270
|
+
(input.numbering === SectionFillNumbering.Snake && index % 2 === 1);
|
|
271
|
+
return { parts, numbering: reversed ? LabelDirection.Reverse : LabelDirection.Forward };
|
|
272
|
+
});
|
|
273
|
+
return { ...limits, status: SectionFillStatus.Fits, rows };
|
|
274
|
+
}
|
|
275
|
+
/** Grow only the authored outline and its openings. Inventory keeps its current layout. */
|
|
276
|
+
export function growSectionOutline(section, request, focalPoint, maximumSeats) {
|
|
277
|
+
if (request.targetSeats <= maximumSeats || (request.rowCount ?? 0) > request.targetSeats)
|
|
278
|
+
return;
|
|
279
|
+
const sampleScale = sectionOutlineSamplingScale(section);
|
|
280
|
+
const contour = sectionOutlineSampleContour(section.outline, sampleScale);
|
|
281
|
+
const center = outlineCenter(contour.outer);
|
|
282
|
+
const curved = contour !== section.outline;
|
|
283
|
+
let factor = GrowSlack * Math.sqrt(request.targetSeats / Math.max(1, maximumSeats));
|
|
284
|
+
for (let attempt = 0; attempt < GrowAttempts; attempt++, factor *= GrowRetryFactor) {
|
|
285
|
+
const scale = ({ x, y }) => ({
|
|
286
|
+
x: center.x + (x - center.x) * factor,
|
|
287
|
+
y: center.y + (y - center.y) * factor,
|
|
288
|
+
});
|
|
289
|
+
const outline = {
|
|
290
|
+
...section.outline,
|
|
291
|
+
outer: section.outline.outer.map(scale),
|
|
292
|
+
holes: section.outline.holes.map((ring) => ring.map(scale)),
|
|
293
|
+
...(section.outline.cornerRadiusM && { cornerRadiusM: section.outline.cornerRadiusM * factor }),
|
|
294
|
+
};
|
|
295
|
+
const plan = planSectionFill(outline, request, focalPoint, curved ? sampleScale * factor : sampleScale);
|
|
296
|
+
if (plan.maximumSeats >= request.targetSeats) {
|
|
297
|
+
return {
|
|
298
|
+
...section,
|
|
299
|
+
outline,
|
|
300
|
+
...(curved && { outlineGrowthFactor: (section.outlineGrowthFactor ?? 1) * factor }),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// The reference records the attempted Grow even when it keeps the same authored outline.
|
|
305
|
+
return { ...section };
|
|
306
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ExpandedInventorySection } from "./section-growth.interface.js";
|
|
3
|
+
import { type PhysicalDocumentV1, type UUID } from "./physical-document.interface.js";
|
|
4
|
+
export declare const sectionInventoryGrowthInputSchema: z.ZodObject<{
|
|
5
|
+
inventory: z.ZodArray<z.ZodString>;
|
|
6
|
+
createdInSection: z.ZodNullable<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
/** Expand boundaries atomically for moved/resized inventory and rows drawn in the active section. */
|
|
9
|
+
export declare function expandedInventorySections(before: PhysicalDocumentV1, after: PhysicalDocumentV1, changed: ReadonlySet<UUID>, createdInSection: UUID | null): ReadonlyMap<UUID, ExpandedInventorySection> | null;
|
|
10
|
+
/** Apply only computed outlines; every other locked section property stays with its source. */
|
|
11
|
+
export declare function projectInventorySectionGrowth(document: PhysicalDocumentV1, grown: ReadonlyMap<UUID, ExpandedInventorySection>): PhysicalDocumentV1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { sectionInventoryGrowthInputSchema } from "./section-growth.js";
|
|
3
|
+
import type { Bounds } from "./geometry/geometry.js";
|
|
4
|
+
import type { UUID, Section, PolygonM } from "./physical-document.interface.js";
|
|
5
|
+
export interface InventoryLayout {
|
|
6
|
+
bounds: Bounds;
|
|
7
|
+
floorId: UUID | null;
|
|
8
|
+
}
|
|
9
|
+
export type SectionInventoryGrowthInput = z.infer<typeof sectionInventoryGrowthInputSchema>;
|
|
10
|
+
export interface ExpandedInventorySection extends Section {
|
|
11
|
+
outline: PolygonM;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { polygonContour } from "./geometry/polygon-curves.js";
|
|
3
|
+
import { objectFloorId } from "./floors.js";
|
|
4
|
+
import { sectionCatalog } from "./sections.js";
|
|
5
|
+
import { uuidSchema, coordinateSchema } from "./schema.js";
|
|
6
|
+
import { footprintInBoundary, prepareBoundary } from "./geometry/boundary.js";
|
|
7
|
+
import { LayoutUnitM } from "./geometry/units.js";
|
|
8
|
+
import { emptyBounds, extend, footprint, generatedSeats, pointsBounds, multiply, transformMatrix, project, tableBodyBounds, worldMatrices, } from "./geometry/geometry.js";
|
|
9
|
+
import { SectionOutlineRole, ShapeKind, AreaKind, } from "./physical-document.interface.js";
|
|
10
|
+
export const sectionInventoryGrowthInputSchema = z.strictObject({
|
|
11
|
+
inventory: z.array(uuidSchema).nonempty(),
|
|
12
|
+
createdInSection: uuidSchema.nullable(),
|
|
13
|
+
});
|
|
14
|
+
const growthPaddingM = 5 * LayoutUnitM;
|
|
15
|
+
const growthStep = 1.15;
|
|
16
|
+
const minimumSeatBoundsM = 20 * LayoutUnitM;
|
|
17
|
+
const standingBoundsPaddingM = 10 * LayoutUnitM;
|
|
18
|
+
function corners(bounds) {
|
|
19
|
+
return [
|
|
20
|
+
{ x: bounds.minX, y: bounds.minY },
|
|
21
|
+
{ x: bounds.maxX, y: bounds.minY },
|
|
22
|
+
{ x: bounds.maxX, y: bounds.maxY },
|
|
23
|
+
{ x: bounds.minX, y: bounds.maxY },
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
function groupBounds(group, matrix) {
|
|
27
|
+
const bounds = new Map();
|
|
28
|
+
for (const seat of generatedSeats(group)) {
|
|
29
|
+
const id = seat.rowId ?? group.id;
|
|
30
|
+
const box = bounds.get(id) ?? emptyBounds();
|
|
31
|
+
const marker = {
|
|
32
|
+
...seat,
|
|
33
|
+
size: {
|
|
34
|
+
width: Math.max(seat.size.width, minimumSeatBoundsM),
|
|
35
|
+
height: Math.max(seat.size.height, minimumSeatBoundsM),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
if (seat.rowId !== null) {
|
|
39
|
+
const seatMatrix = multiply(matrix, transformMatrix({ positionM: seat.position, rotationDeg: seat.rotationDeg }));
|
|
40
|
+
const radiusX = Math.hypot(seatMatrix.a * marker.size.width, seatMatrix.c * marker.size.height) / 2;
|
|
41
|
+
const radiusY = Math.hypot(seatMatrix.b * marker.size.width, seatMatrix.d * marker.size.height) / 2;
|
|
42
|
+
extend(box, { x: seatMatrix.tx - radiusX, y: seatMatrix.ty - radiusY });
|
|
43
|
+
extend(box, { x: seatMatrix.tx + radiusX, y: seatMatrix.ty + radiusY });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
for (const point of footprint(marker, matrix))
|
|
47
|
+
extend(box, point);
|
|
48
|
+
}
|
|
49
|
+
bounds.set(id, box);
|
|
50
|
+
}
|
|
51
|
+
const body = tableBodyBounds(group, matrix);
|
|
52
|
+
if (body) {
|
|
53
|
+
const box = bounds.get(group.id) ?? emptyBounds();
|
|
54
|
+
extend(box, { x: body.minX, y: body.minY });
|
|
55
|
+
extend(box, { x: body.maxX, y: body.maxY });
|
|
56
|
+
bounds.set(group.id, box);
|
|
57
|
+
}
|
|
58
|
+
return bounds;
|
|
59
|
+
}
|
|
60
|
+
function areaBounds(area, matrix) {
|
|
61
|
+
const shape = area.shape;
|
|
62
|
+
const points = shape.kind === ShapeKind.Polygon
|
|
63
|
+
? polygonContour(shape.boundary).outer
|
|
64
|
+
: corners({
|
|
65
|
+
minX: -shape.widthM / 2,
|
|
66
|
+
maxX: shape.widthM / 2,
|
|
67
|
+
minY: -shape.heightM / 2,
|
|
68
|
+
maxY: shape.heightM / 2,
|
|
69
|
+
});
|
|
70
|
+
const bounds = pointsBounds(points.map((point) => project(matrix, point)));
|
|
71
|
+
if (area.kind !== AreaKind.GeneralAdmission)
|
|
72
|
+
return bounds;
|
|
73
|
+
return {
|
|
74
|
+
minX: bounds.minX - standingBoundsPaddingM,
|
|
75
|
+
minY: bounds.minY - standingBoundsPaddingM,
|
|
76
|
+
maxX: bounds.maxX + standingBoundsPaddingM,
|
|
77
|
+
maxY: bounds.maxY + standingBoundsPaddingM,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function affectedInventory(document, changed) {
|
|
81
|
+
const entities = new Map([...document.collections, ...document.seatingGroups, ...document.areas].map((entity) => [entity.id, entity]));
|
|
82
|
+
const affected = new Map();
|
|
83
|
+
const changedAncestor = (id) => {
|
|
84
|
+
const cached = affected.get(id);
|
|
85
|
+
if (cached !== undefined)
|
|
86
|
+
return cached;
|
|
87
|
+
const parent = entities.get(id).parentId;
|
|
88
|
+
const result = changed.has(id) || (parent !== null && changedAncestor(parent));
|
|
89
|
+
affected.set(id, result);
|
|
90
|
+
return result;
|
|
91
|
+
};
|
|
92
|
+
const matrices = worldMatrices(document);
|
|
93
|
+
const layouts = new Map();
|
|
94
|
+
for (const group of document.seatingGroups)
|
|
95
|
+
if (changedAncestor(group.id)) {
|
|
96
|
+
const floorId = objectFloorId(document, group.id);
|
|
97
|
+
for (const [id, bounds] of groupBounds(group, matrices.get(group.id)))
|
|
98
|
+
layouts.set(id, { bounds, floorId });
|
|
99
|
+
}
|
|
100
|
+
for (const area of document.areas)
|
|
101
|
+
if (changedAncestor(area.id))
|
|
102
|
+
layouts.set(area.id, {
|
|
103
|
+
bounds: areaBounds(area, matrices.get(area.id)),
|
|
104
|
+
floorId: objectFloorId(document, area.id),
|
|
105
|
+
});
|
|
106
|
+
return layouts;
|
|
107
|
+
}
|
|
108
|
+
/** Expand boundaries atomically for moved/resized inventory and rows drawn in the active section. */
|
|
109
|
+
export function expandedInventorySections(before, after, changed, createdInSection) {
|
|
110
|
+
const result = new Map();
|
|
111
|
+
if (!changed.size || !before.sections.length)
|
|
112
|
+
return result;
|
|
113
|
+
const sections = new Map(after.sections.map((section) => [section.id, section]));
|
|
114
|
+
// An authored boundary transform owns its geometry, including overlapping sections' shared inventory.
|
|
115
|
+
if (before.sections.some((section) => {
|
|
116
|
+
const next = sections.get(section.id);
|
|
117
|
+
return (next && next.outline !== section.outline && JSON.stringify(section.outline) !== JSON.stringify(next.outline));
|
|
118
|
+
}))
|
|
119
|
+
return result;
|
|
120
|
+
const owners = sectionCatalog(before).owners;
|
|
121
|
+
const oldBounds = affectedInventory(before, changed);
|
|
122
|
+
const nextBounds = affectedInventory(after, changed);
|
|
123
|
+
const requested = new Map();
|
|
124
|
+
for (const [id, nextLayout] of nextBounds) {
|
|
125
|
+
const oldLayout = oldBounds.get(id);
|
|
126
|
+
if (oldLayout) {
|
|
127
|
+
if (oldLayout.floorId !== nextLayout.floorId)
|
|
128
|
+
continue;
|
|
129
|
+
const oldBox = oldLayout.bounds;
|
|
130
|
+
const nextBox = nextLayout.bounds;
|
|
131
|
+
if (oldBox.minX === nextBox.minX &&
|
|
132
|
+
oldBox.minY === nextBox.minY &&
|
|
133
|
+
oldBox.maxX === nextBox.maxX &&
|
|
134
|
+
oldBox.maxY === nextBox.maxY)
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const owner = oldLayout ? owners.get(id) : createdInSection;
|
|
138
|
+
if (!owner)
|
|
139
|
+
continue;
|
|
140
|
+
const nextBox = nextLayout.bounds;
|
|
141
|
+
const section = sections.get(owner);
|
|
142
|
+
if (!section?.outline || section.outlineRole === SectionOutlineRole.Overview)
|
|
143
|
+
continue;
|
|
144
|
+
if (nextLayout.floorId !== (section.floorId ?? null))
|
|
145
|
+
continue;
|
|
146
|
+
const box = requested.get(owner) ?? emptyBounds();
|
|
147
|
+
extend(box, { x: nextBox.minX, y: nextBox.minY });
|
|
148
|
+
extend(box, { x: nextBox.maxX, y: nextBox.maxY });
|
|
149
|
+
requested.set(owner, box);
|
|
150
|
+
}
|
|
151
|
+
for (const [id, box] of requested) {
|
|
152
|
+
const section = sections.get(id);
|
|
153
|
+
const outline = section.outline;
|
|
154
|
+
const target = corners(box);
|
|
155
|
+
const contains = (outer) => footprintInBoundary(prepareBoundary({ ...outline, outer, holes: [] }), target);
|
|
156
|
+
if (contains(outline.outer))
|
|
157
|
+
continue;
|
|
158
|
+
const oldBox = pointsBounds(outline.outer);
|
|
159
|
+
const left = Math.min(oldBox.minX, box.minX - growthPaddingM);
|
|
160
|
+
const top = Math.min(oldBox.minY, box.minY - growthPaddingM);
|
|
161
|
+
const width = Math.max(oldBox.maxX, box.maxX + growthPaddingM) - left;
|
|
162
|
+
const height = Math.max(oldBox.maxY, box.maxY + growthPaddingM) - top;
|
|
163
|
+
let outer = outline.outer.map((point) => ({
|
|
164
|
+
x: left + ((point.x - oldBox.minX) / (oldBox.maxX - oldBox.minX)) * width,
|
|
165
|
+
y: top + ((point.y - oldBox.minY) / (oldBox.maxY - oldBox.minY)) * height,
|
|
166
|
+
}));
|
|
167
|
+
while (!contains(outer)) {
|
|
168
|
+
const center = outer.reduce((sum, point) => ({ x: sum.x + point.x / outer.length, y: sum.y + point.y / outer.length }), { x: 0, y: 0 });
|
|
169
|
+
outer = outer.map((point) => ({
|
|
170
|
+
x: center.x + (point.x - center.x) * growthStep,
|
|
171
|
+
y: center.y + (point.y - center.y) * growthStep,
|
|
172
|
+
}));
|
|
173
|
+
// Canonical coordinate limits bound preparation, including a concave outline that cannot enclose the edit.
|
|
174
|
+
const bounds = pointsBounds(polygonContour({ ...outline, outer, holes: [] }).outer);
|
|
175
|
+
for (const coordinate of [bounds.minX, bounds.minY, bounds.maxX, bounds.maxY])
|
|
176
|
+
if (!coordinateSchema.safeParse(coordinate).success)
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
const grownBox = pointsBounds(outer);
|
|
180
|
+
const growPoint = (point) => ({
|
|
181
|
+
x: grownBox.minX + ((point.x - oldBox.minX) / (oldBox.maxX - oldBox.minX)) * (grownBox.maxX - grownBox.minX),
|
|
182
|
+
y: grownBox.minY + ((point.y - oldBox.minY) / (oldBox.maxY - oldBox.minY)) * (grownBox.maxY - grownBox.minY),
|
|
183
|
+
});
|
|
184
|
+
const holes = outline.holes.map((hole) => hole.map(growPoint));
|
|
185
|
+
result.set(id, { ...section, outline: { ...outline, outer, holes } });
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
/** Apply only computed outlines; every other locked section property stays with its source. */
|
|
190
|
+
export function projectInventorySectionGrowth(document, grown) {
|
|
191
|
+
return {
|
|
192
|
+
...document,
|
|
193
|
+
sections: document.sections.map((section) => {
|
|
194
|
+
const next = grown.get(section.id);
|
|
195
|
+
return next ? { ...section, outline: next.outline } : section;
|
|
196
|
+
}),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type PhysicalDocumentV1 } from "./physical-document.interface.js";
|
|
3
|
+
import { SectionLayoutSaveKind, type SectionTransformInput } from "./section-layout.interface.js";
|
|
4
|
+
export { SectionLayoutSaveKind, type SectionLayoutInput, type SectionTransformInput, } from "./section-layout.interface.js";
|
|
5
|
+
export declare const sectionRotationInputSchema: z.ZodObject<{
|
|
6
|
+
sectionId: z.ZodUUID;
|
|
7
|
+
rotationDeg: z.ZodNumber;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export declare const sectionTransformInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
10
|
+
sectionId: z.ZodUUID;
|
|
11
|
+
rotationDeg: z.ZodNumber;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
sectionId: z.ZodUUID;
|
|
14
|
+
scalePercent: z.ZodNumber;
|
|
15
|
+
}, z.core.$strict>]>;
|
|
16
|
+
export declare const sectionLayoutInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
17
|
+
sectionId: z.ZodUUID;
|
|
18
|
+
follow: z.ZodEnum<typeof import("./section-refit.interface.js").RefitFollow>;
|
|
19
|
+
strength: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
21
|
+
sectionId: z.ZodUUID;
|
|
22
|
+
rotationDeg: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
sectionId: z.ZodUUID;
|
|
25
|
+
scalePercent: z.ZodNumber;
|
|
26
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
27
|
+
sectionId: z.ZodUUID;
|
|
28
|
+
fill: z.ZodObject<{
|
|
29
|
+
targetSeats: z.ZodNumber;
|
|
30
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
direction: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillDirection>;
|
|
32
|
+
numbering: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillNumbering>;
|
|
33
|
+
seatPitchM: z.ZodNumber;
|
|
34
|
+
rowPitchM: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
+
inventory: z.ZodArray<z.ZodString>;
|
|
38
|
+
createdInSection: z.ZodNullable<z.ZodString>;
|
|
39
|
+
}, z.core.$strict>]>;
|
|
40
|
+
export declare const sectionLayoutSaveSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
kind: z.ZodLiteral<SectionLayoutSaveKind.Apply>;
|
|
42
|
+
input: z.ZodUnion<readonly [z.ZodObject<{
|
|
43
|
+
sectionId: z.ZodUUID;
|
|
44
|
+
follow: z.ZodEnum<typeof import("./section-refit.interface.js").RefitFollow>;
|
|
45
|
+
strength: z.ZodNumber;
|
|
46
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
47
|
+
sectionId: z.ZodUUID;
|
|
48
|
+
rotationDeg: z.ZodNumber;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
sectionId: z.ZodUUID;
|
|
51
|
+
scalePercent: z.ZodNumber;
|
|
52
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
53
|
+
sectionId: z.ZodUUID;
|
|
54
|
+
fill: z.ZodObject<{
|
|
55
|
+
targetSeats: z.ZodNumber;
|
|
56
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
direction: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillDirection>;
|
|
58
|
+
numbering: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillNumbering>;
|
|
59
|
+
seatPitchM: z.ZodNumber;
|
|
60
|
+
rowPitchM: z.ZodNumber;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
inventory: z.ZodArray<z.ZodString>;
|
|
64
|
+
createdInSection: z.ZodNullable<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>]>;
|
|
66
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
67
|
+
kind: z.ZodLiteral<SectionLayoutSaveKind.Undo>;
|
|
68
|
+
input: z.ZodUnion<readonly [z.ZodObject<{
|
|
69
|
+
sectionId: z.ZodUUID;
|
|
70
|
+
follow: z.ZodEnum<typeof import("./section-refit.interface.js").RefitFollow>;
|
|
71
|
+
strength: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
|
|
73
|
+
sectionId: z.ZodUUID;
|
|
74
|
+
rotationDeg: z.ZodNumber;
|
|
75
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
+
sectionId: z.ZodUUID;
|
|
77
|
+
scalePercent: z.ZodNumber;
|
|
78
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
79
|
+
sectionId: z.ZodUUID;
|
|
80
|
+
fill: z.ZodObject<{
|
|
81
|
+
targetSeats: z.ZodNumber;
|
|
82
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
direction: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillDirection>;
|
|
84
|
+
numbering: z.ZodEnum<typeof import("./section-fill.interface.js").SectionFillNumbering>;
|
|
85
|
+
seatPitchM: z.ZodNumber;
|
|
86
|
+
rowPitchM: z.ZodNumber;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
inventory: z.ZodArray<z.ZodString>;
|
|
90
|
+
createdInSection: z.ZodNullable<z.ZodString>;
|
|
91
|
+
}, z.core.$strict>]>;
|
|
92
|
+
beforeRevision: z.ZodNumber;
|
|
93
|
+
}, z.core.$strict>], "kind">;
|
|
94
|
+
/** Apply the change in the numeric control to the existing geometry. */
|
|
95
|
+
export declare function transformSection(document: PhysicalDocumentV1, input: SectionTransformInput): PhysicalDocumentV1 | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { sectionLayoutInputSchema, sectionTransformInputSchema } from "./section-layout.js";
|
|
3
|
+
export declare enum SectionLayoutSaveKind {
|
|
4
|
+
Apply = "apply",
|
|
5
|
+
Undo = "undo"
|
|
6
|
+
}
|
|
7
|
+
export type SectionTransformInput = z.infer<typeof sectionTransformInputSchema>;
|
|
8
|
+
export type SectionLayoutInput = z.infer<typeof sectionLayoutInputSchema>;
|