meno-core 1.0.49 → 1.0.51
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/build-static.ts +8 -1
- package/dist/bin/cli.js +1 -1
- package/dist/build-static.js +5 -5
- package/dist/chunks/{chunk-KPU2XHOS.js → chunk-2MHDV5BF.js} +11 -1
- package/dist/chunks/chunk-2MHDV5BF.js.map +7 -0
- package/dist/chunks/{chunk-JER5NQVM.js → chunk-3KJ6SJZC.js} +5 -5
- package/dist/chunks/{chunk-JER5NQVM.js.map → chunk-3KJ6SJZC.js.map} +2 -2
- 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-DM54NPEC.js} +114 -31
- package/dist/chunks/chunk-DM54NPEC.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-4OFZP5NQ.js → chunk-HNLUO36W.js} +15 -4
- package/dist/chunks/chunk-HNLUO36W.js.map +7 -0
- 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-CHD5UCFF.js → chunk-V7CD7V7W.js} +149 -46
- package/dist/chunks/chunk-V7CD7V7W.js.map +7 -0
- package/dist/chunks/{configService-CCA6AIDI.js → configService-R3OGU2UD.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 +12 -10
- 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/routes/pages.ts +37 -2
- package/lib/server/services/cmsService.ts +21 -0
- package/lib/server/services/configService.ts +21 -0
- package/lib/server/services/fileWatcherService.ts +17 -0
- package/lib/server/ssr/buildErrorOverlay.ts +22 -4
- package/lib/server/ssr/errorOverlay.ts +11 -3
- package/lib/server/ssr/htmlGenerator.nonce.test.ts +165 -0
- package/lib/server/ssr/htmlGenerator.ts +36 -9
- package/lib/server/ssr/liveReloadIntegration.test.ts +3 -1
- package/lib/server/ssr/metaTagGenerator.ts +35 -5
- package/lib/server/ssr/ssrRenderer.test.ts +258 -0
- package/lib/server/ssr/ssrRenderer.ts +47 -5
- package/lib/server/ssrRenderer.test.ts +87 -2
- 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-4OFZP5NQ.js.map +0 -7
- 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/{configService-CCA6AIDI.js.map → configService-R3OGU2UD.js.map} +0 -0
|
@@ -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
|