@yahoo/uds-create-cli 5.88.1 → 5.89.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-cli",
3
- "version": "5.88.1",
3
+ "version": "5.89.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,10 +32,10 @@
32
32
  "@modelcontextprotocol/sdk": "^1.32.2",
33
33
  "@orpc/client": "^1.13.9",
34
34
  "@orpc/contract": "^1.13.9",
35
- "@yahoo/uds-create-config": "5.88.1",
36
- "@yahoo/uds-create-loader": "5.88.1",
37
- "@yahoo/uds-create-types": "5.88.1",
38
- "@yahoo/uds-create-utils": "5.88.1",
35
+ "@yahoo/uds-create-config": "5.89.1",
36
+ "@yahoo/uds-create-loader": "5.89.1",
37
+ "@yahoo/uds-create-types": "5.89.1",
38
+ "@yahoo/uds-create-utils": "5.89.1",
39
39
  "esbuild": "^0.27.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "get-tsconfig": "^4.10.0",
@@ -54,11 +54,11 @@
54
54
  },
55
55
  "udsSchemaVersion": 20261109144822,
56
56
  "optionalDependencies": {
57
- "@yahoo/uds-create-cli-darwin-arm64": "5.88.1",
58
- "@yahoo/uds-create-cli-darwin-x64": "5.88.1",
59
- "@yahoo/uds-create-cli-linux-arm64": "5.88.1",
60
- "@yahoo/uds-create-cli-linux-x64": "5.88.1",
61
- "@yahoo/uds-create-cli-linux-arm64-musl": "5.88.1",
62
- "@yahoo/uds-create-cli-linux-x64-musl": "5.88.1"
57
+ "@yahoo/uds-create-cli-darwin-arm64": "5.89.1",
58
+ "@yahoo/uds-create-cli-darwin-x64": "5.89.1",
59
+ "@yahoo/uds-create-cli-linux-arm64": "5.89.1",
60
+ "@yahoo/uds-create-cli-linux-x64": "5.89.1",
61
+ "@yahoo/uds-create-cli-linux-arm64-musl": "5.89.1",
62
+ "@yahoo/uds-create-cli-linux-x64-musl": "5.89.1"
63
63
  }
64
64
  }
@@ -69864,16 +69864,30 @@ function storedDefaultConditions(body) {
69864
69864
  return isPlainObject2(stored) ? stored : {};
69865
69865
  }
69866
69866
  function defaultsFor({ body, given }) {
69867
- const defaults = body?.defaultProps ?? {};
69868
- const conditions = Object.values(storedDefaultConditions(body));
69869
- if (conditions.length === 0) return defaults;
69867
+ const defaults = unconditionalDefaults(body);
69868
+ if (Object.keys(storedDefaultConditions(body)).length === 0) return defaults;
69870
69869
  const out = { ...defaults };
69871
- for (const { when, props } of conditions) if (Object.entries(when).every(([prop, value]) => {
69872
- const current = given[prop] !== void 0 ? given[prop] : defaults[prop];
69873
- return String(refLeaf(current)) === String(refLeaf(value));
69874
- })) Object.assign(out, props);
69870
+ for (const { condition } of holdingDefaultConditions({
69871
+ body,
69872
+ given
69873
+ })) Object.assign(out, condition.props);
69875
69874
  return out;
69876
69875
  }
69876
+ function holdingDefaultConditions({ body, given }) {
69877
+ const defaults = unconditionalDefaults(body);
69878
+ return Object.entries(storedDefaultConditions(body)).flatMap(([key2, condition]) => {
69879
+ return Object.entries(condition.when).every(([prop, value]) => {
69880
+ const current = given[prop] !== void 0 ? given[prop] : defaults[prop];
69881
+ return String(refLeaf(current)) === String(refLeaf(value));
69882
+ }) ? [{
69883
+ key: key2,
69884
+ condition
69885
+ }] : [];
69886
+ });
69887
+ }
69888
+ function unconditionalDefaults(body) {
69889
+ return body?.defaultProps ?? {};
69890
+ }
69877
69891
 
