@prenta/core 1.1.1 → 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.
Files changed (109) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/api/handlers.d.ts.map +1 -1
  3. package/dist/api/handlers.js +0 -2
  4. package/dist/api/handlers.js.map +1 -1
  5. package/dist/api/routes/media.d.ts.map +1 -1
  6. package/dist/api/routes/media.js +73 -104
  7. package/dist/api/routes/media.js.map +1 -1
  8. package/dist/api/routes/saved-sections.d.ts.map +1 -1
  9. package/dist/api/routes/saved-sections.js +20 -300
  10. package/dist/api/routes/saved-sections.js.map +1 -1
  11. package/dist/appearance/resolve.js +1 -1
  12. package/dist/appearance/resolve.js.map +1 -1
  13. package/dist/collections/presets.d.ts +2 -2
  14. package/dist/collections/presets.js +2 -2
  15. package/dist/config/runtime.d.ts +1 -2
  16. package/dist/config/runtime.d.ts.map +1 -1
  17. package/dist/config/runtime.js.map +1 -1
  18. package/dist/config/types.d.ts +0 -3
  19. package/dist/config/types.d.ts.map +1 -1
  20. package/dist/db/model-types.d.ts +67 -26
  21. package/dist/db/model-types.d.ts.map +1 -1
  22. package/dist/generated/browser.d.ts +16 -0
  23. package/dist/generated/client.d.ts +16 -0
  24. package/dist/generated/commonInputTypes.d.ts +30 -0
  25. package/dist/generated/internal/class.d.ts +33 -0
  26. package/dist/generated/internal/class.js +4 -4
  27. package/dist/generated/internal/prismaNamespace.d.ts +294 -1
  28. package/dist/generated/internal/prismaNamespace.js +55 -1
  29. package/dist/generated/internal/prismaNamespaceBrowser.d.ts +60 -0
  30. package/dist/generated/internal/prismaNamespaceBrowser.js +55 -1
  31. package/dist/generated/models/DocumentCRDT.d.ts +1110 -0
  32. package/dist/generated/models/DocumentCRDT.js +1 -0
  33. package/dist/generated/models/DocumentComment.d.ts +1722 -0
  34. package/dist/generated/models/DocumentComment.js +1 -0
  35. package/dist/generated/models/DocumentNotification.d.ts +1289 -0
  36. package/dist/generated/models/DocumentNotification.js +1 -0
  37. package/dist/generated/models/User.d.ts +552 -0
  38. package/dist/generated/models.d.ts +3 -0
  39. package/dist/index.d.ts +4 -2
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +3 -2
  42. package/dist/index.js.map +1 -1
  43. package/dist/media/index.d.ts +2 -0
  44. package/dist/media/index.d.ts.map +1 -1
  45. package/dist/media/index.js +1 -0
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/optimize.d.ts.map +1 -1
  48. package/dist/media/optimize.js +19 -12
  49. package/dist/media/optimize.js.map +1 -1
  50. package/dist/media/reoptimize.d.ts +61 -0
  51. package/dist/media/reoptimize.d.ts.map +1 -0
  52. package/dist/media/reoptimize.js +371 -0
  53. package/dist/media/reoptimize.js.map +1 -0
  54. package/dist/sections/index.d.ts +1 -2
  55. package/dist/sections/index.d.ts.map +1 -1
  56. package/dist/sections/index.js +1 -2
  57. package/dist/sections/index.js.map +1 -1
  58. package/dist/sections/types.d.ts +2 -3
  59. package/dist/sections/types.d.ts.map +1 -1
  60. package/dist/sections/types.js +2 -3
  61. package/dist/sections/types.js.map +1 -1
  62. package/dist/security/api-key-enhanced.d.ts +2 -2
  63. package/package.json +1 -6
  64. package/prisma/migrations/0013_document_collab_models/migration.sql +68 -0
  65. package/prisma/schema.prisma +66 -5
  66. package/dist/api/routes/page-templates.d.ts +0 -3
  67. package/dist/api/routes/page-templates.d.ts.map +0 -1
  68. package/dist/api/routes/page-templates.js +0 -265
  69. package/dist/api/routes/page-templates.js.map +0 -1
  70. package/dist/page-builder/a11y-fix.d.ts +0 -20
  71. package/dist/page-builder/a11y-fix.d.ts.map +0 -1
  72. package/dist/page-builder/a11y-fix.js +0 -182
  73. package/dist/page-builder/a11y-fix.js.map +0 -1
  74. package/dist/page-builder/ai-pipeline.d.ts +0 -43
  75. package/dist/page-builder/ai-pipeline.d.ts.map +0 -1
  76. package/dist/page-builder/ai-pipeline.js +0 -165
  77. package/dist/page-builder/ai-pipeline.js.map +0 -1
  78. package/dist/page-builder/blocks.d.ts +0 -27
  79. package/dist/page-builder/blocks.d.ts.map +0 -1
  80. package/dist/page-builder/blocks.js +0 -313
  81. package/dist/page-builder/blocks.js.map +0 -1
  82. package/dist/page-builder/design-scorer.d.ts +0 -27
  83. package/dist/page-builder/design-scorer.d.ts.map +0 -1
  84. package/dist/page-builder/design-scorer.js +0 -612
  85. package/dist/page-builder/design-scorer.js.map +0 -1
  86. package/dist/page-builder/index.d.ts +0 -16
  87. package/dist/page-builder/index.d.ts.map +0 -1
  88. package/dist/page-builder/index.js +0 -18
  89. package/dist/page-builder/index.js.map +0 -1
  90. package/dist/page-builder/schema.d.ts +0 -107
  91. package/dist/page-builder/schema.d.ts.map +0 -1
  92. package/dist/page-builder/schema.js +0 -90
  93. package/dist/page-builder/schema.js.map +0 -1
  94. package/dist/page-builder/templates.d.ts +0 -9
  95. package/dist/page-builder/templates.d.ts.map +0 -1
  96. package/dist/page-builder/templates.js +0 -742
  97. package/dist/page-builder/templates.js.map +0 -1
  98. package/dist/page-builder/tree.d.ts +0 -17
  99. package/dist/page-builder/tree.d.ts.map +0 -1
  100. package/dist/page-builder/tree.js +0 -160
  101. package/dist/page-builder/tree.js.map +0 -1
  102. package/dist/page-builder/types.d.ts +0 -112
  103. package/dist/page-builder/types.d.ts.map +0 -1
  104. package/dist/page-builder/types.js +0 -4
  105. package/dist/page-builder/types.js.map +0 -1
  106. package/dist/page-builder/validate.d.ts +0 -6
  107. package/dist/page-builder/validate.d.ts.map +0 -1
  108. package/dist/page-builder/validate.js +0 -87
  109. package/dist/page-builder/validate.js.map +0 -1
