@snowcone-app/ui 0.10.11 → 0.10.12
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/composed/search/CurrentRefinements.tsx +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4744](https://github.com/snowcone-app/snowcone-monorepo/pull/4744) [`1e0daeb`](https://github.com/snowcone-app/snowcone-monorepo/commit/1e0daeb635b8ee4a53b052a4a07a4a64d56c310d) Thanks [@kevinsproles](https://github.com/kevinsproles)! - CurrentRefinements builds its "≥ / ≤" price-label patterns from strings instead of regex literals. A raw non-Latin-1 character in a regex literal survives into server bundles, and one is enough to make V8 hold the whole script at two bytes per character.
|
|
8
|
+
|
|
3
9
|
## 0.10.11
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -12287,6 +12287,8 @@ var import_react_instantsearch5 = require("react-instantsearch");
|
|
|
12287
12287
|
var import_lucide_react6 = require("lucide-react");
|
|
12288
12288
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
12289
12289
|
var XIcon3 = import_lucide_react6.X;
|
|
12290
|
+
var MIN_PRICE = new RegExp("[\u2265>=]+\\s*(\\d+)");
|
|
12291
|
+
var MAX_PRICE = new RegExp("[\u2264<=]+\\s*(\\d+)");
|
|
12290
12292
|
function CurrentRefinements() {
|
|
12291
12293
|
const { items, refine } = (0, import_react_instantsearch5.useCurrentRefinements)();
|
|
12292
12294
|
const formatPriceValue = (priceInCents) => {
|
|
@@ -12307,12 +12309,12 @@ function CurrentRefinements() {
|
|
|
12307
12309
|
const max = parseInt(rangeMatch[2]);
|
|
12308
12310
|
return `${formatPriceValue(min)} - ${formatPriceValue(max)}`;
|
|
12309
12311
|
}
|
|
12310
|
-
const minMatch = label.match(
|
|
12312
|
+
const minMatch = label.match(MIN_PRICE);
|
|
12311
12313
|
if (minMatch) {
|
|
12312
12314
|
const min = parseInt(minMatch[1]);
|
|
12313
12315
|
return `Min ${formatPriceValue(min)}`;
|
|
12314
12316
|
}
|
|
12315
|
-
const maxMatch = label.match(
|
|
12317
|
+
const maxMatch = label.match(MAX_PRICE);
|
|
12316
12318
|
if (maxMatch) {
|
|
12317
12319
|
const max = parseInt(maxMatch[1]);
|
|
12318
12320
|
return `Max ${formatPriceValue(max)}`;
|