69878
69892
  // ../config/dist/framework/config-operation-kind.js
69879
69893
  var CONFIG_OPERATION_KIND = "config";
@@ -70508,6 +70522,61 @@ function isShadow(value) {
70508
70522
  const layers = value.shadow;
70509
70523
  return Array.isArray(layers) && layers.length > 0 && layers.every((layer) => isRef2(layer) || isParts(layer));
70510
70524
  }
70525
+ var SHADOW_LENGTH = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:[a-z]+|%)?$/i;
70526
+ function parseCssShadow(value) {
70527
+ return splitTopLevel({
70528
+ value,
70529
+ separator: ","
70530
+ }).map((layer) => {
70531
+ const lengths = [];
70532
+ let color;
70533
+ let inset = false;
70534
+ for (const part of splitTopLevel({
70535
+ value: layer,
70536
+ separator: " "
70537
+ })) {
70538
+ if (part === "inset" && !inset) {
70539
+ inset = true;
70540
+ continue;
70541
+ }
70542
+ if (SHADOW_LENGTH.test(part)) {
70543
+ lengths.push(part);
70544
+ continue;
70545
+ }
70546
+ if (color !== void 0) throw new Error(`Unexpected shadow part "${part}"`);
70547
+ color = part;
70548
+ }
70549
+ if (color === void 0 || lengths.length < 2 || lengths.length > 4) throw new Error("Shadow needs a color and two to four lengths");
70550
+ const [offsetX, offsetY, blur, spread] = lengths;
70551
+ return {
70552
+ ...inset ? { inset } : {},
70553
+ offsetX,
70554
+ offsetY,
70555
+ ...blur === void 0 ? {} : { blur },
70556
+ ...spread === void 0 ? {} : { spread },
70557
+ color
70558
+ };
70559
+ });
70560
+ }
70561
+ function splitTopLevel({ value, separator }) {
70562
+ const parts = [];
70563
+ let depth = 0;
70564
+ let start = 0;
70565
+ for (let at = 0; at < value.length; at++) {
70566
+ const char = value[at] ?? "";
70567
+ if (char === "(") depth++;
70568
+ if (char === ")") depth--;
70569
+ if (depth < 0) throw new Error("Unbalanced shadow function");
70570
+ const splits = separator === " " ? /\s/.test(char) : char === separator;
70571
+ if (depth === 0 && splits) {
70572
+ parts.push(value.slice(start, at).trim());
70573
+ start = at + 1;
70574
+ }
70575
+ }
70576
+ if (depth !== 0) throw new Error("Unbalanced shadow function");
70577
+ parts.push(value.slice(start).trim());
70578
+ return parts.filter(Boolean);
70579
+ }
70511
70580
  function shadowAuthoring(value) {
70512
70581
  return {
70513
70582
  helper: "shadow",
@@ -84546,13 +84615,18 @@ function prepareLinkedTokenBody({ path: path2, body, source, config: config2, de
84546
84615
  remBase,
84547
84616
  preserveLength: path2.split("/")[0] === "fontLineHeight"
84548
84617
  }) : value;
84549
- return typeof literal3 === "string" || typeof literal3 === "number" || typeof literal3 === "boolean" || isNativeFlexValue(literal3) || isRelativeLineHeightValue(literal3) ? convertLinkedTokenValue({
84618
+ if (typeof literal3 !== "string" && typeof literal3 !== "number" && typeof literal3 !== "boolean" && !isNativeFlexValue(literal3) && !isRelativeLineHeightValue(literal3)) return literal3;
84619
+ const converted = convertLinkedTokenValue({
84550
84620
  path: path2,
84551
84621
  value: literal3,
84552
84622
  sourcePlatform: source.name,
84553
84623
  destinationPlatform,
84554
84624
  remBase
84555
- }) : literal3;
84625
+ });
84626
+ return destinationPlatform === "react-native-system" && typeof converted === "string" ? nativeShadowValue({
84627
+ value: converted,
84628
+ remBase
84629
+ }) ?? converted : converted;
84556
84630
  };
84557
84631
  const overrides = body.overrides;
84558
84632
  return {
@@ -84564,6 +84638,42 @@ function prepareLinkedTokenBody({ path: path2, body, source, config: config2, de
84564
84638
  } : raw])) } : {}
