hyperframes 0.8.64 → 0.8.66

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.
@@ -52647,6 +52647,14 @@ var init_assetPaths = __esm({
52647
52647
  });
52648
52648
 
52649
52649
  // ../parsers/dist/subCompositionValidity.js
52650
+ function resolveSubCompositionContent(html, document2) {
52651
+ const template = document2.querySelector("template");
52652
+ if (template) return { contentHtml: template.innerHTML ?? "", hasTemplate: true };
52653
+ const body = document2.querySelector("body");
52654
+ if (body) return { contentHtml: body.innerHTML ?? "", hasTemplate: false };
52655
+ const contentHtml = document2.querySelector("html") ? "" : html;
52656
+ return { contentHtml, hasTemplate: false };
52657
+ }
52650
52658
  function checkSubCompositionUsability(html, parseHtml) {
52651
52659
  if (html == null || !html.trim()) {
52652
52660
  return {
@@ -52663,8 +52671,7 @@ function checkSubCompositionUsability(html, parseHtml) {
52663
52671
  detail: "the file's contents could not be parsed as HTML"
52664
52672
  };
52665
52673
  }
52666
- const contentRoot = compDoc.querySelector("template");
52667
- const contentHtml = contentRoot ? contentRoot.innerHTML || "" : compDoc.body?.innerHTML || "";
52674
+ const { contentHtml } = resolveSubCompositionContent(html, compDoc);
52668
52675
  if (!contentHtml.trim()) {
52669
52676
  return {
52670
52677
  ok: false,
@@ -52677,14 +52684,14 @@ function checkSubCompositionUsability(html, parseHtml) {
52677
52684
  return {
52678
52685
  ok: false,
52679
52686
  reason: "unparsable",
52680
- detail: "the file's <template>/<body> contents could not be parsed as HTML"
52687
+ detail: "the file's resolved contents could not be parsed as HTML"
52681
52688
  };
52682
52689
  }
52683
52690
  if (!contentDoc.querySelector("[data-composition-id]")) {
52684
52691
  return {
52685
52692
  ok: false,
52686
52693
  reason: "no-composition-root",
52687
- detail: "the file's <template>/<body> content has no element with a data-composition-id attribute"
52694
+ detail: "the file's resolved content has no element with a data-composition-id attribute"
52688
52695
  };
52689
52696
  }
52690
52697
  return { ok: true };
@@ -65406,7 +65413,7 @@ async function fetchToPartial(url, partialPath, controller, options) {
65406
65413
  });
65407
65414
  const readableStream = Readable.fromWeb(response.body);
65408
65415
  const fileStream = createWriteStream(partialPath, { flags: "wx" });
65409
- await pipeline(readableStream, inspector, fileStream);
65416
+ await pipeline(readableStream, inspector, fileStream, { signal: controller.signal });
65410
65417
  const localSize = statSync4(partialPath).size;
65411
65418
  const sha256Bytes = sha256.digest();
65412
65419
  const localSha256 = sha256Bytes.toString("hex");
@@ -77909,7 +77916,10 @@ function planCompositionAssembly(input) {
77909
77916
  ...toArray(assetHead?.querySelectorAll(SCRIPT_SELECTOR)),
77910
77917
  ...toArray(contentNode.querySelectorAll(SCRIPT_SELECTOR))
77911
77918
  ],
77912
- linkSources: toArray(head?.querySelectorAll(HOISTED_LINK_SELECTOR)),
77919
+ linkSources: [
77920
+ ...toArray(head?.querySelectorAll(HOISTED_LINK_SELECTOR)),
77921
+ ...toArray(contentNode.querySelectorAll(HOISTED_LINK_SELECTOR))
77922
+ ],
77913
77923
  variableDefaultCarriers: [documentElement, innerRoot].filter((carrier) => carrier != null)
77914
77924
  };
77915
77925
  }
@@ -77932,7 +77942,7 @@ function enumerateNestedCompositionHosts(assembledHost, ancestry) {
77932
77942
  }
77933
77943
  return { hosts, skipped };
77934
77944
  }
