Permalink
Browse files

rich-text-value => rich-text, better deprecation messages, cast strin…

…g to rich text value during block creation
  • Loading branch information...
iseulde committed Oct 1, 2018
1 parent b25545d commit 94352e7cfadc20a4df4585ff7165385dcea0602e
Showing with 194 additions and 125 deletions.
  1. +3 −3 docs/manifest.json
  2. +1 −1 docs/reference/deprecated.md
  3. +7 −7 lib/client-assets.php
  4. +2 −3 package-lock.json
  5. +1 −1 package.json
  6. +1 −2 packages/block-library/src/audio/index.js
  7. +1 −2 packages/block-library/src/button/index.js
  8. +2 −4 packages/block-library/src/cover-image/index.js
  9. +1 −2 packages/block-library/src/embed/index.js
  10. +1 −2 packages/block-library/src/gallery/index.js
  11. +2 −3 packages/block-library/src/heading/index.js
  12. +1 −2 packages/block-library/src/image/index.js
  13. +2 −3 packages/block-library/src/list/index.js
  14. +2 −3 packages/block-library/src/paragraph/index.js
  15. +2 −3 packages/block-library/src/preformatted/index.js
  16. +3 −6 packages/block-library/src/pullquote/index.js
  17. +4 −7 packages/block-library/src/quote/index.js
  18. +1 −2 packages/block-library/src/subhead/index.js
  19. +1 −2 packages/block-library/src/table/index.js
  20. +1 −1 packages/block-library/src/table/state.js
  21. +1 −1 packages/block-library/src/table/test/state.js
  22. +2 −3 packages/block-library/src/text-columns/index.js
  23. +2 −3 packages/block-library/src/verse/index.js
  24. +1 −2 packages/block-library/src/video/index.js
  25. +6 −6 packages/blocks/src/api/children.js
  26. +26 −13 packages/blocks/src/api/factory.js
  27. +2 −2 packages/blocks/src/api/matchers.js
  28. +3 −3 packages/blocks/src/api/node.js
  29. +4 −4 packages/blocks/src/api/parser.js
  30. +79 −0 packages/blocks/src/api/test/factory.js
  31. +1 −1 packages/components/src/autocomplete/index.js
  32. +1 −1 packages/editor/src/components/block-list/test/block-html.js
  33. +4 −4 packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap
  34. +1 −1 packages/editor/src/components/document-outline/test/index.js
  35. +1 −1 packages/editor/src/components/rich-text/format-toolbar/index.js
  36. +1 −1 packages/editor/src/components/rich-text/format-toolbar/link-container.js
  37. +3 −3 packages/editor/src/components/rich-text/index.js
  38. +1 −1 packages/editor/src/components/rich-text/index.native.js
  39. +1 −1 packages/editor/src/components/rich-text/patterns.js
  40. +1 −1 packages/editor/src/components/rich-text/test/index.js
  41. +1 −1 packages/editor/src/components/rich-text/tinymce.js
  42. 0 packages/{rich-text-value → rich-text}/.npmrc
  43. 0 packages/{rich-text-value → rich-text}/CHANGELOG.md
  44. +2 −2 packages/{rich-text-value → rich-text}/README.md
  45. +2 −2 packages/{rich-text-value → rich-text}/package.json
  46. 0 packages/{rich-text-value → rich-text}/src/apply-format.js
  47. 0 packages/{rich-text-value → rich-text}/src/concat.js
  48. 0 packages/{rich-text-value → rich-text}/src/create.js
  49. 0 packages/{rich-text-value → rich-text}/src/get-active-format.js
  50. 0 packages/{rich-text-value → rich-text}/src/get-text-content.js
  51. 0 packages/{rich-text-value → rich-text}/src/index.js
  52. 0 packages/{rich-text-value → rich-text}/src/insert.js
  53. 0 packages/{rich-text-value → rich-text}/src/is-collapsed.js
  54. 0 packages/{rich-text-value → rich-text}/src/is-empty.js
  55. 0 packages/{rich-text-value → rich-text}/src/is-format-equal.js
  56. 0 packages/{rich-text-value → rich-text}/src/join.js
  57. 0 packages/{rich-text-value → rich-text}/src/normalise-formats.js
  58. 0 packages/{rich-text-value → rich-text}/src/remove-format.js
  59. 0 packages/{rich-text-value → rich-text}/src/remove.js
  60. 0 packages/{rich-text-value → rich-text}/src/replace.js
  61. 0 packages/{rich-text-value → rich-text}/src/slice.js
  62. 0 packages/{rich-text-value → rich-text}/src/split.js
  63. 0 packages/{rich-text-value → rich-text}/src/test/apply-format.js
  64. 0 packages/{rich-text-value → rich-text}/src/test/concat.js
  65. 0 packages/{rich-text-value → rich-text}/src/test/create.js
  66. 0 packages/{rich-text-value → rich-text}/src/test/get-active-format.js
  67. 0 packages/{rich-text-value → rich-text}/src/test/helpers/index.js
  68. 0 packages/{rich-text-value → rich-text}/src/test/insert.js
  69. 0 packages/{rich-text-value → rich-text}/src/test/is-collapsed.js
  70. 0 packages/{rich-text-value → rich-text}/src/test/is-empty.js
  71. 0 packages/{rich-text-value → rich-text}/src/test/is-format-equal.js
  72. 0 packages/{rich-text-value → rich-text}/src/test/join.js
  73. 0 packages/{rich-text-value → rich-text}/src/test/normalise-formats.js
  74. 0 packages/{rich-text-value → rich-text}/src/test/remove-format.js
  75. 0 packages/{rich-text-value → rich-text}/src/test/replace.js
  76. 0 packages/{rich-text-value → rich-text}/src/test/slice.js
  77. 0 packages/{rich-text-value → rich-text}/src/test/split.js
  78. 0 packages/{rich-text-value → rich-text}/src/test/to-dom.js
  79. 0 packages/{rich-text-value → rich-text}/src/test/to-html-string.js
  80. 0 packages/{rich-text-value → rich-text}/src/to-dom.js
  81. 0 packages/{rich-text-value → rich-text}/src/to-html-string.js
  82. 0 packages/{rich-text-value → rich-text}/src/to-tree.js
  83. +1 −1 test/e2e/test-plugins/block-icons.php
  84. +1 −1 test/e2e/test-plugins/block-icons/index.js
  85. +5 −5 test/e2e/test-plugins/deprecated-node-matcher/index.js
  86. +1 −1 test/e2e/test-plugins/inner-blocks-templates/index.js
  87. +1 −1 webpack.config.js