84565
84639
  };
84566
84640
  }
84641
+ function nativeShadowValue({ value, remBase }) {
84642
+ let layers;
84643
+ try {
84644
+ layers = parseCssShadow(value);
84645
+ } catch {
84646
+ return;
84647
+ }
84648
+ const points = (length) => {
84649
+ if (NUMBER3.test(length)) return Number(length) === 0 ? length : void 0;
84650
+ const match = LENGTH.exec(length);
84651
+ if (!match) return void 0;
84652
+ if (match[2] === "px") return length;
84653
+ if (remBase === void 0) return void 0;
84654
+ return `${Number(match[1]) * remBase}px`;
84655
+ };
84656
+ const converted = [];
84657
+ for (const { color, offsetX, offsetY, blur, spread, inset } of layers) {
84658
+ if (typeof color !== "string" || color.includes("var(")) return void 0;
84659
+ const [x, y, b, s] = [
84660
+ offsetX,
84661
+ offsetY,
84662
+ blur,
84663
+ spread
84664
+ ].map((length) => length === void 0 ? void 0 : points(length));
84665
+ if (x === void 0 || y === void 0 || blur !== void 0 && b === void 0 || spread !== void 0 && s === void 0) return;
84666
+ converted.push({
84667
+ ...inset ? { inset } : {},
84668
+ offsetX: x,
84669
+ offsetY: y,
84670
+ ...b === void 0 ? {} : { blur: b },
84671
+ ...s === void 0 ? {} : { spread: s },
84672
+ color: oklchAsHex(color) ?? color
84673
+ });
84674
+ }
84675
+ return { shadow: converted };
84676
+ }
84567
84677
  function nativeLiteral({ config: config2, value, remBase, preserveLength = false }) {
84568
84678
  const marked = typeof value === "string" && hasRefMarker(value);
84569
84679
  const calc = isCalc(value);
@@ -91535,11 +91645,20 @@ function inlineWholeEntity({ body, kind, config: config2, slug: slug2, options }
91535
91645
  source: owner
91536
91646
  });
91537
91647
  const { [primary]: _ourRef, ...ourFields } = body;
91538
- const merged = {
91539
- ...inlineSourcedRefs(theirFields, owner, void 0, options),
91540
- ...inlineSourcedRefs(ourFields, config2, slug2, options),
91648
+ const carried = inlineSourcedRefs(theirFields, owner, void 0, options);
91649
+ const ours = inlineSourcedRefs(ourFields, config2, slug2, options);
91650
+ const borrowed = {
91651
+ ...carried,
91652
+ ...ours,
91541
91653
  [primary]: inlineSourcedRefs(theirValue, owner, void 0, options)
91542
91654
  };
91655
+ const merged = config2.entityOf(kind)?.prepareLinkedBody?.({
91656
+ path: pathOf2(pointer),
91657
+ body: borrowed,
91658
+ source: owner,
91659
+ config: config2,
91660
+ extend: ours
91661
+ }) ?? borrowed;
91543
91662
  assertCarriedRefsResolve(merged, config2, pointer.__ref);
91544
91663
  return merged;
91545
91664
  }
