hyperframes 0.8.66 → 0.8.67
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 +491 -374
- package/dist/fontLocalizeCli.js +129 -70
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/renderSetupWorker.js +101 -43
- package/dist/studio/assets/{hyperframes-player-BRlwG-p9.js → hyperframes-player-BF2Y9Rtn.js} +1 -1
- package/dist/studio/assets/index-BBOktYKC.css +1 -0
- package/dist/studio/assets/{index-DJl2JKQj.js → index-BXCEB5uw.js} +1 -1
- package/dist/studio/assets/{index-BzGcmMBS.js → index-CGQ66fle.js} +200 -200
- package/dist/studio/assets/{index-D6Jy-2Zs.js → index-Nnd43iYY.js} +1 -1
- package/dist/studio/index.css +147 -16
- package/dist/studio/index.css.map +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +4436 -4193
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/styles.css +1 -1
- package/package.json +1 -1
- package/dist/studio/assets/index-BnsYeuxA.css +0 -1
|
@@ -55792,13 +55792,13 @@ function resolveAliasDisplayName(alias) {
|
|
|
55792
55792
|
return CANONICAL_FONT_DISPLAY_NAMES[slug];
|
|
55793
55793
|
}
|
|
55794
55794
|
function isSafeMediaUrl(url) {
|
|
55795
|
-
const
|
|
55796
|
-
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
55795
|
+
const normalized2 = url.replace(/[\u0000-\u0020]/g, "");
|
|
55796
|
+
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(normalized2);
|
|
55797
55797
|
if (!scheme) return true;
|
|
55798
55798
|
const proto = scheme[1]?.toLowerCase();
|
|
55799
55799
|
if (!proto) return false;
|
|
55800
55800
|
if (proto === "https" || proto === "http" || proto === "blob") return true;
|
|
55801
|
-
if (proto === "data") return /^data:image\//i.test(
|
|
55801
|
+
if (proto === "data") return /^data:image\//i.test(normalized2);
|
|
55802
55802
|
return false;
|
|
55803
55803
|
}
|
|
55804
55804
|
var COMPOSITION_ATTRIBUTES2 = Object.freeze({
|
|
@@ -55881,14 +55881,14 @@ function parseReferenceOffset(value) {
|
|
|
55881
55881
|
return { refId, operator, magnitude };
|
|
55882
55882
|
}
|
|
55883
55883
|
function parseStartExpression(raw) {
|
|
55884
|
-
const
|
|
55885
|
-
if (!
|
|
55886
|
-
const absolute = parseNumeric(
|
|
55884
|
+
const normalized2 = (raw ?? "").trim();
|
|
55885
|
+
if (!normalized2) return null;
|
|
55886
|
+
const absolute = parseNumeric(normalized2);
|
|
55887
55887
|
if (absolute != null) return { kind: "absolute", value: absolute };
|
|
55888
|
-
if (REFERENCE_ID_PATTERN.test(
|
|
55889
|
-
return { kind: "reference", refId:
|
|
55888
|
+
if (REFERENCE_ID_PATTERN.test(normalized2)) {
|
|
55889
|
+
return { kind: "reference", refId: normalized2, offset: 0 };
|
|
55890
55890
|
}
|
|
55891
|
-
const reference = parseReferenceOffset(
|
|
55891
|
+
const reference = parseReferenceOffset(normalized2);
|
|
55892
55892
|
if (!reference) return null;
|
|
55893
55893
|
return {
|
|
55894
55894
|
kind: "reference",
|
|
@@ -56241,10 +56241,10 @@ function resolveSlideshow(manifest, scenes) {
|
|
|
56241
56241
|
return { resolved: { slides, sequences }, errors };
|
|
56242
56242
|
}
|
|
56243
56243
|
function isSceneLikeCompositionId(compositionId) {
|
|
56244
|
-
const
|
|
56245
|
-
if (!
|
|
56246
|
-
if (
|
|
56247
|
-
if (
|
|
56244
|
+
const normalized2 = compositionId.trim().toLowerCase();
|
|
56245
|
+
if (!normalized2 || normalized2 === "main") return false;
|
|
56246
|
+
if (normalized2.includes("caption")) return false;
|
|
56247
|
+
if (normalized2.includes("ambient")) return false;
|
|
56248
56248
|
return true;
|
|
56249
56249
|
}
|
|
56250
56250
|
|
|
@@ -56313,8 +56313,8 @@ function rewriteAssetPath(compSrcPath, relativePath, assetExists) {
|
|
|
56313
56313
|
return assetExists(sibling2) ? sibling2 + suffix : relativePath;
|
|
56314
56314
|
}
|
|
56315
56315
|
const resolved = join2(compDir, relativePath);
|
|
56316
|
-
const
|
|
56317
|
-
return
|
|
56316
|
+
const normalized2 = resolve2("/", resolved).slice(1);
|
|
56317
|
+
return normalized2;
|
|
56318
56318
|
}
|
|
56319
56319
|
|
|
56320
56320
|
// ../parsers/dist/subCompositionValidity.js
|
|
@@ -56434,8 +56434,8 @@ function resolveLocalAssetCandidates(projectDir, url) {
|
|
|
56434
56434
|
addCandidate(candidates, resolved);
|
|
56435
56435
|
continue;
|
|
56436
56436
|
}
|
|
56437
|
-
const
|
|
56438
|
-
const clamped =
|
|
56437
|
+
const normalized2 = posix2.normalize(projectRelative.replace(/\\/g, "/"));
|
|
56438
|
+
const clamped = normalized2.replace(/^(\.\.\/)+/, "");
|
|
56439
56439
|
if (clamped && !clamped.startsWith("..")) {
|
|
56440
56440
|
addCandidate(candidates, resolve(projectRoot, clamped));
|
|
56441
56441
|
}
|
|
@@ -56513,8 +56513,8 @@ function candidateFileName(candidate) {
|
|
|
56513
56513
|
return candidate.split(/[\\/]/).at(-1)?.toLowerCase() ?? candidate.toLowerCase();
|
|
56514
56514
|
}
|
|
56515
56515
|
function chooseBestPathCandidate(name, candidates) {
|
|
56516
|
-
const
|
|
56517
|
-
return
|
|
56516
|
+
const normalized2 = candidates.map((candidate) => candidate.trim()).filter(Boolean);
|
|
56517
|
+
return normalized2.find((candidate) => candidateFileName(candidate) === `${name}.exe`) ?? normalized2.find((candidate) => candidateFileName(candidate) === name) ?? normalized2.find((candidate) => !candidateFileName(candidate).match(/\.(cmd|bat)$/i)) ?? normalized2[0];
|
|
56518
56518
|
}
|
|
56519
56519
|
function isExecutablePathCandidate(candidate) {
|
|
56520
56520
|
if (process.platform === "win32") return existsSync3(candidate);
|
|
@@ -57152,14 +57152,64 @@ function hasCaptionStyles(styles) {
|
|
|
57152
57152
|
return styles.some((s) => /\.caption[-_]?(?:group|word)/i.test(s.content));
|
|
57153
57153
|
}
|
|
57154
57154
|
function truncateSnippet(value, maxLength = 220) {
|
|
57155
|
-
const
|
|
57156
|
-
if (!
|
|
57157
|
-
if (
|
|
57158
|
-
return `${
|
|
57155
|
+
const normalized2 = value.replace(/\s+/g, " ").trim();
|
|
57156
|
+
if (!normalized2) return void 0;
|
|
57157
|
+
if (normalized2.length <= maxLength) return normalized2;
|
|
57158
|
+
return `${normalized2.slice(0, maxLength - 3)}...`;
|
|
57159
57159
|
}
|
|
57160
57160
|
function mediaSrcTagRe(tagAlternation) {
|
|
57161
57161
|
return new RegExp(`<(${tagAlternation})\\b[^>]*\\ssrc\\s*=\\s*["']([^"']+)["'][^>]*>`, "gi");
|
|
57162
57162
|
}
|
|
57163
|
+
function normalized(source) {
|
|
57164
|
+
let text = "";
|
|
57165
|
+
const offsets = [];
|
|
57166
|
+
for (let i = 0; i < source.length; i++) {
|
|
57167
|
+
const char = source[i];
|
|
57168
|
+
if (/\s/.test(char)) {
|
|
57169
|
+
if (text.endsWith(" ")) continue;
|
|
57170
|
+
text += " ";
|
|
57171
|
+
} else text += char;
|
|
57172
|
+
offsets.push(i);
|
|
57173
|
+
}
|
|
57174
|
+
return { text, offsets };
|
|
57175
|
+
}
|
|
57176
|
+
function createSourceLocator(source) {
|
|
57177
|
+
const tags = parseHtmlStructure(source).tags;
|
|
57178
|
+
const searchable = source.split("");
|
|
57179
|
+
const parser = new Parser({
|
|
57180
|
+
oncomment() {
|
|
57181
|
+
searchable.fill("\0", parser.startIndex, parser.endIndex + 1);
|
|
57182
|
+
}
|
|
57183
|
+
});
|
|
57184
|
+
parser.write(source);
|
|
57185
|
+
parser.end();
|
|
57186
|
+
const normalizedSource = normalized(searchable.join(""));
|
|
57187
|
+
const at2 = (offset2) => {
|
|
57188
|
+
const before2 = source.slice(0, offset2);
|
|
57189
|
+
return {
|
|
57190
|
+
line: before2.split(/\r\n|\r|\n/).length,
|
|
57191
|
+
column: offset2 - Math.max(before2.lastIndexOf("\n"), before2.lastIndexOf("\r"))
|
|
57192
|
+
};
|
|
57193
|
+
};
|
|
57194
|
+
return (finding) => {
|
|
57195
|
+
if (finding.line !== void 0) return { line: finding.line, column: finding.column };
|
|
57196
|
+
if (finding.snippet) {
|
|
57197
|
+
const offset2 = snippetOffset(normalizedSource, finding.snippet);
|
|
57198
|
+
return offset2 === void 0 ? {} : at2(offset2);
|
|
57199
|
+
}
|
|
57200
|
+
const id = finding.elementId ?? /^#([\w-]+)$/.exec(finding.selector ?? "")?.[1];
|
|
57201
|
+
if (!id) return {};
|
|
57202
|
+
const matches2 = tags.filter((tag) => readDecodedAttr(tag.raw, "id") === id);
|
|
57203
|
+
return matches2.length === 1 ? at2(matches2[0].index) : {};
|
|
57204
|
+
};
|
|
57205
|
+
}
|
|
57206
|
+
function snippetOffset(source, snippet) {
|
|
57207
|
+
const needle = snippet.replace(/\s+/g, " ").trim().replace(/\.\.\.$/, "");
|
|
57208
|
+
if (!needle) return void 0;
|
|
57209
|
+
const index = source.text.indexOf(needle);
|
|
57210
|
+
if (index < 0 || source.text.indexOf(needle, index + 1) >= 0) return void 0;
|
|
57211
|
+
return source.offsets[index];
|
|
57212
|
+
}
|
|
57163
57213
|
function buildLintContext(html, options = {}) {
|
|
57164
57214
|
const rawSource = html || "";
|
|
57165
57215
|
let source = stripHtmlComments(rawSource);
|
|
@@ -57945,18 +57995,18 @@ function classNamesFromAttr(classAttr) {
|
|
|
57945
57995
|
return classAttr.split(/\s+/).filter(Boolean);
|
|
57946
57996
|
}
|
|
57947
57997
|
function selectorTargetsManagedMedia(selector, mediaIndex) {
|
|
57948
|
-
const
|
|
57949
|
-
if (!
|
|
57950
|
-
if (mediaIndex.hasVideo && /\bvideo\b/i.test(
|
|
57951
|
-
if (mediaIndex.hasAudio && /\baudio\b/i.test(
|
|
57998
|
+
const normalized2 = selector.trim();
|
|
57999
|
+
if (!normalized2) return false;
|
|
58000
|
+
if (mediaIndex.hasVideo && /\bvideo\b/i.test(normalized2)) return true;
|
|
58001
|
+
if (mediaIndex.hasAudio && /\baudio\b/i.test(normalized2)) return true;
|
|
57952
58002
|
for (const mediaId of mediaIndex.ids) {
|
|
57953
58003
|
const escapedId = escapeRegExp2(mediaId);
|
|
57954
|
-
if (new RegExp(`#${escapedId}(?![\\w-])`).test(
|
|
58004
|
+
if (new RegExp(`#${escapedId}(?![\\w-])`).test(normalized2) || normalized2.includes(`[id="${mediaId}"]`) || normalized2.includes(`[id='${mediaId}']`)) {
|
|
57955
58005
|
return true;
|
|
57956
58006
|
}
|
|
57957
58007
|
}
|
|
57958
58008
|
for (const className of mediaIndex.classes) {
|
|
57959
|
-
if (new RegExp(`\\.${escapeRegExp2(className)}(?![\\w-])`).test(
|
|
58009
|
+
if (new RegExp(`\\.${escapeRegExp2(className)}(?![\\w-])`).test(normalized2)) {
|
|
57960
58010
|
return true;
|
|
57961
58011
|
}
|
|
57962
58012
|
}
|
|
@@ -58686,8 +58736,8 @@ function readTagTiming(rawTag) {
|
|
|
58686
58736
|
}
|
|
58687
58737
|
function countPhysicalLines(source) {
|
|
58688
58738
|
if (source.length === 0) return 0;
|
|
58689
|
-
const
|
|
58690
|
-
const withoutFinalNewline =
|
|
58739
|
+
const normalized2 = source.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
58740
|
+
const withoutFinalNewline = normalized2.endsWith("\n") ? normalized2.slice(0, -1) : normalized2;
|
|
58691
58741
|
return withoutFinalNewline.split("\n").length;
|
|
58692
58742
|
}
|
|
58693
58743
|
function countStructuralLines(source) {
|
|
@@ -58700,8 +58750,8 @@ function isCaptionCue(tag) {
|
|
|
58700
58750
|
}
|
|
58701
58751
|
function isRegistrySourceFile(filePath) {
|
|
58702
58752
|
if (!filePath) return false;
|
|
58703
|
-
const
|
|
58704
|
-
return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(
|
|
58753
|
+
const normalized2 = filePath.replace(/\\/g, "/");
|
|
58754
|
+
return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(normalized2);
|
|
58705
58755
|
}
|
|
58706
58756
|
function isRegistryInstalledFile(rawSource) {
|
|
58707
58757
|
return /^\s*<!--\s*hyperframes-registry-item:[^>]*-->/i.test(rawSource.slice(0, 512));
|
|
@@ -59649,8 +59699,8 @@ function zeroValue(value) {
|
|
|
59649
59699
|
return Number(value.trim()) === 0;
|
|
59650
59700
|
}
|
|
59651
59701
|
function isGsapColorProperty(property) {
|
|
59652
|
-
const
|
|
59653
|
-
return !
|
|
59702
|
+
const normalized2 = property.toLowerCase();
|
|
59703
|
+
return !normalized2.startsWith("--") && (normalized2.endsWith("color") || normalized2 === "fill" || normalized2 === "stroke");
|
|
59654
59704
|
}
|
|
59655
59705
|
function collectStaticCssVariableDefinitions(tags, styles) {
|
|
59656
59706
|
const definitions = /* @__PURE__ */ new Set();
|
|
@@ -59777,10 +59827,10 @@ function styleHasHiddenInitialState(style) {
|
|
|
59777
59827
|
function styleHasOpaqueBackground(style) {
|
|
59778
59828
|
const background = readStyleProperty(style, "background") || readStyleProperty(style, "background-color");
|
|
59779
59829
|
if (!background) return false;
|
|
59780
|
-
const
|
|
59781
|
-
if (
|
|
59782
|
-
if (/rgba?\([^)]*,0(?:\.0+)?\)$/.test(
|
|
59783
|
-
if (/hsla?\([^)]*,0(?:\.0+)?\)$/.test(
|
|
59830
|
+
const normalized2 = background.toLowerCase().replace(/\s+/g, "");
|
|
59831
|
+
if (normalized2 === "transparent" || normalized2 === "none") return false;
|
|
59832
|
+
if (/rgba?\([^)]*,0(?:\.0+)?\)$/.test(normalized2)) return false;
|
|
59833
|
+
if (/hsla?\([^)]*,0(?:\.0+)?\)$/.test(normalized2)) return false;
|
|
59784
59834
|
return true;
|
|
59785
59835
|
}
|
|
59786
59836
|
function styleLooksFullFrameOverlay(style) {
|
|
@@ -60162,9 +60212,9 @@ function elementLevelTokens(tokens, tagsByToken) {
|
|
|
60162
60212
|
return expanded;
|
|
60163
60213
|
}
|
|
60164
60214
|
function isMultiComponentDasharray(value) {
|
|
60165
|
-
const
|
|
60166
|
-
if (!
|
|
60167
|
-
return
|
|
60215
|
+
const normalized2 = value.replace(/!important\s*$/i, "").trim();
|
|
60216
|
+
if (!normalized2 || /^none$/i.test(normalized2)) return false;
|
|
60217
|
+
return normalized2.split(/[\s,]+/).filter(Boolean).length >= 2;
|
|
60168
60218
|
}
|
|
60169
60219
|
function gsapDasharrayValueLooksMultiComponent(valueSource) {
|
|
60170
60220
|
const literal2 = valueSource.trim().match(/^(["'`])([\s\S]*)\1$/)?.[2];
|
|
@@ -62130,7 +62180,15 @@ function collectFindings(produced, seen, filePath, into) {
|
|
|
62130
62180
|
async function lintHyperframeHtml(html, options = {}) {
|
|
62131
62181
|
const startedAt = performance.now();
|
|
62132
62182
|
const ctx = buildLintContext(html, options);
|
|
62133
|
-
const { findings, timings } = await runRules(ctx, options.filePath);
|
|
62183
|
+
const { findings: rawFindings, timings } = await runRules(ctx, options.filePath);
|
|
62184
|
+
const locate = createSourceLocator(html);
|
|
62185
|
+
const findings = rawFindings.map((finding) => {
|
|
62186
|
+
if (finding.snippet && options.externalStyles?.some(
|
|
62187
|
+
(style) => style.content.replace(/\s+/g, " ").includes(finding.snippet.replace(/\.\.\.$/, ""))
|
|
62188
|
+
))
|
|
62189
|
+
return finding;
|
|
62190
|
+
return { ...finding, ...locate(finding) };
|
|
62191
|
+
});
|
|
62134
62192
|
const errorCount = findings.filter((f) => f.severity === "error").length;
|
|
62135
62193
|
const warningCount = findings.filter((f) => f.severity === "warning").length;
|
|
62136
62194
|
const infoCount = findings.filter((f) => f.severity === "info").length;
|
package/dist/studio/assets/{hyperframes-player-BRlwG-p9.js → hyperframes-player-BF2Y9Rtn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ae=Object.defineProperty;var Ee=(s,i,e)=>i in s?Ae(s,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[i]=e;var h=(s,i,e)=>Ee(s,typeof i!="symbol"?i+"":i,e);import{r as ue,i as Ce,a as w,b as ce,c as Te,d as Re,s as Se,e as Le,F as Me}from"./index-
|
|
1
|
+
var Ae=Object.defineProperty;var Ee=(s,i,e)=>i in s?Ae(s,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[i]=e;var h=(s,i,e)=>Ee(s,typeof i!="symbol"?i+"":i,e);import{r as ue,i as Ce,a as w,b as ce,c as Te,d as Re,s as Se,e as Le,F as Me}from"./index-CGQ66fle.js";function xe(s){return s.hasRuntime||s.runtimeInjected?!1:!!(s.hasNestedCompositions||s.hasTimelines&&s.attempts>=5)}function V(s){return typeof s=="object"&&s!==null}function De(s){return V(s)&&typeof s.getDuration=="function"}function Pe(s){return V(s)&&typeof s.duration=="function"&&typeof s.time=="function"&&typeof s.seek=="function"&&typeof s.play=="function"&&typeof s.pause=="function"}function ke(s){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(s))throw new Error(`Invalid HyperFrames runtime version: ${s}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${s}/dist/hyperframe.runtime.iife.js`}const U=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ke("0.0.0-dev");function W(s){if(s===null)return null;const i=Number.parseInt(s,10);return Number.isFinite(i)&&i>0?i:null}function Ie(s){const i=(s==null?void 0:s.querySelector("[data-composition-id][data-width][data-height]"))??(s==null?void 0:s.querySelector("[data-width][data-height]"));if(!i)return null;const e=W(i.getAttribute("data-width")),t=W(i.getAttribute("data-height"));return e!==null&&t!==null?{width:e,height:t}:null}class Oe{constructor(i,e){h(this,"_interval",null);h(this,"_runtimeInjected",!1);this._iframe=i,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let i=0;this._interval=setInterval(()=>{var e;i++;try{const t=this._iframe.contentWindow;if(!t)return;const r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),a=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(xe({hasRuntime:r,hasTimelines:n,hasNestedCompositions:a,runtimeInjected:this._runtimeInjected,attempts:i})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;const d=this._resolvePlaybackDurationAdapter(t);if(d&&d.getDuration()>0){this.stop();const c=Ie(this._iframe.contentDocument);this._callbacks.onReady({duration:d.getDuration(),adapter:d,compositionSize:c});return}}catch{}i>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const i=this._iframe.contentWindow;return i?this._resolveDirectTimelineAdapterFromWindow(i):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(i){return this._resolveDirectTimelineAdapterFromWindow(i)}hasRuntimeBridge(i){return Reflect.get(i,"__hf")!==void 0||V(Reflect.get(i,"__player"))}_injectRuntime(){var i,e;this._runtimeInjected=!0;try{const t=this._iframe.contentDocument;if(!t)return;const r=t.createElement("script");r.src=U,(t.head||t.documentElement).appendChild(r),(e=(i=this._callbacks).onRuntimeInjected)==null||e.call(i)}catch{}}_resolveDirectTimelineAdapterFromWindow(i){var d,c;if(this.hasRuntimeBridge(i))return null;const e=Reflect.get(i,"__timelines");if(!V(e))return null;const t=Object.keys(e);if(t.length===0)return null;const r=(c=(d=this._iframe.contentDocument)==null?void 0:d.querySelector("[data-composition-id]"))==null?void 0:c.getAttribute("data-composition-id"),n=r&&r in e?r:t[t.length-1],a=e[n];return Pe(a)?a:null}_resolvePlaybackDurationAdapter(i){const e=Reflect.get(i,"__player");if(De(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const t=this._resolveDirectTimelineAdapterFromWindow(i);return t?{kind:"direct-timeline",timeline:t,getDuration:()=>t.duration()}:null}}const Ne=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|