@@ -474,9 +474,9 @@
"parent": "packages"
},
{
"title": "@wordpress/rich-text-value",
"slug": "packages-rich-text-value",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/rich-text-value/README.md",
"title": "@wordpress/rich-text",
"slug": "packages-rich-text",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/rich-text/README.md",
"parent": "packages"
},
{
@@ -2,7 +2,7 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo
## 4.4.0
- The block attribute sources `children` and `node` have been removed. Please use the `rich-text-value` source instead. See the core blocks for examples.
- The block attribute sources `children` and `node` have been removed. Please use the `rich-text` source instead. See the core blocks for examples.
- `wp.blocks.node.matcher` has been removed. Please use `wp.richTextValue.create` instead.
- `wp.blocks.node.toHTML` has been removed. Please use `wp.richTextValue.toHTMLString` instead.
- `wp.blocks.node.fromDOM` has been removed. Please use `wp.richTextValue.create` instead.
@@ -372,10 +372,10 @@ function gutenberg_register_scripts_and_styles() {
true
);
wp_register_script(
'wp-rich-text-value',
gutenberg_url( 'build/rich-text-value/index.js' ),
'wp-rich-text',
gutenberg_url( 'build/rich-text/index.js' ),
array( 'wp-polyfill', 'wp-escape-html', 'lodash' ),
filemtime( gutenberg_dir_path() . 'build/rich-text-value/index.js' ),
filemtime( gutenberg_dir_path() . 'build/rich-text/index.js' ),
true
);
wp_register_script(
@@ -397,7 +397,7 @@ function gutenberg_register_scripts_and_styles() {
'wp-keycodes',
'wp-polyfill',
'wp-url',
'wp-rich-text-value',
'wp-rich-text',
),
filemtime( gutenberg_dir_path() . 'build/components/index.js' ),
true
@@ -423,7 +423,7 @@ function gutenberg_register_scripts_and_styles() {
'wp-polyfill',
'wp-shortcode',
'lodash',
'wp-rich-text-value',
'wp-rich-text',
),
filemtime( gutenberg_dir_path() . 'build/blocks/index.js' ),
true
@@ -458,7 +458,7 @@ function gutenberg_register_scripts_and_styles() {
'wp-polyfill',
'wp-url',
'wp-viewport',
'wp-rich-text-value',
'wp-rich-text',
),
filemtime( gutenberg_dir_path() . 'build/block-library/index.js' ),
true
@@ -618,7 +618,7 @@ function gutenberg_register_scripts_and_styles() {
'wp-url',
'wp-viewport',
'wp-wordcount',
'wp-rich-text-value',
'wp-rich-text',
),
filemtime( gutenberg_dir_path() . 'build/editor/index.js' )
);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -42,7 +42,7 @@
"@wordpress/nux": "file:packages/nux",
"@wordpress/plugins": "file:packages/plugins",
"@wordpress/redux-routine": "file:packages/redux-routine",
"@wordpress/rich-text-value": "file:packages/rich-text-value",
"@wordpress/rich-text": "file:packages/rich-text",
"@wordpress/shortcode": "file:packages/shortcode",
"@wordpress/token-list": "file:packages/token-list",
"@wordpress/url": "file:packages/url",
@@ -30,8 +30,7 @@ export const settings = {
attribute: 'src',
},
caption: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'figcaption',
},
id: {
@@ -32,8 +32,7 @@ const blockAttributes = {
attribute: 'title',
},
text: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'a',
},
backgroundColor: {
@@ -24,8 +24,7 @@ const validAlignments = [ 'left', 'center', 'right', 'wide', 'full' ];
const blockAttributes = {
title: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'p',
},
url: {
@@ -275,8 +274,7 @@ export const settings = {
attributes: {
...blockAttributes,
title: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'h2',
},
},
@@ -371,8 +371,7 @@ const embedAttributes = {
type: 'string',
},
caption: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'figcaption',
},
type: {
@@ -45,8 +45,7 @@ const blockAttributes = {
attribute: 'data-id',
},
caption: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'figcaption',
},
},
@@ -14,7 +14,7 @@ import {
getBlockType,
} from '@wordpress/blocks';
import { RichText } from '@wordpress/editor';
import { concat } from '@wordpress/rich-text-value';
import { concat } from '@wordpress/rich-text';
/**
* Internal dependencies
@@ -39,8 +39,7 @@ const supports = {
const schema = {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'h1,h2,h3,h4,h5,h6',
},
level: {
@@ -39,8 +39,7 @@ const blockAttributes = {
default: '',
},
caption: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'figcaption',
},
href: {
@@ -18,7 +18,7 @@ import {
BlockControls,
RichText,
} from '@wordpress/editor';
import { replace, join, split, isEmpty } from '@wordpress/rich-text-value';
import { replace, join, split, isEmpty } from '@wordpress/rich-text';
const listContentSchema = {
...getPhrasingContentSchema(),
@@ -47,8 +47,7 @@ const schema = {
default: false,
},
values: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'ol,ul',
multiline: 'li',
},
@@ -17,7 +17,7 @@ import {
RichText,
} from '@wordpress/editor';
import { getPhrasingContentSchema } from '@wordpress/blocks';
import { create, concat } from '@wordpress/rich-text-value';
import { create, concat } from '@wordpress/rich-text';
/**
* Internal dependencies
@@ -30,8 +30,7 @@ const supports = {
const schema = {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'p',
},
align: {
@@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import { createBlock, getPhrasingContentSchema } from '@wordpress/blocks';
import { RichText } from '@wordpress/editor';
import { create, concat } from '@wordpress/rich-text-value';
import { create, concat } from '@wordpress/rich-text';
export const name = 'core/preformatted';
@@ -19,8 +19,7 @@ export const settings = {
attributes: {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'pre',
},
},
@@ -25,14 +25,12 @@ import {
const blockAttributes = {
value: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'blockquote',
multiline: 'p',
},
citation: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'cite',
},
mainColor: {
@@ -134,8 +132,7 @@ export const settings = {
attributes: {
...blockAttributes,
citation: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'footer',
},
align: {
@@ -14,18 +14,16 @@ import {
AlignmentToolbar,
RichText,
} from '@wordpress/editor';
import { join, split, concat } from '@wordpress/rich-text-value';
import { join, split, concat } from '@wordpress/rich-text';
const blockAttributes = {
value: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'blockquote',
multiline: 'p',
},
citation: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'cite',
},
align: {
@@ -240,8 +238,7 @@ export const settings = {
attributes: {
...blockAttributes,
citation: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'footer',
},
style: {
@@ -30,8 +30,7 @@ export const settings = {
attributes: {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'p',
},
align: {
@@ -58,8 +58,7 @@ function getTableSectionAttributeSchema( section ) {
selector: 'td,th',
query: {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
},
tag: {
type: 'string',
@@ -6,7 +6,7 @@ import { times } from 'lodash';
/**
* WordPress dependencies
*/
import { create } from '@wordpress/rich-text-value';
import { create } from '@wordpress/rich-text';
/**
* Creates a table state.
@@ -6,7 +6,7 @@ import deepFreeze from 'deep-freeze';
/**
* WordPress dependencies
*/
import { create } from '@wordpress/rich-text-value';
import { create } from '@wordpress/rich-text';
/**
* Internal dependencies
@@ -17,7 +17,7 @@ import {
RichText,
} from '@wordpress/editor';
import deprecated from '@wordpress/deprecated';
import { create } from '@wordpress/rich-text-value';
import { create } from '@wordpress/rich-text';
export const name = 'core/text-columns';
@@ -42,8 +42,7 @@ export const settings = {
selector: 'p',
query: {
children: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
},
},
default: [
@@ -9,7 +9,7 @@ import {
BlockControls,
AlignmentToolbar,
} from '@wordpress/editor';
import { concat } from '@wordpress/rich-text-value';
import { concat } from '@wordpress/rich-text';
export const name = 'core/verse';
@@ -26,8 +26,7 @@ export const settings = {
attributes: {
content: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'pre',
},
textAlign: {
@@ -32,8 +32,7 @@ export const settings = {
attribute: 'autoplay',
},
caption: {
source: 'rich-text-value',
type: 'rich-text-value',
source: 'rich-text',
selector: 'figcaption',
},
controls: {
Oops, something went wrong.

0 comments on commit 94352e7

Please sign in to comment.