meno-core 1.0.48 → 1.0.49
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/build-static.js +7 -7
- package/dist/chunks/{chunk-UUA5LEWF.js → chunk-6IVUG7FY.js} +138 -7
- package/dist/chunks/chunk-6IVUG7FY.js.map +7 -0
- package/dist/chunks/{chunk-B2RTLDXY.js → chunk-AZQYF6KE.js} +132 -1
- package/dist/chunks/chunk-AZQYF6KE.js.map +7 -0
- package/dist/chunks/{chunk-NKUV77SR.js → chunk-CHD5UCFF.js} +21 -9
- package/dist/chunks/{chunk-NKUV77SR.js.map → chunk-CHD5UCFF.js.map} +2 -2
- package/dist/chunks/{chunk-TPQ7APVQ.js → chunk-EQYDSPBB.js} +418 -62
- package/dist/chunks/chunk-EQYDSPBB.js.map +7 -0
- package/dist/chunks/{chunk-RQSTH2BS.js → chunk-H4JSCDNW.js} +2 -2
- package/dist/chunks/{chunk-EK4KESLU.js → chunk-J23ZX5AP.js} +8 -2
- package/dist/chunks/{chunk-EK4KESLU.js.map → chunk-J23ZX5AP.js.map} +2 -2
- package/dist/chunks/{chunk-D5E3OKSL.js → chunk-JER5NQVM.js} +5 -5
- package/dist/chunks/{chunk-BJRKEPMP.js → chunk-KPU2XHOS.js} +5 -2
- package/dist/chunks/{chunk-BJRKEPMP.js.map → chunk-KPU2XHOS.js.map} +2 -2
- package/dist/chunks/{chunk-NP76N4HQ.js → chunk-LKAGAQ3M.js} +2 -2
- package/dist/chunks/{chunk-3FHJUHAS.js → chunk-S2CX6HFM.js} +260 -25
- package/dist/chunks/chunk-S2CX6HFM.js.map +7 -0
- package/dist/chunks/{configService-IGJEC3MC.js → configService-CCA6AIDI.js} +3 -3
- package/dist/entries/server-router.js +9 -9
- package/dist/entries/server-router.js.map +2 -2
- package/dist/lib/client/index.js +54 -20
- package/dist/lib/client/index.js.map +3 -3
- package/dist/lib/server/index.js +9 -9
- package/dist/lib/shared/index.js +46 -10
- package/dist/lib/shared/index.js.map +3 -3
- package/entries/server-router.tsx +6 -2
- package/lib/client/core/ComponentBuilder.ts +8 -1
- package/lib/client/core/builders/embedBuilder.ts +15 -2
- package/lib/client/core/builders/linkNodeBuilder.ts +15 -2
- package/lib/client/core/builders/localeListBuilder.ts +17 -6
- package/lib/client/styles/StyleInjector.ts +3 -2
- package/lib/client/theme.ts +4 -4
- package/lib/server/cssGenerator.test.ts +64 -1
- package/lib/server/cssGenerator.ts +48 -9
- package/lib/server/providers/fileSystemCMSProvider.test.ts +163 -0
- package/lib/server/providers/fileSystemCMSProvider.ts +200 -11
- package/lib/server/routes/index.ts +1 -1
- package/lib/server/routes/pages.ts +23 -1
- package/lib/server/services/cmsService.test.ts +246 -0
- package/lib/server/services/cmsService.ts +122 -5
- package/lib/server/services/configService.ts +5 -0
- package/lib/server/ssr/attributeBuilder.ts +41 -0
- package/lib/server/ssr/htmlGenerator.test.ts +113 -0
- package/lib/server/ssr/htmlGenerator.ts +51 -4
- package/lib/server/ssr/liveReloadIntegration.test.ts +209 -0
- package/lib/server/ssr/ssrRenderer.test.ts +306 -0
- package/lib/server/ssr/ssrRenderer.ts +182 -44
- package/lib/shared/cssGeneration.test.ts +267 -1
- package/lib/shared/cssGeneration.ts +240 -18
- package/lib/shared/cssProperties.test.ts +247 -1
- package/lib/shared/cssProperties.ts +196 -6
- package/lib/shared/interfaces/contentProvider.ts +39 -6
- package/lib/shared/pathSecurity.ts +16 -0
- package/lib/shared/responsiveScaling.test.ts +143 -0
- package/lib/shared/responsiveScaling.ts +253 -2
- package/lib/shared/themeDefaults.test.ts +3 -3
- package/lib/shared/themeDefaults.ts +3 -3
- package/lib/shared/types/cms.ts +28 -3
- package/lib/shared/types/index.ts +1 -0
- package/lib/shared/utilityClassConfig.ts +3 -0
- package/lib/shared/utilityClassMapper.test.ts +123 -0
- package/lib/shared/utilityClassMapper.ts +179 -8
- package/lib/shared/validation/schemas.ts +15 -1
- package/lib/shared/validation/validators.ts +26 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-3FHJUHAS.js.map +0 -7
- package/dist/chunks/chunk-B2RTLDXY.js.map +0 -7
- package/dist/chunks/chunk-TPQ7APVQ.js.map +0 -7
- package/dist/chunks/chunk-UUA5LEWF.js.map +0 -7
- /package/dist/chunks/{chunk-RQSTH2BS.js.map → chunk-H4JSCDNW.js.map} +0 -0
- /package/dist/chunks/{chunk-D5E3OKSL.js.map → chunk-JER5NQVM.js.map} +0 -0
- /package/dist/chunks/{chunk-NP76N4HQ.js.map → chunk-LKAGAQ3M.js.map} +0 -0
- /package/dist/chunks/{configService-IGJEC3MC.js.map → configService-CCA6AIDI.js.map} +0 -0
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
parseJSON,
|
|
16
16
|
resolveSlugToPageId,
|
|
17
17
|
variableService
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EQYDSPBB.js";
|
|
19
19
|
import {
|
|
20
20
|
configService
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KPU2XHOS.js";
|
|
22
22
|
import {
|
|
23
23
|
bundleFile,
|
|
24
24
|
createRuntimeServer,
|
|
@@ -38,16 +38,16 @@ import {
|
|
|
38
38
|
} from "./chunk-WQFG7PAH.js";
|
|
39
39
|
import {
|
|
40
40
|
extractStringValue
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-H4JSCDNW.js";
|
|
42
42
|
import {
|
|
43
43
|
isPathWithinRoot
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-J23ZX5AP.js";
|
|
45
45
|
import {
|
|
46
46
|
addItemUrls
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-S2CX6HFM.js";
|
|
48
48
|
import {
|
|
49
49
|
parseLocaleFromPath
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-AZQYF6KE.js";
|
|
51
51
|
import {
|
|
52
52
|
API_ROUTES,
|
|
53
53
|
HMR_ROUTE,
|
|
@@ -2633,9 +2633,11 @@ function hashContent2(content) {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
|
|
2635
2635
|
// lib/server/routes/pages.ts
|
|
2636
|
-
|
|
2636
|
+
var EDITOR_HEADER = "x-meno-editor";
|
|
2637
|
+
async function handlePageRoute(url, context, req) {
|
|
2637
2638
|
const { pageService, componentService, cmsService, injectLiveReload, isEditor, serverPort } = context;
|
|
2638
2639
|
const pagePath = url.pathname;
|
|
2640
|
+
const injectEditorAttrs = req?.headers.get(EDITOR_HEADER) === "1";
|
|
2639
2641
|
const i18nConfig = await loadI18nConfig();
|
|
2640
2642
|
const { locale, pathWithoutLocale } = parseLocaleFromPath(pagePath, i18nConfig);
|
|
2641
2643
|
const slugMappings = pageService.getSlugMappings();
|
|
@@ -2643,6 +2645,12 @@ async function handlePageRoute(url, context) {
|
|
|
2643
2645
|
if (cmsService) {
|
|
2644
2646
|
const cmsMatch = await cmsService.matchRoute(pathWithoutLocale, locale);
|
|
2645
2647
|
if (cmsMatch) {
|
|
2648
|
+
if (injectEditorAttrs && url.searchParams.get("previewDraft") === "1" && cmsMatch.item._filename) {
|
|
2649
|
+
const draft = await cmsService.getDraft(cmsMatch.collection, cmsMatch.item._filename);
|
|
2650
|
+
if (draft) {
|
|
2651
|
+
cmsMatch.item = draft;
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2646
2654
|
const templatePageContent = await loadPageByFilePath(cmsMatch.pagePath);
|
|
2647
2655
|
if (templatePageContent) {
|
|
2648
2656
|
const templatesDir = projectPaths.templates();
|
|
@@ -2667,6 +2675,7 @@ async function handlePageRoute(url, context) {
|
|
|
2667
2675
|
pageLibraries: typedPageData.meta?.libraries,
|
|
2668
2676
|
pageCustomCode: typedPageData.meta?.customCode,
|
|
2669
2677
|
injectLiveReload,
|
|
2678
|
+
injectEditorAttrs,
|
|
2670
2679
|
isEditor,
|
|
2671
2680
|
serverPort,
|
|
2672
2681
|
returnSeparateJS: true
|
|
@@ -2700,6 +2709,7 @@ async function handlePageRoute(url, context) {
|
|
|
2700
2709
|
cmsTemplatePath,
|
|
2701
2710
|
pageLibraries: typedPageData.meta?.libraries,
|
|
2702
2711
|
pageCustomCode: typedPageData.meta?.customCode,
|
|
2712
|
+
injectEditorAttrs,
|
|
2703
2713
|
isEditor
|
|
2704
2714
|
});
|
|
2705
2715
|
return new Response(ssrHTML, {
|
|
@@ -2760,6 +2770,7 @@ async function handlePageRoute(url, context) {
|
|
|
2760
2770
|
pageLibraries: pageData.meta?.libraries,
|
|
2761
2771
|
pageCustomCode: pageData.meta?.customCode,
|
|
2762
2772
|
injectLiveReload,
|
|
2773
|
+
injectEditorAttrs,
|
|
2763
2774
|
isEditor,
|
|
2764
2775
|
serverPort,
|
|
2765
2776
|
returnSeparateJS: true
|
|
@@ -2791,6 +2802,7 @@ async function handlePageRoute(url, context) {
|
|
|
2791
2802
|
cmsService,
|
|
2792
2803
|
pageLibraries: pageData.meta?.libraries,
|
|
2793
2804
|
pageCustomCode: pageData.meta?.customCode,
|
|
2805
|
+
injectEditorAttrs,
|
|
2794
2806
|
isEditor
|
|
2795
2807
|
});
|
|
2796
2808
|
return new Response(ssrHTML, {
|
|
@@ -2967,7 +2979,7 @@ async function handleRoutes(req, url, server, context) {
|
|
|
2967
2979
|
}
|
|
2968
2980
|
}
|
|
2969
2981
|
if (url.pathname === "/" || url.pathname.startsWith("/") && !url.pathname.includes(".")) {
|
|
2970
|
-
const response2 = await handlePageRoute(url, context);
|
|
2982
|
+
const response2 = await handlePageRoute(url, context, req);
|
|
2971
2983
|
logResponseTime(startTime, req);
|
|
2972
2984
|
return response2;
|
|
2973
2985
|
}
|
|
@@ -3254,4 +3266,4 @@ export {
|
|
|
3254
3266
|
createServer,
|
|
3255
3267
|
FileSystemPageProvider
|
|
3256
3268
|
};
|
|
3257
|
-
//# sourceMappingURL=chunk-
|
|
3269
|
+
//# sourceMappingURL=chunk-CHD5UCFF.js.map
|