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/build-astro.ts
CHANGED
|
@@ -565,13 +565,17 @@ export async function buildAstroProject(
|
|
|
565
565
|
// SSR output (htmlGenerator.ts:269-507 for customCode, 368-473 for icons).
|
|
566
566
|
const customCode = configService.getCustomCode();
|
|
567
567
|
const iconsConfig = await loadIconsConfig();
|
|
568
|
+
const hasDarkFavicon = !!(iconsConfig.favicon && iconsConfig.faviconDark);
|
|
568
569
|
const faviconTag = iconsConfig.favicon
|
|
569
|
-
? `<link rel="icon" href="${iconsConfig.favicon.replace(/"/g, '"')}" />`
|
|
570
|
+
? `<link rel="icon" href="${iconsConfig.favicon.replace(/"/g, '"')}"${hasDarkFavicon ? ' media="(prefers-color-scheme: light)"' : ''} />`
|
|
571
|
+
: '';
|
|
572
|
+
const faviconDarkTag = iconsConfig.faviconDark
|
|
573
|
+
? `<link rel="icon" href="${iconsConfig.faviconDark.replace(/"/g, '"')}" media="(prefers-color-scheme: dark)" />`
|
|
570
574
|
: '';
|
|
571
575
|
const appleTouchIconTag = iconsConfig.appleTouchIcon
|
|
572
576
|
? `<link rel="apple-touch-icon" href="${iconsConfig.appleTouchIcon.replace(/"/g, '"')}" />`
|
|
573
577
|
: '';
|
|
574
|
-
const iconTagsHtml = [faviconTag, appleTouchIconTag].filter(Boolean).join('\n ');
|
|
578
|
+
const iconTagsHtml = [faviconTag, faviconDarkTag, appleTouchIconTag].filter(Boolean).join('\n ');
|
|
575
579
|
|
|
576
580
|
const remConversionConfig = configService.getRemConversion();
|
|
577
581
|
|
package/dist/build-static.js
CHANGED
|
@@ -9,14 +9,14 @@ 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-56EUSC6D.js";
|
|
13
|
+
import "./chunks/chunk-CVLFID6V.js";
|
|
14
|
+
import "./chunks/chunk-PQ2HRXDR.js";
|
|
15
15
|
import "./chunks/chunk-I7YIGZXT.js";
|
|
16
16
|
import "./chunks/chunk-WQFG7PAH.js";
|
|
17
17
|
import "./chunks/chunk-J23ZX5AP.js";
|
|
18
|
-
import "./chunks/chunk-
|
|
19
|
-
import "./chunks/chunk-
|
|
18
|
+
import "./chunks/chunk-EDQSMAMP.js";
|
|
19
|
+
import "./chunks/chunk-7NIC4I3V.js";
|
|
20
20
|
import "./chunks/chunk-AZQYF6KE.js";
|
|
21
21
|
import "./chunks/chunk-UB44F4Z2.js";
|
|
22
22
|
import "./chunks/chunk-2QK6U5UK.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
migrateTemplatesDirectory,
|
|
16
16
|
parseJSON,
|
|
17
17
|
prepareClientData
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CVLFID6V.js";
|
|
19
19
|
import {
|
|
20
20
|
minifyJS,
|
|
21
21
|
projectPaths
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
isItemDraftForLocale,
|
|
28
28
|
isItemFullyPublished
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-7NIC4I3V.js";
|
|
30
30
|
import {
|
|
31
31
|
isI18nValue,
|
|
32
32
|
resolveI18nValue
|
|
@@ -754,7 +754,7 @@ async function buildStaticPages() {
|
|
|
754
754
|
console.log("\u{1F3D7}\uFE0F Building static HTML files...\n");
|
|
755
755
|
buildErrors.length = 0;
|
|
756
756
|
clearJSValidationCache();
|
|
757
|
-
const { configService } = await import("./configService-
|
|
757
|
+
const { configService } = await import("./configService-VOY2MY2K.js");
|
|
758
758
|
configService.reset();
|
|
759
759
|
const projectConfig = await loadProjectConfig();
|
|
760
760
|
const siteUrl = projectConfig.siteUrl?.replace(/\/$/, "");
|
|
@@ -1132,4 +1132,4 @@ export {
|
|
|
1132
1132
|
injectTrackingScript,
|
|
1133
1133
|
buildStaticPages
|
|
1134
1134
|
};
|
|
1135
|
-
//# sourceMappingURL=chunk-
|
|
1135
|
+
//# sourceMappingURL=chunk-56EUSC6D.js.map
|
|
@@ -34,16 +34,25 @@ import {
|
|
|
34
34
|
|
|
35
35
|
// lib/shared/validation/schemas.ts
|
|
36
36
|
import { z } from "zod";
|
|
37
|
-
var BasePropTypeSchema, PropTypeSchema, BasePropDefinitionSchema, EnumsConfigSchema, ListItemSchemaSchema, ListPropDefinitionSchema, PropDefinitionSchema, StyleMappingSchema, BooleanMappingSchema, IfConditionSchema, LinkMappingSchema, HtmlMappingSchema, StyleObjectSchema, ResponsiveStyleObjectSchema, StyleValueSchema, InteractiveStyleRuleSchema, InteractiveStylesSchema, SlotMarkerSchema, ComponentNodeSchema, HtmlNodeSchema, ComponentInstanceNodeSchema, EmbedNodeSchema, LinkNodeSchema, LocaleListNodeSchema, ListNodeSchemaBasic, ScriptLoadModeSchema, LibraryPositionSchema, ScriptTypeSchema, JSLibraryConfigSchema, CSSLibraryConfigSchema, LibrariesConfigSchema, StructuredComponentDefinitionSchema, ComponentDefinitionSchema, I18nOrStringSchema, LibraryMergeModeSchema, PageLibrariesConfigSchema, CustomCodeConfigSchema, PageMetaDataBaseSchema, PageMetaDataSchema, LineRangeSchema, JSONPageSchema, PageDataWithComponentSchema, PageDataSchema, CMSFieldTypeSchema, CMSFieldDefinitionSchema, CMSClientDataStrategySchema, CMSClientDataConfigSchema, CMSSchemaSchema, CMSItemSchema, CMSDraftItemSchema, CMSFilterConditionSchema, CMSSortConfigSchema, CMSListQuerySchema, CMSListNodeSchema, PageCmsConfigSchema, PageMetaDataWithCMSSchema;
|
|
37
|
+
var BasePropTypeSchema, PropTypeSchema, I18nValueObjectSchema, BasePropDefinitionSchema, EnumsConfigSchema, ListItemSchemaSchema, ListPropDefinitionSchema, PropDefinitionSchema, StyleMappingSchema, BooleanMappingSchema, IfConditionSchema, LinkMappingSchema, HtmlMappingSchema, StyleObjectSchema, ResponsiveStyleObjectSchema, StyleValueSchema, InteractiveStyleRuleSchema, InteractiveStylesSchema, SlotMarkerSchema, ComponentNodeSchema, HtmlNodeSchema, ComponentInstanceNodeSchema, EmbedNodeSchema, LinkNodeSchema, LocaleListNodeSchema, ListNodeSchemaBasic, ScriptLoadModeSchema, LibraryPositionSchema, ScriptTypeSchema, JSLibraryConfigSchema, CSSLibraryConfigSchema, LibrariesConfigSchema, StructuredComponentDefinitionSchema, ComponentDefinitionSchema, I18nOrStringSchema, LibraryMergeModeSchema, PageLibrariesConfigSchema, CustomCodeConfigSchema, PageMetaDataBaseSchema, PageMetaDataSchema, LineRangeSchema, JSONPageSchema, PageDataWithComponentSchema, PageDataSchema, CMSFieldTypeSchema, CMSFieldDefinitionSchema, CMSClientDataStrategySchema, CMSClientDataConfigSchema, CMSSchemaSchema, CMSItemSchema, CMSDraftItemSchema, CMSFilterConditionSchema, CMSSortConfigSchema, CMSListQuerySchema, CMSListNodeSchema, PageCmsConfigSchema, PageMetaDataWithCMSSchema;
|
|
38
38
|
var init_schemas = __esm({
|
|
39
39
|
"lib/shared/validation/schemas.ts"() {
|
|
40
40
|
"use strict";
|
|
41
41
|
init_constants();
|
|
42
42
|
BasePropTypeSchema = z.enum(["string", "select", "boolean", "number", "link", "file", "rich-text", "embed"]);
|
|
43
43
|
PropTypeSchema = z.enum(["string", "select", "boolean", "number", "link", "file", "rich-text", "embed", "list"]);
|
|
44
|
+
I18nValueObjectSchema = z.object({
|
|
45
|
+
_i18n: z.literal(true)
|
|
46
|
+
}).passthrough();
|
|
44
47
|
BasePropDefinitionSchema = z.object({
|
|
45
48
|
type: BasePropTypeSchema,
|
|
46
|
-
default: z.union([
|
|
49
|
+
default: z.union([
|
|
50
|
+
z.string(),
|
|
51
|
+
z.number(),
|
|
52
|
+
z.boolean(),
|
|
53
|
+
z.object({ href: z.string(), target: z.string().optional() }),
|
|
54
|
+
I18nValueObjectSchema
|
|
55
|
+
]).optional(),
|
|
47
56
|
options: z.array(z.string()).readonly().optional(),
|
|
48
57
|
enumName: z.string().optional(),
|
|
49
58
|
// For 'select' type: reference to project-level enum
|
|
@@ -57,7 +66,16 @@ var init_schemas = __esm({
|
|
|
57
66
|
ListPropDefinitionSchema = z.object({
|
|
58
67
|
type: z.literal("list"),
|
|
59
68
|
itemSchema: ListItemSchemaSchema,
|
|
60
|
-
|
|
69
|
+
// List-item field values can be any primitive, a link object, an `_i18n`
|
|
70
|
+
// object (resolved by the SSR pipeline), or null.
|
|
71
|
+
default: z.array(z.record(z.string(), z.union([
|
|
72
|
+
z.string(),
|
|
73
|
+
z.number(),
|
|
74
|
+
z.boolean(),
|
|
75
|
+
z.object({ href: z.string(), target: z.string().optional() }),
|
|
76
|
+
I18nValueObjectSchema,
|
|
77
|
+
z.null()
|
|
78
|
+
]))).optional()
|
|
61
79
|
}).passthrough();
|
|
62
80
|
PropDefinitionSchema = z.union([
|
|
63
81
|
ListPropDefinitionSchema,
|
|
@@ -119,8 +137,9 @@ var init_schemas = __esm({
|
|
|
119
137
|
SlotMarkerSchema = z.lazy(() => z.object({
|
|
120
138
|
type: z.literal(NODE_TYPE.SLOT),
|
|
121
139
|
default: z.union([
|
|
122
|
-
z.array(z.union([ComponentNodeSchema, z.string()])),
|
|
123
|
-
z.string()
|
|
140
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
141
|
+
z.string(),
|
|
142
|
+
I18nValueObjectSchema
|
|
124
143
|
]).optional()
|
|
125
144
|
}).passthrough());
|
|
126
145
|
HtmlNodeSchema = z.lazy(() => z.object({
|
|
@@ -131,12 +150,13 @@ var init_schemas = __esm({
|
|
|
131
150
|
style: StyleValueSchema.optional(),
|
|
132
151
|
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
133
152
|
generateElementClass: z.boolean().optional(),
|
|
134
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
153
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema])).optional(),
|
|
135
154
|
props: z.record(z.string(), z.any()).optional(),
|
|
136
155
|
// Allow props for backward compatibility
|
|
137
156
|
children: z.union([
|
|
138
|
-
z.array(z.union([ComponentNodeSchema, z.string()])),
|
|
139
|
-
z.string()
|
|
157
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
158
|
+
z.string(),
|
|
159
|
+
I18nValueObjectSchema
|
|
140
160
|
]).optional()
|
|
141
161
|
}).passthrough());
|
|
142
162
|
ComponentInstanceNodeSchema = z.lazy(() => z.object({
|
|
@@ -148,34 +168,36 @@ var init_schemas = __esm({
|
|
|
148
168
|
style: StyleValueSchema.optional(),
|
|
149
169
|
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
150
170
|
generateElementClass: z.boolean().optional(),
|
|
151
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
171
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema])).optional(),
|
|
152
172
|
children: z.union([
|
|
153
|
-
z.array(z.union([ComponentNodeSchema, z.string()])),
|
|
154
|
-
z.string()
|
|
173
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
174
|
+
z.string(),
|
|
175
|
+
I18nValueObjectSchema
|
|
155
176
|
]).optional()
|
|
156
177
|
}).passthrough());
|
|
157
178
|
EmbedNodeSchema = z.lazy(() => z.object({
|
|
158
179
|
type: z.literal(NODE_TYPE.EMBED),
|
|
159
|
-
html: z.union([z.string(), HtmlMappingSchema]),
|
|
180
|
+
html: z.union([z.string(), HtmlMappingSchema, I18nValueObjectSchema]),
|
|
160
181
|
label: z.string().optional(),
|
|
161
182
|
if: IfConditionSchema.optional(),
|
|
162
183
|
style: StyleValueSchema.optional(),
|
|
163
184
|
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
164
185
|
generateElementClass: z.boolean().optional(),
|
|
165
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional()
|
|
186
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema])).optional()
|
|
166
187
|
}).passthrough());
|
|
167
188
|
LinkNodeSchema = z.lazy(() => z.object({
|
|
168
189
|
type: z.literal(NODE_TYPE.LINK),
|
|
169
|
-
href: z.union([z.string(), LinkMappingSchema]),
|
|
190
|
+
href: z.union([z.string(), LinkMappingSchema, I18nValueObjectSchema]),
|
|
170
191
|
label: z.string().optional(),
|
|
171
192
|
if: IfConditionSchema.optional(),
|
|
172
193
|
style: StyleValueSchema.optional(),
|
|
173
194
|
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
174
195
|
generateElementClass: z.boolean().optional(),
|
|
175
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
196
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema])).optional(),
|
|
176
197
|
children: z.union([
|
|
177
|
-
z.array(z.union([ComponentNodeSchema, z.string()])),
|
|
178
|
-
z.string()
|
|
198
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
199
|
+
z.string(),
|
|
200
|
+
I18nValueObjectSchema
|
|
179
201
|
]).optional()
|
|
180
202
|
}).passthrough());
|
|
181
203
|
LocaleListNodeSchema = z.lazy(() => z.object({
|
|
@@ -192,7 +214,7 @@ var init_schemas = __esm({
|
|
|
192
214
|
showSeparator: z.boolean().optional(),
|
|
193
215
|
showFlag: z.boolean().optional(),
|
|
194
216
|
flagStyle: StyleValueSchema.optional(),
|
|
195
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional()
|
|
217
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema])).optional()
|
|
196
218
|
}).passthrough());
|
|
197
219
|
ListNodeSchemaBasic = z.lazy(() => z.object({
|
|
198
220
|
type: z.union([z.literal(NODE_TYPE.LIST), z.literal("cms-list")]),
|
|
@@ -214,7 +236,7 @@ var init_schemas = __esm({
|
|
|
214
236
|
offset: z.number().optional(),
|
|
215
237
|
excludeCurrentItem: z.boolean().optional(),
|
|
216
238
|
emitTemplate: z.boolean().optional(),
|
|
217
|
-
children: z.array(z.union([ComponentNodeSchema, z.string()])).optional()
|
|
239
|
+
children: z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])).optional()
|
|
218
240
|
}).passthrough());
|
|
219
241
|
ComponentNodeSchema = z.union([
|
|
220
242
|
HtmlNodeSchema,
|
|
@@ -5046,4 +5068,4 @@ export {
|
|
|
5046
5068
|
generateInteractiveCSS,
|
|
5047
5069
|
generateAllInteractiveCSS
|
|
5048
5070
|
};
|
|
5049
|
-
//# sourceMappingURL=chunk-
|
|
5071
|
+
//# sourceMappingURL=chunk-7NIC4I3V.js.map
|