@hyperframes/core 0.9.107 → 0.10.1

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.
@@ -31,6 +31,7 @@ export declare function hasCompositionOutsideTemplates(html: string): boolean;
31
31
  /** Insert markup before the document's own `</head>`, `</body>` or `</template>`; null if it has none. */
32
32
  export declare function insertBeforeCloseTag(html: string, name: "head" | "body" | "template", markup: string): string | null;
33
33
  export declare function insertRuntimeTag(html: string, tag: string, atHeadStart?: boolean): string;
34
+ export declare function markForAnotherSite(html: string): string;
34
35
  /**
35
36
  * Insert raw tag markup at the very start of `<head>`, ahead of every author
36
37
  * script (inline or external). Falls back to just before `<body>`, then to the
@@ -1,4 +1,5 @@
1
1
  import { acceleratedCanvasTrackerSource } from "../pageMotionBlur.js";
2
+ import { PREVIEW_FOR_ANOTHER_SITE_META } from "../studioPreviewMark.js";
2
3
  import { findSceneTemplate, templateContent } from "@hyperframes/parsers/sub-composition-validity";
3
4
  import { parseHTML } from "@hyperframes/parsers/linkedom";
4
5
  import { escapeInlineScriptSource, indexOfLower, lowerAscii, RUNTIME_BOOTSTRAP_ATTR, startsWithLower, } from "./htmlTokens.js";
@@ -361,6 +362,9 @@ export function insertRuntimeTag(html, tag, atHeadStart = false) {
361
362
  const tracker = `<script ${ACCEL_TRACKER_ATTR}>${acceleratedCanvasTrackerSource()}</script>`;
362
363
  return (atHeadStart ? insertWhereScriptsFirstRun : injectTagsAtHeadStart)(withRuntime, tracker);
363
364
  }
365
+ export function markForAnotherSite(html) {
366
+ return insertWhereScriptsFirstRun(html, `<meta name="${PREVIEW_FOR_ANOTHER_SITE_META}">`);
367
+ }
364
368
  function insertWhereScriptsFirstRun(html, tags) {
365
369
  const at = headContentStart(html);
366
370
  const opensWithMarkup = html.charAt(at - 1) === ">";