@10up/block-renderer-prompt-generator 0.1.4
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 +334 -0
- package/dist/blocks-prompt.d.ts +18 -0
- package/dist/blocks-prompt.d.ts.map +1 -0
- package/dist/blocks-prompt.js +133 -0
- package/dist/blocks-prompt.js.map +1 -0
- package/dist/ignite-prompt.d.ts +24 -0
- package/dist/ignite-prompt.d.ts.map +1 -0
- package/dist/ignite-prompt.js +143 -0
- package/dist/ignite-prompt.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns-prompt.d.ts +18 -0
- package/dist/patterns-prompt.d.ts.map +1 -0
- package/dist/patterns-prompt.js +90 -0
- package/dist/patterns-prompt.js.map +1 -0
- package/dist/section-styles-prompt.d.ts +18 -0
- package/dist/section-styles-prompt.d.ts.map +1 -0
- package/dist/section-styles-prompt.js +87 -0
- package/dist/section-styles-prompt.js.map +1 -0
- package/dist/system-prompt.d.ts +41 -0
- package/dist/system-prompt.d.ts.map +1 -0
- package/dist/system-prompt.js +230 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/tokens-prompt.d.ts +39 -0
- package/dist/tokens-prompt.d.ts.map +1 -0
- package/dist/tokens-prompt.js +214 -0
- package/dist/tokens-prompt.js.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# @10up/block-renderer-prompt-generator
|
|
2
|
+
|
|
3
|
+
Generate AI system prompts with block documentation, design tokens, and patterns. These prompts guide AI assistants in generating valid WordPress block structures.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @10up/block-renderer-prompt-generator
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @10up/block-renderer-prompt-generator
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This package generates comprehensive system prompts for AI assistants that include:
|
|
16
|
+
|
|
17
|
+
1. **Block documentation** - Available blocks with their props and constraints
|
|
18
|
+
2. **Design tokens** - Colors, typography, spacing from theme.json
|
|
19
|
+
3. **Patterns** - Available block patterns that can be referenced
|
|
20
|
+
4. **User preferences** - Style guide and preferred blocks
|
|
21
|
+
5. **Format instructions** - How to structure the JSON output
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### Generate Complete System Prompt
|
|
26
|
+
|
|
27
|
+
The main entry point - generates a full system prompt:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { generateSystemPrompt } from '@10up/block-renderer-prompt-generator';
|
|
31
|
+
|
|
32
|
+
const prompt = generateSystemPrompt({
|
|
33
|
+
catalog: blockCatalog,
|
|
34
|
+
tokens: themeTokens,
|
|
35
|
+
patterns: patternRegistry,
|
|
36
|
+
preferences: userPreferences,
|
|
37
|
+
compact: false
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Use as system prompt for AI
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Generate Minimal Prompt
|
|
44
|
+
|
|
45
|
+
For smaller context windows:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { generateMinimalPrompt } from '@10up/block-renderer-prompt-generator';
|
|
49
|
+
|
|
50
|
+
const prompt = generateMinimalPrompt({
|
|
51
|
+
tokens: themeTokens,
|
|
52
|
+
patterns: patternRegistry,
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Prompt Options
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
interface GeneratePromptOptions {
|
|
60
|
+
/** Block catalog for documentation */
|
|
61
|
+
catalog?: BlockCatalog;
|
|
62
|
+
/** Theme tokens for color/typography docs */
|
|
63
|
+
tokens?: ThemeTokens;
|
|
64
|
+
/** Available patterns */
|
|
65
|
+
patterns?: PatternRegistry;
|
|
66
|
+
/** User preferences */
|
|
67
|
+
preferences?: BlockPreferencesConfig;
|
|
68
|
+
/** Use compact format for smaller context */
|
|
69
|
+
compact?: boolean;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Individual Generators
|
|
74
|
+
|
|
75
|
+
### Block Documentation
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import {
|
|
79
|
+
generateBlocksPrompt,
|
|
80
|
+
generateBlockList,
|
|
81
|
+
generateBlockDocumentation,
|
|
82
|
+
generateNestingRulesPrompt,
|
|
83
|
+
} from '@10up/block-renderer-prompt-generator';
|
|
84
|
+
|
|
85
|
+
// Full block documentation
|
|
86
|
+
const blocksDoc = generateBlocksPrompt(catalog);
|
|
87
|
+
|
|
88
|
+
// Simple list of block names
|
|
89
|
+
const blockList = generateBlockList(catalog);
|
|
90
|
+
// 'core/paragraph, core/heading, core/group, ...'
|
|
91
|
+
|
|
92
|
+
// Documentation for a single block
|
|
93
|
+
const paragraphDoc = generateBlockDocumentation(paragraphDefinition);
|
|
94
|
+
|
|
95
|
+
// Nesting rules documentation
|
|
96
|
+
const nestingDoc = generateNestingRulesPrompt(catalog);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Token Documentation
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import {
|
|
103
|
+
generateTokensPrompt,
|
|
104
|
+
generateColorsPrompt,
|
|
105
|
+
generateGradientsPrompt,
|
|
106
|
+
generateTypographyPrompt,
|
|
107
|
+
generateSpacingPrompt,
|
|
108
|
+
generateShadowsPrompt,
|
|
109
|
+
generateLayoutPrompt,
|
|
110
|
+
} from '@10up/block-renderer-prompt-generator';
|
|
111
|
+
|
|
112
|
+
// Complete token documentation
|
|
113
|
+
const tokensDoc = generateTokensPrompt(tokens);
|
|
114
|
+
|
|
115
|
+
// Individual token types
|
|
116
|
+
const colorsDoc = generateColorsPrompt(tokens);
|
|
117
|
+
const gradientsDoc = generateGradientsPrompt(tokens);
|
|
118
|
+
const typographyDoc = generateTypographyPrompt(tokens);
|
|
119
|
+
const spacingDoc = generateSpacingPrompt(tokens);
|
|
120
|
+
const shadowsDoc = generateShadowsPrompt(tokens);
|
|
121
|
+
const layoutDoc = generateLayoutPrompt(tokens);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Pattern Documentation
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import {
|
|
128
|
+
generatePatternsPrompt,
|
|
129
|
+
generatePatternList,
|
|
130
|
+
generatePatternDocumentation,
|
|
131
|
+
generateCompactPatternList,
|
|
132
|
+
} from '@10up/block-renderer-prompt-generator';
|
|
133
|
+
|
|
134
|
+
// Full pattern documentation
|
|
135
|
+
const patternsDoc = generatePatternsPrompt(patterns);
|
|
136
|
+
|
|
137
|
+
// Simple list of pattern slugs
|
|
138
|
+
const patternList = generatePatternList(patterns);
|
|
139
|
+
// 'theme/hero-section, theme/feature-grid, ...'
|
|
140
|
+
|
|
141
|
+
// Documentation for a single pattern
|
|
142
|
+
const heroDoc = generatePatternDocumentation(heroPattern);
|
|
143
|
+
|
|
144
|
+
// Compact list for smaller context
|
|
145
|
+
const compactList = generateCompactPatternList(patterns);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Section Styles Documentation
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import {
|
|
152
|
+
generateSectionStylesPrompt,
|
|
153
|
+
generateSectionStyleList,
|
|
154
|
+
generateSectionStyleDocumentation,
|
|
155
|
+
generateCompactSectionStyleList,
|
|
156
|
+
} from '@10up/block-renderer-prompt-generator';
|
|
157
|
+
|
|
158
|
+
// Full section styles documentation
|
|
159
|
+
const stylesDoc = generateSectionStylesPrompt(sectionStyles);
|
|
160
|
+
|
|
161
|
+
// Simple list of style names
|
|
162
|
+
const styleList = generateSectionStyleList(sectionStyles);
|
|
163
|
+
|
|
164
|
+
// Documentation for a single section style
|
|
165
|
+
const heroStyleDoc = generateSectionStyleDocumentation('hero', heroStyle);
|
|
166
|
+
|
|
167
|
+
// Compact list for smaller context
|
|
168
|
+
const compactList = generateCompactSectionStyleList(sectionStyles);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Ignite WP Documentation
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import {
|
|
175
|
+
generateIgnitePrompt,
|
|
176
|
+
generateCompactIgnitePrompt,
|
|
177
|
+
} from '@10up/block-renderer-prompt-generator';
|
|
178
|
+
|
|
179
|
+
// Full Ignite WP documentation (typography presets, fluid values)
|
|
180
|
+
const igniteDoc = generateIgnitePrompt(igniteTokens);
|
|
181
|
+
|
|
182
|
+
// Compact version for smaller context
|
|
183
|
+
const compactIgniteDoc = generateCompactIgnitePrompt(igniteTokens);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Critical Styling Rules
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { generateCriticalStylingRules } from '@10up/block-renderer-prompt-generator';
|
|
190
|
+
|
|
191
|
+
// Generate rules for consistent AI styling decisions
|
|
192
|
+
const rules = generateCriticalStylingRules();
|
|
193
|
+
// Returns markdown with best practices for block styling
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Generated Prompt Structure
|
|
197
|
+
|
|
198
|
+
A complete generated prompt includes:
|
|
199
|
+
|
|
200
|
+
```markdown
|
|
201
|
+
# WordPress Block Generation
|
|
202
|
+
|
|
203
|
+
You are generating WordPress blocks using a JSON format...
|
|
204
|
+
|
|
205
|
+
## Block Tree Format
|
|
206
|
+
|
|
207
|
+
The JSON structure you should generate...
|
|
208
|
+
|
|
209
|
+
## Available Blocks
|
|
210
|
+
|
|
211
|
+
### core/paragraph
|
|
212
|
+
Text block with the following props:
|
|
213
|
+
- content (string): The paragraph text
|
|
214
|
+
- dropCap (boolean): Enable drop cap
|
|
215
|
+
...
|
|
216
|
+
|
|
217
|
+
### core/heading
|
|
218
|
+
Heading block with levels 1-6...
|
|
219
|
+
|
|
220
|
+
## Design Tokens
|
|
221
|
+
|
|
222
|
+
### Colors
|
|
223
|
+
Available colors: primary (#0073aa), secondary (#23282d), ...
|
|
224
|
+
|
|
225
|
+
### Typography
|
|
226
|
+
Font sizes: small (13px), medium (16px), large (20px), ...
|
|
227
|
+
|
|
228
|
+
### Spacing
|
|
229
|
+
Spacing scale: 20 (0.5rem), 30 (0.75rem), 40 (1rem), ...
|
|
230
|
+
|
|
231
|
+
## Available Patterns
|
|
232
|
+
|
|
233
|
+
### theme/hero-section
|
|
234
|
+
A full-width hero with heading and CTA...
|
|
235
|
+
|
|
236
|
+
### theme/feature-grid
|
|
237
|
+
Three-column feature grid...
|
|
238
|
+
|
|
239
|
+
## User Preferences
|
|
240
|
+
|
|
241
|
+
### Preferred Blocks
|
|
242
|
+
- core/group (for containers)
|
|
243
|
+
- core/columns (for layouts)
|
|
244
|
+
|
|
245
|
+
### Style Guide
|
|
246
|
+
- Always use constrained layout for groups
|
|
247
|
+
- Prefer semantic heading levels
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Compact Mode
|
|
251
|
+
|
|
252
|
+
For AI models with smaller context windows, use compact mode:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
const prompt = generateSystemPrompt({
|
|
256
|
+
catalog,
|
|
257
|
+
tokens,
|
|
258
|
+
patterns,
|
|
259
|
+
compact: true // Shorter, more concise output
|
|
260
|
+
});
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Compact mode:
|
|
264
|
+
- Uses shorter descriptions
|
|
265
|
+
- Omits detailed attribute documentation
|
|
266
|
+
- Lists only essential tokens
|
|
267
|
+
- Removes examples
|
|
268
|
+
|
|
269
|
+
## Complete Exports
|
|
270
|
+
|
|
271
|
+
### System Prompt
|
|
272
|
+
|
|
273
|
+
| Function | Description |
|
|
274
|
+
|----------|-------------|
|
|
275
|
+
| `generateSystemPrompt(options)` | Generate complete system prompt |
|
|
276
|
+
| `generateMinimalPrompt(options)` | Generate minimal prompt |
|
|
277
|
+
| `generateCriticalStylingRules()` | Generate critical styling rules |
|
|
278
|
+
|
|
279
|
+
### Block Documentation
|
|
280
|
+
|
|
281
|
+
| Function | Description |
|
|
282
|
+
|----------|-------------|
|
|
283
|
+
| `generateBlocksPrompt(catalog)` | Full blocks documentation |
|
|
284
|
+
| `generateBlockList(catalog)` | Simple comma-separated list |
|
|
285
|
+
| `generateBlockDocumentation(definition)` | Single block documentation |
|
|
286
|
+
| `generateNestingRulesPrompt(catalog)` | Nesting rules documentation |
|
|
287
|
+
|
|
288
|
+
### Token Documentation
|
|
289
|
+
|
|
290
|
+
| Function | Description |
|
|
291
|
+
|----------|-------------|
|
|
292
|
+
| `generateTokensPrompt(tokens, options?)` | Complete tokens documentation |
|
|
293
|
+
| `generateColorsPrompt(tokens)` | Color tokens documentation |
|
|
294
|
+
| `generateGradientsPrompt(tokens)` | Gradient tokens documentation |
|
|
295
|
+
| `generateTypographyPrompt(tokens)` | Typography documentation |
|
|
296
|
+
| `generateSpacingPrompt(tokens)` | Spacing tokens documentation |
|
|
297
|
+
| `generateShadowsPrompt(tokens)` | Shadow tokens documentation |
|
|
298
|
+
| `generateLayoutPrompt(tokens)` | Layout settings documentation |
|
|
299
|
+
|
|
300
|
+
### Pattern Documentation
|
|
301
|
+
|
|
302
|
+
| Function | Description |
|
|
303
|
+
|----------|-------------|
|
|
304
|
+
| `generatePatternsPrompt(patterns)` | Full patterns documentation |
|
|
305
|
+
| `generatePatternList(patterns)` | Simple comma-separated list |
|
|
306
|
+
| `generatePatternDocumentation(pattern)` | Single pattern documentation |
|
|
307
|
+
| `generateCompactPatternList(patterns)` | Compact pattern list |
|
|
308
|
+
|
|
309
|
+
### Section Styles Documentation
|
|
310
|
+
|
|
311
|
+
| Function | Description |
|
|
312
|
+
|----------|-------------|
|
|
313
|
+
| `generateSectionStylesPrompt(styles)` | Full section styles documentation |
|
|
314
|
+
| `generateSectionStyleList(styles)` | Simple list of style names |
|
|
315
|
+
| `generateSectionStyleDocumentation(name, style)` | Single section style docs |
|
|
316
|
+
| `generateCompactSectionStyleList(styles)` | Compact section style list |
|
|
317
|
+
|
|
318
|
+
### Ignite WP Documentation
|
|
319
|
+
|
|
320
|
+
| Function | Description |
|
|
321
|
+
|----------|-------------|
|
|
322
|
+
| `generateIgnitePrompt(tokens)` | Full Ignite WP documentation |
|
|
323
|
+
| `generateCompactIgnitePrompt(tokens)` | Compact Ignite WP documentation |
|
|
324
|
+
|
|
325
|
+
### Types
|
|
326
|
+
|
|
327
|
+
| Type | Description |
|
|
328
|
+
|------|-------------|
|
|
329
|
+
| `GeneratePromptOptions` | Options for prompt generation |
|
|
330
|
+
| `TokenPromptOptions` | Options for token prompt generation |
|
|
331
|
+
|
|
332
|
+
## License
|
|
333
|
+
|
|
334
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BlockDefinition, BlockCatalog } from '@10up/block-renderer-core';
|
|
2
|
+
/**
|
|
3
|
+
* Generates documentation for a single block.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateBlockDocumentation(definition: BlockDefinition): string;
|
|
6
|
+
/**
|
|
7
|
+
* Generates a simple block list for prompts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateBlockList(catalog: BlockCatalog): string;
|
|
10
|
+
/**
|
|
11
|
+
* Generates full block documentation for prompts.
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateBlocksPrompt(catalog: BlockCatalog): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generates nesting rules documentation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateNestingRulesPrompt(catalog: BlockCatalog): string;
|
|
18
|
+
//# sourceMappingURL=blocks-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks-prompt.d.ts","sourceRoot":"","sources":["../src/blocks-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE/E;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAkD9E;AAkBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAwB/D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAuBlE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAkCxE"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates documentation for a single block.
|
|
3
|
+
*/
|
|
4
|
+
export function generateBlockDocumentation(definition) {
|
|
5
|
+
const lines = [];
|
|
6
|
+
// Block name and title
|
|
7
|
+
lines.push(`### ${definition.name}`);
|
|
8
|
+
if (definition.title) {
|
|
9
|
+
lines.push(`**${definition.title}**`);
|
|
10
|
+
}
|
|
11
|
+
if (definition.description) {
|
|
12
|
+
lines.push(definition.description);
|
|
13
|
+
}
|
|
14
|
+
lines.push('');
|
|
15
|
+
// Supports InnerBlocks
|
|
16
|
+
if (definition.hasInnerBlocks) {
|
|
17
|
+
lines.push('**Supports children:** Yes');
|
|
18
|
+
}
|
|
19
|
+
// Parent constraints
|
|
20
|
+
if (definition.parent && definition.parent.length > 0) {
|
|
21
|
+
lines.push(`**Must be inside:** ${definition.parent.join(', ')}`);
|
|
22
|
+
}
|
|
23
|
+
// Ancestor constraints
|
|
24
|
+
if (definition.ancestor && definition.ancestor.length > 0) {
|
|
25
|
+
lines.push(`**Must have ancestor:** ${definition.ancestor.join(', ')}`);
|
|
26
|
+
}
|
|
27
|
+
// Allowed children
|
|
28
|
+
if (definition.allowedBlocks) {
|
|
29
|
+
if (definition.allowedBlocks === true) {
|
|
30
|
+
lines.push('**Can contain:** any block');
|
|
31
|
+
}
|
|
32
|
+
else if (definition.allowedBlocks.length > 0) {
|
|
33
|
+
lines.push(`**Can contain:** ${definition.allowedBlocks.join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Multiple constraint
|
|
37
|
+
if (definition.multiple === false) {
|
|
38
|
+
lines.push('**Note:** Can only appear once per post');
|
|
39
|
+
}
|
|
40
|
+
// Dynamic block
|
|
41
|
+
if (definition.isDynamic) {
|
|
42
|
+
lines.push('**Type:** Dynamic (server-rendered)');
|
|
43
|
+
}
|
|
44
|
+
lines.push('');
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Groups blocks by category.
|
|
49
|
+
*/
|
|
50
|
+
function groupByCategory(catalog) {
|
|
51
|
+
const groups = new Map();
|
|
52
|
+
for (const definition of catalog.values()) {
|
|
53
|
+
const category = definition.category || 'other';
|
|
54
|
+
const existing = groups.get(category) || [];
|
|
55
|
+
existing.push(definition);
|
|
56
|
+
groups.set(category, existing);
|
|
57
|
+
}
|
|
58
|
+
return groups;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generates a simple block list for prompts.
|
|
62
|
+
*/
|
|
63
|
+
export function generateBlockList(catalog) {
|
|
64
|
+
const lines = ['## Available Blocks', ''];
|
|
65
|
+
const grouped = groupByCategory(catalog);
|
|
66
|
+
// Sort categories
|
|
67
|
+
const sortedCategories = Array.from(grouped.keys()).sort();
|
|
68
|
+
for (const category of sortedCategories) {
|
|
69
|
+
const blocks = grouped.get(category) || [];
|
|
70
|
+
// Format category name
|
|
71
|
+
const categoryName = category.charAt(0).toUpperCase() + category.slice(1);
|
|
72
|
+
lines.push(`### ${categoryName}`, '');
|
|
73
|
+
for (const block of blocks) {
|
|
74
|
+
const inner = block.hasInnerBlocks ? ' (supports children)' : '';
|
|
75
|
+
lines.push(`- \`${block.name}\`: ${block.title || block.name}${inner}`);
|
|
76
|
+
}
|
|
77
|
+
lines.push('');
|
|
78
|
+
}
|
|
79
|
+
return lines.join('\n');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generates full block documentation for prompts.
|
|
83
|
+
*/
|
|
84
|
+
export function generateBlocksPrompt(catalog) {
|
|
85
|
+
const lines = [
|
|
86
|
+
'## Available Blocks',
|
|
87
|
+
'',
|
|
88
|
+
'Use these blocks when generating content:',
|
|
89
|
+
'',
|
|
90
|
+
];
|
|
91
|
+
const grouped = groupByCategory(catalog);
|
|
92
|
+
const sortedCategories = Array.from(grouped.keys()).sort();
|
|
93
|
+
for (const category of sortedCategories) {
|
|
94
|
+
const blocks = grouped.get(category) || [];
|
|
95
|
+
const categoryName = category.charAt(0).toUpperCase() + category.slice(1);
|
|
96
|
+
lines.push(`### ${categoryName}`, '');
|
|
97
|
+
for (const block of blocks) {
|
|
98
|
+
lines.push(generateBlockDocumentation(block));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return lines.join('\n');
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Generates nesting rules documentation.
|
|
105
|
+
*/
|
|
106
|
+
export function generateNestingRulesPrompt(catalog) {
|
|
107
|
+
const lines = [
|
|
108
|
+
'## Nesting Rules',
|
|
109
|
+
'',
|
|
110
|
+
'Some blocks have specific nesting requirements:',
|
|
111
|
+
'',
|
|
112
|
+
];
|
|
113
|
+
for (const definition of catalog.values()) {
|
|
114
|
+
const hasConstraints = definition.parent?.length ||
|
|
115
|
+
definition.ancestor?.length ||
|
|
116
|
+
(definition.allowedBlocks && definition.allowedBlocks !== true);
|
|
117
|
+
if (!hasConstraints)
|
|
118
|
+
continue;
|
|
119
|
+
lines.push(`**${definition.name}**:`);
|
|
120
|
+
if (definition.parent?.length) {
|
|
121
|
+
lines.push(` - Must be direct child of: ${definition.parent.join(', ')}`);
|
|
122
|
+
}
|
|
123
|
+
if (definition.ancestor?.length) {
|
|
124
|
+
lines.push(` - Must be nested inside: ${definition.ancestor.join(', ')}`);
|
|
125
|
+
}
|
|
126
|
+
if (definition.allowedBlocks && definition.allowedBlocks !== true) {
|
|
127
|
+
lines.push(` - Can only contain: ${definition.allowedBlocks.join(', ')}`);
|
|
128
|
+
}
|
|
129
|
+
lines.push('');
|
|
130
|
+
}
|
|
131
|
+
return lines.join('\n');
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=blocks-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks-prompt.js","sourceRoot":"","sources":["../src/blocks-prompt.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAA2B;IACpE,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,uBAAuB;IACvB,KAAK,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACrC,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,KAAK,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,uBAAuB;IACvB,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC3C,CAAC;IAED,qBAAqB;IACrB,IAAI,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,KAAK,CAAC,IAAI,CAAC,uBAAuB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,uBAAuB;IACvB,IAAI,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,2BAA2B,UAAU,CAAC,QAAQ,CAAC,IAAI,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KAAK,CAAC,IAAI,CAAC,gCAAgC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,8BAA8B,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YAClE,KAAK,CAAC,IAAI,CAAC,yBAAyB,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ignite WP Prompt Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates AI-friendly documentation for Ignite WP features:
|
|
5
|
+
* - Color & Style Hierarchy
|
|
6
|
+
* - Section Styles with class names
|
|
7
|
+
* - Typography Presets with class names
|
|
8
|
+
* - Fluid Typography tokens
|
|
9
|
+
* - Fluid Spacing tokens
|
|
10
|
+
*/
|
|
11
|
+
import type { IgniteTokens, SectionStyle } from '@10up/block-renderer-theme-json';
|
|
12
|
+
/**
|
|
13
|
+
* Generate the Ignite WP prompt section
|
|
14
|
+
*
|
|
15
|
+
* @param igniteTokens - Extracted Ignite tokens
|
|
16
|
+
* @param sectionStyles - Section styles from the theme (optional)
|
|
17
|
+
* @returns Markdown formatted prompt content
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateIgnitePrompt(igniteTokens: IgniteTokens, sectionStyles?: SectionStyle[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a compact Ignite prompt (for reduced token usage)
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateCompactIgnitePrompt(igniteTokens: IgniteTokens, sectionStyles?: SectionStyle[]): string;
|
|
24
|
+
//# sourceMappingURL=ignite-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignite-prompt.d.ts","sourceRoot":"","sources":["../src/ignite-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACb,MAAM,iCAAiC,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,YAAY,EAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,GAC7B,MAAM,CAwGR;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,EAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,GAC7B,MAAM,CA6BR"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ignite WP Prompt Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates AI-friendly documentation for Ignite WP features:
|
|
5
|
+
* - Color & Style Hierarchy
|
|
6
|
+
* - Section Styles with class names
|
|
7
|
+
* - Typography Presets with class names
|
|
8
|
+
* - Fluid Typography tokens
|
|
9
|
+
* - Fluid Spacing tokens
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Generate the Ignite WP prompt section
|
|
13
|
+
*
|
|
14
|
+
* @param igniteTokens - Extracted Ignite tokens
|
|
15
|
+
* @param sectionStyles - Section styles from the theme (optional)
|
|
16
|
+
* @returns Markdown formatted prompt content
|
|
17
|
+
*/
|
|
18
|
+
export function generateIgnitePrompt(igniteTokens, sectionStyles) {
|
|
19
|
+
const lines = ['## Ignite WP Extensions', ''];
|
|
20
|
+
// Color and Style Hierarchy (most important guidance)
|
|
21
|
+
lines.push('### Color & Style Hierarchy', '');
|
|
22
|
+
lines.push('**IMPORTANT:** Follow this priority order for styling:');
|
|
23
|
+
lines.push('');
|
|
24
|
+
lines.push('1. **Section Styles** (highest priority) - Use for container blocks (groups, columns)');
|
|
25
|
+
lines.push(' - Apply via `className: "is-style-{slug}"` on `core/group` or `core/columns`');
|
|
26
|
+
lines.push(' - Section styles automatically set text, background, link colors, and scoped CSS variables');
|
|
27
|
+
lines.push(' - Child elements inherit colors automatically');
|
|
28
|
+
lines.push('');
|
|
29
|
+
lines.push('2. **Semantic Color Variables** - Use for element colors that should inherit from context');
|
|
30
|
+
lines.push(' - `var(--wp--custom--color--text--primary)` - Main text color (inherits from section)');
|
|
31
|
+
lines.push(' - `var(--wp--custom--color--text--secondary)` - Secondary text');
|
|
32
|
+
lines.push(' - `var(--wp--custom--color--accent)` - Accent/link color');
|
|
33
|
+
lines.push(' - These adapt automatically when inside different section styles');
|
|
34
|
+
lines.push('');
|
|
35
|
+
lines.push('3. **Raw Colors** (avoid) - Break inheritance and should rarely be used');
|
|
36
|
+
lines.push(' - Only use when you need a specific color that should NOT change based on context');
|
|
37
|
+
lines.push('');
|
|
38
|
+
// Section Styles Summary
|
|
39
|
+
if (sectionStyles && sectionStyles.length > 0) {
|
|
40
|
+
lines.push('### Available Section Styles', '');
|
|
41
|
+
lines.push('| Style | Class | Background | Text |');
|
|
42
|
+
lines.push('|-------|-------|------------|------|');
|
|
43
|
+
for (const style of sectionStyles) {
|
|
44
|
+
const className = `is-style-${style.slug}`;
|
|
45
|
+
const bg = style.styles.global?.color?.background || '-';
|
|
46
|
+
const text = style.styles.global?.color?.text || '-';
|
|
47
|
+
lines.push(`| ${style.title} | \`${className}\` | ${bg} | ${text} |`);
|
|
48
|
+
}
|
|
49
|
+
lines.push('');
|
|
50
|
+
lines.push('**Usage Example:**');
|
|
51
|
+
lines.push('```json');
|
|
52
|
+
lines.push('{');
|
|
53
|
+
lines.push(' "key": "hero-section",');
|
|
54
|
+
lines.push(' "type": "core/group",');
|
|
55
|
+
lines.push(' "props": {');
|
|
56
|
+
lines.push(' "className": "is-style-surface-contrast",');
|
|
57
|
+
lines.push(' "layout": { "type": "constrained" }');
|
|
58
|
+
lines.push(' },');
|
|
59
|
+
lines.push(' "children": ["heading-1", "paragraph-1"]');
|
|
60
|
+
lines.push('}');
|
|
61
|
+
lines.push('```');
|
|
62
|
+
lines.push('');
|
|
63
|
+
}
|
|
64
|
+
// Typography Presets
|
|
65
|
+
if (igniteTokens.typographyPresets.length > 0) {
|
|
66
|
+
lines.push('### Typography Presets', '');
|
|
67
|
+
lines.push('**IMPORTANT:** Always prefer typography presets over using font size tokens directly.');
|
|
68
|
+
lines.push('Apply presets using BOTH the `typographyPreset` attribute AND the `className`.');
|
|
69
|
+
lines.push('');
|
|
70
|
+
lines.push('| Preset | Slug | Class Name | Font Size | Weight |');
|
|
71
|
+
lines.push('|--------|------|------------|-----------|--------|');
|
|
72
|
+
for (const preset of igniteTokens.typographyPresets) {
|
|
73
|
+
lines.push(`| ${preset.name} | \`${preset.slug}\` | \`is-typography-preset-${preset.slug}\` | ${preset.fontSize} | ${preset.fontWeight || '-'} |`);
|
|
74
|
+
}
|
|
75
|
+
lines.push('');
|
|
76
|
+
lines.push('**Usage Example:**');
|
|
77
|
+
lines.push('```json');
|
|
78
|
+
lines.push('{');
|
|
79
|
+
lines.push(' "key": "heading-1",');
|
|
80
|
+
lines.push(' "type": "core/heading",');
|
|
81
|
+
lines.push(' "props": {');
|
|
82
|
+
lines.push(' "content": "Welcome",');
|
|
83
|
+
lines.push(' "level": 1,');
|
|
84
|
+
lines.push(' "typographyPreset": "display-lg",');
|
|
85
|
+
lines.push(' "className": "is-typography-preset-display-lg"');
|
|
86
|
+
lines.push(' }');
|
|
87
|
+
lines.push('}');
|
|
88
|
+
lines.push('```');
|
|
89
|
+
lines.push('');
|
|
90
|
+
}
|
|
91
|
+
// Fluid Typography
|
|
92
|
+
if (Object.keys(igniteTokens.fluidTypography).length > 0) {
|
|
93
|
+
lines.push('### Fluid Typography Tokens', '');
|
|
94
|
+
lines.push('These custom properties use `clamp()` for responsive sizing.');
|
|
95
|
+
lines.push('');
|
|
96
|
+
lines.push('**Note:** Prefer typography presets over these tokens when possible.');
|
|
97
|
+
lines.push('');
|
|
98
|
+
for (const [path, value] of Object.entries(igniteTokens.fluidTypography)) {
|
|
99
|
+
const varName = `--wp--custom--${path.replace(/\./g, '--')}`;
|
|
100
|
+
lines.push(`- \`${varName}\`: min=${value.min}, max=${value.max}`);
|
|
101
|
+
}
|
|
102
|
+
lines.push('');
|
|
103
|
+
}
|
|
104
|
+
// Fluid Spacing
|
|
105
|
+
if (Object.keys(igniteTokens.fluidSpacing).length > 0) {
|
|
106
|
+
lines.push('### Fluid Spacing Tokens', '');
|
|
107
|
+
lines.push('These custom properties use `clamp()` for responsive spacing:');
|
|
108
|
+
lines.push('');
|
|
109
|
+
for (const [path, value] of Object.entries(igniteTokens.fluidSpacing)) {
|
|
110
|
+
const varName = `--wp--custom--${path.replace(/\./g, '--')}`;
|
|
111
|
+
lines.push(`- \`${varName}\`: min=${value.min}, max=${value.max}`);
|
|
112
|
+
}
|
|
113
|
+
lines.push('');
|
|
114
|
+
}
|
|
115
|
+
return lines.join('\n');
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Generate a compact Ignite prompt (for reduced token usage)
|
|
119
|
+
*/
|
|
120
|
+
export function generateCompactIgnitePrompt(igniteTokens, sectionStyles) {
|
|
121
|
+
const lines = ['## Ignite WP', ''];
|
|
122
|
+
// Compact hierarchy guidance
|
|
123
|
+
lines.push('**Style Priority:** Section Styles > Semantic Colors > Raw Colors');
|
|
124
|
+
lines.push('');
|
|
125
|
+
// Section Styles (compact)
|
|
126
|
+
if (sectionStyles && sectionStyles.length > 0) {
|
|
127
|
+
lines.push('**Section Styles:** ' + sectionStyles.map(s => `\`is-style-${s.slug}\``).join(', '));
|
|
128
|
+
lines.push('');
|
|
129
|
+
}
|
|
130
|
+
// Typography Presets (compact)
|
|
131
|
+
if (igniteTokens.typographyPresets.length > 0) {
|
|
132
|
+
lines.push('**Typography Presets:** Prefer over font-size tokens. Use BOTH `typographyPreset` attribute AND `className: "is-typography-preset-{slug}"`.');
|
|
133
|
+
lines.push(igniteTokens.typographyPresets.map(p => `\`${p.slug}\``).join(', '));
|
|
134
|
+
lines.push('');
|
|
135
|
+
}
|
|
136
|
+
// Fluid Typography (compact)
|
|
137
|
+
if (Object.keys(igniteTokens.fluidTypography).length > 0) {
|
|
138
|
+
lines.push('**Fluid Typography:** ' + Object.keys(igniteTokens.fluidTypography).map(path => `\`--wp--custom--${path.replace(/\./g, '--')}\``).join(', '));
|
|
139
|
+
lines.push('');
|
|
140
|
+
}
|
|
141
|
+
return lines.join('\n');
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=ignite-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignite-prompt.js","sourceRoot":"","sources":["../src/ignite-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,YAA0B,EAC1B,aAA8B;IAE9B,MAAM,KAAK,GAAa,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;IAExD,sDAAsD;IACtD,KAAK,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACrE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,uFAAuF,CAAC,CAAC;IACpG,KAAK,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;IAC9F,KAAK,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;IAC5G,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;IAC/D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,2FAA2F,CAAC,C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