@yahoo/uds-create-cli 5.110.0 → 5.111.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-cli",
3
- "version": "5.110.0",
3
+ "version": "5.111.0",
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.110.0",
36
- "@yahoo/uds-create-loader": "5.110.0",
37
- "@yahoo/uds-create-types": "5.110.0",
38
- "@yahoo/uds-create-utils": "5.110.0",
35
+ "@yahoo/uds-create-config": "5.111.0",
36
+ "@yahoo/uds-create-loader": "5.111.0",
37
+ "@yahoo/uds-create-types": "5.111.0",
38
+ "@yahoo/uds-create-utils": "5.111.0",
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": 20261118171253,
56
56
  "optionalDependencies": {
57
- "@yahoo/uds-create-cli-darwin-arm64": "5.110.0",
58
- "@yahoo/uds-create-cli-darwin-x64": "5.110.0",
59
- "@yahoo/uds-create-cli-linux-arm64": "5.110.0",
60
- "@yahoo/uds-create-cli-linux-x64": "5.110.0",
61
- "@yahoo/uds-create-cli-linux-arm64-musl": "5.110.0",
62
- "@yahoo/uds-create-cli-linux-x64-musl": "5.110.0"
57
+ "@yahoo/uds-create-cli-darwin-arm64": "5.111.0",
58
+ "@yahoo/uds-create-cli-darwin-x64": "5.111.0",
59
+ "@yahoo/uds-create-cli-linux-arm64": "5.111.0",
60
+ "@yahoo/uds-create-cli-linux-x64": "5.111.0",
61
+ "@yahoo/uds-create-cli-linux-arm64-musl": "5.111.0",
62
+ "@yahoo/uds-create-cli-linux-x64-musl": "5.111.0"
63
63
  }
64
64
  }
@@ -90631,7 +90631,13 @@ function specFromCapture(options) {
90631
90631
  props: converter.artboardProps(frameRole.component)
90632
90632
  } : void 0);
90633
90633
  let rootKey;
90634
- if (wrapper) {
90634
+ if (!options.root && scope === tree && isCapturedPage(tree)) {
90635
+ rootKey = "root";
90636
+ converter.elements.root = converter.pageArtboard({
90637
+ body: tree,
90638
+ children: top
90639
+ });
90640
+ } else if (wrapper) {
90635
90641
  rootKey = "root";
90636
90642
  converter.elements.root = {
90637
90643
  type: wrapper.type,
@@ -90651,6 +90657,9 @@ function specFromCapture(options) {
90651
90657
  unresolvedIcons: converter.unresolvedIcons
90652
90658
  };
90653
90659
  }
90660
+ function isCapturedPage(tree) {
90661
+ return tree.tagName === "body" && (tree.hasAttribute("data-uds-computed") || tree.hasAttribute("style"));
90662
+ }
90654
90663
  var FOLD = "data-uds-fold";
90655
90664
  var EMBED_SPACE_ATTR = "data-uds-embed";
90656
90665
  var COMPUTED_STYLE_ATTR = "data-uds-computed";
@@ -91250,14 +91259,41 @@ var Converter = class {
91250
91259
  }
91251
91260
  return props;
91252
91261
  }
91253
- /** The props that make `component` an artboard: what its content is placed against and clipped to. */
91262
+ /**
91263
+ * The props that make `component` an artboard: what its content is placed against and clipped to,
91264
+ * at the capture's width. A root that states no width hugs its content on the canvas.
91265
+ */
91254
91266
  artboardProps(component) {
91255
91267
  const props = {};
91256
91268
  const grammar = this.grammar.component(component);
91257
- if (grammar) this.propsFromDeclarations(ARTBOARD, grammar, props);
91269
+ const width = this.options.width ?? DEFAULT_CAPTURE_WIDTH;
91270
+ if (grammar) this.propsFromDeclarations([...ARTBOARD, ["width", `${width}px`]], grammar, props);
91258
91271
  return props;
91259
91272
  }
91260
91273
  /**
91274
+ * The artboard a captured page becomes: a plain `div` holding the body's content, painted and set
91275
+ * in type as the body was, the capture's width and at least its height. Its size is inline, where
91276
+ * the canvas reads a plain root's size.
91277
+ */
91278
+ pageArtboard({ body, children }) {
91279
+ const { className: className2, style } = this.plainStyle(body);
91280
+ const width = this.options.width ?? DEFAULT_CAPTURE_WIDTH;
91281
+ const artboard = Object.fromEntries(ARTBOARD.map(([property, value]) => [camelCase3(property), value]));
91282
+ return {
91283
+ type: "div",
91284
+ props: {
91285
+ ...className2 ? { className: className2 } : {},
91286
+ style: {
91287
+ ...style,
91288
+ ...artboard,
91289
+ width: `${width}px`,
91290
+ ...this.options.height !== void 0 ? { minHeight: `${this.options.height}px` } : {}
91291
+ }
91292
+ },
91293
+ children
91294
+ };
91295
+ }
91296
+ /**
91261
91297
  * What `el`'s render placed outside its stamped slot layers and claimed layers, walking down to
91262
91298
  * the first thing on each branch that is a piece of its own: a nested component, a glyph (unless
91263
91299
  * `el` draws its own), a field it does not read, or an unmarked element with an inline style.
@@ -91486,6 +91522,10 @@ var Converter = class {
91486
91522
  if (into === "children" && slot !== ownChildren.at(-1)) continue;
91487
91523
  const holder = into === "children" ? layer : slotLayerNamed(layer, into);
91488
91524
  if (!holder) continue;
91525
+ if (props[slot] !== void 0) {
91526
+ if (layer === el && holder === layer) rootSlotted = true;
91527
+ continue;
91528
+ }
91489
91529
  const declaration = declared2[slot];
91490
91530
  const callerMarkup = declaration?.type === "slot" && declaration.text !== true;
91491
91531
  const fills = holder === layer ? this.convertOutsideLayers(layer, path2, callerMarkup) : this.convertChildren(holder);