@snowcone-app/ui 0.10.11 → 0.10.13
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 +15 -0
- package/README.md +7 -4
- package/dist/{chunk-UJ5ZXSFD.js → chunk-4E5PVNXY.js} +18 -3
- package/dist/chunk-4E5PVNXY.js.map +1 -0
- package/dist/{dev-warnings-LI2YBKKQ.js → dev-warnings-2MCWOVV5.js} +2 -2
- package/dist/index.cjs +79 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/composed/HeroProductImage.tsx +2 -1
- package/src/composed/search/CurrentRefinements.tsx +9 -2
- package/src/utils/dev-warnings.ts +4 -2
- package/dist/chunk-UJ5ZXSFD.js.map +0 -1
- /package/dist/{dev-warnings-LI2YBKKQ.js.map → dev-warnings-2MCWOVV5.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2973](https://github.com/snowcone-app/snowcone-monorepo/pull/2973) [`6910bc9`](https://github.com/snowcone-app/snowcone-monorepo/commit/6910bc9c88dbdcc5974d45ee93d2b2e17fff3bcf) Thanks [@kevinsproles](https://github.com/kevinsproles)! - The SDK owns Snowcone's hostnames. New `SNOWCONE_HOSTS` export (`api`, `img`, `buy`, `search`, `cdn`, `sign`, `raws`, `docs`) and `SNOWCONE_REALTIME_WS_URL` — every default host in the SDK, MCP server, canvas, and ui now reads from this one registry, so a host move ships as a version bump instead of breaking integrations. For an endpoint the SDK doesn't wrap, build the URL from `SNOWCONE_HOSTS.api` rather than hardcoding `https://api.snowcone.app`.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`6910bc9`](https://github.com/snowcone-app/snowcone-monorepo/commit/6910bc9c88dbdcc5974d45ee93d2b2e17fff3bcf)]:
|
|
10
|
+
- @snowcone-app/sdk@0.30.0
|
|
11
|
+
|
|
12
|
+
## 0.10.12
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#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.
|
|
17
|
+
|
|
3
18
|
## 0.10.11
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -62,15 +62,18 @@ function MyStore() {
|
|
|
62
62
|
<Shop mode="mock" shop="acc_123">…</Shop>
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
`mode` is `'mock' | 'live' | 'meilisearch'`. In Next.js you can
|
|
66
|
-
env instead of props:
|
|
65
|
+
`mode` is `'mock' | 'live' | 'meilisearch'`. In Next.js you can pass the Shop
|
|
66
|
+
ID via env instead of props:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
NEXT_PUBLIC_MERCH_ENDPOINT=https://api.snowcone.app
|
|
70
|
-
NEXT_PUBLIC_MERCH_MOCKUP_URL=https://cdn.snowcone.app
|
|
71
69
|
NEXT_PUBLIC_SNOWCONE_SHOP_ID=your-shop-id
|
|
72
70
|
```
|
|
73
71
|
|
|
72
|
+
Don't set Snowcone hostnames in env or props for production — the components
|
|
73
|
+
get them from `@snowcone-app/sdk`, so a host move is a version bump, not a
|
|
74
|
+
config change in your app. `NEXT_PUBLIC_MERCH_ENDPOINT` /
|
|
75
|
+
`NEXT_PUBLIC_MERCH_MOCKUP_URL` exist only to point at a local or staging stack.
|
|
76
|
+
|
|
74
77
|
| Component | Purpose |
|
|
75
78
|
|-----------|---------|
|
|
76
79
|
| `<Shop>` | Root provider (data source, mockup service, shop ID) |
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/utils/dev-warnings.ts
|
|
2
|
+
import { SNOWCONE_HOSTS } from "@snowcone-app/sdk";
|
|
2
3
|
var hasCheckedConfig = false;
|
|
3
4
|
var configCheckPassed = false;
|
|
4
5
|
function checkTailwindConfig() {
|
|
@@ -20,7 +21,21 @@ function checkTailwindConfig() {
|
|
|
20
21
|
console.error(
|
|
21
22
|
"%c\u{1F6A8} @snowcone-app/ui: Tailwind styles not detected!",
|
|
22
23
|
"font-size: 14px; font-weight: bold; color: #ef4444;",
|
|
23
|
-
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
\u274C Your components may look unstyled.
|
|
27
|
+
|
|
28
|
+
Common causes:
|
|
29
|
+
1. Missing or incorrect @source paths in globals.css
|
|
30
|
+
2. Forgot to restart dev server after changing globals.css
|
|
31
|
+
3. Tailwind CSS not imported in globals.css
|
|
32
|
+
|
|
33
|
+
Quick fix:
|
|
34
|
+
Run: npx snowcone-cli init
|
|
35
|
+
|
|
36
|
+
Or manually check:
|
|
37
|
+
${SNOWCONE_HOSTS.docs}/llm-kit/latest/theme-setup.md
|
|
38
|
+
`
|
|
24
39
|
);
|
|
25
40
|
configCheckPassed = false;
|
|
26
41
|
return false;
|
|
@@ -74,7 +89,7 @@ Missing: ${missingTokens.join(", ")}
|
|
|
74
89
|
|
|
75
90
|
Components may not render correctly.
|
|
76
91
|
Add theme tokens to globals.css:
|
|
77
|
-
|
|
92
|
+
${SNOWCONE_HOSTS.docs}/llm-kit/latest/themes.css`
|
|
78
93
|
);
|
|
79
94
|
return false;
|
|
80
95
|
}
|
|
@@ -96,4 +111,4 @@ export {
|
|
|
96
111
|
checkThemeTokens,
|
|
97
112
|
runConfigChecks
|
|
98
113
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-4E5PVNXY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/dev-warnings.ts"],"sourcesContent":["/**\n * Development-only warnings for detecting configuration issues\n *\n * This utility helps catch common setup problems early by checking\n * if Tailwind styles are properly applied to components.\n */\n\nimport { SNOWCONE_HOSTS } from '@snowcone-app/sdk';\n\nlet hasCheckedConfig = false;\nlet configCheckPassed = false;\n\n/**\n * Check if Tailwind CSS is properly configured\n * This runs once per page load in development mode\n */\nexport function checkTailwindConfig() {\n // Only run in development\n if (process.env.NODE_ENV !== 'development') return true;\n\n // Only check once\n if (hasCheckedConfig) return configCheckPassed;\n hasCheckedConfig = true;\n\n try {\n // Create a test element with Tailwind classes\n const testElement = document.createElement('div');\n testElement.className = 'bg-background text-foreground';\n testElement.style.position = 'absolute';\n testElement.style.visibility = 'hidden';\n testElement.style.pointerEvents = 'none';\n document.body.appendChild(testElement);\n\n // Check if styles are applied\n const styles = window.getComputedStyle(testElement);\n const hasBackgroundColor = styles.backgroundColor && styles.backgroundColor !== 'rgba(0, 0, 0, 0)';\n const hasTextColor = styles.color && styles.color !== 'rgb(0, 0, 0)';\n\n // Clean up\n document.body.removeChild(testElement);\n\n if (!hasBackgroundColor || !hasTextColor) {\n console.error(\n '%c🚨 @snowcone-app/ui: Tailwind styles not detected!',\n 'font-size: 14px; font-weight: bold; color: #ef4444;',\n '\\n\\n' +\n '❌ Your components may look unstyled.\\n\\n' +\n 'Common causes:\\n' +\n ' 1. Missing or incorrect @source paths in globals.css\\n' +\n ' 2. Forgot to restart dev server after changing globals.css\\n' +\n ' 3. Tailwind CSS not imported in globals.css\\n\\n' +\n 'Quick fix:\\n' +\n ' Run: npx snowcone-cli init\\n\\n' +\n 'Or manually check:\\n' +\n ` ${SNOWCONE_HOSTS.docs}/llm-kit/latest/theme-setup.md\\n`\n );\n configCheckPassed = false;\n return false;\n }\n\n configCheckPassed = true;\n return true;\n\n } catch (error) {\n console.warn('@snowcone-app/ui: Could not verify Tailwind configuration', error);\n configCheckPassed = false;\n return false;\n }\n}\n\n/**\n * Check if a specific component has styles applied\n * Use this in individual components to provide more specific warnings\n */\nexport function checkComponentStyles(\n element: HTMLElement | null,\n componentName: string\n): boolean {\n // Only run in development\n if (process.env.NODE_ENV !== 'development') return true;\n if (!element) return false;\n\n try {\n const styles = window.getComputedStyle(element);\n\n // Check if any Tailwind styles are applied\n // Look for non-default values on common properties\n const hasStyles =\n (styles.backgroundColor && styles.backgroundColor !== 'rgba(0, 0, 0, 0)') ||\n (styles.padding && styles.padding !== '0px') ||\n (styles.margin && styles.margin !== '0px') ||\n (styles.display && !['inline', 'block'].includes(styles.display));\n\n if (!hasStyles) {\n console.warn(\n `%c⚠️ ${componentName}: Missing Tailwind styles`,\n 'font-size: 12px; color: #f59e0b;',\n '\\n' +\n 'Component may not render correctly.\\n' +\n 'Check @source configuration in globals.css or run: npx snowcone-cli init'\n );\n return false;\n }\n\n return true;\n\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Check if required CSS variables (theme tokens) are defined\n */\nexport function checkThemeTokens(): boolean {\n // Only run in development\n if (process.env.NODE_ENV !== 'development') return true;\n\n try {\n const requiredTokens = [\n '--color-background',\n '--color-foreground',\n '--color-primary',\n '--color-card',\n ];\n\n const rootStyles = getComputedStyle(document.documentElement);\n const missingTokens = requiredTokens.filter(\n (token) => !rootStyles.getPropertyValue(token)\n );\n\n if (missingTokens.length > 0) {\n console.warn(\n '%c⚠️ @snowcone-app/ui: Missing theme tokens',\n 'font-size: 12px; color: #f59e0b;',\n '\\n' +\n `Missing: ${missingTokens.join(', ')}\\n\\n` +\n 'Components may not render correctly.\\n' +\n 'Add theme tokens to globals.css:\\n' +\n ` ${SNOWCONE_HOSTS.docs}/llm-kit/latest/themes.css`\n );\n return false;\n }\n\n return true;\n\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Run all configuration checks\n * Call this once when the app initializes\n */\nexport function runConfigChecks(): boolean {\n if (process.env.NODE_ENV !== 'development') return true;\n\n const tailwindOk = checkTailwindConfig();\n const themesOk = checkThemeTokens();\n\n return tailwindOk && themesOk;\n}\n"],"mappings":";AAOA,SAAS,sBAAsB;AAE/B,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AAMjB,SAAS,sBAAsB;AAEpC,MAAI,QAAQ,IAAI,aAAa,cAAe,QAAO;AAGnD,MAAI,iBAAkB,QAAO;AAC7B,qBAAmB;AAEnB,MAAI;AAEF,UAAM,cAAc,SAAS,cAAc,KAAK;AAChD,gBAAY,YAAY;AACxB,gBAAY,MAAM,WAAW;AAC7B,gBAAY,MAAM,aAAa;AAC/B,gBAAY,MAAM,gBAAgB;AAClC,aAAS,KAAK,YAAY,WAAW;AAGrC,UAAM,SAAS,OAAO,iBAAiB,WAAW;AAClD,UAAM,qBAAqB,OAAO,mBAAmB,OAAO,oBAAoB;AAChF,UAAM,eAAe,OAAO,SAAS,OAAO,UAAU;AAGtD,aAAS,KAAK,YAAY,WAAW;AAErC,QAAI,CAAC,sBAAsB,CAAC,cAAc;AACxC,cAAQ;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASK,eAAe,IAAI;AAAA;AAAA,MAC1B;AACA,0BAAoB;AACpB,aAAO;AAAA,IACT;AAEA,wBAAoB;AACpB,WAAO;AAAA,EAET,SAAS,OAAO;AACd,YAAQ,KAAK,6DAA6D,KAAK;AAC/E,wBAAoB;AACpB,WAAO;AAAA,EACT;AACF;AAMO,SAAS,qBACd,SACA,eACS;AAET,MAAI,QAAQ,IAAI,aAAa,cAAe,QAAO;AACnD,MAAI,CAAC,QAAS,QAAO;AAErB,MAAI;AACF,UAAM,SAAS,OAAO,iBAAiB,OAAO;AAI9C,UAAM,YACH,OAAO,mBAAmB,OAAO,oBAAoB,sBACrD,OAAO,WAAW,OAAO,YAAY,SACrC,OAAO,UAAU,OAAO,WAAW,SACnC,OAAO,WAAW,CAAC,CAAC,UAAU,OAAO,EAAE,SAAS,OAAO,OAAO;AAEjE,QAAI,CAAC,WAAW;AACd,cAAQ;AAAA,QACN,kBAAQ,aAAa;AAAA,QACrB;AAAA,QACA;AAAA,MAGF;AACA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EAET,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAKO,SAAS,mBAA4B;AAE1C,MAAI,QAAQ,IAAI,aAAa,cAAe,QAAO;AAEnD,MAAI;AACF,UAAM,iBAAiB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,UAAM,aAAa,iBAAiB,SAAS,eAAe;AAC5D,UAAM,gBAAgB,eAAe;AAAA,MACnC,CAAC,UAAU,CAAC,WAAW,iBAAiB,KAAK;AAAA,IAC/C;AAEA,QAAI,cAAc,SAAS,GAAG;AAC5B,cAAQ;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,WACY,cAAc,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,IAG/B,eAAe,IAAI;AAAA,MAC1B;AACA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EAET,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAMO,SAAS,kBAA2B;AACzC,MAAI,QAAQ,IAAI,aAAa,cAAe,QAAO;AAEnD,QAAM,aAAa,oBAAoB;AACvC,QAAM,WAAW,iBAAiB;AAElC,SAAO,cAAc;AACvB;","names":[]}
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
checkTailwindConfig,
|
|
4
4
|
checkThemeTokens,
|
|
5
5
|
runConfigChecks
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4E5PVNXY.js";
|
|
7
7
|
export {
|
|
8
8
|
checkComponentStyles,
|
|
9
9
|
checkTailwindConfig,
|
|
10
10
|
checkThemeTokens,
|
|
11
11
|
runConfigChecks
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=dev-warnings-
|
|
13
|
+
//# sourceMappingURL=dev-warnings-2MCWOVV5.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -57,7 +57,21 @@ function checkTailwindConfig() {
|
|
|
57
57
|
console.error(
|
|
58
58
|
"%c\u{1F6A8} @snowcone-app/ui: Tailwind styles not detected!",
|
|
59
59
|
"font-size: 14px; font-weight: bold; color: #ef4444;",
|
|
60
|
-
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
\u274C Your components may look unstyled.
|
|
63
|
+
|
|
64
|
+
Common causes:
|
|
65
|
+
1. Missing or incorrect @source paths in globals.css
|
|
66
|
+
2. Forgot to restart dev server after changing globals.css
|
|
67
|
+
3. Tailwind CSS not imported in globals.css
|
|
68
|
+
|
|
69
|
+
Quick fix:
|
|
70
|
+
Run: npx snowcone-cli init
|
|
71
|
+
|
|
72
|
+
Or manually check:
|
|
73
|
+
${import_sdk.SNOWCONE_HOSTS.docs}/llm-kit/latest/theme-setup.md
|
|
74
|
+
`
|
|
61
75
|
);
|
|
62
76
|
configCheckPassed = false;
|
|
63
77
|
return false;
|
|
@@ -111,7 +125,7 @@ Missing: ${missingTokens.join(", ")}
|
|
|
111
125
|
|
|
112
126
|
Components may not render correctly.
|
|
113
127
|
Add theme tokens to globals.css:
|
|
114
|
-
|
|
128
|
+
${import_sdk.SNOWCONE_HOSTS.docs}/llm-kit/latest/themes.css`
|
|
115
129
|
);
|
|
116
130
|
return false;
|
|
117
131
|
}
|
|
@@ -126,10 +140,11 @@ function runConfigChecks() {
|
|
|
126
140
|
const themesOk = checkThemeTokens();
|
|
127
141
|
return tailwindOk && themesOk;
|
|
128
142
|
}
|
|
129
|
-
var hasCheckedConfig, configCheckPassed;
|
|
143
|
+
var import_sdk, hasCheckedConfig, configCheckPassed;
|
|
130
144
|
var init_dev_warnings = __esm({
|
|
131
145
|
"src/utils/dev-warnings.ts"() {
|
|
132
146
|
"use strict";
|
|
147
|
+
import_sdk = require("@snowcone-app/sdk");
|
|
133
148
|
hasCheckedConfig = false;
|
|
134
149
|
configCheckPassed = false;
|
|
135
150
|
}
|
|
@@ -327,23 +342,23 @@ __export(src_exports, {
|
|
|
327
342
|
checkTailwindConfig: () => checkTailwindConfig,
|
|
328
343
|
checkThemeTokens: () => checkThemeTokens,
|
|
329
344
|
createScrollDirectionTracker: () => createScrollDirectionTracker,
|
|
330
|
-
describeProductArtAlignment: () =>
|
|
345
|
+
describeProductArtAlignment: () => import_sdk13.describeProductArtAlignment,
|
|
331
346
|
formatCurrency: () => formatCurrency,
|
|
332
347
|
formatDate: () => formatDate,
|
|
333
348
|
formatDateTime: () => formatDateTime,
|
|
334
349
|
getBrand: () => getBrand,
|
|
335
|
-
getMockupUrl: () =>
|
|
350
|
+
getMockupUrl: () => import_sdk12.getMockupUrl,
|
|
336
351
|
getObservedElementCount: () => getObservedElementCount,
|
|
337
352
|
getObserverCount: () => getObserverCount,
|
|
338
|
-
getProduct: () =>
|
|
339
|
-
getSnapPoints: () =>
|
|
353
|
+
getProduct: () => import_sdk12.getProduct,
|
|
354
|
+
getSnapPoints: () => import_sdk13.getSnapPoints,
|
|
340
355
|
hasEdgeBlur: () => hasEdgeBlur,
|
|
341
356
|
isObserved: () => isObserved,
|
|
342
357
|
isWideMonitor: () => isWideMonitor,
|
|
343
358
|
kbdVariants: () => kbdVariants,
|
|
344
359
|
linkVariants: () => linkVariants,
|
|
345
360
|
linkedPlacementsLabel: () => linkedPlacementsLabel,
|
|
346
|
-
listProducts: () =>
|
|
361
|
+
listProducts: () => import_sdk12.listProducts,
|
|
347
362
|
normalizeHex: () => normalizeHex,
|
|
348
363
|
observe: () => observe,
|
|
349
364
|
runConfigChecks: () => runConfigChecks,
|
|
@@ -847,12 +862,12 @@ function ColorSwatch({
|
|
|
847
862
|
}
|
|
848
863
|
|
|
849
864
|
// src/primitives/ProductPrice.tsx
|
|
850
|
-
var
|
|
865
|
+
var import_sdk4 = require("@snowcone-app/sdk");
|
|
851
866
|
|
|
852
867
|
// src/patterns/Product.tsx
|
|
853
868
|
var import_react5 = __toESM(require("react"), 1);
|
|
854
|
-
var import_sdk = require("@snowcone-app/sdk");
|
|
855
869
|
var import_sdk2 = require("@snowcone-app/sdk");
|
|
870
|
+
var import_sdk3 = require("@snowcone-app/sdk");
|
|
856
871
|
|
|
857
872
|
// src/patterns/ShopProvider.tsx
|
|
858
873
|
var import_react4 = __toESM(require("react"), 1);
|
|
@@ -1155,7 +1170,7 @@ function Product({
|
|
|
1155
1170
|
const clipShapes = productId ? clipShapesById[productId] || {} : {};
|
|
1156
1171
|
const clipShapeInExport = productId ? clipShapeInExportById[productId] || {} : {};
|
|
1157
1172
|
const universalProvider = (0, import_react5.useMemo)(() => {
|
|
1158
|
-
return (0,
|
|
1173
|
+
return (0, import_sdk3.createUniversalProvider)({
|
|
1159
1174
|
endpoint: effectiveEndpoint,
|
|
1160
1175
|
productId,
|
|
1161
1176
|
fetcher,
|
|
@@ -1175,9 +1190,9 @@ function Product({
|
|
|
1175
1190
|
return prev;
|
|
1176
1191
|
});
|
|
1177
1192
|
}
|
|
1178
|
-
const attrs = (0,
|
|
1179
|
-
const combos = (0,
|
|
1180
|
-
const defaultSelection = initialSelection || (0,
|
|
1193
|
+
const attrs = (0, import_sdk3.toOptionAttributes)(productData);
|
|
1194
|
+
const combos = (0, import_sdk3.toCombinations)(productData);
|
|
1195
|
+
const defaultSelection = initialSelection || (0, import_sdk3.deriveDefaultSelection)(attrs, combos);
|
|
1181
1196
|
const colorPlacementDefaults = {};
|
|
1182
1197
|
if (productData.placements) {
|
|
1183
1198
|
productData.placements.forEach((placement) => {
|
|
@@ -1202,9 +1217,9 @@ function Product({
|
|
|
1202
1217
|
return prev;
|
|
1203
1218
|
});
|
|
1204
1219
|
}
|
|
1205
|
-
const attrs = (0,
|
|
1206
|
-
const combos = (0,
|
|
1207
|
-
const defaultSelection = initialSelection || (0,
|
|
1220
|
+
const attrs = (0, import_sdk3.toOptionAttributes)(productData);
|
|
1221
|
+
const combos = (0, import_sdk3.toCombinations)(productData);
|
|
1222
|
+
const defaultSelection = initialSelection || (0, import_sdk3.deriveDefaultSelection)(attrs, combos);
|
|
1208
1223
|
const colorPlacementDefaults = {};
|
|
1209
1224
|
if (productData.placements) {
|
|
1210
1225
|
productData.placements.forEach((placement) => {
|
|
@@ -1226,12 +1241,12 @@ function Product({
|
|
|
1226
1241
|
try {
|
|
1227
1242
|
let loadedProduct;
|
|
1228
1243
|
if (productId) {
|
|
1229
|
-
loadedProduct = await (0,
|
|
1244
|
+
loadedProduct = await (0, import_sdk2.getProduct)(productId, {
|
|
1230
1245
|
baseUrl,
|
|
1231
1246
|
fetcher: customFetcher
|
|
1232
1247
|
});
|
|
1233
1248
|
} else {
|
|
1234
|
-
const { items } = await (0,
|
|
1249
|
+
const { items } = await (0, import_sdk2.listProducts)({
|
|
1235
1250
|
baseUrl,
|
|
1236
1251
|
fetcher: customFetcher
|
|
1237
1252
|
});
|
|
@@ -1248,9 +1263,9 @@ function Product({
|
|
|
1248
1263
|
return prev;
|
|
1249
1264
|
});
|
|
1250
1265
|
}
|
|
1251
|
-
const attrs = (0,
|
|
1252
|
-
const combos = (0,
|
|
1253
|
-
const defaultSelection = initialSelection || (0,
|
|
1266
|
+
const attrs = (0, import_sdk3.toOptionAttributes)(loadedProduct);
|
|
1267
|
+
const combos = (0, import_sdk3.toCombinations)(loadedProduct);
|
|
1268
|
+
const defaultSelection = initialSelection || (0, import_sdk3.deriveDefaultSelection)(attrs, combos);
|
|
1254
1269
|
const colorPlacementDefaults = {};
|
|
1255
1270
|
if (loadedProduct.placements) {
|
|
1256
1271
|
loadedProduct.placements.forEach((placement) => {
|
|
@@ -1289,11 +1304,11 @@ function Product({
|
|
|
1289
1304
|
effectiveMode
|
|
1290
1305
|
]);
|
|
1291
1306
|
const optionAttributes = (0, import_react5.useMemo)(
|
|
1292
|
-
() => product ? (0,
|
|
1307
|
+
() => product ? (0, import_sdk3.toOptionAttributes)(product) : {},
|
|
1293
1308
|
[product]
|
|
1294
1309
|
);
|
|
1295
1310
|
const combinations = (0, import_react5.useMemo)(
|
|
1296
|
-
() => product ? (0,
|
|
1311
|
+
() => product ? (0, import_sdk3.toCombinations)(product) : [],
|
|
1297
1312
|
[product]
|
|
1298
1313
|
);
|
|
1299
1314
|
const updateSelection = (0, import_react5.useCallback)((newSelection) => {
|
|
@@ -1439,7 +1454,7 @@ function Product({
|
|
|
1439
1454
|
);
|
|
1440
1455
|
const currentPrice = (0, import_react5.useMemo)(() => {
|
|
1441
1456
|
if (!product) return void 0;
|
|
1442
|
-
const bestCombination = (0,
|
|
1457
|
+
const bestCombination = (0, import_sdk3.findBestCombination)(
|
|
1443
1458
|
selection,
|
|
1444
1459
|
combinations,
|
|
1445
1460
|
optionAttributes
|
|
@@ -1564,7 +1579,7 @@ function ProductPrice({
|
|
|
1564
1579
|
} catch {
|
|
1565
1580
|
}
|
|
1566
1581
|
}
|
|
1567
|
-
const descriptor = (0,
|
|
1582
|
+
const descriptor = (0, import_sdk4.describeProductPrice)(
|
|
1568
1583
|
{ price, currency, locale, showCurrency, className },
|
|
1569
1584
|
priceValue
|
|
1570
1585
|
);
|
|
@@ -4268,7 +4283,7 @@ var Tooltip = Object.assign(TooltipBase, {
|
|
|
4268
4283
|
|
|
4269
4284
|
// src/composed/ProductOptions.tsx
|
|
4270
4285
|
var import_react11 = require("react");
|
|
4271
|
-
var
|
|
4286
|
+
var import_sdk5 = require("@snowcone-app/sdk");
|
|
4272
4287
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4273
4288
|
function ProductOptions({ className }) {
|
|
4274
4289
|
const context = useProduct();
|
|
@@ -4276,20 +4291,20 @@ function ProductOptions({ className }) {
|
|
|
4276
4291
|
if (!optionAttributes || Object.keys(optionAttributes).length === 0) {
|
|
4277
4292
|
return null;
|
|
4278
4293
|
}
|
|
4279
|
-
const optionRenderData = (0,
|
|
4294
|
+
const optionRenderData = (0, import_sdk5.prepareOptionRenderData)(
|
|
4280
4295
|
optionAttributes,
|
|
4281
4296
|
selection || {},
|
|
4282
4297
|
combinations || []
|
|
4283
4298
|
);
|
|
4284
4299
|
const handleChange = (0, import_react11.useCallback)(
|
|
4285
4300
|
(attributeName, value) => {
|
|
4286
|
-
const nextSelection = (0,
|
|
4301
|
+
const nextSelection = (0, import_sdk5.handleOptionChange)(
|
|
4287
4302
|
attributeName,
|
|
4288
4303
|
value,
|
|
4289
4304
|
selection || {},
|
|
4290
4305
|
optionAttributes
|
|
4291
4306
|
);
|
|
4292
|
-
const best = (0,
|
|
4307
|
+
const best = (0, import_sdk5.resolveBestCombination)(
|
|
4293
4308
|
nextSelection,
|
|
4294
4309
|
optionAttributes,
|
|
4295
4310
|
combinations || []
|
|
@@ -4698,7 +4713,7 @@ function ProductCard({
|
|
|
4698
4713
|
|
|
4699
4714
|
// src/composed/ProductList.tsx
|
|
4700
4715
|
var import_react13 = require("react");
|
|
4701
|
-
var
|
|
4716
|
+
var import_sdk6 = require("@snowcone-app/sdk");
|
|
4702
4717
|
|
|
4703
4718
|
// src/lib/env.ts
|
|
4704
4719
|
function readEnv(key) {
|
|
@@ -4721,7 +4736,7 @@ function ProductList({
|
|
|
4721
4736
|
(0, import_react13.useEffect)(() => {
|
|
4722
4737
|
async function fetchProducts() {
|
|
4723
4738
|
try {
|
|
4724
|
-
const response = await (0,
|
|
4739
|
+
const response = await (0, import_sdk6.listProducts)({
|
|
4725
4740
|
baseUrl: effectiveEndpoint || ""
|
|
4726
4741
|
});
|
|
4727
4742
|
const limitedProducts = (response.items || []).slice(0, limit);
|
|
@@ -4750,7 +4765,7 @@ function ProductList({
|
|
|
4750
4765
|
|
|
4751
4766
|
// src/hooks/useProductGallery.ts
|
|
4752
4767
|
var import_react14 = require("react");
|
|
4753
|
-
var
|
|
4768
|
+
var import_sdk7 = require("@snowcone-app/sdk");
|
|
4754
4769
|
var import_dev_fetcher = require("@snowcone-app/sdk/dev-fetcher");
|
|
4755
4770
|
function useProductGallery(productIds = [], options = {}) {
|
|
4756
4771
|
const { endpoint, mode = "mock", limit = 10 } = options;
|
|
@@ -4769,14 +4784,14 @@ function useProductGallery(productIds = [], options = {}) {
|
|
|
4769
4784
|
const customFetcher = mode === "mock" ? (0, import_dev_fetcher.createDevFetcher)(baseUrl) : void 0;
|
|
4770
4785
|
let fetchedProducts;
|
|
4771
4786
|
if (memoizedProductIds.length === 0) {
|
|
4772
|
-
const response = await (0,
|
|
4787
|
+
const response = await (0, import_sdk7.listProducts)({
|
|
4773
4788
|
baseUrl,
|
|
4774
4789
|
fetcher: customFetcher
|
|
4775
4790
|
});
|
|
4776
4791
|
fetchedProducts = response.items.slice(0, limit);
|
|
4777
4792
|
} else {
|
|
4778
4793
|
const productPromises = memoizedProductIds.map(
|
|
4779
|
-
(productId) => (0,
|
|
4794
|
+
(productId) => (0, import_sdk7.getProduct)(productId, { baseUrl, fetcher: customFetcher })
|
|
4780
4795
|
);
|
|
4781
4796
|
const results = await Promise.all(productPromises);
|
|
4782
4797
|
fetchedProducts = results.filter(Boolean);
|
|
@@ -4817,7 +4832,7 @@ function ProductGallery({
|
|
|
4817
4832
|
|
|
4818
4833
|
// src/composed/AddToCart.tsx
|
|
4819
4834
|
var import_react15 = require("react");
|
|
4820
|
-
var
|
|
4835
|
+
var import_sdk8 = require("@snowcone-app/sdk");
|
|
4821
4836
|
|
|
4822
4837
|
// src/utils/devWarnings.ts
|
|
4823
4838
|
var DOCS_BASE_URL = "https://snowcone.dev/docs/react";
|
|
@@ -4947,7 +4962,7 @@ function AddToCart({
|
|
|
4947
4962
|
}, []);
|
|
4948
4963
|
const { product, selection, combinations, optionAttributes } = context;
|
|
4949
4964
|
const isValidSelection = () => {
|
|
4950
|
-
return (0,
|
|
4965
|
+
return (0, import_sdk8.validateProductSelection)(
|
|
4951
4966
|
optionAttributes || {},
|
|
4952
4967
|
selection || {},
|
|
4953
4968
|
combinations || []
|
|
@@ -4959,7 +4974,7 @@ function AddToCart({
|
|
|
4959
4974
|
try {
|
|
4960
4975
|
setStatus("adding");
|
|
4961
4976
|
setErrorMessage(null);
|
|
4962
|
-
const cartDetail = (0,
|
|
4977
|
+
const cartDetail = (0, import_sdk8.createCartDetail)({
|
|
4963
4978
|
productId: product.id,
|
|
4964
4979
|
quantity,
|
|
4965
4980
|
selection: selection || {},
|
|
@@ -4972,7 +4987,7 @@ function AddToCart({
|
|
|
4972
4987
|
if (onClick) {
|
|
4973
4988
|
await onClick(cartDetail);
|
|
4974
4989
|
} else {
|
|
4975
|
-
await (0,
|
|
4990
|
+
await (0, import_sdk8.simulateCartOperation)(simulateDelay);
|
|
4976
4991
|
}
|
|
4977
4992
|
setStatus("added");
|
|
4978
4993
|
setTimeout(() => {
|
|
@@ -5984,7 +5999,7 @@ var import_react27 = require("react");
|
|
|
5984
5999
|
// src/patterns/RealtimeProvider.tsx
|
|
5985
6000
|
var import_react25 = require("react");
|
|
5986
6001
|
var import_react26 = require("@snowcone-app/sdk/react");
|
|
5987
|
-
var
|
|
6002
|
+
var import_sdk9 = require("@snowcone-app/sdk");
|
|
5988
6003
|
|
|
5989
6004
|
// src/patterns/MockupBackground.tsx
|
|
5990
6005
|
var import_react24 = require("react");
|
|
@@ -6838,13 +6853,13 @@ function RealtimeProvider({
|
|
|
6838
6853
|
const product = productContext.product;
|
|
6839
6854
|
const productId = product.id;
|
|
6840
6855
|
const placements = product.placements || [];
|
|
6841
|
-
const variantId = (0,
|
|
6856
|
+
const variantId = (0, import_sdk9.resolvePreviewVariantId)(
|
|
6842
6857
|
productContext,
|
|
6843
|
-
(0,
|
|
6858
|
+
(0, import_sdk9.resolveVariantId)(productContext, void 0, void 0)
|
|
6844
6859
|
);
|
|
6845
6860
|
const isFirstSend = !configSentRef.current;
|
|
6846
6861
|
const variantChanged = lastSentVariantIdRef.current !== null && lastSentVariantIdRef.current !== variantId;
|
|
6847
|
-
const sizePicture = (0,
|
|
6862
|
+
const sizePicture = (0, import_sdk9.gallerySizePicture)(product.mockups, (0, import_sdk9.resolveVariantId)(productContext, void 0, void 0));
|
|
6848
6863
|
const sizePictureId = sizePicture?.id ?? null;
|
|
6849
6864
|
const sizePictureChanged = configSentRef.current && lastSentSizePictureRef.current !== sizePictureId;
|
|
6850
6865
|
const bgChanged = configSentRef.current && lastSentBgRef.current !== mockupBg;
|
|
@@ -6859,7 +6874,7 @@ function RealtimeProvider({
|
|
|
6859
6874
|
const mockupIds = [];
|
|
6860
6875
|
if (product.mockups && Array.isArray(product.mockups)) {
|
|
6861
6876
|
product.mockups.forEach((mockup) => {
|
|
6862
|
-
if (mockup.id && (0,
|
|
6877
|
+
if (mockup.id && (0, import_sdk9.mockupRole)(mockup) === "ordinary") {
|
|
6863
6878
|
mockupIds.push(mockup.id);
|
|
6864
6879
|
}
|
|
6865
6880
|
});
|
|
@@ -7116,7 +7131,7 @@ function RealtimeProvider({
|
|
|
7116
7131
|
const pendingIds = [];
|
|
7117
7132
|
if (productContext?.product?.mockups) {
|
|
7118
7133
|
productContext.product.mockups.forEach((mockup) => {
|
|
7119
|
-
if ((0,
|
|
7134
|
+
if ((0, import_sdk9.mockupRole)(mockup) !== "ordinary" && !configuredMockupIdsRef.current.includes(mockup.id)) return;
|
|
7120
7135
|
if (mockup.placement === placement || !mockup.placement) {
|
|
7121
7136
|
pendingMockupIdsRef.current.add(mockup.id);
|
|
7122
7137
|
pendingIds.push(mockup.id);
|
|
@@ -10195,7 +10210,7 @@ var LoadingOverlayPrismCandyInline = (0, import_react41.memo)(
|
|
|
10195
10210
|
|
|
10196
10211
|
// src/index.ts
|
|
10197
10212
|
var import_react71 = require("@snowcone-app/sdk/react");
|
|
10198
|
-
var
|
|
10213
|
+
var import_sdk12 = require("@snowcone-app/sdk");
|
|
10199
10214
|
|
|
10200
10215
|
// src/patterns/ProductPageProvider.tsx
|
|
10201
10216
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
@@ -10262,7 +10277,7 @@ function ProductPageProviderMinimal({
|
|
|
10262
10277
|
// src/composed/ArtAlignment.tsx
|
|
10263
10278
|
var import_react42 = require("react");
|
|
10264
10279
|
var import_react43 = require("@use-gesture/react");
|
|
10265
|
-
var
|
|
10280
|
+
var import_sdk10 = require("@snowcone-app/sdk");
|
|
10266
10281
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
10267
10282
|
function ArtAlignment({
|
|
10268
10283
|
src: propSrc,
|
|
@@ -10307,7 +10322,7 @@ function ArtAlignment({
|
|
|
10307
10322
|
const effectiveAspectRatio = artworkAspectRatio || detectedAspectRatio;
|
|
10308
10323
|
const alignment = placementDesign?.alignment || propAlignment || "center";
|
|
10309
10324
|
const descriptor = (0, import_react42.useMemo)(
|
|
10310
|
-
() => (0,
|
|
10325
|
+
() => (0, import_sdk10.describeProductArtAlignment)(
|
|
10311
10326
|
{
|
|
10312
10327
|
src,
|
|
10313
10328
|
artworkAspectRatio: effectiveAspectRatio,
|
|
@@ -10435,7 +10450,7 @@ function ArtAlignment({
|
|
|
10435
10450
|
(0, import_react42.useEffect)(() => {
|
|
10436
10451
|
if (Date.now() - lastUserDragTimeRef.current < 500) return;
|
|
10437
10452
|
if (!isReady || maskDimensions.width === 0 || !descriptor) return;
|
|
10438
|
-
const points = (0,
|
|
10453
|
+
const points = (0, import_sdk10.getSnapPoints)(
|
|
10439
10454
|
containerSize,
|
|
10440
10455
|
maskDimensions,
|
|
10441
10456
|
descriptor.effectiveAlignment
|
|
@@ -10520,7 +10535,7 @@ function ArtAlignment({
|
|
|
10520
10535
|
-maxDistance
|
|
10521
10536
|
);
|
|
10522
10537
|
const positions = Object.entries(
|
|
10523
|
-
(0,
|
|
10538
|
+
(0, import_sdk10.getSnapPoints)(
|
|
10524
10539
|
containerSize,
|
|
10525
10540
|
maskDimensions,
|
|
10526
10541
|
descriptor.effectiveAlignment
|
|
@@ -10533,7 +10548,7 @@ function ArtAlignment({
|
|
|
10533
10548
|
},
|
|
10534
10549
|
["center", Infinity]
|
|
10535
10550
|
);
|
|
10536
|
-
const snapPoints = (0,
|
|
10551
|
+
const snapPoints = (0, import_sdk10.getSnapPoints)(
|
|
10537
10552
|
containerSize,
|
|
10538
10553
|
maskDimensions,
|
|
10539
10554
|
descriptor.effectiveAlignment
|
|
@@ -10789,7 +10804,7 @@ function CanvasEditor({
|
|
|
10789
10804
|
|
|
10790
10805
|
// src/composed/HeroProductImage.tsx
|
|
10791
10806
|
var import_react46 = require("react");
|
|
10792
|
-
var
|
|
10807
|
+
var import_sdk11 = require("@snowcone-app/sdk");
|
|
10793
10808
|
|
|
10794
10809
|
// src/hooks/viewport/useContainerWidth.ts
|
|
10795
10810
|
var import_react45 = require("react");
|
|
@@ -10855,7 +10870,7 @@ function buildHeroMockupUrl(args) {
|
|
|
10855
10870
|
if (!snow.shop) return null;
|
|
10856
10871
|
const publicDesign = toPublicDesign(args.design, args.placements);
|
|
10857
10872
|
if (Object.keys(publicDesign).length === 0) return null;
|
|
10858
|
-
return (0,
|
|
10873
|
+
return (0, import_sdk11.getMockupUrl)(args.productCode, {
|
|
10859
10874
|
shop: snow.shop,
|
|
10860
10875
|
design: publicDesign,
|
|
10861
10876
|
width: args.width,
|
|
@@ -10911,13 +10926,13 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
10911
10926
|
contextRef.current = context;
|
|
10912
10927
|
const actualProductId = product?.id || productId || context?.product?.id;
|
|
10913
10928
|
const selectedGvid = (0, import_react46.useMemo)(() => {
|
|
10914
|
-
return (0,
|
|
10929
|
+
return (0, import_sdk11.resolveVariantId)(context, gvid, variantId);
|
|
10915
10930
|
}, [gvid, variantId, context?.selection, context?.combinations]);
|
|
10916
10931
|
const actualMockupId = (0, import_react46.useMemo)(() => {
|
|
10917
|
-
return (0,
|
|
10932
|
+
return (0, import_sdk11.resolveMockupId)(context, selectedGvid, mockupId);
|
|
10918
10933
|
}, [mockupId, selectedGvid, context]);
|
|
10919
10934
|
const actualGvid = (0, import_react46.useMemo)(() => {
|
|
10920
|
-
return gvid || variantId ? selectedGvid : (0,
|
|
10935
|
+
return gvid || variantId ? selectedGvid : (0, import_sdk11.resolvePreviewVariantId)(context, selectedGvid, actualMockupId);
|
|
10921
10936
|
}, [gvid, variantId, selectedGvid, actualMockupId, context]);
|
|
10922
10937
|
const unavailable = actualMockupId ? realtimeContext?.unavailableMockups?.get(actualMockupId) ?? null : null;
|
|
10923
10938
|
const artworkSrc = artwork?.src;
|
|
@@ -10948,7 +10963,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
10948
10963
|
};
|
|
10949
10964
|
}
|
|
10950
10965
|
}
|
|
10951
|
-
const design = (0,
|
|
10966
|
+
const design = (0, import_sdk11.createDesignForPlacements)(allPlacements, images, {
|
|
10952
10967
|
artworkSrc: effectiveArtworkSrc,
|
|
10953
10968
|
placementDesigns
|
|
10954
10969
|
});
|
|
@@ -11288,7 +11303,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11288
11303
|
const placementTiles = firstPlacement ? getPlacementDesign?.(firstPlacement.label)?.tiles : void 0;
|
|
11289
11304
|
const isCurrentArtworkPattern = artworkType === "pattern" || selectedArtworkType === "pattern";
|
|
11290
11305
|
const tiles = isCurrentArtworkPattern ? placementTiles ? placementTiles : artworkTileCount ? artworkTileCount : selectedArtworkTileCount ? selectedArtworkTileCount : void 0 : void 0;
|
|
11291
|
-
return (0,
|
|
11306
|
+
return (0, import_sdk11.createDesignForPlacements)(placements, providedImages, {
|
|
11292
11307
|
selection: contextSelectionRef.current,
|
|
11293
11308
|
attributes: contextOptionAttributesRef.current,
|
|
11294
11309
|
artworkSrc: effectiveArtworkSrc2,
|
|
@@ -11568,7 +11583,7 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
11568
11583
|
signHintShownRef.current = true;
|
|
11569
11584
|
const hasSigner = typeof window !== "undefined" && !!window.snowcone?.signMockupUrl;
|
|
11570
11585
|
console.warn(
|
|
11571
|
-
hasSigner ? "[Snowcone] A mockup image failed to load and its URL is unsigned. Your `signMockupUrl` likely errored \u2014 check your /api/sign route and that its secret matches the shop's signing secret." :
|
|
11586
|
+
hasSigner ? "[Snowcone] A mockup image failed to load and its URL is unsigned. Your `signMockupUrl` likely errored \u2014 check your /api/sign route and that its secret matches the shop's signing secret." : `[Snowcone] A mockup image failed to load (likely 'Missing required signature'). If your shop requires signed URLs, pass \`signMockupUrl\` to <Shop> so the UI can sign mockup <img> URLs. Docs: ${import_sdk11.SNOWCONE_HOSTS.docs}/design-system/signing-at-scale`
|
|
11572
11587
|
);
|
|
11573
11588
|
}
|
|
11574
11589
|
}
|
|
@@ -11639,7 +11654,7 @@ var SafeImg = import_react47.default.forwardRef(
|
|
|
11639
11654
|
);
|
|
11640
11655
|
|
|
11641
11656
|
// src/index.ts
|
|
11642
|
-
var
|
|
11657
|
+
var import_sdk13 = require("@snowcone-app/sdk");
|
|
11643
11658
|
|
|
11644
11659
|
// src/composed/search/SearchProvider.tsx
|
|
11645
11660
|
var import_react_instantsearch = require("react-instantsearch");
|
|
@@ -12287,6 +12302,8 @@ var import_react_instantsearch5 = require("react-instantsearch");
|
|
|
12287
12302
|
var import_lucide_react6 = require("lucide-react");
|
|
12288
12303
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
12289
12304
|
var XIcon3 = import_lucide_react6.X;
|
|
12305
|
+
var MIN_PRICE = new RegExp("[\u2265>=]+\\s*(\\d+)");
|
|
12306
|
+
var MAX_PRICE = new RegExp("[\u2264<=]+\\s*(\\d+)");
|
|
12290
12307
|
function CurrentRefinements() {
|
|
12291
12308
|
const { items, refine } = (0, import_react_instantsearch5.useCurrentRefinements)();
|
|
12292
12309
|
const formatPriceValue = (priceInCents) => {
|
|
@@ -12307,12 +12324,12 @@ function CurrentRefinements() {
|
|
|
12307
12324
|
const max = parseInt(rangeMatch[2]);
|
|
12308
12325
|
return `${formatPriceValue(min)} - ${formatPriceValue(max)}`;
|
|
12309
12326
|
}
|
|
12310
|
-
const minMatch = label.match(
|
|
12327
|
+
const minMatch = label.match(MIN_PRICE);
|
|
12311
12328
|
if (minMatch) {
|
|
12312
12329
|
const min = parseInt(minMatch[1]);
|
|
12313
12330
|
return `Min ${formatPriceValue(min)}`;
|
|
12314
12331
|
}
|
|
12315
|
-
const maxMatch = label.match(
|
|
12332
|
+
const maxMatch = label.match(MAX_PRICE);
|
|
12316
12333
|
if (maxMatch) {
|
|
12317
12334
|
const max = parseInt(maxMatch[1]);
|
|
12318
12335
|
return `Max ${formatPriceValue(max)}`;
|