hyperframes 0.2.4 → 0.3.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/dist/cli.js CHANGED
@@ -54,7 +54,7 @@ var VERSION;
54
54
  var init_version = __esm({
55
55
  "src/version.ts"() {
56
56
  "use strict";
57
- VERSION = true ? "0.2.4" : "0.0.0-dev";
57
+ VERSION = true ? "0.3.0" : "0.0.0-dev";
58
58
  }
59
59
  });
60
60
 
@@ -4577,8 +4577,30 @@ ${right.raw}`)
4577
4577
  findings.push({
4578
4578
  code: "gsap_infinite_repeat",
4579
4579
  severity: "error",
4580
- 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`.",
4581
- fixHint: "Replace `repeat: -1` with a finite count, e.g. `repeat: Math.ceil(totalDuration / singleCycleDuration) - 1`.",
4580
+ 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`.",
4581
+ 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.",
4582
+ snippet: truncateSnippet(snippet)
4583
+ });
4584
+ }
4585
+ }
4586
+ return findings;
4587
+ },
4588
+ // gsap_repeat_ceil_overshoot
4589
+ ({ scripts }) => {
4590
+ const findings = [];
4591
+ for (const script of scripts) {
4592
+ const content = script.content;
4593
+ const pattern = /repeat\s*:\s*Math\.ceil\s*\([^)]+\)\s*-\s*1/g;
4594
+ let match;
4595
+ while ((match = pattern.exec(content)) !== null) {
4596
+ const contextStart = Math.max(0, match.index - 40);
4597
+ const contextEnd = Math.min(content.length, match.index + match[0].length + 40);
4598
+ const snippet = content.slice(contextStart, contextEnd).trim();
4599
+ findings.push({
4600
+ code: "gsap_repeat_ceil_overshoot",
4601
+ severity: "warning",
4602
+ 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.",
4603
+ 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",
4582
4604
  snippet: truncateSnippet(snippet)
4583
4605
  });
4584
4606
  }
@@ -4991,6 +5013,24 @@ var init_composition = __esm({
4991
5013
  }
4992
5014
  return findings;
4993
5015
  },
5016
+ // root_composition_missing_data_duration
5017
+ ({ rootTag }) => {
5018
+ const findings = [];
5019
+ if (!rootTag) return findings;
5020
+ const compId = readAttr(rootTag.raw, "data-composition-id");
5021
+ if (!compId) return findings;
5022
+ const hasDuration = readAttr(rootTag.raw, "data-duration") !== null;
5023
+ if (!hasDuration) {
5024
+ findings.push({
5025
+ code: "root_composition_missing_data_duration",
5026
+ severity: "warning",
5027
+ 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.`,
5028
+ fixHint: 'Add data-duration="X" to the root composition element, where X is the total duration in seconds.',
5029
+ snippet: truncateSnippet(rootTag.raw)
5030
+ });
5031
+ }
5032
+ return findings;
5033
+ },
4994
5034
  // standalone_composition_wrapped_in_template
4995
5035
  ({ rawSource, options }) => {
4996
5036
  const findings = [];
@@ -5007,18 +5047,20 @@ var init_composition = __esm({
5007
5047
  return findings;
5008
5048
  },
5009
5049
  // root_composition_missing_html_wrapper
5010
- ({ rawSource, options }) => {
5050
+ ({ rawSource, rootTag, options }) => {
5011
5051
  const findings = [];
5012
5052
  if (options.isSubComposition) return findings;
5013
5053
  const trimmed = rawSource.trimStart().toLowerCase();
5054
+ if (trimmed.startsWith("<template")) return findings;
5014
5055
  const hasDoctype = trimmed.startsWith("<!doctype") || trimmed.startsWith("<html");
5015
5056
  const hasComposition = rawSource.includes("data-composition-id");
5016
5057
  if (hasComposition && !hasDoctype) {
5017
5058
  findings.push({
5018
5059
  code: "root_composition_missing_html_wrapper",
5019
- severity: "warning",
5020
- message: "Composition is missing <!DOCTYPE html> and <html> wrapper. The bundler and preview expect a complete HTML document for index.html files.",
5021
- fixHint: 'Wrap the composition in <!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>...</body></html>.'
5060
+ severity: "error",
5061
+ 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.",
5062
+ fixHint: 'Wrap the composition in <!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>...</body></html>.',
5063
+ snippet: rootTag ? truncateSnippet(rootTag.raw) : void 0
5022
5064
  });
5023
5065
  }
5024
5066
  return findings;
@@ -20180,17 +20222,25 @@ var init_gsap2 = __esm({
20180
20222
  }
20181
20223
  });
20182
20224
 
20183
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/bidi.js
20225
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/generated/bidi-data.js
20226
+ var init_bidi_data = __esm({
20227
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/generated/bidi-data.js"() {
20228
+ "use strict";
20229
+ }
20230
+ });
20231
+
20232
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/bidi.js
20184
20233
  var init_bidi = __esm({
20185
- "../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/bidi.js"() {
20234
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/bidi.js"() {
20186
20235
  "use strict";
20236
+ init_bidi_data();
20187
20237
  }
20188
20238
  });
20189
20239
 
20190
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/analysis.js
20240
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/analysis.js
20191
20241
  var arabicScriptRe, combiningMarkRe, decimalDigitRe;
20192
20242
  var init_analysis = __esm({
20193
- "../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/analysis.js"() {
20243
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/analysis.js"() {
20194
20244
  "use strict";
20195
20245
  arabicScriptRe = new RegExp("\\p{Script=Arabic}", "u");
20196
20246
  combiningMarkRe = new RegExp("\\p{M}", "u");
@@ -20198,27 +20248,27 @@ var init_analysis = __esm({
20198
20248
  }
20199
20249
  });
20200
20250
 
20201
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/measurement.js
20251
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/measurement.js
20202
20252
  var emojiPresentationRe;
20203
20253
  var init_measurement = __esm({
20204
- "../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/measurement.js"() {
20254
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/measurement.js"() {
20205
20255
  "use strict";
20206
20256
  init_analysis();
20207
20257
  emojiPresentationRe = new RegExp("\\p{Emoji_Presentation}", "u");
20208
20258
  }
20209
20259
  });
20210
20260
 
20211
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/line-break.js
20261
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/line-break.js
20212
20262
  var init_line_break = __esm({
20213
- "../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/line-break.js"() {
20263
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/line-break.js"() {
20214
20264
  "use strict";
20215
20265
  init_measurement();
20216
20266
  }
20217
20267
  });
20218
20268
 
20219
- // ../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/layout.js
20269
+ // ../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/layout.js
20220
20270
  var init_layout = __esm({
20221
- "../../node_modules/.bun/@chenglou+pretext@0.0.3/node_modules/@chenglou/pretext/dist/layout.js"() {
20271
+ "../../node_modules/.bun/@chenglou+pretext@0.0.5/node_modules/@chenglou/pretext/dist/layout.js"() {
20222
20272
  "use strict";
20223
20273
  init_bidi();
20224
20274
  init_analysis();
@@ -30671,7 +30721,8 @@ var init_help = __esm({
30671
30721
  [
30672
30722
  "transcribe",
30673
30723
  "Transcribe audio/video to word-level timestamps, or import an existing transcript"
30674
- ]
30724
+ ],
30725
+ ["tts", "Generate speech audio from text using a local AI model (Kokoro-82M)"]
30675
30726
  ]
30676
30727
  },
30677
30728
  {