meno-core 1.0.49 → 1.0.50
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 +6 -2
- package/dist/build-static.js +5 -5
- package/dist/chunks/{chunk-JER5NQVM.js → chunk-56EUSC6D.js} +4 -4
- package/dist/chunks/{chunk-S2CX6HFM.js → chunk-7NIC4I3V.js} +42 -20
- package/dist/chunks/chunk-7NIC4I3V.js.map +7 -0
- package/dist/chunks/{chunk-EQYDSPBB.js → chunk-CVLFID6V.js} +64 -20
- package/dist/chunks/chunk-CVLFID6V.js.map +7 -0
- package/dist/chunks/{chunk-LKAGAQ3M.js → chunk-EDQSMAMP.js} +13 -2
- package/dist/chunks/{chunk-LKAGAQ3M.js.map → chunk-EDQSMAMP.js.map} +2 -2
- package/dist/chunks/{chunk-6IVUG7FY.js → chunk-LPVETICS.js} +19 -2
- package/dist/chunks/{chunk-6IVUG7FY.js.map → chunk-LPVETICS.js.map} +2 -2
- package/dist/chunks/{chunk-KPU2XHOS.js → chunk-PQ2HRXDR.js} +1 -1
- package/dist/chunks/chunk-PQ2HRXDR.js.map +7 -0
- package/dist/chunks/{chunk-CHD5UCFF.js → chunk-YWJJD5D6.js} +116 -32
- package/dist/chunks/chunk-YWJJD5D6.js.map +7 -0
- package/dist/chunks/{configService-CCA6AIDI.js → configService-VOY2MY2K.js} +2 -2
- package/dist/entries/server-router.js +5 -5
- package/dist/lib/client/index.js +41 -15
- package/dist/lib/client/index.js.map +3 -3
- package/dist/lib/server/index.js +11 -9
- package/dist/lib/server/index.js.map +2 -2
- package/dist/lib/shared/index.js +2 -2
- package/lib/client/core/ComponentBuilder.test.ts +34 -0
- package/lib/client/core/ComponentBuilder.ts +25 -3
- package/lib/client/core/builders/embedBuilder.ts +13 -5
- package/lib/client/core/builders/linkNodeBuilder.ts +13 -5
- package/lib/client/core/builders/localeListBuilder.ts +13 -5
- package/lib/client/templateEngine.ts +24 -0
- package/lib/server/fileWatcher.test.ts +134 -0
- package/lib/server/fileWatcher.ts +100 -32
- package/lib/server/jsonLoader.ts +1 -0
- package/lib/server/providers/fileSystemCMSProvider.ts +46 -14
- package/lib/server/services/configService.ts +1 -0
- package/lib/server/services/fileWatcherService.ts +17 -0
- package/lib/server/ssr/htmlGenerator.ts +11 -3
- package/lib/server/ssr/ssrRenderer.test.ts +258 -0
- package/lib/server/ssr/ssrRenderer.ts +46 -5
- package/lib/server/webflow/buildWebflow.ts +1 -1
- package/lib/server/websocketManager.test.ts +61 -6
- package/lib/server/websocketManager.ts +25 -1
- package/lib/shared/cssProperties.test.ts +28 -0
- package/lib/shared/cssProperties.ts +27 -1
- package/lib/shared/types/api.ts +10 -1
- package/lib/shared/types/cms.ts +18 -9
- package/lib/shared/validation/schemas.test.ts +93 -0
- package/lib/shared/validation/schemas.ts +56 -15
- package/package.json +1 -1
- package/dist/chunks/chunk-CHD5UCFF.js.map +0 -7
- package/dist/chunks/chunk-EQYDSPBB.js.map +0 -7
- package/dist/chunks/chunk-KPU2XHOS.js.map +0 -7
- package/dist/chunks/chunk-S2CX6HFM.js.map +0 -7
- /package/dist/chunks/{chunk-JER5NQVM.js.map → chunk-56EUSC6D.js.map} +0 -0
- /package/dist/chunks/{configService-CCA6AIDI.js.map → configService-VOY2MY2K.js.map} +0 -0
package/dist/lib/client/index.js
CHANGED
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
resolveLinkMapping,
|
|
13
13
|
resolveStyleMapping,
|
|
14
14
|
skipEmptyTemplateAttributes
|
|
15
|
-
} from "../../chunks/chunk-
|
|
15
|
+
} from "../../chunks/chunk-EDQSMAMP.js";
|
|
16
16
|
import {
|
|
17
17
|
filterCSSProperties,
|
|
18
18
|
logNetworkError,
|
|
19
19
|
logRuntimeError
|
|
20
|
-
} from "../../chunks/chunk-
|
|
20
|
+
} from "../../chunks/chunk-LPVETICS.js";
|
|
21
21
|
import {
|
|
22
22
|
BaseComponentRegistry,
|
|
23
23
|
DEFAULT_PREFETCH_CONFIG,
|
|
@@ -59,13 +59,14 @@ import {
|
|
|
59
59
|
singularize,
|
|
60
60
|
sortClassesByPropertyOrder,
|
|
61
61
|
validatePageData
|
|
62
|
-
} from "../../chunks/chunk-
|
|
62
|
+
} from "../../chunks/chunk-7NIC4I3V.js";
|
|
63
63
|
import {
|
|
64
64
|
DEFAULT_BREAKPOINTS,
|
|
65
65
|
DEFAULT_I18N_CONFIG,
|
|
66
66
|
DEFAULT_REM_CONFIG,
|
|
67
67
|
DEFAULT_RESPONSIVE_SCALES,
|
|
68
68
|
getBreakpointValues,
|
|
69
|
+
isI18nValue,
|
|
69
70
|
migrateI18nConfig,
|
|
70
71
|
normalizeBreakpointConfig,
|
|
71
72
|
parseLocaleFromPath,
|
|
@@ -636,7 +637,7 @@ function setI18nConfig(config) {
|
|
|
636
637
|
|
|
637
638
|
// lib/client/core/cmsTemplateProcessor.ts
|
|
638
639
|
init_constants();
|
|
639
|
-
function
|
|
640
|
+
function isI18nValue2(value) {
|
|
640
641
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
641
642
|
return false;
|
|
642
643
|
}
|
|
@@ -669,7 +670,7 @@ function processCMSTemplate(template, cmsItem, locale) {
|
|
|
669
670
|
return "";
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
|
-
if (
|
|
673
|
+
if (isI18nValue2(value)) {
|
|
673
674
|
value = resolveI18nValue2(value, effectiveLocale, config);
|
|
674
675
|
}
|
|
675
676
|
if (value === null || value === void 0) {
|
|
@@ -814,9 +815,12 @@ function buildEmbed(node, ctx, deps) {
|
|
|
814
815
|
}
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
|
-
if (extractedAttributes
|
|
818
|
-
const
|
|
819
|
-
|
|
818
|
+
if ("class" in extractedAttributes || "className" in extractedAttributes) {
|
|
819
|
+
const attrClass = extractedAttributes.class ?? extractedAttributes.className ?? "";
|
|
820
|
+
if (attrClass) {
|
|
821
|
+
classNames.push(...attrClass.split(/\s+/));
|
|
822
|
+
}
|
|
823
|
+
delete extractedAttributes.class;
|
|
820
824
|
delete extractedAttributes.className;
|
|
821
825
|
}
|
|
822
826
|
if (classNames.length > 0) {
|
|
@@ -956,9 +960,12 @@ function buildLinkNode(node, children, ctx, deps) {
|
|
|
956
960
|
}
|
|
957
961
|
}
|
|
958
962
|
}
|
|
959
|
-
if (extractedAttributes
|
|
960
|
-
const
|
|
961
|
-
|
|
963
|
+
if ("class" in extractedAttributes || "className" in extractedAttributes) {
|
|
964
|
+
const attrClass = extractedAttributes.class ?? extractedAttributes.className ?? "";
|
|
965
|
+
if (attrClass) {
|
|
966
|
+
classNames.push(...attrClass.split(/\s+/));
|
|
967
|
+
}
|
|
968
|
+
delete extractedAttributes.class;
|
|
962
969
|
delete extractedAttributes.className;
|
|
963
970
|
}
|
|
964
971
|
if (deps.getCurrentPagePath && typeof node.href === "string") {
|
|
@@ -1099,9 +1106,12 @@ function buildLocaleList(node, ctx, deps) {
|
|
|
1099
1106
|
}
|
|
1100
1107
|
}
|
|
1101
1108
|
}
|
|
1102
|
-
if (extractedAttributes
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1109
|
+
if ("class" in extractedAttributes || "className" in extractedAttributes) {
|
|
1110
|
+
const attrClass = extractedAttributes.class ?? extractedAttributes.className ?? "";
|
|
1111
|
+
if (attrClass) {
|
|
1112
|
+
classNames.push(...attrClass.split(/\s+/));
|
|
1113
|
+
}
|
|
1114
|
+
delete extractedAttributes.class;
|
|
1105
1115
|
delete extractedAttributes.className;
|
|
1106
1116
|
}
|
|
1107
1117
|
if (classNames.length > 0) {
|
|
@@ -1851,6 +1861,12 @@ var ComponentBuilder = class {
|
|
|
1851
1861
|
componentResolvedProps = null
|
|
1852
1862
|
} = options;
|
|
1853
1863
|
if (!node) return null;
|
|
1864
|
+
if (isI18nValue(node)) {
|
|
1865
|
+
const i18nResolveConfig = i18nConfig ?? DEFAULT_I18N_CONFIG;
|
|
1866
|
+
const i18nEffectiveLocale = locale || i18nResolveConfig.defaultLocale;
|
|
1867
|
+
const resolved = resolveI18nValue(node, i18nEffectiveLocale, i18nResolveConfig);
|
|
1868
|
+
return this.buildComponent({ ...options, node: resolved });
|
|
1869
|
+
}
|
|
1854
1870
|
const ctx = {
|
|
1855
1871
|
key,
|
|
1856
1872
|
elementPath,
|
|
@@ -2184,10 +2200,20 @@ var ComponentBuilder = class {
|
|
|
2184
2200
|
return result;
|
|
2185
2201
|
}
|
|
2186
2202
|
/**
|
|
2187
|
-
* Extract and merge attributes from node
|
|
2203
|
+
* Extract and merge attributes from node. Resolves any `_i18n` value
|
|
2204
|
+
* objects on attribute values to the active locale's string before
|
|
2205
|
+
* downstream template / CMS processing, mirroring the SSR path.
|
|
2188
2206
|
*/
|
|
2189
2207
|
mergeAttributes(props, node, ctx) {
|
|
2190
2208
|
let extractedAttributes = extractAttributesFromNode(node);
|
|
2209
|
+
const attrI18nConfig = ctx.i18nConfig ?? DEFAULT_I18N_CONFIG;
|
|
2210
|
+
const attrEffectiveLocale = ctx.locale || attrI18nConfig.defaultLocale;
|
|
2211
|
+
for (const [key, value] of Object.entries(extractedAttributes)) {
|
|
2212
|
+
if (isI18nValue(value)) {
|
|
2213
|
+
extractedAttributes = { ...extractedAttributes };
|
|
2214
|
+
extractedAttributes[key] = resolveI18nValue(value, attrEffectiveLocale, attrI18nConfig);
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2191
2217
|
const originalAttributes = { ...extractedAttributes };
|
|
2192
2218
|
if (ctx.cmsContext && Object.keys(extractedAttributes).length > 0) {
|
|
2193
2219
|
extractedAttributes = processCMSPropsTemplate(
|