@10up/block-renderer-block-schemas 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 +359 -0
- package/dist/__benchmarks__/generator.bench.d.ts +5 -0
- package/dist/__benchmarks__/generator.bench.d.ts.map +1 -0
- package/dist/__benchmarks__/generator.bench.js +304 -0
- package/dist/__benchmarks__/generator.bench.js.map +1 -0
- package/dist/generator.d.ts +35 -0
- package/dist/generator.d.ts.map +1 -0
- package/dist/generator.js +195 -0
- package/dist/generator.js.map +1 -0
- package/dist/globals.d.ts +72 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +74 -0
- package/dist/globals.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/required-attributes.d.ts +30 -0
- package/dist/required-attributes.d.ts.map +1 -0
- package/dist/required-attributes.js +54 -0
- package/dist/required-attributes.js.map +1 -0
- package/dist/supports-resolver.d.ts +109 -0
- package/dist/supports-resolver.d.ts.map +1 -0
- package/dist/supports-resolver.js +285 -0
- package/dist/supports-resolver.js.map +1 -0
- package/dist/type-mapper.d.ts +39 -0
- package/dist/type-mapper.d.ts.map +1 -0
- package/dist/type-mapper.js +107 -0
- package/dist/type-mapper.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# @10up/block-renderer-block-schemas
|
|
2
|
+
|
|
3
|
+
Parse WordPress `block.json` files and generate Zod validation schemas. This package handles the complex mapping between WordPress block attribute definitions and runtime-validated Zod schemas.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @10up/block-renderer-block-schemas
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @10up/block-renderer-block-schemas
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
WordPress blocks define their attributes in `block.json` files using a specific schema. This package:
|
|
16
|
+
|
|
17
|
+
1. **Type Mapping** - Converts WordPress attribute types (`string`, `rich-text`, `object`, etc.) to Zod schemas
|
|
18
|
+
2. **Supports Resolution** - Determines which attributes are auto-generated by the `supports` configuration
|
|
19
|
+
3. **Style Schema Generation** - Creates properly typed schemas for the complex `style` attribute
|
|
20
|
+
4. **Global Attributes** - Handles always-present attributes like `lock`, `metadata`, and `className`
|
|
21
|
+
5. **Definition Generation** - Combines all of the above into complete `BlockDefinition` objects
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### Generate Block Definition
|
|
26
|
+
|
|
27
|
+
The main entry point - creates a complete `BlockDefinition` from a `block.json` object:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { generateBlockDefinition } from '@10up/block-renderer-block-schemas';
|
|
31
|
+
|
|
32
|
+
const blockJson = {
|
|
33
|
+
name: 'core/paragraph',
|
|
34
|
+
title: 'Paragraph',
|
|
35
|
+
attributes: {
|
|
36
|
+
content: { type: 'rich-text', source: 'rich-text' },
|
|
37
|
+
dropCap: { type: 'boolean', default: false }
|
|
38
|
+
},
|
|
39
|
+
supports: {
|
|
40
|
+
color: { background: true, text: true },
|
|
41
|
+
typography: { fontSize: true }
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const definition = generateBlockDefinition(blockJson);
|
|
46
|
+
// definition.schema validates: content, dropCap, backgroundColor, textColor,
|
|
47
|
+
// fontSize, style, lock, metadata, className
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Generator Options
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface GeneratorOptions {
|
|
54
|
+
/** Include supports-generated attributes (default: true) */
|
|
55
|
+
includeSupportsAttributes?: boolean;
|
|
56
|
+
/** Include global attributes - lock, metadata (default: true) */
|
|
57
|
+
includeGlobalAttributes?: boolean;
|
|
58
|
+
/** Include className attribute (default: true) */
|
|
59
|
+
includeClassName?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const definition = generateBlockDefinition(blockJson, {
|
|
63
|
+
includeSupportsAttributes: true,
|
|
64
|
+
includeGlobalAttributes: false, // Skip lock/metadata
|
|
65
|
+
includeClassName: true,
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Generate Multiple Definitions
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { generateBlockDefinitions } from '@10up/block-renderer-block-schemas';
|
|
73
|
+
|
|
74
|
+
const blockJsons = [paragraphBlock, headingBlock, groupBlock];
|
|
75
|
+
const catalog = generateBlockDefinitions(blockJsons);
|
|
76
|
+
// Returns Map<string, BlockDefinition>
|
|
77
|
+
|
|
78
|
+
const paragraphDef = catalog.get('core/paragraph');
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Type Mapping
|
|
82
|
+
|
|
83
|
+
Maps WordPress attribute types to Zod schemas:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { mapTypeToZod } from '@10up/block-renderer-block-schemas';
|
|
87
|
+
|
|
88
|
+
mapTypeToZod('string'); // z.string()
|
|
89
|
+
mapTypeToZod('number'); // z.number()
|
|
90
|
+
mapTypeToZod('integer'); // z.number().int()
|
|
91
|
+
mapTypeToZod('boolean'); // z.boolean()
|
|
92
|
+
mapTypeToZod('rich-text'); // z.string()
|
|
93
|
+
mapTypeToZod('object'); // z.record(z.unknown())
|
|
94
|
+
mapTypeToZod('array'); // z.array(z.unknown())
|
|
95
|
+
mapTypeToZod('null'); // z.null()
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Union Types
|
|
99
|
+
|
|
100
|
+
WordPress attributes can have multiple types:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { createUnionSchema } from '@10up/block-renderer-block-schemas';
|
|
104
|
+
|
|
105
|
+
// { type: ['string', 'number'] }
|
|
106
|
+
createUnionSchema(['string', 'number']); // z.union([z.string(), z.number()])
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Attribute to Schema
|
|
110
|
+
|
|
111
|
+
Full attribute definition to Zod schema:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { attributeToZodSchema, attributesToZodSchema } from '@10up/block-renderer-block-schemas';
|
|
115
|
+
|
|
116
|
+
// Single attribute with enum
|
|
117
|
+
attributeToZodSchema({
|
|
118
|
+
type: 'string',
|
|
119
|
+
enum: ['left', 'center', 'right'],
|
|
120
|
+
default: 'left'
|
|
121
|
+
});
|
|
122
|
+
// z.union([z.literal('left'), z.literal('center'), z.literal('right')]).default('left').optional()
|
|
123
|
+
|
|
124
|
+
// Multiple attributes
|
|
125
|
+
const schema = attributesToZodSchema({
|
|
126
|
+
content: { type: 'string' },
|
|
127
|
+
level: { type: 'number', default: 2 }
|
|
128
|
+
});
|
|
129
|
+
// z.object({ content: z.string().optional(), level: z.number().default(2).optional() })
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Supports Resolution
|
|
133
|
+
|
|
134
|
+
WordPress `supports` configuration auto-generates certain attributes. This package resolves them:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
import { resolveSupportsToAttributes } from '@10up/block-renderer-block-schemas';
|
|
138
|
+
|
|
139
|
+
const supports = {
|
|
140
|
+
anchor: true,
|
|
141
|
+
align: ['wide', 'full'],
|
|
142
|
+
color: { background: true, text: true, gradients: true },
|
|
143
|
+
typography: { fontSize: true, fontFamily: true },
|
|
144
|
+
border: { color: true, radius: true },
|
|
145
|
+
shadow: true
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const attributes = resolveSupportsToAttributes(supports);
|
|
149
|
+
// Returns attribute definitions for:
|
|
150
|
+
// - anchor: string
|
|
151
|
+
// - align: enum ['wide', 'full']
|
|
152
|
+
// - backgroundColor: string
|
|
153
|
+
// - textColor: string
|
|
154
|
+
// - gradient: string
|
|
155
|
+
// - fontSize: string
|
|
156
|
+
// - fontFamily: string
|
|
157
|
+
// - borderColor: string
|
|
158
|
+
// - shadow: string
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Style Schema
|
|
162
|
+
|
|
163
|
+
The `style` attribute has a complex nested structure. This package generates properly typed schemas:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { createStyleSchema } from '@10up/block-renderer-block-schemas';
|
|
167
|
+
|
|
168
|
+
const styleSchema = createStyleSchema({
|
|
169
|
+
color: { background: true, text: true },
|
|
170
|
+
typography: { fontSize: true, lineHeight: true },
|
|
171
|
+
spacing: { padding: true, margin: true },
|
|
172
|
+
border: { color: true, radius: true }
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Validates:
|
|
176
|
+
// {
|
|
177
|
+
// color: { background?: string, text?: string },
|
|
178
|
+
// typography: { fontSize?: string, lineHeight?: string },
|
|
179
|
+
// spacing: {
|
|
180
|
+
// padding?: { top?: string, right?: string, bottom?: string, left?: string },
|
|
181
|
+
// margin?: { top?: string, right?: string, bottom?: string, left?: string }
|
|
182
|
+
// },
|
|
183
|
+
// border: { color?: string, radius?: string | { topLeft?, topRight?, bottomLeft?, bottomRight? } }
|
|
184
|
+
// }
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Layout Schema
|
|
188
|
+
|
|
189
|
+
For blocks with layout support:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
import { createLayoutSchema } from '@10up/block-renderer-block-schemas';
|
|
193
|
+
|
|
194
|
+
const layoutSchema = createLayoutSchema({ layout: true });
|
|
195
|
+
// Validates:
|
|
196
|
+
// {
|
|
197
|
+
// type?: 'constrained' | 'flex' | 'flow' | 'grid',
|
|
198
|
+
// justifyContent?: string,
|
|
199
|
+
// orientation?: 'horizontal' | 'vertical',
|
|
200
|
+
// flexWrap?: 'wrap' | 'nowrap',
|
|
201
|
+
// contentSize?: string,
|
|
202
|
+
// wideSize?: string,
|
|
203
|
+
// columnCount?: number,
|
|
204
|
+
// minimumColumnWidth?: string
|
|
205
|
+
// }
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Global Attributes
|
|
209
|
+
|
|
210
|
+
Attributes that exist on every block:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import {
|
|
214
|
+
lockSchema,
|
|
215
|
+
metadataSchema,
|
|
216
|
+
getGlobalAttributeDefinitions,
|
|
217
|
+
getGlobalAttributeSchemas,
|
|
218
|
+
getClassNameAttribute,
|
|
219
|
+
getClassNameSchema,
|
|
220
|
+
} from '@10up/block-renderer-block-schemas';
|
|
221
|
+
|
|
222
|
+
// Lock attribute - controls block locking
|
|
223
|
+
lockSchema.parse({ move: false, remove: true });
|
|
224
|
+
|
|
225
|
+
// Metadata attribute - block bindings, name, overrides
|
|
226
|
+
metadataSchema.parse({
|
|
227
|
+
name: 'my-block-instance',
|
|
228
|
+
bindings: {
|
|
229
|
+
content: { source: 'core/post-meta', args: { key: 'my_meta' } }
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Get all global attribute definitions
|
|
234
|
+
const globals = getGlobalAttributeDefinitions();
|
|
235
|
+
// { lock: {...}, metadata: {...} }
|
|
236
|
+
|
|
237
|
+
// className depends on supports.customClassName
|
|
238
|
+
const classNameAttr = getClassNameAttribute({ customClassName: true });
|
|
239
|
+
// { className: { type: 'string' } }
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Block Detection Utilities
|
|
243
|
+
|
|
244
|
+
### Dynamic Block Detection
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
import { isDynamicBlock } from '@10up/block-renderer-block-schemas';
|
|
248
|
+
|
|
249
|
+
isDynamicBlock({ name: 'core/paragraph' }); // false
|
|
250
|
+
isDynamicBlock({ name: 'core/latest-posts' }); // true
|
|
251
|
+
isDynamicBlock({ name: 'my/block', render: 'file:./render.php' }); // true
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Dynamic blocks are server-rendered and include:
|
|
255
|
+
- Blocks with a `render` property in block.json
|
|
256
|
+
- Known dynamic core blocks (archives, latest-posts, query, search, etc.)
|
|
257
|
+
|
|
258
|
+
### Inner Blocks Detection
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { hasInnerBlocksSupport } from '@10up/block-renderer-block-schemas';
|
|
262
|
+
|
|
263
|
+
hasInnerBlocksSupport({ name: 'core/paragraph' }); // false
|
|
264
|
+
hasInnerBlocksSupport({ name: 'core/group' }); // true
|
|
265
|
+
hasInnerBlocksSupport({ name: 'my/block', allowedBlocks: ['core/paragraph'] }); // true
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Required Attributes
|
|
269
|
+
|
|
270
|
+
Some core blocks require specific attributes to render meaningful output. For example, `core/image` needs a `url` attribute - without it, the block renders nothing.
|
|
271
|
+
|
|
272
|
+
This information cannot be determined from `block.json` alone, so we maintain a static list of required attributes for core blocks:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
import {
|
|
276
|
+
CORE_REQUIRED_ATTRIBUTES,
|
|
277
|
+
getRequiredAttributes,
|
|
278
|
+
hasRequiredAttributes,
|
|
279
|
+
} from '@10up/block-renderer-block-schemas';
|
|
280
|
+
|
|
281
|
+
// Get required attributes for a specific block
|
|
282
|
+
getRequiredAttributes('core/image'); // ['url']
|
|
283
|
+
getRequiredAttributes('core/video'); // ['src']
|
|
284
|
+
getRequiredAttributes('core/embed'); // ['url']
|
|
285
|
+
getRequiredAttributes('core/pattern'); // ['slug']
|
|
286
|
+
|
|
287
|
+
// Check if a block has required attributes
|
|
288
|
+
hasRequiredAttributes('core/image'); // true
|
|
289
|
+
hasRequiredAttributes('core/paragraph'); // false
|
|
290
|
+
|
|
291
|
+
// Full list of blocks with required attributes
|
|
292
|
+
console.log(CORE_REQUIRED_ATTRIBUTES);
|
|
293
|
+
// {
|
|
294
|
+
// 'core/image': ['url'],
|
|
295
|
+
// 'core/video': ['src'],
|
|
296
|
+
// 'core/audio': ['src'],
|
|
297
|
+
// 'core/file': ['href'],
|
|
298
|
+
// 'core/embed': ['url'],
|
|
299
|
+
// 'core/pattern': ['slug'],
|
|
300
|
+
// 'core/template-part': ['slug'],
|
|
301
|
+
// 'core/shortcode': ['text'],
|
|
302
|
+
// 'core/html': ['content'],
|
|
303
|
+
// 'core/block': ['ref'],
|
|
304
|
+
// 'core/navigation-link': ['label', 'url'],
|
|
305
|
+
// 'core/social-link': ['service'],
|
|
306
|
+
// }
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
When generating schemas, required attributes are automatically marked as non-optional in the Zod schema, ensuring validation fails if they're missing.
|
|
310
|
+
|
|
311
|
+
## Complete Exports
|
|
312
|
+
|
|
313
|
+
### Functions
|
|
314
|
+
|
|
315
|
+
| Function | Description |
|
|
316
|
+
|----------|-------------|
|
|
317
|
+
| `generateBlockDefinition(blockJson, options?)` | Generate complete BlockDefinition from block.json |
|
|
318
|
+
| `generateBlockDefinitions(blockJsons, options?)` | Generate definitions for multiple blocks |
|
|
319
|
+
| `mapTypeToZod(type)` | Map single WordPress type to Zod schema |
|
|
320
|
+
| `createUnionSchema(types)` | Create Zod union from multiple types |
|
|
321
|
+
| `attributeToZodSchema(attr, options?)` | Convert attribute definition to Zod schema |
|
|
322
|
+
| `attributesToZodSchema(attrs, options?)` | Convert all attributes to Zod object schema |
|
|
323
|
+
| `resolveSupportsToAttributes(supports)` | Get generated attributes from supports |
|
|
324
|
+
| `createStyleSchema(supports)` | Create Zod schema for style attribute |
|
|
325
|
+
| `createLayoutSchema(supports)` | Create Zod schema for layout attribute |
|
|
326
|
+
| `getGlobalAttributeDefinitions()` | Get lock/metadata attribute definitions |
|
|
327
|
+
| `getGlobalAttributeSchemas()` | Get lock/metadata Zod schemas |
|
|
328
|
+
| `getClassNameAttribute(supports)` | Get className attribute if enabled |
|
|
329
|
+
| `getClassNameSchema(supports)` | Get className Zod schema if enabled |
|
|
330
|
+
| `isDynamicBlock(blockJson)` | Check if block is server-rendered |
|
|
331
|
+
| `hasInnerBlocksSupport(blockJson)` | Check if block supports InnerBlocks |
|
|
332
|
+
| `getRequiredAttributes(blockName)` | Get required attributes for a core block |
|
|
333
|
+
| `hasRequiredAttributes(blockName)` | Check if a block has required attributes |
|
|
334
|
+
|
|
335
|
+
### Types
|
|
336
|
+
|
|
337
|
+
| Type | Description |
|
|
338
|
+
|------|-------------|
|
|
339
|
+
| `GeneratorOptions` | Options for generateBlockDefinition |
|
|
340
|
+
| `StyleAttributeShape` | TypeScript interface for style attribute |
|
|
341
|
+
| `AttributeSchemaOptions` | Options for attributeToZodSchema |
|
|
342
|
+
| `AttributesSchemaOptions` | Options for attributesToZodSchema |
|
|
343
|
+
|
|
344
|
+
### Constants
|
|
345
|
+
|
|
346
|
+
| Constant | Description |
|
|
347
|
+
|----------|-------------|
|
|
348
|
+
| `CORE_REQUIRED_ATTRIBUTES` | Map of block names to required attribute names |
|
|
349
|
+
|
|
350
|
+
### Schemas
|
|
351
|
+
|
|
352
|
+
| Schema | Description |
|
|
353
|
+
|--------|-------------|
|
|
354
|
+
| `lockSchema` | Zod schema for lock attribute |
|
|
355
|
+
| `metadataSchema` | Zod schema for metadata attribute |
|
|
356
|
+
|
|
357
|
+
## License
|
|
358
|
+
|
|
359
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.bench.d.ts","sourceRoot":"","sources":["../../src/__benchmarks__/generator.bench.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block-schemas package benchmarks
|
|
3
|
+
*/
|
|
4
|
+
import { bench, describe } from 'vitest';
|
|
5
|
+
import { generateBlockDefinition, generateBlockDefinitions, resolveSupportsToAttributes, createStyleSchema, } from '../index.js';
|
|
6
|
+
// Define block.json fixtures inline to avoid type issues
|
|
7
|
+
const paragraphBlockJson = {
|
|
8
|
+
apiVersion: 3,
|
|
9
|
+
name: 'core/paragraph',
|
|
10
|
+
title: 'Paragraph',
|
|
11
|
+
category: 'text',
|
|
12
|
+
attributes: {
|
|
13
|
+
align: { type: 'string' },
|
|
14
|
+
content: { type: 'string' },
|
|
15
|
+
dropCap: { type: 'boolean', default: false },
|
|
16
|
+
},
|
|
17
|
+
supports: {
|
|
18
|
+
anchor: true,
|
|
19
|
+
className: true,
|
|
20
|
+
color: {
|
|
21
|
+
gradients: true,
|
|
22
|
+
link: true,
|
|
23
|
+
},
|
|
24
|
+
spacing: {
|
|
25
|
+
margin: true,
|
|
26
|
+
padding: true,
|
|
27
|
+
},
|
|
28
|
+
typography: {
|
|
29
|
+
fontSize: true,
|
|
30
|
+
lineHeight: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
const headingBlockJson = {
|
|
35
|
+
apiVersion: 3,
|
|
36
|
+
name: 'core/heading',
|
|
37
|
+
title: 'Heading',
|
|
38
|
+
category: 'text',
|
|
39
|
+
attributes: {
|
|
40
|
+
content: { type: 'string' },
|
|
41
|
+
level: { type: 'number', default: 2 },
|
|
42
|
+
},
|
|
43
|
+
supports: {
|
|
44
|
+
anchor: true,
|
|
45
|
+
className: true,
|
|
46
|
+
color: {
|
|
47
|
+
gradients: true,
|
|
48
|
+
link: true,
|
|
49
|
+
},
|
|
50
|
+
spacing: {
|
|
51
|
+
margin: true,
|
|
52
|
+
padding: true,
|
|
53
|
+
},
|
|
54
|
+
typography: {
|
|
55
|
+
fontSize: true,
|
|
56
|
+
lineHeight: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const groupBlockJson = {
|
|
61
|
+
apiVersion: 3,
|
|
62
|
+
name: 'core/group',
|
|
63
|
+
title: 'Group',
|
|
64
|
+
category: 'design',
|
|
65
|
+
attributes: {
|
|
66
|
+
tagName: { type: 'string', default: 'div' },
|
|
67
|
+
},
|
|
68
|
+
supports: {
|
|
69
|
+
anchor: true,
|
|
70
|
+
align: ['wide', 'full'],
|
|
71
|
+
html: false,
|
|
72
|
+
background: {
|
|
73
|
+
backgroundImage: true,
|
|
74
|
+
backgroundSize: true,
|
|
75
|
+
},
|
|
76
|
+
color: {
|
|
77
|
+
gradients: true,
|
|
78
|
+
link: true,
|
|
79
|
+
button: true,
|
|
80
|
+
heading: true,
|
|
81
|
+
},
|
|
82
|
+
spacing: {
|
|
83
|
+
margin: ['top', 'bottom'],
|
|
84
|
+
padding: true,
|
|
85
|
+
blockGap: true,
|
|
86
|
+
},
|
|
87
|
+
dimensions: {
|
|
88
|
+
minHeight: true,
|
|
89
|
+
},
|
|
90
|
+
border: {
|
|
91
|
+
color: true,
|
|
92
|
+
radius: true,
|
|
93
|
+
style: true,
|
|
94
|
+
width: true,
|
|
95
|
+
},
|
|
96
|
+
position: {
|
|
97
|
+
sticky: true,
|
|
98
|
+
},
|
|
99
|
+
layout: {
|
|
100
|
+
allowSizingOnChildren: true,
|
|
101
|
+
},
|
|
102
|
+
shadow: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
const imageBlockJson = {
|
|
106
|
+
apiVersion: 3,
|
|
107
|
+
name: 'core/image',
|
|
108
|
+
title: 'Image',
|
|
109
|
+
category: 'media',
|
|
110
|
+
attributes: {
|
|
111
|
+
url: { type: 'string' },
|
|
112
|
+
alt: { type: 'string', default: '' },
|
|
113
|
+
caption: { type: 'string' },
|
|
114
|
+
id: { type: 'number' },
|
|
115
|
+
width: { type: 'string' },
|
|
116
|
+
height: { type: 'string' },
|
|
117
|
+
},
|
|
118
|
+
supports: {
|
|
119
|
+
anchor: true,
|
|
120
|
+
color: {
|
|
121
|
+
text: false,
|
|
122
|
+
background: false,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
const buttonBlockJson = {
|
|
127
|
+
apiVersion: 3,
|
|
128
|
+
name: 'core/button',
|
|
129
|
+
title: 'Button',
|
|
130
|
+
category: 'design',
|
|
131
|
+
parent: ['core/buttons'],
|
|
132
|
+
attributes: {
|
|
133
|
+
url: { type: 'string' },
|
|
134
|
+
text: { type: 'string' },
|
|
135
|
+
linkTarget: { type: 'string' },
|
|
136
|
+
width: { type: 'number' },
|
|
137
|
+
},
|
|
138
|
+
supports: {
|
|
139
|
+
anchor: true,
|
|
140
|
+
align: false,
|
|
141
|
+
color: {
|
|
142
|
+
gradients: true,
|
|
143
|
+
},
|
|
144
|
+
typography: {
|
|
145
|
+
fontSize: true,
|
|
146
|
+
lineHeight: true,
|
|
147
|
+
},
|
|
148
|
+
border: {
|
|
149
|
+
color: true,
|
|
150
|
+
radius: true,
|
|
151
|
+
style: true,
|
|
152
|
+
width: true,
|
|
153
|
+
},
|
|
154
|
+
shadow: true,
|
|
155
|
+
spacing: {
|
|
156
|
+
padding: true,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
const columnBlockJson = {
|
|
161
|
+
apiVersion: 3,
|
|
162
|
+
name: 'core/column',
|
|
163
|
+
title: 'Column',
|
|
164
|
+
category: 'design',
|
|
165
|
+
parent: ['core/columns'],
|
|
166
|
+
attributes: {
|
|
167
|
+
verticalAlignment: { type: 'string' },
|
|
168
|
+
width: { type: 'string' },
|
|
169
|
+
},
|
|
170
|
+
supports: {
|
|
171
|
+
anchor: true,
|
|
172
|
+
html: false,
|
|
173
|
+
color: {
|
|
174
|
+
gradients: true,
|
|
175
|
+
heading: true,
|
|
176
|
+
button: true,
|
|
177
|
+
link: true,
|
|
178
|
+
},
|
|
179
|
+
spacing: {
|
|
180
|
+
blockGap: true,
|
|
181
|
+
padding: true,
|
|
182
|
+
},
|
|
183
|
+
border: {
|
|
184
|
+
color: true,
|
|
185
|
+
radius: true,
|
|
186
|
+
style: true,
|
|
187
|
+
width: true,
|
|
188
|
+
},
|
|
189
|
+
shadow: true,
|
|
190
|
+
layout: true,
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
const latestPostsBlockJson = {
|
|
194
|
+
apiVersion: 3,
|
|
195
|
+
name: 'core/latest-posts',
|
|
196
|
+
title: 'Latest Posts',
|
|
197
|
+
category: 'widgets',
|
|
198
|
+
render: 'file:./render.php',
|
|
199
|
+
attributes: {
|
|
200
|
+
postsToShow: { type: 'number', default: 5 },
|
|
201
|
+
displayPostContent: { type: 'boolean', default: false },
|
|
202
|
+
columns: { type: 'number', default: 3 },
|
|
203
|
+
},
|
|
204
|
+
supports: {
|
|
205
|
+
align: true,
|
|
206
|
+
html: false,
|
|
207
|
+
color: {
|
|
208
|
+
gradients: true,
|
|
209
|
+
link: true,
|
|
210
|
+
},
|
|
211
|
+
spacing: {
|
|
212
|
+
margin: true,
|
|
213
|
+
padding: true,
|
|
214
|
+
},
|
|
215
|
+
typography: {
|
|
216
|
+
fontSize: true,
|
|
217
|
+
lineHeight: true,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
// Collection of all test blocks
|
|
222
|
+
const allBlocks = [
|
|
223
|
+
paragraphBlockJson,
|
|
224
|
+
headingBlockJson,
|
|
225
|
+
groupBlockJson,
|
|
226
|
+
imageBlockJson,
|
|
227
|
+
buttonBlockJson,
|
|
228
|
+
columnBlockJson,
|
|
229
|
+
latestPostsBlockJson,
|
|
230
|
+
];
|
|
231
|
+
// Create a larger collection by duplicating blocks with different names
|
|
232
|
+
function createManyBlocks(count) {
|
|
233
|
+
const blocks = [];
|
|
234
|
+
for (let i = 0; i < count; i++) {
|
|
235
|
+
const sourceBlock = allBlocks[i % allBlocks.length];
|
|
236
|
+
blocks.push({
|
|
237
|
+
...sourceBlock,
|
|
238
|
+
name: `custom/block-${i}`,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return blocks;
|
|
242
|
+
}
|
|
243
|
+
const manyBlocks = createManyBlocks(50);
|
|
244
|
+
const veryManyBlocks = createManyBlocks(100);
|
|
245
|
+
describe('block-schemas/generateBlockDefinition', () => {
|
|
246
|
+
bench('paragraph block (basic)', () => {
|
|
247
|
+
generateBlockDefinition(paragraphBlockJson);
|
|
248
|
+
});
|
|
249
|
+
bench('heading block (with supports)', () => {
|
|
250
|
+
generateBlockDefinition(headingBlockJson);
|
|
251
|
+
});
|
|
252
|
+
bench('group block (complex supports)', () => {
|
|
253
|
+
generateBlockDefinition(groupBlockJson);
|
|
254
|
+
});
|
|
255
|
+
bench('image block (many attributes)', () => {
|
|
256
|
+
generateBlockDefinition(imageBlockJson);
|
|
257
|
+
});
|
|
258
|
+
bench('button block (with parent)', () => {
|
|
259
|
+
generateBlockDefinition(buttonBlockJson);
|
|
260
|
+
});
|
|
261
|
+
bench('latestPosts block (dynamic)', () => {
|
|
262
|
+
generateBlockDefinition(latestPostsBlockJson);
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
describe('block-schemas/generateBlockDefinitions', () => {
|
|
266
|
+
bench('7 blocks (standard set)', () => {
|
|
267
|
+
generateBlockDefinitions(allBlocks);
|
|
268
|
+
});
|
|
269
|
+
bench('50 blocks', () => {
|
|
270
|
+
generateBlockDefinitions(manyBlocks);
|
|
271
|
+
});
|
|
272
|
+
bench('100 blocks', () => {
|
|
273
|
+
generateBlockDefinitions(veryManyBlocks);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
describe('block-schemas/resolveSupportsToAttributes', () => {
|
|
277
|
+
bench('paragraph supports', () => {
|
|
278
|
+
resolveSupportsToAttributes(paragraphBlockJson.supports);
|
|
279
|
+
});
|
|
280
|
+
bench('group supports (full)', () => {
|
|
281
|
+
resolveSupportsToAttributes(groupBlockJson.supports);
|
|
282
|
+
});
|
|
283
|
+
bench('button supports', () => {
|
|
284
|
+
resolveSupportsToAttributes(buttonBlockJson.supports);
|
|
285
|
+
});
|
|
286
|
+
bench('undefined supports', () => {
|
|
287
|
+
resolveSupportsToAttributes(undefined);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
describe('block-schemas/createStyleSchema', () => {
|
|
291
|
+
bench('paragraph supports', () => {
|
|
292
|
+
createStyleSchema(paragraphBlockJson.supports);
|
|
293
|
+
});
|
|
294
|
+
bench('group supports (full)', () => {
|
|
295
|
+
createStyleSchema(groupBlockJson.supports);
|
|
296
|
+
});
|
|
297
|
+
bench('button supports', () => {
|
|
298
|
+
createStyleSchema(buttonBlockJson.supports);
|
|
299
|
+
});
|
|
300
|
+
bench('image supports (minimal)', () => {
|
|
301
|
+
createStyleSchema(imageBlockJson.supports);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
//# sourceMappingURL=generator.bench.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.bench.js","sourceRoot":"","sources":["../../src/__benchmarks__/generator.bench.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,yDAAyD;AACzD,MAAM,kBAAkB,GAAG;IACzB,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE;QAClC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE;QACpC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAkB,EAAE,OAAO,EAAE,KAAK,EAAE;KACtD;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,KAAK,EAAE;YACL,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;SACX;QACD,OAAO,EAAE;YACP,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI;SACd;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;KACF;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG;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