@seatlayer/js 0.60.0 → 0.62.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/dist/index.cjs +127 -38
- package/dist/index.d.cts +103 -0
- package/dist/index.d.ts +103 -0
- package/dist/index.js +126 -37
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -660,6 +660,16 @@ interface SeatingChartOptions {
|
|
|
660
660
|
* without shipping a whole bundle, e.g. `{ 'map.fromPrice': 'ab {price}' }`.
|
|
661
661
|
*/
|
|
662
662
|
messages?: Record<string, string>;
|
|
663
|
+
/**
|
|
664
|
+
* Show an in-chart language switcher offering exactly these languages.
|
|
665
|
+
*
|
|
666
|
+
* Opt-in and curated on purpose: the chart sits inside someone else's page,
|
|
667
|
+
* a multilingual host already has its own switcher, and two that can
|
|
668
|
+
* disagree is worse than either alone. A curated list also beats all 37 — a
|
|
669
|
+
* German venue wants de/en/pl in the menu, not Welsh. Fewer than two
|
|
670
|
+
* resolvable entries renders nothing.
|
|
671
|
+
*/
|
|
672
|
+
languages?: string[];
|
|
663
673
|
/** ISO 4217 currency for on-map prices (default USD). */
|
|
664
674
|
currency?: string;
|
|
665
675
|
/**
|
|
@@ -761,6 +771,8 @@ declare class SeatingChart {
|
|
|
761
771
|
readonly publicKey?: string;
|
|
762
772
|
private mount;
|
|
763
773
|
private hostEl;
|
|
774
|
+
/** The organizer's language for this event, learned when the chart resolves. */
|
|
775
|
+
private eventLocale;
|
|
764
776
|
private rendered;
|
|
765
777
|
private mode_;
|
|
766
778
|
private tipEl;
|
|
@@ -794,6 +806,32 @@ declare class SeatingChart {
|
|
|
794
806
|
* wrapper, which must be able to tell an integrator that the build they are
|
|
795
807
|
* about to ship is pointed at a test event.
|
|
796
808
|
*/
|
|
809
|
+
/**
|
|
810
|
+
* The opt-in language switcher, offering exactly the languages the host
|
|
811
|
+
* named. Absent unless `languages` lists at least two — a menu with one
|
|
812
|
+
* entry is furniture, and an unrequested one duplicates the switcher a
|
|
813
|
+
* multilingual host site already has.
|
|
814
|
+
*
|
|
815
|
+
* Each language names itself (`LOCALE_NAMES`): a reader scanning for their
|
|
816
|
+
* own language finds "Deutsch", never "German". An English list is
|
|
817
|
+
* unreadable to exactly the people who need it.
|
|
818
|
+
*/
|
|
819
|
+
private buildLanguageSwitcher;
|
|
820
|
+
/**
|
|
821
|
+
* Change the language of a LIVE chart, keeping the buyer's selection.
|
|
822
|
+
*
|
|
823
|
+
* `locale` is otherwise read once at render, which is fine for a page that
|
|
824
|
+
* knows its language up front and useless for one with a language switcher.
|
|
825
|
+
* The competing embed API can only `rerender()`, and that clears the
|
|
826
|
+
* selection — losing someone's seats because they changed language is not an
|
|
827
|
+
* acceptable trade, so this rebuilds the map through `refreshMapCopy()`,
|
|
828
|
+
* which restores the selection on the far side.
|
|
829
|
+
*
|
|
830
|
+
* Returns the locale that actually became active: an unsupported or
|
|
831
|
+
* not-yet-translated tag resolves to English rather than throwing, exactly as
|
|
832
|
+
* it does at first render.
|
|
833
|
+
*/
|
|
834
|
+
setLocale(next: string | null | undefined): Promise<string>;
|
|
797
835
|
getMode(): 'live' | 'test' | null;
|
|
798
836
|
/** Current selection with prices resolved from the chart categories. */
|
|
799
837
|
getSelection(): SelectedSeat[];
|
|
@@ -1604,6 +1642,18 @@ interface SeatPickerOptions {
|
|
|
1604
1642
|
locale?: string;
|
|
1605
1643
|
/** Per-key string overrides layered over the active locale. */
|
|
1606
1644
|
messages?: Record<string, string>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Show an in-picker language switcher offering exactly these languages.
|
|
1647
|
+
*
|
|
1648
|
+
* Opt-in and curated on purpose. Omit it and there is no control: the widget
|
|
1649
|
+
* sits inside someone else's page, and a multilingual host site already has
|
|
1650
|
+
* its own switcher — two that can disagree is worse than either alone. A
|
|
1651
|
+
* curated list also beats offering all 37: a German venue wants de/en/pl in
|
|
1652
|
+
* the menu, not Welsh.
|
|
1653
|
+
*
|
|
1654
|
+
* Switching keeps the buyer's selection; it does not re-render the chart.
|
|
1655
|
+
*/
|
|
1656
|
+
languages?: string[];
|
|
1607
1657
|
/** ISO 4217 currency fallback (the org/event currency on the chart wins). */
|
|
1608
1658
|
currency?: string;
|
|
1609
1659
|
/** Colorblind-safe rendering (Okabe-Ito palette, hollow booked seats). */
|
|
@@ -2058,6 +2108,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2058
2108
|
private secCardShownAt;
|
|
2059
2109
|
/** Previous tray ticket count — first 0→n transition auto-expands the mobile sheet. */
|
|
2060
2110
|
private lastTrayCount;
|
|
2111
|
+
/** The opt-in language switcher, when `languages` named at least two. */
|
|
2112
|
+
private langSel;
|
|
2061
2113
|
/** Previous computed total — drives a single explanatory value bump. */
|
|
2062
2114
|
private lastTrayTotal;
|
|
2063
2115
|
/** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
|
|
@@ -2068,6 +2120,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2068
2120
|
private holdingLabels;
|
|
2069
2121
|
private ctaPhase;
|
|
2070
2122
|
private a11yChipsEl;
|
|
2123
|
+
/** Rail scroll listener attached once; the rail repaints many times. */
|
|
2124
|
+
private railEdgesBound;
|
|
2071
2125
|
private fsFallback;
|
|
2072
2126
|
private fsChangeHandler;
|
|
2073
2127
|
private fsEscHandler;
|
|
@@ -2526,6 +2580,12 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2526
2580
|
* colours have not changed; safe to call on every render.
|
|
2527
2581
|
*/
|
|
2528
2582
|
setMapTheme(map: PickerMapTheme | null): void;
|
|
2583
|
+
/**
|
|
2584
|
+
* Chrome docked on the map follows the MAP's ground, not the picker's — see
|
|
2585
|
+
* resolveMapChromeTokens. The map ground resolves the way the renderer does:
|
|
2586
|
+
* host map override → chart theme → the picker's own background.
|
|
2587
|
+
*/
|
|
2588
|
+
private applyMapChromeTokens;
|
|
2529
2589
|
/**
|
|
2530
2590
|
* Let a host suppress duplicate event identity after mount without remounting
|
|
2531
2591
|
* the live picker (and therefore without disturbing a selection or hold).
|
|
@@ -2553,6 +2613,49 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2553
2613
|
* A no-op when the map is unchanged, so a host may call it on every poll.
|
|
2554
2614
|
*/
|
|
2555
2615
|
setPricing(pricing: SeatPickerPricing | undefined): void;
|
|
2616
|
+
/**
|
|
2617
|
+
* The opt-in language switcher.
|
|
2618
|
+
*
|
|
2619
|
+
* Rendered only when `languages` resolves to at least two distinct locales.
|
|
2620
|
+
* Curated rather than all 37 on purpose — a German venue wants de/en/pl in
|
|
2621
|
+
* the menu, not Welsh — and absent by default, because a multilingual host
|
|
2622
|
+
* site already has its own switcher and two that can disagree is worse than
|
|
2623
|
+
* either alone.
|
|
2624
|
+
*
|
|
2625
|
+
* Each language names itself: a reader scanning for their own finds
|
|
2626
|
+
* "Deutsch", never "German". An English list is unreadable to exactly the
|
|
2627
|
+
* people who need it.
|
|
2628
|
+
*/
|
|
2629
|
+
private buildLanguageSwitcher;
|
|
2630
|
+
/**
|
|
2631
|
+
* Change the language of a mounted picker, keeping the buyer's seats.
|
|
2632
|
+
*
|
|
2633
|
+
* `locale` is otherwise read once, before the chrome is built. That is fine
|
|
2634
|
+
* for a page that knows its language up front and useless for one with a
|
|
2635
|
+
* language switcher — and the competing embed API's only answer, `rerender()`,
|
|
2636
|
+
* clears the selection. Losing someone's held seats because they changed
|
|
2637
|
+
* language is not a trade worth making, so nothing here is destroyed and
|
|
2638
|
+
* rebuilt: the copy is re-applied in place.
|
|
2639
|
+
*
|
|
2640
|
+
* Three passes, because the picker's ~195 `tf()` sites fall into three kinds:
|
|
2641
|
+
*
|
|
2642
|
+
* 1. The skeleton's static labels and aria — set once inside one `innerHTML`
|
|
2643
|
+
* template. Re-applied from the `data-sl-*` markers on those nodes.
|
|
2644
|
+
* 2. The painters (tray, prices, CTA, offer, rails, rungs, floors) — these
|
|
2645
|
+
* already rebuild their HTML from `tf()` whenever state moves, so calling
|
|
2646
|
+
* them again is all it takes.
|
|
2647
|
+
* 3. Everything transient — toasts, dialogs, screen-reader announcements,
|
|
2648
|
+
* tooltips. Those read `tf()` at the moment they fire, so they are already
|
|
2649
|
+
* correct the next time they run and must NOT be forced now.
|
|
2650
|
+
*
|
|
2651
|
+
* The map is last and goes through the controller, because its labels are
|
|
2652
|
+
* baked into Konva `Text` at build time — a repaint would faithfully redraw
|
|
2653
|
+
* the old language.
|
|
2654
|
+
*
|
|
2655
|
+
* Returns the locale that actually became active; an unsupported or
|
|
2656
|
+
* untranslated tag resolves to English rather than throwing.
|
|
2657
|
+
*/
|
|
2658
|
+
setLocale(next: string | null | undefined): Promise<string>;
|
|
2556
2659
|
/** Current colorblind-safe render state, resolved from the stored buyer
|
|
2557
2660
|
* preference at mount. Host chrome (e.g. the Designer preview) reads this to
|
|
2558
2661
|
* surface the state rather than rendering colorblind colors silently. */
|
package/dist/index.d.ts
CHANGED
|
@@ -660,6 +660,16 @@ interface SeatingChartOptions {
|
|
|
660
660
|
* without shipping a whole bundle, e.g. `{ 'map.fromPrice': 'ab {price}' }`.
|
|
661
661
|
*/
|
|
662
662
|
messages?: Record<string, string>;
|
|
663
|
+
/**
|
|
664
|
+
* Show an in-chart language switcher offering exactly these languages.
|
|
665
|
+
*
|
|
666
|
+
* Opt-in and curated on purpose: the chart sits inside someone else's page,
|
|
667
|
+
* a multilingual host already has its own switcher, and two that can
|
|
668
|
+
* disagree is worse than either alone. A curated list also beats all 37 — a
|
|
669
|
+
* German venue wants de/en/pl in the menu, not Welsh. Fewer than two
|
|
670
|
+
* resolvable entries renders nothing.
|
|
671
|
+
*/
|
|
672
|
+
languages?: string[];
|
|
663
673
|
/** ISO 4217 currency for on-map prices (default USD). */
|
|
664
674
|
currency?: string;
|
|
665
675
|
/**
|
|
@@ -761,6 +771,8 @@ declare class SeatingChart {
|
|
|
761
771
|
readonly publicKey?: string;
|
|
762
772
|
private mount;
|
|
763
773
|
private hostEl;
|
|
774
|
+
/** The organizer's language for this event, learned when the chart resolves. */
|
|
775
|
+
private eventLocale;
|
|
764
776
|
private rendered;
|
|
765
777
|
private mode_;
|
|
766
778
|
private tipEl;
|
|
@@ -794,6 +806,32 @@ declare class SeatingChart {
|
|
|
794
806
|
* wrapper, which must be able to tell an integrator that the build they are
|
|
795
807
|
* about to ship is pointed at a test event.
|
|
796
808
|
*/
|
|
809
|
+
/**
|
|
810
|
+
* The opt-in language switcher, offering exactly the languages the host
|
|
811
|
+
* named. Absent unless `languages` lists at least two — a menu with one
|
|
812
|
+
* entry is furniture, and an unrequested one duplicates the switcher a
|
|
813
|
+
* multilingual host site already has.
|
|
814
|
+
*
|
|
815
|
+
* Each language names itself (`LOCALE_NAMES`): a reader scanning for their
|
|
816
|
+
* own language finds "Deutsch", never "German". An English list is
|
|
817
|
+
* unreadable to exactly the people who need it.
|
|
818
|
+
*/
|
|
819
|
+
private buildLanguageSwitcher;
|
|
820
|
+
/**
|
|
821
|
+
* Change the language of a LIVE chart, keeping the buyer's selection.
|
|
822
|
+
*
|
|
823
|
+
* `locale` is otherwise read once at render, which is fine for a page that
|
|
824
|
+
* knows its language up front and useless for one with a language switcher.
|
|
825
|
+
* The competing embed API can only `rerender()`, and that clears the
|
|
826
|
+
* selection — losing someone's seats because they changed language is not an
|
|
827
|
+
* acceptable trade, so this rebuilds the map through `refreshMapCopy()`,
|
|
828
|
+
* which restores the selection on the far side.
|
|
829
|
+
*
|
|
830
|
+
* Returns the locale that actually became active: an unsupported or
|
|
831
|
+
* not-yet-translated tag resolves to English rather than throwing, exactly as
|
|
832
|
+
* it does at first render.
|
|
833
|
+
*/
|
|
834
|
+
setLocale(next: string | null | undefined): Promise<string>;
|
|
797
835
|
getMode(): 'live' | 'test' | null;
|
|
798
836
|
/** Current selection with prices resolved from the chart categories. */
|
|
799
837
|
getSelection(): SelectedSeat[];
|
|
@@ -1604,6 +1642,18 @@ interface SeatPickerOptions {
|
|
|
1604
1642
|
locale?: string;
|
|
1605
1643
|
/** Per-key string overrides layered over the active locale. */
|
|
1606
1644
|
messages?: Record<string, string>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Show an in-picker language switcher offering exactly these languages.
|
|
1647
|
+
*
|
|
1648
|
+
* Opt-in and curated on purpose. Omit it and there is no control: the widget
|
|
1649
|
+
* sits inside someone else's page, and a multilingual host site already has
|
|
1650
|
+
* its own switcher — two that can disagree is worse than either alone. A
|
|
1651
|
+
* curated list also beats offering all 37: a German venue wants de/en/pl in
|
|
1652
|
+
* the menu, not Welsh.
|
|
1653
|
+
*
|
|
1654
|
+
* Switching keeps the buyer's selection; it does not re-render the chart.
|
|
1655
|
+
*/
|
|
1656
|
+
languages?: string[];
|
|
1607
1657
|
/** ISO 4217 currency fallback (the org/event currency on the chart wins). */
|
|
1608
1658
|
currency?: string;
|
|
1609
1659
|
/** Colorblind-safe rendering (Okabe-Ito palette, hollow booked seats). */
|
|
@@ -2058,6 +2108,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2058
2108
|
private secCardShownAt;
|
|
2059
2109
|
/** Previous tray ticket count — first 0→n transition auto-expands the mobile sheet. */
|
|
2060
2110
|
private lastTrayCount;
|
|
2111
|
+
/** The opt-in language switcher, when `languages` named at least two. */
|
|
2112
|
+
private langSel;
|
|
2061
2113
|
/** Previous computed total — drives a single explanatory value bump. */
|
|
2062
2114
|
private lastTrayTotal;
|
|
2063
2115
|
/** Stable item keys prevent tray chips re-animating on unrelated realtime syncs. */
|
|
@@ -2068,6 +2120,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2068
2120
|
private holdingLabels;
|
|
2069
2121
|
private ctaPhase;
|
|
2070
2122
|
private a11yChipsEl;
|
|
2123
|
+
/** Rail scroll listener attached once; the rail repaints many times. */
|
|
2124
|
+
private railEdgesBound;
|
|
2071
2125
|
private fsFallback;
|
|
2072
2126
|
private fsChangeHandler;
|
|
2073
2127
|
private fsEscHandler;
|
|
@@ -2526,6 +2580,12 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2526
2580
|
* colours have not changed; safe to call on every render.
|
|
2527
2581
|
*/
|
|
2528
2582
|
setMapTheme(map: PickerMapTheme | null): void;
|
|
2583
|
+
/**
|
|
2584
|
+
* Chrome docked on the map follows the MAP's ground, not the picker's — see
|
|
2585
|
+
* resolveMapChromeTokens. The map ground resolves the way the renderer does:
|
|
2586
|
+
* host map override → chart theme → the picker's own background.
|
|
2587
|
+
*/
|
|
2588
|
+
private applyMapChromeTokens;
|
|
2529
2589
|
/**
|
|
2530
2590
|
* Let a host suppress duplicate event identity after mount without remounting
|
|
2531
2591
|
* the live picker (and therefore without disturbing a selection or hold).
|
|
@@ -2553,6 +2613,49 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
2553
2613
|
* A no-op when the map is unchanged, so a host may call it on every poll.
|
|
2554
2614
|
*/
|
|
2555
2615
|
setPricing(pricing: SeatPickerPricing | undefined): void;
|
|
2616
|
+
/**
|
|
2617
|
+
* The opt-in language switcher.
|
|
2618
|
+
*
|
|
2619
|
+
* Rendered only when `languages` resolves to at least two distinct locales.
|
|
2620
|
+
* Curated rather than all 37 on purpose — a German venue wants de/en/pl in
|
|
2621
|
+
* the menu, not Welsh — and absent by default, because a multilingual host
|
|
2622
|
+
* site already has its own switcher and two that can disagree is worse than
|
|
2623
|
+
* either alone.
|
|
2624
|
+
*
|
|
2625
|
+
* Each language names itself: a reader scanning for their own finds
|
|
2626
|
+
* "Deutsch", never "German". An English list is unreadable to exactly the
|
|
2627
|
+
* people who need it.
|
|
2628
|
+
*/
|
|
2629
|
+
private buildLanguageSwitcher;
|
|
2630
|
+
/**
|
|
2631
|
+
* Change the language of a mounted picker, keeping the buyer's seats.
|
|
2632
|
+
*
|
|
2633
|
+
* `locale` is otherwise read once, before the chrome is built. That is fine
|
|
2634
|
+
* for a page that knows its language up front and useless for one with a
|
|
2635
|
+
* language switcher — and the competing embed API's only answer, `rerender()`,
|
|
2636
|
+
* clears the selection. Losing someone's held seats because they changed
|
|
2637
|
+
* language is not a trade worth making, so nothing here is destroyed and
|
|
2638
|
+
* rebuilt: the copy is re-applied in place.
|
|
2639
|
+
*
|
|
2640
|
+
* Three passes, because the picker's ~195 `tf()` sites fall into three kinds:
|
|
2641
|
+
*
|
|
2642
|
+
* 1. The skeleton's static labels and aria — set once inside one `innerHTML`
|
|
2643
|
+
* template. Re-applied from the `data-sl-*` markers on those nodes.
|
|
2644
|
+
* 2. The painters (tray, prices, CTA, offer, rails, rungs, floors) — these
|
|
2645
|
+
* already rebuild their HTML from `tf()` whenever state moves, so calling
|
|
2646
|
+
* them again is all it takes.
|
|
2647
|
+
* 3. Everything transient — toasts, dialogs, screen-reader announcements,
|
|
2648
|
+
* tooltips. Those read `tf()` at the moment they fire, so they are already
|
|
2649
|
+
* correct the next time they run and must NOT be forced now.
|
|
2650
|
+
*
|
|
2651
|
+
* The map is last and goes through the controller, because its labels are
|
|
2652
|
+
* baked into Konva `Text` at build time — a repaint would faithfully redraw
|
|
2653
|
+
* the old language.
|
|
2654
|
+
*
|
|
2655
|
+
* Returns the locale that actually became active; an unsupported or
|
|
2656
|
+
* untranslated tag resolves to English rather than throwing.
|
|
2657
|
+
*/
|
|
2658
|
+
setLocale(next: string | null | undefined): Promise<string>;
|
|
2556
2659
|
/** Current colorblind-safe render state, resolved from the stored buyer
|
|
2557
2660
|
* preference at mount. Host chrome (e.g. the Designer preview) reads this to
|
|
2558
2661
|
* surface the state rather than rendering colorblind colors silently. */
|