From 572207384b886453b68ca4d18e05687fdde1ff37 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 17 Dec 2018 04:50:48 +0000 Subject: [PATCH] Block Editor: Update `@wordpress` dependencies. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes of note: - Includes the new Annotations API package. - `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`. - `strip_dynamic_blocks()` has been removed in favor of `excerpt_remove_blocks()`. - The PHP block parser is now syncing from the `block-serialization-default-parser` package. - `do_blocks()` uses the new parser. - The `do_block` filter has been removed from `do_blocks()`, in favor of a `render_block` filter in `render_block()`. Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter. Props pento, azaozz. Merges [43884] and [43888] to trunk. See #45145, #45190, #45264, #45282. git-svn-id: https://develop.svn.wordpress.org/trunk@44261 602fd350-edb4-49c9-b593-d223f7449a82 --- package-lock.json | 825 +++++++++++++----- package.json | 43 +- src/wp-admin/edit-form-blocks.php | 24 +- src/wp-includes/blocks.php | 184 ++-- src/wp-includes/class-wp-block-parser.php | 89 +- src/wp-includes/formatting.php | 2 +- src/wp-includes/script-loader.php | 14 +- ...ore__4-invalid-starting-letter.parsed.json | 5 +- ...ore__4-invalid-starting-letter.server.html | 2 +- .../fixtures/core__archives.parsed.json | 3 +- ...core__archives__showPostCounts.parsed.json | 3 +- .../blocks/fixtures/core__audio.parsed.json | 6 +- .../blocks/fixtures/core__block.parsed.json | 6 +- .../fixtures/core__button__center.parsed.json | 6 +- .../blocks/fixtures/core__categories.json | 4 +- .../fixtures/core__categories.parsed.json | 6 +- .../blocks/fixtures/core__code.parsed.json | 6 +- .../blocks/fixtures/core__column.parsed.json | 34 +- .../blocks/fixtures/core__columns.parsed.json | 122 ++- .../fixtures/core__columns__deprecated.html | 16 + .../fixtures/core__columns__deprecated.json | 85 ++ .../core__columns__deprecated.parsed.json | 75 ++ .../core__columns__deprecated.serialized.html | 23 + .../core__columns__deprecated.server.html | 16 + .../fixtures/core__cover-image.parsed.json | 10 +- .../data/blocks/fixtures/core__cover.html | 5 + .../data/blocks/fixtures/core__cover.json | 17 + .../blocks/fixtures/core__cover.parsed.json | 23 + .../fixtures/core__cover.serialized.html | 3 + .../blocks/fixtures/core__cover.server.html | 5 + .../fixtures/core__cover__video-overlay.html | 6 + .../fixtures/core__cover__video-overlay.json | 18 + .../core__cover__video-overlay.parsed.json | 25 + ...core__cover__video-overlay.serialized.html | 3 + .../core__cover__video-overlay.server.html | 6 + .../blocks/fixtures/core__cover__video.html | 6 + .../blocks/fixtures/core__cover__video.json | 17 + .../fixtures/core__cover__video.parsed.json | 24 + .../core__cover__video.serialized.html | 3 + .../fixtures/core__cover__video.server.html | 6 + .../blocks/fixtures/core__embed.parsed.json | 10 +- .../fixtures/core__file__new-window.html | 2 +- .../fixtures/core__file__new-window.json | 2 +- .../core__file__new-window.parsed.json | 10 +- .../core__file__new-window.serialized.html | 2 +- .../core__file__new-window.server.html | 2 +- ...core__file__no-download-button.parsed.json | 10 +- .../fixtures/core__file__no-text-link.html | 2 +- .../fixtures/core__file__no-text-link.json | 2 +- .../core__file__no-text-link.parsed.json | 10 +- .../core__file__no-text-link.serialized.html | 2 +- .../core__file__no-text-link.server.html | 2 +- .../fixtures/core__freeform.parsed.json | 10 +- .../core__freeform__undelimited.parsed.json | 7 +- .../blocks/fixtures/core__gallery.parsed.json | 10 +- .../core__gallery__columns.parsed.json | 10 +- .../fixtures/core__heading__h2-em.parsed.json | 10 +- .../fixtures/core__heading__h2.parsed.json | 10 +- .../blocks/fixtures/core__html.parsed.json | 10 +- .../blocks/fixtures/core__image.parsed.json | 10 +- .../core__image__attachment-link.parsed.json | 10 +- .../core__image__center-caption.parsed.json | 10 +- .../core__image__custom-link.parsed.json | 10 +- .../core__image__media-link.parsed.json | 10 +- .../core__invalid-Capitals.parsed.json | 5 +- .../core__invalid-Capitals.server.html | 2 +- .../core__invalid-special.parsed.json | 5 +- .../core__invalid-special.server.html | 2 +- .../core__latest-comments.parsed.json | 8 +- .../fixtures/core__latest-posts.parsed.json | 8 +- ..._latest-posts__displayPostDate.parsed.json | 8 +- .../fixtures/core__list__ul.parsed.json | 10 +- .../blocks/fixtures/core__media-text.html | 12 + .../blocks/fixtures/core__media-text.json | 33 + .../fixtures/core__media-text.parsed.json | 38 + .../fixtures/core__media-text.serialized.html | 5 + .../fixtures/core__media-text.server.html | 12 + .../core__media-text__image-alt-no-align.html | 12 + .../core__media-text__image-alt-no-align.json | 33 + ...media-text__image-alt-no-align.parsed.json | 39 + ...a-text__image-alt-no-align.serialized.html | 5 + ...media-text__image-alt-no-align.server.html | 12 + ...ore__media-text__is-stacked-on-mobile.html | 12 + ...ore__media-text__is-stacked-on-mobile.json | 33 + ...dia-text__is-stacked-on-mobile.parsed.json | 39 + ...text__is-stacked-on-mobile.serialized.html | 5 + ...dia-text__is-stacked-on-mobile.server.html | 12 + ..._media-text__media-right-custom-width.html | 12 + ..._media-text__media-right-custom-width.json | 34 + ...text__media-right-custom-width.parsed.json | 42 + ...__media-right-custom-width.serialized.html | 5 + ...text__media-right-custom-width.server.html | 12 + .../fixtures/core__media-text__video.html | 12 + .../fixtures/core__media-text__video.json | 33 + .../core__media-text__video.parsed.json | 38 + .../core__media-text__video.serialized.html | 5 + .../core__media-text__video.server.html | 12 + .../data/blocks/fixtures/core__missing.json | 6 +- .../blocks/fixtures/core__missing.parsed.json | 18 +- .../blocks/fixtures/core__more.parsed.json | 6 +- ...core__more__custom-text-teaser.parsed.json | 6 +- .../fixtures/core__nextpage.parsed.json | 6 +- .../core__paragraph__align-right.parsed.json | 6 +- .../core__paragraph__deprecated.parsed.json | 6 +- .../fixtures/core__preformatted.parsed.json | 6 +- .../fixtures/core__pullquote.parsed.json | 6 +- ...re__pullquote__multi-paragraph.parsed.json | 6 +- .../fixtures/core__quote__style-1.parsed.json | 6 +- .../fixtures/core__quote__style-2.parsed.json | 6 +- .../fixtures/core__separator.parsed.json | 6 +- .../fixtures/core__shortcode.parsed.json | 6 +- .../blocks/fixtures/core__spacer.parsed.json | 6 +- .../blocks/fixtures/core__subhead.parsed.json | 6 +- .../blocks/fixtures/core__table.parsed.json | 6 +- .../fixtures/core__text-columns.parsed.json | 6 +- ...e__text__converts-to-paragraph.parsed.json | 6 +- .../blocks/fixtures/core__verse.parsed.json | 6 +- .../blocks/fixtures/core__video.parsed.json | 6 +- tests/phpunit/tests/blocks/render.php | 118 +++ tools/webpack/packages.js | 8 +- 120 files changed, 2157 insertions(+), 611 deletions(-) create mode 100644 tests/phpunit/data/blocks/fixtures/core__columns__deprecated.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__columns__deprecated.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__columns__deprecated.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__columns__deprecated.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__cover__video.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__video.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__video.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__video.parsed.json create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__video.serialized.html create mode 100644 tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html diff --git a/package-lock.json b/package-lock.json index 46c79b9f5a..2908bc6ffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -215,15 +215,30 @@ "@wordpress/dom-ready": "^2.0.2" } }, + "@wordpress/annotations": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/annotations/-/annotations-1.0.0.tgz", + "integrity": "sha512-S1geWYg1OFRy9Lw8IE377DMEcnbFWD0457N7wHEvnjWU4ngI9rbFJ9FLEs/FNNlYR4zVy+niAl6I5pY1Qac9lw==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/data": "^3.1.2", + "@wordpress/hooks": "^2.0.3", + "@wordpress/i18n": "^3.0.1", + "@wordpress/rich-text": "^2.0.4", + "lodash": "^4.17.10", + "rememo": "^3.0.0", + "uuid": "^3.3.2" + } + }, "@wordpress/api-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-2.2.1.tgz", - "integrity": "sha512-uKEXy1d78m+foRhc5yDoE3C6NBVlEL18F70vxedI4XvypkJ15tSNEPVVxwiHRfJ4AUhA9Cmu3HE6VW9ytYuAnQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-2.2.3.tgz", + "integrity": "sha512-kYQ8Au3tkNYDkJQfXfe5KS5DGN7YlCM4Ltk1vMCNy7C9JdNNJQ5v44ccZr6hT0usxyj+4UyIh0AnY55asT+b/A==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/hooks": "^2.0.3", "@wordpress/i18n": "^3.0.1", - "@wordpress/url": "^2.2.0" + "@wordpress/url": "^2.3.0" } }, "@wordpress/autop": { @@ -243,25 +258,25 @@ } }, "@wordpress/block-library": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-2.1.7.tgz", - "integrity": "sha512-mhEmJ8v9eXcrxrTi5KO0ui0ipszjv2eY9POzHMNfW5WtxC/Lppev0ygGg881FX7ZwaOXcTqJ0shlWS/um5R+Dg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-2.2.2.tgz", + "integrity": "sha512-Q0hkYxq1eXRAAhGoCHZ1mT0GV1AtSpyB/N9ZwMrF3nP116tx7hbcMsyJW9j/tgvKLFOUforSitGQyfojxlWysQ==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/autop": "^2.0.2", "@wordpress/blob": "^2.1.0", - "@wordpress/blocks": "^5.1.1", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/core-data": "^2.0.8", - "@wordpress/data": "^3.0.1", + "@wordpress/blocks": "^5.3.1", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/core-data": "^2.0.12", + "@wordpress/data": "^3.1.2", "@wordpress/deprecated": "^2.0.3", - "@wordpress/editor": "^6.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/editor": "^7.0.0", + "@wordpress/element": "^2.1.7", "@wordpress/html-entities": "^2.0.2", "@wordpress/i18n": "^3.0.1", "@wordpress/keycodes": "^2.0.3", - "@wordpress/viewport": "^2.0.7", + "@wordpress/viewport": "^2.0.10", "classnames": "^2.2.5", "lodash": "^4.17.10", "memize": "^1.0.5", @@ -271,6 +286,60 @@ "url": "^0.11.0" }, "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + }, + "@wordpress/viewport": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@wordpress/viewport/-/viewport-2.0.10.tgz", + "integrity": "sha512-G+7VgUQkRu9JwrsiBvTs/CS87vs6wcxCknr2lWU14rk55FWpxg4fhduRHUcBYEk7E+bvOHV1TgnAspBncu1aYg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/data": "^3.1.2", + "@wordpress/element": "^2.1.7", + "lodash": "^4.17.10" + } + }, "querystringify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", @@ -279,61 +348,114 @@ } }, "@wordpress/block-serialization-default-parser": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-1.0.1.tgz", - "integrity": "sha512-r3pi1GVDnxR4MEb8BcS2UX8BQcNHU/7PyueUihSWGbVJaCksSf+wyRKVTuZiOQKagO95fWy7Egc0JcWK6clmiQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-2.0.0.tgz", + "integrity": "sha512-WPQuQ2IsUOG9wMTst8CYW8c5NMM3iatTW2FinfZrHtH9R1g9qdQPt5Wv56U7eMeDACVOj35jG2oJtZCRaDyL7A==", "requires": { "@babel/runtime": "^7.0.0" } }, "@wordpress/block-serialization-spec-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-spec-parser/-/block-serialization-spec-parser-1.1.1.tgz", - "integrity": "sha512-33/4M2D8ftrHvRythIA44/530erCPn3bdA+C8pqm6DWByGxxYzR/jemwEuG3H+sfDWAQGfsVFmHSIXxJtEax7g==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-spec-parser/-/block-serialization-spec-parser-2.0.0.tgz", + "integrity": "sha512-l5N0o2Tkc4IcDhhMfX2W3KuEV/4F7TeitJEDtBpLYf7eRMIn3Uh6l5rPDmmuTDv7UFlMWTiA8z/oCpl13ZyBOw==" }, "@wordpress/blocks": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-5.1.1.tgz", - "integrity": "sha512-k/xrp9LqZx5V5lixWHfmNPhGETUIOHk3vE0t0KxMWKkjkJfRG/5POLx45tD1KZbhx4m8O6Eq0haDpE1Curms0w==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-5.3.1.tgz", + "integrity": "sha512-bC7yqqfwFRpcOwtcJ5KtIesVH8344wy7HAnYt7g58nGyoFXfO9Ja75f02XS2jqS7Jo1j+gacJqGZoLnHfN8dYw==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/autop": "^2.0.2", "@wordpress/blob": "^2.1.0", - "@wordpress/block-serialization-default-parser": "^1.0.1", - "@wordpress/block-serialization-spec-parser": "^1.0.3", - "@wordpress/data": "^3.0.1", - "@wordpress/dom": "^2.0.4", - "@wordpress/element": "^2.1.5", + "@wordpress/block-serialization-default-parser": "^2.0.0", + "@wordpress/block-serialization-spec-parser": "^2.0.0", + "@wordpress/data": "^3.1.2", + "@wordpress/dom": "^2.0.6", + "@wordpress/element": "^2.1.7", "@wordpress/hooks": "^2.0.3", "@wordpress/i18n": "^3.0.1", "@wordpress/is-shallow-equal": "^1.1.4", "@wordpress/shortcode": "^2.0.2", - "hpq": "^1.2.0", + "hpq": "^1.3.0", "lodash": "^4.17.10", "rememo": "^3.0.0", "showdown": "^1.8.6", "simple-html-tokenizer": "^0.4.1", "tinycolor2": "^1.4.1", - "uuid": "^3.1.0" + "uuid": "^3.3.2" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/dom": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.6.tgz", + "integrity": "sha512-z1xdNASrkJc+FTdYAEDKub7pqrizAo2WFlkBmqrurwBcY/HoOTTEqg6wzq2SwvEq/rff741BCWD/JmGU7tI3AQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + } } }, "@wordpress/components": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-5.0.1.tgz", - "integrity": "sha512-Ub3h47JjZbzDw94JJaL0B4TiSLb73aqEAZOxjGPeJ72aR4TZS8mwayxN+tcgIAi0VEkcOWz2559CHk0UM214IA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-6.0.0.tgz", + "integrity": "sha512-0TeXSfUYHeismfdrTKeFnxg30Nz2F9ZgvqTz2KAiQcCzwgZ/cY8ijf9Ef6Xl11RCEsKoN82tYmc5WNTRrClObA==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/a11y": "^2.0.2", - "@wordpress/api-fetch": "^2.2.1", - "@wordpress/compose": "^2.1.0", + "@wordpress/api-fetch": "^2.2.3", + "@wordpress/compose": "^2.1.2", "@wordpress/deprecated": "^2.0.3", - "@wordpress/dom": "^2.0.4", - "@wordpress/element": "^2.1.5", + "@wordpress/dom": "^2.0.6", + "@wordpress/element": "^2.1.7", "@wordpress/hooks": "^2.0.3", "@wordpress/i18n": "^3.0.1", "@wordpress/is-shallow-equal": "^1.1.4", "@wordpress/keycodes": "^2.0.3", - "@wordpress/url": "^2.2.0", + "@wordpress/url": "^2.3.0", "classnames": "^2.2.5", "clipboard": "^2.0.1", "diff": "^3.5.0", @@ -347,33 +469,112 @@ "react-dates": "^17.1.1", "rememo": "^3.0.0", "tinycolor2": "^1.4.1", - "uuid": "^3.1.0" + "uuid": "^3.3.2" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/dom": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.6.tgz", + "integrity": "sha512-z1xdNASrkJc+FTdYAEDKub7pqrizAo2WFlkBmqrurwBcY/HoOTTEqg6wzq2SwvEq/rff741BCWD/JmGU7tI3AQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + } } }, "@wordpress/compose": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.0.tgz", - "integrity": "sha512-QtjesFxEdLAUoBxFQ7rkpUG5aA4ccRxZI71fz0RkMiBVKoUHIqy+R6VGViL/wkdYigmfD9KU89Rg3Ksk40hVIA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/deprecated": "^2.0.3", - "@wordpress/element": "^2.1.5", + "@wordpress/element": "^2.1.7", "@wordpress/is-shallow-equal": "^1.1.4", "lodash": "^4.17.10" } }, "@wordpress/core-data": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-2.0.8.tgz", - "integrity": "sha512-HJo8C/fX5w1pWT4Qw06KUdSCqi3mabrcljMYvspHdezynlGPd+0qJIlMav3cG6TQ6vZsTu+HN8gDiPT1gay8dw==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-2.0.12.tgz", + "integrity": "sha512-Z1nby7U+m+R2LVH2N6YEanbSbBiwKc+Ce646TULbnP7+S1NMGiLTlY00/00TWuIlQ6+gFHAd3lDuwigY6LZorw==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/api-fetch": "^2.2.1", - "@wordpress/data": "^3.0.1", - "@wordpress/url": "^2.2.0", + "@wordpress/api-fetch": "^2.2.3", + "@wordpress/data": "^3.1.2", + "@wordpress/url": "^2.3.0", "equivalent-key-map": "^0.2.2", "lodash": "^4.17.10", "rememo": "^3.0.0" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + } } }, "@wordpress/custom-templated-path-webpack-plugin": { @@ -387,13 +588,14 @@ } }, "@wordpress/data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.0.1.tgz", - "integrity": "sha512-7sMJ1EhaONY6vT7Miq534xhtKF+J/LecdiyX4r+DLk1Zgeacl48hUwGGvCzJ+CzwJZ06L1F/5lIEAiWM6he77A==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/compose": "^2.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", "@wordpress/is-shallow-equal": "^1.1.4", "@wordpress/redux-routine": "^3.0.3", "equivalent-key-map": "^0.2.2", @@ -404,9 +606,9 @@ } }, "@wordpress/date": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-2.1.0.tgz", - "integrity": "sha512-MMDU2/N0unnwKTmaeCYy4fW/CuyCdM5t+/ANXVigBxY/IiOGeRXnmiU4VHK1BshEnsWRJz687MmEGEkxVpwd8w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-2.2.1.tgz", + "integrity": "sha512-icDlv9HAEVx4xXveU9m93CHqH+82SqkL/Y3Po9jjuCS6K2F0OMJURdQSbcf6QJ6KmCXJzeQTq4/IrtioXOEy5w==", "requires": { "@babel/runtime": "^7.0.0", "moment": "^2.22.1", @@ -423,9 +625,9 @@ } }, "@wordpress/dom": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.4.tgz", - "integrity": "sha512-uW/yeWayoSu6uUA+xrM+yCbNJc3oQfga1Y1PUgXvowv0ydn5Qhgh2Dj07ANgg1AncZqFZsObPerBFNloaJhsvQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.6.tgz", + "integrity": "sha512-z1xdNASrkJc+FTdYAEDKub7pqrizAo2WFlkBmqrurwBcY/HoOTTEqg6wzq2SwvEq/rff741BCWD/JmGU7tI3AQ==", "requires": { "@babel/runtime": "^7.0.0", "lodash": "^4.17.10" @@ -440,63 +642,130 @@ } }, "@wordpress/edit-post": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-2.0.2.tgz", - "integrity": "sha512-oSArO39TUFR+PboGABq85aYBxo8suOnjJIwc7KzhoelhGVQ+AHxN83xk8L4fhgWvp5v4k4rNu7i/HiVdy0iIsw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-3.0.0.tgz", + "integrity": "sha512-sswJ8jFYoUn70WGcWuxzPCldjAsAlmyBfOsfEdy6LDeBvxwi84Bk9CzooJr/V+FGsRmMtmRA5O6XbpnaBVo6Ig==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/a11y": "^2.0.2", - "@wordpress/api-fetch": "^2.2.1", - "@wordpress/block-library": "^2.1.7", - "@wordpress/blocks": "^5.1.1", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/core-data": "^2.0.8", - "@wordpress/data": "^3.0.1", - "@wordpress/deprecated": "^2.0.3", - "@wordpress/editor": "^6.1.0", - "@wordpress/element": "^2.1.5", - "@wordpress/format-library": "^1.0.2", + "@wordpress/api-fetch": "^2.2.3", + "@wordpress/block-library": "^2.2.2", + "@wordpress/blocks": "^5.3.1", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/core-data": "^2.0.12", + "@wordpress/data": "^3.1.2", + "@wordpress/editor": "^7.0.0", + "@wordpress/element": "^2.1.7", + "@wordpress/format-library": "^1.2.0", "@wordpress/hooks": "^2.0.3", "@wordpress/i18n": "^3.0.1", "@wordpress/keycodes": "^2.0.3", - "@wordpress/nux": "^2.0.8", - "@wordpress/plugins": "^2.0.6", - "@wordpress/url": "^2.2.0", - "@wordpress/viewport": "^2.0.7", + "@wordpress/nux": "^2.0.12", + "@wordpress/plugins": "^2.0.8", + "@wordpress/url": "^2.3.0", + "@wordpress/viewport": "^2.0.10", "classnames": "^2.2.5", "lodash": "^4.17.10", "refx": "^3.0.0" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + }, + "@wordpress/plugins": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-2.0.8.tgz", + "integrity": "sha512-qxoUQ6QukmktKDAIvYg+tJBSihZ/gPftxXOuYhoPBADXnAUxh6s7njpWebf2sw7pJjQPYv4EG7/edOQ0bt6C9Q==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/element": "^2.1.7", + "@wordpress/hooks": "^2.0.3", + "lodash": "^4.17.10" + } + }, + "@wordpress/viewport": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@wordpress/viewport/-/viewport-2.0.10.tgz", + "integrity": "sha512-G+7VgUQkRu9JwrsiBvTs/CS87vs6wcxCknr2lWU14rk55FWpxg4fhduRHUcBYEk7E+bvOHV1TgnAspBncu1aYg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/data": "^3.1.2", + "@wordpress/element": "^2.1.7", + "lodash": "^4.17.10" + } + } } }, "@wordpress/editor": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-6.1.0.tgz", - "integrity": "sha512-ppc5PLjecQrFMSb/I5bv1ENR0E7BSWoqrsW+IjapPkdhPrw5i2UtL3wWb13Nn+4G6UQEUJQO+md+uXnlVMdNkg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-7.0.0.tgz", + "integrity": "sha512-aNSwKvBlU6tg9qwte+yMk8W+sgOy2HUQyoyoPJIXo0awqfDPLFrBG8I7tnicybPXxxtBNamybSf6TVB1R/kn8A==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/a11y": "^2.0.2", - "@wordpress/api-fetch": "^2.2.1", + "@wordpress/api-fetch": "^2.2.3", "@wordpress/blob": "^2.1.0", - "@wordpress/blocks": "^5.1.1", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/core-data": "^2.0.8", - "@wordpress/data": "^3.0.1", - "@wordpress/date": "^2.1.0", + "@wordpress/blocks": "^5.3.1", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/core-data": "^2.0.12", + "@wordpress/data": "^3.1.2", + "@wordpress/date": "^2.2.1", "@wordpress/deprecated": "^2.0.3", - "@wordpress/dom": "^2.0.4", - "@wordpress/element": "^2.1.5", + "@wordpress/dom": "^2.0.6", + "@wordpress/element": "^2.1.7", "@wordpress/hooks": "^2.0.3", "@wordpress/html-entities": "^2.0.2", "@wordpress/i18n": "^3.0.1", "@wordpress/is-shallow-equal": "^1.1.4", "@wordpress/keycodes": "^2.0.3", - "@wordpress/notices": "^1.0.1", - "@wordpress/nux": "^2.0.8", + "@wordpress/notices": "^1.0.4", + "@wordpress/nux": "^2.0.12", "@wordpress/token-list": "^1.0.2", - "@wordpress/url": "^2.2.0", - "@wordpress/viewport": "^2.0.7", + "@wordpress/url": "^2.3.0", + "@wordpress/viewport": "^2.0.10", "@wordpress/wordcount": "^2.0.3", "classnames": "^2.2.5", "dom-scroll-into-view": "^1.2.1", @@ -514,6 +783,90 @@ "traverse": "^0.6.6" }, "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/date": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-2.2.1.tgz", + "integrity": "sha512-icDlv9HAEVx4xXveU9m93CHqH+82SqkL/Y3Po9jjuCS6K2F0OMJURdQSbcf6QJ6KmCXJzeQTq4/IrtioXOEy5w==", + "requires": { + "@babel/runtime": "^7.0.0", + "moment": "^2.22.1", + "moment-timezone": "^0.5.16" + } + }, + "@wordpress/dom": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.6.tgz", + "integrity": "sha512-z1xdNASrkJc+FTdYAEDKub7pqrizAo2WFlkBmqrurwBcY/HoOTTEqg6wzq2SwvEq/rff741BCWD/JmGU7tI3AQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + }, + "@wordpress/notices": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-1.0.4.tgz", + "integrity": "sha512-7vjv62bx2VJLagl6+8FPkQeVtWMd4tC3GYIqX6AU4HA6RUaC0VPxWxVTHt0tFXPL7bqUkOZgICNHTyzOIzdTzA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/a11y": "^2.0.2", + "@wordpress/data": "^3.1.2", + "lodash": "^4.17.10" + } + }, + "@wordpress/viewport": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@wordpress/viewport/-/viewport-2.0.10.tgz", + "integrity": "sha512-G+7VgUQkRu9JwrsiBvTs/CS87vs6wcxCknr2lWU14rk55FWpxg4fhduRHUcBYEk7E+bvOHV1TgnAspBncu1aYg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/data": "^3.1.2", + "@wordpress/element": "^2.1.7", + "lodash": "^4.17.10" + } + }, "jquery": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", @@ -522,9 +875,9 @@ } }, "@wordpress/element": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.5.tgz", - "integrity": "sha512-y567y5SZv3VXDrUw/qpO7ElrTc8/BhumAivVlpAItychfn/PdTxd2l5V1Cc91Uc2/JDoAhPCRIO23UFWX+Ehtw==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/escape-html": "^1.0.1", @@ -542,19 +895,19 @@ } }, "@wordpress/format-library": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-1.0.2.tgz", - "integrity": "sha512-Y49EBpjfo6CbkT8ytuCfaLq53vdGGO+R3XkmEIGrdwaPUFgUyICtrNZKRxml6wx63DdcernaDeYMfz5XWuMWnQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-1.2.0.tgz", + "integrity": "sha512-FnkzmgMYrKiBdQN1iDUgqjqZTnniHsrxcg/MvQwpg+inRtXYUTh2lp4wWsn9lEO2g2t85r69GAYsC8TmmaUjEQ==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/components": "^5.0.1", - "@wordpress/dom": "^2.0.4", - "@wordpress/editor": "^6.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/components": "^6.0.0", + "@wordpress/dom": "^2.0.6", + "@wordpress/editor": "^7.0.0", + "@wordpress/element": "^2.1.7", "@wordpress/i18n": "^3.0.1", "@wordpress/keycodes": "^2.0.3", - "@wordpress/rich-text": "^2.0.1", - "@wordpress/url": "^2.2.0" + "@wordpress/rich-text": "^2.0.4", + "@wordpress/url": "^2.3.0" }, "dependencies": { "@wordpress/compose": { @@ -567,20 +920,45 @@ "@wordpress/element": "^2.1.7", "@wordpress/is-shallow-equal": "^1.1.4", "lodash": "^4.17.10" - }, - "dependencies": { - "@wordpress/element": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.8.tgz", - "integrity": "sha512-hPbNWcxGQCpTeXoTdwr0Bu3kNJMSSKAnIb5B8P/2lTQ9mJ6w8l1Vc/0L11Yy8+uElaLwGq4Lja9ljgTlWbXUkA==", - "requires": { - "@babel/runtime": "^7.0.0", - "@wordpress/escape-html": "^1.0.1", - "lodash": "^4.17.10", - "react": "^16.6.3", - "react-dom": "^16.6.3" - } - } + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/dom": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-2.0.6.tgz", + "integrity": "sha512-z1xdNASrkJc+FTdYAEDKub7pqrizAo2WFlkBmqrurwBcY/HoOTTEqg6wzq2SwvEq/rff741BCWD/JmGU7tI3AQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" } }, "@wordpress/rich-text": { @@ -594,60 +972,6 @@ "@wordpress/escape-html": "^1.0.1", "lodash": "^4.17.10", "rememo": "^3.0.0" - }, - "dependencies": { - "@wordpress/data": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", - "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", - "requires": { - "@babel/runtime": "^7.0.0", - "@wordpress/compose": "^2.1.2", - "@wordpress/deprecated": "^2.0.3", - "@wordpress/element": "^2.1.7", - "@wordpress/is-shallow-equal": "^1.1.4", - "@wordpress/redux-routine": "^3.0.3", - "equivalent-key-map": "^0.2.2", - "is-promise": "^2.1.0", - "lodash": "^4.17.10", - "redux": "^4.0.0", - "turbo-combine-reducers": "^1.0.2" - } - }, - "@wordpress/element": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.8.tgz", - "integrity": "sha512-hPbNWcxGQCpTeXoTdwr0Bu3kNJMSSKAnIb5B8P/2lTQ9mJ6w8l1Vc/0L11Yy8+uElaLwGq4Lja9ljgTlWbXUkA==", - "requires": { - "@babel/runtime": "^7.0.0", - "@wordpress/escape-html": "^1.0.1", - "lodash": "^4.17.10", - "react": "^16.6.3", - "react-dom": "^16.6.3" - } - } - } - }, - "react": { - "version": "16.6.3", - "resolved": "https://registry.npmjs.org/react/-/react-16.6.3.tgz", - "integrity": "sha512-zCvmH2vbEolgKxtqXL2wmGCUxUyNheYn/C+PD1YAjfxHC54+MhdruyhO7QieQrYsYeTxrn93PM2y0jRH1zEExw==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.11.2" - } - }, - "react-dom": { - "version": "16.6.3", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.6.3.tgz", - "integrity": "sha512-8ugJWRCWLGXy+7PmNh8WJz3g1TaTUt1XyoIcFN+x0Zbkoz+KKdUyx1AQLYJdbFXjuF41Nmjn5+j//rxvhFjgSQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.11.2" } } } @@ -709,54 +1033,124 @@ } }, "@wordpress/list-reusable-blocks": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-1.1.6.tgz", - "integrity": "sha512-69FxfHl8zb0kYcYkAFE9zJCUpBfOP/zLGVa96yTaf/kP0RDrb6oB8APLOWtBrAxIriKcksinjwi1WZv5kw7+fA==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-1.1.10.tgz", + "integrity": "sha512-8Jdee13/AYfEYbTXZqz9XHbhKdw0c41oa3bf3nKWqrf2DaNWxLBAT9U9VsINcfFa0+508fLf6kgRCjNpmHvNag==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/api-fetch": "^2.2.1", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/api-fetch": "^2.2.3", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/element": "^2.1.7", "@wordpress/i18n": "^3.0.1", "lodash": "^4.17.10" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + } } }, "@wordpress/notices": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-1.0.1.tgz", - "integrity": "sha512-Spj6SWDIYUOXA8YtJaX5um0SIqWMKPwJHKnMyFd8pq6K3dsp+vVwsTQEld06XxN9ZyQCKXkQkY1R8rzQozvD2w==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-1.0.4.tgz", + "integrity": "sha512-7vjv62bx2VJLagl6+8FPkQeVtWMd4tC3GYIqX6AU4HA6RUaC0VPxWxVTHt0tFXPL7bqUkOZgICNHTyzOIzdTzA==", "requires": { "@babel/runtime": "^7.0.0", "@wordpress/a11y": "^2.0.2", - "@wordpress/data": "^3.0.1", + "@wordpress/data": "^3.1.2", "lodash": "^4.17.10" } }, "@wordpress/nux": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-2.0.8.tgz", - "integrity": "sha512-DgOLf9wRq+nYK8+KOf/1+DcZQMIo7eQBPN7rffwA3qoVlyzN3Emkn1O4pJwK+c/o5hp0TU2nHRKrYbUvWAwgMQ==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-2.0.12.tgz", + "integrity": "sha512-y97Q/plpcFPTRYqbfeucmIOnJe1jEIJwFJxJinDqifcfGhYZ4/x3JN7+9uwyatdT8oDzHUO67VoE9z2k2fPTmQ==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/data": "^3.0.1", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/data": "^3.1.2", "@wordpress/deprecated": "^2.0.3", - "@wordpress/element": "^2.1.5", + "@wordpress/element": "^2.1.7", "@wordpress/i18n": "^3.0.1", "lodash": "^4.17.10", "rememo": "^3.0.0" + }, + "dependencies": { + "@wordpress/compose": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-2.1.2.tgz", + "integrity": "sha512-jr1bWRYx8vt4bCWB4hqR9Ve9rk/TCJ5mFRvkwEd+xTDyXG6ZMmps3HszGA6aCH7E+TCHH+bWw2qZo9sAeHVK/w==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "lodash": "^4.17.10" + } + }, + "@wordpress/data": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-3.1.2.tgz", + "integrity": "sha512-aAYgRIljpLboplTaCA7t5r+qVjE53VGMS7rLjSHFsoFxj9GYPiCCX1f/B01eKz9pf04rVdM2N4cEowyxjkhKFA==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/deprecated": "^2.0.3", + "@wordpress/element": "^2.1.7", + "@wordpress/is-shallow-equal": "^1.1.4", + "@wordpress/redux-routine": "^3.0.3", + "equivalent-key-map": "^0.2.2", + "is-promise": "^2.1.0", + "lodash": "^4.17.10", + "redux": "^4.0.0", + "turbo-combine-reducers": "^1.0.2" + } + }, + "@wordpress/element": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.1.7.tgz", + "integrity": "sha512-+2Nbs0R3eP2gNrH0z1H5ZXTr0Lja7ZGFrtlKXa3+ZblHDBAheSB24ZEbQqZJTK1zdGw+GOU/vXPyY4ThHHJiPg==", + "requires": { + "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "^1.0.1", + "lodash": "^4.17.10", + "react": "^16.4.1", + "react-dom": "^16.4.1" + } + } } }, "@wordpress/plugins": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-2.0.6.tgz", - "integrity": "sha512-6irK6QjXc414ns0P/gSMJFUBXDVxqvuHmYKGNo5lyBbmas68WwyBwV/V52wP1cBhfqo3LCpYshX+jzTm/HXMLw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-2.0.8.tgz", + "integrity": "sha512-qxoUQ6QukmktKDAIvYg+tJBSihZ/gPftxXOuYhoPBADXnAUxh6s7njpWebf2sw7pJjQPYv4EG7/edOQ0bt6C9Q==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/compose": "^2.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/compose": "^2.1.2", + "@wordpress/element": "^2.1.7", "@wordpress/hooks": "^2.0.3", "lodash": "^4.17.10" } @@ -772,12 +1166,12 @@ } }, "@wordpress/rich-text": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-2.0.1.tgz", - "integrity": "sha512-cWbb3CryMaUkUARX+izJu++60IC8vRz68oxgg/bKP3l8Bof2NaAZJt637qQCghl5XVzUXjpBayufF3bdnuajfA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-2.0.4.tgz", + "integrity": "sha512-c1DQ5xhVb8k1PV/9fTCSFHyu8SbKVzM3tCG7JX/fsUppzjV3CzljkxSYRm1GrFidRX5uqOYP+SGWi9x25Cnl1g==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/data": "^3.0.1", + "@wordpress/data": "^3.1.2", "@wordpress/deprecated": "^2.0.3", "@wordpress/escape-html": "^1.0.1", "lodash": "^4.17.10", @@ -804,9 +1198,9 @@ } }, "@wordpress/url": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.2.0.tgz", - "integrity": "sha512-Y1Vjbvkcfeh9scstzArW0f4G0v1YpevZcjlPvVM77gqXPxKhoBobc/XyErUaqWbozji6L2YE/baP/bYSOaswug==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.3.0.tgz", + "integrity": "sha512-Uzl6RZnPZZHM67Z6Rs4lHgGY7dJO6OHjWrcw5/Pnoy/WQGDAg1vl5lfTbRXSNKsubOsbvB9IF8qTwVoPEl/ezA==", "requires": { "@babel/runtime": "^7.0.0", "qs": "^6.5.2" @@ -820,14 +1214,14 @@ } }, "@wordpress/viewport": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@wordpress/viewport/-/viewport-2.0.7.tgz", - "integrity": "sha512-bvJytESuTdoTr5GmLmKlLoWp4WfIsN7Jpe5u+EBrbbWXYlDPMBgEnD83bu8myPmQb56YJPPz561YCeTZMPjhDQ==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@wordpress/viewport/-/viewport-2.0.10.tgz", + "integrity": "sha512-G+7VgUQkRu9JwrsiBvTs/CS87vs6wcxCknr2lWU14rk55FWpxg4fhduRHUcBYEk7E+bvOHV1TgnAspBncu1aYg==", "requires": { "@babel/runtime": "^7.0.0", - "@wordpress/compose": "^2.1.0", - "@wordpress/data": "^3.0.1", - "@wordpress/element": "^2.1.5", + "@wordpress/compose": "^2.1.2", + "@wordpress/data": "^3.1.2", + "@wordpress/element": "^2.1.7", "lodash": "^4.17.10" } }, @@ -13542,15 +13936,6 @@ "object-assign": "^4.1.1" } }, - "scheduler": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.11.3.tgz", - "integrity": "sha512-i9X9VRRVZDd3xZw10NY5Z2cVMbdYg6gqFecfj79USv1CFN+YrJ3gIPRKf1qlY+Sxly4djoKdfx1T+m9dnRB8kQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "schema-utils": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", diff --git a/package.json b/package.json index e5bffeadc9..3cfb9e7af8 100644 --- a/package.json +++ b/package.json @@ -56,40 +56,41 @@ "dependencies": { "@babel/polyfill": "^7.0.0", "@wordpress/a11y": "^2.0.2", - "@wordpress/api-fetch": "^2.2.1", + "@wordpress/annotations": "^1.0.0", + "@wordpress/api-fetch": "^2.2.3", "@wordpress/autop": "^2.0.2", "@wordpress/blob": "^2.1.0", - "@wordpress/block-library": "^2.1.7", - "@wordpress/block-serialization-default-parser": "^1.0.1", - "@wordpress/blocks": "^5.1.1", - "@wordpress/components": "^5.0.1", - "@wordpress/compose": "^2.1.0", - "@wordpress/core-data": "^2.0.8", - "@wordpress/data": "^3.0.1", - "@wordpress/date": "^2.1.0", + "@wordpress/block-library": "^2.2.2", + "@wordpress/block-serialization-default-parser": "^2.0.0", + "@wordpress/blocks": "^5.3.1", + "@wordpress/components": "^6.0.0", + "@wordpress/compose": "^2.1.2", + "@wordpress/core-data": "^2.0.12", + "@wordpress/data": "^3.1.2", + "@wordpress/date": "^2.2.1", "@wordpress/deprecated": "^2.0.3", - "@wordpress/dom": "^2.0.4", + "@wordpress/dom": "^2.0.6", "@wordpress/dom-ready": "^2.0.2", - "@wordpress/edit-post": "^2.0.2", - "@wordpress/editor": "^6.1.0", - "@wordpress/element": "^2.1.5", + "@wordpress/edit-post": "^3.0.0", + "@wordpress/editor": "^7.0.0", + "@wordpress/element": "^2.1.7", "@wordpress/escape-html": "^1.0.1", - "@wordpress/format-library": "^1.0.2", + "@wordpress/format-library": "^1.2.0", "@wordpress/hooks": "^2.0.3", "@wordpress/html-entities": "^2.0.2", "@wordpress/i18n": "^3.0.1", "@wordpress/is-shallow-equal": "^1.1.4", "@wordpress/keycodes": "^2.0.3", - "@wordpress/list-reusable-blocks": "^1.1.6", - "@wordpress/notices": "^1.0.1", - "@wordpress/nux": "^2.0.8", - "@wordpress/plugins": "^2.0.6", + "@wordpress/list-reusable-blocks": "^1.1.10", + "@wordpress/notices": "^1.0.4", + "@wordpress/nux": "^2.0.12", + "@wordpress/plugins": "^2.0.8", "@wordpress/redux-routine": "^3.0.3", - "@wordpress/rich-text": "^2.0.1", + "@wordpress/rich-text": "^2.0.4", "@wordpress/shortcode": "^2.0.2", "@wordpress/token-list": "^1.0.2", - "@wordpress/url": "^2.2.0", - "@wordpress/viewport": "^2.0.7", + "@wordpress/url": "^2.3.0", + "@wordpress/viewport": "^2.0.10", "@wordpress/wordcount": "^2.0.3", "backbone": "1.3.3", "element-closest": "^2.0.2", diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 617432d957..23206b5b65 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -104,15 +104,9 @@ if ( 'auto-draft' === $post->post_status ) { $is_new_post = true; // Override "(Auto Draft)" new post default title with empty string, or filtered value. $initial_edits = array( - 'title' => array( - 'raw' => $post->post_title, - ), - 'content' => array( - 'raw' => $post->post_content, - ), - 'excerpt' => array( - 'raw' => $post->post_excerpt, - ), + 'title' => $post->post_title, + 'content' => $post->post_content, + 'excerpt' => $post->post_excerpt, ); } @@ -203,8 +197,6 @@ if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) { } // Image sizes. -$image_sizes = get_intermediate_image_sizes(); -$image_sizes[] = 'full'; /** This filter is documented in wp-admin/includes/media.php */ $image_size_names = apply_filters( @@ -218,10 +210,10 @@ $image_size_names = apply_filters( ); $available_image_sizes = array(); -foreach ( $image_sizes as $image_size_slug ) { +foreach ( $image_size_names as $image_size_slug => $image_size_name ) { $available_image_sizes[] = array( 'slug' => $image_size_slug, - 'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug, + 'name' => $image_size_name, ); } @@ -260,10 +252,10 @@ if ( $user_id ) { * * @since 5.0.0 * - * @param string $text Placeholder text. Default 'Write your story'. + * @param string $text Placeholder text. Default 'Start writing or type / to choose a block'. * @param WP_Post $post Post object. */ -$body_placeholder = apply_filters( 'write_your_story', __( 'Write your story' ), $post ); +$body_placeholder = apply_filters( 'write_your_story', __( 'Start writing or type / to choose a block' ), $post ); $editor_settings = array( 'alignWide' => $align_wide, @@ -280,7 +272,7 @@ $editor_settings = array( 'maxUploadFileSize' => $max_upload_size, 'allowedMimeTypes' => get_allowed_mime_types(), 'styles' => $styles, - 'availableImageSizes' => $available_image_sizes, + 'imageSizes' => $available_image_sizes, 'postLock' => $lock_details, 'postLockUtils' => array( 'nonce' => wp_create_nonce( 'lock-post_' . $post->ID ), diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index fe83ef7750..e584dc377d 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -114,41 +114,95 @@ function get_dynamic_block_names() { } /** - * Remove all dynamic blocks from the given content. + * Parses blocks out of a content string, and renders those appropriate for the excerpt. + * + * As the excerpt should be a small string of text relevant to the full post content, + * this function renders the blocks that are most likely to contain such text. * * @since 5.0.0 * - * @param string $content Content of the current post. - * @return string + * @param string $content The content to parse. + * @return string The parsed and filtered content. */ -function strip_dynamic_blocks( $content ) { - return _recurse_strip_dynamic_blocks( parse_blocks( $content ) ); +function excerpt_remove_blocks( $content ) { + $allowed_blocks = array( + // Classic blocks have their blockName set to null. + null, + 'core/columns', + 'core/freeform', + 'core/heading', + 'core/html', + 'core/list', + 'core/media-text', + 'core/paragraph', + 'core/preformatted', + 'core/pullquote', + 'core/quote', + 'core/table', + 'core/verse', + ); + /** + * Filters the list of blocks that can contribute to the excerpt. + * + * If a dynamic block is added to this list, it must not generate another + * excerpt, as this will cause an infinite loop to occur. + * + * @since 4.4.0 + * + * @param array $allowed_blocks The list of allowed blocks. + */ + $allowed_blocks = apply_filters( 'excerpt_allowed_blocks', $allowed_blocks ); + $blocks = parse_blocks( $content ); + $output = ''; + foreach ( $blocks as $block ) { + if ( in_array( $block['blockName'], $allowed_blocks, true ) ) { + $output .= render_block( $block ); + } + } + return $output; } /** - * Helper function for strip_dynamic_blocks(), to recurse through the block tree. + * Renders a single block into a HTML string. * * @since 5.0.0 - * @access private * - * @param array $blocks Array of blocks from parse_blocks(). - * @return string HTML from the non-dynamic blocks. + * @global WP_Post $post The post to edit. + * + * @param array $block A single parsed block object. + * @return string String of rendered HTML. */ -function _recurse_strip_dynamic_blocks( $blocks ) { - $clean_content = ''; - $dynamic_blocks = get_dynamic_block_names(); +function render_block( $block ) { + global $post; - foreach ( $blocks as $block ) { - if ( ! in_array( $block['blockName'], $dynamic_blocks ) ) { - if ( $block['innerBlocks'] ) { - $clean_content .= _recurse_strip_dynamic_blocks( $block['innerBlocks'] ); - } else { - $clean_content .= $block['innerHTML']; - } - } + $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); + $is_dynamic = $block['blockName'] && null !== $block_type && $block_type->is_dynamic(); + $block_content = ''; + $index = 0; + + foreach ( $block['innerContent'] as $chunk ) { + $block_content .= is_string( $chunk ) ? $chunk : render_block( $block['innerBlocks'][ $index++ ] ); } - return $clean_content; + if ( ! is_array( $block['attrs'] ) ) { + $block['attrs'] = array(); + } + + if ( $is_dynamic ) { + $global_post = $post; + $block_content = $block_type->render( $block['attrs'], $block_content ); + $post = $global_post; + } + + /** + * Filters the content of a single block. + * + * @since 5.0.0 + * + * @param string $block_content The block content about to be appended. + * @param array $block The full block, including name and attributes. + */ + return apply_filters( 'render_block', $block_content, $block ); } /** @@ -156,25 +210,10 @@ function _recurse_strip_dynamic_blocks( $blocks ) { * * @since 5.0.0 * - * @param string $content Post content. - * @return array Array of parsed block objects. + * @param string $content Post content. + * @return array Array of parsed block objects. */ function parse_blocks( $content ) { - /* - * If there are no blocks in the content, return a single block, rather - * than wasting time trying to parse the string. - */ - if ( ! has_blocks( $content ) ) { - return array( - array( - 'blockName' => null, - 'attrs' => array(), - 'innerBlocks' => array(), - 'innerHTML' => $content, - ), - ); - } - /** * Filter to allow plugins to replace the server-side block parser * @@ -206,7 +245,13 @@ function do_blocks( $content ) { } $blocks = parse_blocks( $content ); - return _recurse_do_blocks( $blocks, $blocks ); + $output = ''; + + foreach ( $blocks as $block ) { + $output .= render_block( $block ); + } + + return $output; } /** @@ -230,67 +275,6 @@ function _restore_wpautop_hook( $content ) { return $content; } -/** - * Helper function for do_blocks(), to recurse through the block tree. - * - * @since 5.0.0 - * @access private - * - * @param array $blocks Array of blocks from parse_blocks(). - * @param array $all_blocks The top level array of blocks. - * @return string The block HTML. - */ -function _recurse_do_blocks( $blocks, $all_blocks ) { - global $post; - - /* - * Back up global post, to restore after render callback. - * Allows callbacks to run new WP_Query instances without breaking the global post. - */ - $global_post = $post; - - $rendered_content = ''; - $dynamic_blocks = get_dynamic_block_names(); - - foreach ( $blocks as $block ) { - $block = (array) $block; - if ( in_array( $block['blockName'], $dynamic_blocks ) ) { - // Find registered block type. We can assume it exists since we use the - // `get_dynamic_block_names` function as a source for pattern matching. - $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); - - // Replace dynamic block with server-rendered output. - $block_content = $block_type->render( (array) $block['attrs'], $block['innerHTML'] ); - } elseif ( $block['innerBlocks'] ) { - $block_content = _recurse_do_blocks( $block['innerBlocks'], $blocks ); - } else { - $block_content = $block['innerHTML']; - } - - /** - * Filters the content of a single block. - * - * During the_content, each block is parsed and added to the output individually. This filter allows - * that content to be altered immediately before it's appended. - * - * @since 5.0.0 - * - * @param string $block_content The block content about to be appended. - * @param array $block The full block, including name and attributes. - * @param array $all_blocks The array of all blocks being processed. - */ - $rendered_content .= apply_filters( 'do_block', $block_content, $block, $all_blocks ); - - // Restore global $post. - $post = $global_post; - } - - // Strip remaining block comment demarcations. - $rendered_content = preg_replace( '//m', '', $rendered_content ); - - return $rendered_content; -} - /** * Returns the current version of the block format that the content string is using. * diff --git a/src/wp-includes/class-wp-block-parser.php b/src/wp-includes/class-wp-block-parser.php index 15c9d9556b..22a8a57a9a 100644 --- a/src/wp-includes/class-wp-block-parser.php +++ b/src/wp-includes/class-wp-block-parser.php @@ -48,11 +48,26 @@ class WP_Block_Parser_Block { */ public $innerHTML; - function __construct( $name, $attrs, $innerBlocks, $innerHTML ) { - $this->blockName = $name; - $this->attrs = $attrs; - $this->innerBlocks = $innerBlocks; - $this->innerHTML = $innerHTML; + /** + * List of string fragments and null markers where inner blocks were found + * + * @example array( + * 'innerHTML' => 'BeforeInnerAfter', + * 'innerBlocks' => array( block, block ), + * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), + * ) + * + * @since 4.2.0 + * @var array + */ + public $innerContent; + + function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { + $this->blockName = $name; + $this->attrs = $attrs; + $this->innerBlocks = $innerBlocks; + $this->innerHTML = $innerHTML; + $this->innerContent = $innerContent; } } @@ -158,6 +173,14 @@ class WP_Block_Parser { */ public $stack; + /** + * Empty associative array, here due to PHP quirks + * + * @since 4.4.0 + * @var array empty associative array + */ + public $empty_attrs; + /** * Parses a document and returns a list of block structures * @@ -171,10 +194,11 @@ class WP_Block_Parser { * @return WP_Block_Parser_Block[] */ function parse( $document ) { - $this->document = $document; - $this->offset = 0; - $this->output = array(); - $this->stack = array(); + $this->document = $document; + $this->offset = 0; + $this->output = array(); + $this->stack = array(); + $this->empty_attrs = json_decode( '{}', true ); do { // twiddle our thumbs @@ -254,14 +278,14 @@ class WP_Block_Parser { ); } - $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ); + $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ); $this->offset = $start_offset + $token_length; return true; } // otherwise we found an inner block $this->add_inner_block( - new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ), + new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length ); @@ -273,7 +297,7 @@ class WP_Block_Parser { array_push( $this->stack, new WP_Block_Parser_Frame( - new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ), + new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length, $start_offset + $token_length, @@ -310,16 +334,11 @@ class WP_Block_Parser { * otherwise we're nested and we have to close out the current * block and add it as a new innerBlock to the parent */ - $stack_top = array_pop( $this->stack ); - - $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); - if ( $stack_top->block->innerBlocks ) { - $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); - } else { - $stack_top->block->innerHTML = $html; - } - - $stack_top->prev_offset = $start_offset + $token_length; + $stack_top = array_pop( $this->stack ); + $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); + $stack_top->block->innerHTML .= $html; + $stack_top->block->innerContent[] = $html; + $stack_top->prev_offset = $start_offset + $token_length; $this->add_inner_block( $stack_top->block, @@ -359,7 +378,7 @@ class WP_Block_Parser { * match back in PHP to see which one it was. */ $has_match = preg_match( - '/).)+?}\s+)?(?\/)?-->/s', + '/).)*?}\s+)?(?\/)?-->/s', $this->document, $matches, PREG_OFFSET_CAPTURE, @@ -387,7 +406,7 @@ class WP_Block_Parser { */ $attrs = $has_attrs ? json_decode( $matches['attrs'][0], /* as-associative */ true ) - : json_decode( '{}', /* don't ask why, just verify in PHP */ false ); + : $this->empty_attrs; /* * This state isn't allowed @@ -417,8 +436,8 @@ class WP_Block_Parser { * @param string $innerHTML HTML content of block * @return WP_Block_Parser_Block freeform block object */ - static function freeform( $innerHTML ) { - return new WP_Block_Parser_Block( null, array(), array(), $innerHTML ); + function freeform( $innerHTML ) { + return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) ); } /** @@ -452,9 +471,16 @@ class WP_Block_Parser { */ function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { $parent = $this->stack[ count( $this->stack ) - 1 ]; - $parent->block->innerBlocks[] = (array) $this->freeform( substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ) ); $parent->block->innerBlocks[] = (array) $block; - $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; + $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); + + if ( ! empty( $html ) ) { + $parent->block->innerHTML .= $html; + $parent->block->innerContent[] = $html; + } + + $parent->block->innerContent[] = null; + $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; } /** @@ -472,10 +498,9 @@ class WP_Block_Parser { ? substr( $this->document, $prev_offset, $end_offset - $prev_offset ) : substr( $this->document, $prev_offset ); - if ( $stack_top->block->innerBlocks ) { - $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); - } else { - $stack_top->block->innerHTML = $html; + if ( ! empty( $html ) ) { + $stack_top->block->innerHTML .= $html; + $stack_top->block->innerContent[] = $html; } if ( isset( $stack_top->leading_html_start ) ) { diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 5c974f9a06..f858d7b9ab 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3635,7 +3635,7 @@ function wp_trim_excerpt( $text = '' ) { $text = get_the_content( '' ); $text = strip_shortcodes( $text ); - $text = strip_dynamic_blocks( $text ); + $text = excerpt_remove_blocks( $text ); /** This filter is documented in wp-includes/post-template.php */ $text = apply_filters( 'the_content', $text ); diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 82ea66d700..8fa4d5eea2 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -85,7 +85,7 @@ function wp_default_packages_vendor( &$scripts ) { 'wp-polyfill-formdata', 'wp-polyfill-node-contains', 'wp-polyfill-element-closest', - 'wp-polyfill-ecmascript', + 'wp-polyfill', ); foreach ( $vendor_scripts as $handle => $dependencies ) { @@ -99,7 +99,7 @@ function wp_default_packages_vendor( &$scripts ) { $scripts->add( $handle, $path, $dependencies, false, 1 ); } - $scripts->add( 'wp-polyfill', null, array( 'wp-polyfill-ecmascript' ) ); + $scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) ); did_action( 'init' ) && $scripts->add_data( 'wp-polyfill', 'data', @@ -166,6 +166,13 @@ function wp_default_packages_scripts( &$scripts ) { $packages_dependencies = array( 'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ), 'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ), + 'annotations' => array( + 'wp-data', + 'wp-hooks', + 'wp-i18n', + 'wp-polyfill', + 'wp-rich-text', + ), 'autop' => array( 'wp-polyfill' ), 'blob' => array( 'wp-polyfill' ), 'blocks' => array( @@ -259,7 +266,6 @@ function wp_default_packages_scripts( &$scripts ) { 'wp-compose', 'wp-core-data', 'wp-data', - 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', @@ -334,7 +340,7 @@ function wp_default_packages_scripts( &$scripts ) { 'lodash', 'wp-a11y', 'wp-data', - 'wp-polyfill-ecmascript', + 'wp-polyfill', ), 'nux' => array( 'wp-element', diff --git a/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.parsed.json b/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.parsed.json index 2dfce101b4..b3c0c79ad5 100644 --- a/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html b/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html index 8b13789179..220f8b60c8 100644 --- a/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html +++ b/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html @@ -1 +1 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__archives.parsed.json b/tests/phpunit/data/blocks/fixtures/core__archives.parsed.json index fab690ff93..f974a7a167 100644 --- a/tests/phpunit/data/blocks/fixtures/core__archives.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__archives.parsed.json @@ -6,6 +6,7 @@ "showPostCounts": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.parsed.json b/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.parsed.json index cd58cbf969..88439c3fc9 100644 --- a/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.parsed.json @@ -6,6 +6,7 @@ "showPostCounts": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__audio.parsed.json b/tests/phpunit/data/blocks/fixtures/core__audio.parsed.json index 33926c0b88..6b0acbd0c4 100644 --- a/tests/phpunit/data/blocks/fixtures/core__audio.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__audio.parsed.json @@ -5,12 +5,14 @@ "align": "right" }, "innerBlocks": [], - "innerHTML": "\n
\n \n
\n" + "innerHTML": "\n
\n \n
\n", + "innerContent": [ "\n
\n \n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__block.parsed.json b/tests/phpunit/data/blocks/fixtures/core__block.parsed.json index 61b65e317a..33c4d86f6c 100644 --- a/tests/phpunit/data/blocks/fixtures/core__block.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__block.parsed.json @@ -5,12 +5,14 @@ "ref": 123 }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__button__center.parsed.json b/tests/phpunit/data/blocks/fixtures/core__button__center.parsed.json index 0094e8f264..352767e1c1 100644 --- a/tests/phpunit/data/blocks/fixtures/core__button__center.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__button__center.parsed.json @@ -5,12 +5,14 @@ "align": "center" }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__categories.json b/tests/phpunit/data/blocks/fixtures/core__categories.json index ff93919fbc..18375cfe83 100644 --- a/tests/phpunit/data/blocks/fixtures/core__categories.json +++ b/tests/phpunit/data/blocks/fixtures/core__categories.json @@ -4,9 +4,9 @@ "name": "core/categories", "isValid": true, "attributes": { - "showPostCounts": false, "displayAsDropdown": false, - "showHierarchy": false + "showHierarchy": false, + "showPostCounts": false }, "innerBlocks": [], "originalContent": "" diff --git a/tests/phpunit/data/blocks/fixtures/core__categories.parsed.json b/tests/phpunit/data/blocks/fixtures/core__categories.parsed.json index df39a8078d..60d03d7bc5 100644 --- a/tests/phpunit/data/blocks/fixtures/core__categories.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__categories.parsed.json @@ -7,12 +7,14 @@ "showHierarchy": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__code.parsed.json b/tests/phpunit/data/blocks/fixtures/core__code.parsed.json index 5aea1d9a14..d9bf0a215e 100644 --- a/tests/phpunit/data/blocks/fixtures/core__code.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__code.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/code", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n" + "innerHTML": "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n", + "innerContent": [ "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__column.parsed.json b/tests/phpunit/data/blocks/fixtures/core__column.parsed.json index 53f60ddbae..10f1e1a07c 100644 --- a/tests/phpunit/data/blocks/fixtures/core__column.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__column.parsed.json @@ -3,43 +3,29 @@ "blockName": "core/column", "attrs": {}, "innerBlocks": [ - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
\n\t" - }, { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph One

\n\t" + "innerHTML": "\n\t

Column One, Paragraph One

\n\t", + "innerContent": [ "\n\t

Column One, Paragraph One

\n\t" ] }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t" - }, { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph Two

\n\t" - }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
\n" - } - ], - "innerHTML": "" + "innerHTML": "\n\t

Column One, Paragraph Two

\n\t", + "innerContent": [ "\n\t

Column One, Paragraph Two

\n\t" ] + } + ], + "innerHTML": "\n
\n\t\n\t\n
\n", + "innerContent": [ "\n
\n\t", null, "\n\t", null, "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json b/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json index 111a378aa5..7dbde278bc 100644 --- a/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json @@ -5,105 +5,87 @@ "columns": 3 }, "innerBlocks": [ - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
\n\t" - }, { "blockName": "core/column", "attrs": {}, "innerBlocks": [ - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t
\n\t\t" - }, - { + { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column One, Paragraph One

\n\t\t" + "innerHTML": "\n\t\t

Column One, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column One, Paragraph One

\n\t\t" + ] }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t\t" - }, - { + { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column One, Paragraph Two

\n\t\t" - }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t
\n\t" - } + "innerHTML": "\n\t\t

Column One, Paragraph Two

\n\t\t", + "innerContent": [ + "\n\t\t

Column One, Paragraph Two

\n\t\t" + ] + } ], - "innerHTML": "" + "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t", + "innerContent": [ + "\n\t
\n\t\t", + null, + "\n\t\t", + null, + "\n\t
\n\t" + ] }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t" - }, { "blockName": "core/column", "attrs": {}, - "innerBlocks": [ - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t
\n\t\t" - }, - { + "innerBlocks": [ + { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column Two, Paragraph One

\n\t\t" + "innerHTML": "\n\t\t

Column Two, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column Two, Paragraph One

\n\t\t" + ] }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t\t" - }, - { + { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column Three, Paragraph One

\n\t\t" - }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\t
\n\t" - } + "innerHTML": "\n\t\t

Column Three, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column Three, Paragraph One

\n\t\t" + ] + } ], - "innerHTML": "" - }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
\n" - } + "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t", + "innerContent": [ + "\n\t
\n\t\t", + null, + "\n\t\t", + null, + "\n\t
\n\t" + ] + } ], - "innerHTML": "" + "innerHTML": "\n
\n\t\n\t\n
\n", + "innerContent": [ + "\n
\n\t", + null, + "\n\t", + null, + "\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.html b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.html new file mode 100644 index 0000000000..ae96a2e33b --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.html @@ -0,0 +1,16 @@ + +
+ +

Column One, Paragraph One

+ + +

Column One, Paragraph Two

+ + +

Column Two, Paragraph One

+ + +

Column Three, Paragraph One

+ +
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.json b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.json new file mode 100644 index 0000000000..6993fb5da6 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.json @@ -0,0 +1,85 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/columns", + "isValid": true, + "attributes": { + "columns": 3 + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/column", + "isValid": true, + "attributes": {}, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "Column One, Paragraph One", + "dropCap": false, + "className": "layout-column-1" + }, + "innerBlocks": [], + "originalContent": "

Column One, Paragraph One

" + }, + { + "clientId": "_clientId_1", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "Column One, Paragraph Two", + "dropCap": false, + "className": "layout-column-1" + }, + "innerBlocks": [], + "originalContent": "

Column One, Paragraph Two

" + } + ] + }, + { + "clientId": "_clientId_1", + "name": "core/column", + "isValid": true, + "attributes": {}, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "Column Two, Paragraph One", + "dropCap": false, + "className": "layout-column-2" + }, + "innerBlocks": [], + "originalContent": "

Column Two, Paragraph One

" + } + ] + }, + { + "clientId": "_clientId_2", + "name": "core/column", + "isValid": true, + "attributes": {}, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "Column Three, Paragraph One", + "dropCap": false, + "className": "layout-column-3" + }, + "innerBlocks": [], + "originalContent": "

Column Three, Paragraph One

" + } + ] + } + ], + "originalContent": "
\n\t\n\t\n\t\n\t\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.parsed.json b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.parsed.json new file mode 100644 index 0000000000..6bb604b40e --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.parsed.json @@ -0,0 +1,75 @@ +[ + { + "blockName": "core/columns", + "attrs": { + "columns": 3 + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "layout": "column-1" + }, + "innerBlocks": [], + "innerHTML": "\n\t

Column One, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column One, Paragraph One

\n\t" + ] + }, + { + "blockName": "core/paragraph", + "attrs": { + "layout": "column-1" + }, + "innerBlocks": [], + "innerHTML": "\n\t

Column One, Paragraph Two

\n\t", + "innerContent": [ + "\n\t

Column One, Paragraph Two

\n\t" + ] + }, + { + "blockName": "core/paragraph", + "attrs": { + "layout": "column-2" + }, + "innerBlocks": [], + "innerHTML": "\n\t

Column Two, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column Two, Paragraph One

\n\t" + ] + }, + { + "blockName": "core/paragraph", + "attrs": { + "layout": "column-3" + }, + "innerBlocks": [], + "innerHTML": "\n\t

Column Three, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column Three, Paragraph One

\n\t" + ] + } + ], + "innerHTML": "\n
\n\t\n\t\n\t\n\t\n
\n", + "innerContent": [ + "\n
\n\t", + null, + "\n\t", + null, + "\n\t", + null, + "\n\t", + null, + "\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.serialized.html b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.serialized.html new file mode 100644 index 0000000000..88041c92cb --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.serialized.html @@ -0,0 +1,23 @@ + +
+
+

Column One, Paragraph One

+ + + +

Column One, Paragraph Two

+
+ + + +
+

Column Two, Paragraph One

+
+ + + +
+

Column Three, Paragraph One

+
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html new file mode 100644 index 0000000000..7c774d7bd7 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html @@ -0,0 +1,16 @@ + +
+ +

Column One, Paragraph One

+ + +

Column One, Paragraph Two

+ + +

Column Two, Paragraph One

+ + +

Column Three, Paragraph One

+ +
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover-image.parsed.json b/tests/phpunit/data/blocks/fixtures/core__cover-image.parsed.json index 93bc4fbc8d..7d8b68a925 100644 --- a/tests/phpunit/data/blocks/fixtures/core__cover-image.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__cover-image.parsed.json @@ -6,12 +6,18 @@ "dimRatio": 40 }, "innerBlocks": [], - "innerHTML": "\n
\n

Guten Berg!

\n
\n" + "innerHTML": "\n
\n

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n

Guten Berg!

\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover.html b/tests/phpunit/data/blocks/fixtures/core__cover.html new file mode 100644 index 0000000000..ae26d922c2 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover.html @@ -0,0 +1,5 @@ + +
+

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover.json b/tests/phpunit/data/blocks/fixtures/core__cover.json new file mode 100644 index 0000000000..dea09d92c1 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover.json @@ -0,0 +1,17 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/cover", + "isValid": true, + "attributes": { + "title": "Guten Berg!", + "url": "https://cldup.com/uuUqE_dXzy.jpg", + "contentAlign": "center", + "hasParallax": false, + "dimRatio": 40, + "backgroundType": "image" + }, + "innerBlocks": [], + "originalContent": "
\n

Guten Berg!

\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover.parsed.json b/tests/phpunit/data/blocks/fixtures/core__cover.parsed.json new file mode 100644 index 0000000000..14f37b6170 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover.parsed.json @@ -0,0 +1,23 @@ +[ + { + "blockName": "core/cover", + "attrs": { + "url": "https://cldup.com/uuUqE_dXzy.jpg", + "dimRatio": 40 + }, + "innerBlocks": [], + "innerHTML": "\n
\n

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n

Guten Berg!

\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover.serialized.html b/tests/phpunit/data/blocks/fixtures/core__cover.serialized.html new file mode 100644 index 0000000000..a6d795bb56 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover.serialized.html @@ -0,0 +1,3 @@ + +

Guten Berg!

+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover.server.html b/tests/phpunit/data/blocks/fixtures/core__cover.server.html new file mode 100644 index 0000000000..726c24a585 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover.server.html @@ -0,0 +1,5 @@ + +
+

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.html b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.html new file mode 100644 index 0000000000..2a3530954f --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.html @@ -0,0 +1,6 @@ + +
+ +

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.json b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.json new file mode 100644 index 0000000000..08f0de4eb4 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.json @@ -0,0 +1,18 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/cover", + "isValid": true, + "attributes": { + "title": "Guten Berg!", + "url": "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=", + "contentAlign": "center", + "hasParallax": false, + "dimRatio": 10, + "customOverlayColor": "#3615d9", + "backgroundType": "video" + }, + "innerBlocks": [], + "originalContent": "
\n\t\n\t

Guten Berg!

\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.parsed.json b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.parsed.json new file mode 100644 index 0000000000..a2a3ccc94a --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.parsed.json @@ -0,0 +1,25 @@ +[ + { + "blockName": "core/cover", + "attrs": { + "url": "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=", + "dimRatio": 10, + "customOverlayColor": "#3615d9", + "backgroundType": "video" + }, + "innerBlocks": [], + "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n\t\n\t

Guten Berg!

\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.serialized.html b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.serialized.html new file mode 100644 index 0000000000..14786a0f0d --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.serialized.html @@ -0,0 +1,3 @@ + +

Guten Berg!

+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.server.html b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.server.html new file mode 100644 index 0000000000..d8e1e40cac --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video-overlay.server.html @@ -0,0 +1,6 @@ + +
+ +

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video.html b/tests/phpunit/data/blocks/fixtures/core__cover__video.html new file mode 100644 index 0000000000..0ab2fd73cc --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video.html @@ -0,0 +1,6 @@ + +
+ +

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video.json b/tests/phpunit/data/blocks/fixtures/core__cover__video.json new file mode 100644 index 0000000000..1fa4d25d66 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video.json @@ -0,0 +1,17 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/cover", + "isValid": true, + "attributes": { + "title": "Guten Berg!", + "url": "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=", + "contentAlign": "center", + "hasParallax": false, + "dimRatio": 40, + "backgroundType": "video" + }, + "innerBlocks": [], + "originalContent": "
\n\t\n\t

Guten Berg!

\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video.parsed.json b/tests/phpunit/data/blocks/fixtures/core__cover__video.parsed.json new file mode 100644 index 0000000000..a864b5fea3 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video.parsed.json @@ -0,0 +1,24 @@ +[ + { + "blockName": "core/cover", + "attrs": { + "url": "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=", + "dimRatio": 40, + "backgroundType": "video" + }, + "innerBlocks": [], + "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n\t\n\t

Guten Berg!

\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video.serialized.html b/tests/phpunit/data/blocks/fixtures/core__cover__video.serialized.html new file mode 100644 index 0000000000..03398311e2 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video.serialized.html @@ -0,0 +1,3 @@ + +

Guten Berg!

+ diff --git a/tests/phpunit/data/blocks/fixtures/core__cover__video.server.html b/tests/phpunit/data/blocks/fixtures/core__cover__video.server.html new file mode 100644 index 0000000000..50a924c054 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__cover__video.server.html @@ -0,0 +1,6 @@ + +
+ +

Guten Berg!

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__embed.parsed.json b/tests/phpunit/data/blocks/fixtures/core__embed.parsed.json index 5efa23bb5f..43bbfac823 100644 --- a/tests/phpunit/data/blocks/fixtures/core__embed.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__embed.parsed.json @@ -5,12 +5,18 @@ "url": "https://example.com/" }, "innerBlocks": [], - "innerHTML": "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n" + "innerHTML": "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n", + "innerContent": [ + "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__new-window.html b/tests/phpunit/data/blocks/fixtures/core__file__new-window.html index e8ee1b8258..9c489088ce 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__new-window.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__new-window.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__file__new-window.json b/tests/phpunit/data/blocks/fixtures/core__file__new-window.json index 4922f02880..378ae6dd78 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__new-window.json +++ b/tests/phpunit/data/blocks/fixtures/core__file__new-window.json @@ -13,6 +13,6 @@ "downloadButtonText": "Download" }, "innerBlocks": [], - "originalContent": "" + "originalContent": "" } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__new-window.parsed.json b/tests/phpunit/data/blocks/fixtures/core__file__new-window.parsed.json index 481c7e5c98..a29bea33c5 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__new-window.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__file__new-window.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__new-window.serialized.html b/tests/phpunit/data/blocks/fixtures/core__file__new-window.serialized.html index 7d28f4db58..f132127db9 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__new-window.serialized.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__new-window.serialized.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html b/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html index b948a1d8c2..8aca3416ff 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.parsed.json b/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.parsed.json index 65a2cffa5e..ac019b9694 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.html b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.html index 89c0390aac..02fd463de1 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.json b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.json index 6cf32d1f9d..ec3e7b670b 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.json +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.json @@ -11,6 +11,6 @@ "downloadButtonText": "Download" }, "innerBlocks": [], - "originalContent": "" + "originalContent": "" } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.parsed.json b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.parsed.json index c905766eb9..d70321c12c 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.serialized.html b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.serialized.html index a0ab5b5f41..1289b31287 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.serialized.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.serialized.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html index 0110c1ac8b..8e56caffae 100644 --- a/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html +++ b/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html @@ -1,3 +1,3 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__freeform.parsed.json b/tests/phpunit/data/blocks/fixtures/core__freeform.parsed.json index 5cf330c0e9..1ec86e571b 100644 --- a/tests/phpunit/data/blocks/fixtures/core__freeform.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__freeform.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/freeform", "attrs": {}, "innerBlocks": [], - "innerHTML": "\nTesting freeform block with some\n
\n\tHTML content\n
\n" + "innerHTML": "\nTesting freeform block with some\n
\n\tHTML content\n
\n", + "innerContent": [ + "\nTesting freeform block with some\n
\n\tHTML content\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.parsed.json b/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.parsed.json index e0b2c76f29..4aca91e2f3 100644 --- a/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.parsed.json @@ -1,8 +1,11 @@ [ { - "attrs": {}, "blockName": null, + "attrs": {}, "innerBlocks": [], - "innerHTML": "Testing freeform block with some\n
\n\tHTML content\n
\n" + "innerHTML": "Testing freeform block with some\n
\n\tHTML content\n
\n", + "innerContent": [ + "Testing freeform block with some\n
\n\tHTML content\n
\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__gallery.parsed.json b/tests/phpunit/data/blocks/fixtures/core__gallery.parsed.json index 3d80657c7f..fc5c9e17d6 100644 --- a/tests/phpunit/data/blocks/fixtures/core__gallery.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__gallery.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/gallery", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__gallery__columns.parsed.json b/tests/phpunit/data/blocks/fixtures/core__gallery__columns.parsed.json index 44faed907a..6f6e4b856d 100644 --- a/tests/phpunit/data/blocks/fixtures/core__gallery__columns.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__gallery__columns.parsed.json @@ -5,12 +5,18 @@ "columns": 1 }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.parsed.json b/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.parsed.json index 76d235d42c..e10209f227 100644 --- a/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/heading", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

The Inserter Tool

\n" + "innerHTML": "\n

The Inserter Tool

\n", + "innerContent": [ + "\n

The Inserter Tool

\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__heading__h2.parsed.json b/tests/phpunit/data/blocks/fixtures/core__heading__h2.parsed.json index 700f5f941e..be6bc63b31 100644 --- a/tests/phpunit/data/blocks/fixtures/core__heading__h2.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__heading__h2.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/heading", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

A picture is worth a thousand words, or so the saying goes

\n" + "innerHTML": "\n

A picture is worth a thousand words, or so the saying goes

\n", + "innerContent": [ + "\n

A picture is worth a thousand words, or so the saying goes

\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__html.parsed.json b/tests/phpunit/data/blocks/fixtures/core__html.parsed.json index 2bfdc65866..adb0cd44b3 100644 --- a/tests/phpunit/data/blocks/fixtures/core__html.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__html.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/html", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

Some HTML code

\nThis text will scroll from right to left\n" + "innerHTML": "\n

Some HTML code

\nThis text will scroll from right to left\n", + "innerContent": [ + "\n

Some HTML code

\nThis text will scroll from right to left\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__image.parsed.json b/tests/phpunit/data/blocks/fixtures/core__image.parsed.json index fff414d9b0..d7e16a440d 100644 --- a/tests/phpunit/data/blocks/fixtures/core__image.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__image.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/image", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.parsed.json b/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.parsed.json index e5da07242d..fae6604516 100644 --- a/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "attachment" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__image__center-caption.parsed.json b/tests/phpunit/data/blocks/fixtures/core__image__center-caption.parsed.json index 290057c287..02ff95e3ae 100644 --- a/tests/phpunit/data/blocks/fixtures/core__image__center-caption.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__image__center-caption.parsed.json @@ -5,12 +5,18 @@ "align": "center" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n" + "innerHTML": "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n", + "innerContent": [ + "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__image__custom-link.parsed.json b/tests/phpunit/data/blocks/fixtures/core__image__custom-link.parsed.json index d814737aae..a3625c6a1f 100644 --- a/tests/phpunit/data/blocks/fixtures/core__image__custom-link.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__image__custom-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "custom" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__image__media-link.parsed.json b/tests/phpunit/data/blocks/fixtures/core__image__media-link.parsed.json index 345c5d4e25..46458a7eec 100644 --- a/tests/phpunit/data/blocks/fixtures/core__image__media-link.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__image__media-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "media" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.parsed.json b/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.parsed.json index c17c81b398..cbfafc27db 100644 --- a/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html b/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html index 8b13789179..1eaeb57026 100644 --- a/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html +++ b/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html @@ -1 +1 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__invalid-special.parsed.json b/tests/phpunit/data/blocks/fixtures/core__invalid-special.parsed.json index 3198b43be5..05b96f6deb 100644 --- a/tests/phpunit/data/blocks/fixtures/core__invalid-special.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__invalid-special.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html b/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html index 8b13789179..548aef63c7 100644 --- a/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html +++ b/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html @@ -1 +1 @@ - + diff --git a/tests/phpunit/data/blocks/fixtures/core__latest-comments.parsed.json b/tests/phpunit/data/blocks/fixtures/core__latest-comments.parsed.json index 7e8bb541ad..b7a0e61422 100644 --- a/tests/phpunit/data/blocks/fixtures/core__latest-comments.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__latest-comments.parsed.json @@ -7,12 +7,16 @@ "displayTimestamp": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__latest-posts.parsed.json b/tests/phpunit/data/blocks/fixtures/core__latest-posts.parsed.json index f1c800291d..4279957a0f 100644 --- a/tests/phpunit/data/blocks/fixtures/core__latest-posts.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__latest-posts.parsed.json @@ -6,12 +6,16 @@ "displayPostDate": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.parsed.json b/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.parsed.json index a92b392679..57a36f5dce 100644 --- a/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.parsed.json @@ -6,12 +6,16 @@ "displayPostDate": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__list__ul.parsed.json b/tests/phpunit/data/blocks/fixtures/core__list__ul.parsed.json index c42181ba55..83cb9ff7fc 100644 --- a/tests/phpunit/data/blocks/fixtures/core__list__ul.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__list__ul.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/list", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
  • Text & Headings
  • Images & Videos
  • Galleries
  • Embeds, like YouTube, Tweets, or other WordPress posts.
  • Layout blocks, like Buttons, Hero Images, Separators, etc.
  • And Lists like this one of course :)
\n" + "innerHTML": "\n
  • Text & Headings
  • Images & Videos
  • Galleries
  • Embeds, like YouTube, Tweets, or other WordPress posts.
  • Layout blocks, like Buttons, Hero Images, Separators, etc.
  • And Lists like this one of course :)
\n", + "innerContent": [ + "\n
  • Text & Headings
  • Images & Videos
  • Galleries
  • Embeds, like YouTube, Tweets, or other WordPress posts.
  • Layout blocks, like Buttons, Hero Images, Separators, etc.
  • And Lists like this one of course :)
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.html b/tests/phpunit/data/blocks/fixtures/core__media-text.html new file mode 100644 index 0000000000..63d279b9db --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.json b/tests/phpunit/data/blocks/fixtures/core__media-text.json new file mode 100644 index 0000000000..2b892048ec --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text.json @@ -0,0 +1,33 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/media-text", + "isValid": true, + "attributes": { + "align": "wide", + "mediaAlt": "", + "mediaPosition": "left", + "mediaId": 17985, + "mediaUrl": "http://localhost/wp-content/uploads/2018/09/1600px-Mount_Everest_as_seen_from_Drukair2_PLW_edit.jpg", + "mediaType": "image", + "mediaWidth": 50, + "isStackedOnMobile": false + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "My Content", + "dropCap": false, + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "originalContent": "

My Content

" + } + ], + "originalContent": "
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t\n\t
\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.parsed.json b/tests/phpunit/data/blocks/fixtures/core__media-text.parsed.json new file mode 100644 index 0000000000..ec0bf62e61 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text.parsed.json @@ -0,0 +1,38 @@ +[ + { + "blockName": "core/media-text", + "attrs": { + "mediaId": 17985, + "mediaType": "image" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] + } + ], + "innerHTML": "\n
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.serialized.html b/tests/phpunit/data/blocks/fixtures/core__media-text.serialized.html new file mode 100644 index 0000000000..5e70ba8e96 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text.serialized.html @@ -0,0 +1,5 @@ + +
+

My Content

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text.server.html new file mode 100644 index 0000000000..e472aeb90e --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text.server.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.html b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.html new file mode 100644 index 0000000000..66e424e3b1 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.html @@ -0,0 +1,12 @@ + +
+
+ my alt +
+
+ +

Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.json b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.json new file mode 100644 index 0000000000..548f2dbd28 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.json @@ -0,0 +1,33 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/media-text", + "isValid": true, + "attributes": { + "align": "none", + "mediaAlt": "my alt", + "mediaPosition": "left", + "mediaId": 17985, + "mediaUrl": "http://localhost/wp-content/uploads/2018/09/1600px-Mount_Everest_as_seen_from_Drukair2_PLW_edit.jpg", + "mediaType": "image", + "mediaWidth": 50, + "isStackedOnMobile": false + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "Content", + "dropCap": false, + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "originalContent": "

Content

" + } + ], + "originalContent": "
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t\n\t
\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.parsed.json b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.parsed.json new file mode 100644 index 0000000000..e078f9c6ae --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.parsed.json @@ -0,0 +1,39 @@ +[ + { + "blockName": "core/media-text", + "attrs": { + "align": "none", + "mediaId": 17985, + "mediaType": "image" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "innerHTML": "\n\t\t

Content

\n\t\t", + "innerContent": [ + "\n\t\t

Content

\n\t\t" + ] + } + ], + "innerHTML": "\n
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.serialized.html b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.serialized.html new file mode 100644 index 0000000000..3a28587c29 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.serialized.html @@ -0,0 +1,5 @@ + +
my alt
+

Content

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html new file mode 100644 index 0000000000..c25f5431b6 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html @@ -0,0 +1,12 @@ + +
+
+ my alt +
+
+ +

Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.html b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.html new file mode 100644 index 0000000000..0aa403f6c3 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.json b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.json new file mode 100644 index 0000000000..85d29db70e --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.json @@ -0,0 +1,33 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/media-text", + "isValid": true, + "attributes": { + "align": "wide", + "mediaAlt": "", + "mediaPosition": "left", + "mediaId": 17897, + "mediaUrl": "http://localhost/wp-content/uploads/2018/09/Jul-26-2018-11-34-54.mp4", + "mediaType": "video", + "mediaWidth": 50, + "isStackedOnMobile": true + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "My Content", + "dropCap": false, + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "originalContent": "

My Content

" + } + ], + "originalContent": "
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.parsed.json b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.parsed.json new file mode 100644 index 0000000000..3451267ab6 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.parsed.json @@ -0,0 +1,39 @@ +[ + { + "blockName": "core/media-text", + "attrs": { + "mediaId": 17897, + "mediaType": "video", + "isStackedOnMobile": true + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] + } + ], + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.serialized.html b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.serialized.html new file mode 100644 index 0000000000..b9a82b9d84 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.serialized.html @@ -0,0 +1,5 @@ + +
+

My Content

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html new file mode 100644 index 0000000000..5a1c3993f5 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.html b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.html new file mode 100644 index 0000000000..b0772fb7b4 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My video

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.json b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.json new file mode 100644 index 0000000000..42d3a5ab16 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.json @@ -0,0 +1,34 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/media-text", + "isValid": true, + "attributes": { + "align": "full", + "mediaAlt": "", + "mediaPosition": "right", + "mediaId": 17897, + "mediaUrl": "http://localhost/wp-content/uploads/2018/09/Jul-26-2018-11-34-54.mp4", + "mediaType": "video", + "mediaWidth": 41, + "isStackedOnMobile": false + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "My video", + "align": "right", + "dropCap": false, + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "originalContent": "

My video

" + } + ], + "originalContent": "
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.parsed.json b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.parsed.json new file mode 100644 index 0000000000..3748450219 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.parsed.json @@ -0,0 +1,42 @@ +[ + { + "blockName": "core/media-text", + "attrs": { + "align": "full", + "mediaPosition": "right", + "mediaId": 17897, + "mediaType": "video", + "mediaWidth": 41 + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "align": "right", + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "innerHTML": "\n\t\t

My video

\n\t\t", + "innerContent": [ + "\n\t\t

My video

\n\t\t" + ] + } + ], + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.serialized.html b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.serialized.html new file mode 100644 index 0000000000..a11efac920 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.serialized.html @@ -0,0 +1,5 @@ + +
+

My video

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html new file mode 100644 index 0000000000..41edc3e02e --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My video

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.html b/tests/phpunit/data/blocks/fixtures/core__media-text__video.html new file mode 100644 index 0000000000..48c13cac64 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.json b/tests/phpunit/data/blocks/fixtures/core__media-text__video.json new file mode 100644 index 0000000000..427195d751 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.json @@ -0,0 +1,33 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/media-text", + "isValid": true, + "attributes": { + "align": "wide", + "mediaAlt": "", + "mediaPosition": "left", + "mediaId": 17897, + "mediaUrl": "http://localhost/wp-content/uploads/2018/09/Jul-26-2018-11-34-54.mp4", + "mediaType": "video", + "mediaWidth": 50, + "isStackedOnMobile": false + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "My Content", + "dropCap": false, + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "originalContent": "

My Content

" + } + ], + "originalContent": "
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
" + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.parsed.json b/tests/phpunit/data/blocks/fixtures/core__media-text__video.parsed.json new file mode 100644 index 0000000000..4e06eb858a --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.parsed.json @@ -0,0 +1,38 @@ +[ + { + "blockName": "core/media-text", + "attrs": { + "mediaId": 17897, + "mediaType": "video" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": { + "placeholder": "Content…", + "fontSize": "large" + }, + "innerBlocks": [], + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] + } + ], + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.serialized.html b/tests/phpunit/data/blocks/fixtures/core__media-text__video.serialized.html new file mode 100644 index 0000000000..f7302c9a33 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.serialized.html @@ -0,0 +1,5 @@ + +
+

My Content

+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html new file mode 100644 index 0000000000..88e9393dd7 --- /dev/null +++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+ +

My Content

+ +
+
+ diff --git a/tests/phpunit/data/blocks/fixtures/core__missing.json b/tests/phpunit/data/blocks/fixtures/core__missing.json index 4e90cf7132..f7499ca71d 100644 --- a/tests/phpunit/data/blocks/fixtures/core__missing.json +++ b/tests/phpunit/data/blocks/fixtures/core__missing.json @@ -4,9 +4,9 @@ "name": "core/missing", "isValid": true, "attributes": { - "originalContent": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n", - "originalName": "unregistered/example", - "originalUndelimitedContent": "

Testing missing block with some

\n
\n\tHTML content\n
" + "originalName": "unregistered/example", + "originalUndelimitedContent": "

Testing missing block with some

\n
\n\tHTML content\n
", + "originalContent": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" }, "innerBlocks": [], "originalContent": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" diff --git a/tests/phpunit/data/blocks/fixtures/core__missing.parsed.json b/tests/phpunit/data/blocks/fixtures/core__missing.parsed.json index 3466b8cf2a..85ab1542c7 100644 --- a/tests/phpunit/data/blocks/fixtures/core__missing.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__missing.parsed.json @@ -2,16 +2,18 @@ { "blockName": "unregistered/example", "attrs": { - "attr1": "One", - "attr2": "Two" - }, + "attr1": "One", + "attr2": "Two" + }, "innerBlocks": [], - "innerHTML": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" + "innerHTML": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n", + "innerContent": [ "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" ] }, { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n" + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__more.parsed.json b/tests/phpunit/data/blocks/fixtures/core__more.parsed.json index 176e7fe7f7..b806b0c0af 100644 --- a/tests/phpunit/data/blocks/fixtures/core__more.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__more.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/more", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.parsed.json b/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.parsed.json index a533e3c09c..e3096b9d7c 100644 --- a/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.parsed.json @@ -6,12 +6,14 @@ "noTeaser": true }, "innerBlocks": [], - "innerHTML": "\n\n\n" + "innerHTML": "\n\n\n", + "innerContent": [ "\n\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__nextpage.parsed.json b/tests/phpunit/data/blocks/fixtures/core__nextpage.parsed.json index e4dd2534c8..ff3f2703bf 100644 --- a/tests/phpunit/data/blocks/fixtures/core__nextpage.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__nextpage.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/nextpage", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.parsed.json b/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.parsed.json index 060d40a38d..e0c2ab7be2 100644 --- a/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.parsed.json @@ -5,12 +5,14 @@ "align": "right" }, "innerBlocks": [], - "innerHTML": "\n

... like this one, which is separate from the above and right aligned.

\n" + "innerHTML": "\n

... like this one, which is separate from the above and right aligned.

\n", + "innerContent": [ "\n

... like this one, which is separate from the above and right aligned.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.parsed.json b/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.parsed.json index ac11af1b3a..e6b914e24e 100644 --- a/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\nUnwrapped is still valid.\n" + "innerHTML": "\nUnwrapped is still valid.\n", + "innerContent": [ "\nUnwrapped is still valid.\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__preformatted.parsed.json b/tests/phpunit/data/blocks/fixtures/core__preformatted.parsed.json index 247fdda2e3..c78497076e 100644 --- a/tests/phpunit/data/blocks/fixtures/core__preformatted.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__preformatted.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/preformatted", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
Some preformatted text...
And more!
\n" + "innerHTML": "\n
Some preformatted text...
And more!
\n", + "innerContent": [ "\n
Some preformatted text...
And more!
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__pullquote.parsed.json b/tests/phpunit/data/blocks/fixtures/core__pullquote.parsed.json index 0e39eea4ec..033b311fa5 100644 --- a/tests/phpunit/data/blocks/fixtures/core__pullquote.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__pullquote.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/pullquote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n" + "innerHTML": "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n", + "innerContent": [ "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.parsed.json b/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.parsed.json index 3b303a0d8d..fe8abfce70 100644 --- a/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/pullquote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n" + "innerHTML": "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n", + "innerContent": [ "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__quote__style-1.parsed.json b/tests/phpunit/data/blocks/fixtures/core__quote__style-1.parsed.json index 12f480ef31..6a873438f1 100644 --- a/tests/phpunit/data/blocks/fixtures/core__quote__style-1.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__quote__style-1.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/quote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n" + "innerHTML": "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n", + "innerContent": [ "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__quote__style-2.parsed.json b/tests/phpunit/data/blocks/fixtures/core__quote__style-2.parsed.json index 87a9377e2e..6470afbc17 100644 --- a/tests/phpunit/data/blocks/fixtures/core__quote__style-2.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__quote__style-2.parsed.json @@ -5,12 +5,14 @@ "className": "is-style-large" }, "innerBlocks": [], - "innerHTML": "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n" + "innerHTML": "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n", + "innerContent": [ "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__separator.parsed.json b/tests/phpunit/data/blocks/fixtures/core__separator.parsed.json index d01eb1eed1..48a8e742c3 100644 --- a/tests/phpunit/data/blocks/fixtures/core__separator.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__separator.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/separator", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__shortcode.parsed.json b/tests/phpunit/data/blocks/fixtures/core__shortcode.parsed.json index 70d24dc276..b875770f15 100644 --- a/tests/phpunit/data/blocks/fixtures/core__shortcode.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__shortcode.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/shortcode", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n[gallery ids=\"238,338\"]\n" + "innerHTML": "\n[gallery ids=\"238,338\"]\n", + "innerContent": [ "\n[gallery ids=\"238,338\"]\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__spacer.parsed.json b/tests/phpunit/data/blocks/fixtures/core__spacer.parsed.json index 8b8baa2a7f..c3c0938df5 100644 --- a/tests/phpunit/data/blocks/fixtures/core__spacer.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__spacer.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/spacer", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__subhead.parsed.json b/tests/phpunit/data/blocks/fixtures/core__subhead.parsed.json index 06ca46da1b..d88b9ee4c9 100644 --- a/tests/phpunit/data/blocks/fixtures/core__subhead.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__subhead.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/subhead", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

This is a subhead.

\n" + "innerHTML": "\n

This is a subhead.

\n", + "innerContent": [ "\n

This is a subhead.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__table.parsed.json b/tests/phpunit/data/blocks/fixtures/core__table.parsed.json index 8c24b96113..7a2d91003f 100644 --- a/tests/phpunit/data/blocks/fixtures/core__table.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__table.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/table", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n" + "innerHTML": "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n", + "innerContent": [ "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__text-columns.parsed.json b/tests/phpunit/data/blocks/fixtures/core__text-columns.parsed.json index 293c930ac5..1a7db4e09e 100644 --- a/tests/phpunit/data/blocks/fixtures/core__text-columns.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__text-columns.parsed.json @@ -5,12 +5,14 @@ "width": "center" }, "innerBlocks": [], - "innerHTML": "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n" + "innerHTML": "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n", + "innerContent": [ "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.parsed.json b/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.parsed.json index 958d2a2921..75a5ca1140 100644 --- a/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/text", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

This is an old-style text block. Changed to paragraph in #2135.

\n" + "innerHTML": "\n

This is an old-style text block. Changed to paragraph in #2135.

\n", + "innerContent": [ "\n

This is an old-style text block. Changed to paragraph in #2135.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__verse.parsed.json b/tests/phpunit/data/blocks/fixtures/core__verse.parsed.json index 4f244cb551..4cccc9383a 100644 --- a/tests/phpunit/data/blocks/fixtures/core__verse.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__verse.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/verse", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
A verse
And more!
\n" + "innerHTML": "\n
A verse
And more!
\n", + "innerContent": [ "\n
A verse
And more!
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/data/blocks/fixtures/core__video.parsed.json b/tests/phpunit/data/blocks/fixtures/core__video.parsed.json index 7b448d6f38..e9be9d8a2e 100644 --- a/tests/phpunit/data/blocks/fixtures/core__video.parsed.json +++ b/tests/phpunit/data/blocks/fixtures/core__video.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/video", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/tests/phpunit/tests/blocks/render.php b/tests/phpunit/tests/blocks/render.php index 98e42249bc..be41a4bb9a 100644 --- a/tests/phpunit/tests/blocks/render.php +++ b/tests/phpunit/tests/blocks/render.php @@ -46,6 +46,9 @@ class WP_Test_Block_Render extends WP_UnitTestCase { if ( $registry->is_registered( 'core/test' ) ) { $registry->unregister( 'core/test' ); } + if ( $registry->is_registered( 'core/dynamic' ) ) { + $registry->unregister( 'core/dynamic' ); + } } /** @@ -75,6 +78,8 @@ class WP_Test_Block_Render extends WP_UnitTestCase { // Block rendering add some extra blank lines, but we're not worried about them. $block_filtered_content = preg_replace( "/\n{2,}/", "\n", $block_filtered_content ); + remove_shortcode( 'someshortcode' ); + $this->assertEquals( trim( $classic_filtered_content ), trim( $block_filtered_content ) ); } @@ -82,6 +87,42 @@ class WP_Test_Block_Render extends WP_UnitTestCase { return $content; } + public function test_can_nest_at_least_so_deep() { + $minimum_depth = 99; + + $content = 'deep inside'; + for ( $i = 0; $i < $minimum_depth; $i++ ) { + $content = '' . $content . ''; + } + + $this->assertEquals( 'deep inside', do_blocks( $content ) ); + } + + public function test_can_nest_at_least_so_deep_with_dynamic_blocks() { + $minimum_depth = 99; + + $content = '0'; + for ( $i = 0; $i < $minimum_depth; $i++ ) { + $content = '' . $content . ''; + } + + register_block_type( + 'core/test', + array( + 'render_callback' => array( + $this, + 'render_dynamic_incrementer', + ), + ) + ); + + $this->assertEquals( $minimum_depth, (int) do_blocks( $content ) ); + } + + public function render_dynamic_incrementer( $attrs, $content ) { + return (string) ( 1 + (int) $content ); + } + /** * @ticket 45290 */ @@ -242,6 +283,72 @@ class WP_Test_Block_Render extends WP_UnitTestCase { $this->assertInternalType( 'string', $rendered ); } + public function test_dynamic_block_gets_inner_html() { + register_block_type( + 'core/dynamic', + array( + 'render_callback' => array( + $this, + 'render_serialize_dynamic_block', + ), + ) + ); + + $output = do_blocks( 'inner' ); + + $data = unserialize( base64_decode( $output ) ); + + $this->assertEquals( 'inner', $data[1] ); + } + + public function test_dynamic_block_gets_rendered_inner_blocks() { + register_block_type( + 'core/test', + array( + 'render_callback' => array( + $this, + 'render_test_block_numeric', + ), + ) + ); + + register_block_type( + 'core/dynamic', + array( + 'render_callback' => array( + $this, + 'render_serialize_dynamic_block', + ), + ) + ); + + $output = do_blocks( 'beforeafter' ); + + $data = unserialize( base64_decode( $output ) ); + + $this->assertEquals( 'before10after', $data[1] ); + } + + public function test_dynamic_block_gets_rendered_inner_dynamic_blocks() { + register_block_type( + 'core/dynamic', + array( + 'render_callback' => array( + $this, + 'render_serialize_dynamic_block', + ), + ) + ); + + $output = do_blocks( 'beforedeep innerafter' ); + + $data = unserialize( base64_decode( $output ) ); + + $inner = $this->render_serialize_dynamic_block( array(), 'deep inner' ); + + $this->assertEquals( $data[1], 'before' . $inner . 'after' ); + } + /** * Helper function to remove relative paths and extension from a filename, leaving just the fixture name. * @@ -307,6 +414,17 @@ class WP_Test_Block_Render extends WP_UnitTestCase { return 10; } + /** + * Test block rendering function, returning base64 encoded serialised value. + * + * @since 5.0.0 + * + * @return string Block output. + */ + public function render_serialize_dynamic_block( $attributes, $content ) { + return base64_encode( serialize( array( $attributes, $content ) ) ); + } + /** * Test block rendering function, creating a new WP_Query instance. * diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 4292795f9f..f678401694 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -57,6 +57,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc const packages = [ 'api-fetch', 'a11y', + 'annotations', 'autop', 'blob', 'blocks', @@ -95,7 +96,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc const vendors = { 'lodash.js': 'lodash/lodash.js', - 'wp-polyfill-ecmascript.js': '@babel/polyfill/dist/polyfill.js', + 'wp-polyfill.js': '@babel/polyfill/dist/polyfill.js', 'wp-polyfill-fetch.js': 'whatwg-fetch/dist/fetch.umd.js', 'wp-polyfill-element-closest.js': 'element-closest/element-closest.js', 'wp-polyfill-node-contains.js': 'polyfill-library/polyfills/Node/prototype/contains/polyfill.js', @@ -107,7 +108,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc const minifiedVendors = { 'lodash.min.js': 'lodash/lodash.min.js', - 'wp-polyfill-ecmascript.min.js': '@babel/polyfill/dist/polyfill.min.js', + 'wp-polyfill.min.js': '@babel/polyfill/dist/polyfill.min.js', 'wp-polyfill-formdata.min.js': 'formdata-polyfill/formdata.min.js', 'moment.min.js': 'moment/min/moment.min.js', 'react.min.js': 'react/umd/react.production.min.js', @@ -121,8 +122,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc }; const phpFiles = { - // Parser shouldn't be copied until nested block issues are resolved. - // 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php', + 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php', 'block-library/src/archives/index.php': 'wp-includes/blocks/archives.php', 'block-library/src/block/index.php': 'wp-includes/blocks/block.php', 'block-library/src/categories/index.php': 'wp-includes/blocks/categories.php',