@hyperframes/lint 0.8.81 → 0.8.83

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
@@ -5819,6 +5819,9 @@ import {
5819
5819
  topLevelElements,
5820
5820
  trackKindOf
5821
5821
  } from "@hyperframes/parsers/top-level-elements";
5822
+ import { readClipTiming as readClipTiming2 } from "@hyperframes/parsers/composition-contract";
5823
+ import { readDataDurationSeconds } from "@hyperframes/parsers/media-duration";
5824
+ import { TIMING_TOLERANCE_SECONDS } from "@hyperframes/parsers/composition-duration";
5822
5825
  var INLINE_TEXT_TAGS = /* @__PURE__ */ new Set([
5823
5826
  "br",
5824
5827
  "wbr",
@@ -5947,6 +5950,27 @@ function captionFindings(rows, severity) {
5947
5950
  }
5948
5951
  return findings;
5949
5952
  }
5953
+ var hundredths = (seconds) => Math.round(seconds * 100) / 100;
5954
+ function clipsPastRootFindings(root, rows) {
5955
+ if (root.attrs["data-composition-id"] === void 0) return [];
5956
+ const rootDuration = readDataDurationSeconds((name) => root.attrs[name]);
5957
+ if (rootDuration === null) return [];
5958
+ const limit = hundredths(rootDuration);
5959
+ return rows.flatMap((row) => {
5960
+ const { start, end } = readClipTiming2({ getAttribute: (name) => row.attrs[name] ?? null });
5961
+ if (start === null || end === null || end <= rootDuration + TIMING_TOLERANCE_SECONDS) return [];
5962
+ return [
5963
+ {
5964
+ code: "clip_ends_past_root_duration",
5965
+ severity: "warning",
5966
+ message: `${describe(row)} runs from ${hundredths(start)}s to ${hundredths(end)}s, past the root composition's data-duration of ${limit}s, so it is cut off in previews, posters and renders.`,
5967
+ elementId: row.attrs.id,
5968
+ fixHint: `Extend the root data-duration to ${hundredths(end)}, or make ${describe(row)} end at or before ${limit}s.`,
5969
+ snippet: truncateSnippet(row.open.raw)
5970
+ }
5971
+ ];
5972
+ });
5973
+ }
5950
5974
  var structureRules = [
5951
5975
  (ctx) => {
5952
5976
  if (ctx.options.isSubComposition) return [];
@@ -5957,7 +5981,8 @@ var structureRules = [
5957
5981
  return [
5958
5982
  ...nestedStructureFindings(rows, severity),
5959
5983
  ...missingDurationFindings(rows, severity),
5960
- ...captionFindings(rows, severity)
5984
+ ...captionFindings(rows, severity),
5985
+ ...clipsPastRootFindings(root, rows)
5961
5986
  ];
5962
5987
  }
5963
5988
  ];