meno-core 1.0.19 → 1.0.21
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/.claude/settings.local.json +7 -0
- package/lib/client/core/ComponentBuilder.test.ts +68 -56
- package/lib/client/core/ComponentBuilder.ts +6 -4
- package/lib/client/core/builders/embedBuilder.ts +10 -1
- package/lib/client/core/builders/index.ts +6 -2
- package/lib/client/core/builders/{cmsListBuilder.ts → listBuilder.ts} +227 -95
- package/lib/client/responsiveStyleResolver.test.ts +12 -12
- package/lib/client/responsiveStyleResolver.ts +19 -7
- package/lib/client/routing/Router.tsx +35 -7
- package/lib/client/templateEngine.test.ts +126 -0
- package/lib/client/templateEngine.ts +53 -13
- package/lib/server/jsonLoader.test.ts +4 -1
- package/lib/server/jsonLoader.ts +64 -15
- package/lib/server/services/configService.ts +68 -13
- package/lib/server/ssr/attributeBuilder.ts +8 -0
- package/lib/server/ssr/index.ts +1 -1
- package/lib/server/ssr/ssrRenderer.ts +245 -111
- package/lib/server/ssrRenderer.test.ts +197 -3
- package/lib/server/validateStyleCoverage.ts +14 -17
- package/lib/shared/breakpoints.test.ts +210 -23
- package/lib/shared/breakpoints.ts +124 -17
- package/lib/shared/constants.test.ts +1 -1
- package/lib/shared/constants.ts +5 -1
- package/lib/shared/cssGeneration.test.ts +17 -0
- package/lib/shared/cssGeneration.ts +49 -12
- package/lib/shared/index.ts +3 -0
- package/lib/shared/itemTemplateUtils.test.ts +44 -2
- package/lib/shared/itemTemplateUtils.ts +15 -2
- package/lib/shared/nodeUtils.ts +23 -4
- package/lib/shared/registry/BaseNodeTypeRegistry.test.ts +2 -2
- package/lib/shared/registry/nodeTypes/ListNodeType.ts +186 -0
- package/lib/shared/registry/nodeTypes/SlotMarkerType.ts +6 -0
- package/lib/shared/registry/nodeTypes/index.ts +6 -5
- package/lib/shared/responsiveScaling.test.ts +87 -0
- package/lib/shared/responsiveScaling.ts +33 -29
- package/lib/shared/responsiveStyleUtils.test.ts +7 -7
- package/lib/shared/responsiveStyleUtils.ts +22 -16
- package/lib/shared/styleNodeUtils.ts +5 -5
- package/lib/shared/styleValueRegistry.ts +60 -5
- package/lib/shared/tree/PathBuilder.ts +3 -3
- package/lib/shared/treePathUtils.ts +7 -5
- package/lib/shared/types/cms.ts +4 -57
- package/lib/shared/types/components.ts +45 -4
- package/lib/shared/types/index.ts +13 -0
- package/lib/shared/utilityClassConfig.ts +14 -0
- package/lib/shared/utilityClassMapper.ts +43 -2
- package/lib/shared/validation/propValidator.ts +9 -1
- package/lib/shared/validation/schemas.ts +60 -14
- package/package.json +1 -1
- package/lib/shared/registry/nodeTypes/CMSListNodeType.ts +0 -109
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS List Node Type Definition
|
|
3
|
-
* Renders children for each CMS item in a collection
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { createElement as h } from 'react';
|
|
8
|
-
import { StyleValueSchema, InteractiveStylesSchema, IfConditionSchema } from '../../validation/schemas';
|
|
9
|
-
import { createNodeType } from '../createNodeType';
|
|
10
|
-
import { NODE_TYPE } from '../../constants';
|
|
11
|
-
|
|
12
|
-
// Schema is the SINGLE source of truth
|
|
13
|
-
const CMSListNodeSchemaInternal = z.object({
|
|
14
|
-
type: z.literal('cms-list'),
|
|
15
|
-
label: z.string().optional(), // Custom label displayed in structure tree
|
|
16
|
-
if: IfConditionSchema.optional(), // Conditional rendering - skip node when false
|
|
17
|
-
style: StyleValueSchema.optional(),
|
|
18
|
-
interactiveStyles: InteractiveStylesSchema.optional(), // Interactive CSS rules (hover, active, etc.)
|
|
19
|
-
generateElementClass: z.boolean().optional(), // Generate element class without styles (for custom CSS)
|
|
20
|
-
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
21
|
-
/** Collection to query */
|
|
22
|
-
collection: z.string(),
|
|
23
|
-
/** Filter conditions */
|
|
24
|
-
filter: z.union([
|
|
25
|
-
z.object({
|
|
26
|
-
field: z.string(),
|
|
27
|
-
operator: z.enum(['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'contains', 'in']).optional(),
|
|
28
|
-
value: z.unknown(),
|
|
29
|
-
}),
|
|
30
|
-
z.array(z.object({
|
|
31
|
-
field: z.string(),
|
|
32
|
-
operator: z.enum(['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'contains', 'in']).optional(),
|
|
33
|
-
value: z.unknown(),
|
|
34
|
-
})),
|
|
35
|
-
z.record(z.unknown()),
|
|
36
|
-
]).optional(),
|
|
37
|
-
/** Sort configuration */
|
|
38
|
-
sort: z.union([
|
|
39
|
-
z.object({
|
|
40
|
-
field: z.string(),
|
|
41
|
-
order: z.enum(['asc', 'desc']).optional(),
|
|
42
|
-
}),
|
|
43
|
-
z.array(z.object({
|
|
44
|
-
field: z.string(),
|
|
45
|
-
order: z.enum(['asc', 'desc']).optional(),
|
|
46
|
-
})),
|
|
47
|
-
]).optional(),
|
|
48
|
-
/** Maximum number of items to return */
|
|
49
|
-
limit: z.number().optional(),
|
|
50
|
-
/** Number of items to skip */
|
|
51
|
-
offset: z.number().optional(),
|
|
52
|
-
/** Children are repeated for each item */
|
|
53
|
-
children: z.array(z.unknown()).optional(),
|
|
54
|
-
}).passthrough();
|
|
55
|
-
|
|
56
|
-
// TypeScript type inferred from schema
|
|
57
|
-
export type CMSListNode = z.infer<typeof CMSListNodeSchemaInternal>;
|
|
58
|
-
|
|
59
|
-
// Export schema for validation/schemas.ts
|
|
60
|
-
export const CMSListNodeSchema = CMSListNodeSchemaInternal;
|
|
61
|
-
|
|
62
|
-
export const CMSListNodeType = createNodeType({
|
|
63
|
-
type: NODE_TYPE.CMS_LIST,
|
|
64
|
-
displayName: 'CMS List',
|
|
65
|
-
category: 'special',
|
|
66
|
-
schema: CMSListNodeSchemaInternal,
|
|
67
|
-
|
|
68
|
-
defaultValues: {
|
|
69
|
-
collection: '',
|
|
70
|
-
children: [],
|
|
71
|
-
style: { base: {} },
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
treeDisplay: {
|
|
75
|
-
icon: 'HTML_ELEMENT',
|
|
76
|
-
getLabel: (node) => {
|
|
77
|
-
const cmsNode = node as CMSListNode;
|
|
78
|
-
return cmsNode.collection ? `CMS List: ${cmsNode.collection}` : 'CMS List';
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
clientRenderer: (node, context) => {
|
|
83
|
-
const cmsNode = node as CMSListNode;
|
|
84
|
-
// In editor, shows placeholder with collection name
|
|
85
|
-
return h('div', {
|
|
86
|
-
key: context.key,
|
|
87
|
-
'data-cms-list': 'true',
|
|
88
|
-
'data-collection': cmsNode.collection,
|
|
89
|
-
style: {
|
|
90
|
-
padding: '8px 12px',
|
|
91
|
-
background: 'rgba(139, 92, 246, 0.1)',
|
|
92
|
-
border: '1px dashed rgba(139, 92, 246, 0.5)',
|
|
93
|
-
borderRadius: '4px',
|
|
94
|
-
color: '#8b5cf6',
|
|
95
|
-
fontSize: '12px',
|
|
96
|
-
},
|
|
97
|
-
}, `[CMS List: ${cmsNode.collection || 'No collection'}]`);
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
ssrRenderer: (_node, _context) => {
|
|
101
|
-
// Placeholder - actual SSR is handled by processCMSList in ssrRenderer.ts
|
|
102
|
-
return '<!-- cms-list rendered by processCMSList -->';
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
capabilities: {
|
|
106
|
-
canHaveChildren: true,
|
|
107
|
-
requiresProps: ['collection'],
|
|
108
|
-
},
|
|
109
|
-
});
|