@absolutejs/absolute 0.19.0-beta.1000 → 0.19.0-beta.1002

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,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-nFVk06/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-QcnKME/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-nFVk06/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-QcnKME/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-nFVk06/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-QcnKME/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -14088,6 +14088,34 @@ var injectIslandPageContextStream = (stream, options) => {
14088
14088
  var setCurrentIslandManifest = (manifest) => {
14089
14089
  globalThis.__absoluteManifest = manifest;
14090
14090
  };
14091
+
14092
+ // src/utils/inlinePageCss.ts
14093
+ var siblingCssCache = new Map;
14094
+ var readSiblingCss = async (siblingJsPath) => {
14095
+ if (!siblingJsPath)
14096
+ return "";
14097
+ const cssPath = siblingJsPath.replace(/\.js$/, ".css");
14098
+ if (cssPath === siblingJsPath)
14099
+ return "";
14100
+ const cached = siblingCssCache.get(cssPath);
14101
+ if (cached !== undefined)
14102
+ return cached;
14103
+ const { readFile } = await import("fs/promises");
14104
+ try {
14105
+ const css = await readFile(cssPath, "utf-8");
14106
+ siblingCssCache.set(cssPath, css);
14107
+ return css;
14108
+ } catch {
14109
+ siblingCssCache.set(cssPath, "");
14110
+ return "";
14111
+ }
14112
+ };
14113
+ var injectInlineCss = (headTag, css) => {
14114
+ if (!css)
14115
+ return headTag;
14116
+ const styleBlock = `<style data-absolute-page-css>${css}</style>`;
14117
+ return headTag.replace("</head>", `${styleBlock}</head>`);
14118
+ };
14091
14119
  // src/utils/resolveConvention.ts
14092
14120
  import { basename } from "path";
14093
14121
  var CONVENTIONS_KEY = "__absoluteConventions";
@@ -14816,13 +14844,15 @@ var handleAngularPageRequest = async (input) => {
14816
14844
  const requestId = `angular_${Date.now()}_${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
14817
14845
  return angularSsrContext.run(requestId, async () => {
14818
14846
  await ensureAngularCompiler();
14819
- const resolvedHeadTag = input.headTag ?? "<head></head>";
14847
+ const userHeadTag = input.headTag ?? "<head></head>";
14820
14848
  const resolvedIndexPath = input.indexPath;
14821
14849
  const options = input;
14822
14850
  const resolvedPagePath = input.pagePath;
14823
14851
  const maybeRequestContext = input.requestContext;
14824
14852
  const responseInit = input.responseInit ?? {};
14825
14853
  const resolvedUrl = resolveRequestRenderUrl(input.request);
14854
+ const siblingCss = await readSiblingCss(resolvedPagePath);
14855
+ const resolvedHeadTag = injectInlineCss(userHeadTag, siblingCss);
14826
14856
  cacheRouteData(resolvedPagePath, {
14827
14857
  headTag: resolvedHeadTag,
14828
14858
  requestContext: maybeRequestContext
@@ -15396,5 +15426,5 @@ export {
15396
15426
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15397
15427
  };
15398
15428
 
15399
- //# debugId=8F32AEC124BC3D1D64756E2164756E21
15429
+ //# debugId=02EA2C04A14C82A864756E2164756E21
15400
15430
  //# sourceMappingURL=index.js.map