From e7cf9694cdfb565af880b54bcd5f4cb45569272c Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 6 Nov 2017 18:15:12 +0100 Subject: [PATCH] Metaboxes: Remove lingering useless code or mentions of iframe --- .eslintignore | 1 - bin/build-plugin-zip.sh | 1 - docs/meta-box.md | 4 +- .../meta-boxes/meta-boxes-area/index.js | 1 - .../meta-boxes-area/meta-box-area.scss | 93 --------------- .../meta-boxes/meta-boxes-area/style.scss | 108 +++++++++++++----- .../meta-boxes/meta-boxes-panel/style.scss | 3 - lib/meta-box-partial-page.php | 8 +- 8 files changed, 85 insertions(+), 134 deletions(-) delete mode 100644 editor/components/meta-boxes/meta-boxes-area/meta-box-area.scss diff --git a/.eslintignore b/.eslintignore index 3aa71080db424..164ae5ac2c7ef 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,3 @@ build coverage vendor node_modules -/assets/js diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh index b86bb82bd068d..4828c1d50f0b5 100755 --- a/bin/build-plugin-zip.sh +++ b/bin/build-plugin-zip.sh @@ -93,7 +93,6 @@ mv gutenberg.tmp.php gutenberg.php status "Creating archive..." zip -r gutenberg.zip \ gutenberg.php \ - assets/js/*.js \ lib/*.php \ blocks/library/*/*.php \ post-content.js \ diff --git a/docs/meta-box.md b/docs/meta-box.md index 639dd110a5735..f48dc84dab034 100644 --- a/docs/meta-box.md +++ b/docs/meta-box.md @@ -42,9 +42,9 @@ this might now be possible. Test with ACF to make sure. `INITIALIZE_META_BOX_STATE` comes in, the store will update any active meta box areas by setting the `isActive` flag to `true`. Once this happens React will check for the new props sent in by Redux on the `MetaBox` component. If that -`MetaBox` is now active, instead of rendering null, a `MetaBoxIframe` component will +`MetaBox` is now active, instead of rendering null, a `MetaBoxArea` component will be rendered. The `MetaBox` component is the container component that mediates -between the `MetaBoxIframe` and the Redux Store. *If no meta boxes are active, +between the `MetaBoxArea` and the Redux Store. *If no meta boxes are active, nothing happens. This will be the default behavior, as all core meta boxes have been stripped.* diff --git a/editor/components/meta-boxes/meta-boxes-area/index.js b/editor/components/meta-boxes/meta-boxes-area/index.js index d93006b19d1ab..efcae3d986614 100644 --- a/editor/components/meta-boxes/meta-boxes-area/index.js +++ b/editor/components/meta-boxes/meta-boxes-area/index.js @@ -16,7 +16,6 @@ import { Spinner } from '@wordpress/components'; * Internal dependencies */ import './style.scss'; -import './meta-box-area.scss'; import { handleMetaBoxReload, metaBoxStateChanged, metaBoxLoaded } from '../../actions'; import { getMetaBox, isSavingPost } from '../../selectors'; diff --git a/editor/components/meta-boxes/meta-boxes-area/meta-box-area.scss b/editor/components/meta-boxes/meta-boxes-area/meta-box-area.scss deleted file mode 100644 index cddb4e6b4a30a..0000000000000 --- a/editor/components/meta-boxes/meta-boxes-area/meta-box-area.scss +++ /dev/null @@ -1,93 +0,0 @@ - -.editor-meta-boxes-area { - position: relative; - - /* Match width and positioning of the meta boxes. Override default styles. */ - #poststuff { - margin: 0 auto; - padding-top: 0; - min-width: auto; - } - - #post { - margin: 0; - } - - /* Override Default meta box stylings */ - - #poststuff h3.hndle, - #poststuff .stuffbox > h3, - #poststuff h2.hndle { /* WordPress selectors yolo */ - border-bottom: 1px solid $light-gray-500; - box-sizing: border-box; - color: $dark-gray-500; - font-weight: 600; - outline: none; - padding: 15px; - position: relative; - width: 100%; - } - - .postbox { - border: 0; - color: $dark-gray-500; - margin-bottom: 0; - } - - .postbox > .inside { - border-bottom: 1px solid $light-gray-500; - color: $dark-gray-500; - padding: 15px; - margin: 0; - } - - input { - max-width: 300px; - } - - input, - select, - textarea { - background: inherit; - border: 1px solid $light-gray-500; - border-radius: 4px; - box-shadow: none; - color: $dark-gray-800; - display: inline-block; - font-family: inherit; - font-size: 13px; - line-height: 24px; - outline: none; - padding: 4px; - } - - input:hover, - select:hover, - textarea:hover { - border: 1px solid $light-gray-700; - } - - .postbox .handlediv { - height: 44px; - width: 44px; - } - - &.is-loading:before { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - content: ''; - z-index: 1; - background: transparent; - z-index: z-index( '.editor-meta-boxes-area.is-loading:before'); - } - - .spinner { - position: absolute; - top: 10px; - right: 20px; - z-index: z-index( '.editor-meta-boxes-area .spinner'); - } -} diff --git a/editor/components/meta-boxes/meta-boxes-area/style.scss b/editor/components/meta-boxes/meta-boxes-area/style.scss index bd2fbe9a9a679..cddb4e6b4a30a 100644 --- a/editor/components/meta-boxes/meta-boxes-area/style.scss +++ b/editor/components/meta-boxes/meta-boxes-area/style.scss @@ -1,37 +1,93 @@ -.editor-meta-boxes-iframe { - width: 100%; + +.editor-meta-boxes-area { position: relative; - .is-updating { - filter: blur( 5px ); + /* Match width and positioning of the meta boxes. Override default styles. */ + #poststuff { + margin: 0 auto; + padding-top: 0; + min-width: auto; + } + + #post { + margin: 0; + } + + /* Override Default meta box stylings */ + + #poststuff h3.hndle, + #poststuff .stuffbox > h3, + #poststuff h2.hndle { /* WordPress selectors yolo */ + border-bottom: 1px solid $light-gray-500; + box-sizing: border-box; + color: $dark-gray-500; + font-weight: 600; + outline: none; + padding: 15px; + position: relative; + width: 100%; + } + + .postbox { + border: 0; + color: $dark-gray-500; + margin-bottom: 0; + } + + .postbox > .inside { + border-bottom: 1px solid $light-gray-500; + color: $dark-gray-500; + padding: 15px; + margin: 0; + } + + input { + max-width: 300px; + } + + input, + select, + textarea { + background: inherit; + border: 1px solid $light-gray-500; + border-radius: 4px; + box-shadow: none; + color: $dark-gray-800; + display: inline-block; + font-family: inherit; + font-size: 13px; + line-height: 24px; + outline: none; + padding: 4px; } - .is-hidden { - visibility: hidden; + input:hover, + select:hover, + textarea:hover { + border: 1px solid $light-gray-700; + } + + .postbox .handlediv { + height: 44px; + width: 44px; + } + + &.is-loading:before { position: absolute; top: 0; left: 0; + right: 0; + bottom: 0; + content: ''; + z-index: 1; + background: transparent; + z-index: z-index( '.editor-meta-boxes-area.is-loading:before'); } -} -.editor-meta-boxes-iframe__loading-overlay { - background-color: rgba( 0, 0, 0, 0.6 ); - display: none; - position: absolute; - height: 100%; - top: 0; - left: 0; - width: 100%; - z-index: 1; - - &.is-visible { - align-items: center; - display: flex; - justify-content: center; + .spinner { + position: absolute; + top: 10px; + right: 20px; + z-index: z-index( '.editor-meta-boxes-area .spinner'); } } - -.editor-meta-boxes-iframe__loading-overlay-text { - color: $white; - font-weight: 700; -} diff --git a/editor/components/meta-boxes/meta-boxes-panel/style.scss b/editor/components/meta-boxes/meta-boxes-panel/style.scss index 9b20379f59bab..f62ab9f092c5b 100644 --- a/editor/components/meta-boxes/meta-boxes-panel/style.scss +++ b/editor/components/meta-boxes/meta-boxes-panel/style.scss @@ -1,6 +1,3 @@ -/** - * These are the styles that are not loaded from within the iframe. - */ .editor-meta-boxes-panel { border: 0; diff --git a/lib/meta-box-partial-page.php b/lib/meta-box-partial-page.php index 8afd082093f53..ce27ef205e6fd 100644 --- a/lib/meta-box-partial-page.php +++ b/lib/meta-box-partial-page.php @@ -152,8 +152,7 @@ function gutenberg_meta_box_partial_page_admin_header( $hook_suffix, $current_sc wp_enqueue_script( 'common' ); wp_enqueue_script( 'svg-painter' ); ?> - - +