@numueg/theme-sdk 0.5.1 → 0.5.2
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 +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/dist/validation.cjs +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var MAX_BLOCK_DEPTH = 5;
|
|
|
9
9
|
|
|
10
10
|
// src/validation/index.ts
|
|
11
11
|
var THEME_CONTRACT_VERSION = 1;
|
|
12
|
-
var SDK_VERSION = "0.5.
|
|
12
|
+
var SDK_VERSION = "0.5.2" ;
|
|
13
13
|
var REQUIRED_TEMPLATES = [
|
|
14
14
|
"home",
|
|
15
15
|
"product",
|
|
@@ -1470,16 +1470,17 @@ function availableValues(product, selection) {
|
|
|
1470
1470
|
const variants = product.variants || [];
|
|
1471
1471
|
const out = {};
|
|
1472
1472
|
for (const axis of axes) {
|
|
1473
|
-
|
|
1473
|
+
const set = /* @__PURE__ */ new Set();
|
|
1474
1474
|
for (const v of variants) {
|
|
1475
1475
|
const opts = v.option_values || v.options || {};
|
|
1476
1476
|
const compatible = Object.entries(selection).every(
|
|
1477
1477
|
([k, val]) => k === axis.name || opts[k] === val
|
|
1478
1478
|
);
|
|
1479
1479
|
if (compatible && opts[axis.name]) {
|
|
1480
|
-
|
|
1480
|
+
set.add(opts[axis.name]);
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
|
+
out[axis.name] = set.size > 0 ? set : new Set(axis.values || []);
|
|
1483
1484
|
}
|
|
1484
1485
|
return out;
|
|
1485
1486
|
}
|