77935
- var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
77945
+ var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, EXTRACTED_COMPOSITION_ASSET_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
77936
77946
  var init_compositionAssembly = __esm({
77937
77947
  "../core/dist/compiler/compositionAssembly.js"() {
77938
77948
  "use strict";
@@ -77943,6 +77953,7 @@ var init_compositionAssembly = __esm({
77943
77953
  STYLE_SELECTOR = "style";
77944
77954
  SCRIPT_SELECTOR = "script";
77945
77955
  HOISTED_LINK_SELECTOR = 'link[rel="stylesheet"], link[rel="preconnect"]';
77956
+ EXTRACTED_COMPOSITION_ASSET_SELECTOR = `${STYLE_SELECTOR}, ${SCRIPT_SELECTOR}, ${HOISTED_LINK_SELECTOR}`;
77946
77957
  MAX_SUB_COMPOSITION_DEPTH = 20;
77947
77958
  }
77948
77959
  });
@@ -77988,8 +77999,7 @@ function inlineSubCompositions(document2, hosts, options) {
77988
77999
  compId = hostEl.getAttribute("data-composition-id") || null;
77989
78000
  runtimeCompId = compId || "";
77990
78001
  }
77991
- const contentRoot = compDoc.querySelector("template");
77992
- const contentHtml = contentRoot ? contentRoot.innerHTML || "" : compDoc.body?.innerHTML || "";
78002
+ const { contentHtml, hasTemplate } = resolveSubCompositionContent(compHtml, compDoc);
77993
78003
  if (!contentHtml.trim()) {
77994
78004
  onMissingComposition?.(src);
77995
78005
  continue;
@@ -78003,7 +78013,7 @@ function inlineSubCompositions(document2, hosts, options) {
78003
78013
  contentNode: contentDoc,
78004
78014
  head: compDoc.head,
78005
78015
  documentElement: compDoc.documentElement,
78006
- hasTemplate: Boolean(contentRoot),
78016
+ hasTemplate,
78007
78017
  compositionId: compId
78008
78018
  });
78009
78019
  const innerRoot = plan2.innerRoot;
@@ -78086,7 +78096,7 @@ function inlineSubCompositions(document2, hosts, options) {
78086
78096
  }
78087
78097
  if (innerRoot) {
78088
78098
  innerRoot.setAttribute("data-composition-file", src);
78089
- for (const child of [...innerRoot.querySelectorAll("style, script")])
78099
+ for (const child of [...innerRoot.querySelectorAll(EXTRACTED_COMPOSITION_ASSET_SELECTOR)])
78090
78100
  child.remove();
78091
78101
  if (flattenInnerRoot) {
78092
78102
  const prepared = flattenInnerRoot(innerRoot);
@@ -78101,7 +78111,7 @@ function inlineSubCompositions(document2, hosts, options) {
78101
78111
  }
78102
78112
  }
78103
78113
  } else {
78104
- for (const child of [...contentDoc.querySelectorAll("style, script")])
78114
+ for (const child of [...contentDoc.querySelectorAll(EXTRACTED_COMPOSITION_ASSET_SELECTOR)])
78105
78115
  child.remove();
78106
78116
  const bodyHtml = contentDoc.body?.innerHTML || "";
78107
78117
  hostEl.innerHTML = bodyHtml || contentDoc.documentElement?.outerHTML || "";
@@ -94769,7 +94779,7 @@ var EmptyCompositionError = class extends Error {
94769
94779
  `${problems.length} composition file${problems.length === 1 ? "" : "s"} referenced by data-composition-src cannot be rendered:
94770
94780
  ${lines.join("\n")}
94771
94781
 
94772
- Check that each file referenced by data-composition-src contains valid HTML with a <template> or <body> containing a [data-composition-id] element. If a scene-authoring step is still running, wait for it to finish before referencing the file.`
94782
+ Check that each file referenced by data-composition-src contains valid HTML with a [data-composition-id] element in a <template>, <body>, or bare fragment. If a scene-authoring step is still running, wait for it to finish before referencing the file.`
94773
94783
  );
94774
94784
  this.name = "EmptyCompositionError";
94775
94785
  this.problems = problems;
@@ -103438,8 +103448,8 @@ async function runFontLocalize(io, localize) {
103438
103448
  }
103439
103449
 
103440
103450
  // src/version.ts
103441
- var VERSION = true ? "0.8.64" : "0.0.0-dev";
103442
- var PRODUCER_VERSION = true ? "0.8.64" : "0.0.0-dev";
103451
+ var VERSION = true ? "0.8.66" : "0.0.0-dev";
103452
+ var PRODUCER_VERSION = true ? "0.8.66" : "0.0.0-dev";
103443
103453
 
103444
103454
  // src/fontLocalizeCli.ts
103445
103455
  async function readStdin() {