meno-core 1.0.45 → 1.0.46
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 +214 -63
- package/dist/bin/cli.js +2 -2
- package/dist/build-static.js +7 -7
- package/dist/chunks/{chunk-NZTSJS5C.js → chunk-2QK6U5UK.js} +3 -2
- package/dist/chunks/{chunk-NZTSJS5C.js.map → chunk-2QK6U5UK.js.map} +2 -2
- package/dist/chunks/{chunk-BZQKEJQY.js → chunk-77ZB6353.js} +29 -18
- package/dist/chunks/chunk-77ZB6353.js.map +7 -0
- package/dist/chunks/{chunk-TVH3TC2T.js → chunk-C6U5T5S5.js} +6 -6
- package/dist/chunks/{chunk-5ZASE4IG.js → chunk-FED5MME6.js} +234 -11
- package/dist/chunks/{chunk-5ZASE4IG.js.map → chunk-FED5MME6.js.map} +3 -3
- package/dist/chunks/{chunk-5Z5VQRTJ.js → chunk-I7YIGZXT.js} +4 -4
- package/dist/chunks/{chunk-5Z5VQRTJ.js.map → chunk-I7YIGZXT.js.map} +2 -2
- package/dist/chunks/{chunk-OUNJ76QM.js → chunk-ORN7S4AP.js} +5 -5
- package/dist/chunks/{chunk-GYF3ABI3.js → chunk-UUA5LEWF.js} +3 -3
- package/dist/chunks/{chunk-GYF3ABI3.js.map → chunk-UUA5LEWF.js.map} +2 -2
- package/dist/chunks/{chunk-WQSG5WHC.js → chunk-ZTKHJQ2Z.js} +2 -2
- package/dist/chunks/{chunk-F7MA62WG.js → chunk-ZWYDT3QJ.js} +3 -3
- package/dist/chunks/{configService-6KTT6GRT.js → configService-DYCUEURL.js} +3 -3
- package/dist/chunks/{constants-L5IKLB6U.js → constants-GWBAD66U.js} +2 -2
- package/dist/entries/server-router.js +7 -7
- package/dist/lib/client/index.js +4 -4
- package/dist/lib/server/index.js +586 -142
- package/dist/lib/server/index.js.map +3 -3
- package/dist/lib/shared/index.js +7 -3
- package/dist/lib/shared/index.js.map +2 -2
- package/dist/lib/test-utils/index.js +1 -1
- package/lib/client/templateEngine.test.ts +64 -0
- package/lib/server/astro/astroEmitHelpers.ts +18 -0
- package/lib/server/astro/cmsPageEmitter.ts +31 -1
- package/lib/server/astro/componentEmitter.test.ts +59 -0
- package/lib/server/astro/componentEmitter.ts +43 -10
- package/lib/server/astro/cssCollector.ts +58 -11
- package/lib/server/astro/nodeToAstro.test.ts +397 -5
- package/lib/server/astro/nodeToAstro.ts +478 -63
- package/lib/server/astro/pageEmitter.ts +31 -1
- package/lib/server/astro/tailwindMapper.test.ts +119 -0
- package/lib/server/astro/tailwindMapper.ts +67 -1
- package/lib/server/runtime/httpServer.ts +12 -4
- package/lib/server/ssr/htmlGenerator.ts +1 -1
- package/lib/server/ssr/jsCollector.ts +2 -2
- package/lib/server/ssr/ssrRenderer.test.ts +32 -0
- package/lib/server/ssr/ssrRenderer.ts +26 -11
- package/lib/shared/constants.ts +1 -0
- package/lib/shared/cssGeneration.test.ts +109 -3
- package/lib/shared/cssGeneration.ts +98 -13
- package/lib/shared/cssNamedColors.ts +47 -0
- package/lib/shared/cssProperties.ts +2 -2
- package/lib/shared/index.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-BZQKEJQY.js.map +0 -7
- /package/dist/chunks/{chunk-TVH3TC2T.js.map → chunk-C6U5T5S5.js.map} +0 -0
- /package/dist/chunks/{chunk-OUNJ76QM.js.map → chunk-ORN7S4AP.js.map} +0 -0
- /package/dist/chunks/{chunk-WQSG5WHC.js.map → chunk-ZTKHJQ2Z.js.map} +0 -0
- /package/dist/chunks/{chunk-F7MA62WG.js.map → chunk-ZWYDT3QJ.js.map} +0 -0
- /package/dist/chunks/{configService-6KTT6GRT.js.map → configService-DYCUEURL.js.map} +0 -0
- /package/dist/chunks/{constants-L5IKLB6U.js.map → constants-GWBAD66U.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZTKHJQ2Z.js";
|
|
4
4
|
import {
|
|
5
5
|
projectPaths,
|
|
6
6
|
resolveProjectPath,
|
|
7
7
|
validateJS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I7YIGZXT.js";
|
|
9
9
|
import {
|
|
10
10
|
fileExists,
|
|
11
11
|
readJsonFile,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
processStructure,
|
|
24
24
|
resolveHtmlMapping,
|
|
25
25
|
skipEmptyTemplateAttributes
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZWYDT3QJ.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-FED5MME6.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_BREAKPOINTS,
|
|
68
68
|
DEFAULT_I18N_CONFIG,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
NODE_TYPE,
|
|
84
84
|
RAW_HTML_PREFIX,
|
|
85
85
|
init_constants
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-2QK6U5UK.js";
|
|
87
87
|
import {
|
|
88
88
|
__require
|
|
89
89
|
} from "./chunk-KSBZ2L7C.js";
|
|
@@ -1663,7 +1663,9 @@ __meno.initComponent("${name}", function(el, props) {
|
|
|
1663
1663
|
});`);
|
|
1664
1664
|
} else {
|
|
1665
1665
|
jsCodeBlocks.push(`// Component: ${name}
|
|
1666
|
-
|
|
1666
|
+
(function(){
|
|
1667
|
+
${js}
|
|
1668
|
+
})();`);
|
|
1667
1669
|
}
|
|
1668
1670
|
};
|
|
1669
1671
|
for (const [name, component] of Object.entries(globalComponents)) {
|
|
@@ -2071,7 +2073,8 @@ async function buildComponentHTML(node, globalComponents = {}, pageComponents =
|
|
|
2071
2073
|
const preloadImages = [];
|
|
2072
2074
|
const neededCollections = /* @__PURE__ */ new Set();
|
|
2073
2075
|
const ssrFallbackCollector = /* @__PURE__ */ new Map();
|
|
2074
|
-
|
|
2076
|
+
const processedRawHtmlCollector = /* @__PURE__ */ new Map();
|
|
2077
|
+
if (!node) return { html: "", interactiveStylesMap, preloadImages, neededCollections, ssrFallbackCollector, processedRawHtmlCollector };
|
|
2075
2078
|
ssrComponentRegistry.merge(globalComponents);
|
|
2076
2079
|
ssrComponentRegistry.merge(pageComponents);
|
|
2077
2080
|
const breakpoints = await loadBreakpointConfig();
|
|
@@ -2098,10 +2101,12 @@ async function buildComponentHTML(node, globalComponents = {}, pageComponents =
|
|
|
2098
2101
|
isProductionBuild,
|
|
2099
2102
|
ssrFallbackCollector,
|
|
2100
2103
|
// Collect SSR fallback HTML for complex nodes
|
|
2104
|
+
processedRawHtmlCollector,
|
|
2105
|
+
// Collect raw→processed HTML for Astro exporter
|
|
2101
2106
|
imageFormat: configService.getImageFormat()
|
|
2102
2107
|
};
|
|
2103
2108
|
const html = await renderNode(node, ctx);
|
|
2104
|
-
return { html, interactiveStylesMap, preloadImages, neededCollections, ssrFallbackCollector };
|
|
2109
|
+
return { html, interactiveStylesMap, preloadImages, neededCollections, ssrFallbackCollector, processedRawHtmlCollector };
|
|
2105
2110
|
}
|
|
2106
2111
|
async function renderNestedListPlaceholder(node, ctx) {
|
|
2107
2112
|
const sourceValue = node.source || node.collection;
|
|
@@ -2339,10 +2344,12 @@ async function renderNode(node, ctx) {
|
|
|
2339
2344
|
text = processCMSTemplate(text, ctx.cmsContext.cms, locale, i18nConfig);
|
|
2340
2345
|
}
|
|
2341
2346
|
if (text.startsWith(RAW_HTML_PREFIX)) {
|
|
2342
|
-
|
|
2347
|
+
const rawSlice = text.slice(RAW_HTML_PREFIX.length);
|
|
2348
|
+
let rawHtml = rawSlice;
|
|
2343
2349
|
if (ctx.imageMetadataMap) rawHtml = rewriteRichTextImages(rawHtml, ctx.imageMetadataMap, ctx.imageFormat);
|
|
2344
2350
|
rawHtml = await expandRichTextComponents(rawHtml, ctx);
|
|
2345
2351
|
rawHtml = localizeRichTextLinks(rawHtml, ctx);
|
|
2352
|
+
ctx.processedRawHtmlCollector?.set(rawSlice, rawHtml);
|
|
2346
2353
|
return rawHtml;
|
|
2347
2354
|
}
|
|
2348
2355
|
return escapeHtml(text);
|
|
@@ -2355,10 +2362,12 @@ async function renderNode(node, ctx) {
|
|
|
2355
2362
|
text = processCMSTemplate(text, ctx.cmsContext.cms, locale, i18nConfig);
|
|
2356
2363
|
}
|
|
2357
2364
|
if (text.startsWith(RAW_HTML_PREFIX)) {
|
|
2358
|
-
|
|
2365
|
+
const rawSlice = text.slice(RAW_HTML_PREFIX.length);
|
|
2366
|
+
let rawHtml = rawSlice;
|
|
2359
2367
|
if (ctx.imageMetadataMap) rawHtml = rewriteRichTextImages(rawHtml, ctx.imageMetadataMap, ctx.imageFormat);
|
|
2360
2368
|
rawHtml = await expandRichTextComponents(rawHtml, ctx);
|
|
2361
2369
|
rawHtml = localizeRichTextLinks(rawHtml, ctx);
|
|
2370
|
+
ctx.processedRawHtmlCollector?.set(rawSlice, rawHtml);
|
|
2362
2371
|
return rawHtml;
|
|
2363
2372
|
}
|
|
2364
2373
|
return escapeHtml(text);
|
|
@@ -2741,13 +2750,13 @@ async function renderHtmlElement(tag, propsWithStyleAndAttrs, children, ctx) {
|
|
|
2741
2750
|
const voidElements = ["img", "input", "br", "hr", "meta", "link", "area", "base", "col", "embed", "source", "track", "wbr"];
|
|
2742
2751
|
if (voidElements.includes(tag.toLowerCase())) {
|
|
2743
2752
|
if (tag.toLowerCase() === "img") {
|
|
2744
|
-
return renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx);
|
|
2753
|
+
return renderImageElement(propsWithStyleAndAttrs, classAttr, styleAttr, attrs, ctx);
|
|
2745
2754
|
}
|
|
2746
2755
|
return `<${tag}${classAttr}${styleAttr}${attrs} />`;
|
|
2747
2756
|
}
|
|
2748
2757
|
return `<${tag}${classAttr}${styleAttr}${attrs}>${childrenHTML}</${tag}>`;
|
|
2749
2758
|
}
|
|
2750
|
-
function renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx) {
|
|
2759
|
+
function renderImageElement(propsWithStyleAndAttrs, classAttr, styleAttr, attrs, ctx) {
|
|
2751
2760
|
const imgProps = propsWithStyleAndAttrs;
|
|
2752
2761
|
const src = imgProps.src;
|
|
2753
2762
|
const alt = imgProps.alt;
|
|
@@ -2809,13 +2818,13 @@ function renderImageElement(propsWithStyleAndAttrs, classAttr, attrs, ctx) {
|
|
|
2809
2818
|
}
|
|
2810
2819
|
const pictureClassAttr = pictureClasses.length > 0 ? ` class="${escapeHtml(pictureClasses.join(" "))}"` : "";
|
|
2811
2820
|
const imgClassAttr = imgClasses.length > 0 ? ` class="${escapeHtml(imgClasses.join(" "))}"` : "";
|
|
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>`;
|
|
2821
|
+
return `<picture${pictureClassAttr}${styleAttr}><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>`;
|
|
2813
2822
|
}
|
|
2814
2823
|
if (metadata?.srcset) {
|
|
2815
2824
|
imgAttrs += ` srcset="${escapeHtml(metadata.srcset)}"`;
|
|
2816
2825
|
imgAttrs += ` sizes="${escapeHtml(sizesAttr)}"`;
|
|
2817
2826
|
}
|
|
2818
|
-
return `<img${classAttr}${imgAttrs}${attrs} />`;
|
|
2827
|
+
return `<img${classAttr}${styleAttr}${imgAttrs}${attrs} />`;
|
|
2819
2828
|
}
|
|
2820
2829
|
function renderLocaleList(node, ctx) {
|
|
2821
2830
|
const { slugMappings, pagePath, i18nConfig, locale } = ctx;
|
|
@@ -2933,7 +2942,7 @@ async function renderPageSSR(pageData, globalComponents = {}, pagePath = "/", ba
|
|
|
2933
2942
|
}
|
|
2934
2943
|
}
|
|
2935
2944
|
const pageComponents = pageData?.components || {};
|
|
2936
|
-
const { html: contentHTML, interactiveStylesMap, preloadImages, neededCollections, ssrFallbackCollector } = rootNode ? await buildComponentHTML(rootNode, globalComponents, pageComponents, effectiveLocale, config, slugMappings, pagePath, cmsContext, cmsService, isProductionBuild) : { html: "", interactiveStylesMap: /* @__PURE__ */ new Map(), preloadImages: [], neededCollections: /* @__PURE__ */ new Set(), ssrFallbackCollector: /* @__PURE__ */ new Map() };
|
|
2945
|
+
const { html: contentHTML, interactiveStylesMap, preloadImages, neededCollections, ssrFallbackCollector, processedRawHtmlCollector } = rootNode ? await buildComponentHTML(rootNode, globalComponents, pageComponents, effectiveLocale, config, slugMappings, pagePath, cmsContext, cmsService, isProductionBuild) : { html: "", interactiveStylesMap: /* @__PURE__ */ new Map(), preloadImages: [], neededCollections: /* @__PURE__ */ new Set(), ssrFallbackCollector: /* @__PURE__ */ new Map(), processedRawHtmlCollector: /* @__PURE__ */ new Map() };
|
|
2937
2946
|
const javascript = await collectComponentJavaScript(globalComponents, pageComponents);
|
|
2938
2947
|
const componentCSS = collectComponentCSS(globalComponents, pageComponents);
|
|
2939
2948
|
const fullUrl = baseUrl ? `${baseUrl}${pagePath}` : pagePath;
|
|
@@ -2954,7 +2963,8 @@ async function renderPageSSR(pageData, globalComponents = {}, pagePath = "/", ba
|
|
|
2954
2963
|
interactiveStylesMap,
|
|
2955
2964
|
preloadImages,
|
|
2956
2965
|
neededCollections,
|
|
2957
|
-
ssrFallbackCollector
|
|
2966
|
+
ssrFallbackCollector,
|
|
2967
|
+
processedRawHtmlCollector
|
|
2958
2968
|
};
|
|
2959
2969
|
}
|
|
2960
2970
|
|
|
@@ -3415,7 +3425,7 @@ ${escapedJavaScript}
|
|
|
3415
3425
|
const variablesCSS = generateVariablesCSS(variablesConfig, breakpointConfig, responsiveScalesConfig);
|
|
3416
3426
|
const remConversionConfig = configService.getRemConversion();
|
|
3417
3427
|
const utilityCSS = generateUtilityCSS(usedUtilityClasses, breakpointConfig, responsiveScalesConfig, remConversionConfig);
|
|
3418
|
-
const interactiveCSS = rendered.interactiveStylesMap.size > 0 ? generateAllInteractiveCSS(rendered.interactiveStylesMap, breakpointConfig, remConversionConfig) : "";
|
|
3428
|
+
const interactiveCSS = rendered.interactiveStylesMap.size > 0 ? generateAllInteractiveCSS(rendered.interactiveStylesMap, breakpointConfig, remConversionConfig, responsiveScalesConfig) : "";
|
|
3419
3429
|
printMissingStyleWarnings(false);
|
|
3420
3430
|
const baseCSS = `* {
|
|
3421
3431
|
margin: 0;
|
|
@@ -5919,6 +5929,7 @@ export {
|
|
|
5919
5929
|
loadBreakpointConfig,
|
|
5920
5930
|
loadResponsiveScalesConfig,
|
|
5921
5931
|
loadI18nConfig,
|
|
5932
|
+
loadIconsConfig,
|
|
5922
5933
|
CachedConfigLoader,
|
|
5923
5934
|
ColorService,
|
|
5924
5935
|
colorService,
|
|
@@ -5965,4 +5976,4 @@ export {
|
|
|
5965
5976
|
FileSystemCMSProvider,
|
|
5966
5977
|
migrateTemplatesDirectory
|
|
5967
5978
|
};
|
|
5968
|
-
//# sourceMappingURL=chunk-
|
|
5979
|
+
//# sourceMappingURL=chunk-77ZB6353.js.map
|