@hyperframes/lint 0.8.13 → 0.8.14

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/browser.js CHANGED
@@ -528,7 +528,7 @@ var coreRules = [
528
528
  }
529
529
  ];
530
530
  },
531
- // missing_timeline_registry + timeline_registry_missing_init
531
+ // missing_timeline_registry
532
532
  // fallow-ignore-next-line complexity
533
533
  ({ source, rawSource, rootTag, options }) => {
534
534
  if (options.isSubComposition || rawSource.trimStart().toLowerCase().startsWith("<template")) {
@@ -544,14 +544,6 @@ var coreRules = [
544
544
  fixHint: "Register each composition timeline on `window.__timelines[compositionId]`."
545
545
  });
546
546
  }
547
- if (TIMELINE_REGISTRY_ASSIGN_PATTERN.test(source) && !TIMELINE_REGISTRY_INIT_PATTERN.test(source)) {
548
- findings.push({
549
- code: "timeline_registry_missing_init",
550
- severity: "error",
551
- message: "`window.__timelines[\u2026] = \u2026` is used without initializing `window.__timelines` first.",
552
- fixHint: "Add `window.__timelines = window.__timelines || {};` before any timeline assignment."
553
- });
554
- }
555
547
  return findings;
556
548
  },
557
549
  // timeline_id_mismatch
@@ -1105,9 +1097,9 @@ var mediaRules = [
1105
1097
  findings.push({
1106
1098
  code: "video_nested_in_timed_element",
1107
1099
  severity: "error",
1108
- message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The framework cannot manage playback of nested media \u2014 video will be FROZEN in renders.`,
1100
+ message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The frame extractor resolves the video's start from its own data-start without the wrapper's offset, while visibility uses the wrapper's window, so the two disagree: the clip shows the wrong source frames and then disappears partway through its slot.`,
1109
1101
  elementId: readAttr(tag.raw, "id") || void 0,
1110
- fixHint: "Move the <video> to be a direct child of the stage, or remove data-start from the wrapper div (use it as a non-timed visual container).",
1102
+ fixHint: "Time the wrapper OR the video, never both: remove data-start from the wrapper (use it as a non-timed visual container), or move the <video> up to be a direct child of the stage.",
1111
1103
  snippet: truncateSnippet(tag.raw)
1112
1104
  });
1113
1105
  break;
@@ -3635,7 +3627,7 @@ var compositionRules = [
3635
3627
  severity: "error",
3636
3628
  message: `<${tag.name}${elementId ? ` id="${elementId}"` : ""}> uses data-layer instead of data-track-index.`,
3637
3629
  elementId,
3638
- fixHint: "Replace data-layer with data-track-index. The runtime reads data-track-index.",
3630
+ fixHint: "Replace data-layer with data-track-index, which is the canonical name Studio and the linter read. Neither name is read by the render.",
3639
3631
  snippet: truncateSnippet(tag.raw)
3640
3632
  });
3641
3633
  }
@@ -4033,10 +4025,13 @@ var compositionRules = [
4033
4025
  // can't leak styles into each other. A rule whose LEFTMOST selector is the ROOT
4034
4026
  // element's own class (e.g. `.frame { ... }` on the same element that carries
4035
4027
  // data-composition-id) therefore becomes a DESCENDANT selector that can never
4036
- // match the root the whole scene renders unstyled (tiny text top-left, images
4037
- // at natural size). lint/validate/inspect evaluate the file in isolation (no
4038
- // scoping) and Studio previews each scene in its own iframe (no scoping), so the
4039
- // break is invisible until the composited MP4 render. Style the root via `#root`
4028
+ // match the SCOPED element itself. NOTE on the symptom: since #1886 the producer
4029
+ // preserves the authored root as a `data-hf-inner-root` wrapper INSIDE the scoped
4030
+ // element (regression fixture packages/producer/tests/sub-comp-class-selector),
4031
+ // so the class still matches as a descendant and the scene no longer renders
4032
+ // unstyled. This rule is now a consistency constraint, not a render-bug guard:
4033
+ // `#root` is the shape the registry blocks model and the one the scoper
4034
+ // special-cases. Style the root via `#root`
4040
4035
  // (the scoper special-cases the root id) and descendants via plain selectors,
4041
4036
  // like the registry blocks — the runtime already scopes each scene by id, so a
4042
4037
  // class namespace on the root is redundant.
@@ -4053,9 +4048,9 @@ var compositionRules = [
4053
4048
  {
4054
4049
  code: "subcomposition_root_styled_by_class",
4055
4050
  severity: "error",
4056
- message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the root \u2014 the scene renders unstyled (tiny text top-left, full-size images). lint/validate/inspect and Studio's per-frame iframe preview do not scope, so this passes every static check and looks correct in preview.`,
4051
+ message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the scoped element itself. Since #1886 the producer preserves the authored root as an inner wrapper, so this no longer renders the scene unstyled, but #root is the shape the scoper special-cases and the registry blocks model. Use it so preview, render, and Studio agree.`,
4057
4052
  selector: example,
4058
- fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant and breaks under scoping.`,
4053
+ fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant.`,
4059
4054
  snippet: truncateSnippet(rootTag.raw)
4060
4055
  }
4061
4056
  ];