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