@hyperframes/producer 0.1.7 → 0.1.8

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/index.js CHANGED
@@ -99245,6 +99245,37 @@ function lintHyperframeHtml(html, options = {}) {
99245
99245
  fixHint: "Register each composition timeline on `window.__timelines[compositionId]`."
99246
99246
  });
99247
99247
  }
99248
+ if (TIMELINE_REGISTRY_ASSIGN_PATTERN.test(source2) && !TIMELINE_REGISTRY_INIT_PATTERN.test(source2)) {
99249
+ pushFinding({
99250
+ code: "timeline_registry_missing_init",
99251
+ severity: "error",
99252
+ message: "`window.__timelines[\u2026] = \u2026` is used without initializing `window.__timelines` first.",
99253
+ fixHint: "Add `window.__timelines = window.__timelines || {};` before any timeline assignment."
99254
+ });
99255
+ }
99256
+ {
99257
+ const htmlCompIds = /* @__PURE__ */ new Set();
99258
+ const timelineRegKeys = /* @__PURE__ */ new Set();
99259
+ const compIdRe = /data-composition-id\s*=\s*["']([^"']+)["']/gi;
99260
+ const tlKeyRe = /window\.__timelines\[\s*["']([^"']+)["']\s*\]/g;
99261
+ let m;
99262
+ while ((m = compIdRe.exec(source2)) !== null) {
99263
+ if (m[1]) htmlCompIds.add(m[1]);
99264
+ }
99265
+ while ((m = tlKeyRe.exec(source2)) !== null) {
99266
+ if (m[1]) timelineRegKeys.add(m[1]);
99267
+ }
99268
+ for (const key2 of timelineRegKeys) {
99269
+ if (!htmlCompIds.has(key2)) {
99270
+ pushFinding({
99271
+ code: "timeline_id_mismatch",
99272
+ severity: "error",
99273
+ message: `Timeline registered as "${key2}" but no element has data-composition-id="${key2}". The runtime cannot auto-nest this timeline.`,
99274
+ fixHint: `Change window.__timelines["${key2}"] to match the data-composition-id attribute, or vice versa.`
99275
+ });
99276
+ }
99277
+ }
99278
+ }
99248
99279
  if (INVALID_SCRIPT_CLOSE_PATTERN.test(source2)) {
99249
99280
  pushFinding({
99250
99281
  code: "invalid_inline_script_syntax",