diff --git a/composer.json b/composer.json index 0569ec6..aba8c77 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/packages/wp-types/index.ts b/packages/wp-types/index.ts index d974d84..2519a27 100644 --- a/packages/wp-types/index.ts +++ b/packages/wp-types/index.ts @@ -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. */ @@ -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. */ @@ -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. */ @@ -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. */ diff --git a/packages/wp-types/readme.md b/packages/wp-types/readme.md index c5e67a6..1d54a02 100644 --- a/packages/wp-types/readme.md +++ b/packages/wp-types/readme.md @@ -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? @@ -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` @@ -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 diff --git a/readme.md b/readme.md index 23adcf2..2bdd24b 100644 --- a/readme.md +++ b/readme.md @@ -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? @@ -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` @@ -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 diff --git a/schemas/block-type.json b/schemas/block-type.json index 7366a15..0c87544 100644 --- a/schemas/block-type.json +++ b/schemas/block-type.json @@ -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", @@ -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": [ @@ -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": [ diff --git a/schemas/rest-api/attachment.json b/schemas/rest-api/attachment.json index 57306ad..14f5746 100644 --- a/schemas/rest-api/attachment.json +++ b/schemas/rest-api/attachment.json @@ -9,6 +9,7 @@ "date_gmt", "guid", "id", + "featured_media", "link", "modified", "modified_gmt", @@ -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.", diff --git a/schemas/rest-api/block-type.json b/schemas/rest-api/block-type.json index 8433730..0f68b89 100644 --- a/schemas/rest-api/block-type.json +++ b/schemas/rest-api/block-type.json @@ -25,6 +25,9 @@ "styles", "variations", "block_hooks", + "allowed_blocks", + "view_script_module_ids", + "view_style_handles", "textdomain", "parent", "keywords", @@ -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": [ diff --git a/tests/data/rest-api/routes/routes.json b/tests/data/rest-api/routes/routes.json index df19d17..30e6705 100644 --- a/tests/data/rest-api/routes/routes.json +++ b/tests/data/rest-api/routes/routes.json @@ -17,8 +17,15 @@ "/wp/v2/categories/(?P[\\d]+)", "/wp/v2/comments", "/wp/v2/comments/(?P[\\d]+)", + "/wp/v2/font-collections", + "/wp/v2/font-collections/(?P[\\/\\w-]+)", + "/wp/v2/font-families", + "/wp/v2/font-families/(?P[\\d]+)/font-faces", + "/wp/v2/font-families/(?P[\\d]+)/font-faces/(?P[\\d]+)", + "/wp/v2/font-families/(?P[\\d]+)", "/wp/v2/global-styles/(?P[\\/\\w-]+)", "/wp/v2/global-styles/(?P[\\d]+)/revisions", + "/wp/v2/global-styles/(?P[\\d]+)/revisions/(?P[\\d]+)", "/wp/v2/global-styles/themes/(?P[\\/\\s%\\w\\.\\(\\)\\[\\]\\@_\\-]+)/variations", "/wp/v2/global-styles/themes/(?P[^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)", "/wp/v2/media", diff --git a/tests/data/rest-api/routes/wp-v2-font-collections-slug.json b/tests/data/rest-api/routes/wp-v2-font-collections-slug.json new file mode 100644 index 0000000..fe342a0 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-collections-slug.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-collections/(?P[\\/\\w-]+)" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-font-collections.json b/tests/data/rest-api/routes/wp-v2-font-collections.json new file mode 100644 index 0000000..b7973c4 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-collections.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-collections" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces-id.json b/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces-id.json new file mode 100644 index 0000000..c1b1c68 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces-id.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-families/(?P[\\d]+)/font-faces/(?P[\\d]+)" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces.json b/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces.json new file mode 100644 index 0000000..c083df8 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-families-font-family-id-font-faces.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-families/(?P[\\d]+)/font-faces" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-font-families-id.json b/tests/data/rest-api/routes/wp-v2-font-families-id.json new file mode 100644 index 0000000..f0add66 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-families-id.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-families/(?P[\\d]+)" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-font-families.json b/tests/data/rest-api/routes/wp-v2-font-families.json new file mode 100644 index 0000000..d8e3e7d --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-font-families.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/font-families" +} \ No newline at end of file diff --git a/tests/data/rest-api/routes/wp-v2-global-styles-parent-revisions-id.json b/tests/data/rest-api/routes/wp-v2-global-styles-parent-revisions-id.json new file mode 100644 index 0000000..534f1e8 --- /dev/null +++ b/tests/data/rest-api/routes/wp-v2-global-styles-parent-revisions-id.json @@ -0,0 +1,3 @@ +{ + "route": "/wp/v2/global-styles/(?P[\\d]+)/revisions/(?P[\\d]+)" +} \ No newline at end of file