@wix/himalaya-cli 0.1154.0 → 0.1155.0

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.
@@ -7909,10 +7909,52 @@ function walk(node, registry, path, out) {
7909
7909
  });
7910
7910
  }
7911
7911
  }
7912
+ const type = typeof obj.type === "string" ? obj.type : "";
7913
+ const colorProps = Object.prototype.hasOwnProperty.call(COLOR_TOKEN_PROPS, type) ? COLOR_TOKEN_PROPS[type] : void 0;
7914
+ const typoProps = Object.prototype.hasOwnProperty.call(TYPOGRAPHY_TOKEN_PROPS, type) ? TYPOGRAPHY_TOKEN_PROPS[type] : void 0;
7915
+ if ((colorProps || typoProps) && obj.props && typeof obj.props === "object") {
7916
+ const props = obj.props;
7917
+ const check = (spec, kind) => {
7918
+ const [arrayKey, leaf] = spec.includes("[].") ? spec.split("[].") : [void 0, spec];
7919
+ const sites = arrayKey ? (Array.isArray(props[arrayKey]) ? props[arrayKey] : []).map((el, i) => [`${path}.props.${arrayKey}[${i}].${leaf}`, el && typeof el === "object" ? el[leaf] : void 0]) : [[`${path}.props.${leaf}`, props[leaf]]];
7920
+ for (const [at, v] of sites) {
7921
+ if (typeof v !== "string" || v === "") continue;
7922
+ if (kind === "color" ? !v.startsWith("#") && !registry.colors.has(v) : !registry.typography.has(v)) {
7923
+ out.push({ path: at, kind, name: v });
7924
+ }
7925
+ }
7926
+ };
7927
+ for (const spec of colorProps ?? []) check(spec, "color");
7928
+ for (const spec of typoProps ?? []) check(spec, "typography");
7929
+ }
7912
7930
  for (const [key, value] of Object.entries(obj)) {
7913
7931
  walk(value, registry, `${path}.${key}`, out);
7914
7932
  }
7915
7933
  }
7934
+ var COLOR_TOKEN_PROPS = {
7935
+ Badge: ["token"],
7936
+ Card: ["background"],
7937
+ Image: ["tint", "placeholder"],
7938
+ Tag: ["token"],
7939
+ Icon: ["tint"],
7940
+ Toggle: ["trackOn", "trackOff", "thumb"],
7941
+ ProgressBar: ["tint", "trackColor"],
7942
+ ListItem: ["titleColor", "subtitleColor", "overlineColor"],
7943
+ Slider: ["tint"],
7944
+ ActivityIndicator: ["tint"],
7945
+ Label: ["color"],
7946
+ Gauge: ["tint", "rings[].tint"],
7947
+ Rating: ["color"],
7948
+ VoiceNote: ["tint"],
7949
+ Marquee: ["color"],
7950
+ Fab: ["tint"]
7951
+ };
7952
+ var TYPOGRAPHY_TOKEN_PROPS = {
7953
+ ListItem: ["titleStyle", "subtitleStyle"],
7954
+ RichText: ["runs[].style"],
7955
+ Label: ["style"],
7956
+ Marquee: ["style"]
7957
+ };
7916
7958
 
7917
7959
  // ../../core/ts/src/widget-vocabulary.ts
7918
7960
  var WIDGET_FAMILIES = ["ios_home", "ios_lock", "android_home", "web_card", "ios_live_activity", "watch_complication", "car_list"];