meno-core 1.0.42 → 1.0.44
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/build-astro.ts +2 -1
- package/build-static.ts +2 -0
- package/dist/bin/cli.js +1 -1
- package/dist/build-static.js +7 -7
- package/dist/chunks/{chunk-UGHOL7IP.js → chunk-3XXLBUYA.js} +23 -26
- package/dist/chunks/chunk-3XXLBUYA.js.map +7 -0
- package/dist/chunks/{chunk-LIHJ6OUH.js → chunk-46AVQA4V.js} +2 -2
- package/dist/chunks/{chunk-YM5BJZYJ.js → chunk-5TJA272J.js} +12 -8
- package/dist/chunks/chunk-5TJA272J.js.map +7 -0
- package/dist/chunks/{chunk-DIYO4RBJ.js → chunk-BXB6AX76.js} +2 -7
- package/dist/chunks/{chunk-DIYO4RBJ.js.map → chunk-BXB6AX76.js.map} +2 -2
- package/dist/chunks/{chunk-ACK7AURE.js → chunk-G3WIPJN3.js} +7 -5
- package/dist/chunks/chunk-G3WIPJN3.js.map +7 -0
- package/dist/chunks/{chunk-ITVPRBD6.js → chunk-KPNSCQNA.js} +37 -21
- package/dist/chunks/chunk-KPNSCQNA.js.map +7 -0
- package/dist/chunks/{chunk-6AYGKR6Y.js → chunk-OLNQMCSR.js} +3 -3
- package/dist/chunks/{chunk-PGH3ATYI.js → chunk-X5SH4HXS.js} +88 -2
- package/dist/chunks/{chunk-PGH3ATYI.js.map → chunk-X5SH4HXS.js.map} +3 -3
- package/dist/chunks/{chunk-24KKYW25.js → chunk-YEJVSNVF.js} +21 -2
- package/dist/chunks/chunk-YEJVSNVF.js.map +7 -0
- package/dist/chunks/{configService-KK5JEQOZ.js → configService-KYO3TXDS.js} +3 -3
- package/dist/chunks/{constants-JOIPAAAA.js → constants-34NUGHQR.js} +2 -2
- package/dist/entries/server-router.js +8 -8
- package/dist/lib/client/index.js +29 -7
- package/dist/lib/client/index.js.map +3 -3
- package/dist/lib/server/index.js +11 -10
- package/dist/lib/server/index.js.map +2 -2
- package/dist/lib/shared/index.js +18 -4
- package/dist/lib/shared/index.js.map +2 -2
- package/dist/lib/test-utils/index.js +1 -1
- package/lib/client/responsiveStyleResolver.ts +31 -1
- package/lib/client/styles/StyleInjector.ts +3 -2
- package/lib/client/styles/UtilityClassCollector.ts +3 -2
- package/lib/server/routes/pages.ts +4 -0
- package/lib/server/services/configService.ts +25 -0
- package/lib/server/services/pageService.ts +1 -1
- package/lib/server/ssr/htmlGenerator.ts +20 -6
- package/lib/server/ssr/ssrRenderer.test.ts +8 -7
- package/lib/server/ssr/ssrRenderer.ts +4 -21
- package/lib/shared/constants.ts +1 -3
- package/lib/shared/cssGeneration.ts +30 -14
- package/lib/shared/index.ts +3 -0
- package/lib/shared/pxToRem.test.ts +115 -0
- package/lib/shared/pxToRem.ts +77 -0
- package/lib/shared/types/api.ts +14 -0
- package/lib/shared/types/index.ts +1 -0
- package/lib/shared/validation/schemas.ts +8 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-24KKYW25.js.map +0 -7
- package/dist/chunks/chunk-ACK7AURE.js.map +0 -7
- package/dist/chunks/chunk-ITVPRBD6.js.map +0 -7
- package/dist/chunks/chunk-UGHOL7IP.js.map +0 -7
- package/dist/chunks/chunk-YM5BJZYJ.js.map +0 -7
- /package/dist/chunks/{chunk-LIHJ6OUH.js.map → chunk-46AVQA4V.js.map} +0 -0
- /package/dist/chunks/{chunk-6AYGKR6Y.js.map → chunk-OLNQMCSR.js.map} +0 -0
- /package/dist/chunks/{configService-KK5JEQOZ.js.map → configService-KYO3TXDS.js.map} +0 -0
- /package/dist/chunks/{constants-JOIPAAAA.js.map → constants-34NUGHQR.js.map} +0 -0
package/build-astro.ts
CHANGED
|
@@ -661,7 +661,8 @@ export async function buildAstroProject(
|
|
|
661
661
|
const fontCSS = generateFontCSS();
|
|
662
662
|
const themeColorCSS = generateThemeColorVariablesCSS(themeConfig);
|
|
663
663
|
const variablesCSS = generateVariablesCSS(variablesConfig, breakpoints, responsiveScales);
|
|
664
|
-
const
|
|
664
|
+
const remConversionConfig = configService.getRemConversion();
|
|
665
|
+
const interactiveCSS = generateAllInteractiveCSS(allInteractiveStyles, breakpoints, remConversionConfig);
|
|
665
666
|
const componentCSSCombined = Array.from(allComponentCSS).join('\n');
|
|
666
667
|
|
|
667
668
|
const baseCSS = `@layer base {
|
package/build-static.ts
CHANGED
|
@@ -454,6 +454,7 @@ async function buildCMSTemplates(
|
|
|
454
454
|
cmsService,
|
|
455
455
|
returnSeparateJS: true,
|
|
456
456
|
pageLibraries: pageData.meta?.libraries,
|
|
457
|
+
pageCustomCode: pageData.meta?.customCode,
|
|
457
458
|
clientDataCollections,
|
|
458
459
|
isProductionBuild: true,
|
|
459
460
|
}) as SSRHTMLResult;
|
|
@@ -876,6 +877,7 @@ export async function buildStaticPages(): Promise<void> {
|
|
|
876
877
|
cmsService,
|
|
877
878
|
returnSeparateJS: true,
|
|
878
879
|
pageLibraries: pageData.meta?.libraries,
|
|
880
|
+
pageCustomCode: pageData.meta?.customCode,
|
|
879
881
|
isProductionBuild: true,
|
|
880
882
|
}) as SSRHTMLResult;
|
|
881
883
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -82,7 +82,7 @@ function getMatchingHeaders(pathname, headersMap) {
|
|
|
82
82
|
return result;
|
|
83
83
|
}
|
|
84
84
|
async function startStaticServer(distPath) {
|
|
85
|
-
const { SERVE_PORT } = await import("../chunks/constants-
|
|
85
|
+
const { SERVE_PORT } = await import("../chunks/constants-34NUGHQR.js");
|
|
86
86
|
const headersMap = parseHeadersFile(distPath);
|
|
87
87
|
const server = await createRuntimeServer({
|
|
88
88
|
port: SERVE_PORT,
|
package/dist/build-static.js
CHANGED
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
hashContent,
|
|
10
10
|
injectTrackingScript,
|
|
11
11
|
isCMSPage
|
|
12
|
-
} from "./chunks/chunk-
|
|
13
|
-
import "./chunks/chunk-
|
|
14
|
-
import "./chunks/chunk-
|
|
12
|
+
} from "./chunks/chunk-G3WIPJN3.js";
|
|
13
|
+
import "./chunks/chunk-3XXLBUYA.js";
|
|
14
|
+
import "./chunks/chunk-YEJVSNVF.js";
|
|
15
15
|
import "./chunks/chunk-5Z5VQRTJ.js";
|
|
16
16
|
import "./chunks/chunk-WQFG7PAH.js";
|
|
17
17
|
import "./chunks/chunk-S2HXJTAF.js";
|
|
18
|
-
import "./chunks/chunk-
|
|
19
|
-
import "./chunks/chunk-
|
|
20
|
-
import "./chunks/chunk-
|
|
18
|
+
import "./chunks/chunk-OLNQMCSR.js";
|
|
19
|
+
import "./chunks/chunk-KPNSCQNA.js";
|
|
20
|
+
import "./chunks/chunk-X5SH4HXS.js";
|
|
21
21
|
import "./chunks/chunk-UB44F4Z2.js";
|
|
22
|
-
import "./chunks/chunk-
|
|
22
|
+
import "./chunks/chunk-BXB6AX76.js";
|
|
23
23
|
import "./chunks/chunk-KSBZ2L7C.js";
|
|
24
24
|
export {
|
|
25
25
|
buildCMSItemPath,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YEJVSNVF.js";
|
|
4
4
|
import {
|
|
5
5
|
projectPaths,
|
|
6
6
|
resolveProjectPath,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
processStructure,
|
|
24
24
|
resolveHtmlMapping,
|
|
25
25
|
skipEmptyTemplateAttributes
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OLNQMCSR.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_PREFETCH_CONFIG,
|
|
29
29
|
SSRRegistry,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
singularize,
|
|
63
63
|
validateCMSItem,
|
|
64
64
|
validateComponentDefinition
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-KPNSCQNA.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_BREAKPOINTS,
|
|
68
68
|
DEFAULT_I18N_CONFIG,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
normalizeBreakpointConfig,
|
|
75
75
|
resolveI18nValue,
|
|
76
76
|
scalePropertyValue
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-X5SH4HXS.js";
|
|
78
78
|
import {
|
|
79
79
|
isTiptapDocument,
|
|
80
80
|
tiptapToHtml
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
NODE_TYPE,
|
|
84
84
|
RAW_HTML_PREFIX,
|
|
85
85
|
init_constants
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-BXB6AX76.js";
|
|
87
87
|
import {
|
|
88
88
|
__require
|
|
89
89
|
} from "./chunk-KSBZ2L7C.js";
|
|
@@ -2756,12 +2756,7 @@ function renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx) {
|
|
|
2756
2756
|
const fetchpriority = imgProps.fetchpriority;
|
|
2757
2757
|
let width = imgProps.width;
|
|
2758
2758
|
let height = imgProps.height;
|
|
2759
|
-
const originalHeight = height;
|
|
2760
2759
|
const metadata = src ? ctx.imageMetadataMap?.get(src) : void 0;
|
|
2761
|
-
if (metadata) {
|
|
2762
|
-
if (width === void 0 && metadata.width) width = metadata.width;
|
|
2763
|
-
if (height === void 0 && metadata.height) height = metadata.height;
|
|
2764
|
-
}
|
|
2765
2760
|
const sizesAttr = sizes || DEFAULT_SIZES;
|
|
2766
2761
|
if (fetchpriority === "high" && metadata && ctx.preloadImages) {
|
|
2767
2762
|
if (metadata.avifSrcset && ctx.imageFormat !== "webp") {
|
|
@@ -2785,14 +2780,6 @@ function renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx) {
|
|
|
2785
2780
|
if (loading) imgAttrs += ` loading="${escapeHtml(String(loading))}"`;
|
|
2786
2781
|
if (width !== void 0) imgAttrs += ` width="${escapeHtml(String(width))}"`;
|
|
2787
2782
|
if (height !== void 0) imgAttrs += ` height="${escapeHtml(String(height))}"`;
|
|
2788
|
-
const needsHeightAuto = originalHeight === void 0 && height !== void 0;
|
|
2789
|
-
let blurStyle = "";
|
|
2790
|
-
if (metadata?.blurHash) {
|
|
2791
|
-
const heightAuto = needsHeightAuto ? "height: auto; " : "";
|
|
2792
|
-
blurStyle = ` style="${heightAuto}background-image: url(${escapeHtml(metadata.blurHash)}); background-size: cover;" onload="this.style.backgroundImage=''"`;
|
|
2793
|
-
} else if (needsHeightAuto) {
|
|
2794
|
-
blurStyle = ` style="height: auto;"`;
|
|
2795
|
-
}
|
|
2796
2783
|
if (metadata?.avifSrcset && ctx.imageFormat !== "webp") {
|
|
2797
2784
|
const imgClassPrefixes = [
|
|
2798
2785
|
"objf-",
|
|
@@ -2822,13 +2809,13 @@ function renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx) {
|
|
|
2822
2809
|
}
|
|
2823
2810
|
const pictureClassAttr = pictureClasses.length > 0 ? ` class="${escapeHtml(pictureClasses.join(" "))}"` : "";
|
|
2824
2811
|
const imgClassAttr = imgClasses.length > 0 ? ` class="${escapeHtml(imgClasses.join(" "))}"` : "";
|
|
2825
|
-
return `<picture${pictureClassAttr}><source type="image/avif" srcset="${escapeHtml(metadata.avifSrcset)}" sizes="${escapeHtml(sizesAttr)}" /><source type="image/webp" srcset="${escapeHtml(metadata.srcset)}" sizes="${escapeHtml(sizesAttr)}" /><img${imgClassAttr}${imgAttrs}${
|
|
2812
|
+
return `<picture${pictureClassAttr}><source type="image/avif" srcset="${escapeHtml(metadata.avifSrcset)}" sizes="${escapeHtml(sizesAttr)}" /><source type="image/webp" srcset="${escapeHtml(metadata.srcset)}" sizes="${escapeHtml(sizesAttr)}" /><img${imgClassAttr}${imgAttrs}${attrs} /></picture>`;
|
|
2826
2813
|
}
|
|
2827
2814
|
if (metadata?.srcset) {
|
|
2828
2815
|
imgAttrs += ` srcset="${escapeHtml(metadata.srcset)}"`;
|
|
2829
2816
|
imgAttrs += ` sizes="${escapeHtml(sizesAttr)}"`;
|
|
2830
2817
|
}
|
|
2831
|
-
return `<img${classAttr}${imgAttrs}${
|
|
2818
|
+
return `<img${classAttr}${imgAttrs}${attrs} />`;
|
|
2832
2819
|
}
|
|
2833
2820
|
function renderLocaleList(node, ctx) {
|
|
2834
2821
|
const { slugMappings, pagePath, i18nConfig, locale } = ctx;
|
|
@@ -3303,6 +3290,7 @@ async function generateSSRHTML(pageDataOrOptions, globalComponents = {}, pagePat
|
|
|
3303
3290
|
cmsTemplatePath,
|
|
3304
3291
|
returnSeparateJS = false,
|
|
3305
3292
|
pageLibraries,
|
|
3293
|
+
pageCustomCode,
|
|
3306
3294
|
clientDataCollections,
|
|
3307
3295
|
injectLiveReload = false,
|
|
3308
3296
|
isEditor = false,
|
|
@@ -3338,6 +3326,12 @@ async function generateSSRHTML(pageDataOrOptions, globalComponents = {}, pagePat
|
|
|
3338
3326
|
}
|
|
3339
3327
|
await configService.load();
|
|
3340
3328
|
const globalLibraries = configService.getLibraries() || { js: [], css: [] };
|
|
3329
|
+
const globalCustomCode = configService.getCustomCode();
|
|
3330
|
+
const mergedCustomCode = {
|
|
3331
|
+
head: [globalCustomCode.head, pageCustomCode?.head].filter(Boolean).join("\n"),
|
|
3332
|
+
bodyStart: [globalCustomCode.bodyStart, pageCustomCode?.bodyStart].filter(Boolean).join("\n"),
|
|
3333
|
+
bodyEnd: [globalCustomCode.bodyEnd, pageCustomCode?.bodyEnd].filter(Boolean).join("\n")
|
|
3334
|
+
};
|
|
3341
3335
|
const componentLibraries = collectComponentLibraries(components, pageData.components || {});
|
|
3342
3336
|
const globalPlusComponent = mergeLibraries(globalLibraries, componentLibraries) || { js: [], css: [] };
|
|
3343
3337
|
const mergedRaw = mergeLibraries(globalPlusComponent, pageLibraries) || { js: [], css: [] };
|
|
@@ -3418,8 +3412,9 @@ ${escapedJavaScript}
|
|
|
3418
3412
|
const responsiveScalesConfig = await loadResponsiveScalesConfig();
|
|
3419
3413
|
const variablesConfig = await variableService.loadConfig();
|
|
3420
3414
|
const variablesCSS = generateVariablesCSS(variablesConfig, breakpointConfig, responsiveScalesConfig);
|
|
3421
|
-
const
|
|
3422
|
-
const
|
|
3415
|
+
const remConversionConfig = configService.getRemConversion();
|
|
3416
|
+
const utilityCSS = generateUtilityCSS(usedUtilityClasses, breakpointConfig, responsiveScalesConfig, remConversionConfig);
|
|
3417
|
+
const interactiveCSS = rendered.interactiveStylesMap.size > 0 ? generateAllInteractiveCSS(rendered.interactiveStylesMap, breakpointConfig, remConversionConfig) : "";
|
|
3423
3418
|
printMissingStyleWarnings(false);
|
|
3424
3419
|
const baseCSS = `* {
|
|
3425
3420
|
margin: 0;
|
|
@@ -3446,6 +3441,8 @@ picture {
|
|
|
3446
3441
|
}
|
|
3447
3442
|
.oem {
|
|
3448
3443
|
display: inline-block;
|
|
3444
|
+
vertical-align: top;
|
|
3445
|
+
line-height: 0;
|
|
3449
3446
|
}`;
|
|
3450
3447
|
const combinedCSS = [
|
|
3451
3448
|
fontCSS,
|
|
@@ -3487,13 +3484,13 @@ picture {
|
|
|
3487
3484
|
<meta charset="UTF-8">
|
|
3488
3485
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3489
3486
|
${iconTags ? iconTags + "\n " : ""}${scriptPreloadTag ? scriptPreloadTag + "\n " : ""}${imagePreloadTags ? imagePreloadTags + "\n " : ""}${fontPreloadTags ? fontPreloadTags + "\n " : ""}${libraryTags.headCSS ? libraryTags.headCSS + "\n " : ""}${libraryTags.headJS ? libraryTags.headJS + "\n " : ""}${rendered.meta}
|
|
3490
|
-
${configInlineScript}${cmsInlineScript}${clientDataScripts}<style id="meno-styles">${styleContent}</style
|
|
3487
|
+
${configInlineScript}${cmsInlineScript}${clientDataScripts}<style id="meno-styles">${styleContent}</style>${mergedCustomCode.head ? "\n " + mergedCustomCode.head : ""}
|
|
3491
3488
|
</head>
|
|
3492
|
-
<body
|
|
3489
|
+
<body>${mergedCustomCode.bodyStart ? "\n " + mergedCustomCode.bodyStart : ""}
|
|
3493
3490
|
<div id="root">
|
|
3494
3491
|
${rendered.html}
|
|
3495
3492
|
</div>
|
|
3496
|
-
${clientScript}${componentScript}${libraryTags.bodyEndJS ? "\n " + libraryTags.bodyEndJS : ""}${liveReloadScript ? "\n " + liveReloadScript : ""}${scrollHandlerScript ? "\n " + scrollHandlerScript : ""}
|
|
3493
|
+
${clientScript}${componentScript}${libraryTags.bodyEndJS ? "\n " + libraryTags.bodyEndJS : ""}${liveReloadScript ? "\n " + liveReloadScript : ""}${scrollHandlerScript ? "\n " + scrollHandlerScript : ""}${mergedCustomCode.bodyEnd ? "\n " + mergedCustomCode.bodyEnd : ""}
|
|
3497
3494
|
</body>
|
|
3498
3495
|
</html>`;
|
|
3499
3496
|
if (returnSeparateJS) {
|
|
@@ -5967,4 +5964,4 @@ export {
|
|
|
5967
5964
|
FileSystemCMSProvider,
|
|
5968
5965
|
migrateTemplatesDirectory
|
|
5969
5966
|
};
|
|
5970
|
-
//# sourceMappingURL=chunk-
|
|
5967
|
+
//# sourceMappingURL=chunk-3XXLBUYA.js.map
|