hyperframes 0.8.76 → 0.8.77
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 +275 -108
- package/dist/fontLocalizeCli.js +119 -43
- package/dist/hyperframe-runtime.js +49 -49
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +49 -49
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-BkDxgSKG.js → hyperframes-player-BSDTJ9EF.js} +1 -1
- package/dist/studio/assets/{index-DeHir1up.js → index-2GgHjQq-.js} +148 -148
- package/dist/studio/assets/{index-0w6iIlwZ.css → index-BWJqxeaH.css} +1 -1
- package/dist/studio/assets/{index-COX0scwJ.js → index-CsFCRdMo.js} +1 -1
- package/dist/studio/assets/{index-FmKUmYhC.js → index-DcxWQ7Za.js} +1 -1
- package/dist/studio/{chunk-IYDE66BY.js → chunk-5VANA2TG.js} +7 -1
- package/dist/studio/{chunk-IYDE66BY.js.map → chunk-5VANA2TG.js.map} +1 -1
- package/dist/studio/{domEditingLayers-2XBFXXSW.js → domEditingLayers-IGPLTI5E.js} +2 -2
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +4125 -4009
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/styles.css +1 -1
- package/package.json +1 -1
- /package/dist/studio/{domEditingLayers-2XBFXXSW.js.map → domEditingLayers-IGPLTI5E.js.map} +0 -0
package/dist/fontLocalizeCli.js
CHANGED
|
@@ -52717,10 +52717,13 @@ function parseHTMLContent(html) {
|
|
|
52717
52717
|
}
|
|
52718
52718
|
return parseHTML(`<!DOCTYPE html><html><head></head><body>${html}</body></html>`).document;
|
|
52719
52719
|
}
|
|
52720
|
+
function lowerAscii(text) {
|
|
52721
|
+
return text.replace(/[A-Z]+/g, (letters) => letters.toLowerCase());
|
|
52722
|
+
}
|
|
52720
52723
|
function stripEmbeddedRuntimeScripts(html) {
|
|
52721
52724
|
if (!html)
|
|
52722
52725
|
return html;
|
|
52723
|
-
const loweredHtml = html
|
|
52726
|
+
const loweredHtml = lowerAscii(html);
|
|
52724
52727
|
let output = "";
|
|
52725
52728
|
let cursor = 0;
|
|
52726
52729
|
while (cursor < html.length) {
|
|
@@ -52757,22 +52760,41 @@ function findScriptStart(loweredHtml, from) {
|
|
|
52757
52760
|
}
|
|
52758
52761
|
function findTagEnd(html, from) {
|
|
52759
52762
|
let quote;
|
|
52763
|
+
let state = "tagName";
|
|
52760
52764
|
for (let index = from; index < html.length; index += 1) {
|
|
52761
|
-
const char = html
|
|
52765
|
+
const char = html.charAt(index);
|
|
52762
52766
|
if (quote) {
|
|
52763
|
-
|
|
52764
|
-
quote = void 0;
|
|
52767
|
+
quote = char === quote ? void 0 : quote;
|
|
52765
52768
|
continue;
|
|
52766
52769
|
}
|
|
52767
|
-
if (char ===
|
|
52770
|
+
if (char === ">")
|
|
52771
|
+
return index;
|
|
52772
|
+
if (state === "equals" && (char === '"' || char === "'")) {
|
|
52768
52773
|
quote = char;
|
|
52774
|
+
state = "between";
|
|
52769
52775
|
continue;
|
|
52770
52776
|
}
|
|
52771
|
-
|
|
52772
|
-
return index;
|
|
52777
|
+
state = nextTagState(state, char, index === from);
|
|
52773
52778
|
}
|
|
52774
52779
|
return -1;
|
|
52775
52780
|
}
|
|
52781
|
+
function nextTagState(state, char, first) {
|
|
52782
|
+
if (isHtmlWhitespace(char))
|
|
52783
|
+
return stateAfterWhitespace(state);
|
|
52784
|
+
if (char === "/" && !first)
|
|
52785
|
+
return stateAfterSlash(state);
|
|
52786
|
+
if (char === "=" && state === "name")
|
|
52787
|
+
return "equals";
|
|
52788
|
+
if (state === "equals")
|
|
52789
|
+
return "value";
|
|
52790
|
+
return state === "between" ? "name" : state;
|
|
52791
|
+
}
|
|
52792
|
+
function stateAfterWhitespace(state) {
|
|
52793
|
+
return state === "tagName" || state === "value" ? "between" : state;
|
|
52794
|
+
}
|
|
52795
|
+
function stateAfterSlash(state) {
|
|
52796
|
+
return state === "equals" || state === "value" ? "value" : "between";
|
|
52797
|
+
}
|
|
52776
52798
|
function findScriptCloseTagEnd(loweredHtml, from) {
|
|
52777
52799
|
let index = loweredHtml.indexOf("</script", from);
|
|
52778
52800
|
while (index !== -1) {
|
|
@@ -52811,7 +52833,7 @@ function getScriptSource(block) {
|
|
|
52811
52833
|
const startTagEnd = findTagEnd(block, 1);
|
|
52812
52834
|
if (startTagEnd === -1)
|
|
52813
52835
|
return "";
|
|
52814
|
-
const loweredBlock = block
|
|
52836
|
+
const loweredBlock = lowerAscii(block);
|
|
52815
52837
|
const closeTagStart = loweredBlock.lastIndexOf("</script");
|
|
52816
52838
|
const end = closeTagStart === -1 ? block.length : closeTagStart;
|
|
52817
52839
|
return block.slice(startTagEnd + 1, end);
|
|
@@ -52826,8 +52848,8 @@ function escapeInlineScriptSource(source) {
|
|
|
52826
52848
|
return escapeCaseInsensitiveToken(escapeCaseInsensitiveToken(source, "</script", "<\\/script"), "<!--", "<\\!--");
|
|
52827
52849
|
}
|
|
52828
52850
|
function escapeCaseInsensitiveToken(source, token, replacement) {
|
|
52829
|
-
const loweredSource = source
|
|
52830
|
-
const loweredToken = token
|
|
52851
|
+
const loweredSource = lowerAscii(source);
|
|
52852
|
+
const loweredToken = lowerAscii(token);
|
|
52831
52853
|
let output = "";
|
|
52832
52854
|
let cursor = 0;
|
|
52833
52855
|
while (cursor < source.length) {
|
|
@@ -52844,16 +52866,78 @@ function escapeCaseInsensitiveToken(source, token, replacement) {
|
|
|
52844
52866
|
function inlineScriptTags(scripts) {
|
|
52845
52867
|
return scripts.map((source) => `<script>${escapeInlineScriptSource(source)}</script>`).join("\n");
|
|
52846
52868
|
}
|
|
52847
|
-
function
|
|
52848
|
-
|
|
52849
|
-
|
|
52850
|
-
|
|
52869
|
+
function findDocumentTag(html, tag) {
|
|
52870
|
+
const lowered = lowerAscii(html);
|
|
52871
|
+
const unclosedRawText = /* @__PURE__ */ new Set();
|
|
52872
|
+
let cursor = 0;
|
|
52873
|
+
while (cursor !== -1) {
|
|
52874
|
+
const open = lowered.indexOf("<", cursor);
|
|
52875
|
+
if (open === -1)
|
|
52876
|
+
return -1;
|
|
52877
|
+
if (isTagAt(lowered, open, tag))
|
|
52878
|
+
return open;
|
|
52879
|
+
cursor = skipMarkup(lowered, open, unclosedRawText);
|
|
52851
52880
|
}
|
|
52852
|
-
|
|
52853
|
-
|
|
52854
|
-
|
|
52881
|
+
return -1;
|
|
52882
|
+
}
|
|
52883
|
+
function isTagAt(lowered, at2, token) {
|
|
52884
|
+
return lowered.startsWith(token, at2) && isTagBoundary(lowered.charAt(at2 + token.length));
|
|
52885
|
+
}
|
|
52886
|
+
function skipMarkup(lowered, open, unclosedRawText) {
|
|
52887
|
+
if (lowered.startsWith("<!--", open))
|
|
52888
|
+
return skipComment(lowered, open);
|
|
52889
|
+
const next = lowered.charAt(open + 1);
|
|
52890
|
+
if (next === "/" && !/[a-z]/.test(lowered.charAt(open + 2))) {
|
|
52891
|
+
const bogusEnd = lowered.indexOf(">", open);
|
|
52892
|
+
return bogusEnd === -1 ? -1 : bogusEnd + 1;
|
|
52893
|
+
}
|
|
52894
|
+
if (!/[a-z/]/.test(next))
|
|
52895
|
+
return open + 1;
|
|
52896
|
+
const tagEnd = findTagEnd(lowered, open + 1);
|
|
52897
|
+
return tagEnd === -1 ? -1 : skipRawText(lowered, open, tagEnd, unclosedRawText);
|
|
52898
|
+
}
|
|
52899
|
+
function skipComment(lowered, open) {
|
|
52900
|
+
if (lowered.startsWith("<!-->", open) || lowered.startsWith("<!--->", open)) {
|
|
52901
|
+
return lowered.indexOf(">", open) + 1;
|
|
52902
|
+
}
|
|
52903
|
+
COMMENT_END.lastIndex = open + 4;
|
|
52904
|
+
const end = COMMENT_END.exec(lowered);
|
|
52905
|
+
return end ? end.index + end[0].length : -1;
|
|
52906
|
+
}
|
|
52907
|
+
function skipRawText(lowered, open, tagEnd, unclosedRawText) {
|
|
52908
|
+
const rawText = RAW_TEXT_TAGS.find((name) => isTagAt(lowered, open, `<${name}`));
|
|
52909
|
+
if (!rawText)
|
|
52910
|
+
return tagEnd + 1;
|
|
52911
|
+
const close = unclosedRawText.has(rawText) ? -1 : findRawTextClose(lowered, rawText, tagEnd + 1);
|
|
52912
|
+
if (close !== -1)
|
|
52913
|
+
return close;
|
|
52914
|
+
unclosedRawText.add(rawText);
|
|
52915
|
+
return lowered.charAt(tagEnd - 1) === "/" ? tagEnd + 1 : -1;
|
|
52916
|
+
}
|
|
52917
|
+
function findRawTextClose(lowered, name, from) {
|
|
52918
|
+
const close = `</${name}`;
|
|
52919
|
+
for (let at2 = lowered.indexOf(close, from); at2 !== -1; at2 = lowered.indexOf(close, at2 + 1)) {
|
|
52920
|
+
if (isTagAt(lowered, at2, close))
|
|
52921
|
+
return at2;
|
|
52855
52922
|
}
|
|
52856
|
-
return
|
|
52923
|
+
return -1;
|
|
52924
|
+
}
|
|
52925
|
+
function insertBeforeDocumentTag(html, tag, markup) {
|
|
52926
|
+
const at2 = findDocumentTag(html, tag);
|
|
52927
|
+
return at2 === -1 ? null : html.slice(0, at2) + markup + html.slice(at2);
|
|
52928
|
+
}
|
|
52929
|
+
function insertBeforeCloseTag(html, name, markup) {
|
|
52930
|
+
return insertBeforeDocumentTag(html, `</${name}`, markup);
|
|
52931
|
+
}
|
|
52932
|
+
function injectTagsAtHeadStart(html, tags) {
|
|
52933
|
+
const headOpen = findDocumentTag(html, "<head");
|
|
52934
|
+
const headOpenEnd = headOpen === -1 ? -1 : findTagEnd(html, headOpen + 1);
|
|
52935
|
+
if (headOpenEnd !== -1) {
|
|
52936
|
+
return `${html.slice(0, headOpenEnd + 1)}
|
|
52937
|
+
${tags}${html.slice(headOpenEnd + 1)}`;
|
|
52938
|
+
}
|
|
52939
|
+
return insertBeforeDocumentTag(html, "<body", `${tags}
|
|
52940
|
+
`) ?? `${tags}
|
|
52857
52941
|
${html}`;
|
|
52858
52942
|
}
|
|
52859
52943
|
function injectScriptsAtHeadStart(html, scripts) {
|
|
@@ -52867,30 +52951,21 @@ function injectScriptsIntoHtml(html, headScripts, bodyScripts, stripEmbeddedRunt
|
|
|
52867
52951
|
}
|
|
52868
52952
|
if (headScripts.length > 0) {
|
|
52869
52953
|
const headTags = inlineScriptTags(headScripts);
|
|
52870
|
-
|
|
52871
|
-
|
|
52872
|
-
|
|
52873
|
-
|
|
52874
|
-
html = html.replace("<body", () => `${headTags}
|
|
52875
|
-
<body`);
|
|
52876
|
-
} else {
|
|
52877
|
-
html = `${headTags}
|
|
52954
|
+
const withHead = insertBeforeCloseTag(html, "head", `${headTags}
|
|
52955
|
+
`);
|
|
52956
|
+
html = withHead ?? insertBeforeDocumentTag(html, "<body", `${headTags}
|
|
52957
|
+
`) ?? `${headTags}
|
|
52878
52958
|
${html}`;
|
|
52879
|
-
}
|
|
52880
52959
|
}
|
|
52881
52960
|
if (bodyScripts.length > 0) {
|
|
52882
52961
|
const bodyTags = inlineScriptTags(bodyScripts);
|
|
52883
|
-
|
|
52884
|
-
|
|
52885
|
-
</body>`);
|
|
52886
|
-
} else {
|
|
52887
|
-
html = `${html}
|
|
52962
|
+
html = insertBeforeCloseTag(html, "body", `${bodyTags}
|
|
52963
|
+
`) ?? `${html}
|
|
52888
52964
|
${bodyTags}`;
|
|
52889
|
-
}
|
|
52890
52965
|
}
|
|
52891
52966
|
return html;
|
|
52892
52967
|
}
|
|
52893
|
-
var RUNTIME_BOOTSTRAP_ATTR, RUNTIME_SRC_MARKERS, RUNTIME_INLINE_MARKERS, SIMPLE_RUNTIME_FLAG_ASSIGNMENTS;
|
|
52968
|
+
var RUNTIME_BOOTSTRAP_ATTR, RUNTIME_SRC_MARKERS, RUNTIME_INLINE_MARKERS, SIMPLE_RUNTIME_FLAG_ASSIGNMENTS, RAW_TEXT_TAGS, COMMENT_END;
|
|
52894
52969
|
var init_htmlDocument = __esm({
|
|
52895
52970
|
"../core/dist/compiler/htmlDocument.js"() {
|
|
52896
52971
|
"use strict";
|
|
@@ -52913,6 +52988,8 @@ var init_htmlDocument = __esm({
|
|
|
52913
52988
|
/^window\.__playerReady\s*=\s*(?:true|false)\s*;?$/,
|
|
52914
52989
|
/^window\.__renderReady\s*=\s*(?:true|false)\s*;?$/
|
|
52915
52990
|
];
|
|
52991
|
+
RAW_TEXT_TAGS = ["script", "style", "title", "textarea"];
|
|
52992
|
+
COMMENT_END = /--!?>/g;
|
|
52916
52993
|
}
|
|
52917
52994
|
});
|
|
52918
52995
|
|
|
@@ -95735,9 +95812,7 @@ function injectSdkPositionEditsRenderScript(html) {
|
|
|
95735
95812
|
}
|
|
95736
95813
|
const scriptBody = getPositionEditsRenderScript().replace(/<\/script/gi, "<\\/script");
|
|
95737
95814
|
const script = `<script>${scriptBody}</script>`;
|
|
95738
|
-
|
|
95739
|
-
if (bodyClose < 0) return `${html}${script}`;
|
|
95740
|
-
return `${html.slice(0, bodyClose)}${script}${html.slice(bodyClose)}`;
|
|
95815
|
+
return insertBeforeCloseTag(html, "body", script) ?? `${html}${script}`;
|
|
95741
95816
|
}
|
|
95742
95817
|
var EmptyCompositionError = class extends Error {
|
|
95743
95818
|
code = "EMPTY_COMPOSITION";
|
|
@@ -96869,10 +96944,11 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
96869
96944
|
'data-hf-studio-motion="'
|
|
96870
96945
|
];
|
|
96871
96946
|
const hasPositionEdits = HF_POSITION_ATTRS.some((attr) => assembledHtml.includes(attr));
|
|
96872
|
-
const htmlWithPositionScript = hasPositionEdits ?
|
|
96873
|
-
|
|
96874
|
-
|
|
96875
|
-
|
|
96947
|
+
const htmlWithPositionScript = hasPositionEdits ? insertBeforeCloseTag(
|
|
96948
|
+
assembledHtml,
|
|
96949
|
+
"body",
|
|
96950
|
+
`<script>${createStudioPositionSeekReapplyScript()}</script>`
|
|
96951
|
+
) ?? assembledHtml : assembledHtml;
|
|
96876
96952
|
const htmlWithSdkPositionScript = injectSdkPositionEditsRenderScript(htmlWithPositionScript);
|
|
96877
96953
|
const { html: htmlWithLocalMedia, remoteMediaAssets } = await localizeRemoteMediaSources(
|
|
96878
96954
|
htmlWithSdkPositionScript,
|
|
@@ -104437,8 +104513,8 @@ async function runFontLocalize(io, localize) {
|
|
|
104437
104513
|
}
|
|
104438
104514
|
|
|
104439
104515
|
// src/version.ts
|
|
104440
|
-
var VERSION = true ? "0.8.
|
|
104441
|
-
var PRODUCER_VERSION = true ? "0.8.
|
|
104516
|
+
var VERSION = true ? "0.8.77" : "0.0.0-dev";
|
|
104517
|
+
var PRODUCER_VERSION = true ? "0.8.77" : "0.0.0-dev";
|
|
104442
104518
|
|
|
104443
104519
|
// src/fontLocalizeCli.ts
|
|
104444
104520
|
async function readStdin() {
|