@hyperframes/studio-server 0.8.117 → 0.8.118

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
@@ -3258,6 +3258,7 @@ import {
3258
3258
  stripEmbeddedRuntimeScripts as stripEmbeddedRuntimeScripts2
3259
3259
  } from "@hyperframes/core/compiler";
3260
3260
  import { STUDIO_PREVIEW_MARK_META } from "@hyperframes/core/studio-preview-mark";
3261
+ import { gsapCdnDist as gsapCdnDist2, motionPathPluginUrl } from "@hyperframes/core/gsap-cdn";
3261
3262
  import { injectTagsAtHeadStart } from "@hyperframes/core/compiler/html-document";
3262
3263
  import { isWithinProjectRoot } from "@hyperframes/parsers/asset-resolution";
3263
3264
 
@@ -3272,6 +3273,7 @@ import {
3272
3273
  } from "@hyperframes/core";
3273
3274
  import { stripEmbeddedRuntimeScripts } from "@hyperframes/core/compiler";
3274
3275
  import { isFullHtmlDocument } from "@hyperframes/core/compiler/html-document";
3276
+ import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
3275
3277
  function rewriteRelativePaths(root, compPath, projectDir) {
3276
3278
  const assetExists = (path) => existsSync4(join6(projectDir, path));
3277
3279
  rewriteAssetPaths(
@@ -3421,7 +3423,7 @@ ${compHeadContent}`;
3421
3423
  }
3422
3424
  if (!headContent.includes("gsap")) {
3423
3425
  headContent += `
3424
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>`;
3426
+ <script src="${gsapCdnDist()}gsap.min.js"></script>`;
3425
3427
  }
3426
3428
  const htmlOpen = htmlAttrs ? `<html ${htmlAttrs}>` : "<html>";
3427
3429
  const bodyOpen = bodyAttrs ? `<body ${bodyAttrs}>` : "<body>";
@@ -3572,10 +3574,9 @@ function lazyPreviewImages(html) {
3572
3574
 
3573
3575
  // src/routes/preview.ts
3574
3576
  var PROJECT_SIGNATURE_META = "hyperframes-project-signature";
3575
- var GSAP_CDN_VERSION = "3.15.0";
3576
- var GSAP_CDN_SCRIPT = `<script src="https://cdn.jsdelivr.net/npm/gsap@${GSAP_CDN_VERSION}/dist/gsap.min.js"></script>`;
3577
- var GSAP_CUSTOM_EASE_CDN_SCRIPT = `<script src="https://cdn.jsdelivr.net/npm/gsap@${GSAP_CDN_VERSION}/dist/CustomEase.min.js"></script>`;
3578
- var GSAP_MOTION_PATH_CDN_SCRIPT = `<script src="https://cdn.jsdelivr.net/npm/gsap@${GSAP_CDN_VERSION}/dist/MotionPathPlugin.min.js"></script>`;
3577
+ var GSAP_CDN_SCRIPT = `<script src="${gsapCdnDist2()}gsap.min.js"></script>`;
3578
+ var GSAP_CUSTOM_EASE_CDN_SCRIPT = `<script src="${gsapCdnDist2()}CustomEase.min.js"></script>`;
3579
+ var GSAP_MOTION_PATH_CDN_SCRIPT = `<script src="${motionPathPluginUrl()}"></script>`;
3579
3580
  function injectProjectSignature(html, signature) {
3580
3581
  const tag = `<meta name="${PROJECT_SIGNATURE_META}" content="${signature}">`;
3581
3582
  if (html.includes(`name="${PROJECT_SIGNATURE_META}"`)) {
@@ -3632,8 +3633,8 @@ function injectMotionPathPluginIfNeeded(html) {
3632
3633
  const gsapScript = /<script\b[^>]*\bsrc=["'][^"']*\/gsap(\.min)?\.js["'][^>]*>\s*<\/script>/i;
3633
3634
  const match = html.match(gsapScript);
3634
3635
  if (match) {
3635
- const version = match[0].match(/gsap@([\d.]+)/)?.[1] ?? GSAP_CDN_VERSION;
3636
- const pluginTag = `<script src="https://cdn.jsdelivr.net/npm/gsap@${version}/dist/MotionPathPlugin.min.js"></script>`;
3636
+ const version = match[0].match(/gsap@([\d.]+)/)?.[1];
3637
+ const pluginTag = `<script src="${motionPathPluginUrl(version)}"></script>`;
3637
3638
  const end = html.indexOf(match[0]) + match[0].length;
3638
3639
  return html.slice(0, end) + "\n" + pluginTag + html.slice(end);
3639
3640
  }
@@ -3665,7 +3666,7 @@ function injectStudioMotionScript(html, projectDir, activeCompositionPath) {
3665
3666
  var GSAP_FALLBACK_ATTR = "data-hf-gsap-fallback";
3666
3667
  var GSAP_CDN_FALLBACK_SCRIPT = `<script ${GSAP_FALLBACK_ATTR}>
3667
3668
  (function(){
3668
- var cdnBase="https://cdn.jsdelivr.net/npm/gsap@${GSAP_CDN_VERSION}/dist/";
3669
+ var cdnBase="${gsapCdnDist2()}";
3669
3670
  var loaded={};
3670
3671
  function loadFallback(file){
3671
3672
  if(loaded[file])return loaded[file];