@kerusiweb/core 2.3.0 → 3.1.0
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/LICENSE +22 -22
- package/README.md +74 -68
- package/dist/kerusi/index.d.ts +4 -3
- package/dist/kerusi/index.d.ts.map +1 -1
- package/dist/kerusi/index.js +4 -3
- package/dist/kerusi/index.js.map +1 -1
- package/dist/kerusi/kerusi-geometry.d.ts +47 -0
- package/dist/kerusi/kerusi-geometry.d.ts.map +1 -0
- package/dist/kerusi/kerusi-geometry.js +111 -0
- package/dist/kerusi/kerusi-geometry.js.map +1 -0
- package/dist/kerusi/kerusi-map.model.d.ts +121 -68
- package/dist/kerusi/kerusi-map.model.d.ts.map +1 -1
- package/dist/kerusi/kerusi-map.model.js +6 -2
- package/dist/kerusi/kerusi-map.model.js.map +1 -1
- package/dist/kerusi/kerusi-rows.d.ts +2 -2
- package/dist/kerusi/kerusi-rows.js +2 -2
- package/dist/kerusi/kerusi-validator.d.ts +18 -9
- package/dist/kerusi/kerusi-validator.d.ts.map +1 -1
- package/dist/kerusi/kerusi-validator.js +301 -122
- package/dist/kerusi/kerusi-validator.js.map +1 -1
- package/dist/render/build-render-model.d.ts +8 -4
- package/dist/render/build-render-model.d.ts.map +1 -1
- package/dist/render/build-render-model.js +147 -45
- package/dist/render/build-render-model.js.map +1 -1
- package/dist/render/index.d.ts +1 -1
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/map-layout.d.ts +92 -0
- package/dist/render/map-layout.d.ts.map +1 -0
- package/dist/render/map-layout.js +93 -0
- package/dist/render/map-layout.js.map +1 -0
- package/dist/render/navigation-order.d.ts +20 -10
- package/dist/render/navigation-order.d.ts.map +1 -1
- package/dist/render/navigation-order.js +72 -57
- package/dist/render/navigation-order.js.map +1 -1
- package/dist/render/render-model.d.ts +48 -26
- package/dist/render/render-model.d.ts.map +1 -1
- package/dist/render/seat-shapes.d.ts +3 -3
- package/dist/render/seat-shapes.js +3 -3
- package/dist/view/index.d.ts +6 -2
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/index.js +6 -2
- package/dist/view/index.js.map +1 -1
- package/dist/view/rtl.d.ts +1 -1
- package/dist/view/rtl.js +1 -1
- package/dist/view/seat-aria.d.ts +6 -0
- package/dist/view/seat-aria.d.ts.map +1 -1
- package/dist/view/seat-aria.js +8 -0
- package/dist/view/seat-aria.js.map +1 -1
- package/dist/view/seat-card-placement.d.ts +60 -0
- package/dist/view/seat-card-placement.d.ts.map +1 -0
- package/dist/view/seat-card-placement.js +94 -0
- package/dist/view/seat-card-placement.js.map +1 -0
- package/dist/view/seat-card.d.ts +83 -0
- package/dist/view/seat-card.d.ts.map +1 -0
- package/dist/view/seat-card.js +68 -0
- package/dist/view/seat-card.js.map +1 -0
- package/dist/view/seat-glyph.d.ts +1 -1
- package/dist/view/seat-glyph.d.ts.map +1 -1
- package/dist/view/seat-hover.d.ts +90 -0
- package/dist/view/seat-hover.d.ts.map +1 -0
- package/dist/view/seat-hover.js +205 -0
- package/dist/view/seat-hover.js.map +1 -0
- package/dist/view/viewport.d.ts +35 -7
- package/dist/view/viewport.d.ts.map +1 -1
- package/dist/view/viewport.js +56 -7
- package/dist/view/viewport.js.map +1 -1
- package/package.json +42 -42
- package/dist/kerusi/kerusi-layout-mode.d.ts +0 -58
- package/dist/kerusi/kerusi-layout-mode.d.ts.map +0 -1
- package/dist/kerusi/kerusi-layout-mode.js +0 -117
- package/dist/kerusi/kerusi-layout-mode.js.map +0 -1
- package/dist/render/section-layout.d.ts +0 -66
- package/dist/render/section-layout.d.ts.map +0 -1
- package/dist/render/section-layout.js +0 -186
- package/dist/render/section-layout.js.map +0 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kerusi Seat Map document types, transcribed from the Kerusi Seat Map and
|
|
3
|
-
* Availability Format v1.0.0-draft, §4. Field-level comments preserve
|
|
4
|
-
* normative REQUIRED/OPTIONAL constraints and defaults from the standard.
|
|
3
|
+
* Availability Format v1.0.0-draft rev 15, §4. Field-level comments preserve
|
|
4
|
+
* the normative REQUIRED/OPTIONAL constraints and defaults from the standard.
|
|
5
5
|
*
|
|
6
6
|
* A `KerusiMap` describes a physical venue/vehicle configuration (layout,
|
|
7
7
|
* pricing, seat types). It is static and cacheable; live availability lives
|
|
8
8
|
* in a separate {@link KerusiState} (see kerusi-state.model.ts).
|
|
9
|
+
*
|
|
10
|
+
* Every seat, element and section sits on the map's one {@link Canvas} (§4.5).
|
|
11
|
+
* A renderer draws each seat as a `seatSize` square centred on its `x`/`y` and
|
|
12
|
+
* does no layout arithmetic of its own.
|
|
9
13
|
*/
|
|
10
14
|
/**
|
|
11
15
|
* A label that may be a plain string or a BCP-47 locale map, e.g.
|
|
@@ -13,6 +17,26 @@
|
|
|
13
17
|
* `resolveLocalizedText` (§4.1, §4.7).
|
|
14
18
|
*/
|
|
15
19
|
export type LocalizedText = string | Record<string, string>;
|
|
20
|
+
/** [x, y] in canvas units. */
|
|
21
|
+
export type Point = [number, number];
|
|
22
|
+
/**
|
|
23
|
+
* The map's one drawing surface (§4.5). Unitless, with the same scale on both
|
|
24
|
+
* axes; the origin is the top-left corner, x grows to the right and y grows
|
|
25
|
+
* downwards.
|
|
26
|
+
*/
|
|
27
|
+
export interface Canvas {
|
|
28
|
+
/** REQUIRED. Positive. */
|
|
29
|
+
width: number;
|
|
30
|
+
/** REQUIRED. Positive. */
|
|
31
|
+
height: number;
|
|
32
|
+
}
|
|
33
|
+
/** A rectangle on the canvas: top-left corner and size, in canvas units. */
|
|
34
|
+
export interface Bounds {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
}
|
|
16
40
|
/**
|
|
17
41
|
* Structured accessibility properties for a seat (§4.3.4). All members are
|
|
18
42
|
* OPTIONAL, per the progressive-enhancement principle (§2): a map with no
|
|
@@ -58,6 +82,38 @@ export interface SeatType {
|
|
|
58
82
|
color?: string;
|
|
59
83
|
defaultPriceTier?: string;
|
|
60
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* The form a row was laid out in, for editors (§4.2.3): exactly one of `line`,
|
|
87
|
+
* `arc` or `circle`. Angles are degrees on the canvas axes (0 points right, 90
|
|
88
|
+
* points down), and `cols` is `[first, last]` with first not exceeding last.
|
|
89
|
+
*
|
|
90
|
+
* A guide only. It MUST NOT move any seat, a renderer ignores it, and it never
|
|
91
|
+
* decides which row a seat is in. See `guidePoint` and `isOnGuide`.
|
|
92
|
+
*/
|
|
93
|
+
export type RowShape = {
|
|
94
|
+
line: {
|
|
95
|
+
from: Point;
|
|
96
|
+
to: Point;
|
|
97
|
+
cols: [number, number];
|
|
98
|
+
};
|
|
99
|
+
} | {
|
|
100
|
+
arc: {
|
|
101
|
+
center: Point;
|
|
102
|
+
/** Positive. */
|
|
103
|
+
radius: number;
|
|
104
|
+
start: number;
|
|
105
|
+
/** REQUIRED. Positive turns clockwise on screen. */
|
|
106
|
+
sweep: number;
|
|
107
|
+
cols: [number, number];
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
circle: {
|
|
111
|
+
center: Point;
|
|
112
|
+
radius: number;
|
|
113
|
+
start: number;
|
|
114
|
+
cols: [number, number];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
61
117
|
/**
|
|
62
118
|
* A row's declaration: label, ordering key, row-level metadata. NOT a container
|
|
63
119
|
* — seats reference a row by id via `Seat.row` rather than nesting inside it
|
|
@@ -67,19 +123,21 @@ export interface SeatType {
|
|
|
67
123
|
* section's **complete, ordered row registry** rather than an annotation on the
|
|
68
124
|
* rows the seats happen to mention: §4.6 requires every `Seat.row` to resolve
|
|
69
125
|
* against it, so no seat can occupy a row it does not declare. A `RowMeta` that
|
|
70
|
-
* no seat references is an *empty row
|
|
126
|
+
* no seat references is an *empty row*: valid, and it reserves no space
|
|
127
|
+
* (§4.2.2).
|
|
71
128
|
*/
|
|
72
129
|
export interface RowMeta {
|
|
73
|
-
/** REQUIRED. */
|
|
130
|
+
/** REQUIRED. Unique within its section; another section MAY reuse it. */
|
|
74
131
|
id: string;
|
|
75
132
|
label?: string;
|
|
76
133
|
/**
|
|
77
134
|
* Ordering key among the section's rows (§4.2.1) — a key, not a position.
|
|
78
135
|
* Rows at 0 and 11 with nothing between them are adjacent, two rows and not
|
|
79
|
-
* twelve
|
|
80
|
-
* numeric hole here.
|
|
136
|
+
* twelve. Rows give order and adjacency, never space.
|
|
81
137
|
*/
|
|
82
138
|
index?: number;
|
|
139
|
+
/** The guide the row was laid out along, for editors (§4.2.3). Renderers ignore it. */
|
|
140
|
+
shape?: RowShape;
|
|
83
141
|
metadata?: Record<string, unknown>;
|
|
84
142
|
}
|
|
85
143
|
/**
|
|
@@ -100,27 +158,39 @@ export interface Direction {
|
|
|
100
158
|
* section's first, or `x`/`y` = 0.
|
|
101
159
|
*/
|
|
102
160
|
low: LocalizedText;
|
|
103
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* REQUIRED. The high end: descending row/col order, or `x` = `canvas.width`
|
|
163
|
+
* / `y` = `canvas.height`.
|
|
164
|
+
*/
|
|
104
165
|
high: LocalizedText;
|
|
105
166
|
}
|
|
106
167
|
/**
|
|
107
|
-
* A single seat within a section (§4.3).
|
|
108
|
-
* `y
|
|
168
|
+
* A single seat within a section (§4.3). Its footprint is a `seatSize` square
|
|
169
|
+
* centred on `x`/`y` in canvas units and turned by `rotation` (§4.5). `row` and
|
|
170
|
+
* `col` say only which seats are next to it (§4.3.5).
|
|
109
171
|
*/
|
|
110
172
|
export interface Seat {
|
|
111
173
|
/** REQUIRED. Globally unique within the KerusiMap. */
|
|
112
174
|
id: string;
|
|
113
175
|
/** Display label, e.g. "12" or "12A". Defaults to `id`. */
|
|
114
176
|
label?: string;
|
|
115
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* References `RowMeta.id` when the section declares `rows`; free text
|
|
179
|
+
* otherwise. The only way a seat joins a row (§4.2.3).
|
|
180
|
+
*/
|
|
116
181
|
row?: string;
|
|
117
|
-
/**
|
|
182
|
+
/**
|
|
183
|
+
* Positive integer adjacency ordinal within `row`, which it requires. Seats
|
|
184
|
+
* in the same section and row whose cols differ by 1 are neighbours; a
|
|
185
|
+
* skipped col is an aisle (§4.3.5). No two seats in a section share a row and
|
|
186
|
+
* col. Never affects where the seat is drawn.
|
|
187
|
+
*/
|
|
118
188
|
col?: number;
|
|
119
|
-
/**
|
|
120
|
-
x
|
|
121
|
-
/**
|
|
122
|
-
y
|
|
123
|
-
/** Degrees
|
|
189
|
+
/** REQUIRED. Centre of the footprint, in canvas units, 0 to `canvas.width` (§4.3.1). */
|
|
190
|
+
x: number;
|
|
191
|
+
/** REQUIRED. Centre of the footprint, in canvas units, 0 to `canvas.height`. */
|
|
192
|
+
y: number;
|
|
193
|
+
/** Degrees, clockwise on screen, about the seat's centre. */
|
|
124
194
|
rotation?: number;
|
|
125
195
|
/** REQUIRED. References a `SeatType.id` in the map's `legend`. */
|
|
126
196
|
type: string;
|
|
@@ -141,75 +211,49 @@ export interface Seat {
|
|
|
141
211
|
}
|
|
142
212
|
/**
|
|
143
213
|
* A non-bookable feature that still requires rendering: screens, stages,
|
|
144
|
-
* exits, lavatories, staircases, or a labelled gap (§4.4).
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* are (§4.4.1), for the same reason §4.5 binds the seats: a section whose
|
|
148
|
-
* elements may be addressed differently from its seats cannot be laid out
|
|
149
|
-
* deterministically by two independent renderers.
|
|
214
|
+
* exits, lavatories, staircases, or a labelled gap (§4.4). Placed on the canvas
|
|
215
|
+
* exactly as a seat is (§4.4.1): a `width` × `height` rectangle centred on
|
|
216
|
+
* `x`/`y`.
|
|
150
217
|
*/
|
|
151
218
|
export interface Element {
|
|
152
|
-
/** REQUIRED. */
|
|
219
|
+
/** REQUIRED. Unique across the whole KerusiMap (§4.6). */
|
|
153
220
|
id: string;
|
|
154
221
|
/** REQUIRED. "screen" | "stage" | "exit" | "lavatory" | "gap" | "aisle" | ... */
|
|
155
222
|
kind: string;
|
|
156
223
|
label?: string;
|
|
157
|
-
/**
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
x?: number;
|
|
163
|
-
/** Percent of section height. MUST NOT appear in a grid section (§4.4.1). */
|
|
164
|
-
y?: number;
|
|
165
|
-
/**
|
|
166
|
-
* Grid: a **column span** in cells — a positive integer, default 1. Omitting
|
|
167
|
-
* `col` spans the section's full column extent and ignores `width`, which is
|
|
168
|
-
* the usual form for a screen or a stage.
|
|
169
|
-
* Freeform: a percentage of the section's width (§4.4.1).
|
|
170
|
-
*/
|
|
224
|
+
/** REQUIRED. Centre, in canvas units, 0 to `canvas.width`. */
|
|
225
|
+
x: number;
|
|
226
|
+
/** REQUIRED. Centre, in canvas units, 0 to `canvas.height`. */
|
|
227
|
+
y: number;
|
|
228
|
+
/** Canvas units, positive. Default: the applicable seat size. */
|
|
171
229
|
width?: number;
|
|
172
|
-
/**
|
|
173
|
-
* Grid: a **row span** in cells — a positive integer, default 1, counted from
|
|
174
|
-
* this element's `row` through the section's row order (§4.2.1). The rows it
|
|
175
|
-
* reaches are ordinarily empty rows declared for the purpose (§4.2.2).
|
|
176
|
-
* Freeform: a percentage of the section's height (§4.4.1).
|
|
177
|
-
*/
|
|
230
|
+
/** Canvas units, positive. Default: the applicable seat size. */
|
|
178
231
|
height?: number;
|
|
232
|
+
/** Degrees, clockwise on screen, about the element's centre. */
|
|
179
233
|
rotation?: number;
|
|
180
234
|
metadata?: Record<string, unknown>;
|
|
181
235
|
}
|
|
182
236
|
/**
|
|
183
|
-
* A
|
|
184
|
-
*
|
|
185
|
-
* curves, offsets, and
|
|
237
|
+
* A named zone on the map's canvas (§4.1), not a canvas of its own. It holds a
|
|
238
|
+
* FLAT list of seats, not a grid of rows containing seats; a seat's position
|
|
239
|
+
* is a property of the seat, which is what makes curves, offsets, and
|
|
240
|
+
* irregular gaps representable.
|
|
186
241
|
*/
|
|
187
242
|
export interface Section {
|
|
188
243
|
/** REQUIRED. */
|
|
189
244
|
id: string;
|
|
190
245
|
/** String, or locale map: `{ "en": "Orchestra", "ms": "Orkestra" }`. */
|
|
191
246
|
label?: LocalizedText;
|
|
192
|
-
/**
|
|
247
|
+
/** Ordering key among sections (§4.1.1) — a key, not a position. */
|
|
193
248
|
index?: number;
|
|
249
|
+
/** Overrides `KerusiMap.seatSize` for this section's seats and elements. Positive. */
|
|
250
|
+
seatSize?: number;
|
|
194
251
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* - `grid` — every seat has `col`; no seat has `x` or `y`.
|
|
199
|
-
* - `freeform` — every seat has both `x` and `y`; no seat has `col`.
|
|
200
|
-
* - `mixed` — every seat has `col` AND both `x` and `y`; `x`/`y` places
|
|
201
|
-
* the seat and `col` gives its logical adjacency.
|
|
202
|
-
*
|
|
203
|
-
* Omitted, the mode is INFERRED from the seats; a section whose seats are
|
|
204
|
-
* inconsistent is invalid and MUST be rejected. A free-text `row` is allowed
|
|
205
|
-
* in every mode — it carries no positional information.
|
|
206
|
-
*/
|
|
207
|
-
layout?: 'grid' | 'freeform' | 'mixed';
|
|
208
|
-
/**
|
|
209
|
-
* "width:height", e.g. "16:9". Meaningful only for freeform/mixed sections.
|
|
210
|
-
* Default: "1:1".
|
|
252
|
+
* The section's extent on the canvas, for zooming to a section, thumbnails
|
|
253
|
+
* and legends. Does not affect drawing; the section's seats SHOULD lie
|
|
254
|
+
* inside it (§4.1).
|
|
211
255
|
*/
|
|
212
|
-
|
|
256
|
+
bounds?: Bounds;
|
|
213
257
|
/**
|
|
214
258
|
* The section's row registry, when present: a complete, ordered list of its
|
|
215
259
|
* rows, not merely an annotation on the ones its seats mention (§4.2).
|
|
@@ -218,10 +262,8 @@ export interface Section {
|
|
|
218
262
|
*
|
|
219
263
|
* Rows are ordered by §4.2.1 — those declaring `index` first, ascending, then
|
|
220
264
|
* the rest in declaration order. A row no seat references is an **empty row**
|
|
221
|
-
* (§4.2.2):
|
|
222
|
-
*
|
|
223
|
-
* cinema screen and its front row, or a cross-aisle between two rows — the
|
|
224
|
-
* row-axis counterpart to a skipped column (§4.3.2).
|
|
265
|
+
* (§4.2.2): valid, and it reserves no space. Rows give order and adjacency;
|
|
266
|
+
* where a seat is drawn comes only from its own `x`/`y`.
|
|
225
267
|
*/
|
|
226
268
|
rows?: RowMeta[];
|
|
227
269
|
/** Human-facing labels for this section's addressing axes (§4.10). */
|
|
@@ -247,6 +289,17 @@ export interface KerusiMap {
|
|
|
247
289
|
domain?: string;
|
|
248
290
|
/** BCP-47 language tag. Default: "en". */
|
|
249
291
|
locale?: string;
|
|
292
|
+
/**
|
|
293
|
+
* REQUIRED. The one drawing surface every seat, element and section is
|
|
294
|
+
* placed on (§4.5).
|
|
295
|
+
*/
|
|
296
|
+
canvas: Canvas;
|
|
297
|
+
/**
|
|
298
|
+
* REQUIRED. A seat's footprint: a square of this side, in canvas units,
|
|
299
|
+
* centred on the seat's `x`/`y` and turned by its rotation (§4.5). Positive.
|
|
300
|
+
* A section MAY override it.
|
|
301
|
+
*/
|
|
302
|
+
seatSize: number;
|
|
250
303
|
/** REQUIRED. Vocabulary of seat types used in this map. */
|
|
251
304
|
legend: SeatType[];
|
|
252
305
|
/** Named price tiers, referenced by id. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kerusi-map.model.d.ts","sourceRoot":"","sources":["../../src/kerusi/kerusi-map.model.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kerusi-map.model.d.ts","sourceRoot":"","sources":["../../src/kerusi/kerusi-map.model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5D,8BAA8B;AAC9B,M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;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,sEAAsE;IACtE,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,qDAAqD;IACrD,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,mDAAmD;AACnD,MAAM,WAAW,SAAS;IACxB,wDAAwD;IACxD,MAAM,EAAE,KAAK,CAAC;IACd,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,gBAAgB;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kerusi Seat Map document types, transcribed from the Kerusi Seat Map and
|
|
3
|
-
* Availability Format v1.0.0-draft, §4. Field-level comments preserve
|
|
4
|
-
* normative REQUIRED/OPTIONAL constraints and defaults from the standard.
|
|
3
|
+
* Availability Format v1.0.0-draft rev 15, §4. Field-level comments preserve
|
|
4
|
+
* the normative REQUIRED/OPTIONAL constraints and defaults from the standard.
|
|
5
5
|
*
|
|
6
6
|
* A `KerusiMap` describes a physical venue/vehicle configuration (layout,
|
|
7
7
|
* pricing, seat types). It is static and cacheable; live availability lives
|
|
8
8
|
* in a separate {@link KerusiState} (see kerusi-state.model.ts).
|
|
9
|
+
*
|
|
10
|
+
* Every seat, element and section sits on the map's one {@link Canvas} (§4.5).
|
|
11
|
+
* A renderer draws each seat as a `seatSize` square centred on its `x`/`y` and
|
|
12
|
+
* does no layout arithmetic of its own.
|
|
9
13
|
*/
|
|
10
14
|
export {};
|
|
11
15
|
//# sourceMappingURL=kerusi-map.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kerusi-map.model.js","sourceRoot":"","sources":["../../src/kerusi/kerusi-map.model.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kerusi-map.model.js","sourceRoot":"","sources":["../../src/kerusi/kerusi-map.model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -12,8 +12,8 @@ import { RowMeta, Section } from './kerusi-map.model.js';
|
|
|
12
12
|
* 3. rows sharing an `index` in declaration order relative to one another.
|
|
13
13
|
*
|
|
14
14
|
* `index` is an ordering key, not a position: rows at 0 and 11 with nothing
|
|
15
|
-
* between them are adjacent.
|
|
16
|
-
* (§4.2.2)
|
|
15
|
+
* between them are adjacent. Rows give order and adjacency, never space; an
|
|
16
|
+
* empty row (§4.2.2) still takes its place in the order and reserves nothing.
|
|
17
17
|
*/
|
|
18
18
|
export declare function orderRowMeta(rows: readonly RowMeta[]): RowMeta[];
|
|
19
19
|
/**
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* 3. rows sharing an `index` in declaration order relative to one another.
|
|
12
12
|
*
|
|
13
13
|
* `index` is an ordering key, not a position: rows at 0 and 11 with nothing
|
|
14
|
-
* between them are adjacent.
|
|
15
|
-
* (§4.2.2)
|
|
14
|
+
* between them are adjacent. Rows give order and adjacency, never space; an
|
|
15
|
+
* empty row (§4.2.2) still takes its place in the order and reserves nothing.
|
|
16
16
|
*/
|
|
17
17
|
export function orderRowMeta(rows) {
|
|
18
18
|
return [...rows]
|
|
@@ -59,23 +59,32 @@ export declare function validateDocumentSet(docs: {
|
|
|
59
59
|
* unchanged when valid, so it can be used inline.
|
|
60
60
|
*
|
|
61
61
|
* Enforced rules:
|
|
62
|
-
* - Required members present: `kerusi`, `id`, `
|
|
63
|
-
* `kerusi` declares a supported major version.
|
|
64
|
-
* -
|
|
65
|
-
*
|
|
66
|
-
*
|
|
62
|
+
* - Required members present: `kerusi`, `id`, `canvas`, `seatSize`, `legend`,
|
|
63
|
+
* `sections` (§4), and `kerusi` declares a supported major version.
|
|
64
|
+
* - The canvas and every seat size are positive (§4.5).
|
|
65
|
+
* - Every seat and element has `x` and `y` on the canvas (§4.3.1, §4.4.1), and
|
|
66
|
+
* an element's `width`/`height`, when given, are positive.
|
|
67
|
+
* - A seat's `col` is a positive integer, only with a `row`, and no two seats
|
|
68
|
+
* in a section share a row and col (§4.3.5).
|
|
69
|
+
* - Section, seat, element, seat type and price tier ids are unique across the
|
|
70
|
+
* map, and row ids within their section (§4.3, §4.6).
|
|
67
71
|
* - Every `Seat.type` resolves to a `SeatType.id` in `legend` (§4.6).
|
|
68
72
|
* - Every `Seat.priceTier` resolves to a `PriceTier.id` (§4.6).
|
|
69
73
|
* - Every `Seat.row` resolves to a `RowMeta.id` when the section declares
|
|
70
74
|
* `rows`; opaque free-text otherwise (§4.6).
|
|
71
75
|
* - Every `Seat.companions[]` entry resolves to another seat in the SAME
|
|
72
76
|
* section, and the relationship is symmetric (§4.6).
|
|
73
|
-
* - Every
|
|
74
|
-
*
|
|
75
|
-
* column and row spans that stay inside the section's rows (§4.4.1, §4.6).
|
|
77
|
+
* - Every row shape is exactly one well-formed line, arc or circle (§4.2.3).
|
|
78
|
+
* - Every `Element` has the required `id` and `kind` (§4.4).
|
|
76
79
|
* - All resolved currencies across the map are identical (§4.9).
|
|
77
80
|
*
|
|
78
|
-
*
|
|
81
|
+
* Members this library does not recognize are ignored (§7), including the
|
|
82
|
+
* members rev 15 removed from sections and elements; a rev 14 map is still
|
|
83
|
+
* rejected, for lacking `canvas` and `seatSize`.
|
|
84
|
+
*
|
|
85
|
+
* Advisory findings never throw: overlapping seats (§4.3.1), seats outside
|
|
86
|
+
* their section's `bounds` (§4.1), an unknown `transferArmrest`. Use
|
|
87
|
+
* {@link checkKerusiMap} to see them.
|
|
79
88
|
*/
|
|
80
89
|
export declare function validateKerusiMap(map: KerusiMap): KerusiMap;
|
|
81
90
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kerusi-validator.d.ts","sourceRoot":"","sources":["../../src/kerusi/kerusi-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,
|
|
1
|
+
{"version":3,"file":"kerusi-validator.d.ts","sourceRoot":"","sources":["../../src/kerusi/kerusi-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAA0B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAc,MAAM,yBAAyB,CAAC;AAGnG,OAAO,EAAmB,eAAe,EAAW,MAAM,uBAAuB,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQhF;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAG5C,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM;IACpB,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE;gBAN/C,OAAO,EA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