@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,52 @@
|
|
|
1
|
+
import type { Decoration, DecorationKind, UUID } from "./physical-document.interface.js";
|
|
2
|
+
export declare enum GateUse {
|
|
3
|
+
In = "in",
|
|
4
|
+
Out = "out",
|
|
5
|
+
Both = "both"
|
|
6
|
+
}
|
|
7
|
+
export type GateDetails = {
|
|
8
|
+
use: GateUse;
|
|
9
|
+
stepFree?: boolean;
|
|
10
|
+
opens?: string;
|
|
11
|
+
showToBuyers?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare enum EntranceKind {
|
|
14
|
+
Gate = "gate",
|
|
15
|
+
Text = "text"
|
|
16
|
+
}
|
|
17
|
+
export type EntranceAssignment = {
|
|
18
|
+
kind: EntranceKind.Gate;
|
|
19
|
+
gateId: UUID;
|
|
20
|
+
label?: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: EntranceKind.Text;
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
export type RouteDetails = {
|
|
26
|
+
stepFree: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare enum LineCap {
|
|
29
|
+
Flat = "butt",
|
|
30
|
+
Round = "round",
|
|
31
|
+
Square = "square"
|
|
32
|
+
}
|
|
33
|
+
export declare enum LineJoin {
|
|
34
|
+
Sharp = "miter",
|
|
35
|
+
Round = "round",
|
|
36
|
+
Bevelled = "bevel"
|
|
37
|
+
}
|
|
38
|
+
export declare enum LineEnding {
|
|
39
|
+
None = "none",
|
|
40
|
+
Arrow = "arrow"
|
|
41
|
+
}
|
|
42
|
+
export type EntranceReference = {
|
|
43
|
+
objectId: UUID;
|
|
44
|
+
entrance: EntranceAssignment;
|
|
45
|
+
};
|
|
46
|
+
export type GateEntry = {
|
|
47
|
+
decoration: Extract<Decoration, {
|
|
48
|
+
kind: DecorationKind.Rectangle | DecorationKind.Polygon;
|
|
49
|
+
}>;
|
|
50
|
+
details: GateDetails;
|
|
51
|
+
serves: UUID[];
|
|
52
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var GateUse;
|
|
2
|
+
(function (GateUse) {
|
|
3
|
+
GateUse["In"] = "in";
|
|
4
|
+
GateUse["Out"] = "out";
|
|
5
|
+
GateUse["Both"] = "both";
|
|
6
|
+
})(GateUse || (GateUse = {}));
|
|
7
|
+
export var EntranceKind;
|
|
8
|
+
(function (EntranceKind) {
|
|
9
|
+
EntranceKind["Gate"] = "gate";
|
|
10
|
+
EntranceKind["Text"] = "text";
|
|
11
|
+
})(EntranceKind || (EntranceKind = {}));
|
|
12
|
+
export var LineCap;
|
|
13
|
+
(function (LineCap) {
|
|
14
|
+
LineCap["Flat"] = "butt";
|
|
15
|
+
LineCap["Round"] = "round";
|
|
16
|
+
LineCap["Square"] = "square";
|
|
17
|
+
})(LineCap || (LineCap = {}));
|
|
18
|
+
export var LineJoin;
|
|
19
|
+
(function (LineJoin) {
|
|
20
|
+
LineJoin["Sharp"] = "miter";
|
|
21
|
+
LineJoin["Round"] = "round";
|
|
22
|
+
LineJoin["Bevelled"] = "bevel";
|
|
23
|
+
})(LineJoin || (LineJoin = {}));
|
|
24
|
+
export var LineEnding;
|
|
25
|
+
(function (LineEnding) {
|
|
26
|
+
LineEnding["None"] = "none";
|
|
27
|
+
LineEnding["Arrow"] = "arrow";
|
|
28
|
+
})(LineEnding || (LineEnding = {}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { documentCatalog } from "./catalog.js";
|
|
2
|
+
import { sectionCatalog } from "./sections.js";
|
|
3
|
+
import { EntranceKind } from "./wayfinding.interface.js";
|
|
4
|
+
const catalogs = new WeakMap();
|
|
5
|
+
/** Gate identities and their direct assignments share the physical document lifetime. */
|
|
6
|
+
export function gateCatalog(document) {
|
|
7
|
+
let catalog = catalogs.get(document);
|
|
8
|
+
if (catalog)
|
|
9
|
+
return catalog;
|
|
10
|
+
const gates = new Map();
|
|
11
|
+
for (const decoration of document.decorations) {
|
|
12
|
+
if ("gate" in decoration && decoration.gate) {
|
|
13
|
+
gates.set(decoration.id, { decoration, details: decoration.gate, serves: [] });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
for (const reference of entranceReferences(document)) {
|
|
17
|
+
if (reference.entrance.kind === EntranceKind.Gate) {
|
|
18
|
+
gates.get(reference.entrance.gateId)?.serves.push(reference.objectId);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catalog = gates;
|
|
22
|
+
catalogs.set(document, catalog);
|
|
23
|
+
return catalog;
|
|
24
|
+
}
|
|
25
|
+
export function* entranceReferences(document) {
|
|
26
|
+
for (const entity of [...document.sections, ...document.seatingGroups, ...document.areas]) {
|
|
27
|
+
if (entity.entrance)
|
|
28
|
+
yield { objectId: entity.id, entrance: entity.entrance };
|
|
29
|
+
}
|
|
30
|
+
for (const group of document.seatingGroups) {
|
|
31
|
+
if (!("rows" in group))
|
|
32
|
+
continue;
|
|
33
|
+
for (const row of group.rows) {
|
|
34
|
+
if (row.entrance)
|
|
35
|
+
yield { objectId: row.id, entrance: row.entrance };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Resolve explicit inventory instructions before the primary section's entrance. */
|
|
40
|
+
export function inventoryEntrance(document, id) {
|
|
41
|
+
const catalog = documentCatalog(document);
|
|
42
|
+
const seat = catalog.seats.get(id);
|
|
43
|
+
const ownerId = seat?.seat.rowId ?? seat?.group.id ?? id;
|
|
44
|
+
const group = catalog.groups.get(ownerId) ?? catalog.rows.get(ownerId);
|
|
45
|
+
const row = group && "rows" in group ? group.rows.find((entry) => entry.id === ownerId) : undefined;
|
|
46
|
+
const direct = row?.entrance ?? group?.entrance ?? catalog.areas.get(ownerId)?.entrance;
|
|
47
|
+
if (direct)
|
|
48
|
+
return direct;
|
|
49
|
+
const sectionId = sectionCatalog(document).owners.get(ownerId) ?? ownerId;
|
|
50
|
+
return document.sections.find((section) => section.id === sectionId)?.entrance;
|
|
51
|
+
}
|
|
52
|
+
/** Authored instructions can differ from the gate name without changing the serving gate. */
|
|
53
|
+
export function entranceLabel(document, entrance) {
|
|
54
|
+
return (entrance.label ??
|
|
55
|
+
(entrance.kind === EntranceKind.Gate ? gateCatalog(document).get(entrance.gateId)?.decoration.label : undefined));
|
|
56
|
+
}
|
|
57
|
+
export function entranceWithLabel(document, entrance, label) {
|
|
58
|
+
if (entrance?.kind === EntranceKind.Gate) {
|
|
59
|
+
const gate = { kind: EntranceKind.Gate, gateId: entrance.gateId };
|
|
60
|
+
return label === gateCatalog(document).get(entrance.gateId)?.decoration.label ? gate : { ...gate, label };
|
|
61
|
+
}
|
|
62
|
+
return label ? { kind: EntranceKind.Text, label } : undefined;
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatmap-fyi/map-domain",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.48",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,13 +9,17 @@
|
|
|
9
9
|
"src/unicode-license.txt"
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
|
+
"./layers": {
|
|
13
|
+
"types": "./dist/layers.d.ts",
|
|
14
|
+
"import": "./dist/layers.js"
|
|
15
|
+
},
|
|
12
16
|
"./editor-state": {
|
|
13
17
|
"types": "./dist/editor-state.d.ts",
|
|
14
18
|
"import": "./dist/editor-state.js"
|
|
15
19
|
},
|
|
16
20
|
"./types": {
|
|
17
|
-
"types": "./dist/
|
|
18
|
-
"import": "./dist/
|
|
21
|
+
"types": "./dist/physical-document.interface.d.ts",
|
|
22
|
+
"import": "./dist/physical-document.interface.js"
|
|
19
23
|
},
|
|
20
24
|
"./schema": {
|
|
21
25
|
"types": "./dist/schema.d.ts",
|
|
@@ -41,10 +45,18 @@
|
|
|
41
45
|
"types": "./dist/catalog.d.ts",
|
|
42
46
|
"import": "./dist/catalog.js"
|
|
43
47
|
},
|
|
48
|
+
"./geometry/units": {
|
|
49
|
+
"types": "./dist/geometry/units.d.ts",
|
|
50
|
+
"import": "./dist/geometry/units.js"
|
|
51
|
+
},
|
|
44
52
|
"./geometry/geometry": {
|
|
45
53
|
"types": "./dist/geometry/geometry.d.ts",
|
|
46
54
|
"import": "./dist/geometry/geometry.js"
|
|
47
55
|
},
|
|
56
|
+
"./geometry/layout-transform": {
|
|
57
|
+
"types": "./dist/geometry/layout-transform.d.ts",
|
|
58
|
+
"import": "./dist/geometry/layout-transform.js"
|
|
59
|
+
},
|
|
48
60
|
"./geometry/boundary": {
|
|
49
61
|
"types": "./dist/geometry/boundary.d.ts",
|
|
50
62
|
"import": "./dist/geometry/boundary.js"
|
|
@@ -100,13 +112,86 @@
|
|
|
100
112
|
"./row-segments": {
|
|
101
113
|
"types": "./dist/row-segments.d.ts",
|
|
102
114
|
"import": "./dist/row-segments.js"
|
|
115
|
+
},
|
|
116
|
+
"./floors": {
|
|
117
|
+
"types": "./dist/floors.d.ts",
|
|
118
|
+
"import": "./dist/floors.js"
|
|
119
|
+
},
|
|
120
|
+
"./geometry/decoration-bounds": {
|
|
121
|
+
"types": "./dist/geometry/decoration-bounds.d.ts",
|
|
122
|
+
"import": "./dist/geometry/decoration-bounds.js"
|
|
123
|
+
},
|
|
124
|
+
"./sections": {
|
|
125
|
+
"types": "./dist/sections.d.ts",
|
|
126
|
+
"import": "./dist/sections.js"
|
|
127
|
+
},
|
|
128
|
+
"./section-refit": {
|
|
129
|
+
"types": "./dist/section-refit.d.ts",
|
|
130
|
+
"import": "./dist/section-refit.js"
|
|
131
|
+
},
|
|
132
|
+
"./section-fill": {
|
|
133
|
+
"types": "./dist/section-fill.d.ts",
|
|
134
|
+
"import": "./dist/section-fill.js"
|
|
135
|
+
},
|
|
136
|
+
"./section-elevation": {
|
|
137
|
+
"types": "./dist/section-elevation.d.ts",
|
|
138
|
+
"import": "./dist/section-elevation.js"
|
|
139
|
+
},
|
|
140
|
+
"./section-layout": {
|
|
141
|
+
"types": "./dist/section-layout.d.ts",
|
|
142
|
+
"import": "./dist/section-layout.js"
|
|
143
|
+
},
|
|
144
|
+
"./spacing-repairs": {
|
|
145
|
+
"types": "./dist/spacing-repairs.d.ts",
|
|
146
|
+
"import": "./dist/spacing-repairs.js"
|
|
147
|
+
},
|
|
148
|
+
"./media": {
|
|
149
|
+
"types": "./dist/media.d.ts",
|
|
150
|
+
"import": "./dist/media.js"
|
|
151
|
+
},
|
|
152
|
+
"./geometry/polygon-curves": {
|
|
153
|
+
"types": "./dist/geometry/polygon-curves.d.ts",
|
|
154
|
+
"import": "./dist/geometry/polygon-curves.js"
|
|
155
|
+
},
|
|
156
|
+
"./wayfinding": {
|
|
157
|
+
"types": "./dist/wayfinding.d.ts",
|
|
158
|
+
"import": "./dist/wayfinding.js"
|
|
159
|
+
},
|
|
160
|
+
"./wayfinding-types": {
|
|
161
|
+
"types": "./dist/wayfinding.interface.d.ts",
|
|
162
|
+
"import": "./dist/wayfinding.interface.js"
|
|
163
|
+
},
|
|
164
|
+
"./arc-fan": {
|
|
165
|
+
"types": "./dist/arc-fan.d.ts",
|
|
166
|
+
"import": "./dist/arc-fan.js"
|
|
167
|
+
},
|
|
168
|
+
"./arc-fan/types": {
|
|
169
|
+
"types": "./dist/arc-fan.interface.d.ts",
|
|
170
|
+
"import": "./dist/arc-fan.interface.js"
|
|
171
|
+
},
|
|
172
|
+
"./arc-fan/rebuild": {
|
|
173
|
+
"types": "./dist/arc-fan-rebuild.d.ts",
|
|
174
|
+
"import": "./dist/arc-fan-rebuild.js"
|
|
175
|
+
},
|
|
176
|
+
"./geometry/venue-outline-types": {
|
|
177
|
+
"types": "./dist/geometry/venue-outline.interface.d.ts",
|
|
178
|
+
"import": "./dist/geometry/venue-outline.interface.js"
|
|
179
|
+
},
|
|
180
|
+
"./section-growth": {
|
|
181
|
+
"types": "./dist/section-growth.d.ts",
|
|
182
|
+
"import": "./dist/section-growth.js"
|
|
183
|
+
},
|
|
184
|
+
"./section-growth/types": {
|
|
185
|
+
"types": "./dist/section-growth.interface.d.ts",
|
|
186
|
+
"import": "./dist/section-growth.interface.js"
|
|
103
187
|
}
|
|
104
188
|
},
|
|
105
189
|
"scripts": {
|
|
106
190
|
"build": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\" && tsc -p tsconfig.json"
|
|
107
191
|
},
|
|
108
192
|
"dependencies": {
|
|
109
|
-
"zod": "4.6.5"
|
|
193
|
+
"zod": "4.6.5",
|
|
194
|
+
"tinyqueue": "3.0.0"
|
|
110
195
|
},
|
|
111
196
|
"publishConfig": {
|
|
112
197
|
"access": "public"
|