@absolutejs/absolute 0.19.0-beta.422 → 0.19.0-beta.423

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
@@ -180488,7 +180488,13 @@ var createSlotPatchStatement = (id, payload) => `(window.${STREAMING_RUNTIME_GLO
180488
180488
  var createNonceAttr = (nonce) => nonce ? ` nonce="${nonce}"` : "";
180489
180489
  var createStreamingSlotId = () => `${SLOT_ID_PREFIX}${Math.random().toString(36).slice(2, 10)}`;
180490
180490
  var getStreamingSlotsRuntimeScript = () => getStreamSwapRuntimeScript();
180491
- var renderStreamingSlotsRuntimeTag = (nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(getStreamingSlotsRuntimeScript())}</script>`;
180491
+ var renderStreamingSlotsRuntimeTag = (nonce, runtimePreludeScript) => {
180492
+ const runtimeBody = [
180493
+ runtimePreludeScript?.trim() ? runtimePreludeScript.trim() : "",
180494
+ getStreamingSlotsRuntimeScript()
180495
+ ].filter(Boolean).join(";");
180496
+ return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
180497
+ };
180492
180498
  var renderStreamingSlotPlaceholder = (id, fallbackHtml = "") => `<div id="${createSlotPlaceholderId(id)}" data-absolute-slot="true">${fallbackHtml}</div>`;
180493
180499
  var renderStreamingSlotPatchTag = (id, payload, nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(createSlotPatchStatement(id, payload))}</script>`;
180494
180500
  var injectHtmlIntoHead = (html, injection) => {
@@ -180793,8 +180799,8 @@ var streamOutOfOrderSlots = ({
180793
180799
  }
180794
180800
  });
180795
180801
  };
180796
- var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head") => {
180797
- const runtimeTag = renderStreamingSlotsRuntimeTag(nonce);
180802
+ var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head", runtimePreludeScript) => {
180803
+ const runtimeTag = renderStreamingSlotsRuntimeTag(nonce, runtimePreludeScript);
180798
180804
  const encoder = new TextEncoder;
180799
180805
  const decoder = new TextDecoder;
180800
180806
  const closingTag = runtimePlacement === "body" ? CLOSING_BODY_TAG : CLOSING_HEAD_TAG;
@@ -180851,6 +180857,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
180851
180857
  onError,
180852
180858
  onSlotMetric,
180853
180859
  policy,
180860
+ runtimePreludeScript,
180854
180861
  runtimePlacement = "head"
180855
180862
  } = {}) => {
180856
180863
  const resolvedPolicy = resolveStreamingSlotPolicy(policy);
@@ -180868,7 +180875,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
180868
180875
  });
180869
180876
  if (preparedSlots.length === 0)
180870
180877
  return stream;
180871
- const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement) : stream;
180878
+ const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement, runtimePreludeScript) : stream;
180872
180879
  const encoder = new TextEncoder;
180873
180880
  const decoder = new TextDecoder;
180874
180881
  const reader = source.getReader();
@@ -180957,6 +180964,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
180957
180964
  nonce,
180958
180965
  onError,
180959
180966
  runtimePlacement,
180967
+ runtimePreludeScript,
180960
180968
  streamingSlots = [],
180961
180969
  policy
180962
180970
  } = {}) => {
@@ -180967,6 +180975,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
180967
180975
  nonce,
180968
180976
  onError,
180969
180977
  policy,
180978
+ runtimePreludeScript,
180970
180979
  runtimePlacement
180971
180980
  });
180972
180981
  return new Response(body, {
@@ -187934,5 +187943,5 @@ export {
187934
187943
  ANGULAR_INIT_TIMEOUT_MS
187935
187944
  };
187936
187945
 
187937
- //# debugId=E4F98DB669C3380E64756E2164756E21
187946
+ //# debugId=A38F8CCE74110BA664756E2164756E21
187938
187947
  //# sourceMappingURL=index.js.map