@seatlayer/core 0.36.3 → 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.d.cts
CHANGED
|
@@ -507,7 +507,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
507
507
|
/** Category order from the doc — the stable index into the CB palette. */
|
|
508
508
|
private catOrder;
|
|
509
509
|
private selection;
|
|
510
|
-
/**
|
|
510
|
+
/** Seat-contained selection markers: outline + non-colour check cue. */
|
|
511
511
|
private selectionMarkers;
|
|
512
512
|
/** Held by this picker instance, not by another buyer. */
|
|
513
513
|
private ownedHold;
|
|
@@ -1935,7 +1935,31 @@ declare function setMoneyLocale(locale: string | undefined): void;
|
|
|
1935
1935
|
* `fractionDigits` for fixed precision (e.g. 3 for "$0.045 / credit").
|
|
1936
1936
|
*/
|
|
1937
1937
|
declare function formatMoney(amount: number, currency?: string, fractionDigits?: number): string;
|
|
1938
|
+
/**
|
|
1939
|
+
* How many decimal places a currency has — 2 for USD/EUR, 0 for JPY/KRW/VND,
|
|
1940
|
+
* 3 for KWD/BHD/JOD.
|
|
1941
|
+
*
|
|
1942
|
+
* Derived from Intl rather than from a table, because ICU already carries ISO
|
|
1943
|
+
* 4217's exponents and a second hand-maintained list is a second thing to get
|
|
1944
|
+
* wrong. (`workers/api/src/payments/money.ts` DOES keep a table, on purpose: it
|
|
1945
|
+
* must THROW for a currency checkout cannot transact. Display has no such duty
|
|
1946
|
+
* — it renders whatever the ledger already recorded, including a currency
|
|
1947
|
+
* checkout would refuse.)
|
|
1948
|
+
*
|
|
1949
|
+
* Falls back to 2 for a code Intl rejects, so a bad row cannot blank a chart.
|
|
1950
|
+
*/
|
|
1951
|
+
declare function currencyExponent(currency?: string): number;
|
|
1952
|
+
/**
|
|
1953
|
+
* Minor units → major units. `9000` USD cents is `90`; `9000` JPY is `9000`.
|
|
1954
|
+
*
|
|
1955
|
+
* Every money field the API returns is an integer in the currency's smallest
|
|
1956
|
+
* unit (`grossMinor`, `total_minor`). Dividing by 100 at a call site is right
|
|
1957
|
+
* for most currencies and silently wrong for the rest — 100x wrong for yen.
|
|
1958
|
+
*/
|
|
1959
|
+
declare function fromMinorUnits(minor: number, currency?: string): number;
|
|
1960
|
+
/** "$90" / "¥9,000" — a minor-unit integer rendered for display. */
|
|
1961
|
+
declare function formatMinor(minor: number, currency?: string): string;
|
|
1938
1962
|
/** Bare symbol for input adornments ("€", "$", "₹"). */
|
|
1939
1963
|
declare function currencySymbol(currency?: string): string;
|
|
1940
1964
|
|
|
1941
|
-
export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
|
|
1965
|
+
export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencyExponent, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMinor, formatMoney, fromMinorUnits, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
|
package/dist/index.d.ts
CHANGED
|
@@ -507,7 +507,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
|
|
|
507
507
|
/** Category order from the doc — the stable index into the CB palette. */
|
|
508
508
|
private catOrder;
|
|
509
509
|
private selection;
|
|
510
|
-
/**
|
|
510
|
+
/** Seat-contained selection markers: outline + non-colour check cue. */
|
|
511
511
|
private selectionMarkers;
|
|
512
512
|
/** Held by this picker instance, not by another buyer. */
|
|
513
513
|
private ownedHold;
|
|
@@ -1935,7 +1935,31 @@ declare function setMoneyLocale(locale: string | undefined): void;
|
|
|
1935
1935
|
* `fractionDigits` for fixed precision (e.g. 3 for "$0.045 / credit").
|
|
1936
1936
|
*/
|
|
1937
1937
|
declare function formatMoney(amount: number, currency?: string, fractionDigits?: number): string;
|
|
1938
|
+
/**
|
|
1939
|
+
* How many decimal places a currency has — 2 for USD/EUR, 0 for JPY/KRW/VND,
|
|
1940
|
+
* 3 for KWD/BHD/JOD.
|
|
1941
|
+
*
|
|
1942
|
+
* Derived from Intl rather than from a table, because ICU already carries ISO
|
|
1943
|
+
* 4217's exponents and a second hand-maintained list is a second thing to get
|
|
1944
|
+
* wrong. (`workers/api/src/payments/money.ts` DOES keep a table, on purpose: it
|
|
1945
|
+
* must THROW for a currency checkout cannot transact. Display has no such duty
|
|
1946
|
+
* — it renders whatever the ledger already recorded, including a currency
|
|
1947
|
+
* checkout would refuse.)
|
|
1948
|
+
*
|
|
1949
|
+
* Falls back to 2 for a code Intl rejects, so a bad row cannot blank a chart.
|
|
1950
|
+
*/
|
|
1951
|
+
declare function currencyExponent(currency?: string): number;
|
|
1952
|
+
/**
|
|
1953
|
+
* Minor units → major units. `9000` USD cents is `90`; `9000` JPY is `9000`.
|
|
1954
|
+
*
|
|
1955
|
+
* Every money field the API returns is an integer in the currency's smallest
|
|
1956
|
+
* unit (`grossMinor`, `total_minor`). Dividing by 100 at a call site is right
|
|
1957
|
+
* for most currencies and silently wrong for the rest — 100x wrong for yen.
|
|
1958
|
+
*/
|
|
1959
|
+
declare function fromMinorUnits(minor: number, currency?: string): number;
|
|
1960
|
+
/** "$90" / "¥9,000" — a minor-unit integer rendered for display. */
|
|
1961
|
+
declare function formatMinor(minor: number, currency?: string): string;
|
|
1938
1962
|
/** Bare symbol for input adornments ("€", "$", "₹"). */
|
|
1939
1963
|
declare function currencySymbol(currency?: string): string;
|
|
1940
1964
|
|
|
1941
|
-
export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
|
|
1965
|
+
export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencyExponent, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMinor, formatMoney, fromMinorUnits, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
|
package/dist/index.js
CHANGED
|
@@ -1255,6 +1255,19 @@ function formatMoney(amount, currency = DEFAULT_CURRENCY, fractionDigits) {
|
|
|
1255
1255
|
const digits = fractionDigits ?? (Number.isInteger(amount) ? 0 : void 0);
|
|
1256
1256
|
return formatter(currency, digits).format(amount);
|
|
1257
1257
|
}
|
|
1258
|
+
function currencyExponent(currency = DEFAULT_CURRENCY) {
|
|
1259
|
+
try {
|
|
1260
|
+
return formatter(currency, void 0).resolvedOptions().maximumFractionDigits ?? 2;
|
|
1261
|
+
} catch {
|
|
1262
|
+
return 2;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
function fromMinorUnits(minor, currency = DEFAULT_CURRENCY) {
|
|
1266
|
+
return minor / 10 ** currencyExponent(currency);
|
|
1267
|
+
}
|
|
1268
|
+
function formatMinor(minor, currency = DEFAULT_CURRENCY) {
|
|
1269
|
+
return formatMoney(fromMinorUnits(minor, currency), currency);
|
|
1270
|
+
}
|
|
1258
1271
|
function currencySymbol(currency = DEFAULT_CURRENCY) {
|
|
1259
1272
|
const part = formatter(currency, 0).formatToParts(0).find((p) => p.type === "currency");
|
|
1260
1273
|
return part?.value ?? currency;
|
|
@@ -1821,7 +1834,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
1821
1834
|
/** Category order from the doc — the stable index into the CB palette. */
|
|
1822
1835
|
this.catOrder = [];
|
|
1823
1836
|
this.selection = /* @__PURE__ */ new Set();
|
|
1824
|
-
/**
|
|
1837
|
+
/** Seat-contained selection markers: outline + non-colour check cue. */
|
|
1825
1838
|
this.selectionMarkers = /* @__PURE__ */ new Map();
|
|
1826
1839
|
/** Held by this picker instance, not by another buyer. */
|
|
1827
1840
|
this.ownedHold = /* @__PURE__ */ new Set();
|
|
@@ -5162,11 +5175,15 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
5162
5175
|
}));
|
|
5163
5176
|
}
|
|
5164
5177
|
} else {
|
|
5165
|
-
marker.add(new Circle({
|
|
5178
|
+
marker.add(new Circle({
|
|
5179
|
+
...common,
|
|
5180
|
+
radius: Math.max(1, this.seatR - 1.25),
|
|
5181
|
+
strokeWidth: Math.min(2.5, Math.max(1.8, this.seatR * 0.22))
|
|
5182
|
+
}));
|
|
5166
5183
|
if (candidate) {
|
|
5167
5184
|
marker.add(new Circle({
|
|
5168
5185
|
...common,
|
|
5169
|
-
radius: this.seatR +
|
|
5186
|
+
radius: this.seatR + 2,
|
|
5170
5187
|
strokeWidth: 2,
|
|
5171
5188
|
opacity: 0.55
|
|
5172
5189
|
}));
|
|
@@ -7873,8 +7890,8 @@ var PickerController = class {
|
|
|
7873
7890
|
["held", "booked", "not_for_sale"].forEach((st) => {
|
|
7874
7891
|
if (byStatus[st].length) r.setStatus(byStatus[st], st);
|
|
7875
7892
|
});
|
|
7876
|
-
this.opts.onStatusChange?.();
|
|
7877
7893
|
this.clearBookedHoldIfSettled();
|
|
7894
|
+
this.opts.onStatusChange?.();
|
|
7878
7895
|
}
|
|
7879
7896
|
clearBookedHoldIfSettled() {
|
|
7880
7897
|
const hold = this.hold_;
|
|
@@ -9215,6 +9232,7 @@ export {
|
|
|
9215
9232
|
chartBounds,
|
|
9216
9233
|
computeSections,
|
|
9217
9234
|
createRenderer,
|
|
9235
|
+
currencyExponent,
|
|
9218
9236
|
currencySymbol,
|
|
9219
9237
|
expandBooth,
|
|
9220
9238
|
expandChart,
|
|
@@ -9225,7 +9243,9 @@ export {
|
|
|
9225
9243
|
floorObjects,
|
|
9226
9244
|
floorsOf,
|
|
9227
9245
|
formatDate,
|
|
9246
|
+
formatMinor,
|
|
9228
9247
|
formatMoney,
|
|
9248
|
+
fromMinorUnits,
|
|
9229
9249
|
gaAreasOf,
|
|
9230
9250
|
gaInventorySegments,
|
|
9231
9251
|
gaUnitLabel,
|