hyperframes 0.8.65 → 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 +515 -388
- package/dist/fontLocalizeCli.js +152 -83
- package/dist/hyperframe-runtime.js +37 -37
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +37 -37
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/renderSetupWorker.js +112 -47
- package/dist/studio/assets/{hyperframes-player-CwFrSySS.js → hyperframes-player-BF2Y9Rtn.js} +1 -1
- package/dist/studio/assets/index-BBOktYKC.css +1 -0
- package/dist/studio/assets/{index-a5nEhdAU.js → index-BXCEB5uw.js} +1 -1
- package/dist/studio/assets/{index-Cs1lQrQ6.js → index-CGQ66fle.js} +200 -200
- package/dist/studio/assets/{index-wQFEeTL3.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 +4451 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var HyperframesPlayer=(()=>{var Se=Object.defineProperty;var fn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var bn=Object.prototype.hasOwnProperty;var gn=(n,e)=>{for(var t in e)Se(n,t,{get:e[t],enumerable:!0})},_n=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hn(e))!bn.call(n,r)&&r!==t&&Se(n,r,{get:()=>e[r],enumerable:!(i=fn(e,r))||i.enumerable});return n};var yn=n=>_n(Se({},"__esModule",{value:!0}),n);var Xi={};gn(Xi,{HyperframesPlayer:()=>Ee,SPEED_PRESETS:()=>we,formatSpeed:()=>G,formatTime:()=>ie});function ct(n){return n.hasRuntime||n.runtimeInjected?!1:!!(n.hasNestedCompositions||n.hasTimelines&&n.attempts>=5)}function H(n){return typeof n=="object"&&n!==null}function mt(n){return H(n)&&typeof n.getDuration=="function"}function pt(n){return H(n)&&typeof n.duration=="function"&&typeof n.time=="function"&&typeof n.seek=="function"&&typeof n.play=="function"&&typeof n.pause=="function"}var L="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.8.
|
|
1
|
+
"use strict";var HyperframesPlayer=(()=>{var Se=Object.defineProperty;var fn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var bn=Object.prototype.hasOwnProperty;var gn=(n,e)=>{for(var t in e)Se(n,t,{get:e[t],enumerable:!0})},_n=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hn(e))!bn.call(n,r)&&r!==t&&Se(n,r,{get:()=>e[r],enumerable:!(i=fn(e,r))||i.enumerable});return n};var yn=n=>_n(Se({},"__esModule",{value:!0}),n);var Xi={};gn(Xi,{HyperframesPlayer:()=>Ee,SPEED_PRESETS:()=>we,formatSpeed:()=>G,formatTime:()=>ie});function ct(n){return n.hasRuntime||n.runtimeInjected?!1:!!(n.hasNestedCompositions||n.hasTimelines&&n.attempts>=5)}function H(n){return typeof n=="object"&&n!==null}function mt(n){return H(n)&&typeof n.getDuration=="function"}function pt(n){return H(n)&&typeof n.duration=="function"&&typeof n.time=="function"&&typeof n.seek=="function"&&typeof n.play=="function"&&typeof n.pause=="function"}var L="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.8.67/dist/hyperframe.runtime.iife.js";function V(n){if(n===null)return null;let e=Number.parseInt(n,10);return Number.isFinite(e)&&e>0?e:null}function vn(n){let e=n?.querySelector("[data-composition-id][data-width][data-height]")??n?.querySelector("[data-width][data-height]");if(!e)return null;let t=V(e.getAttribute("data-width")),i=V(e.getAttribute("data-height"));return t!==null&&i!==null?{width:t,height:i}:null}var ne=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let i=!!(t.__hf||t.__player),r=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ct({hasRuntime:i,hasTimelines:r,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!i)return;let a=this._resolvePlaybackDurationAdapter(t);if(a&&a.getDuration()>0){this.stop();let s=vn(this._iframe.contentDocument);this._callbacks.onReady({duration:a.getDuration(),adapter:a,compositionSize:s});return}}catch{}e>=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{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||H(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=L,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!H(t))return null;let i=Object.keys(t);if(i.length===0)return null;let r=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=r&&r in t?r:i[i.length-1],a=t[o];return pt(a)?a:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(mt(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let i=this._resolveDirectTimelineAdapterFromWindow(e);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}};var ft=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
|
@@ -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,11 +56313,19 @@ 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
|
|
56321
|
+
function resolveSubCompositionContent(html, document) {
|
|
56322
|
+
const template = document.querySelector("template");
|
|
56323
|
+
if (template) return { contentHtml: template.innerHTML ?? "", hasTemplate: true };
|
|
56324
|
+
const body = document.querySelector("body");
|
|
56325
|
+
if (body) return { contentHtml: body.innerHTML ?? "", hasTemplate: false };
|
|
56326
|
+
const contentHtml = document.querySelector("html") ? "" : html;
|
|
56327
|
+
return { contentHtml, hasTemplate: false };
|
|
56328
|
+
}
|
|
56321
56329
|
function checkSubCompositionUsability(html, parseHtml) {
|
|
56322
56330
|
if (html == null || !html.trim()) {
|
|
56323
56331
|
return {
|
|
@@ -56334,8 +56342,7 @@ function checkSubCompositionUsability(html, parseHtml) {
|
|
|
56334
56342
|
detail: "the file's contents could not be parsed as HTML"
|
|
56335
56343
|
};
|
|
56336
56344
|
}
|
|
56337
|
-
const
|
|
56338
|
-
const contentHtml = contentRoot ? contentRoot.innerHTML || "" : compDoc.body?.innerHTML || "";
|
|
56345
|
+
const { contentHtml } = resolveSubCompositionContent(html, compDoc);
|
|
56339
56346
|
if (!contentHtml.trim()) {
|
|
56340
56347
|
return {
|
|
56341
56348
|
ok: false,
|
|
@@ -56348,14 +56355,14 @@ function checkSubCompositionUsability(html, parseHtml) {
|
|
|
56348
56355
|
return {
|
|
56349
56356
|
ok: false,
|
|
56350
56357
|
reason: "unparsable",
|
|
56351
|
-
detail: "the file's
|
|
56358
|
+
detail: "the file's resolved contents could not be parsed as HTML"
|
|
56352
56359
|
};
|
|
56353
56360
|
}
|
|
56354
56361
|
if (!contentDoc.querySelector("[data-composition-id]")) {
|
|
56355
56362
|
return {
|
|
56356
56363
|
ok: false,
|
|
56357
56364
|
reason: "no-composition-root",
|
|
56358
|
-
detail: "the file's
|
|
56365
|
+
detail: "the file's resolved content has no element with a data-composition-id attribute"
|
|
56359
56366
|
};
|
|
56360
56367
|
}
|
|
56361
56368
|
return { ok: true };
|
|
@@ -56427,8 +56434,8 @@ function resolveLocalAssetCandidates(projectDir, url) {
|
|
|
56427
56434
|
addCandidate(candidates, resolved);
|
|
56428
56435
|
continue;
|
|
56429
56436
|
}
|
|
56430
|
-
const
|
|
56431
|
-
const clamped =
|
|
56437
|
+
const normalized2 = posix2.normalize(projectRelative.replace(/\\/g, "/"));
|
|
56438
|
+
const clamped = normalized2.replace(/^(\.\.\/)+/, "");
|
|
56432
56439
|
if (clamped && !clamped.startsWith("..")) {
|
|
56433
56440
|
addCandidate(candidates, resolve(projectRoot, clamped));
|
|
56434
56441
|
}
|
|
@@ -56506,8 +56513,8 @@ function candidateFileName(candidate) {
|
|
|
56506
56513
|
return candidate.split(/[\\/]/).at(-1)?.toLowerCase() ?? candidate.toLowerCase();
|
|
56507
56514
|
}
|
|
56508
56515
|
function chooseBestPathCandidate(name, candidates) {
|
|
56509
|
-
const
|
|
56510
|
-
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];
|
|
56511
56518
|
}
|
|
56512
56519
|
function isExecutablePathCandidate(candidate) {
|
|
56513
56520
|
if (process.platform === "win32") return existsSync3(candidate);
|
|
@@ -57145,14 +57152,64 @@ function hasCaptionStyles(styles) {
|
|
|
57145
57152
|
return styles.some((s) => /\.caption[-_]?(?:group|word)/i.test(s.content));
|
|
57146
57153
|
}
|
|
57147
57154
|
function truncateSnippet(value, maxLength = 220) {
|
|
57148
|
-
const
|
|
57149
|
-
if (!
|
|
57150
|
-
if (
|
|
57151
|
-
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)}...`;
|
|
57152
57159
|
}
|
|
57153
57160
|
function mediaSrcTagRe(tagAlternation) {
|
|
57154
57161
|
return new RegExp(`<(${tagAlternation})\\b[^>]*\\ssrc\\s*=\\s*["']([^"']+)["'][^>]*>`, "gi");
|
|
57155
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
|
+
}
|
|
57156
57213
|
function buildLintContext(html, options = {}) {
|
|
57157
57214
|
const rawSource = html || "";
|
|
57158
57215
|
let source = stripHtmlComments(rawSource);
|
|
@@ -57938,18 +57995,18 @@ function classNamesFromAttr(classAttr) {
|
|
|
57938
57995
|
return classAttr.split(/\s+/).filter(Boolean);
|
|
57939
57996
|
}
|
|
57940
57997
|
function selectorTargetsManagedMedia(selector, mediaIndex) {
|
|
57941
|
-
const
|
|
57942
|
-
if (!
|
|
57943
|
-
if (mediaIndex.hasVideo && /\bvideo\b/i.test(
|
|
57944
|
-
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;
|
|
57945
58002
|
for (const mediaId of mediaIndex.ids) {
|
|
57946
58003
|
const escapedId = escapeRegExp2(mediaId);
|
|
57947
|
-
if (new RegExp(`#${escapedId}(?![\\w-])`).test(
|
|
58004
|
+
if (new RegExp(`#${escapedId}(?![\\w-])`).test(normalized2) || normalized2.includes(`[id="${mediaId}"]`) || normalized2.includes(`[id='${mediaId}']`)) {
|
|
57948
58005
|
return true;
|
|
57949
58006
|
}
|
|
57950
58007
|
}
|
|
57951
58008
|
for (const className of mediaIndex.classes) {
|
|
57952
|
-
if (new RegExp(`\\.${escapeRegExp2(className)}(?![\\w-])`).test(
|
|
58009
|
+
if (new RegExp(`\\.${escapeRegExp2(className)}(?![\\w-])`).test(normalized2)) {
|
|
57953
58010
|
return true;
|
|
57954
58011
|
}
|
|
57955
58012
|
}
|
|
@@ -58679,8 +58736,8 @@ function readTagTiming(rawTag) {
|
|
|
58679
58736
|
}
|
|
58680
58737
|
function countPhysicalLines(source) {
|
|
58681
58738
|
if (source.length === 0) return 0;
|
|
58682
|
-
const
|
|
58683
|
-
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;
|
|
58684
58741
|
return withoutFinalNewline.split("\n").length;
|
|
58685
58742
|
}
|
|
58686
58743
|
function countStructuralLines(source) {
|
|
@@ -58693,8 +58750,8 @@ function isCaptionCue(tag) {
|
|
|
58693
58750
|
}
|
|
58694
58751
|
function isRegistrySourceFile(filePath) {
|
|
58695
58752
|
if (!filePath) return false;
|
|
58696
|
-
const
|
|
58697
|
-
return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(
|
|
58753
|
+
const normalized2 = filePath.replace(/\\/g, "/");
|
|
58754
|
+
return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(normalized2);
|
|
58698
58755
|
}
|
|
58699
58756
|
function isRegistryInstalledFile(rawSource) {
|
|
58700
58757
|
return /^\s*<!--\s*hyperframes-registry-item:[^>]*-->/i.test(rawSource.slice(0, 512));
|
|
@@ -59642,8 +59699,8 @@ function zeroValue(value) {
|
|
|
59642
59699
|
return Number(value.trim()) === 0;
|
|
59643
59700
|
}
|
|
59644
59701
|
function isGsapColorProperty(property) {
|
|
59645
|
-
const
|
|
59646
|
-
return !
|
|
59702
|
+
const normalized2 = property.toLowerCase();
|
|
59703
|
+
return !normalized2.startsWith("--") && (normalized2.endsWith("color") || normalized2 === "fill" || normalized2 === "stroke");
|
|
59647
59704
|
}
|
|
59648
59705
|
function collectStaticCssVariableDefinitions(tags, styles) {
|
|
59649
59706
|
const definitions = /* @__PURE__ */ new Set();
|
|
@@ -59770,10 +59827,10 @@ function styleHasHiddenInitialState(style) {
|
|
|
59770
59827
|
function styleHasOpaqueBackground(style) {
|
|
59771
59828
|
const background = readStyleProperty(style, "background") || readStyleProperty(style, "background-color");
|
|
59772
59829
|
if (!background) return false;
|
|
59773
|
-
const
|
|
59774
|
-
if (
|
|
59775
|
-
if (/rgba?\([^)]*,0(?:\.0+)?\)$/.test(
|
|
59776
|
-
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;
|
|
59777
59834
|
return true;
|
|
59778
59835
|
}
|
|
59779
59836
|
function styleLooksFullFrameOverlay(style) {
|
|
@@ -60155,9 +60212,9 @@ function elementLevelTokens(tokens, tagsByToken) {
|
|
|
60155
60212
|
return expanded;
|
|
60156
60213
|
}
|
|
60157
60214
|
function isMultiComponentDasharray(value) {
|
|
60158
|
-
const
|
|
60159
|
-
if (!
|
|
60160
|
-
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;
|
|
60161
60218
|
}
|
|
60162
60219
|
function gsapDasharrayValueLooksMultiComponent(valueSource) {
|
|
60163
60220
|
const literal2 = valueSource.trim().match(/^(["'`])([\s\S]*)\1$/)?.[2];
|
|
@@ -62123,7 +62180,15 @@ function collectFindings(produced, seen, filePath, into) {
|
|
|
62123
62180
|
async function lintHyperframeHtml(html, options = {}) {
|
|
62124
62181
|
const startedAt = performance.now();
|
|
62125
62182
|
const ctx = buildLintContext(html, options);
|
|
62126
|
-
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
|
+
});
|
|
62127
62192
|
const errorCount = findings.filter((f) => f.severity === "error").length;
|
|
62128
62193
|
const warningCount = findings.filter((f) => f.severity === "warning").length;
|
|
62129
62194
|
const infoCount = findings.filter((f) => f.severity === "info").length;
|
package/dist/studio/assets/{hyperframes-player-CwFrSySS.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;
|