hyperframes 0.8.42 → 0.8.43

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.
@@ -50279,7 +50279,7 @@ function resolveAliasDisplayName(alias) {
50279
50279
  if (!slug) return void 0;
50280
50280
  return CANONICAL_FONT_DISPLAY_NAMES[slug];
50281
50281
  }
50282
- var recast, import_parser2, CANVAS_DIMENSIONS, VALID_CANVAS_RESOLUTIONS, RESOLUTION_ALIASES, ASPECT_AGNOSTIC_RESOLUTION_ALIASES, PROPERTY_GROUPS, PROP_TO_GROUP, COMPOSITION_ATTRIBUTES, CANONICAL_AUTHORED_TIMING_ATTRIBUTES, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, OK, FONT_ALIAS_MAP, FONT_ALIAS_KEYS, CANONICAL_FONT_DISPLAY_NAMES;
50282
+ var recast, import_parser2, CANVAS_DIMENSIONS, VALID_CANVAS_RESOLUTIONS, RESOLUTION_ALIASES, ASPECT_AGNOSTIC_RESOLUTION_ALIASES, PROPERTY_GROUPS, PROP_TO_GROUP, COMPOSITION_ATTRIBUTES, CANONICAL_AUTHORED_TIMING_ATTRIBUTES, DERIVED_TIMING_ATTRIBUTES, LEGACY_TIMING_ATTRIBUTES, OK, HTML_BODY_CSS_WIDTH_FIRST_RE, HTML_BODY_CSS_HEIGHT_FIRST_RE, VIEWPORT_META_SIZE_RE, FONT_ALIAS_MAP, FONT_ALIAS_KEYS, CANONICAL_FONT_DISPLAY_NAMES;
50283
50283
  var init_dist = __esm({
50284
50284
  "../parsers/dist/index.js"() {
50285
50285
  "use strict";
@@ -50355,6 +50355,9 @@ var init_dist = __esm({
50355
50355
  COMPOSITION_ATTRIBUTES.legacyTrack
50356
50356
  ]);
50357
50357
  OK = { ok: true };
50358
+ HTML_BODY_CSS_WIDTH_FIRST_RE = /html\s*,\s*body\s*\{[^}]*?width:\s*(\d+)px[^}]*?height:\s*(\d+)px/i;
50359
+ HTML_BODY_CSS_HEIGHT_FIRST_RE = /html\s*,\s*body\s*\{[^}]*?height:\s*(\d+)px[^}]*?width:\s*(\d+)px/i;
50360
+ VIEWPORT_META_SIZE_RE = /<meta[^>]*name=["']viewport["'][^>]*content=["']width=(\d+),\s*height=(\d+)/i;
50358
50361
  FONT_ALIAS_MAP = {
50359
50362
  // ── Canonical bundled fonts (self-referencing) ────────────────────────
50360
50363
  inter: "inter",
@@ -69424,6 +69427,35 @@ function findVisibleMarkupCommentLeak(source) {
69424
69427
  }
69425
69428
  return null;
69426
69429
  }
69430
+ function readHtmlBodyCssSize(source) {
69431
+ const widthFirst = source.match(HTML_BODY_CSS_WIDTH_FIRST_RE);
69432
+ if (widthFirst) {
69433
+ const [, width = "", height = ""] = widthFirst;
69434
+ return { width, height };
69435
+ }
69436
+ const heightFirst = source.match(HTML_BODY_CSS_HEIGHT_FIRST_RE);
69437
+ if (heightFirst) {
69438
+ const [, height = "", width = ""] = heightFirst;
69439
+ return { width, height };
69440
+ }
69441
+ return null;
69442
+ }
69443
+ function readViewportMetaSize(source) {
69444
+ const match = source.match(VIEWPORT_META_SIZE_RE);
69445
+ if (!match) return null;
69446
+ const [, width = "", height = ""] = match;
69447
+ return { width, height };
69448
+ }
69449
+ function describeSizeMismatch(label, size, dataWidth, dataHeight) {
69450
+ if (!size || size.width === dataWidth && size.height === dataHeight) return null;
69451
+ return `${label} is ${size.width}x${size.height}`;
69452
+ }
69453
+ function findScaffoldSizeMismatches(source, dataWidth, dataHeight) {
69454
+ return [
69455
+ describeSizeMismatch("html/body CSS", readHtmlBodyCssSize(source), dataWidth, dataHeight),
69456
+ describeSizeMismatch("the viewport meta", readViewportMetaSize(source), dataWidth, dataHeight)
69457
+ ].filter((mismatch) => mismatch !== null);
69458
+ }
69427
69459
  function tweensVolumeInSameCall(script, id) {
69428
69460
  const selector = new RegExp(`#${escapeRegExp3(id)}(?![\\w-])`, "g");
69429
69461
  for (let hit = selector.exec(script); hit; hit = selector.exec(script)) {
@@ -70920,6 +70952,7 @@ var init_dist3 = __esm({
70920
70952
  "use strict";
70921
70953
  init_esm6();
70922
70954
  import_postcss_selector_parser = __toESM(require_dist(), 1);
70955
+ init_dist();
70923
70956
  init_colorGradingContract();
70924
70957
  init_dist();
70925
70958
  init_esm10();
@@ -71031,6 +71064,37 @@ var init_dist3 = __esm({
71031
71064
  }
71032
71065
  return findings;
71033
71066
  },
71067
+ // root_dimensions_mismatch
71068
+ //
71069
+ // Render size and the runtime's forced #root size both read the root's own
71070
+ // data-width/data-height, so they stay correct. But editing only those two
71071
+ // attributes — rather than scaffolding with `hyperframes init --resolution`,
71072
+ // which rewrites the scaffold's other copies of the resolution too — leaves
71073
+ // the `html, body` CSS and the `<meta viewport>` at the old value, and a
71074
+ // stale body with `overflow: hidden` visually clips the correctly-sized
71075
+ // root. `hyperframes check`'s layout audits can't see it: they measure
71076
+ // against the root's own (already-correct) rect, not the body's.
71077
+ //
71078
+ // A sub-composition fragment has no html/body or viewport to compare
71079
+ // against, which makes this top-level-only without a separate guard.
71080
+ ({ rootTag, source }) => {
71081
+ if (!rootTag) return [];
71082
+ const dataWidth = readAttr(rootTag.raw, "data-width");
71083
+ const dataHeight = readAttr(rootTag.raw, "data-height");
71084
+ if (!dataWidth || !dataHeight) return [];
71085
+ const mismatches = findScaffoldSizeMismatches(source, dataWidth, dataHeight);
71086
+ if (mismatches.length === 0) return [];
71087
+ return [
71088
+ {
71089
+ code: "root_dimensions_mismatch",
71090
+ severity: "warning",
71091
+ message: `Root composition declares data-width="${dataWidth}" data-height="${dataHeight}", but ${mismatches.join(" and ")}. The scaffolded body clips the composition at its old size.`,
71092
+ elementId: readAttr(rootTag.raw, "id") || void 0,
71093
+ fixHint: "update html/body CSS and the meta viewport to match, or scaffold with `hyperframes init --resolution portrait`",
71094
+ snippet: truncateSnippet(rootTag.raw)
71095
+ }
71096
+ ];
71097
+ },
71034
71098
  // unbalanced_style_tags
71035
71099
  ({ source }) => {
71036
71100
  let opens = 0;
@@ -87124,6 +87188,9 @@ function aggregateDrawElement(perfs, de) {
87124
87188
  preInversionWorkers: de.preInversionWorkers,
87125
87189
  compositionElementCount: de.compositionElementCount,
87126
87190
  compositionElementCountSource: de.compositionElementCountSource,
87191
+ compositionElementTags: de.compositionElementTags,
87192
+ arollVideoCount: de.arollVideoCount,
87193
+ heygenVideoCount: de.heygenVideoCount,
87127
87194
  shortBand: de.shortBand,
87128
87195
  parallelRouter: de.parallelRouter ?? "none",
87129
87196
  preRouterWorkers: de.preRouterWorkers,
@@ -96743,16 +96810,31 @@ function envInt(name, fallback) {
96743
96810
  const parsed = Number(raw);
96744
96811
  return Number.isInteger(parsed) ? parsed : fallback;
96745
96812
  }
96746
- function countElementTags(html) {
96813
+ var MAX_REPORTED_ELEMENT_TAGS = 50;
96814
+ function scanElementTags(html) {
96747
96815
  let markup = html;
96748
96816
  for (let previous = ""; markup !== previous; ) {
96749
96817
  previous = markup;
96750
96818
  markup = markup.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, "");
96751
96819
  }
96752
- const matches2 = markup.match(
96753
- /<\/[a-zA-Z]|<(?:img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b|<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\/>/gi
96820
+ let total = 0;
96821
+ const counts = /* @__PURE__ */ new Map();
96822
+ for (const m of markup.matchAll(
96823
+ /<\/([a-zA-Z][-a-zA-Z0-9]*)|<(img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b|<([a-zA-Z][-a-zA-Z0-9]*)\b[^>]*\/>/gi
96824
+ )) {
96825
+ total++;
96826
+ const tag = (m[1] ?? m[2] ?? m[3] ?? "").toLowerCase();
96827
+ counts.set(tag, (counts.get(tag) ?? 0) + 1);
96828
+ }
96829
+ const ranked = [...counts.entries()].sort((a, b) => b[1] - a[1]);
96830
+ const byTag = Object.fromEntries(
96831
+ ranked.slice(0, MAX_REPORTED_ELEMENT_TAGS)
96754
96832
  );
96755
- return matches2 === null ? 0 : matches2.length;
96833
+ const otherCount = ranked.slice(MAX_REPORTED_ELEMENT_TAGS).reduce((sum, [, count]) => sum + count, 0);
96834
+ if (otherCount > 0) byTag.other = (byTag.other ?? 0) + otherCount;
96835
+ const arollVideoCount = markup.match(/<video\b[^>]*\bdata-aroll=["']true["'][^>]*>/gi)?.length ?? 0;
96836
+ const heygenVideoCount = markup.match(/<video\b[^>]*\bdata-media-source=["']heygen["'][^>]*>/gi)?.length ?? 0;
96837
+ return { total, byTag, arollVideoCount, heygenVideoCount };
96756
96838
  }
96757
96839
  async function resolveCompositionElementCount(probeSession, html) {
96758
96840
  if (probeSession?.isInitialized) {
@@ -96768,7 +96850,14 @@ async function resolveCompositionElementCount(probeSession, html) {
96768
96850
  } catch {
96769
96851
  }
96770
96852
  }
96771
- return { count: countElementTags(html), source: "static" };
96853
+ const scan = scanElementTags(html);
96854
+ return {
96855
+ count: scan.total,
96856
+ source: "static",
96857
+ byTag: scan.byTag,
96858
+ arollVideoCount: scan.arollVideoCount,
96859
+ heygenVideoCount: scan.heygenVideoCount
96860
+ };
96772
96861
  }
96773
96862
  function mergeWorkerInitObservability(perfs) {
96774
96863
  let initDurationMs;
@@ -97426,7 +97515,13 @@ async function executeRenderPipeline(input) {
97426
97515
  const deSingleMinFrames = Number.isFinite(deSingleMinFramesNum) ? deSingleMinFramesNum : 900;
97427
97516
  const deShortBandMinFrames = envInt("HF_DE_SHORT_MIN_FRAMES", 250);
97428
97517
  const deShortBandMaxElements = envInt("HF_DE_SHORT_MAX_ELEMENTS", 2500);
97429
- const { count: compositionElementCount, source: compositionElementCountSource } = await resolveCompositionElementCount(probeSession, compiled.html);
97518
+ const {
97519
+ count: compositionElementCount,
97520
+ source: compositionElementCountSource,
97521
+ byTag: compositionElementTags,
97522
+ arollVideoCount,
97523
+ heygenVideoCount
97524
+ } = await resolveCompositionElementCount(probeSession, compiled.html);
97430
97525
  const deShortBandEnabled = deShortBandMaxElements > 0;
97431
97526
  const deShortBandOpen = deShortBandEnabled && deShortBandMinFrames > 0 && compositionElementCountSource === "live" && compositionElementCount <= deShortBandMaxElements;
97432
97527
  const deShortBandRoute = process.env.HF_DE_SHORT_BAND_ROUTE === "true";
@@ -97620,6 +97715,9 @@ async function executeRenderPipeline(input) {
97620
97715
  // perf shift can be split into "the new band did it" vs "unchanged".
97621
97716
  compositionElementCount,
97622
97717
  compositionElementCountSource,
97718
+ compositionElementTags,
97719
+ arollVideoCount,
97720
+ heygenVideoCount,
97623
97721
  deShortBand,
97624
97722
  // Same rationale as the counters above: carried on live capture
97625
97723
  // observability, not only the success-path perfSummary, so a crash /
@@ -98284,6 +98382,9 @@ async function executeRenderPipeline(input) {
98284
98382
  preInversionWorkers: deWorkerInversion ? preRoutingWorkerCount : void 0,
98285
98383
  compositionElementCount,
98286
98384
  compositionElementCountSource,
98385
+ compositionElementTags,
98386
+ arollVideoCount,
98387
+ heygenVideoCount,
98287
98388
  shortBand: deShortBand,
98288
98389
  parallelRouter: deParallelRouter,
98289
98390
  preRouterWorkers: deParallelRouter ? preRoutingWorkerCount : void 0,
@@ -99706,8 +99807,8 @@ async function runFontLocalize(io, localize) {
99706
99807
  }
99707
99808
 
99708
99809
  // src/version.ts
99709
- var VERSION = true ? "0.8.42" : "0.0.0-dev";
99710
- var PRODUCER_VERSION = true ? "0.8.42" : "0.0.0-dev";
99810
+ var VERSION = true ? "0.8.43" : "0.0.0-dev";
99811
+ var PRODUCER_VERSION = true ? "0.8.43" : "0.0.0-dev";
99711
99812
 
99712
99813
  // src/fontLocalizeCli.ts
99713
99814
  async function readStdin() {