@orderingstack/front-hooks 3.6.2 → 3.7.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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +12 -3
- package/dist/index.es.js.map +1 -1
- package/dist/src/useCms.d.ts +1 -0
- package/dist/src/useCms.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -3128,7 +3128,7 @@ function useLocalizedVenueMedia(id, venue, locale, intervalSeconds = 300, withLo
|
|
|
3128
3128
|
var _a, _b, _c, _d;
|
|
3129
3129
|
const config = useContext(ConfigContext);
|
|
3130
3130
|
if (!config) {
|
|
3131
|
-
throw new Error("
|
|
3131
|
+
throw new Error("Hook was used outside config context");
|
|
3132
3132
|
}
|
|
3133
3133
|
const { value, isError } = useVenueCms(id, intervalSeconds, withLocalStorage, config.baseUrl, config.tenant, venue);
|
|
3134
3134
|
let localizedValue = null;
|
|
@@ -3139,7 +3139,12 @@ function useLocalizedVenueMedia(id, venue, locale, intervalSeconds = 300, withLo
|
|
|
3139
3139
|
if (!localizedValue && value && ((_d = value == null ? void 0 : value.url) == null ? void 0 : _d.length) > 0) {
|
|
3140
3140
|
fallbackUrl = value.url[0].value;
|
|
3141
3141
|
}
|
|
3142
|
-
return {
|
|
3142
|
+
return {
|
|
3143
|
+
url: localizedValue,
|
|
3144
|
+
fallbackUrl,
|
|
3145
|
+
isError,
|
|
3146
|
+
mediaType: value == null ? void 0 : value.mediaType
|
|
3147
|
+
};
|
|
3143
3148
|
}
|
|
3144
3149
|
function useKioskMediaCms({
|
|
3145
3150
|
kioskMediaId,
|
|
@@ -3692,5 +3697,9 @@ function addDiscounts(discounts) {
|
|
|
3692
3697
|
function summarizeLineDiscounts(line) {
|
|
3693
3698
|
return addDiscounts(line.discounts);
|
|
3694
3699
|
}
|
|
3695
|
-
|
|
3700
|
+
function formatPrice(value, currency, separator = ",", decimals = 2) {
|
|
3701
|
+
const price = Number(value);
|
|
3702
|
+
return `${price.toFixed(decimals).replace(".", separator)}${currency ? "\xA0" + currency : ""}`;
|
|
3703
|
+
}
|
|
3704
|
+
export { addDiscounts, formatPrice, getGroupedBucketLines, getMediaUrl, groupOrderLines, isChannelOpen, summarizeLineDiscounts, useAvailability, useCms, useDisplayPrice, useGroupOrderLines, useInterval, useKioskChannelsAvailability, useKioskMediaCms, useKioskMediaCmsWithContext, useLocalizedVenueMedia, useMediaUrl, useOnClickOutside, useVenueCms };
|
|
3696
3705
|
//# sourceMappingURL=index.es.js.map
|