Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress 6.5 #68

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"ext-pdo_sqlite": "*",
"johnbillion/args": "1.7.0",
"roots/wordpress-core-installer": "^1.0.0",
"roots/wordpress-full": "~6.4.0",
"roots/wordpress-full": "~6.5.0",
"wp-cli/core-command": "^2",
"wp-cli/db-command": "^2",
"wp-cli/language-command": "^2",
Expand Down
36 changes: 32 additions & 4 deletions packages/wp-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,22 @@ export interface WP_Block_Type {
| {
[k: string]: string;
};
/**
* Allowed child block types.
*/
allowed_blocks: string[] | null;
/**
* Block variations callback.
*/
variation_callback: Callable | null;
/**
* Block type front end only script module IDs.
*/
view_script_module_ids: string[];
/**
* Block type front end only style handles.
*/
view_style_handles: string[];
/**
* Custom CSS selectors for theme.json style generation.
*/
Expand Down Expand Up @@ -344,10 +360,6 @@ export interface WP_Block_Type {
[k: string]: unknown;
}
| null;
/**
* Context values inherited by blocks of this type.
*/
uses_context: string[];
/**
* Context provided by blocks of this type.
*/
Expand Down Expand Up @@ -2098,6 +2110,10 @@ export interface WP_REST_API_Attachment {
* Unique identifier for the attachment.
*/
id: number;
/**
* The ID of the featured media for the post.
*/
featured_media: number;
/**
* URL to the attachment.
*/
Expand Down Expand Up @@ -2631,6 +2647,18 @@ export interface WP_REST_API_Block_Type {
| {
[k: string]: string;
};
/**
* Allowed child block types.
*/
allowed_blocks: string[] | null;
/**
* Block type front end only script module IDs.
*/
view_script_module_ids: string[];
/**
* Block type front end only style handles.
*/
view_style_handles: string[];
/**
* Public text domain.
*/
Expand Down
15 changes: 11 additions & 4 deletions packages/wp-types/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This package provides well-documented TypeScript definitions that describe the s
* WordPress REST API responses such as from `/wp/v2/posts` and `/wp/v2/users`
* Various property types and allowed values of both

The definitions were last updated for WordPress 6.4.
The definitions were last updated for WordPress 6.5.

## What's included?

Expand Down Expand Up @@ -52,8 +52,15 @@ Route | Schema
/wp/v2/categories/{id} | `WP_REST_API_Category`
/wp/v2/comments | `WP_REST_API_Comments`
/wp/v2/comments/{id} | `WP_REST_API_Comment`
/wp/v2/wp/v2/font-collections | Todo
/wp/v2/wp/v2/font-collections/{slug} | Todo
/wp/v2/wp/v2/font-families | Todo
/wp/v2/wp/v2/font-families/{id}/ | Todo
/wp/v2/wp/v2/font-families/{id}/font-faces | Todo
/wp/v2/wp/v2/font-families/{id}/font-faces/{id} | Todo
/wp/v2/global-styles/{id} | Todo
/wp/v2/global-styles/{id}/revisions | Todo
/wp/v2/global-styles/{parent}/revisions | Todo
/wp/v2/global-styles/{parent}/revisions/{id} | Todo
/wp/v2/global-styles/themes/{stylesheet}/variations | Todo
/wp/v2/global-styles/themes/{stylesheet} | Todo
/wp/v2/media | `WP_REST_API_Attachments`
Expand Down Expand Up @@ -174,12 +181,12 @@ npm install wp-types --save-dev
This package is versioned so that you can specify both the schema version and the WordPress branch version in a way that's compatible with semantic versioning. Given version `x.y.z`:

* The major version number (`x`) indicates the schema version number, currently `3`
* The minor version number (`y`) indicates the WordPress branch version number without its decimal place, eg. `64` for WordPress 6.4
* The minor version number (`y`) indicates the WordPress branch version number without its decimal place, eg. `65` for WordPress 6.5
* The patch version number (`z`) indicates the schema patch version number

Examples:

* `~3.64.0` - Schema version 3 for WordPress 6.4
* `~3.65.0` - Schema version 3 for WordPress 6.5
* `~3.60.0` - Schema version 3 for WordPress 6.0
* `~3.57.0` - Schema version 3 for WordPress 5.7
* `^3.0.0` - Schema version 3 for the latest WordPress version
Expand Down
15 changes: 11 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This package provides well-documented JSON schemas that describe the shape of:

The schemas in this library are used to generate [the WordPress TypeScript definitions provided by the `wp-types` package](https://www.npmjs.com/package/wp-types).

The schemas were last updated for WordPress 6.4.
The schemas were last updated for WordPress 6.5.

## What's included?

Expand Down Expand Up @@ -56,8 +56,15 @@ Route | Schema
/wp/v2/categories/{id} | `WP_REST_API_Category`
/wp/v2/comments | `WP_REST_API_Comments`
/wp/v2/comments/{id} | `WP_REST_API_Comment`
/wp/v2/wp/v2/font-collections | Todo
/wp/v2/wp/v2/font-collections/{slug} | Todo
/wp/v2/wp/v2/font-families | Todo
/wp/v2/wp/v2/font-families/{id}/ | Todo
/wp/v2/wp/v2/font-families/{id}/font-faces | Todo
/wp/v2/wp/v2/font-families/{id}/font-faces/{id} | Todo
/wp/v2/global-styles/{id} | Todo
/wp/v2/global-styles/{id}/revisions | Todo
/wp/v2/global-styles/{parent}/revisions | Todo
/wp/v2/global-styles/{parent}/revisions/{id} | Todo
/wp/v2/global-styles/themes/{stylesheet}/variations | Todo
/wp/v2/global-styles/themes/{stylesheet} | Todo
/wp/v2/media | `WP_REST_API_Attachments`
Expand Down Expand Up @@ -179,12 +186,12 @@ npm install wp-json-schemas
This package is versioned so that you can specify both the schema version and the WordPress branch version in a way that's compatible with semantic versioning. Given version `x.y.z`:

* The major version number (`x`) indicates the schema version number, currently `3`
* The minor version number (`y`) indicates the WordPress branch version number without its decimal place, eg. `64` for WordPress 6.4
* The minor version number (`y`) indicates the WordPress branch version number without its decimal place, eg. `65` for WordPress 6.5
* The patch version number (`z`) indicates the schema patch version number

Examples:

* `~3.64.0` - Schema version 3 for WordPress 6.4
* `~3.65.0` - Schema version 3 for WordPress 6.5
* `~3.60.0` - Schema version 3 for WordPress 6.0
* `~3.57.0` - Schema version 3 for WordPress 5.7
* `^3.0.0` - Schema version 3 for the latest WordPress version
Expand Down
47 changes: 39 additions & 8 deletions schemas/block-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
"example",
"render_callback",
"attributes",
"uses_context",
"block_hooks",
"allowed_blocks",
"variation_callback",
"view_script_module_ids",
"view_style_handles",
"provides_context",
"editor_script_handles",
"script_handles",
Expand Down Expand Up @@ -116,6 +119,41 @@
}
]
},
"allowed_blocks": {
"description": "Allowed child block types.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"variation_callback": {
"description": "Block variations callback.",
"anyOf": [
{
"$ref": "properties/callable.json"
},
{
"type": "null"
}
]
},
"view_script_module_ids": {
"description": "Block type front end only script module IDs.",
"type": "array",
"items": {
"type": "string"
}
},
"view_style_handles": {
"description": "Block type front end only style handles.",
"type": "array",
"items": {
"type": "string"
}
},
"selectors": {
"description": "Custom CSS selectors for theme.json style generation.",
"oneOf": [
Expand Down Expand Up @@ -177,13 +215,6 @@
}
]
},
"uses_context": {
"description": "Context values inherited by blocks of this type.",
"type": "array",
"items": {
"type": "string"
}
},
"provides_context": {
"description": "Context provided by blocks of this type.",
"oneOf": [
Expand Down
5 changes: 5 additions & 0 deletions schemas/rest-api/attachment.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"date_gmt",
"guid",
"id",
"featured_media",
"link",
"modified",
"modified_gmt",
Expand Down Expand Up @@ -74,6 +75,10 @@
"description": "Unique identifier for the attachment.",
"type": "integer"
},
"featured_media": {
"description": "The ID of the featured media for the post.",
"type": "integer"
},
"link": {
"readOnly": true,
"description": "URL to the attachment.",
Expand Down
27 changes: 27 additions & 0 deletions schemas/rest-api/block-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"styles",
"variations",
"block_hooks",
"allowed_blocks",
"view_script_module_ids",
"view_style_handles",
"textdomain",
"parent",
"keywords",
Expand Down Expand Up @@ -262,6 +265,30 @@
}
]
},
"allowed_blocks": {
"description": "Allowed child block types.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"view_script_module_ids": {
"description": "Block type front end only script module IDs.",
"type": "array",
"items": {
"type": "string"
}
},
"view_style_handles": {
"description": "Block type front end only style handles.",
"type": "array",
"items": {
"type": "string"
}
},
"textdomain": {
"description": "Public text domain.",
"type": [
Expand Down
7 changes: 7 additions & 0 deletions tests/data/rest-api/routes/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
"/wp/v2/categories/(?P<id>[\\d]+)",
"/wp/v2/comments",
"/wp/v2/comments/(?P<id>[\\d]+)",
"/wp/v2/font-collections",
"/wp/v2/font-collections/(?P<slug>[\\/\\w-]+)",
"/wp/v2/font-families",
"/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces",
"/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces/(?P<id>[\\d]+)",
"/wp/v2/font-families/(?P<id>[\\d]+)",
"/wp/v2/global-styles/(?P<id>[\\/\\w-]+)",
"/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions",
"/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)",
"/wp/v2/global-styles/themes/(?P<stylesheet>[\\/\\s%\\w\\.\\(\\)\\[\\]\\@_\\-]+)/variations",
"/wp/v2/global-styles/themes/(?P<stylesheet>[^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)",
"/wp/v2/media",
Expand Down
3 changes: 3 additions & 0 deletions tests/data/rest-api/routes/wp-v2-font-collections-slug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-collections/(?P<slug>[\\/\\w-]+)"
}
3 changes: 3 additions & 0 deletions tests/data/rest-api/routes/wp-v2-font-collections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-collections"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces/(?P<id>[\\d]+)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces"
}
3 changes: 3 additions & 0 deletions tests/data/rest-api/routes/wp-v2-font-families-id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-families/(?P<id>[\\d]+)"
}
3 changes: 3 additions & 0 deletions tests/data/rest-api/routes/wp-v2-font-families.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/font-families"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"route": "/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)"
}
Loading