@lotics/cli 0.223.0 → 0.225.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.
@@ -420,6 +420,7 @@ var __loticsProbe = (() => {
420
420
  strips: counted.map((el) => Array.from(el.querySelectorAll('[role="tab"]')).map((tab) => (tab.textContent || "").trim()))
421
421
  };
422
422
  }
423
+ var SINGLE_LINE_FIELDS = /* @__PURE__ */ new Set(["text", "search", "tel", "url", "email", "number"]);
423
424
  function truncatedLeaves(root = document.body) {
424
425
  const skipTag = /^(SCRIPT|STYLE|TITLE|META|LINK|NOSCRIPT|TEMPLATE)$/;
425
426
  const clippedAway2 = /^inset\(\s*50%/;
@@ -428,7 +429,8 @@ var __loticsProbe = (() => {
428
429
  let total = 0;
429
430
  for (const el of Array.from(root.querySelectorAll("*"))) {
430
431
  if (skipTag.test(el.tagName) || el.children.length > 0) continue;
431
- const text = (el.textContent || "").trim();
432
+ const field = el instanceof HTMLInputElement && SINGLE_LINE_FIELDS.has(el.type) ? el : void 0;
433
+ const text = (field === void 0 ? el.textContent || "" : field.value).trim();
432
434
  if (!text) continue;
433
435
  if (typeof el.checkVisibility === "function" && !el.checkVisibility()) continue;
434
436
  const style = getComputedStyle(el);
@@ -441,7 +443,7 @@ var __loticsProbe = (() => {
441
443
  const value = style.getPropertyValue(property);
442
444
  return value !== "" && value !== "none";
443
445
  };
444
- if ((states("-webkit-line-clamp") || states("line-clamp")) && breakable.test(text)) continue;
446
+ if ((field !== void 0 || states("-webkit-line-clamp") || states("line-clamp")) && breakable.test(text)) continue;
445
447
  if (el.scrollWidth > el.clientWidth + 1) {
446
448
  cut.push({ text: text.slice(0, 40), axis: "width", has: el.clientWidth, needs: el.scrollWidth });
447
449
  } else if (el.scrollHeight > el.clientHeight + 1) {