@hyperframes/producer 0.2.4 → 0.2.5

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.
@@ -102877,8 +102877,30 @@ ${right2.raw}`)
102877
102877
  findings.push({
102878
102878
  code: "gsap_infinite_repeat",
102879
102879
  severity: "error",
102880
- message: "GSAP tween uses `repeat: -1` (infinite). Infinite repeats break the deterministic capture engine which seeks to exact frame times. Use a finite repeat count calculated from the composition duration: `repeat: Math.ceil(duration / cycleDuration) - 1`.",
102881
- fixHint: "Replace `repeat: -1` with a finite count, e.g. `repeat: Math.ceil(totalDuration / singleCycleDuration) - 1`.",
102880
+ message: "GSAP tween uses `repeat: -1` (infinite). Infinite repeats break the deterministic capture engine which seeks to exact frame times. Use a finite repeat count calculated from the composition duration: `repeat: Math.floor(duration / cycleDuration) - 1`.",
102881
+ fixHint: "Replace `repeat: -1` with a finite count, e.g. `repeat: Math.floor(totalDuration / singleCycleDuration) - 1`. Use Math.floor (not Math.ceil) to ensure the animation fits within the total duration.",
102882
+ snippet: truncateSnippet(snippet)
102883
+ });
102884
+ }
102885
+ }
102886
+ return findings;
102887
+ },
102888
+ // gsap_repeat_ceil_overshoot
102889
+ ({ scripts }) => {
102890
+ const findings = [];
102891
+ for (const script of scripts) {
102892
+ const content = script.content;
102893
+ const pattern = /repeat\s*:\s*Math\.ceil\s*\([^)]+\)\s*-\s*1/g;
102894
+ let match2;
102895
+ while ((match2 = pattern.exec(content)) !== null) {
102896
+ const contextStart = Math.max(0, match2.index - 40);
102897
+ const contextEnd = Math.min(content.length, match2.index + match2[0].length + 40);
102898
+ const snippet = content.slice(contextStart, contextEnd).trim();
102899
+ findings.push({
102900
+ code: "gsap_repeat_ceil_overshoot",
102901
+ severity: "warning",
102902
+ message: "GSAP repeat calculation uses `Math.ceil` which can overshoot the composition duration. For example, Math.ceil(10.5 / 2) - 1 = 5 repeats \u2192 6 cycles \xD7 2s = 12s, exceeding 10.5s.",
102903
+ fixHint: "Use `Math.floor` instead of `Math.ceil` to ensure the animation fits within the duration: `repeat: Math.floor(totalDuration / cycleDuration) - 1`. Math.floor(10.5 / 2) - 1 = 4 repeats \u2192 5 cycles \xD7 2s = 10s \u2713",
102882
102904
  snippet: truncateSnippet(snippet)
102883
102905
  });
102884
102906
  }
@@ -103278,6 +103300,24 @@ var compositionRules = [
103278
103300
  }
103279
103301
  return findings;
103280
103302
  },
103303
+ // root_composition_missing_data_duration
103304
+ ({ rootTag }) => {
103305
+ const findings = [];
103306
+ if (!rootTag) return findings;
103307
+ const compId = readAttr(rootTag.raw, "data-composition-id");
103308
+ if (!compId) return findings;
103309
+ const hasDuration = readAttr(rootTag.raw, "data-duration") !== null;
103310
+ if (!hasDuration) {
103311
+ findings.push({
103312
+ code: "root_composition_missing_data_duration",
103313
+ severity: "warning",
103314
+ message: `Root composition "${compId}" is missing data-duration. Without an explicit duration, the runtime may infer Infinity for compositions with repeating animations, causing playback issues.`,
103315
+ fixHint: 'Add data-duration="X" to the root composition element, where X is the total duration in seconds.',
103316
+ snippet: truncateSnippet(rootTag.raw)
103317
+ });
103318
+ }
103319
+ return findings;
103320
+ },
103281
103321
  // standalone_composition_wrapped_in_template
103282
103322
  ({ rawSource, options }) => {
103283
103323
  const findings = [];
@@ -103294,18 +103334,20 @@ var compositionRules = [
103294
103334
  return findings;
103295
103335
  },
103296
103336
  // root_composition_missing_html_wrapper
103297
- ({ rawSource, options }) => {
103337
+ ({ rawSource, rootTag, options }) => {
103298
103338
  const findings = [];
103299
103339
  if (options.isSubComposition) return findings;
103300
103340
  const trimmed = rawSource.trimStart().toLowerCase();
103341
+ if (trimmed.startsWith("<template")) return findings;
103301
103342
  const hasDoctype = trimmed.startsWith("<!doctype") || trimmed.startsWith("<html");
103302
103343
  const hasComposition = rawSource.includes("data-composition-id");
103303
103344
  if (hasComposition && !hasDoctype) {
103304
103345
  findings.push({
103305
103346
  code: "root_composition_missing_html_wrapper",
103306
- severity: "warning",
103307
- message: "Composition is missing <!DOCTYPE html> and <html> wrapper. The bundler and preview expect a complete HTML document for index.html files.",
103308
- fixHint: 'Wrap the composition in <!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>...</body></html>.'
103347
+ severity: "error",
103348
+ message: "Composition starts with a bare element instead of a proper HTML document. An index.html that contains data-composition-id but no <!DOCTYPE html>, <html>, or <body> is a fragment \u2014 browsers quirks-mode it, the preview server cannot load it, and the bundler will fail to inject runtime scripts.",
103349
+ fixHint: 'Wrap the composition in <!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>...</body></html>.',
103350
+ snippet: rootTag ? truncateSnippet(rootTag.raw) : void 0
103309
103351
  });
103310
103352
  }
103311
103353
  return findings;
@@ -103491,12 +103533,12 @@ function quantizeTimeToFrame(timeSeconds, fps) {
103491
103533
  return frameIndex / safeFps;
103492
103534
  }
103493
103535
 
103494
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/analysis.js
103536
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/analysis.js
103495
103537
  var arabicScriptRe = new RegExp("\\p{Script=Arabic}", "u");
103496
103538
  var combiningMarkRe = new RegExp("\\p{M}", "u");
103497
103539
  var decimalDigitRe = new RegExp("\\p{Nd}", "u");
103498
103540
 
103499
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/measurement.js
103541
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/measurement.js
103500
103542
  var emojiPresentationRe = new RegExp("\\p{Emoji_Presentation}", "u");
103501
103543
 
103502
103544
  // ../engine/src/services/screenshotService.ts