@seatlayer/core 0.20.0 → 0.21.1

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/index.d.cts CHANGED
@@ -2,8 +2,8 @@
2
2
  * SeatMap chart document — the single source of truth shared by the
3
3
  * Designer (authoring) and the Renderer (buyer picker).
4
4
  *
5
- * Mirrors docs/seatmap-build-spec.md §5. Coordinates are abstract units
6
- * (roughly "pixels at scale 1"); the renderer fits the chart to its container.
5
+ * Coordinates are abstract units (roughly "pixels at scale 1"); the renderer
6
+ * fits the chart to its container.
7
7
  * Rows are PARAMETRIC (origin + count + spacing + curve + rotation) — never
8
8
  * store per-seat coordinates in the document; expansion happens in layout.ts.
9
9
  */
@@ -499,7 +499,7 @@ interface ZoneDef {
499
499
  * Fixed set of four; derived from object type via `layerOf()` (no per-object field yet).
500
500
  */
501
501
  type SelectionLayer = 'interactive' | 'background' | 'foreground' | 'surroundings';
502
- /** Derive an object's selection layer from its type (design contract, HANDOFF §03). */
502
+ /** Derive an object's selection layer from its type. */
503
503
  declare function layerOf(obj: ChartObject): SelectionLayer;
504
504
  /** Free-standing text on the chart (aisle names, door labels…). */
505
505
  interface TextObject {
@@ -2117,6 +2117,11 @@ declare class PickerController {
2117
2117
  * chart: clear any older section drill-in and guide the camera to the seats
2118
2118
  * that remain relevant. Clearing the filter glides back to the full chart. */
2119
2119
  focusCategoryFilter(keys: string[] | null): void;
2120
+ /** The floor a buyer means when filtering to `keys`: the active floor when it
2121
+ * carries any of those categories, else the first floor that does (null =
2122
+ * stay put). Row overrides and GA areas count — a category can exist on a
2123
+ * floor only via a per-seat override. */
2124
+ private floorForCategories;
2120
2125
  /** World-space rect currently visible + full chart bounds (F3 minimap frame). */
2121
2126
  getViewport(): {
2122
2127
  visible: {
@@ -2229,10 +2234,10 @@ declare function generateSeatThumb(seat: ExpandedSeat, focalPoint: Point, _neigh
2229
2234
 
2230
2235
  /**
2231
2236
  * i18n core — deliberately tiny and framework-free so the embed SDK can share
2232
- * it without dragging in a runtime library (the 60KB-gzipped SDK budget is a
2237
+ * it without dragging in a runtime library (the 150KB-gzipped complete CDN budget is a
2233
2238
  * product contract).
2234
2239
  *
2235
- * Scope (docs/design-port-plan.md): the buyer surface (picker, public event
2240
+ * Scope: the buyer surface (picker, public event
2236
2241
  * page, SDK) ships fully translated in en/es/de/fr; dashboard pages route
2237
2242
  * their strings through t() as they are rebuilt but ship English this round.
2238
2243
  *
@@ -2260,7 +2265,7 @@ declare function formatDate(value: number | Date, opts?: Intl.DateTimeFormatOpti
2260
2265
 
2261
2266
  /**
2262
2267
  * Locale bundle loader — keeps non-English translations OUT of the initial
2263
- * bundle (the 60 KB SDK budget is a product contract) and code-splits each
2268
+ * bundle (the 150 KB complete CDN budget is a product contract) and code-splits each
2264
2269
  * locale so a page/SDK only downloads the language it actually uses.
2265
2270
  *
2266
2271
  * `loadLocale('de')` dynamic-imports the German dictionary, registers it via
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * SeatMap chart document — the single source of truth shared by the
3
3
  * Designer (authoring) and the Renderer (buyer picker).
4
4
  *
5
- * Mirrors docs/seatmap-build-spec.md §5. Coordinates are abstract units
6
- * (roughly "pixels at scale 1"); the renderer fits the chart to its container.
5
+ * Coordinates are abstract units (roughly "pixels at scale 1"); the renderer
6
+ * fits the chart to its container.
7
7
  * Rows are PARAMETRIC (origin + count + spacing + curve + rotation) — never
8
8
  * store per-seat coordinates in the document; expansion happens in layout.ts.
9
9
  */
@@ -499,7 +499,7 @@ interface ZoneDef {
499
499
  * Fixed set of four; derived from object type via `layerOf()` (no per-object field yet).
500
500
  */
501
501
  type SelectionLayer = 'interactive' | 'background' | 'foreground' | 'surroundings';
502
- /** Derive an object's selection layer from its type (design contract, HANDOFF §03). */
502
+ /** Derive an object's selection layer from its type. */
503
503
  declare function layerOf(obj: ChartObject): SelectionLayer;
504
504
  /** Free-standing text on the chart (aisle names, door labels…). */
505
505
  interface TextObject {
@@ -2117,6 +2117,11 @@ declare class PickerController {
2117
2117
  * chart: clear any older section drill-in and guide the camera to the seats
2118
2118
  * that remain relevant. Clearing the filter glides back to the full chart. */
2119
2119
  focusCategoryFilter(keys: string[] | null): void;
2120
+ /** The floor a buyer means when filtering to `keys`: the active floor when it
2121
+ * carries any of those categories, else the first floor that does (null =
2122
+ * stay put). Row overrides and GA areas count — a category can exist on a
2123
+ * floor only via a per-seat override. */
2124
+ private floorForCategories;
2120
2125
  /** World-space rect currently visible + full chart bounds (F3 minimap frame). */
2121
2126
  getViewport(): {
2122
2127
  visible: {
@@ -2229,10 +2234,10 @@ declare function generateSeatThumb(seat: ExpandedSeat, focalPoint: Point, _neigh
2229
2234
 
2230
2235
  /**
2231
2236
  * i18n core — deliberately tiny and framework-free so the embed SDK can share
2232
- * it without dragging in a runtime library (the 60KB-gzipped SDK budget is a
2237
+ * it without dragging in a runtime library (the 150KB-gzipped complete CDN budget is a
2233
2238
  * product contract).
2234
2239
  *
2235
- * Scope (docs/design-port-plan.md): the buyer surface (picker, public event
2240
+ * Scope: the buyer surface (picker, public event
2236
2241
  * page, SDK) ships fully translated in en/es/de/fr; dashboard pages route
2237
2242
  * their strings through t() as they are rebuilt but ship English this round.
2238
2243
  *
@@ -2260,7 +2265,7 @@ declare function formatDate(value: number | Date, opts?: Intl.DateTimeFormatOpti
2260
2265
 
2261
2266
  /**
2262
2267
  * Locale bundle loader — keeps non-English translations OUT of the initial
2263
- * bundle (the 60 KB SDK budget is a product contract) and code-splits each
2268
+ * bundle (the 150 KB complete CDN budget is a product contract) and code-splits each
2264
2269
  * locale so a page/SDK only downloads the language it actually uses.
2265
2270
  *
2266
2271
  * `loadLocale('de')` dynamic-imports the German dictionary, registers it via
package/dist/index.js CHANGED
@@ -742,7 +742,7 @@ var en = {
742
742
  "common.close": "Close",
743
743
  "common.done": "Done",
744
744
  "common.copied": "\u2713 Copied",
745
- // buyer picker (extraction in progress — P4 of the port plan)
745
+ // buyer picker
746
746
  "picker.holdSeats": "Hold seats & checkout",
747
747
  "picker.completeBooking": "Complete booking",
748
748
  "picker.seatsHeld": "Seats held \u2014 {time}",
@@ -798,7 +798,7 @@ var en = {
798
798
  "picker.real360": "REAL 360\xB0",
799
799
  "picker.preview": "PREVIEW",
800
800
  "picker.open360": "Open 360\xB0 view",
801
- "picker.sightline": "\u2248 {rows} rows from stage \xB7 {angle}\xB0 off-center",
801
+ "picker.sightline": "\u2248 {m} m to stage \xB7 clear sightline",
802
802
  "picker.bookedDemo": "Booked! (demo)",
803
803
  "picker.bookButton.one": "Book {count} ticket \u2014 {amount}",
804
804
  "picker.bookButton.other": "Book {count} tickets \u2014 {amount}",
@@ -5041,9 +5041,29 @@ var PickerController = class {
5041
5041
  if (!renderer) return;
5042
5042
  renderer.clearSectionFocus?.();
5043
5043
  this.opts.onSectionFocus?.(null);
5044
+ if (keys?.length) {
5045
+ const target = this.floorForCategories(keys);
5046
+ if (target) this.setFloor(target);
5047
+ }
5044
5048
  if (renderer.focusCategories) renderer.focusCategories(keys);
5045
5049
  else renderer.zoomToFit();
5046
5050
  }
5051
+ /** The floor a buyer means when filtering to `keys`: the active floor when it
5052
+ * carries any of those categories, else the first floor that does (null =
5053
+ * stay put). Row overrides and GA areas count — a category can exist on a
5054
+ * floor only via a per-seat override. */
5055
+ floorForCategories(keys) {
5056
+ const doc = this._doc;
5057
+ if (!doc?.floors || doc.floors.length < 2) return null;
5058
+ const wanted = new Set(keys);
5059
+ const carries = (objects) => objects.some(
5060
+ (o) => o.type === "row" && (wanted.has(o.categoryKey) || (o.overrides ?? []).some((ov) => ov.categoryKey != null && wanted.has(ov.categoryKey))) || o.type === "gaArea" && wanted.has(o.categoryKey)
5061
+ );
5062
+ const activeId = this.getActiveFloorId();
5063
+ const active2 = doc.floors.find((f) => f.id === activeId);
5064
+ if (active2 && carries(active2.objects)) return null;
5065
+ return doc.floors.find((f) => carries(f.objects))?.id ?? null;
5066
+ }
5047
5067
  /** World-space rect currently visible + full chart bounds (F3 minimap frame). */
5048
5068
  getViewport() {
5049
5069
  const r = this.renderer;
@@ -5641,9 +5661,9 @@ function generateSeatThumb(seat, focalPoint, _neighborSeats) {
5641
5661
 
5642
5662
  // src/i18n/bundles.ts
5643
5663
  var LOADERS = {
5644
- es: () => import("./es-NLD3NL3W.js").then((m) => ({ default: m.es })),
5645
- de: () => import("./de-ZTKJOFHT.js").then((m) => ({ default: m.de })),
5646
- fr: () => import("./fr-KSFKWSAT.js").then((m) => ({ default: m.fr }))
5664
+ es: () => import("./es-LDI3FESI.js").then((m) => ({ default: m.es })),
5665
+ de: () => import("./de-HLJXYBWA.js").then((m) => ({ default: m.de })),
5666
+ fr: () => import("./fr-H4KTK4F5.js").then((m) => ({ default: m.fr }))
5647
5667
  };
5648
5668
  var loaded = /* @__PURE__ */ new Set(["en"]);
5649
5669
  async function loadLocale(code) {