@actuate-media/cms-core 0.7.0 → 0.9.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/dist/api/handlers.d.ts.map +1 -1
- package/dist/api/handlers.js +530 -0
- package/dist/api/handlers.js.map +1 -1
- package/dist/config/types.d.ts +3 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +0 -1
- package/dist/config/types.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/page-builder/__tests__/a11y-fix.test.d.ts +2 -0
- package/dist/page-builder/__tests__/a11y-fix.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/a11y-fix.test.js +246 -0
- package/dist/page-builder/__tests__/a11y-fix.test.js.map +1 -0
- package/dist/page-builder/__tests__/blocks.test.d.ts +2 -0
- package/dist/page-builder/__tests__/blocks.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/blocks.test.js +87 -0
- package/dist/page-builder/__tests__/blocks.test.js.map +1 -0
- package/dist/page-builder/__tests__/design-scorer.test.d.ts +2 -0
- package/dist/page-builder/__tests__/design-scorer.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/design-scorer.test.js +268 -0
- package/dist/page-builder/__tests__/design-scorer.test.js.map +1 -0
- package/dist/page-builder/__tests__/schema.test.d.ts +2 -0
- package/dist/page-builder/__tests__/schema.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/schema.test.js +191 -0
- package/dist/page-builder/__tests__/schema.test.js.map +1 -0
- package/dist/page-builder/__tests__/seo-analyzer.test.d.ts +2 -0
- package/dist/page-builder/__tests__/seo-analyzer.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/seo-analyzer.test.js +332 -0
- package/dist/page-builder/__tests__/seo-analyzer.test.js.map +1 -0
- package/dist/page-builder/__tests__/tree.test.d.ts +2 -0
- package/dist/page-builder/__tests__/tree.test.d.ts.map +1 -0
- package/dist/page-builder/__tests__/tree.test.js +257 -0
- package/dist/page-builder/__tests__/tree.test.js.map +1 -0
- package/dist/page-builder/a11y-fix.d.ts +20 -0
- package/dist/page-builder/a11y-fix.d.ts.map +1 -0
- package/dist/page-builder/a11y-fix.js +182 -0
- package/dist/page-builder/a11y-fix.js.map +1 -0
- package/dist/page-builder/ai-pipeline.d.ts +43 -0
- package/dist/page-builder/ai-pipeline.d.ts.map +1 -0
- package/dist/page-builder/ai-pipeline.js +167 -0
- package/dist/page-builder/ai-pipeline.js.map +1 -0
- package/dist/page-builder/blocks.d.ts +10 -0
- package/dist/page-builder/blocks.d.ts.map +1 -0
- package/dist/page-builder/blocks.js +252 -0
- package/dist/page-builder/blocks.js.map +1 -0
- package/dist/page-builder/design-scorer.d.ts +27 -0
- package/dist/page-builder/design-scorer.d.ts.map +1 -0
- package/dist/page-builder/design-scorer.js +404 -0
- package/dist/page-builder/design-scorer.js.map +1 -0
- package/dist/page-builder/index.d.ts +18 -0
- package/dist/page-builder/index.d.ts.map +1 -0
- package/dist/page-builder/index.js +20 -0
- package/dist/page-builder/index.js.map +1 -0
- package/dist/page-builder/schema.d.ts +107 -0
- package/dist/page-builder/schema.d.ts.map +1 -0
- package/dist/page-builder/schema.js +90 -0
- package/dist/page-builder/schema.js.map +1 -0
- package/dist/page-builder/seo-analyzer.d.ts +61 -0
- package/dist/page-builder/seo-analyzer.d.ts.map +1 -0
- package/dist/page-builder/seo-analyzer.js +582 -0
- package/dist/page-builder/seo-analyzer.js.map +1 -0
- package/dist/page-builder/templates.d.ts +9 -0
- package/dist/page-builder/templates.d.ts.map +1 -0
- package/dist/page-builder/templates.js +401 -0
- package/dist/page-builder/templates.js.map +1 -0
- package/dist/page-builder/tree.d.ts +17 -0
- package/dist/page-builder/tree.d.ts.map +1 -0
- package/dist/page-builder/tree.js +160 -0
- package/dist/page-builder/tree.js.map +1 -0
- package/dist/page-builder/types.d.ts +112 -0
- package/dist/page-builder/types.d.ts.map +1 -0
- package/dist/page-builder/types.js +4 -0
- package/dist/page-builder/types.js.map +1 -0
- package/dist/page-builder/validate.d.ts +6 -0
- package/dist/page-builder/validate.d.ts.map +1 -0
- package/dist/page-builder/validate.js +87 -0
- package/dist/page-builder/validate.js.map +1 -0
- package/package.json +6 -1
- package/prisma/migrations/0006_page_builder/migration.sql +38 -0
- package/prisma/schema.prisma +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y-fix.d.ts","sourceRoot":"","sources":["../../src/page-builder/a11y-fix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA0B,MAAM,YAAY,CAAA;AAKlE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,oBAAoB,CAAA;IAC9F,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;CACvB;AAgCD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,CAqG9D;AAQD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAiEvF"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { hasChildren } from './types.js';
|
|
2
|
+
// ─── Internal Helpers ────────────────────────────────────────────────
|
|
3
|
+
let issueCounter = 0;
|
|
4
|
+
function nextIssueId() {
|
|
5
|
+
return `a11y_${++issueCounter}`;
|
|
6
|
+
}
|
|
7
|
+
function collectBlocks(node, blocks) {
|
|
8
|
+
if (node.type === 'block') {
|
|
9
|
+
blocks.push(node);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (hasChildren(node)) {
|
|
13
|
+
for (const child of node.children) {
|
|
14
|
+
collectBlocks(child, blocks);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function getHeadingLevel(block) {
|
|
19
|
+
if (block.settings.blockType !== 'text')
|
|
20
|
+
return null;
|
|
21
|
+
const level = block.data.headingLevel;
|
|
22
|
+
if (!level)
|
|
23
|
+
return null;
|
|
24
|
+
const match = /^h(\d)$/.exec(level);
|
|
25
|
+
return match ? parseInt(match[1], 10) : null;
|
|
26
|
+
}
|
|
27
|
+
// ─── Audit ───────────────────────────────────────────────────────────
|
|
28
|
+
export function auditAccessibility(tree) {
|
|
29
|
+
issueCounter = 0;
|
|
30
|
+
const blocks = [];
|
|
31
|
+
collectBlocks(tree, blocks);
|
|
32
|
+
const issues = [];
|
|
33
|
+
let lastHeadingLevel = 1;
|
|
34
|
+
for (const block of blocks) {
|
|
35
|
+
const blockType = block.settings.blockType;
|
|
36
|
+
if (blockType === 'image') {
|
|
37
|
+
if (!block.data.alt) {
|
|
38
|
+
issues.push({
|
|
39
|
+
id: nextIssueId(),
|
|
40
|
+
blockId: block.id,
|
|
41
|
+
type: 'missing-alt',
|
|
42
|
+
severity: 'error',
|
|
43
|
+
message: 'Image block is missing alt text',
|
|
44
|
+
autoFixable: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (blockType === 'hero') {
|
|
49
|
+
if (block.data.image && !block.data.imageAlt && !block.data.alt) {
|
|
50
|
+
issues.push({
|
|
51
|
+
id: nextIssueId(),
|
|
52
|
+
blockId: block.id,
|
|
53
|
+
type: 'missing-alt',
|
|
54
|
+
severity: 'error',
|
|
55
|
+
message: 'Hero block image is missing alt text',
|
|
56
|
+
autoFixable: false,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (blockType === 'gallery') {
|
|
61
|
+
const images = block.data.images;
|
|
62
|
+
if (images) {
|
|
63
|
+
for (const img of images) {
|
|
64
|
+
if (!img.alt) {
|
|
65
|
+
issues.push({
|
|
66
|
+
id: nextIssueId(),
|
|
67
|
+
blockId: block.id,
|
|
68
|
+
type: 'missing-alt',
|
|
69
|
+
severity: 'error',
|
|
70
|
+
message: 'Gallery image is missing alt text',
|
|
71
|
+
autoFixable: false,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (blockType === 'text') {
|
|
78
|
+
const level = getHeadingLevel(block);
|
|
79
|
+
if (level !== null) {
|
|
80
|
+
if (level > lastHeadingLevel + 1) {
|
|
81
|
+
issues.push({
|
|
82
|
+
id: nextIssueId(),
|
|
83
|
+
blockId: block.id,
|
|
84
|
+
type: 'heading-skip',
|
|
85
|
+
severity: 'warning',
|
|
86
|
+
message: `Heading level skips from h${lastHeadingLevel} to h${level}`,
|
|
87
|
+
autoFixable: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
lastHeadingLevel = level;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (blockType === 'form') {
|
|
94
|
+
if (!block.data.formId) {
|
|
95
|
+
issues.push({
|
|
96
|
+
id: nextIssueId(),
|
|
97
|
+
blockId: block.id,
|
|
98
|
+
type: 'missing-label',
|
|
99
|
+
severity: 'warning',
|
|
100
|
+
message: 'Form block is missing a linked form with field labels',
|
|
101
|
+
autoFixable: false,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (blockType === 'cta') {
|
|
106
|
+
const buttonText = block.data.buttonText;
|
|
107
|
+
if (!buttonText) {
|
|
108
|
+
issues.push({
|
|
109
|
+
id: nextIssueId(),
|
|
110
|
+
blockId: block.id,
|
|
111
|
+
type: 'missing-aria',
|
|
112
|
+
severity: 'warning',
|
|
113
|
+
message: 'CTA block is missing button text for aria-label',
|
|
114
|
+
autoFixable: true,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return issues;
|
|
120
|
+
}
|
|
121
|
+
// ─── Fix ─────────────────────────────────────────────────────────────
|
|
122
|
+
function deepClone(obj) {
|
|
123
|
+
return JSON.parse(JSON.stringify(obj));
|
|
124
|
+
}
|
|
125
|
+
export function fixAccessibility(tree) {
|
|
126
|
+
const fixedTree = deepClone(tree);
|
|
127
|
+
const blocks = [];
|
|
128
|
+
collectBlocks(fixedTree, blocks);
|
|
129
|
+
const issues = auditAccessibility(tree);
|
|
130
|
+
let fixedCount = 0;
|
|
131
|
+
let lastHeadingLevel = 1;
|
|
132
|
+
for (const block of blocks) {
|
|
133
|
+
const blockType = block.settings.blockType;
|
|
134
|
+
if (blockType === 'image' && !block.data.alt) {
|
|
135
|
+
block.data.alt = `Image in ${blockType} section`;
|
|
136
|
+
fixedCount++;
|
|
137
|
+
}
|
|
138
|
+
if (blockType === 'hero' && block.data.image && !block.data.imageAlt && !block.data.alt) {
|
|
139
|
+
block.data.alt = 'Image in hero section';
|
|
140
|
+
fixedCount++;
|
|
141
|
+
}
|
|
142
|
+
if (blockType === 'gallery') {
|
|
143
|
+
const images = block.data.images;
|
|
144
|
+
if (images) {
|
|
145
|
+
for (const img of images) {
|
|
146
|
+
if (!img.alt) {
|
|
147
|
+
img.alt = 'Image in gallery section';
|
|
148
|
+
fixedCount++;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (blockType === 'text') {
|
|
154
|
+
const level = getHeadingLevel(block);
|
|
155
|
+
if (level !== null) {
|
|
156
|
+
if (level > lastHeadingLevel + 1) {
|
|
157
|
+
const corrected = lastHeadingLevel + 1;
|
|
158
|
+
block.data.headingLevel = `h${corrected}`;
|
|
159
|
+
lastHeadingLevel = corrected;
|
|
160
|
+
fixedCount++;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
lastHeadingLevel = level;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (blockType === 'cta' && !block.data.buttonText) {
|
|
168
|
+
block.data.ariaLabel = block.data.heading || 'Call to action';
|
|
169
|
+
fixedCount++;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const remainingCount = issues.length - fixedCount;
|
|
173
|
+
return {
|
|
174
|
+
tree: fixedTree,
|
|
175
|
+
report: {
|
|
176
|
+
issues,
|
|
177
|
+
fixedCount,
|
|
178
|
+
remainingCount: remainingCount < 0 ? 0 : remainingCount,
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=a11y-fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y-fix.js","sourceRoot":"","sources":["../../src/page-builder/a11y-fix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAmBxC,wEAAwE;AAExE,IAAI,YAAY,GAAG,CAAC,CAAA;AAEpB,SAAS,WAAW;IAClB,OAAO,QAAQ,EAAE,YAAY,EAAE,CAAA;AACjC,CAAC;AAED,SAAS,aAAa,CAAC,IAAiB,EAAE,MAAmB;IAC3D,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjB,OAAM;IACR,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAyB,EAAE,CAAC;YACnD,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,KAAgB;IACvC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,KAAK,MAAM;QAAE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ACzC,gBAAgB,GAAG,SAAS,CAAA;oBAC5B,UAAU,EAAE,CAAA;gBACd,CAAC;qBAAM,CAAC;oBACN,gBAAgB,GAAG,KAAK,CAAA;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,SAAS,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,SAAS,GAAI,KAAK,CAAC,IAAI,CAAC,OAAkB,IAAI,gBAAgB,CAAA;YACzE,UAAU,EAAE,CAAA;QACd,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;IAEjD,OAAO;QACL,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,MAAM;YACN,UAAU;YACV,cAAc,EAAE,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc;SACxD;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PageNode } from './types.js';
|
|
2
|
+
export type GenerationStep = 'structure' | 'content' | 'seo' | 'accessibility';
|
|
3
|
+
export interface GenerationContext {
|
|
4
|
+
prompt: string;
|
|
5
|
+
template?: string;
|
|
6
|
+
context?: {
|
|
7
|
+
businessName?: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
address?: string;
|
|
10
|
+
services?: string[];
|
|
11
|
+
industry?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
steps: GenerationStep[];
|
|
15
|
+
tone?: 'professional' | 'casual' | 'friendly' | 'technical' | 'luxury';
|
|
16
|
+
}
|
|
17
|
+
export interface StepResult {
|
|
18
|
+
step: GenerationStep;
|
|
19
|
+
tree: PageNode;
|
|
20
|
+
metadata: {
|
|
21
|
+
tokensUsed: number;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
changes: string[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface GenerationResult {
|
|
27
|
+
tree: PageNode;
|
|
28
|
+
steps: StepResult[];
|
|
29
|
+
totalTokensUsed: number;
|
|
30
|
+
totalDurationMs: number;
|
|
31
|
+
}
|
|
32
|
+
export interface GenerationProgress {
|
|
33
|
+
currentStep: GenerationStep;
|
|
34
|
+
completedSteps: GenerationStep[];
|
|
35
|
+
totalSteps: number;
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const PAGE_TREE_SCHEMA_REFERENCE: string;
|
|
39
|
+
export declare function buildStructurePrompt(ctx: GenerationContext, templateTree?: PageNode): string;
|
|
40
|
+
export declare function buildContentPrompt(ctx: GenerationContext, tree: PageNode): string;
|
|
41
|
+
export declare function buildSEOPrompt(ctx: GenerationContext, tree: PageNode): string;
|
|
42
|
+
export declare function buildAccessibilityPrompt(tree: PageNode): string;
|
|
43
|
+
//# sourceMappingURL=ai-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-pipeline.d.ts","sourceRoot":"","sources":["../../src/page-builder/ai-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAI1C,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,GAAG,eAAe,CAAA;AAE9E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,IAAI,CAAC,EAAE,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAA;CACvE;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAA;IACpB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAA;QAClB,UAAU,EAAE,MAAM,CAAA;QAClB,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,cAAc,CAAA;IAC3B,cAAc,EAAE,cAAc,EAAE,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAID,eAAO,MAAM,0BAA0B,QA4C/B,CAAA;AAyBR,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,CAyB5F;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAuBjF;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAyB7E;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAmB/D"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// ─── Schema Reference ────────────────────────────────────────────────
|
|
2
|
+
export const PAGE_TREE_SCHEMA_REFERENCE = `
|
|
3
|
+
Page Tree Structure Rules:
|
|
4
|
+
- Root node: { type: "page", id: string, children: SectionNode[] }
|
|
5
|
+
- SectionNode: { type: "section", id: string, settings: SectionSettings, children: (ContainerNode | RowNode)[] }
|
|
6
|
+
- ContainerNode: { type: "container", id: string, settings: { maxWidth?: string, alignment?: string, padding?: string }, children: RowNode[] }
|
|
7
|
+
- RowNode: { type: "row", id: string, settings: { gap?: string, verticalAlign?: string }, children: ColumnNode[] }
|
|
8
|
+
- ColumnNode: { type: "column", id: string, settings: { width: number }, children: (BlockNode | ContainerNode)[] }
|
|
9
|
+
- BlockNode: { type: "block", id: string, settings: { blockType: string, variant?: string }, data: Record<string, unknown> }
|
|
10
|
+
|
|
11
|
+
Column width rules:
|
|
12
|
+
- Column widths in a row MUST sum to exactly 12
|
|
13
|
+
- Valid single-column widths: 12 (full), 6 (half), 4 (third), 3 (quarter)
|
|
14
|
+
- Valid two-column splits: 6+6, 7+5, 8+4, 9+3
|
|
15
|
+
- Valid three-column splits: 4+4+4, 6+3+3, 3+6+3
|
|
16
|
+
|
|
17
|
+
Available block types and their data fields:
|
|
18
|
+
- hero: { title, subtitle, image, videoUrl, ctaText, ctaLink, overlayOpacity }
|
|
19
|
+
variants: centered, split-image, video-bg, minimal
|
|
20
|
+
- text: { body (richText), heading, headingLevel (h2|h3|h4) }
|
|
21
|
+
variants: prose, two-column, with-sidebar
|
|
22
|
+
- image: { src, alt, caption, link, aspectRatio }
|
|
23
|
+
variants: full-width, captioned, rounded, side-by-side
|
|
24
|
+
- cards: { items: [{ title, description, image, link, icon }] }
|
|
25
|
+
variants: grid-2, grid-3, grid-4, horizontal
|
|
26
|
+
- cta: { heading, body, buttonText, buttonLink, buttonStyle }
|
|
27
|
+
variants: banner, inline, floating, split
|
|
28
|
+
- video: { url, poster, autoplay, loop }
|
|
29
|
+
variants: inline, lightbox, background
|
|
30
|
+
- gallery: { images: [{ src, alt, caption }] }
|
|
31
|
+
variants: grid, masonry, carousel, lightbox
|
|
32
|
+
- faq: { items: [{ question, answer }] }
|
|
33
|
+
variants: accordion, list, two-column
|
|
34
|
+
- form: { formId, successMessage }
|
|
35
|
+
variants: contact, newsletter, custom
|
|
36
|
+
- code: { content, language (html|javascript|css), sandboxed }
|
|
37
|
+
variants: embed, html, script
|
|
38
|
+
|
|
39
|
+
Nesting rules:
|
|
40
|
+
- page > section > container | row
|
|
41
|
+
- container > row
|
|
42
|
+
- row > column
|
|
43
|
+
- column > block | container
|
|
44
|
+
- Never nest blocks inside blocks
|
|
45
|
+
- Every id must be unique (use format "node_<random>")
|
|
46
|
+
`.trim();
|
|
47
|
+
// ─── Prompt Builders ─────────────────────────────────────────────────
|
|
48
|
+
function formatBusinessContext(ctx) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
const biz = ctx.context;
|
|
51
|
+
if (!biz)
|
|
52
|
+
return '';
|
|
53
|
+
if (biz.businessName)
|
|
54
|
+
parts.push(`Business name: ${biz.businessName}`);
|
|
55
|
+
if (biz.industry)
|
|
56
|
+
parts.push(`Industry: ${biz.industry}`);
|
|
57
|
+
if (biz.phone)
|
|
58
|
+
parts.push(`Phone: ${biz.phone}`);
|
|
59
|
+
if (biz.address)
|
|
60
|
+
parts.push(`Address: ${biz.address}`);
|
|
61
|
+
if (biz.services?.length)
|
|
62
|
+
parts.push(`Services: ${biz.services.join(', ')}`);
|
|
63
|
+
return parts.length > 0
|
|
64
|
+
? `\nBusiness context:\n${parts.join('\n')}`
|
|
65
|
+
: '';
|
|
66
|
+
}
|
|
67
|
+
function formatTone(tone) {
|
|
68
|
+
if (!tone)
|
|
69
|
+
return '';
|
|
70
|
+
return `\nTone: ${tone}. Adjust all copy to match this voice.`;
|
|
71
|
+
}
|
|
72
|
+
export function buildStructurePrompt(ctx, templateTree) {
|
|
73
|
+
const templateInstruction = templateTree
|
|
74
|
+
? `\nUse the following page tree as a starting template and adapt it to match the user's request. Modify sections, add or remove blocks as needed:\n${JSON.stringify(templateTree, null, 2)}`
|
|
75
|
+
: '\nGenerate the page tree structure from scratch.';
|
|
76
|
+
return [
|
|
77
|
+
'You are a page builder AI. Generate a valid PageNode JSON tree for a website page.',
|
|
78
|
+
'',
|
|
79
|
+
`User request: ${ctx.prompt}`,
|
|
80
|
+
formatBusinessContext(ctx),
|
|
81
|
+
formatTone(ctx.tone),
|
|
82
|
+
templateInstruction,
|
|
83
|
+
'',
|
|
84
|
+
'Schema reference:',
|
|
85
|
+
PAGE_TREE_SCHEMA_REFERENCE,
|
|
86
|
+
'',
|
|
87
|
+
'Requirements:',
|
|
88
|
+
'- Output ONLY valid JSON matching the schema above.',
|
|
89
|
+
'- Generate unique IDs for every node using the format "node_<random8chars>".',
|
|
90
|
+
'- Column widths in each row must sum to exactly 12.',
|
|
91
|
+
'- Choose appropriate block types and variants for the content described.',
|
|
92
|
+
'- Include at least a hero section and one content section.',
|
|
93
|
+
'- Leave block data fields empty or with brief placeholders — content will be filled in the next step.',
|
|
94
|
+
'- Do not include any explanation or markdown, only the JSON object.',
|
|
95
|
+
].join('\n');
|
|
96
|
+
}
|
|
97
|
+
export function buildContentPrompt(ctx, tree) {
|
|
98
|
+
return [
|
|
99
|
+
'You are a content writer AI. Fill in the content for all blocks in the following page tree.',
|
|
100
|
+
'',
|
|
101
|
+
`Original user request: ${ctx.prompt}`,
|
|
102
|
+
formatBusinessContext(ctx),
|
|
103
|
+
formatTone(ctx.tone),
|
|
104
|
+
'',
|
|
105
|
+
'Current page tree (with empty/placeholder block data):',
|
|
106
|
+
JSON.stringify(tree, null, 2),
|
|
107
|
+
'',
|
|
108
|
+
'Instructions:',
|
|
109
|
+
'- Populate the "data" field of every BlockNode with relevant, high-quality content.',
|
|
110
|
+
'- For text blocks: write compelling copy that matches the tone and business context.',
|
|
111
|
+
'- For hero blocks: write a strong headline (title), supporting subtitle, and CTA text.',
|
|
112
|
+
'- For cards blocks: generate 3-4 items with titles and descriptions.',
|
|
113
|
+
'- For CTA blocks: write persuasive heading, body, and button text.',
|
|
114
|
+
'- For FAQ blocks: generate 4-6 relevant questions and answers.',
|
|
115
|
+
'- For image blocks: use descriptive placeholder src values like "/images/hero-bg.jpg" and write proper alt text.',
|
|
116
|
+
'- For gallery blocks: include 4-6 images with descriptive alt text.',
|
|
117
|
+
'- Keep the tree structure EXACTLY the same — only modify "data" fields inside BlockNodes.',
|
|
118
|
+
'- Output ONLY the complete JSON tree with content filled in. No explanation or markdown.',
|
|
119
|
+
].join('\n');
|
|
120
|
+
}
|
|
121
|
+
export function buildSEOPrompt(ctx, tree) {
|
|
122
|
+
return [
|
|
123
|
+
'You are an SEO specialist AI. Optimize the following page tree for search engines.',
|
|
124
|
+
'',
|
|
125
|
+
`Original user request: ${ctx.prompt}`,
|
|
126
|
+
formatBusinessContext(ctx),
|
|
127
|
+
'',
|
|
128
|
+
'Current page tree:',
|
|
129
|
+
JSON.stringify(tree, null, 2),
|
|
130
|
+
'',
|
|
131
|
+
'Instructions:',
|
|
132
|
+
'- Ensure the first text or hero block contains the primary keyword in the heading.',
|
|
133
|
+
'- Ensure headings follow proper hierarchy (h2 before h3, no skipping levels).',
|
|
134
|
+
'- Add descriptive alt text to any image blocks missing it.',
|
|
135
|
+
'- Ensure the first paragraph of body content includes the focus keyphrase naturally.',
|
|
136
|
+
'- Keep sentences concise and scannable for readability.',
|
|
137
|
+
'- Do NOT change the tree structure — only modify text content and data fields.',
|
|
138
|
+
'- After the tree JSON, add a "pageSEO" object with: { metaTitle: string, metaDescription: string, focusKeyphrase: string }',
|
|
139
|
+
'- metaTitle should be 50-60 characters and include the primary keyword.',
|
|
140
|
+
'- metaDescription should be 150-160 characters and include a call-to-action.',
|
|
141
|
+
'',
|
|
142
|
+
'Output format:',
|
|
143
|
+
'{ "tree": <PageNode JSON>, "pageSEO": { "metaTitle": "...", "metaDescription": "...", "focusKeyphrase": "..." } }',
|
|
144
|
+
'- Output ONLY the JSON object. No explanation or markdown.',
|
|
145
|
+
].join('\n');
|
|
146
|
+
}
|
|
147
|
+
export function buildAccessibilityPrompt(tree) {
|
|
148
|
+
return [
|
|
149
|
+
'You are an accessibility specialist AI. Audit and fix the following page tree for WCAG 2.1 AA compliance.',
|
|
150
|
+
'',
|
|
151
|
+
'Current page tree:',
|
|
152
|
+
JSON.stringify(tree, null, 2),
|
|
153
|
+
'',
|
|
154
|
+
'Check and fix:',
|
|
155
|
+
'- Heading hierarchy: ensure headings go in order (h2 → h3 → h4) with no skipped levels.',
|
|
156
|
+
'- Image alt text: every image block, hero image, and gallery image must have descriptive alt text.',
|
|
157
|
+
'- Form labels: form blocks should reference forms with proper labels.',
|
|
158
|
+
'- CTA/button blocks: ensure button text is descriptive (not just "Click here" or "Submit").',
|
|
159
|
+
'- Link text: avoid generic "Read more" or "Click here" — use descriptive link text.',
|
|
160
|
+
'- Color contrast: if text colors are specified, note any potential contrast issues in changes.',
|
|
161
|
+
'',
|
|
162
|
+
'Output format:',
|
|
163
|
+
'{ "tree": <fixed PageNode JSON>, "changes": ["description of each fix applied"] }',
|
|
164
|
+
'- Output ONLY the JSON object. No explanation or markdown.',
|
|
165
|
+
].join('\n');
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=ai-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-pipeline.js","sourceRoot":"","sources":["../../src/page-builder/ai-pipeline.ts"],"names":[],"mappings":"AA6CA,wEAAwE;AAExE,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CzC,CAAC,IAAI,EAAE,CAAA;AAER,wEAAwE;AAExE,SAAS,qBAAqB,CAAC,GAAsB;IACnD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAA;IACvB,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAA;IAEnB,IAAI,GAAG,CAAC,YAAY;QAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,YAAY,EAAE,CAAC,CAAA;IACtE,IAAI,GAAG,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,GA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E;QACF,gBAAgB;QAChB,yFAAyF;QACzF,oGAAoG;QACpG,uEAAuE;QACvE,6FAA6F;QAC7F,qFAAqF;QACrF,gGAAgG;QAChG,EAAE;QACF,gBAAgB;QAChB,mFAAmF;QACnF,4DAA4D;KAC7D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BlockTypeDefinition, VariantDefinition } from './types.js';
|
|
2
|
+
export declare class BlockCatalog {
|
|
3
|
+
private blocks;
|
|
4
|
+
constructor();
|
|
5
|
+
get(type: string): BlockTypeDefinition | undefined;
|
|
6
|
+
getAll(): BlockTypeDefinition[];
|
|
7
|
+
register(block: BlockTypeDefinition): void;
|
|
8
|
+
getVariant(blockType: string, variantName: string): VariantDefinition | undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/page-builder/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAsOxE,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAkC;;IAShD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAIlD,MAAM,IAAI,mBAAmB,EAAE;IAI/B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAI1C,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;CAKlF"}
|