@seatlayer/core 0.36.2 → 0.37.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 +27 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -231,6 +231,7 @@ __export(index_exports, {
|
|
|
231
231
|
chartBounds: () => chartBounds,
|
|
232
232
|
computeSections: () => computeSections,
|
|
233
233
|
createRenderer: () => createRenderer,
|
|
234
|
+
currencyExponent: () => currencyExponent,
|
|
234
235
|
currencySymbol: () => currencySymbol,
|
|
235
236
|
expandBooth: () => expandBooth,
|
|
236
237
|
expandChart: () => expandChart,
|
|
@@ -241,7 +242,9 @@ __export(index_exports, {
|
|
|
241
242
|
floorObjects: () => floorObjects,
|
|
242
243
|
floorsOf: () => floorsOf,
|
|
243
244
|
formatDate: () => formatDate,
|
|
245
|
+
formatMinor: () => formatMinor,
|
|
244
246
|
formatMoney: () => formatMoney,
|
|
247
|
+
fromMinorUnits: () => fromMinorUnits,
|
|
245
248
|
gaAreasOf: () => gaAreasOf,
|
|
246
249
|
gaInventorySegments: () => gaInventorySegments,
|
|
247
250
|
gaUnitLabel: () => gaUnitLabel,
|
|
@@ -2843,6 +2846,19 @@ function formatMoney(amount, currency = DEFAULT_CURRENCY, fractionDigits) {
|
|
|
2843
2846
|
const digits = fractionDigits ?? (Number.isInteger(amount) ? 0 : void 0);
|
|
2844
2847
|
return formatter(currency, digits).format(amount);
|
|
2845
2848
|
}
|
|
2849
|
+
function currencyExponent(currency = DEFAULT_CURRENCY) {
|
|
2850
|
+
try {
|
|
2851
|
+
return formatter(currency, void 0).resolvedOptions().maximumFractionDigits ?? 2;
|
|
2852
|
+
} catch {
|
|
2853
|
+
return 2;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
function fromMinorUnits(minor, currency = DEFAULT_CURRENCY) {
|
|
2857
|
+
return minor / 10 ** currencyExponent(currency);
|
|
2858
|
+
}
|
|
2859
|
+
function formatMinor(minor, currency = DEFAULT_CURRENCY) {
|
|
2860
|
+
return formatMoney(fromMinorUnits(minor, currency), currency);
|
|
2861
|
+
}
|
|
2846
2862
|
function currencySymbol(currency = DEFAULT_CURRENCY) {
|
|
2847
2863
|
const part = formatter(currency, 0).formatToParts(0).find((p) => p.type === "currency");
|
|
2848
2864
|
return part?.value ?? currency;
|
|
@@ -3409,7 +3425,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
3409
3425
|
/** Category order from the doc — the stable index into the CB palette. */
|
|
3410
3426
|
this.catOrder = [];
|
|
3411
3427
|
this.selection = /* @__PURE__ */ new Set();
|
|
3412
|
-
/**
|
|
3428
|
+
/** Seat-contained selection markers: outline + non-colour check cue. */
|
|
3413
3429
|
this.selectionMarkers = /* @__PURE__ */ new Map();
|
|
3414
3430
|
/** Held by this picker instance, not by another buyer. */
|
|
3415
3431
|
this.ownedHold = /* @__PURE__ */ new Set();
|
|
@@ -6750,11 +6766,15 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
6750
6766
|
}));
|
|
6751
6767
|
}
|
|
6752
6768
|
} else {
|
|
6753
|
-
marker.add(new import_Circle.Circle({
|
|
6769
|
+
marker.add(new import_Circle.Circle({
|
|
6770
|
+
...common,
|
|
6771
|
+
radius: Math.max(1, this.seatR - 1.25),
|
|
6772
|
+
strokeWidth: Math.min(2.5, Math.max(1.8, this.seatR * 0.22))
|
|
6773
|
+
}));
|
|
6754
6774
|
if (candidate) {
|
|
6755
6775
|
marker.add(new import_Circle.Circle({
|
|
6756
6776
|
...common,
|
|
6757
|
-
radius: this.seatR +
|
|
6777
|
+
radius: this.seatR + 2,
|
|
6758
6778
|
strokeWidth: 2,
|
|
6759
6779
|
opacity: 0.55
|
|
6760
6780
|
}));
|
|
@@ -9461,8 +9481,8 @@ var PickerController = class {
|
|
|
9461
9481
|
["held", "booked", "not_for_sale"].forEach((st) => {
|
|
9462
9482
|
if (byStatus[st].length) r.setStatus(byStatus[st], st);
|
|
9463
9483
|
});
|
|
9464
|
-
this.opts.onStatusChange?.();
|
|
9465
9484
|
this.clearBookedHoldIfSettled();
|
|
9485
|
+
this.opts.onStatusChange?.();
|
|
9466
9486
|
}
|
|
9467
9487
|
clearBookedHoldIfSettled() {
|
|
9468
9488
|
const hold = this.hold_;
|
|
@@ -10804,6 +10824,7 @@ async function loadLocale(code) {
|
|
|
10804
10824
|
chartBounds,
|
|
10805
10825
|
computeSections,
|
|
10806
10826
|
createRenderer,
|
|
10827
|
+
currencyExponent,
|
|
10807
10828
|
currencySymbol,
|
|
10808
10829
|
expandBooth,
|
|
10809
10830
|
expandChart,
|
|
@@ -10814,7 +10835,9 @@ async function loadLocale(code) {
|
|
|
10814
10835
|
floorObjects,
|
|
10815
10836
|
floorsOf,
|
|
10816
10837
|
formatDate,
|
|
10838
|
+
formatMinor,
|
|
10817
10839
|
formatMoney,
|
|
10840
|
+
fromMinorUnits,
|
|
10818
10841
|
gaAreasOf,
|
|
10819
10842
|
gaInventorySegments,
|
|
10820
10843
|
gaUnitLabel,
|