@hyperframes/studio-server 0.7.89 → 0.7.92

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.
@@ -1,4 +1,4 @@
1
- export { P as PreviewApiAdapter, i as injectMediaCodecMap, e as injectMediaCodecMapIntoHtml, f as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-ChE1ATG4.js';
1
+ export { P as PreviewApiAdapter, i as injectMediaCodecMap, e as injectMediaCodecMapIntoHtml, f as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-pJzYIpV9.js';
2
2
  import './mediaCodecMap.js';
3
3
  import '@hyperframes/core';
4
4
  import '@hyperframes/parsers';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Hono } from 'hono';
2
- import { S as StudioApiAdapter, M as MediaProcessingJobState } from './mediaProxyPreview-ChE1ATG4.js';
3
- export { L as LintResult, P as PreviewApiAdapter, R as RenderJobState, a as ResolvedProject, b as StudioSelectionResponse, c as StudioSelectionSnapshot, d as StudioSelectionTextField } from './mediaProxyPreview-ChE1ATG4.js';
2
+ import { S as StudioApiAdapter, M as MediaProcessingJobState } from './mediaProxyPreview-pJzYIpV9.js';
3
+ export { L as LintResult, P as PreviewApiAdapter, R as RenderJobState, a as ResolvedProject, b as StudioSelectionResponse, c as StudioSelectionSnapshot, d as StudioSelectionTextField } from './mediaProxyPreview-pJzYIpV9.js';
4
4
  export { ScreenshotClip, getElementScreenshotClip } from './helpers/screenshotClip.js';
5
5
  export { STUDIO_MANUAL_EDITS_PATH, StudioManualEditsRenderScriptOptions, createStudioManualEditsRenderBodyScript, createStudioPositionSeekReapplyScript } from './helpers/manualEditsRenderScript.js';
6
6
  export { STUDIO_MOTION_PATH, StudioMotionRenderScriptOptions, createStudioMotionRenderBodyScript } from './helpers/studioMotionRenderScript.js';
package/dist/index.js CHANGED
@@ -2999,21 +2999,24 @@ import { stripEmbeddedRuntimeScripts } from "@hyperframes/core/compiler";
2999
2999
  function isFullHtmlDocument(html) {
3000
3000
  return /^\s*(?:<!doctype\s|<html[\s>])/i.test(html);
3001
3001
  }
3002
- function rewriteRelativePaths(root, compPath) {
3002
+ function rewriteRelativePaths(root, compPath, projectDir) {
3003
+ const assetExists = (path) => existsSync5(join7(projectDir, path));
3003
3004
  rewriteAssetPaths(
3004
3005
  root.querySelectorAll("[src], [href]"),
3005
3006
  compPath,
3006
3007
  (el, attr) => el.getAttribute(attr),
3007
- (el, attr, value) => el.setAttribute(attr, value)
3008
+ (el, attr, value) => el.setAttribute(attr, value),
3009
+ assetExists
3008
3010
  );
3009
3011
  rewriteInlineStyleAssetUrls(
3010
3012
  root.querySelectorAll("[style]"),
3011
3013
  compPath,
3012
3014
  (el) => el.getAttribute("style"),
3013
- (el, value) => el.setAttribute("style", value)
3015
+ (el, value) => el.setAttribute("style", value),
3016
+ assetExists
3014
3017
  );
3015
3018
  for (const styleEl of root.querySelectorAll("style")) {
3016
- styleEl.textContent = rewriteCssAssetUrls(styleEl.textContent || "", compPath);
3019
+ styleEl.textContent = rewriteCssAssetUrls(styleEl.textContent || "", compPath, assetExists);
3017
3020
  }
3018
3021
  }
3019
3022
  function escapeLeadingDigitIdent(id) {
@@ -3036,11 +3039,11 @@ function fixDigitLeadingIdSelectors(root) {
3036
3039
  styleEl.textContent = css;
3037
3040
  }
3038
3041
  }
3039
- function extractFullDocumentParts(rawHtml, compPath) {
3042
+ function extractFullDocumentParts(rawHtml, compPath, projectDir) {
3040
3043
  const { document: doc } = parseHTML3(rawHtml);
3041
3044
  const rewriteTargets = [doc.head, doc.body].filter(Boolean);
3042
3045
  for (const target of rewriteTargets) {
3043
- rewriteRelativePaths(target, compPath);
3046
+ rewriteRelativePaths(target, compPath, projectDir);
3044
3047
  }
3045
3048
  fixDigitLeadingIdSelectors(doc);
3046
3049
  const headContent = doc.head?.innerHTML ?? "";
@@ -3106,12 +3109,12 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, raw
3106
3109
  const { document: contentDoc } = parseHTML3(
3107
3110
  `<!DOCTYPE html><html><head></head><body>${templateInner}</body></html>`
3108
3111
  );
3109
- rewriteRelativePaths(contentDoc, compPath);
3112
+ rewriteRelativePaths(contentDoc, compPath, projectDir);
3110
3113
  fixDigitLeadingIdSelectors(contentDoc);
3111
3114
  promoteTemplateCompositionId(rawComp, contentDoc.body);
3112
3115
  rewrittenContent = contentDoc.body.innerHTML || templateInner;
3113
3116
  } else if (isFullHtmlDocument(rawComp)) {
3114
- const parts = extractFullDocumentParts(rawComp, compPath);
3117
+ const parts = extractFullDocumentParts(rawComp, compPath, projectDir);
3115
3118
  compHeadContent = parts.headContent;
3116
3119
  rewrittenContent = parts.bodyContent;
3117
3120
  htmlAttrs = parts.htmlAttrs;
@@ -3120,7 +3123,7 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, raw
3120
3123
  const { document: contentDoc } = parseHTML3(
3121
3124
  `<!DOCTYPE html><html><head></head><body>${rawComp}</body></html>`
3122
3125
  );
3123
- rewriteRelativePaths(contentDoc, compPath);
3126
+ rewriteRelativePaths(contentDoc, compPath, projectDir);
3124
3127
  fixDigitLeadingIdSelectors(contentDoc);
3125
3128
  rewrittenContent = contentDoc.body.innerHTML || rawComp;
3126
3129
  }
@@ -3750,7 +3753,8 @@ function registerRenderRoutes(api, adapter) {
3750
3753
  outputResolution,
3751
3754
  composition,
3752
3755
  variables,
3753
- distinctId: typeof body.telemetryDistinctId === "string" ? body.telemetryDistinctId : void 0
3756
+ distinctId: typeof body.telemetryDistinctId === "string" ? body.telemetryDistinctId : void 0,
3757
+ telemetryOptOut: body.telemetryOptOut === true
3754
3758
  });
3755
3759
  jobState.createdAt = Date.now();
3756
3760
  renderJobs.set(jobId, jobState);