@@ -1,165 +0,0 @@
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 ? `\nBusiness context:\n${parts.join('\n')}` : '';
64
- }
65
- function formatTone(tone) {
66
- if (!tone)
67
- return '';
68
- return `\nTone: ${tone}. Adjust all copy to match this voice.`;
69
- }
70
- export function buildStructurePrompt(ctx, templateTree) {
71
- const templateInstruction = templateTree
72
- ? `\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)}`
73
- : '\nGenerate the page tree structure from scratch.';
74
- return [
75
- 'You are a page builder AI. Generate a valid PageNode JSON tree for a website page.',
76
- '',
77
- `User request: ${ctx.prompt}`,
78
- formatBusinessContext(ctx),
79
- formatTone(ctx.tone),
80
- templateInstruction,
81
- '',
82
- 'Schema reference:',
83
- PAGE_TREE_SCHEMA_REFERENCE,
84
- '',
85
- 'Requirements:',
86
- '- Output ONLY valid JSON matching the schema above.',
87
- '- Generate unique IDs for every node using the format "node_<random8chars>".',
88
- '- Column widths in each row must sum to exactly 12.',
89
- '- Choose appropriate block types and variants for the content described.',
90
- '- Include at least a hero section and one content section.',
91
- '- Leave block data fields empty or with brief placeholders — content will be filled in the next step.',
92
- '- Do not include any explanation or markdown, only the JSON object.',
93
- ].join('\n');
94
- }
95
- export function buildContentPrompt(ctx, tree) {
96
- return [
97
- 'You are a content writer AI. Fill in the content for all blocks in the following page tree.',
98
- '',
99
- `Original user request: ${ctx.prompt}`,
100
- formatBusinessContext(ctx),
101
- formatTone(ctx.tone),
102
- '',
103
- 'Current page tree (with empty/placeholder block data):',
104
- JSON.stringify(tree, null, 2),
105
- '',
106
- 'Instructions:',
107
- '- Populate the "data" field of every BlockNode with relevant, high-quality content.',
108
- '- For text blocks: write compelling copy that matches the tone and business context.',
109
- '- For hero blocks: write a strong headline (title), supporting subtitle, and CTA text.',
110
- '- For cards blocks: generate 3-4 items with titles and descriptions.',
111
- '- For CTA blocks: write persuasive heading, body, and button text.',
112
- '- For FAQ blocks: generate 4-6 relevant questions and answers.',
113
- '- For image blocks: use descriptive placeholder src values like "/images/hero-bg.jpg" and write proper alt text.',
114
- '- For gallery blocks: include 4-6 images with descriptive alt text.',
115
- '- Keep the tree structure EXACTLY the same — only modify "data" fields inside BlockNodes.',
116
- '- Output ONLY the complete JSON tree with content filled in. No explanation or markdown.',
117
- ].join('\n');
118
- }
119
- export function buildSEOPrompt(ctx, tree) {
120
- return [
121
- 'You are an SEO specialist AI. Optimize the following page tree for search engines.',
122
- '',
123
- `Original user request: ${ctx.prompt}`,
124
- formatBusinessContext(ctx),
125
- '',
126
- 'Current page tree:',
127
- JSON.stringify(tree, null, 2),
128
- '',
129
- 'Instructions:',
130
- '- Ensure the first text or hero block contains the primary keyword in the heading.',
131
- '- Ensure headings follow proper hierarchy (h2 before h3, no skipping levels).',
132
- '- Add descriptive alt text to any image blocks missing it.',
133
- '- Ensure the first paragraph of body content includes the focus keyphrase naturally.',
134
- '- Keep sentences concise and scannable for readability.',
135
- '- Do NOT change the tree structure — only modify text content and data fields.',
136
- '- After the tree JSON, add a "pageSEO" object with: { metaTitle: string, metaDescription: string, focusKeyphrase: string }',
137
- '- metaTitle should be 50-60 characters and include the primary keyword.',
138
- '- metaDescription should be 150-160 characters and include a call-to-action.',
139
- '',
140
- 'Output format:',
141
- '{ "tree": <PageNode JSON>, "pageSEO": { "metaTitle": "...", "metaDescription": "...", "focusKeyphrase": "..." } }',
142
- '- Output ONLY the JSON object. No explanation or markdown.',
143
- ].join('\n');
144
- }
145
- export function buildAccessibilityPrompt(tree) {
146
- return [
147
- 'You are an accessibility specialist AI. Audit and fix the following page tree for WCAG 2.1 AA compliance.',
148
- '',
149
- 'Current page tree:',
150
- JSON.stringify(tree, null, 2),
151
- '',
152
- 'Check and fix:',
153
- '- Heading hierarchy: ensure headings go in order (h2 → h3 → h4) with no skipped levels.',
154
- '- Image alt text: every image block, hero image, and gallery image must have descriptive alt text.',
155
- '- Form labels: form blocks should reference forms with proper labels.',
156
- '- CTA/button blocks: ensure button text is descriptive (not just "Click here" or "Submit").',
157
- '- Link text: avoid generic "Read more" or "Click here" — use descriptive link text.',
158
- '- Color contrast: if text colors are specified, note any potential contrast issues in changes.',
159
- '',
160
- 'Output format:',
161
- '{ "tree": <fixed PageNode JSON>, "changes": ["description of each fix applied"] }',
162
- '- Output ONLY the JSON object. No explanation or markdown.',
163
- ].join('\n');
164
- }
165
- //# sourceMappingURL=ai-pipeline.js.map
@@ -1 +0,0 @@
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,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;IACzD,IAAI,GAAG,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IAChD,IAAI,GAAG,CAAC,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,YAA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;AACd,CAAC"}
@@ -1,27 +0,0 @@
1
- import type { BlockTypeDefinition, VariantDefinition } from './types.js';
2
- export interface BlockCatalogOptions {
3
- /**
4
- * Custom blocks to layer on top of the core catalog. Provided either
5
- * inline or — when omitted — pulled from
6
- * `globalThis.__prentaConfig.pageBuilder.blocks` so consumer-defined
7
- * blocks declared in `prenta.config.ts` are picked up automatically.
8
- *
9
- * Custom blocks override core blocks of the same `type`, mirroring the
10
- * "last one wins" semantics consumers already expect from plugin merging.
11
- */
12
- customBlocks?: BlockTypeDefinition[];
13
- /**
14
- * If true (default), include core blocks in the catalog. Set to false to
15
- * build a catalog from custom blocks only.
16
- */
17
- includeCore?: boolean;
18
- }
19
- export declare class BlockCatalog {
20
- private blocks;
21
- constructor(options?: BlockCatalogOptions);
22
- get(type: string): BlockTypeDefinition | undefined;
23
- getAll(): BlockTypeDefinition[];
24
- register(block: BlockTypeDefinition): void;
25
- getVariant(blockType: string, variantName: string): VariantDefinition | undefined;
26
- }
27
- //# sourceMappingURL=blocks.d.ts.map
@@ -1 +0,0 @@
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;AA0QxE,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAiBD,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAkC;gBAEpC,OAAO,GAAE,mBAAwB;IAmB7C,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"}
@@ -1,313 +0,0 @@
1
- const CORE_BLOCKS = [
2
- {
3
- type: 'hero',
4
- label: 'Hero',
5
- icon: 'Star',
6
- description: 'Large banner section with headline, image, and call-to-action',
7
- variants: [
8
- {
9
- name: 'centered',
10
- label: 'Centered',
11
- description: 'Content centered over background image',
12
- },
13
- {
14
- name: 'split-image',
15
- label: 'Split Image',
16
- description: 'Text on one side, image on the other',
17
- },
18
- {
19
- name: 'video-bg',
20
- label: 'Video Background',
21
- description: 'Fullscreen video with text overlay',
22
- },
23
- { name: 'minimal', label: 'Minimal', description: 'Simple text-only hero with no media' },
24
- ],
25
- fields: {
26
- title: { type: 'text', label: 'Title', required: true },
27
- subtitle: { type: 'text', label: 'Subtitle' },
28
- image: { type: 'media', label: 'Image' },
29
- videoUrl: { type: 'url', label: 'Video URL' },
30
- ctaText: { type: 'text', label: 'CTA Text' },
31
- ctaLink: { type: 'url', label: 'CTA Link' },
32
- overlayOpacity: { type: 'number', label: 'Overlay Opacity', min: 0, max: 100 },
33
- },
34
- },
35
- {
36
- type: 'text',
37
- label: 'Text',
38
- icon: 'Type',
39
- description: 'Rich text content block with optional heading',
40
- variants: [
41
- { name: 'prose', label: 'Prose', description: 'Single-column readable text' },
42
- { name: 'two-column', label: 'Two Column', description: 'Text split across two columns' },
43
- {
44
- name: 'with-sidebar',
45
- label: 'With Sidebar',
46
- description: 'Main text with a sidebar annotation',
47
- },
48
- ],
49
- fields: {
50
- body: { type: 'richText', label: 'Body', required: true },
51
- heading: { type: 'text', label: 'Heading' },
52
- headingLevel: {
53
- type: 'select',
54
- label: 'Heading Level',
55
- options: [
56
- { label: 'H2', value: 'h2' },
57
- { label: 'H3', value: 'h3' },
58
- { label: 'H4', value: 'h4' },
59
- ],
60
- },
61
- },
62
- },
63
- {
64
- type: 'image',
65
- label: 'Image',
66
- icon: 'Image',
67
- description: 'Single image with optional caption and link',
68
- variants: [
69
- { name: 'full-width', label: 'Full Width', description: 'Edge-to-edge image' },
70
- { name: 'captioned', label: 'Captioned', description: 'Image with visible caption below' },
71
- { name: 'rounded', label: 'Rounded', description: 'Image with rounded corners' },
72
- {
73
- name: 'side-by-side',
74
- label: 'Side by Side',
75
- description: 'Two images displayed horizontally',
76
- },
77
- ],
78
- fields: {
79
- src: { type: 'media', label: 'Source', required: true },
80
- alt: { type: 'text', label: 'Alt Text', required: true },
81
- caption: { type: 'text', label: 'Caption' },
82
- link: { type: 'url', label: 'Link' },
83
- aspectRatio: {
84
- type: 'select',
85
- label: 'Aspect Ratio',
86
- options: [
87
- { label: 'Auto', value: 'auto' },
88
- { label: '16:9', value: '16:9' },
89
- { label: '4:3', value: '4:3' },
90
- { label: '1:1', value: '1:1' },
91
- ],
92
- },
93
- },
94
- },
95
- {
96
- type: 'cards',
97
- label: 'Cards',
98
- icon: 'LayoutGrid',
99
- description: 'Grid or list of cards with title, description, and image',
100
- variants: [
101
- { name: 'grid-2', label: '2 Column Grid', description: 'Cards in a 2-column grid' },
102
- { name: 'grid-3', label: '3 Column Grid', description: 'Cards in a 3-column grid' },
103
- { name: 'grid-4', label: '4 Column Grid', description: 'Cards in a 4-column grid' },
104
- {
105
- name: 'horizontal',
106
- label: 'Horizontal',
107
- description: 'Cards in a horizontal scrolling row',
108
- },
109
- ],
110
- fields: {
111
- items: {
112
- type: 'array',
113
- label: 'Items',
114
- fields: {
115
- title: { type: 'text', label: 'Title', required: true },
116
- description: { type: 'text', label: 'Description' },
117
- image: { type: 'media', label: 'Image' },
118
- link: { type: 'url', label: 'Link' },
119
- icon: { type: 'text', label: 'Icon' },
120
- },
121
- },
122
- },
123
- },
124
- {
125
- type: 'cta',
126
- label: 'Call to Action',
127
- icon: 'MousePointer',
128
- description: 'Prominent call-to-action with button',
129
- variants: [
130
- { name: 'banner', label: 'Banner', description: 'Full-width colored banner' },
131
- { name: 'inline', label: 'Inline', description: 'Compact inline CTA' },
132
- { name: 'floating', label: 'Floating', description: 'Floating card-style CTA' },
133
- { name: 'split', label: 'Split', description: 'Text on one side, button on the other' },
134
- ],
135
- fields: {
136
- heading: { type: 'text', label: 'Heading', required: true },
137
- body: { type: 'text', label: 'Body' },
138
- buttonText: { type: 'text', label: 'Button Text', required: true },
139
- buttonLink: { type: 'url', label: 'Button Link', required: true },
140
- buttonStyle: {
141
- type: 'select',
142
- label: 'Button Style',
143
- options: [
144
- { label: 'Primary', value: 'primary' },
145
- { label: 'Secondary', value: 'secondary' },
146
- { label: 'Outline', value: 'outline' },
147
- ],
148
- },
149
- },
150
- },
151
- {
152
- type: 'video',
153
- label: 'Video',
154
- icon: 'Play',
155
- description: 'Embedded video player',
156
- variants: [
157
- { name: 'inline', label: 'Inline', description: 'Video embedded directly in the page' },
158
- {
159
- name: 'lightbox',
160
- label: 'Lightbox',
161
- description: 'Thumbnail that opens video in a lightbox',
162
- },
163
- {
164
- name: 'background',
165
- label: 'Background',
166
- description: 'Muted video as a background element',
167
- },
168
- ],
169
- fields: {
170
- url: { type: 'url', label: 'URL', required: true },
171
- poster: { type: 'media', label: 'Poster' },
172
- autoplay: { type: 'boolean', label: 'Autoplay' },
173
- loop: { type: 'boolean', label: 'Loop' },
174
- },
175
- },
176
- {
177
- type: 'gallery',
178
- label: 'Gallery',
179
- icon: 'Grid',
180
- description: 'Collection of images displayed in various layouts',
181
- variants: [
182
- { name: 'grid', label: 'Grid', description: 'Equal-sized image grid' },
183
- { name: 'masonry', label: 'Masonry', description: 'Varied-height masonry layout' },
184
- { name: 'carousel', label: 'Carousel', description: 'Horizontal scrolling carousel' },
185
- { name: 'lightbox', label: 'Lightbox', description: 'Thumbnails that open in a lightbox' },
186
- ],
187
- fields: {
188
- images: {
189
- type: 'array',
190
- label: 'Images',
191
- fields: {
192
- src: { type: 'media', label: 'Source', required: true },
193
- alt: { type: 'text', label: 'Alt Text', required: true },
194
- caption: { type: 'text', label: 'Caption' },
195
- },
196
- },
197
- },
198
- },
199
- {
200
- type: 'faq',
201
- label: 'FAQ',
202
- icon: 'HelpCircle',
203
- description: 'Frequently asked questions list',
204
- variants: [
205
- { name: 'accordion', label: 'Accordion', description: 'Collapsible accordion panels' },
206
- { name: 'list', label: 'List', description: 'All questions visible in a flat list' },
207
- {
208
- name: 'two-column',
209
- label: 'Two Column',
210
- description: 'Questions split across two columns',
211
- },
212
- ],
213
- fields: {
214
- items: {
215
- type: 'array',
216
- label: 'Items',
217
- fields: {
218
- question: { type: 'text', label: 'Question', required: true },
219
- answer: { type: 'richText', label: 'Answer', required: true },
220
- },
221
- },
222
- },
223
- },
224
- {
225
- type: 'form',
226
- label: 'Form',
227
- icon: 'FileText',
228
- description: 'Embedded form from the forms collection',
229
- variants: [
230
- { name: 'contact', label: 'Contact', description: 'Standard contact form layout' },
231
- { name: 'newsletter', label: 'Newsletter', description: 'Compact email signup' },
232
- { name: 'custom', label: 'Custom', description: 'Fully custom form layout' },
233
- ],
234
- fields: {
235
- formId: { type: 'relationship', label: 'Form', relationTo: 'forms' },
236
- successMessage: { type: 'text', label: 'Success Message' },
237
- },
238
- },
239
- {
240
- type: 'code',
241
- label: 'Code',
242
- icon: 'Code',
243
- description: 'Embed raw HTML, JavaScript, or CSS',
244
- variants: [
245
- { name: 'embed', label: 'Embed', description: 'Generic embed code' },
246
- { name: 'html', label: 'HTML', description: 'Raw HTML block' },
247
- { name: 'script', label: 'Script', description: 'JavaScript or tracking script' },
248
- ],
249
- fields: {
250
- content: { type: 'text', label: 'Content', required: true },
251
- language: {
252
- type: 'select',
253
- label: 'Language',
254
- options: [
255
- { label: 'HTML', value: 'html' },
256
- { label: 'JavaScript', value: 'javascript' },
257
- { label: 'CSS', value: 'css' },
258
- ],
259
- },
260
- sandboxed: { type: 'boolean', label: 'Sandboxed' },
261
- },
262
- },
263
- ];
264
- function readCustomBlocksFromGlobalConfig() {
265
- if (typeof globalThis === 'undefined')
266
- return [];
267
- // We read directly from `globalThis` (rather than via `getPrentaConfig()`)
268
- // so this stays synchronous at module-load time and avoids importing the
269
- // wider runtime module from inside page-builder. The shape we need is
270
- // narrow enough that a local typed cast is safer than `as any`.
271
- const config = globalThis
272
- .__prentaConfig;
273
- const blocks = config?.pageBuilder?.blocks;
274
- if (Array.isArray(blocks)) {
275
- return blocks.filter((b) => !!b && typeof b.type === 'string');
276
- }
277
- return [];
278
- }
279
- export class BlockCatalog {
280
- blocks;
281
- constructor(options = {}) {
282
- const includeCore = options.includeCore !== false;
283
- this.blocks = new Map();
284
- if (includeCore) {
285
- for (const block of CORE_BLOCKS) {
286
- this.blocks.set(block.type, block);
287
- }
288
- }
289
- // Pull from explicit `customBlocks` first; otherwise fall back to the
290
- // global config so consumers don't have to thread their custom blocks
291
- // through every BlockEditor / BlockPicker call site.
292
- const custom = options.customBlocks ?? readCustomBlocksFromGlobalConfig();
293
- for (const block of custom) {
294
- this.blocks.set(block.type, block);
295
- }
296
- }
297
- get(type) {
298
- return this.blocks.get(type);
299
- }
300
- getAll() {
301
- return Array.from(this.blocks.values());
302
- }
303
- register(block) {
304
- this.blocks.set(block.type, block);
305
- }
306
- getVariant(blockType, variantName) {
307
- const block = this.blocks.get(blockType);
308
- if (!block)
309
- return undefined;
310
- return block.variants.find((v) => v.name === variantName);
311
- }
312
- }
313
- //# sourceMappingURL=blocks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/page-builder/blocks.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAA0B;IACzC;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,+DAA+D;QAC5E,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,wCAAwC;aACtD;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,sCAAsC;aACpD;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,KA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ACpC,CAAC;IACH,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IACzC,CAAC;IAED,QAAQ,CAAC,KAA0B;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACpC,CAAC;IAED,UAAU,CAAC,SAAiB,EAAE,WAAmB;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAA;QAC5B,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;IAC3D,CAAC;CACF"}
@@ -1,27 +0,0 @@
1
- import type { PageNode } from './types.js';
2
- export interface DesignCheck {
3
- id: string;
4
- label: string;
5
- status: 'good' | 'warning' | 'error';
6
- detail: string;
7
- }
8
- export interface DesignCategory {
9
- name: string;
10
- label: string;
11
- score: number;
12
- maxScore: number;
13
- checks: DesignCheck[];
14
- }
15
- export interface DesignSuggestion {
16
- id: string;
17
- message: string;
18
- severity: 'info' | 'suggestion' | 'important';
19
- category: string;
20
- }
21
- export interface DesignAnalysis {
22
- score: number;
23
- categories: DesignCategory[];
24
- suggestions: DesignSuggestion[];
25
- }
26
- export declare function analyzeDesign(tree: PageNode): DesignAnalysis;
27
- //# sourceMappingURL=design-scorer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"design-scorer.d.ts","sourceRoot":"","sources":["../../src/page-builder/design-scorer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA4D,MAAM,YAAY,CAAA;AAKpG,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACpC,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,WAAW,CAAA;IAC7C,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAChC;AAqnBD,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,CAoB5D"}