Skip to content

Commit

Permalink
Gutenberg 5.9 compatibility - moved deprecated components to from `@w…
Browse files Browse the repository at this point in the history
…ordpress/editor` to `@wordpress/block-editor` Closes #122
  • Loading branch information
bfintal committed Jun 14, 2019
1 parent c9dee23 commit 34c5356
Show file tree
Hide file tree
Showing 75 changed files with 115 additions and 85 deletions.
27 changes: 14 additions & 13 deletions .config/externals.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,28 @@ const camelCaseDash = string => string.replace(
*/
const externals = [
'api-fetch',
'blocks',
'components',
'compose',
'data',
'date',
'htmlEntities',
'hooks',
'block-editor',
'blocks',
'components',
'compose',
'data',
'date',
'htmlEntities',
'hooks',
'edit-post',
'element',
'editor',
'element',
'editor',
'i18n',
'plugins',
'viewport',
'plugins',
'viewport',
'ajax',
'codeEditor',
].reduce( ( externals, name ) => ( {
...externals,
[ `@wordpress/${ name }` ]: `wp.${ camelCaseDash( name ) }`,
} ), {
wp: 'wp',
lodash: 'lodash', // WP loads lodash already.
wp: 'wp',
lodash: 'lodash', // WP loads lodash already.
stackable: 'stackable', // Our localized JS variable.
fetch: 'fetch', // Used in our debugger sidebar.
} );
Expand Down
1 change: 1 addition & 0 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function stackable_php_requirement_notice() {
* Block Initializer.
*/
require_once( plugin_dir_path( __FILE__ ) . 'src/block/disabled-blocks.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/init-deprecated.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/init.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/fonts.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/block/blog-posts/index.php' );
Expand Down
2 changes: 1 addition & 1 deletion src/block/accordion/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import md5 from 'md5'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'
import SVGArrowIconV112 from './images/arrow-v1-12.svg'

const deprecatedSchema_1_12 = {
Expand Down
2 changes: 1 addition & 1 deletion src/block/accordion/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@stackable/components'
import {
InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
PanelBody, RangeControl, ToggleControl,
} from '@wordpress/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/accordion/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import { ArrowIcon } from './index'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

// Accessibility: https://www.w3.org/TR/wai-aria-practices/examples/accordion/accordion.html
const save = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/block/blockquote/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import { QUOTE_ICONS } from './quotes'
import { QUOTE_ICONS_1_11 } from './deprecated-quotes'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSave_1_13 = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/blockquote/edit-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@stackable/components'
import {
InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import { __ } from '@wordpress/i18n'
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
Expand Down
2 changes: 1 addition & 1 deletion src/block/blockquote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@stackable/components'
import {
InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import { __ } from '@wordpress/i18n'
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
Expand Down
2 changes: 1 addition & 1 deletion src/block/blockquote/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
import { QUOTE_ICONS } from './quotes'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/blog-posts/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './designs'
import {
AlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import { Component, Fragment } from '@wordpress/element'
import { dateI18n, format } from '@wordpress/date'
import { DesignPanelBody, ProControl, ProControlButton } from '@stackable/components/'
Expand Down
2 changes: 1 addition & 1 deletion src/block/button/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
BlockAlignmentToolbar, BlockControls, InspectorControls,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
ButtonEdit, PanelButtonSettings, ProControl, URLInputControl,
} from '@stackable/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/call-to-action/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSchema_1_12 = {
url: {
Expand Down
2 changes: 1 addition & 1 deletion src/block/call-to-action/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from '@stackable/components'
import {
InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
PanelBody, RangeControl, ToggleControl,
} from '@wordpress/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/call-to-action/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import { ButtonEdit } from '@stackable/components'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/card/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSave_1_12 = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/card/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
ButtonEdit, ColorPaletteControl, DesignPanelBody, ImageUploadPlaceholder, PanelButtonSettings, ProControl, ProControlButton, URLInputControl,
} from '@stackable/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/card/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import { ButtonEdit } from '@stackable/components'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/container/deprecated.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import { InnerBlocks } from '@wordpress/editor'
import { InnerBlocks } from '@wordpress/block-editor'

const deprecatedSchema_1_10 = {
textColor: {
Expand Down
2 changes: 1 addition & 1 deletion src/block/container/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlignmentToolbar, BlockControls, InnerBlocks, InspectorControls, PanelColorSettings,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
HorizontalAlignmentToolbar, PanelBackgroundSettings, ProControl, VerticalAlignmentToolbar,
} from '@stackable/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/container/save.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
import { InnerBlocks } from '@wordpress/editor'
import { InnerBlocks } from '@wordpress/block-editor'

const save = props => {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/block/count-up/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
import { getFontFamily } from './deprecated-font'
import { range } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

export const deprecatedSave_1_15_4 = props => {
const { className, attributes } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/count-up/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Fragment } from '@wordpress/element'
import ImageDesignPlain from './images/plain.png'
import ImageDesignPlain2 from './images/plain-2.png'
import { range } from 'lodash'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'
import { showProNotice } from 'stackable'

addFilter( 'stackable.count-up.edit.inspector.layout.before', 'stackable/count-up', ( output, props ) => {
Expand Down
2 changes: 1 addition & 1 deletion src/block/count-up/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classnames from 'classnames'
import { compose } from '@wordpress/compose'
import createStyles from './style'
import { Fragment } from '@wordpress/element'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className, attributes } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/divider/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import { PanelBody, RangeControl } from '@wordpress/components'
import { __ } from '@wordpress/i18n'
import { applyFilters } from '@wordpress/hooks'
Expand Down
2 changes: 1 addition & 1 deletion src/block/expand/deprecated.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSchema_1_10 = {
text: {
Expand Down
2 changes: 1 addition & 1 deletion src/block/expand/edit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InspectorControls, RichText } from '@wordpress/editor'
import { InspectorControls, RichText } from '@wordpress/block-editor'
import { __ } from '@wordpress/i18n'
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
Expand Down
2 changes: 1 addition & 1 deletion src/block/expand/save.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature-grid/deprecated.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { descriptionPlaceholder, range } from '@stackable/util'
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSave_1_10 = props => {
const { attributes, className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature-grid/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from '@stackable/components'
import {
InspectorControls, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
PanelBody, RangeControl,
} from '@wordpress/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature-grid/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { applyFilters } from '@wordpress/hooks'
import { ButtonEdit } from '@stackable/components'
import classnames from 'classnames'
import { range } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'
import striptags from 'striptags'

const save = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSchema_1_10 = {
textColor: {
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
ButtonEdit, DesignPanelBody, ImageUploadPlaceholder, PanelBackgroundSettings, PanelButtonSettings, ProControl, ProControlButton, URLInputControl,
} from '@stackable/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/feature/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import { ButtonEdit } from '@stackable/components'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'
import striptags from 'striptags'

const save = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/block/ghost-button/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
BlockAlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings, RichText, URLInput,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
Dashicon, IconButton, PanelBody, RangeControl, SelectControl,
} from '@wordpress/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/ghost-button/save.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/header/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { descriptionPlaceholder } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSave_1_12 = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/header/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlignmentToolbar, BlockControls, InspectorControls, PanelColorSettings, RichText,
} from '@wordpress/editor'
} from '@wordpress/block-editor'
import {
ButtonEdit, DesignPanelBody, PanelBackgroundSettings, PanelButtonSettings, ProControl, ProControlButton, URLInputControl,
} from '@stackable/components'
Expand Down
2 changes: 1 addition & 1 deletion src/block/header/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyFilters } from '@wordpress/hooks'
import { ButtonEdit } from '@stackable/components'
import classnames from 'classnames'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/icon-list/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { applyFilters } from '@wordpress/hooks'
import classnames from 'classnames'
import { getIconSVGBase64 as deprecatedGetIconSVGBase64 } from './deprecated-util'
import { getIconSVGBase64 } from './util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSave_1_15_4 = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/icon-list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import classnames from 'classnames'
import { compose } from '@wordpress/compose'
import createStyles from './style'
import { Fragment } from '@wordpress/element'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

addFilter( 'stackable.icon-list.edit.inspector.style.before', 'stackable/icon-list', ( output, props ) => {
const { setAttributes } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/icon-list/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classnames from 'classnames'
import { compose } from '@wordpress/compose'
import createStyles from './style'
import { Fragment } from '@wordpress/element'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const save = props => {
const { className } = props
Expand Down
2 changes: 1 addition & 1 deletion src/block/image-box/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { __ } from '@wordpress/i18n'
import classnames from 'classnames'
import { omit } from 'lodash'
import { range } from '@stackable/util'
import { RichText } from '@wordpress/editor'
import { RichText } from '@wordpress/block-editor'

const deprecatedSchema_1_10 = {
columns: {
Expand Down
Loading

0 comments on commit 34c5356

Please sign in to comment.