@hale-bopp/valentino-engine 2.1.0 → 2.2.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Valentino Engine
2
2
 
3
- > **Antifragile Open Source UI Design Engine** — part of the [HALE-BOPP](https://dev.azure.com/EasyWayData/EasyWay-DataPortal/_git/hale-bopp-valentino-engine) family.
3
+ > **Antifragile Open Source UI Design Engine** — part of the [HALE-BOPP](https://github.com/hale-bopp-data) family.
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
6
6
  [![npm](https://img.shields.io/npm/v/@hale-bopp/valentino-engine)](https://www.npmjs.com/package/@hale-bopp/valentino-engine)
@@ -101,7 +101,7 @@ Any MCP-compatible AI agent can connect to Valentino Engine:
101
101
 
102
102
  ## Contributing
103
103
 
104
- PRs welcome! Please link your PR to an ADO Work Item under [Epic #480](https://dev.azure.com/EasyWayData/EasyWay-DataPortal/_workitems/edit/480).
104
+ PRs welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
105
105
 
106
106
  ## License
107
107
 
@@ -66,7 +66,7 @@ Usage:
66
66
  valentino manifest resolve <manifest.json> --route /path Resolve route to page ID
67
67
  valentino llms <manifest.json> [--content c.json] [--site N] Generate llms.txt + llms-full.txt
68
68
 
69
- Epic: https://dev.azure.com/EasyWayData/EasyWay-DataPortal/_workitems/edit/480
69
+ GitHub: https://github.com/hale-bopp-data/valentino-engine
70
70
  `);
71
71
  }
72
72
  //# sourceMappingURL=valentino.js.map
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Editor utilities — Pure functions for visual page spec editing.
3
+ * PBI #602 — Editor visuale non-tecnico.
4
+ *
5
+ * Provides:
6
+ * - generateEditorSchema(sectionType) — JSON-like schema for form generation
7
+ * - applySectionPatch(spec, sectionIndex, patch) — immutable update + validation
8
+ * - getEditableSectionTypes() — list of section types supported by editor
9
+ */
10
+ import type { PageSpecV1, SectionSpec } from './types.js';
11
+ export type EditorFieldType = 'string' | 'text' | 'number' | 'boolean' | 'enum' | 'array' | 'object' | 'json';
12
+ export type EditorFieldSpec = {
13
+ key: string;
14
+ label: string;
15
+ type: EditorFieldType;
16
+ required?: boolean;
17
+ enumValues?: string[];
18
+ defaultValue?: unknown;
19
+ group?: string;
20
+ description?: string;
21
+ /** For array fields: schema of each item */
22
+ itemFields?: EditorFieldSpec[];
23
+ /** For object fields: nested fields */
24
+ children?: EditorFieldSpec[];
25
+ };
26
+ export type EditorSectionSchema = {
27
+ sectionType: string;
28
+ label: string;
29
+ fields: EditorFieldSpec[];
30
+ };
31
+ /**
32
+ * Returns the list of section types that the editor supports.
33
+ */
34
+ export declare function getEditableSectionTypes(): string[];
35
+ /**
36
+ * Generates the editor schema for a given section type.
37
+ * Returns null if the section type is not supported.
38
+ */
39
+ export declare function generateEditorSchema(sectionType: string): EditorSectionSchema | null;
40
+ /**
41
+ * Returns editor schemas for all supported section types.
42
+ */
43
+ export declare function generateAllEditorSchemas(): EditorSectionSchema[];
44
+ export type SectionPatchWarning = {
45
+ field: string;
46
+ message: string;
47
+ };
48
+ export type SectionPatchResult = {
49
+ spec: PageSpecV1;
50
+ warnings: SectionPatchWarning[];
51
+ };
52
+ /**
53
+ * Apply a patch (key-value map) to a section within a PageSpec.
54
+ * Returns a new PageSpec (immutable) + validation warnings.
55
+ *
56
+ * Keys use dot notation for nested fields (e.g. "presentation.surface").
57
+ * If value is null/undefined, the field is removed.
58
+ */
59
+ export declare function applySectionPatch(spec: PageSpecV1, sectionIndex: number, patch: Record<string, unknown>): SectionPatchResult;
60
+ /**
61
+ * Add a new section to a PageSpec at a given index.
62
+ * Returns the updated spec.
63
+ */
64
+ export declare function addSection(spec: PageSpecV1, section: SectionSpec, atIndex?: number): PageSpecV1;
65
+ /**
66
+ * Remove a section from a PageSpec by index.
67
+ * Returns the updated spec.
68
+ */
69
+ export declare function removeSection(spec: PageSpecV1, sectionIndex: number): PageSpecV1;
70
+ /**
71
+ * Move a section within a PageSpec (reorder).
72
+ * Returns the updated spec.
73
+ */
74
+ export declare function moveSection(spec: PageSpecV1, fromIndex: number, toIndex: number): PageSpecV1;
75
+ /**
76
+ * Update page-level fields (id, titleKey, profile, themeId, chrome, seo).
77
+ * Returns the updated spec.
78
+ */
79
+ export declare function applyPagePatch(spec: PageSpecV1, patch: Partial<Omit<PageSpecV1, 'version' | 'sections'>>): PageSpecV1;
80
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/core/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACR,UAAU,EACV,WAAW,EAGd,MAAM,YAAY,CAAC;AAOpB,MAAM,MAAM,eAAe,GACrB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,CAAC;AAEb,MAAM,MAAM,eAAe,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B,CAAC;AAwRF;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAElD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAGpF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,mBAAmB,EAAE,CAEhE;AAMD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACnC,CAAC;AA8BF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,kBAAkB,CA2DpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACtB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,MAAM,GACjB,UAAU,CAKZ;AAED;;;GAGG;AACH,wBAAgB,aAAa,CACzB,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,MAAM,GACrB,UAAU,CAKZ;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,UAAU,CASZ;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC,GACzD,UAAU,CAEZ"}
@@ -0,0 +1,421 @@
1
+ /**
2
+ * Editor utilities — Pure functions for visual page spec editing.
3
+ * PBI #602 — Editor visuale non-tecnico.
4
+ *
5
+ * Provides:
6
+ * - generateEditorSchema(sectionType) — JSON-like schema for form generation
7
+ * - applySectionPatch(spec, sectionIndex, patch) — immutable update + validation
8
+ * - getEditableSectionTypes() — list of section types supported by editor
9
+ */
10
+ import { validatePageSpec } from './page-spec.js';
11
+ // ---------------------------------------------------------------------------
12
+ // Shared field definitions (reusable across section types)
13
+ // ---------------------------------------------------------------------------
14
+ const presentationFields = [
15
+ { key: 'presentation.surface', label: 'Surface', type: 'enum', enumValues: ['default', 'muted', 'accent', 'dark', 'shell-dark', 'reading-light', 'ops-light'], group: 'presentation' },
16
+ { key: 'presentation.surfaceScreen', label: 'Surface Screen', type: 'enum', enumValues: ['none', 'soft', 'immersive', 'inherit'], group: 'presentation' },
17
+ { key: 'presentation.height', label: 'Height', type: 'enum', enumValues: ['content', 'screen-sm', 'screen-md', 'screen-full'], group: 'presentation' },
18
+ { key: 'presentation.tone', label: 'Tone', type: 'enum', enumValues: ['default', 'elevated', 'immersive'], group: 'presentation' },
19
+ { key: 'presentation.rhythmProfile', label: 'Rhythm Profile', type: 'enum', enumValues: ['hero', 'transition', 'feature', 'reading', 'proof', 'metrics', 'ops'], group: 'presentation' },
20
+ { key: 'presentation.rhythmGroup', label: 'Rhythm Group', type: 'string', group: 'presentation' },
21
+ { key: 'presentation.seamProfile', label: 'Seam Profile', type: 'enum', enumValues: ['none', 'hero-intro-merge', 'hero-to-light'], group: 'presentation' },
22
+ { key: 'presentation.surfaceEntry', label: 'Surface Entry', type: 'enum', enumValues: ['slab', 'bleed', 'floating'], group: 'presentation' },
23
+ { key: 'presentation.contentLift', label: 'Content Lift', type: 'enum', enumValues: ['none', 'sm', 'md', 'lg'], group: 'presentation' },
24
+ { key: 'presentation.visualStage', label: 'Visual Stage', type: 'string', group: 'presentation' },
25
+ { key: 'presentation.presetId', label: 'Preset ID', type: 'string', group: 'presentation' },
26
+ ];
27
+ const animationFields = [
28
+ { key: 'animation.entrance', label: 'Entrance Animation', type: 'enum', enumValues: ['fade-up', 'fade-in', 'slide-left', 'slide-right', 'scale-in', 'none'], group: 'animation' },
29
+ { key: 'animation.delay', label: 'Delay', type: 'enum', enumValues: ['none', 'stagger'], group: 'animation' },
30
+ { key: 'animation.trigger', label: 'Trigger', type: 'enum', enumValues: ['viewport', 'immediate'], group: 'animation' },
31
+ { key: 'animation.duration', label: 'Duration (ms)', type: 'number', defaultValue: 400, group: 'animation' },
32
+ ];
33
+ const ctaFields = (prefix, label) => [
34
+ { key: `${prefix}.labelKey`, label: `${label} Label Key`, type: 'string', group: 'content' },
35
+ { key: `${prefix}.action.type`, label: `${label} Action Type`, type: 'enum', enumValues: ['link', 'noop'], group: 'content' },
36
+ { key: `${prefix}.action.href`, label: `${label} Href`, type: 'string', group: 'content' },
37
+ ];
38
+ // ---------------------------------------------------------------------------
39
+ // Per-section-type schema definitions
40
+ // ---------------------------------------------------------------------------
41
+ const SECTION_SCHEMAS = {
42
+ hero: () => ({
43
+ sectionType: 'hero',
44
+ label: 'Hero',
45
+ fields: [
46
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
47
+ { key: 'eyebrowKey', label: 'Eyebrow Key', type: 'string', group: 'content' },
48
+ { key: 'taglineKey', label: 'Tagline Key', type: 'string', group: 'content' },
49
+ { key: 'supportKey', label: 'Support Key', type: 'string', group: 'content' },
50
+ { key: 'mottoKey', label: 'Motto Key', type: 'string', group: 'content' },
51
+ { key: 'poeticAsideKey', label: 'Poetic Aside Key', type: 'string', group: 'content' },
52
+ { key: 'layout', label: 'Layout', type: 'enum', enumValues: ['default', 'split'], group: 'layout' },
53
+ { key: 'layoutMode', label: 'Layout Mode', type: 'enum', enumValues: ['stack', 'split', 'stage-right'], group: 'layout' },
54
+ { key: 'primaryFocus', label: 'Primary Focus', type: 'enum', enumValues: ['copy', 'action-box', 'balanced'], group: 'layout' },
55
+ { key: 'heroPanel', label: 'Hero Panel', type: 'enum', enumValues: ['none', 'inline', 'right-box'], group: 'layout' },
56
+ { key: 'foldVisibility', label: 'Fold Visibility', type: 'enum', enumValues: ['immediate', 'scroll'], group: 'layout' },
57
+ ...ctaFields('cta', 'CTA'),
58
+ ...ctaFields('ctaSecondary', 'CTA Secondary'),
59
+ { key: 'visualAssetPath', label: 'Visual Asset Path', type: 'string', group: 'content' },
60
+ ...presentationFields,
61
+ ...animationFields,
62
+ ],
63
+ }),
64
+ cards: () => ({
65
+ sectionType: 'cards',
66
+ label: 'Cards',
67
+ fields: [
68
+ { key: 'titleKey', label: 'Title Key', type: 'string', group: 'content' },
69
+ { key: 'descKey', label: 'Description Key', type: 'string', group: 'content' },
70
+ { key: 'variant', label: 'Variant', type: 'enum', enumValues: ['catalog'], required: true, group: 'layout' },
71
+ { key: 'density', label: 'Density', type: 'enum', enumValues: ['default', 'compact'], group: 'layout' },
72
+ {
73
+ key: 'items', label: 'Cards', type: 'array', required: true, group: 'content',
74
+ itemFields: [
75
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true },
76
+ { key: 'descKey', label: 'Description Key', type: 'string' },
77
+ { key: 'iconText', label: 'Icon Text', type: 'string' },
78
+ { key: 'badgeKey', label: 'Badge Key', type: 'string' },
79
+ ],
80
+ },
81
+ ...presentationFields,
82
+ ...animationFields,
83
+ ],
84
+ }),
85
+ comparison: () => ({
86
+ sectionType: 'comparison',
87
+ label: 'Comparison',
88
+ fields: [
89
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
90
+ { key: 'subtitleKey', label: 'Subtitle Key', type: 'string', group: 'content' },
91
+ { key: 'left.titleKey', label: 'Left Title Key', type: 'string', required: true, group: 'content' },
92
+ { key: 'left.itemsKeys', label: 'Left Items Keys', type: 'json', required: true, group: 'content', description: 'JSON array of i18n keys' },
93
+ { key: 'right.titleKey', label: 'Right Title Key', type: 'string', required: true, group: 'content' },
94
+ { key: 'right.itemsKeys', label: 'Right Items Keys', type: 'json', required: true, group: 'content', description: 'JSON array of i18n keys' },
95
+ ...presentationFields,
96
+ ...animationFields,
97
+ ],
98
+ }),
99
+ cta: () => ({
100
+ sectionType: 'cta',
101
+ label: 'Call to Action',
102
+ fields: [
103
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
104
+ { key: 'bodyKey', label: 'Body Key', type: 'string', group: 'content' },
105
+ ...ctaFields('primary', 'Primary CTA'),
106
+ ...ctaFields('secondary', 'Secondary CTA'),
107
+ ...presentationFields,
108
+ ...animationFields,
109
+ ],
110
+ }),
111
+ form: () => ({
112
+ sectionType: 'form',
113
+ label: 'Form',
114
+ fields: [
115
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
116
+ { key: 'leadKey', label: 'Lead Key', type: 'string', group: 'content' },
117
+ { key: 'variant', label: 'Variant', type: 'enum', enumValues: ['demo'], group: 'layout' },
118
+ { key: 'submitKey', label: 'Submit Label Key', type: 'string', required: true, group: 'content' },
119
+ { key: 'consentKey', label: 'Consent Key', type: 'string', group: 'content' },
120
+ { key: 'legalKey', label: 'Legal Key', type: 'string', group: 'content' },
121
+ {
122
+ key: 'fields', label: 'Form Fields', type: 'array', required: true, group: 'content',
123
+ itemFields: [
124
+ { key: 'name', label: 'Field Name', type: 'string', required: true },
125
+ { key: 'type', label: 'Field Type', type: 'enum', enumValues: ['text', 'email', 'select', 'textarea', 'checkbox'], required: true },
126
+ { key: 'labelKey', label: 'Label Key', type: 'string', required: true },
127
+ { key: 'placeholderKey', label: 'Placeholder Key', type: 'string' },
128
+ { key: 'required', label: 'Required', type: 'boolean' },
129
+ { key: 'width', label: 'Width', type: 'enum', enumValues: ['half', 'full'] },
130
+ ],
131
+ },
132
+ ...presentationFields,
133
+ ...animationFields,
134
+ ],
135
+ }),
136
+ manifesto: () => ({
137
+ sectionType: 'manifesto',
138
+ label: 'Manifesto',
139
+ fields: [
140
+ { key: 'contentPrefix', label: 'Content Prefix', type: 'string', group: 'content', description: 'i18n key prefix for manifesto paragraphs' },
141
+ { key: 'ctaLabelKey', label: 'CTA Label Key', type: 'string', group: 'content' },
142
+ { key: 'ctaHref', label: 'CTA Href', type: 'string', group: 'content' },
143
+ ...presentationFields,
144
+ ...animationFields,
145
+ ],
146
+ }),
147
+ spacer: () => ({
148
+ sectionType: 'spacer',
149
+ label: 'Spacer',
150
+ fields: [
151
+ { key: 'size', label: 'Size', type: 'enum', enumValues: ['sm', 'md', 'lg'], group: 'layout' },
152
+ ...presentationFields,
153
+ ],
154
+ }),
155
+ stats: () => ({
156
+ sectionType: 'stats',
157
+ label: 'Stats',
158
+ fields: [
159
+ { key: 'titleKey', label: 'Title Key', type: 'string', group: 'content' },
160
+ {
161
+ key: 'items', label: 'Stat Items', type: 'array', required: true, group: 'content',
162
+ itemFields: [
163
+ { key: 'valueKey', label: 'Value Key', type: 'string', required: true },
164
+ { key: 'labelKey', label: 'Label Key', type: 'string', required: true },
165
+ ],
166
+ },
167
+ ...presentationFields,
168
+ ...animationFields,
169
+ ],
170
+ }),
171
+ 'how-it-works': () => ({
172
+ sectionType: 'how-it-works',
173
+ label: 'How It Works',
174
+ fields: [
175
+ { key: 'titleKey', label: 'Title Key', type: 'string', group: 'content' },
176
+ { key: 'subtitleKey', label: 'Subtitle Key', type: 'string', group: 'content' },
177
+ {
178
+ key: 'steps', label: 'Steps', type: 'array', required: true, group: 'content',
179
+ itemFields: [
180
+ { key: 'numKey', label: 'Number Key', type: 'string', required: true },
181
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true },
182
+ { key: 'descKey', label: 'Description Key', type: 'string', required: true },
183
+ ],
184
+ },
185
+ ...presentationFields,
186
+ ...animationFields,
187
+ ],
188
+ }),
189
+ advisor: () => ({
190
+ sectionType: 'advisor',
191
+ label: 'Advisor',
192
+ fields: [
193
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
194
+ { key: 'leadKey', label: 'Lead Key', type: 'string', group: 'content' },
195
+ { key: 'promptPlaceholderKey', label: 'Prompt Placeholder Key', type: 'string', group: 'content' },
196
+ { key: 'submitKey', label: 'Submit Key', type: 'string', required: true, group: 'content' },
197
+ { key: 'submitUrl', label: 'Submit URL', type: 'string', group: 'content' },
198
+ { key: 'loadingKey', label: 'Loading Key', type: 'string', group: 'content' },
199
+ { key: 'fallbackTitleKey', label: 'Fallback Title Key', type: 'string', required: true, group: 'content' },
200
+ { key: 'fallbackBodyKey', label: 'Fallback Body Key', type: 'string', required: true, group: 'content' },
201
+ {
202
+ key: 'prompts', label: 'Quick Prompts', type: 'array', required: true, group: 'content',
203
+ itemFields: [
204
+ { key: 'id', label: 'ID', type: 'string', required: true },
205
+ { key: 'labelKey', label: 'Label Key', type: 'string', required: true },
206
+ { key: 'answerTitleKey', label: 'Answer Title Key', type: 'string', required: true },
207
+ { key: 'answerBodyKey', label: 'Answer Body Key', type: 'string', required: true },
208
+ ],
209
+ },
210
+ ...presentationFields,
211
+ ...animationFields,
212
+ ],
213
+ }),
214
+ 'mermaid-diagram': () => ({
215
+ sectionType: 'mermaid-diagram',
216
+ label: 'Mermaid Diagram',
217
+ fields: [
218
+ { key: 'titleKey', label: 'Title Key', type: 'string', group: 'content' },
219
+ { key: 'descKey', label: 'Description Key', type: 'string', group: 'content' },
220
+ { key: 'mermaidCode', label: 'Mermaid Code', type: 'text', required: true, group: 'content' },
221
+ { key: 'height', label: 'Height', type: 'enum', enumValues: ['auto', 'sm', 'md', 'lg'], group: 'layout' },
222
+ ...presentationFields,
223
+ ...animationFields,
224
+ ],
225
+ }),
226
+ 'data-list': () => ({
227
+ sectionType: 'data-list',
228
+ label: 'Data List',
229
+ fields: [
230
+ { key: 'titleKey', label: 'Title Key', type: 'string', group: 'content' },
231
+ { key: 'dataUrl', label: 'Data URL', type: 'string', required: true, group: 'content' },
232
+ {
233
+ key: 'columns', label: 'Columns', type: 'array', required: true, group: 'content',
234
+ itemFields: [
235
+ { key: 'key', label: 'Key', type: 'string', required: true },
236
+ { key: 'labelKey', label: 'Label Key', type: 'string', required: true },
237
+ { key: 'format', label: 'Format', type: 'enum', enumValues: ['datetime', 'date', 'currency'] },
238
+ ],
239
+ },
240
+ ...presentationFields,
241
+ ...animationFields,
242
+ ],
243
+ }),
244
+ 'action-form': () => ({
245
+ sectionType: 'action-form',
246
+ label: 'Action Form',
247
+ fields: [
248
+ { key: 'titleKey', label: 'Title Key', type: 'string', required: true, group: 'content' },
249
+ { key: 'submitUrl', label: 'Submit URL', type: 'string', required: true, group: 'content' },
250
+ { key: 'submitKey', label: 'Submit Label Key', type: 'string', required: true, group: 'content' },
251
+ { key: 'successKey', label: 'Success Message Key', type: 'string', required: true, group: 'content' },
252
+ {
253
+ key: 'fields', label: 'Fields', type: 'array', required: true, group: 'content',
254
+ itemFields: [
255
+ { key: 'name', label: 'Field Name', type: 'string', required: true },
256
+ { key: 'type', label: 'Field Type', type: 'enum', enumValues: ['text', 'email', 'number', 'date', 'datetime-local', 'textarea'], required: true },
257
+ { key: 'labelKey', label: 'Label Key', type: 'string', required: true },
258
+ { key: 'placeholderKey', label: 'Placeholder Key', type: 'string' },
259
+ { key: 'required', label: 'Required', type: 'boolean' },
260
+ ],
261
+ },
262
+ ...presentationFields,
263
+ ...animationFields,
264
+ ],
265
+ }),
266
+ };
267
+ // ---------------------------------------------------------------------------
268
+ // Public API
269
+ // ---------------------------------------------------------------------------
270
+ /**
271
+ * Returns the list of section types that the editor supports.
272
+ */
273
+ export function getEditableSectionTypes() {
274
+ return Object.keys(SECTION_SCHEMAS);
275
+ }
276
+ /**
277
+ * Generates the editor schema for a given section type.
278
+ * Returns null if the section type is not supported.
279
+ */
280
+ export function generateEditorSchema(sectionType) {
281
+ const factory = SECTION_SCHEMAS[sectionType];
282
+ return factory ? factory() : null;
283
+ }
284
+ /**
285
+ * Returns editor schemas for all supported section types.
286
+ */
287
+ export function generateAllEditorSchemas() {
288
+ return Object.values(SECTION_SCHEMAS).map((factory) => factory());
289
+ }
290
+ /**
291
+ * Deep-get a value from an object using a dot-separated path.
292
+ */
293
+ function deepGet(obj, path) {
294
+ const parts = path.split('.');
295
+ let current = obj;
296
+ for (const part of parts) {
297
+ if (current == null || typeof current !== 'object')
298
+ return undefined;
299
+ current = current[part];
300
+ }
301
+ return current;
302
+ }
303
+ /**
304
+ * Deep-set a value in an object using a dot-separated path (immutable — returns new object).
305
+ */
306
+ function deepSet(obj, path, value) {
307
+ const parts = path.split('.');
308
+ if (parts.length === 1) {
309
+ return { ...obj, [parts[0]]: value };
310
+ }
311
+ const [head, ...rest] = parts;
312
+ const child = (obj[head] != null && typeof obj[head] === 'object')
313
+ ? { ...obj[head] }
314
+ : {};
315
+ return { ...obj, [head]: deepSet(child, rest.join('.'), value) };
316
+ }
317
+ /**
318
+ * Apply a patch (key-value map) to a section within a PageSpec.
319
+ * Returns a new PageSpec (immutable) + validation warnings.
320
+ *
321
+ * Keys use dot notation for nested fields (e.g. "presentation.surface").
322
+ * If value is null/undefined, the field is removed.
323
+ */
324
+ export function applySectionPatch(spec, sectionIndex, patch) {
325
+ const warnings = [];
326
+ if (sectionIndex < 0 || sectionIndex >= spec.sections.length) {
327
+ return {
328
+ spec,
329
+ warnings: [{ field: '_index', message: `Section index ${sectionIndex} out of bounds (0..${spec.sections.length - 1})` }],
330
+ };
331
+ }
332
+ // Clone sections array
333
+ const newSections = [...spec.sections];
334
+ let section = { ...newSections[sectionIndex] };
335
+ // Apply each patch field
336
+ for (const [key, value] of Object.entries(patch)) {
337
+ if (value === null || value === undefined) {
338
+ // Remove field — rebuild without it
339
+ const parts = key.split('.');
340
+ if (parts.length === 1) {
341
+ const { [key]: _removed, ...rest } = section;
342
+ section = rest;
343
+ }
344
+ else {
345
+ // For nested, set to undefined and let JSON.parse(JSON.stringify) clean it
346
+ section = deepSet(section, key, undefined);
347
+ }
348
+ }
349
+ else {
350
+ section = deepSet(section, key, value);
351
+ }
352
+ }
353
+ // Validate: section must still have a type
354
+ if (!section.type || typeof section.type !== 'string') {
355
+ warnings.push({ field: 'type', message: 'Section type is missing or invalid after patch' });
356
+ }
357
+ // Validate: check required fields per schema
358
+ const schema = section.type ? generateEditorSchema(section.type) : null;
359
+ if (schema) {
360
+ for (const field of schema.fields) {
361
+ if (field.required && deepGet(section, field.key) == null) {
362
+ warnings.push({ field: field.key, message: `Required field "${field.label}" is missing` });
363
+ }
364
+ }
365
+ }
366
+ newSections[sectionIndex] = section;
367
+ const newSpec = {
368
+ ...spec,
369
+ sections: newSections,
370
+ };
371
+ // Final validation
372
+ if (!validatePageSpec(newSpec)) {
373
+ warnings.push({ field: '_spec', message: 'Patched spec failed PageSpecV1 validation' });
374
+ }
375
+ return { spec: newSpec, warnings };
376
+ }
377
+ /**
378
+ * Add a new section to a PageSpec at a given index.
379
+ * Returns the updated spec.
380
+ */
381
+ export function addSection(spec, section, atIndex) {
382
+ const newSections = [...spec.sections];
383
+ const idx = atIndex ?? newSections.length;
384
+ newSections.splice(idx, 0, section);
385
+ return { ...spec, sections: newSections };
386
+ }
387
+ /**
388
+ * Remove a section from a PageSpec by index.
389
+ * Returns the updated spec.
390
+ */
391
+ export function removeSection(spec, sectionIndex) {
392
+ if (sectionIndex < 0 || sectionIndex >= spec.sections.length)
393
+ return spec;
394
+ const newSections = [...spec.sections];
395
+ newSections.splice(sectionIndex, 1);
396
+ return { ...spec, sections: newSections };
397
+ }
398
+ /**
399
+ * Move a section within a PageSpec (reorder).
400
+ * Returns the updated spec.
401
+ */
402
+ export function moveSection(spec, fromIndex, toIndex) {
403
+ if (fromIndex < 0 || fromIndex >= spec.sections.length)
404
+ return spec;
405
+ if (toIndex < 0 || toIndex >= spec.sections.length)
406
+ return spec;
407
+ if (fromIndex === toIndex)
408
+ return spec;
409
+ const newSections = [...spec.sections];
410
+ const [moved] = newSections.splice(fromIndex, 1);
411
+ newSections.splice(toIndex, 0, moved);
412
+ return { ...spec, sections: newSections };
413
+ }
414
+ /**
415
+ * Update page-level fields (id, titleKey, profile, themeId, chrome, seo).
416
+ * Returns the updated spec.
417
+ */
418
+ export function applyPagePatch(spec, patch) {
419
+ return { ...spec, ...patch, version: '1', sections: spec.sections };
420
+ }
421
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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,OAAO,IAAI,CAAC;IAChE,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAEvC,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACjD,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAgB,EAChB,KAAwD;IAExD,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AACxE,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Template Gallery — Pure helpers for enumerating catalog entries.
3
+ * PBI #610 — Provides gallery-ready metadata from ValentinoCatalogV1.
4
+ *
5
+ * No DOM, no fetch — pure functions only.
6
+ * The consumer (portal) renders the gallery UI.
7
+ */
8
+ import type { ValentinoCatalogV1, PageSpecV1, PagesManifestV1 } from './types.js';
9
+ export type GalleryEntryKind = 'blueprint' | 'template' | 'page';
10
+ export type GalleryEntry = {
11
+ /** Unique key (blueprint ID, template ID, or page ID) */
12
+ id: string;
13
+ kind: GalleryEntryKind;
14
+ /** Display name (derived from ID) */
15
+ name: string;
16
+ /** Description for the gallery card */
17
+ description: string;
18
+ /** Page profile (if available) */
19
+ profile?: string;
20
+ /** Theme ID (if available) */
21
+ themeId?: string;
22
+ /** Number of sections in the blueprint/page */
23
+ sectionCount: number;
24
+ /** Section types present (for preview/filtering) */
25
+ sectionTypes: string[];
26
+ /** Governance tier (if available) */
27
+ governanceTier?: string;
28
+ };
29
+ export type GalleryFilter = {
30
+ kind?: GalleryEntryKind | GalleryEntryKind[];
31
+ profile?: string;
32
+ sectionType?: string;
33
+ search?: string;
34
+ };
35
+ /**
36
+ * List all gallery entries from a catalog.
37
+ * Returns blueprints first, then templates.
38
+ */
39
+ export declare function listCatalogEntries(catalog: ValentinoCatalogV1): GalleryEntry[];
40
+ /**
41
+ * List gallery entries from a pages manifest (existing pages as starting points).
42
+ * Optionally provide a specs map (pageId -> PageSpecV1) for richer metadata.
43
+ */
44
+ export declare function listPageEntries(manifest: PagesManifestV1, specs?: Map<string, PageSpecV1>): GalleryEntry[];
45
+ /**
46
+ * List all gallery entries: catalog + manifest pages.
47
+ */
48
+ export declare function listAllGalleryEntries(catalog: ValentinoCatalogV1, manifest?: PagesManifestV1, specs?: Map<string, PageSpecV1>): GalleryEntry[];
49
+ /**
50
+ * Filter gallery entries by criteria.
51
+ */
52
+ export declare function filterGalleryEntries(entries: GalleryEntry[], filter: GalleryFilter): GalleryEntry[];
53
+ //# sourceMappingURL=gallery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../src/core/gallery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,kBAAkB,EAGlB,UAAU,EACV,eAAe,EAGlB,MAAM,YAAY,CAAC;AAMpB,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG;IACvB,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAo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