@snowcone-app/ui 0.10.10 → 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/package.json
CHANGED
|
@@ -1228,6 +1228,8 @@ export const HeroProductImage = memo(function HeroProductImage({
|
|
|
1228
1228
|
className={`relative overflow-hidden ${className || ""}`}
|
|
1229
1229
|
style={style}
|
|
1230
1230
|
data-hero-image="true"
|
|
1231
|
+
// Which picture this is (machine-readable: the canary and verify-www name pictures by it, never by DOM order).
|
|
1232
|
+
data-mockup-id={actualMockupId || undefined}
|
|
1231
1233
|
data-fit={fit}
|
|
1232
1234
|
data-picture-failed={imgFailed ? "E_PICTURE_UNDISPLAYED" : undefined}
|
|
1233
1235
|
data-picture-failed-src={failedSrc}
|
|
@@ -8,6 +8,13 @@ import type { ComponentType } from "react";
|
|
|
8
8
|
type IconProps = { className?: string; size?: number };
|
|
9
9
|
const XIcon = LucideX as ComponentType<IconProps>;
|
|
10
10
|
|
|
11
|
+
// "≥ 3434" / "≤ 1000" price labels. Built from strings, never regex literals: a raw ≥ or ≤ in a regex literal reaches a
|
|
12
|
+
// server bundle as-is (minifiers undo a \u escape there, and esbuild escapes strings but not regexes), and one such
|
|
13
|
+
// character makes V8 hold the whole script at two bytes per character. In the www worker that was about 50 MB of its
|
|
14
|
+
// 128 MB isolate, and cold isolates answered Cloudflare's 1102 page (2026-11-12).
|
|
15
|
+
const MIN_PRICE = new RegExp("[\u2265>=]+\\s*(\\d+)");
|
|
16
|
+
const MAX_PRICE = new RegExp("[\u2264<=]+\\s*(\\d+)");
|
|
17
|
+
|
|
11
18
|
export function CurrentRefinements() {
|
|
12
19
|
const { items, refine } = useCurrentRefinements();
|
|
13
20
|
|
|
@@ -33,14 +40,14 @@ export function CurrentRefinements() {
|
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
// Handle >= format like "price >= 3434" or "≥ 3434"
|
|
36
|
-
const minMatch = label.match(
|
|
43
|
+
const minMatch = label.match(MIN_PRICE);
|
|
37
44
|
if (minMatch) {
|
|
38
45
|
const min = parseInt(minMatch[1]);
|
|
39
46
|
return `Min ${formatPriceValue(min)}`;
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
// Handle <= format like "price <= 1000" or "≤ 1000"
|
|
43
|
-
const maxMatch = label.match(
|
|
50
|
+
const maxMatch = label.match(MAX_PRICE);
|
|
44
51
|
if (maxMatch) {
|
|
45
52
|
const max = parseInt(maxMatch[1]);
|
|
46
53
|
return `Max ${formatPriceValue(max)}`;
|