@@ -96569,14 +96688,57 @@ var Config = class Config2 {
96569
96688
  const reaching = this.sourceFor(other);
96570
96689
  const copy = reaching?.resolve(kind, path2);
96571
96690
  if (!reaching || !copy) return false;
96691
+ const bare2 = [.../* @__PURE__ */ new Set([...reaching.sourceSlugs(), ...collectRefs(copy.body).flatMap((marker) => sourceOf2(marker) ?? [])])].reduce((body2, slug2) => rewriteRefSource(body2, slug2, void 0), copy.body);
96692
+ const ours = rewriteRefSource(body, other, void 0);
96693
+ return this.readsAs({
96694
+ kind,
96695
+ body: bare2,
96696
+ as: ours
96697
+ });
96698
+ }
96699
+ /**
96700
+ * Whether `body` is what `slug`'s entity at `kind:path` becomes when it is inlined here
96701
+ * ({@link withInlinedSources}), which follows their aliases and spells the result in this config's
96702
+ * terms. A pin that survives the inlining still offers the path, and this is the same entity.
96703
+ */
96704
+ inlinedFrom({ body, slug: slug2, kind, path: path2 }) {
96705
+ let borrowed;
96706
+ try {
96707
+ borrowed = this.extensionBody(kind, {
96708
+ __ref: ref(kind, path2, slug2).__ref,
96709
+ extend: {}
96710
+ });
96711
+ } catch {
96712
+ return false;
96713
+ }
96714
+ if (!borrowed) return false;
96715
+ let inlined;
96716
+ try {
96717
+ inlined = inlineWholeEntity({
96718
+ body: borrowed,
96719
+ kind,
96720
+ config: this,
96721
+ options: { keepIdentityRefs: true }
96722
+ });
96723
+ } catch {
96724
+ return false;
96725
+ }
96726
+ return this.readsAs({
96727
+ kind,
96728
+ body: inlined,
96729
+ as: body
96730
+ });
96731
+ }
96732
+ /** Whether two bodies of `kind` are the same entity, leaving out the fields that say where a body
96733
+ * came from: the kind's computed fields (`borrowedFrom`, `sources`) and a copy's `copiedFrom`. A
96734
+ * resolved body carries them where a stored one doesn't. */
96735
+ readsAs({ kind, body, as }) {
96572
96736
  const provenance = Object.fromEntries([...this.entityOf(kind)?.computedKeys ?? [], "copiedFrom"].map((key2) => [key2, void 0]));
96573
- const entityOf = (body2) => JSON.stringify({
96574
- ...body2,
96737
+ const entityOf = (fields) => JSON.stringify({
96738
+ ...fields,
96575
96739
  ...provenance
96576
96740
  });
96577
- const bare2 = [.../* @__PURE__ */ new Set([...reaching.sourceSlugs(), ...collectRefs(copy.body).flatMap((marker) => sourceOf2(marker) ?? [])])].reduce((body2, slug2) => rewriteRefSource(body2, slug2, void 0), copy.body);
96578
- const ours = rewriteRefSource(body, other, void 0);
96579
- return entityOf(bare2) === entityOf(ours);
96741
+ return entityOf(body) === entityOf(as);
96580
96742
  }
96581
96743
  /** How `slug`'s source joins this config ({@link EntityKind.sourceType}): `linked` unless its pin
96582
96744
  * says otherwise. */
@@ -96793,6 +96955,11 @@ var Config = class Config2 {
96793
96955
  other: slug2,
96794
96956
  kind,
96795
96957
  path: path2
96958
+ }) && !this.inlinedFrom({
96959
+ body: current.body,
96960
+ slug: slug2,
96961
+ kind,
96962
+ path: path2
96796
96963
  })) ownedAgainst.set(target2, [...ownedAgainst.get(target2) ?? [], slug2]);
96797
96964
  continue;
96798
96965
  }
@@ -106053,6 +106220,21 @@ var defineComponent = Object.assign(defineComponentImpl, {
106053
106220
  props: definePropsFirst
106054
106221
  });
106055
106222
 
106223
+ // ../config/dist/entities/system/resolve-properties.js
106224
+ var componentModels = createSliceMemo({
106225
+ kinds: [
106226
+ "component",
106227
+ "style-property",
106228
+ "token",
106229
+ "composite",
106230
+ "modifier",
106231
+ "icon",
106232
+ "motion",
106233
+ "source"
106234
+ ],
106235
+ compute: (_config) => /* @__PURE__ */ new Map()
106236
+ });
106237
+
106056
106238
  // ../config/dist/framework/derived-mutations.js
106057
106239
  var PROBE_COLLECTION = defineSubEntity({
106058
106240
  name: "member",