Block Editor: Hide the Custom Fields meta box option if that meta box has been removed.

Some plugins remove the Custom Fields meta box, particularly when they provide functionality that replaces it. The block editor would correctly not display this meta box in these circumstances, but it still showed the option to display or hide it.

Props pento, noisysocks.
See #45282.



Built from https://develop.svn.wordpress.org/branches/5.0@43885


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2018-11-12 03:38:50 +00:00
parent 54368e50b6
commit 8f8f3bb91d
35 changed files with 12762 additions and 3529 deletions

View File

@ -19,8 +19,9 @@ if ( ! defined( 'ABSPATH' ) ) {
* @global WP_Post $post * @global WP_Post $post
* @global string $title * @global string $title
* @global array $editor_styles * @global array $editor_styles
* @global array $wp_meta_boxes
*/ */
global $post_type, $post_type_object, $post, $title, $editor_styles; global $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes;
if ( ! empty( $post_type_object ) ) { if ( ! empty( $post_type_object ) ) {
$title = $post_type_object->labels->edit_item; $title = $post_type_object->labels->edit_item;
@ -316,36 +317,6 @@ if ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post
} }
} }
$init_script = <<<JS
( function() {
window._wpLoadBlockEditor = new Promise( function( resolve ) {
wp.domReady( function() {
resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) );
} );
} );
} )();
JS;
/**
* Filters the settings to pass to the block editor.
*
* @since 5.0.0
*
* @param array $editor_settings Default editor settings.
* @param WP_Post $post Post being edited.
*/
$editor_settings = apply_filters( 'block_editor_settings', $editor_settings, $post );
$script = sprintf(
$init_script,
$post->post_type,
$post->ID,
wp_json_encode( $editor_settings ),
wp_json_encode( $initial_edits )
);
wp_add_inline_script( 'wp-edit-post', $script );
/** /**
* Scripts * Scripts
*/ */
@ -378,6 +349,41 @@ do_action( 'enqueue_block_editor_assets' );
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
register_and_do_post_meta_boxes( $post ); register_and_do_post_meta_boxes( $post );
// Check if the Custom Fields meta box has been removed at some point.
$core_meta_boxes = $wp_meta_boxes[ $current_screen->id ]['normal']['core'];
if ( ! isset( $core_meta_boxes['postcustom'] ) || ! $core_meta_boxes['postcustom'] ) {
unset( $editor_settings['enableCustomFields'] );
}
/**
* Filters the settings to pass to the block editor.
*
* @since 5.0.0
*
* @param array $editor_settings Default editor settings.
* @param WP_Post $post Post being edited.
*/
$editor_settings = apply_filters( 'block_editor_settings', $editor_settings, $post );
$init_script = <<<JS
( function() {
window._wpLoadBlockEditor = new Promise( function( resolve ) {
wp.domReady( function() {
resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) );
} );
} );
} )();
JS;
$script = sprintf(
$init_script,
$post->post_type,
$post->ID,
wp_json_encode( $editor_settings ),
wp_json_encode( $initial_edits )
);
wp_add_inline_script( 'wp-edit-post', $script );
require_once( ABSPATH . 'wp-admin/admin-header.php' ); require_once( ABSPATH . 'wp-admin/admin-header.php' );
?> ?>

View File

@ -1361,10 +1361,11 @@ function register_and_do_post_meta_boxes( $post ) {
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
if ( post_type_supports($post_type, 'custom-fields') ) { if ( post_type_supports($post_type, 'custom-fields') ) {
$screen = get_current_screen(); $args = array(
if ( ! $screen || ! $screen->is_block_editor() || (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ) ) { '__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => false, '__block_editor_compatible_meta_box' => true ) ); '__block_editor_compatible_meta_box' => true
} );
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core', $args );
} }
/** /**

View File

@ -1076,7 +1076,8 @@ function do_meta_boxes( $screen, $context, $object ) {
} }
$i++; $i++;
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; // get_hidden_meta_boxes() doesn't apply in the block editor.
$hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
if ( 'dashboard_browser_nag' != $box['id'] ) { if ( 'dashboard_browser_nag' != $box['id'] ) {
$widget_title = $box[ 'title' ]; $widget_title = $box[ 'title' ];

1299
wp-includes/js/dist/annotations.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -195,19 +195,20 @@ var document;
var offset; var offset;
var output; var output;
var stack; var stack;
var tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?!}\s+-->)[^])+?}\s+)?(\/)?-->/g; var tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:[^}]+|}+(?=})|(?!}\s+-->)[^])*?}\s+)?(\/)?-->/g;
function Block(blockName, attrs, innerBlocks, innerHTML) { function Block(blockName, attrs, innerBlocks, innerHTML, innerContent) {
return { return {
blockName: blockName, blockName: blockName,
attrs: attrs, attrs: attrs,
innerBlocks: innerBlocks, innerBlocks: innerBlocks,
innerHTML: innerHTML innerHTML: innerHTML,
innerContent: innerContent
}; };
} }
function Freeform(innerHTML) { function Freeform(innerHTML) {
return Block(null, {}, [], innerHTML); return Block(null, {}, [], innerHTML, [innerHTML]);
} }
function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) { function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) {
@ -283,19 +284,19 @@ function proceed() {
output.push(Freeform(document.substr(leadingHtmlStart, startOffset - leadingHtmlStart))); output.push(Freeform(document.substr(leadingHtmlStart, startOffset - leadingHtmlStart)));
} }
output.push(Block(blockName, attrs, [], '')); output.push(Block(blockName, attrs, [], '', []));
offset = startOffset + tokenLength; offset = startOffset + tokenLength;
return true; return true;
} // otherwise we found an inner block } // otherwise we found an inner block
addInnerBlock(Block(blockName, attrs, [], ''), startOffset, tokenLength); addInnerBlock(Block(blockName, attrs, [], '', []), startOffset, tokenLength);
offset = startOffset + tokenLength; offset = startOffset + tokenLength;
return true; return true;
case 'block-opener': case 'block-opener':
// track all newly-opened blocks on the stack // track all newly-opened blocks on the stack
stack.push(Frame(Block(blockName, attrs, [], ''), startOffset, tokenLength, startOffset + tokenLength, leadingHtmlStart)); stack.push(Frame(Block(blockName, attrs, [], '', []), startOffset, tokenLength, startOffset + tokenLength, leadingHtmlStart));
offset = startOffset + tokenLength; offset = startOffset + tokenLength;
return true; return true;
@ -321,7 +322,9 @@ function proceed() {
var stackTop = stack.pop(); var stackTop = stack.pop();
stackTop.block.innerHTML += document.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset); var html = document.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset);
stackTop.block.innerHTML += html;
stackTop.block.innerContent.push(html);
stackTop.prevOffset = startOffset + tokenLength; stackTop.prevOffset = startOffset + tokenLength;
addInnerBlock(stackTop.block, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength); addInnerBlock(stackTop.block, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength);
offset = startOffset + tokenLength; offset = startOffset + tokenLength;
@ -413,7 +416,14 @@ function addFreeform(rawLength) {
function addInnerBlock(block, tokenStart, tokenLength, lastOffset) { function addInnerBlock(block, tokenStart, tokenLength, lastOffset) {
var parent = stack[stack.length - 1]; var parent = stack[stack.length - 1];
parent.block.innerBlocks.push(block); parent.block.innerBlocks.push(block);
parent.block.innerHTML += document.substr(parent.prevOffset, tokenStart - parent.prevOffset); var html = document.substr(parent.prevOffset, tokenStart - parent.prevOffset);
if (html) {
parent.block.innerHTML += html;
parent.block.innerContent.push(html);
}
parent.block.innerContent.push(null);
parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength; parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength;
} }
@ -424,10 +434,11 @@ function addBlockFromStack(endOffset) {
prevOffset = _stack$pop.prevOffset, prevOffset = _stack$pop.prevOffset,
tokenStart = _stack$pop.tokenStart; tokenStart = _stack$pop.tokenStart;
if (endOffset) { var html = endOffset ? document.substr(prevOffset, endOffset - prevOffset) : document.substr(prevOffset);
block.innerHTML += document.substr(prevOffset, endOffset - prevOffset);
} else { if (html) {
block.innerHTML += document.substr(prevOffset); block.innerHTML += html;
block.innerContent.push(html);
} }
if (null !== leadingHtmlStart) { if (null !== leadingHtmlStart) {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -91,7 +91,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["date"] =
/*!************************************************************!*\ /*!************************************************************!*\
!*** ./node_modules/@wordpress/date/build-module/index.js ***! !*** ./node_modules/@wordpress/date/build-module/index.js ***!
\************************************************************/ \************************************************************/
/*! exports provided: setSettings, __experimentalGetSettings, getSettings, moment, format, date, gmdate, dateI18n */ /*! exports provided: setSettings, __experimentalGetSettings, getSettings, moment, format, date, gmdate, dateI18n, isInTheFuture, getDate */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -104,6 +104,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "date", function() { return date; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "date", function() { return date; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gmdate", function() { return gmdate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gmdate", function() { return gmdate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateI18n", function() { return dateI18n; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateI18n", function() { return dateI18n; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInTheFuture", function() { return isInTheFuture; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDate", function() { return getDate; });
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment-timezone */ "./node_modules/moment-timezone/index.js"); /* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment-timezone */ "./node_modules/moment-timezone/index.js");
@ -241,6 +243,12 @@ function setupWPTimezone() {
var moment = function moment() { var moment = function moment() {
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_3___default()('wp.date.moment', {
version: '4.4',
alternative: 'the moment script as a dependency',
plugin: 'Gutenberg'
});
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key]; args[_key] = arguments[_key];
} }
@ -515,6 +523,34 @@ function dateI18n(dateFormat) {
return format(dateFormat, dateMoment); return format(dateFormat, dateMoment);
} }
/**
* Check whether a date is considered in the future according to the WordPress settings.
*
* @param {string} dateValue Date String or Date object in the Defined WP Timezone.
*
* @return {boolean} Is in the future.
*/
function isInTheFuture(dateValue) {
var now = moment__WEBPACK_IMPORTED_MODULE_0___default.a.tz('WP');
var momentObject = moment__WEBPACK_IMPORTED_MODULE_0___default.a.tz(dateValue, 'WP');
return momentObject.isAfter(now);
}
/**
* Create and return a JavaScript Date Object from a date string in the WP timezone.
*
* @param {string?} dateString Date formatted in the WP timezone.
*
* @return {Date} Date
*/
function getDate(dateString) {
if (!dateString) {
return moment__WEBPACK_IMPORTED_MODULE_0___default.a.tz('WP').toDate();
}
return moment__WEBPACK_IMPORTED_MODULE_0___default.a.tz(dateString, 'WP').toDate();
}
setupWPTimezone(); setupWPTimezone();

File diff suppressed because one or more lines are too long

View File

@ -167,7 +167,7 @@ function _toConsumableArray(arr) {
/*!*********************************************************!*\ /*!*********************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/dom.js ***! !*** ./node_modules/@wordpress/dom/build-module/dom.js ***!
\*********************************************************/ \*********************************************************/
/*! exports provided: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag */ /*! exports provided: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -188,6 +188,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return insertAfter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return insertAfter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return replaceTag; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return replaceTag; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/** /**
@ -799,13 +800,12 @@ function unwrap(node) {
* *
* @param {Element} node The node to replace * @param {Element} node The node to replace
* @param {string} tagName The new tag name. * @param {string} tagName The new tag name.
* @param {Document} doc The document of the node.
* *
* @return {Element} The new node. * @return {Element} The new node.
*/ */
function replaceTag(node, tagName, doc) { function replaceTag(node, tagName) {
var newNode = doc.createElement(tagName); var newNode = node.ownerDocument.createElement(tagName);
while (node.firstChild) { while (node.firstChild) {
newNode.appendChild(node.firstChild); newNode.appendChild(node.firstChild);
@ -814,6 +814,17 @@ function replaceTag(node, tagName, doc) {
node.parentNode.replaceChild(newNode, node); node.parentNode.replaceChild(newNode, node);
return newNode; return newNode;
} }
/**
* Wraps the given node with a new node with the given tag name.
*
* @param {Element} newNode The node to insert.
* @param {Element} referenceNode The node to wrap.
*/
function wrap(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode);
newNode.appendChild(referenceNode);
}
/***/ }), /***/ }),
@ -916,7 +927,7 @@ function find(context) {
/*!***********************************************************!*\ /*!***********************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/index.js ***! !*** ./node_modules/@wordpress/dom/build-module/index.js ***!
\***********************************************************/ \***********************************************************/
/*! exports provided: focus, isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag */ /*! exports provided: focus, isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -957,6 +968,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["replaceTag"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["replaceTag"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["wrap"]; });
/** /**
* Internal dependencies * Internal dependencies
*/ */

File diff suppressed because one or more lines are too long

View File

@ -1255,9 +1255,14 @@ function Header(_ref) {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Editor top bar'), "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Editor top bar'),
className: "edit-post-header", className: "edit-post-header",
tabIndex: "-1" tabIndex: "-1"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_header_toolbar__WEBPACK_IMPORTED_MODULE_8__["default"], null), !isPublishSidebarOpened && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_header_toolbar__WEBPACK_IMPORTED_MODULE_8__["default"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "edit-post-header__settings" className: "edit-post-header__settings"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["PostSavedState"], { }, !isPublishSidebarOpened && // This button isn't completely hidden by the publish sidebar.
// We can't hide the whole toolbar when the publish sidebar is open because
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
// We track that DOM node to return focus to the PostPublishButtonOrToggle
// when the publish sidebar has been closed.
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["PostSavedState"], {
forceIsDirty: hasActiveMetaboxes, forceIsDirty: hasActiveMetaboxes,
forceIsSaving: isSaving forceIsSaving: isSaving
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["PostPreviewButton"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_publish_button_or_toggle__WEBPACK_IMPORTED_MODULE_11__["default"], { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["PostPreviewButton"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_post_publish_button_or_toggle__WEBPACK_IMPORTED_MODULE_11__["default"], {
@ -1712,12 +1717,12 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor"); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport"); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/viewport */ "@wordpress/viewport");
/* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _wordpress_viewport__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_viewport__WEBPACK_IMPORTED_MODULE_5__);
@ -1746,48 +1751,51 @@ function PostPublishButtonOrToggle(_ref) {
isPublishSidebarOpened = _ref.isPublishSidebarOpened, isPublishSidebarOpened = _ref.isPublishSidebarOpened,
isScheduled = _ref.isScheduled, isScheduled = _ref.isScheduled,
togglePublishSidebar = _ref.togglePublishSidebar; togglePublishSidebar = _ref.togglePublishSidebar;
var button = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_2__["PostPublishButton"], { var IS_TOGGLE = 'toggle';
forceIsDirty: forceIsDirty, var IS_BUTTON = 'button';
forceIsSaving: forceIsSaving var component;
});
var toggle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_2__["PostPublishPanelToggle"], {
isOpen: isPublishSidebarOpened,
onToggle: togglePublishSidebar,
forceIsSaving: forceIsSaving
});
/** /**
* We want to show a BUTTON when the post status is at the _final stage_ * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
*
* 1) We want to show a BUTTON when the post status is at the _final stage_
* for a particular role (see https://codex.wordpress.org/Post_Status): * for a particular role (see https://codex.wordpress.org/Post_Status):
* *
* - is published * - is published
* - is scheduled to be published * - is scheduled to be published
* - is pending and can't be published (but only for viewports >= medium) * - is pending and can't be published (but only for viewports >= medium).
* Originally, we considered showing a button for pending posts that couldn't be published
* (for example, for an author with the contributor role). Some languages can have
* long translations for "Submit for review", so given the lack of UI real estate available
* we decided to take into account the viewport in that case.
* See: https://github.com/WordPress/gutenberg/issues/10475
* *
* Originally we considered showing a button for pending posts * 2) Then, in small viewports, we'll show a TOGGLE.
* that couldn't be published (for ex, for a contributor role). *
* Some languages can have really long translations for "Submit for review", * 3) Finally, we'll use the publish sidebar status to decide:
* so given the lack of UI real state we decided to take into account the viewport *
* in that particular case. * - if it is enabled, we show a TOGGLE
* - if it is disabled, we show a BUTTON
*/ */
if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isLessThanMediumViewport) { if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isLessThanMediumViewport) {
return button; component = IS_BUTTON;
} } else if (isLessThanMediumViewport) {
/** component = IS_TOGGLE;
* Then, we take other things into account: } else if (isPublishSidebarEnabled) {
* component = IS_TOGGLE;
* - Show TOGGLE if it is small viewport. } else {
* - Otherwise, use publish sidebar status to decide - TOGGLE if enabled, BUTTON if not. component = IS_BUTTON;
*/
if (isLessThanMediumViewport) {
return toggle;
} }
return isPublishSidebarEnabled ? toggle : button; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_4__["PostPublishButton"], {
forceIsDirty: forceIsDirty,
forceIsSaving: forceIsSaving,
isOpen: isPublishSidebarOpened,
isToggle: component === IS_TOGGLE,
onToggle: togglePublishSidebar
});
} }
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (select) {
return { return {
hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(select('core/editor').getCurrentPost(), ['_links', 'wp:action-publish'], false), hasPublishAction: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(select('core/editor').getCurrentPost(), ['_links', 'wp:action-publish'], false),
isBeingScheduled: select('core/editor').isEditedPostBeingScheduled(), isBeingScheduled: select('core/editor').isEditedPostBeingScheduled(),
@ -1797,7 +1805,7 @@ function PostPublishButtonOrToggle(_ref) {
isPublishSidebarOpened: select('core/edit-post').isPublishSidebarOpened(), isPublishSidebarOpened: select('core/edit-post').isPublishSidebarOpened(),
isScheduled: select('core/editor').isCurrentPostScheduled() isScheduled: select('core/editor').isCurrentPostScheduled()
}; };
}), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])(function (dispatch) { }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (dispatch) {
var _dispatch = dispatch('core/edit-post'), var _dispatch = dispatch('core/edit-post'),
togglePublishSidebar = _dispatch.togglePublishSidebar; togglePublishSidebar = _dispatch.togglePublishSidebar;
@ -2883,11 +2891,12 @@ function OptionsModal(_ref) {
/*!*******************************************************************************************************!*\ /*!*******************************************************************************************************!*\
!*** ./node_modules/@wordpress/edit-post/build-module/components/options-modal/meta-boxes-section.js ***! !*** ./node_modules/@wordpress/edit-post/build-module/components/options-modal/meta-boxes-section.js ***!
\*******************************************************************************************************/ \*******************************************************************************************************/
/*! exports provided: default */ /*! exports provided: MetaBoxesSection, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MetaBoxesSection", function() { return MetaBoxesSection; });
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
@ -2918,44 +2927,42 @@ __webpack_require__.r(__webpack_exports__);
function MetaBoxesSection(_ref) { function MetaBoxesSection(_ref) {
var hasCustomFieldsSupport = _ref.hasCustomFieldsSupport, var areCustomFieldsRegistered = _ref.areCustomFieldsRegistered,
metaBoxes = _ref.metaBoxes, metaBoxes = _ref.metaBoxes,
sectionProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["hasCustomFieldsSupport", "metaBoxes"]); sectionProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["areCustomFieldsRegistered", "metaBoxes"]);
if (!hasCustomFieldsSupport && metaBoxes.length === 0) { // The 'Custom Fields' meta box is a special case that we handle separately.
var thirdPartyMetaBoxes = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["filter"])(metaBoxes, function (_ref2) {
var id = _ref2.id;
return id !== 'postcustom';
});
if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
return null; return null;
} }
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_section__WEBPACK_IMPORTED_MODULE_5__["default"], sectionProps, hasCustomFieldsSupport && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_options__WEBPACK_IMPORTED_MODULE_6__["EnableCustomFieldsOption"], { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_section__WEBPACK_IMPORTED_MODULE_5__["default"], sectionProps, areCustomFieldsRegistered && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_options__WEBPACK_IMPORTED_MODULE_6__["EnableCustomFieldsOption"], {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom Fields') label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom Fields')
}), Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(metaBoxes, function (_ref2) { }), Object(lodash__WEBPACK_IMPORTED_MODULE_2__["map"])(thirdPartyMetaBoxes, function (_ref3) {
var id = _ref2.id, var id = _ref3.id,
title = _ref2.title; title = _ref3.title;
return (// The 'Custom Fields' meta box is a special case handled above. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_options__WEBPACK_IMPORTED_MODULE_6__["EnablePanelOption"], {
id !== 'postcustom' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_options__WEBPACK_IMPORTED_MODULE_6__["EnablePanelOption"], { key: id,
key: id, label: title,
label: title, panelName: "meta-box-".concat(id)
panelName: "meta-box-".concat(id) });
})
);
})); }));
} }
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) { /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])(function (select) {
var _select = select('core/editor'), var _select = select('core/editor'),
getEditedPostAttribute = _select.getEditedPostAttribute; getEditorSettings = _select.getEditorSettings;
var _select2 = select('core'), var _select2 = select('core/edit-post'),
getPostType = _select2.getPostType; getAllMetaBoxes = _select2.getAllMetaBoxes;
var _select3 = select('core/edit-post'),
getAllMetaBoxes = _select3.getAllMetaBoxes;
var postType = getPostType(getEditedPostAttribute('type'));
return { return {
hasCustomFieldsSupport: postType.supports['custom-fields'], areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined,
metaBoxes: getAllMetaBoxes() metaBoxes: getAllMetaBoxes()
}; };
})(MetaBoxesSection)); })(MetaBoxesSection));
@ -3089,11 +3096,12 @@ function (_Component) {
/*!*****************************************************************************************************************!*\ /*!*****************************************************************************************************************!*\
!*** ./node_modules/@wordpress/edit-post/build-module/components/options-modal/options/enable-custom-fields.js ***! !*** ./node_modules/@wordpress/edit-post/build-module/components/options-modal/options/enable-custom-fields.js ***!
\*****************************************************************************************************************/ \*****************************************************************************************************************/
/*! exports provided: default */ /*! exports provided: EnableCustomFieldsOption, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EnableCustomFieldsOption", function() { return EnableCustomFieldsOption; });
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
@ -3123,7 +3131,6 @@ __webpack_require__.r(__webpack_exports__);
*/ */
var EnableCustomFieldsOption = var EnableCustomFieldsOption =
/*#__PURE__*/ /*#__PURE__*/
function (_Component) { function (_Component) {
@ -3171,10 +3178,9 @@ function (_Component) {
return EnableCustomFieldsOption; return EnableCustomFieldsOption;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) { /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])(function (select) {
return { return {
isChecked: select('core/editor').getEditorSettings().enableCustomFields isChecked: !!select('core/editor').getEditorSettings().enableCustomFields
}; };
})(EnableCustomFieldsOption)); })(EnableCustomFieldsOption));
@ -5030,9 +5036,9 @@ function Editor(_ref) {
hasFixedToolbar = _ref.hasFixedToolbar, hasFixedToolbar = _ref.hasFixedToolbar,
focusMode = _ref.focusMode, focusMode = _ref.focusMode,
post = _ref.post, post = _ref.post,
overridePost = _ref.overridePost, initialEdits = _ref.initialEdits,
onError = _ref.onError, onError = _ref.onError,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["settings", "hasFixedToolbar", "focusMode", "post", "overridePost", "onError"]); props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["settings", "hasFixedToolbar", "focusMode", "post", "initialEdits", "onError"]);
if (!post) { if (!post) {
return null; return null;
@ -5045,7 +5051,8 @@ function Editor(_ref) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["StrictMode"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["EditorProvider"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["StrictMode"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["EditorProvider"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
settings: editorSettings, settings: editorSettings,
post: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, post, overridePost) post: post,
initialEdits: initialEdits
}, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["ErrorBoundary"], { }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["ErrorBoundary"], {
onError: onError onError: onError
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_components_layout__WEBPACK_IMPORTED_MODULE_6__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["PostLockedModal"], null))); }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_components_layout__WEBPACK_IMPORTED_MODULE_6__["default"], null)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_5__["PostLockedModal"], null)));
@ -5183,7 +5190,7 @@ var getAttachmentsCollection = function getAttachmentsCollection(ids) {
order: 'ASC', order: 'ASC',
orderby: 'post__in', orderby: 'post__in',
post__in: ids, post__in: ids,
per_page: 100, posts_per_page: -1,
query: true, query: true,
type: 'image' type: 'image'
}); });
@ -5602,22 +5609,24 @@ __webpack_require__.r(__webpack_exports__);
* an unhandled error occurs, replacing previously mounted editor element using * an unhandled error occurs, replacing previously mounted editor element using
* an initial state from prior to the crash. * an initial state from prior to the crash.
* *
* @param {Object} postType Post type of the post to edit. * @param {Object} postType Post type of the post to edit.
* @param {Object} postId ID of the post to edit. * @param {Object} postId ID of the post to edit.
* @param {Element} target DOM node in which editor is rendered. * @param {Element} target DOM node in which editor is rendered.
* @param {?Object} settings Editor settings object. * @param {?Object} settings Editor settings object.
* @param {Object} overridePost Post properties to override. * @param {Object} initialEdits Programmatic edits to apply initially, to be
* considered as non-user-initiated (bypass for
* unsaved changes prompt).
*/ */
function reinitializeEditor(postType, postId, target, settings, overridePost) { function reinitializeEditor(postType, postId, target, settings, initialEdits) {
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["unmountComponentAtNode"])(target); Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["unmountComponentAtNode"])(target);
var reboot = reinitializeEditor.bind(null, postType, postId, target, settings, overridePost); var reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_editor__WEBPACK_IMPORTED_MODULE_10__["default"], { Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_editor__WEBPACK_IMPORTED_MODULE_10__["default"], {
settings: settings, settings: settings,
onError: reboot, onError: reboot,
postId: postId, postId: postId,
postType: postType, postType: postType,
overridePost: overridePost, initialEdits: initialEdits,
recovery: true recovery: true
}), target); }), target);
} }
@ -5627,16 +5636,18 @@ function reinitializeEditor(postType, postId, target, settings, overridePost) {
* The return value of this function is not necessary if we change where we * The return value of this function is not necessary if we change where we
* call initializeEditor(). This is due to metaBox timing. * call initializeEditor(). This is due to metaBox timing.
* *
* @param {string} id Unique identifier for editor instance. * @param {string} id Unique identifier for editor instance.
* @param {Object} postType Post type of the post to edit. * @param {Object} postType Post type of the post to edit.
* @param {Object} postId ID of the post to edit. * @param {Object} postId ID of the post to edit.
* @param {?Object} settings Editor settings object. * @param {?Object} settings Editor settings object.
* @param {Object} overridePost Post properties to override. * @param {Object} initialEdits Programmatic edits to apply initially, to be
* considered as non-user-initiated (bypass for
* unsaved changes prompt).
*/ */
function initializeEditor(id, postType, postId, settings, overridePost) { function initializeEditor(id, postType, postId, settings, initialEdits) {
var target = document.getElementById(id); var target = document.getElementById(id);
var reboot = reinitializeEditor.bind(null, postType, postId, target, settings, overridePost); var reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
Object(_wordpress_block_library__WEBPACK_IMPORTED_MODULE_5__["registerCoreBlocks"])(); Object(_wordpress_block_library__WEBPACK_IMPORTED_MODULE_5__["registerCoreBlocks"])();
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["dispatch"])('core/nux').triggerGuide(['core/editor.inserter', 'core/editor.settings', 'core/editor.preview', 'core/editor.publish']); Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__["dispatch"])('core/nux').triggerGuide(['core/editor.inserter', 'core/editor.settings', 'core/editor.preview', 'core/editor.publish']);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_editor__WEBPACK_IMPORTED_MODULE_10__["default"], { Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_editor__WEBPACK_IMPORTED_MODULE_10__["default"], {
@ -5644,7 +5655,7 @@ function initializeEditor(id, postType, postId, settings, overridePost) {
onError: reboot, onError: reboot,
postId: postId, postId: postId,
postType: postType, postType: postType,
overridePost: overridePost initialEdits: initialEdits
}), target); }), target);
} }
@ -5856,7 +5867,7 @@ function KeyboardShortcutsHelpMenuItem(_ref) {
/*!*************************************************************************!*\ /*!*************************************************************************!*\
!*** ./node_modules/@wordpress/edit-post/build-module/store/actions.js ***! !*** ./node_modules/@wordpress/edit-post/build-module/store/actions.js ***!
\*************************************************************************/ \*************************************************************************/
/*! exports provided: openGeneralSidebar, closeGeneralSidebar, openModal, closeModal, openPublishSidebar, closePublishSidebar, togglePublishSidebar, toggleEditorPanelEnabled, toggleEditorPanelOpened, toggleGeneralSidebarEditorPanel, toggleFeature, switchEditorMode, togglePinnedPluginItem, setAvailableMetaBoxesPerLocation, requestMetaBoxUpdates, metaBoxUpdatesSuccess */ /*! exports provided: openGeneralSidebar, closeGeneralSidebar, openModal, closeModal, openPublishSidebar, closePublishSidebar, togglePublishSidebar, toggleEditorPanelEnabled, toggleEditorPanelOpened, toggleFeature, switchEditorMode, togglePinnedPluginItem, setAvailableMetaBoxesPerLocation, requestMetaBoxUpdates, metaBoxUpdatesSuccess */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -5870,19 +5881,12 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "togglePublishSidebar", function() { return togglePublishSidebar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "togglePublishSidebar", function() { return togglePublishSidebar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleEditorPanelEnabled", function() { return toggleEditorPanelEnabled; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleEditorPanelEnabled", function() { return toggleEditorPanelEnabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleEditorPanelOpened", function() { return toggleEditorPanelOpened; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleEditorPanelOpened", function() { return toggleEditorPanelOpened; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleGeneralSidebarEditorPanel", function() { return toggleGeneralSidebarEditorPanel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleFeature", function() { return toggleFeature; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleFeature", function() { return toggleFeature; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchEditorMode", function() { return switchEditorMode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchEditorMode", function() { return switchEditorMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "togglePinnedPluginItem", function() { return togglePinnedPluginItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "togglePinnedPluginItem", function() { return togglePinnedPluginItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAvailableMetaBoxesPerLocation", function() { return setAvailableMetaBoxesPerLocation; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAvailableMetaBoxesPerLocation", function() { return setAvailableMetaBoxesPerLocation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestMetaBoxUpdates", function() { return requestMetaBoxUpdates; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requestMetaBoxUpdates", function() { return requestMetaBoxUpdates; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "metaBoxUpdatesSuccess", function() { return metaBoxUpdatesSuccess; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "metaBoxUpdatesSuccess", function() { return metaBoxUpdatesSuccess; });
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__);
/**
* WordPress dependencies
*/
/** /**
* Returns an action object used in signalling that the user opened an editor sidebar. * Returns an action object used in signalling that the user opened an editor sidebar.
* *
@ -5890,7 +5894,6 @@ __webpack_require__.r(__webpack_exports__);
* *
* @return {Object} Action object. * @return {Object} Action object.
*/ */
function openGeneralSidebar(name) { function openGeneralSidebar(name) {
return { return {
type: 'OPEN_GENERAL_SIDEBAR', type: 'OPEN_GENERAL_SIDEBAR',
@ -5996,22 +5999,6 @@ function toggleEditorPanelOpened(panelName) {
panelName: panelName panelName: panelName
}; };
} }
/**
* Returns an action object used to open or close a panel in the editor.
*
* @param {string} panelName A string that identifies the panel to open or close.
*
* @return {Object} Action object.
*/
function toggleGeneralSidebarEditorPanel(panelName) {
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0___default()('toggleGeneralSidebarEditorPanel', {
alternative: 'toggleEditorPanelOpened',
plugin: 'Gutenberg',
version: '4.3.0'
});
return toggleEditorPanelOpened(panelName);
}
/** /**
* Returns an action object used to toggle a feature flag. * Returns an action object used to toggle a feature flag.
* *
@ -6162,6 +6149,7 @@ __webpack_require__.r(__webpack_exports__);
var VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';
var effects = { var effects = {
SET_META_BOXES_PER_LOCATIONS: function SET_META_BOXES_PER_LOCATIONS(action, store) { SET_META_BOXES_PER_LOCATIONS: function SET_META_BOXES_PER_LOCATIONS(action, store) {
// Allow toggling metaboxes panels // Allow toggling metaboxes panels
@ -6302,7 +6290,25 @@ var effects = {
adjustSidebar(isMobileViewPort()); // Collapse sidebar when viewport shrinks. adjustSidebar(isMobileViewPort()); // Collapse sidebar when viewport shrinks.
// Reopen sidebar it if viewport expands and it was closed because of a previous shrink. // Reopen sidebar it if viewport expands and it was closed because of a previous shrink.
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["subscribe"])(Object(_utils__WEBPACK_IMPORTED_MODULE_10__["onChangeListener"])(isMobileViewPort, adjustSidebar)); Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["subscribe"])(Object(_utils__WEBPACK_IMPORTED_MODULE_10__["onChangeListener"])(isMobileViewPort, adjustSidebar)); // Update View as link when currentPost link changes
var updateViewAsLink = function updateViewAsLink(newPermalink) {
if (!newPermalink) {
return;
}
var nodeToUpdate = document.querySelector(VIEW_AS_LINK_SELECTOR);
if (!nodeToUpdate) {
return;
}
nodeToUpdate.setAttribute('href', newPermalink);
};
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["subscribe"])(Object(_utils__WEBPACK_IMPORTED_MODULE_10__["onChangeListener"])(function () {
return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/editor').getCurrentPost().link;
}, updateViewAsLink));
} }
}; };
/* harmony default export */ __webpack_exports__["default"] = (effects); /* harmony default export */ __webpack_exports__["default"] = (effects);
@ -6689,7 +6695,7 @@ var metaBoxes = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["combineRedu
/*!***************************************************************************!*\ /*!***************************************************************************!*\
!*** ./node_modules/@wordpress/edit-post/build-module/store/selectors.js ***! !*** ./node_modules/@wordpress/edit-post/build-module/store/selectors.js ***!
\***************************************************************************/ \***************************************************************************/
/*! exports provided: getEditorMode, isEditorSidebarOpened, isPluginSidebarOpened, getActiveGeneralSidebarName, getPreferences, getPreference, isPublishSidebarOpened, isEditorPanelEnabled, isEditorSidebarPanelOpened, isEditorPanelOpened, isModalActive, isFeatureActive, isPluginItemPinned, getActiveMetaBoxLocations, isMetaBoxLocationVisible, isMetaBoxLocationActive, getMetaBoxesPerLocation, getAllMetaBoxes, hasMetaBoxes, isSavingMetaBoxes */ /*! exports provided: getEditorMode, isEditorSidebarOpened, isPluginSidebarOpened, getActiveGeneralSidebarName, getPreferences, getPreference, isPublishSidebarOpened, isEditorPanelEnabled, isEditorPanelOpened, isModalActive, isFeatureActive, isPluginItemPinned, getActiveMetaBoxLocations, isMetaBoxLocationVisible, isMetaBoxLocationActive, getMetaBoxesPerLocation, getAllMetaBoxes, hasMetaBoxes, isSavingMetaBoxes */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -6702,7 +6708,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPreference", function() { return getPreference; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPreference", function() { return getPreference; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPublishSidebarOpened", function() { return isPublishSidebarOpened; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPublishSidebarOpened", function() { return isPublishSidebarOpened; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorPanelEnabled", function() { return isEditorPanelEnabled; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorPanelEnabled", function() { return isEditorPanelEnabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorSidebarPanelOpened", function() { return isEditorSidebarPanelOpened; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorPanelOpened", function() { return isEditorPanelOpened; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorPanelOpened", function() { return isEditorPanelOpened; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isModalActive", function() { return isModalActive; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isModalActive", function() { return isModalActive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFeatureActive", function() { return isFeatureActive; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFeatureActive", function() { return isFeatureActive; });
@ -6717,18 +6722,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js"); /* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__);
/** /**
* External dependencies * External dependencies
*/ */
/**
* WordPress dependencies
*/
/** /**
* Returns the current editing mode. * Returns the current editing mode.
* *
@ -6838,24 +6836,6 @@ function isEditorPanelEnabled(state, panelName) {
var panels = getPreference(state, 'panels'); var panels = getPreference(state, 'panels');
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(panels, [panelName, 'enabled'], true); return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(panels, [panelName, 'enabled'], true);
} }
/**
* Returns true if the given panel is enabled, or false otherwise. Panels are
* enabled by default.
*
* @param {Object} state Global application state.
* @param {string} panel A string that identifies the panel.
*
* @return {boolean} Whether or not the panel is enabled.
*/
function isEditorSidebarPanelOpened(state, panel) {
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('isEditorSidebarPanelOpened', {
alternative: 'isEditorPanelEnabled',
plugin: 'Gutenberg',
version: '4.3'
});
return isEditorPanelEnabled(state, panel);
}
/** /**
* Returns true if the given panel is open, or false otherwise. Panels are * Returns true if the given panel is open, or false otherwise. Panels are
* closed by default. * closed by default.
@ -7564,17 +7544,6 @@ function isShallowEqual( a, b, fromIndex ) {
/***/ }), /***/ }),
/***/ "@wordpress/deprecated":
/*!*********************************************!*\
!*** external {"this":["wp","deprecated"]} ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["deprecated"]; }());
/***/ }),
/***/ "@wordpress/editor": /***/ "@wordpress/editor":
/*!*****************************************!*\ /*!*****************************************!*\
!*** external {"this":["wp","editor"]} ***! !*** external {"this":["wp","editor"]} ***!

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -350,6 +350,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__);
/** /**
@ -358,19 +360,17 @@ __webpack_require__.r(__webpack_exports__);
var name = 'core/bold'; var name = 'core/bold';
var bold = { var bold = {
name: name, name: name,
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Bold'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Bold'),
match: { tagName: 'strong',
tagName: 'strong' className: null,
},
edit: function edit(_ref) { edit: function edit(_ref) {
var isActive = _ref.isActive, var isActive = _ref.isActive,
value = _ref.value, value = _ref.value,
onChange = _ref.onChange, onChange = _ref.onChange;
ToolbarButton = _ref.ToolbarButton,
Shortcut = _ref.Shortcut;
var onToggle = function onToggle() { var onToggle = function onToggle() {
return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, { return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, {
@ -378,11 +378,11 @@ var bold = {
})); }));
}; };
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Shortcut, { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextShortcut"], {
type: "primary", type: "primary",
character: "b", character: "b",
onUse: onToggle onUse: onToggle
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(ToolbarButton, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextToolbarButton"], {
name: "bold", name: "bold",
icon: "editor-bold", icon: "editor-bold",
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Bold'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Bold'),
@ -413,6 +413,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__);
/** /**
@ -425,13 +427,11 @@ var name = 'core/code';
var code = { var code = {
name: name, name: name,
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Code'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Code'),
match: { tagName: 'code',
tagName: 'code' className: null,
},
edit: function edit(_ref) { edit: function edit(_ref) {
var value = _ref.value, var value = _ref.value,
onChange = _ref.onChange, onChange = _ref.onChange;
Shortcut = _ref.Shortcut;
var onToggle = function onToggle() { var onToggle = function onToggle() {
return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, { return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, {
@ -439,11 +439,11 @@ var code = {
})); }));
}; };
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Shortcut, { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextShortcut"], {
type: "access", type: "access",
character: "x", character: "x",
onUse: onToggle onUse: onToggle
})); });
} }
}; };
@ -499,9 +499,8 @@ var image = {
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Image'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Image'),
keywords: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('photo'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('media')], keywords: [Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('photo'), Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('media')],
object: true, object: true,
match: { tagName: 'img',
tagName: 'img' className: null,
},
attributes: { attributes: {
className: 'class', className: 'class',
style: 'style', style: 'style',
@ -548,9 +547,9 @@ var image = {
var _this$props = this.props, var _this$props = this.props,
value = _this$props.value, value = _this$props.value,
onChange = _this$props.onChange, onChange = _this$props.onChange;
InserterListItem = _this$props.InserterListItem; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_10__["RichTextInserterItem"], {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(InserterListItem, { name: name,
icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__["SVG"], { icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__["SVG"], {
xmlns: "http://www.w3.org/2000/svg", xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24" viewBox: "0 0 24 24"
@ -656,6 +655,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__);
/** /**
@ -664,19 +665,17 @@ __webpack_require__.r(__webpack_exports__);
var name = 'core/italic'; var name = 'core/italic';
var italic = { var italic = {
name: name, name: name,
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Italic'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Italic'),
match: { tagName: 'em',
tagName: 'em' className: null,
},
edit: function edit(_ref) { edit: function edit(_ref) {
var isActive = _ref.isActive, var isActive = _ref.isActive,
value = _ref.value, value = _ref.value,
onChange = _ref.onChange, onChange = _ref.onChange;
ToolbarButton = _ref.ToolbarButton,
Shortcut = _ref.Shortcut;
var onToggle = function onToggle() { var onToggle = function onToggle() {
return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, { return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, {
@ -684,11 +683,11 @@ var italic = {
})); }));
}; };
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Shortcut, { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextShortcut"], {
type: "primary", type: "primary",
character: "i", character: "i",
onUse: onToggle onUse: onToggle
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(ToolbarButton, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextToolbarButton"], {
name: "italic", name: "italic",
icon: "editor-italic", icon: "editor-italic",
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Italic'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Italic'),
@ -729,7 +728,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _inline__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inline */ "./node_modules/@wordpress/format-library/build-module/link/inline.js"); /* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _inline__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./inline */ "./node_modules/@wordpress/format-library/build-module/link/inline.js");
@ -746,6 +747,7 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -755,9 +757,8 @@ var name = 'core/link';
var link = { var link = {
name: name, name: name,
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link'),
match: { tagName: 'a',
tagName: 'a' className: null,
},
attributes: { attributes: {
url: 'href', url: 'href',
target: 'target' target: 'target'
@ -827,26 +828,24 @@ var link = {
isActive = _this$props3.isActive, isActive = _this$props3.isActive,
activeAttributes = _this$props3.activeAttributes, activeAttributes = _this$props3.activeAttributes,
value = _this$props3.value, value = _this$props3.value,
onChange = _this$props3.onChange, onChange = _this$props3.onChange;
ToolbarButton = _this$props3.ToolbarButton, return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextShortcut"], {
Shortcut = _this$props3.Shortcut;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Shortcut, {
type: "access", type: "access",
character: "a", character: "a",
onUse: this.addLink onUse: this.addLink
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Shortcut, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextShortcut"], {
type: "access", type: "access",
character: "s", character: "s",
onUse: this.onRemoveFormat onUse: this.onRemoveFormat
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Shortcut, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextShortcut"], {
type: "primary", type: "primary",
character: "k", character: "k",
onUse: this.addLink onUse: this.addLink
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Shortcut, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextShortcut"], {
type: "primaryShift", type: "primaryShift",
character: "k", character: "k",
onUse: this.onRemoveFormat onUse: this.onRemoveFormat
}), isActive && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(ToolbarButton, { }), isActive && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextToolbarButton"], {
name: "link", name: "link",
icon: "editor-unlink", icon: "editor-unlink",
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Unlink'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Unlink'),
@ -854,7 +853,7 @@ var link = {
isActive: isActive, isActive: isActive,
shortcutType: "primaryShift", shortcutType: "primaryShift",
shortcutCharacter: "k" shortcutCharacter: "k"
}), !isActive && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(ToolbarButton, { }), !isActive && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_11__["RichTextToolbarButton"], {
name: "link", name: "link",
icon: "admin-links", icon: "admin-links",
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link'),
@ -862,7 +861,7 @@ var link = {
isActive: isActive, isActive: isActive,
shortcutType: "primary", shortcutType: "primary",
shortcutCharacter: "k" shortcutCharacter: "k"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_inline__WEBPACK_IMPORTED_MODULE_11__["default"], { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_inline__WEBPACK_IMPORTED_MODULE_12__["default"], {
addingLink: this.state.addingLink, addingLink: this.state.addingLink,
stopAddingLink: this.stopAddingLink, stopAddingLink: this.stopAddingLink,
isActive: isActive, isActive: isActive,
@ -897,19 +896,22 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes"); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _positioned_at_selection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./positioned-at-selection */ "./node_modules/@wordpress/format-library/build-module/link/positioned-at-selection.js"); /* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _positioned_at_selection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./positioned-at-selection */ "./node_modules/@wordpress/format-library/build-module/link/positioned-at-selection.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/format-library/build-module/link/utils.js");
@ -918,6 +920,10 @@ __webpack_require__.r(__webpack_exports__);
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -928,12 +934,14 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* Internal dependencies * Internal dependencies
*/ */
var stopKeyPropagation = function stopKeyPropagation(event) { var stopKeyPropagation = function stopKeyPropagation(event) {
return event.stopPropagation(); return event.stopPropagation();
}; };
@ -961,7 +969,7 @@ function createLinkFormat(_ref) {
if (opensInNewWindow) { if (opensInNewWindow) {
// translators: accessibility label for external links, where the argument is the link text // translators: accessibility label for external links, where the argument is the link text
var label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('%s (opens in a new tab)'), text).trim(); var label = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('%s (opens in a new tab)'), text).trim();
format.attributes.target = '_blank'; format.attributes.target = '_blank';
format.attributes.rel = 'noreferrer noopener'; format.attributes.rel = 'noreferrer noopener';
format.attributes['aria-label'] = label; format.attributes['aria-label'] = label;
@ -988,13 +996,13 @@ var LinkEditor = function LinkEditor(_ref2) {
onKeyPress: stopKeyPropagation, onKeyPress: stopKeyPropagation,
onKeyDown: onKeyDown, onKeyDown: onKeyDown,
onSubmit: submitLink onSubmit: submitLink
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_12__["URLInput"], { }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_13__["URLInput"], {
value: value, value: value,
onChange: onChangeInputValue, onChange: onChangeInputValue,
autocompleteRef: autocompleteRef autocompleteRef: autocompleteRef
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], {
icon: "editor-break", icon: "editor-break",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Apply'), label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Apply'),
type: "submit" type: "submit"
})) }))
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */ /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
@ -1005,18 +1013,22 @@ var LinkEditor = function LinkEditor(_ref2) {
var LinkViewer = function LinkViewer(_ref3) { var LinkViewer = function LinkViewer(_ref3) {
var url = _ref3.url, var url = _ref3.url,
editLink = _ref3.editLink; editLink = _ref3.editLink;
var prependedURL = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["prependHTTP"])(url);
var linkClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()('editor-format-toolbar__link-container-value', {
'has-invalid-link': !Object(_utils__WEBPACK_IMPORTED_MODULE_15__["isValidHref"])(prependedURL)
});
return (// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar return (// Disable reason: KeyPress must be suppressed so the block doesn't hide the toolbar
/* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/no-static-element-interactions */
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "editor-format-toolbar__link-container-content", className: "editor-format-toolbar__link-container-content",
onKeyPress: stopKeyPropagation onKeyPress: stopKeyPropagation
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ExternalLink"], { }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ExternalLink"], {
className: "editor-format-toolbar__link-container-value", className: linkClassName,
href: url href: url
}, Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["filterURLForDisplay"])(Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["safeDecodeURI"])(url))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["IconButton"], { }, Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["filterURLForDisplay"])(Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["safeDecodeURI"])(url))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["IconButton"], {
icon: "edit", icon: "edit",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Edit'), label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Edit'),
onClick: editLink onClick: editLink
})) }))
/* eslint-enable jsx-a11y/no-static-element-interactions */ /* eslint-enable jsx-a11y/no-static-element-interactions */
@ -1050,12 +1062,12 @@ function (_Component) {
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(InlineLinkUI, [{ Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(InlineLinkUI, [{
key: "onKeyDown", key: "onKeyDown",
value: function onKeyDown(event) { value: function onKeyDown(event) {
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ESCAPE"]) { if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["ESCAPE"]) {
event.stopPropagation(); event.stopPropagation();
this.resetState(); this.resetState();
} }
if ([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["BACKSPACE"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["ENTER"]].indexOf(event.keyCode) > -1) { if ([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["DOWN"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["UP"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["BACKSPACE"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["ENTER"]].indexOf(event.keyCode) > -1) {
// Stop the key event from propagating up to ObserveTyping.startTypingInTextField. // Stop the key event from propagating up to ObserveTyping.startTypingInTextField.
event.stopPropagation(); event.stopPropagation();
} }
@ -1079,7 +1091,7 @@ function (_Component) {
}); // Apply now if URL is not being edited. }); // Apply now if URL is not being edited.
if (!isShowingInput(this.props, this.state)) { if (!isShowingInput(this.props, this.state)) {
onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(value, createLinkFormat({ onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["applyFormat"])(value, createLinkFormat({
url: url, url: url,
opensInNewWindow: opensInNewWindow, opensInNewWindow: opensInNewWindow,
text: value.text text: value.text
@ -1105,7 +1117,7 @@ function (_Component) {
var _this$state = this.state, var _this$state = this.state,
inputValue = _this$state.inputValue, inputValue = _this$state.inputValue,
opensInNewWindow = _this$state.opensInNewWindow; opensInNewWindow = _this$state.opensInNewWindow;
var url = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["prependHTTP"])(inputValue); var url = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_11__["prependHTTP"])(inputValue);
var format = createLinkFormat({ var format = createLinkFormat({
url: url, url: url,
opensInNewWindow: opensInNewWindow, opensInNewWindow: opensInNewWindow,
@ -1113,21 +1125,23 @@ function (_Component) {
}); });
event.preventDefault(); event.preventDefault();
if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["isCollapsed"])(value) && !isActive) { if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["isCollapsed"])(value) && !isActive) {
var toInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["create"])({ var toInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["applyFormat"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["create"])({
text: url text: url
}), format, 0, url.length); }), format, 0, url.length);
onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["insert"])(value, toInsert)); onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["insert"])(value, toInsert));
} else { } else {
onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_11__["applyFormat"])(value, format)); onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_12__["applyFormat"])(value, format));
} }
this.resetState(); this.resetState();
if (isActive) { if (!Object(_utils__WEBPACK_IMPORTED_MODULE_15__["isValidHref"])(url)) {
speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link edited.'), 'assertive'); speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');
} else if (isActive) {
speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Link edited.'), 'assertive');
} else { } else {
speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Link added.'), 'assertive'); speak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Link inserted'), 'assertive');
} }
} }
}, { }, {
@ -1172,16 +1186,16 @@ function (_Component) {
inputValue = _this$state2.inputValue, inputValue = _this$state2.inputValue,
opensInNewWindow = _this$state2.opensInNewWindow; opensInNewWindow = _this$state2.opensInNewWindow;
var showInput = isShowingInput(this.props, this.state); var showInput = isShowingInput(this.props, this.state);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_positioned_at_selection__WEBPACK_IMPORTED_MODULE_13__["default"], { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_positioned_at_selection__WEBPACK_IMPORTED_MODULE_14__["default"], {
key: "".concat(value.start).concat(value.end) key: "".concat(value.start).concat(value.end)
/* Used to force rerender on selection change */ /* Used to force rerender on selection change */
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_12__["URLPopover"], { }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_13__["URLPopover"], {
onClickOutside: this.onClickOutside, onClickOutside: this.onClickOutside,
focusOnMount: showInput ? 'firstElement' : false, focusOnMount: showInput ? 'firstElement' : false,
renderSettings: function renderSettings() { renderSettings: function renderSettings() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["ToggleControl"], { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["ToggleControl"], {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])('Open in New Tab'), label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Open in New Tab'),
checked: opensInNewWindow, checked: opensInNewWindow,
onChange: _this2.setLinkTarget onChange: _this2.setLinkTarget
}); });
@ -1226,7 +1240,7 @@ function (_Component) {
return InlineLinkUI; return InlineLinkUI;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__["withSpokenMessages"])(InlineLinkUI)); /* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__["withSpokenMessages"])(InlineLinkUI));
/***/ }), /***/ }),
@ -1339,6 +1353,92 @@ function (_Component) {
/* harmony default export */ __webpack_exports__["default"] = (PositionedAtSelection); /* harmony default export */ __webpack_exports__["default"] = (PositionedAtSelection);
/***/ }),
/***/ "./node_modules/@wordpress/format-library/build-module/link/utils.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/format-library/build-module/link/utils.js ***!
\***************************************************************************/
/*! exports provided: isValidHref */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidHref", function() { return isValidHref; });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Check for issues with the provided href.
*
* @param {string} href The href.
*
* @return {boolean} Is the href invalid?
*/
function isValidHref(href) {
if (!href) {
return false;
}
var trimmedHref = href.trim();
if (!trimmedHref) {
return false;
} // Does the href start with something that looks like a url protocol?
if (/^\S+:/.test(trimmedHref)) {
var protocol = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["getProtocol"])(trimmedHref);
if (!Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidProtocol"])(protocol)) {
return false;
}
var authority = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["getAuthority"])(trimmedHref);
if (!Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidAuthority"])(authority)) {
return false;
}
var path = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["getPath"])(trimmedHref);
if (path && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidPath"])(path)) {
return false;
}
var queryString = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["getQueryString"])(trimmedHref);
if (queryString && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidQueryString"])(queryString)) {
return false;
}
var fragment = Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["getFragment"])(trimmedHref);
if (fragment && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidFragment"])(trimmedHref)) {
return false;
}
} // Validate anchor links.
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["startsWith"])(trimmedHref, '#') && !Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["isValidFragment"])(trimmedHref)) {
return false;
}
return true;
}
/***/ }), /***/ }),
/***/ "./node_modules/@wordpress/format-library/build-module/strikethrough/index.js": /***/ "./node_modules/@wordpress/format-library/build-module/strikethrough/index.js":
@ -1357,6 +1457,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__);
/** /**
@ -1365,19 +1467,17 @@ __webpack_require__.r(__webpack_exports__);
var name = 'core/strikethrough'; var name = 'core/strikethrough';
var strikethrough = { var strikethrough = {
name: name, name: name,
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Strikethrough'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Strikethrough'),
match: { tagName: 'del',
tagName: 'del' className: null,
},
edit: function edit(_ref) { edit: function edit(_ref) {
var isActive = _ref.isActive, var isActive = _ref.isActive,
value = _ref.value, value = _ref.value,
onChange = _ref.onChange, onChange = _ref.onChange;
ToolbarButton = _ref.ToolbarButton,
Shortcut = _ref.Shortcut;
var onToggle = function onToggle() { var onToggle = function onToggle() {
return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, { return onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__["toggleFormat"])(value, {
@ -1385,11 +1485,11 @@ var strikethrough = {
})); }));
}; };
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Shortcut, { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextShortcut"], {
type: "access", type: "access",
character: "d", character: "d",
onUse: onToggle onUse: onToggle
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(ToolbarButton, { }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__["RichTextToolbarButton"], {
name: "strikethrough", name: "strikethrough",
icon: "editor-strikethrough", icon: "editor-strikethrough",
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Strikethrough'), title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Strikethrough'),
@ -1402,6 +1502,68 @@ var strikethrough = {
}; };
/***/ }),
/***/ "./node_modules/classnames/index.js":
/*!******************************************!*\
!*** ./node_modules/classnames/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg) && arg.length) {
var inner = classNames.apply(null, arg);
if (inner) {
classes.push(inner);
}
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if ( true && module.exports) {
classNames.default = classNames;
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}());
/***/ }), /***/ }),
/***/ "@wordpress/components": /***/ "@wordpress/components":
@ -1490,6 +1652,17 @@ var strikethrough = {
(function() { module.exports = this["wp"]["url"]; }()); (function() { module.exports = this["wp"]["url"]; }());
/***/ }),
/***/ "lodash":
/*!*************************!*\
!*** external "lodash" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["lodash"]; }());
/***/ }) /***/ })
/******/ }); /******/ });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -136,6 +136,36 @@ function _defineProperty(obj, key, value) {
/***/ }), /***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
\************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; });
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js": /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
/*!********************************************************************!*\ /*!********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***! !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
@ -473,18 +503,17 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-empty */ "./node_modules/@wordpress/rich-text/build-module/is-empty.js"); /* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-empty */ "./node_modules/@wordpress/rich-text/build-module/is-empty.js");
/* harmony import */ var _is_format_equal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./is-format-equal */ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js"); /* harmony import */ var _is_format_equal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./is-format-equal */ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js");
/* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-element */ "./node_modules/@wordpress/rich-text/build-module/create-element.js"); /* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-element */ "./node_modules/@wordpress/rich-text/build-module/create-element.js");
/* harmony import */ var _get_format_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./get-format-types */ "./node_modules/@wordpress/rich-text/build-module/get-format-types.js"); /* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/** /**
* External dependencies * WordPress dependencies
*/ */
/** /**
@ -495,7 +524,6 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* Browser dependencies * Browser dependencies
*/ */
@ -522,10 +550,24 @@ function simpleFindKey(object, value) {
function toFormat(_ref) { function toFormat(_ref) {
var type = _ref.type, var type = _ref.type,
attributes = _ref.attributes; attributes = _ref.attributes;
var formatType = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(Object(_get_format_types__WEBPACK_IMPORTED_MODULE_6__["getFormatTypes"])(), function (_ref2) { var formatType;
var match = _ref2.match;
return type === match.tagName; if (attributes && attributes.class) {
}); formatType = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/rich-text').getFormatTypeForClassName(attributes.class);
if (formatType) {
// Preserve any additional classes.
attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
if (!attributes.class) {
delete attributes.class;
}
}
}
if (!formatType) {
formatType = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/rich-text').getFormatTypeForBareElement(type);
}
if (!formatType) { if (!formatType) {
return attributes ? { return attributes ? {
@ -536,6 +578,10 @@ function toFormat(_ref) {
}; };
} }
if (formatType.__experimentalCreatePrepareEditableTree) {
return null;
}
if (!attributes) { if (!attributes) {
return { return {
type: formatType.name type: formatType.name
@ -592,17 +638,17 @@ function toFormat(_ref) {
function create() { function create() {
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
element = _ref3.element, element = _ref2.element,
text = _ref3.text, text = _ref2.text,
html = _ref3.html, html = _ref2.html,
range = _ref3.range, range = _ref2.range,
multilineTag = _ref3.multilineTag, multilineTag = _ref2.multilineTag,
multilineWrapperTags = _ref3.multilineWrapperTags, multilineWrapperTags = _ref2.multilineWrapperTags,
removeNode = _ref3.removeNode, removeNode = _ref2.removeNode,
unwrapNode = _ref3.unwrapNode, unwrapNode = _ref2.unwrapNode,
filterString = _ref3.filterString, filterString = _ref2.filterString,
removeAttribute = _ref3.removeAttribute; removeAttribute = _ref2.removeAttribute;
if (typeof text === 'string' && text.length > 0) { if (typeof text === 'string' && text.length > 0) {
return { return {
@ -747,17 +793,17 @@ function filterRange(node, range, filter) {
*/ */
function createFromElement(_ref4) { function createFromElement(_ref3) {
var element = _ref4.element, var element = _ref3.element,
range = _ref4.range, range = _ref3.range,
multilineTag = _ref4.multilineTag, multilineTag = _ref3.multilineTag,
multilineWrapperTags = _ref4.multilineWrapperTags, multilineWrapperTags = _ref3.multilineWrapperTags,
_ref4$currentWrapperT = _ref4.currentWrapperTags, _ref3$currentWrapperT = _ref3.currentWrapperTags,
currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT, currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
removeNode = _ref4.removeNode, removeNode = _ref3.removeNode,
unwrapNode = _ref4.unwrapNode, unwrapNode = _ref3.unwrapNode,
filterString = _ref4.filterString, filterString = _ref3.filterString,
removeAttribute = _ref4.removeAttribute; removeAttribute = _ref3.removeAttribute;
var accumulator = createEmptyValue(); var accumulator = createEmptyValue();
if (!element) { if (!element) {
@ -830,12 +876,15 @@ function createFromElement(_ref4) {
element: node, element: node,
removeAttribute: removeAttribute removeAttribute: removeAttribute
}) })
}); // Reuse the last format if it's equal. });
if (Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_4__["isFormatEqual"])(newFormat, lastFormat)) { if (newFormat) {
format = lastFormat; // Reuse the last format if it's equal.
} else { if (Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_4__["isFormatEqual"])(newFormat, lastFormat)) {
format = newFormat; format = lastFormat;
} else {
format = newFormat;
}
} }
} }
@ -877,7 +926,7 @@ function createFromElement(_ref4) {
if (format && format.attributes && text.length === 0) { if (format && format.attributes && text.length === 0) {
format.object = true; format.object = true;
accumulator.text += _special_characters__WEBPACK_IMPORTED_MODULE_7__["OBJECT_REPLACEMENT_CHARACTER"]; accumulator.text += _special_characters__WEBPACK_IMPORTED_MODULE_6__["OBJECT_REPLACEMENT_CHARACTER"];
if (formats[start]) { if (formats[start]) {
formats[start].unshift(format); formats[start].unshift(format);
@ -941,17 +990,17 @@ function createFromElement(_ref4) {
*/ */
function createFromMultilineElement(_ref5) { function createFromMultilineElement(_ref4) {
var element = _ref5.element, var element = _ref4.element,
range = _ref5.range, range = _ref4.range,
multilineTag = _ref5.multilineTag, multilineTag = _ref4.multilineTag,
multilineWrapperTags = _ref5.multilineWrapperTags, multilineWrapperTags = _ref4.multilineWrapperTags,
removeNode = _ref5.removeNode, removeNode = _ref4.removeNode,
unwrapNode = _ref5.unwrapNode, unwrapNode = _ref4.unwrapNode,
filterString = _ref5.filterString, filterString = _ref4.filterString,
removeAttribute = _ref5.removeAttribute, removeAttribute = _ref4.removeAttribute,
_ref5$currentWrapperT = _ref5.currentWrapperTags, _ref4$currentWrapperT = _ref4.currentWrapperTags,
currentWrapperTags = _ref5$currentWrapperT === void 0 ? [] : _ref5$currentWrapperT; currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT;
var accumulator = createEmptyValue(); var accumulator = createEmptyValue();
if (!element || !element.hasChildNodes()) { if (!element || !element.hasChildNodes()) {
@ -998,7 +1047,7 @@ function createFromMultilineElement(_ref5) {
if (index !== 0 || currentWrapperTags.length > 0) { if (index !== 0 || currentWrapperTags.length > 0) {
var formats = currentWrapperTags.length > 0 ? [currentWrapperTags] : [,]; var formats = currentWrapperTags.length > 0 ? [currentWrapperTags] : [,];
accumulator.formats = accumulator.formats.concat(formats); accumulator.formats = accumulator.formats.concat(formats);
accumulator.text += _special_characters__WEBPACK_IMPORTED_MODULE_7__["LINE_SEPARATOR"]; accumulator.text += _special_characters__WEBPACK_IMPORTED_MODULE_6__["LINE_SEPARATOR"];
} }
accumulateSelection(accumulator, node, range, value); accumulateSelection(accumulator, node, range, value);
@ -1021,9 +1070,9 @@ function createFromMultilineElement(_ref5) {
*/ */
function getAttributes(_ref6) { function getAttributes(_ref5) {
var element = _ref6.element, var element = _ref5.element,
removeAttribute = _ref6.removeAttribute; removeAttribute = _ref5.removeAttribute;
if (!element.hasAttributes()) { if (!element.hasAttributes()) {
return; return;
@ -1124,35 +1173,6 @@ function getFormatType(name) {
} }
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-format-types.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-format-types.js ***!
\****************************************************************************/
/*! exports provided: getFormatTypes */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypes", function() { return getFormatTypes; });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
/**
* WordPress dependencies
*/
/**
* Returns all registered formats.
*
* @return {Array} Format settings.
*/
function getFormatTypes() {
return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["select"])('core/rich-text').getFormatTypes();
}
/***/ }), /***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-selection-end.js": /***/ "./node_modules/@wordpress/rich-text/build-module/get-selection-end.js":
@ -1239,7 +1259,7 @@ function getTextContent(_ref) {
/*!*****************************************************************!*\ /*!*****************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/index.js ***! !*** ./node_modules/@wordpress/rich-text/build-module/index.js ***!
\*****************************************************************/ \*****************************************************************/
/*! exports provided: applyFormat, charAt, concat, create, getActiveFormat, getFormatType, getFormatTypes, getSelectionEnd, getSelectionStart, getTextContent, isCollapsed, isEmpty, isEmptyLine, join, registerFormatType, removeFormat, remove, replace, insert, insertLineSeparator, insertObject, slice, split, apply, unstableToDom, toHTMLString, toggleFormat, LINE_SEPARATOR, unregisterFormatType */ /*! exports provided: applyFormat, charAt, concat, create, getActiveFormat, getSelectionEnd, getSelectionStart, getTextContent, isCollapsed, isEmpty, isEmptyLine, join, registerFormatType, removeFormat, remove, replace, insert, insertLineSeparator, insertObject, slice, split, apply, unstableToDom, toHTMLString, toggleFormat, LINE_SEPARATOR, unregisterFormatType */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
@ -1260,77 +1280,69 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _get_active_format__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./get-active-format */ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js"); /* harmony import */ var _get_active_format__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./get-active-format */ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return _get_active_format__WEBPACK_IMPORTED_MODULE_5__["getActiveFormat"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return _get_active_format__WEBPACK_IMPORTED_MODULE_5__["getActiveFormat"]; });
/* harmony import */ var _get_format_type__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./get-format-type */ "./node_modules/@wordpress/rich-text/build-module/get-format-type.js"); /* harmony import */ var _get_selection_end__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./get-selection-end */ "./node_modules/@wordpress/rich-text/build-module/get-selection-end.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFormatType", function() { return _get_format_type__WEBPACK_IMPORTED_MODULE_6__["getFormatType"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSelectionEnd", function() { return _get_selection_end__WEBPACK_IMPORTED_MODULE_6__["getSelectionEnd"]; });
/* harmony import */ var _get_format_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-format-types */ "./node_modules/@wordpress/rich-text/build-module/get-format-types.js"); /* harmony import */ var _get_selection_start__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-selection-start */ "./node_modules/@wordpress/rich-text/build-module/get-selection-start.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFormatTypes", function() { return _get_format_types__WEBPACK_IMPORTED_MODULE_7__["getFormatTypes"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSelectionStart", function() { return _get_selection_start__WEBPACK_IMPORTED_MODULE_7__["getSelectionStart"]; });
/* harmony import */ var _get_selection_end__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./get-selection-end */ "./node_modules/@wordpress/rich-text/build-module/get-selection-end.js"); /* harmony import */ var _get_text_content__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./get-text-content */ "./node_modules/@wordpress/rich-text/build-module/get-text-content.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSelectionEnd", function() { return _get_selection_end__WEBPACK_IMPORTED_MODULE_8__["getSelectionEnd"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTextContent", function() { return _get_text_content__WEBPACK_IMPORTED_MODULE_8__["getTextContent"]; });
/* harmony import */ var _get_selection_start__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./get-selection-start */ "./node_modules/@wordpress/rich-text/build-module/get-selection-start.js"); /* harmony import */ var _is_collapsed__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./is-collapsed */ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSelectionStart", function() { return _get_selection_start__WEBPACK_IMPORTED_MODULE_9__["getSelectionStart"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return _is_collapsed__WEBPACK_IMPORTED_MODULE_9__["isCollapsed"]; });
/* harmony import */ var _get_text_content__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./get-text-content */ "./node_modules/@wordpress/rich-text/build-module/get-text-content.js"); /* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./is-empty */ "./node_modules/@wordpress/rich-text/build-module/is-empty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTextContent", function() { return _get_text_content__WEBPACK_IMPORTED_MODULE_10__["getTextContent"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_10__["isEmpty"]; });
/* harmony import */ var _is_collapsed__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./is-collapsed */ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmptyLine", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_10__["isEmptyLine"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return _is_collapsed__WEBPACK_IMPORTED_MODULE_11__["isCollapsed"]; });
/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./is-empty */ "./node_modules/@wordpress/rich-text/build-module/is-empty.js"); /* harmony import */ var _join__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./join */ "./node_modules/@wordpress/rich-text/build-module/join.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_12__["isEmpty"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join__WEBPACK_IMPORTED_MODULE_11__["join"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmptyLine", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_12__["isEmptyLine"]; }); /* harmony import */ var _register_format_type__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./register-format-type */ "./node_modules/@wordpress/rich-text/build-module/register-format-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return _register_format_type__WEBPACK_IMPORTED_MODULE_12__["registerFormatType"]; });
/* harmony import */ var _join__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./join */ "./node_modules/@wordpress/rich-text/build-module/join.js"); /* harmony import */ var _remove_format__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./remove-format */ "./node_modules/@wordpress/rich-text/build-module/remove-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join__WEBPACK_IMPORTED_MODULE_13__["join"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFormat", function() { return _remove_format__WEBPACK_IMPORTED_MODULE_13__["removeFormat"]; });
/* harmony import */ var _register_format_type__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./register-format-type */ "./node_modules/@wordpress/rich-text/build-module/register-format-type.js"); /* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./remove */ "./node_modules/@wordpress/rich-text/build-module/remove.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return _register_format_type__WEBPACK_IMPORTED_MODULE_14__["registerFormatType"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove__WEBPACK_IMPORTED_MODULE_14__["remove"]; });
/* harmony import */ var _remove_format__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./remove-format */ "./node_modules/@wordpress/rich-text/build-module/remove-format.js"); /* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./replace */ "./node_modules/@wordpress/rich-text/build-module/replace.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFormat", function() { return _remove_format__WEBPACK_IMPORTED_MODULE_15__["removeFormat"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace__WEBPACK_IMPORTED_MODULE_15__["replace"]; });
/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./remove */ "./node_modules/@wordpress/rich-text/build-module/remove.js"); /* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove__WEBPACK_IMPORTED_MODULE_16__["remove"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insert", function() { return _insert__WEBPACK_IMPORTED_MODULE_16__["insert"]; });
/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./replace */ "./node_modules/@wordpress/rich-text/build-module/replace.js"); /* harmony import */ var _insert_line_separator__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./insert-line-separator */ "./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace__WEBPACK_IMPORTED_MODULE_17__["replace"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertLineSeparator", function() { return _insert_line_separator__WEBPACK_IMPORTED_MODULE_17__["insertLineSeparator"]; });
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js"); /* harmony import */ var _insert_object__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./insert-object */ "./node_modules/@wordpress/rich-text/build-module/insert-object.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insert", function() { return _insert__WEBPACK_IMPORTED_MODULE_18__["insert"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertObject", function() { return _insert_object__WEBPACK_IMPORTED_MODULE_18__["insertObject"]; });
/* harmony import */ var _insert_line_separator__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./insert-line-separator */ "./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js"); /* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./slice */ "./node_modules/@wordpress/rich-text/build-module/slice.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertLineSeparator", function() { return _insert_line_separator__WEBPACK_IMPORTED_MODULE_19__["insertLineSeparator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice__WEBPACK_IMPORTED_MODULE_19__["slice"]; });
/* harmony import */ var _insert_object__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./insert-object */ "./node_modules/@wordpress/rich-text/build-module/insert-object.js"); /* harmony import */ var _split__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./split */ "./node_modules/@wordpress/rich-text/build-module/split.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertObject", function() { return _insert_object__WEBPACK_IMPORTED_MODULE_20__["insertObject"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split__WEBPACK_IMPORTED_MODULE_20__["split"]; });
/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./slice */ "./node_modules/@wordpress/rich-text/build-module/slice.js"); /* harmony import */ var _to_dom__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./to-dom */ "./node_modules/@wordpress/rich-text/build-module/to-dom.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice__WEBPACK_IMPORTED_MODULE_21__["slice"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return _to_dom__WEBPACK_IMPORTED_MODULE_21__["apply"]; });
/* harmony import */ var _split__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./split */ "./node_modules/@wordpress/rich-text/build-module/split.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unstableToDom", function() { return _to_dom__WEBPACK_IMPORTED_MODULE_21__["toDom"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split__WEBPACK_IMPORTED_MODULE_22__["split"]; });
/* harmony import */ var _to_dom__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./to-dom */ "./node_modules/@wordpress/rich-text/build-module/to-dom.js"); /* harmony import */ var _to_html_string__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./to-html-string */ "./node_modules/@wordpress/rich-text/build-module/to-html-string.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return _to_dom__WEBPACK_IMPORTED_MODULE_23__["apply"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return _to_html_string__WEBPACK_IMPORTED_MODULE_22__["toHTMLString"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unstableToDom", function() { return _to_dom__WEBPACK_IMPORTED_MODULE_23__["toDom"]; }); /* harmony import */ var _toggle_format__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./toggle-format */ "./node_modules/@wordpress/rich-text/build-module/toggle-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return _toggle_format__WEBPACK_IMPORTED_MODULE_23__["toggleFormat"]; });
/* harmony import */ var _to_html_string__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./to-html-string */ "./node_modules/@wordpress/rich-text/build-module/to-html-string.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return _to_html_string__WEBPACK_IMPORTED_MODULE_24__["toHTMLString"]; });
/* harmony import */ var _toggle_format__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./toggle-format */ "./node_modules/@wordpress/rich-text/build-module/toggle-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return _toggle_format__WEBPACK_IMPORTED_MODULE_25__["toggleFormat"]; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LINE_SEPARATOR", function() { return _special_characters__WEBPACK_IMPORTED_MODULE_26__["LINE_SEPARATOR"]; });
/* harmony import */ var _unregister_format_type__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unregister-format-type */ "./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return _unregister_format_type__WEBPACK_IMPORTED_MODULE_27__["unregisterFormatType"]; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LINE_SEPARATOR", function() { return _special_characters__WEBPACK_IMPORTED_MODULE_24__["LINE_SEPARATOR"]; });
/* harmony import */ var _unregister_format_type__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./unregister-format-type */ "./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return _unregister_format_type__WEBPACK_IMPORTED_MODULE_25__["unregisterFormatType"]; });
@ -1439,7 +1451,7 @@ var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
* removed. Indices are retrieved from the selection if none are provided. * removed. Indices are retrieved from the selection if none are provided.
* *
* @param {Object} value Value to modify. * @param {Object} value Value to modify.
* @param {string} formatToInsert Format to insert as object. * @param {Object} formatToInsert Format to insert as object.
* @param {number} startIndex Start index. * @param {number} startIndex Start index.
* @param {number} endIndex End index. * @param {number} endIndex End index.
* *
@ -1796,16 +1808,21 @@ function normaliseFormats(_ref) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return registerFormatType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return registerFormatType; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js"); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__);
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
@ -1824,7 +1841,7 @@ __webpack_require__.r(__webpack_exports__);
*/ */
function registerFormatType(name, settings) { function registerFormatType(name, settings) {
settings = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({ settings = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_3__["default"])({
name: name name: name
}, settings); }, settings);
@ -1838,16 +1855,42 @@ function registerFormatType(name, settings) {
return; return;
} }
if (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["select"])('core/rich-text').getFormatType(settings.name)) { if (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["select"])('core/rich-text').getFormatType(settings.name)) {
window.console.error('Format "' + settings.name + '" is already registered.'); window.console.error('Format "' + settings.name + '" is already registered.');
return; return;
} }
if (!settings || !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(settings.edit)) { if (typeof settings.tagName !== 'string' || settings.tagName === '') {
window.console.error('The "edit" property must be specified and must be a valid function.'); window.console.error('Format tag names must be a string.');
return; return;
} }
if ((typeof settings.className !== 'string' || settings.className === '') && settings.className !== null) {
window.console.error('Format class names must be a string, or null to handle bare elements.');
return;
}
if (!/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(settings.className)) {
window.console.error('A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.');
return;
}
if (settings.className === null) {
var formatTypeForBareElement = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["select"])('core/rich-text').getFormatTypeForBareElement(settings.tagName);
if (formatTypeForBareElement) {
window.console.error("Format \"".concat(formatTypeForBareElement.name, "\" is already registered to handle bare tag name \"").concat(settings.tagName, "\"."));
return;
}
} else {
var formatTypeForClassName = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["select"])('core/rich-text').getFormatTypeForClassName(settings.className);
if (formatTypeForClassName) {
window.console.error("Format \"".concat(formatTypeForClassName.name, "\" is already registered to handle class name \"").concat(settings.className, "\"."));
return;
}
}
if (!('title' in settings) || settings.title === '') { if (!('title' in settings) || settings.title === '') {
window.console.error('The format "' + settings.name + '" must have a title.'); window.console.error('The format "' + settings.name + '" must have a title.');
return; return;
@ -1863,7 +1906,28 @@ function registerFormatType(name, settings) {
return; return;
} }
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["dispatch"])('core/rich-text').addFormatTypes(settings); Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["dispatch"])('core/rich-text').addFormatTypes(settings);
if (settings.__experimentalCreatePrepareEditableTree && settings.__experimentalGetPropsForEditableTreePreparation) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_6__["addFilter"])('experimentalRichText', name, function (OriginalComponent) {
return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["withSelect"])(function (sel, _ref) {
var clientId = _ref.clientId,
identifier = _ref.identifier;
return Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__["default"])({}, "format_".concat(name), settings.__experimentalGetPropsForEditableTreePreparation(sel, {
richTextIdentifier: identifier,
blockClientId: clientId
}));
})(function (props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
prepareEditableTree: Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(props.prepareEditableTree || []).concat([settings.__experimentalCreatePrepareEditableTree(props["format_".concat(name)], {
richTextIdentifier: props.identifier,
blockClientId: props.clientId
})])
}));
});
});
}
return settings; return settings;
} }
@ -2377,18 +2441,23 @@ function formatTypes() {
/*!***************************************************************************!*\ /*!***************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/store/selectors.js ***! !*** ./node_modules/@wordpress/rich-text/build-module/store/selectors.js ***!
\***************************************************************************/ \***************************************************************************/
/*! exports provided: getFormatTypes, getFormatType */ /*! exports provided: getFormatTypes, getFormatType, getFormatTypeForBareElement, getFormatTypeForClassName */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypes", function() { return getFormatTypes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypes", function() { return getFormatTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatType", function() { return getFormatType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatType", function() { return getFormatType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypeForBareElement", function() { return getFormatTypeForBareElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypeForClassName", function() { return getFormatTypeForClassName; });
/* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js"); /* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/** /**
* External dependencies * External dependencies
*/ */
/** /**
* Returns all the available format types. * Returns all the available format types.
* *
@ -2414,6 +2483,42 @@ var getFormatTypes = Object(rememo__WEBPACK_IMPORTED_MODULE_0__["default"])(func
function getFormatType(state, name) { function getFormatType(state, name) {
return state.formatTypes[name]; return state.formatTypes[name];
} }
/**
* Gets the format type, if any, that can handle a bare element (without a
* data-format-type attribute), given the tag name of this element.
*
* @param {Object} state Data state.
* @param {string} bareElementTagName The tag name of the element to find a
* format type for.
* @return {?Object} Format type.
*/
function getFormatTypeForBareElement(state, bareElementTagName) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(getFormatTypes(state), function (_ref) {
var tagName = _ref.tagName;
return bareElementTagName === tagName;
});
}
/**
* Gets the format type, if any, that can handle an element, given its classes.
*
* @param {Object} state Data state.
* @param {string} elementClassName The classes of the element to find a format
* type for.
* @return {?Object} Format type.
*/
function getFormatTypeForClassName(state, elementClassName) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(getFormatTypes(state), function (_ref2) {
var className = _ref2.className;
if (className === null) {
return false;
}
return " ".concat(elementClassName, " ").indexOf(" ".concat(className, " ")) >= 0;
});
}
/***/ }), /***/ }),
@ -2431,8 +2536,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyValue", function() { return applyValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyValue", function() { return applyValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applySelection", function() { return applySelection; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applySelection", function() { return applySelection; });
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _to_tree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./to-tree */ "./node_modules/@wordpress/rich-text/build-module/to-tree.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _to_tree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./to-tree */ "./node_modules/@wordpress/rich-text/build-module/to-tree.js");
/** /**
@ -2465,7 +2572,7 @@ function createPathToNode(node, rootNode, path) {
i++; i++;
} }
path = [i].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(path)); path = [i].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(path));
if (parentNode !== rootNode) { if (parentNode !== rootNode) {
path = createPathToNode(parentNode, rootNode, path); path = createPathToNode(parentNode, rootNode, path);
@ -2484,7 +2591,7 @@ function createPathToNode(node, rootNode, path) {
function getNodeByPath(node, path) { function getNodeByPath(node, path) {
path = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(path); path = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(path);
while (node && path.length > 1) { while (node && path.length > 1) {
node = node.childNodes[path.shift()]; node = node.childNodes[path.shift()];
@ -2581,15 +2688,26 @@ function padEmptyLines(_ref5) {
} }
} }
function prepareFormats() {
var prepareEditableTree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var value = arguments.length > 1 ? arguments[1] : undefined;
return prepareEditableTree.reduce(function (accumlator, fn) {
return fn(accumlator, value.text);
}, value.formats);
}
function toDom(_ref6) { function toDom(_ref6) {
var value = _ref6.value, var value = _ref6.value,
multilineTag = _ref6.multilineTag, multilineTag = _ref6.multilineTag,
multilineWrapperTags = _ref6.multilineWrapperTags, multilineWrapperTags = _ref6.multilineWrapperTags,
createLinePadding = _ref6.createLinePadding; createLinePadding = _ref6.createLinePadding,
prepareEditableTree = _ref6.prepareEditableTree;
var startPath = []; var startPath = [];
var endPath = []; var endPath = [];
var tree = Object(_to_tree__WEBPACK_IMPORTED_MODULE_1__["toTree"])({ var tree = Object(_to_tree__WEBPACK_IMPORTED_MODULE_2__["toTree"])({
value: value, value: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
formats: prepareFormats(prepareEditableTree, value)
}),
multilineTag: multilineTag, multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags, multilineWrapperTags: multilineWrapperTags,
createEmpty: createEmpty, createEmpty: createEmpty,
@ -2641,14 +2759,16 @@ function apply(_ref7) {
current = _ref7.current, current = _ref7.current,
multilineTag = _ref7.multilineTag, multilineTag = _ref7.multilineTag,
multilineWrapperTags = _ref7.multilineWrapperTags, multilineWrapperTags = _ref7.multilineWrapperTags,
createLinePadding = _ref7.createLinePadding; createLinePadding = _ref7.createLinePadding,
prepareEditableTree = _ref7.prepareEditableTree;
// Construct a new element tree in memory. // Construct a new element tree in memory.
var _toDom = toDom({ var _toDom = toDom({
value: value, value: value,
multilineTag: multilineTag, multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags, multilineWrapperTags: multilineWrapperTags,
createLinePadding: createLinePadding createLinePadding: createLinePadding,
prepareEditableTree: prepareEditableTree
}), }),
body = _toDom.body, body = _toDom.body,
selection = _toDom.selection; selection = _toDom.selection;
@ -2879,8 +2999,10 @@ function createChildrenHTML() {
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toTree", function() { return toTree; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toTree", function() { return toTree; });
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _get_format_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-format-type */ "./node_modules/@wordpress/rich-text/build-module/get-format-type.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js"); /* harmony import */ var _get_format_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-format-type */ "./node_modules/@wordpress/rich-text/build-module/get-format-type.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/** /**
@ -2892,8 +3014,9 @@ __webpack_require__.r(__webpack_exports__);
function fromFormat(_ref) { function fromFormat(_ref) {
var type = _ref.type, var type = _ref.type,
attributes = _ref.attributes, attributes = _ref.attributes,
unregisteredAttributes = _ref.unregisteredAttributes,
object = _ref.object; object = _ref.object;
var formatType = Object(_get_format_type__WEBPACK_IMPORTED_MODULE_1__["getFormatType"])(type); var formatType = Object(_get_format_type__WEBPACK_IMPORTED_MODULE_2__["getFormatType"])(type);
if (!formatType) { if (!formatType) {
return { return {
@ -2903,14 +3026,7 @@ function fromFormat(_ref) {
}; };
} }
if (!attributes) { var elementAttributes = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, unregisteredAttributes);
return {
type: formatType.match.tagName,
object: formatType.object
};
}
var elementAttributes = {};
for (var name in attributes) { for (var name in attributes) {
var key = formatType.attributes[name]; var key = formatType.attributes[name];
@ -2922,8 +3038,16 @@ function fromFormat(_ref) {
} }
} }
if (formatType.className) {
if (elementAttributes.class) {
elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
} else {
elementAttributes.class = formatType.className;
}
}
return { return {
type: formatType.match.tagName, type: formatType.tagName,
object: formatType.object, object: formatType.object,
attributes: elementAttributes attributes: elementAttributes
}; };
@ -2932,7 +3056,8 @@ function fromFormat(_ref) {
function toTree(_ref2) { function toTree(_ref2) {
var value = _ref2.value, var value = _ref2.value,
multilineTag = _ref2.multilineTag, multilineTag = _ref2.multilineTag,
multilineWrapperTags = _ref2.multilineWrapperTags, _ref2$multilineWrappe = _ref2.multilineWrapperTags,
multilineWrapperTags = _ref2$multilineWrappe === void 0 ? [] : _ref2$multilineWrappe,
createEmpty = _ref2.createEmpty, createEmpty = _ref2.createEmpty,
append = _ref2.append, append = _ref2.append,
getLastChild = _ref2.getLastChild, getLastChild = _ref2.getLastChild,
@ -2977,7 +3102,7 @@ function toTree(_ref2) {
pointer = append(parent, fromFormat(formatPlaceholder.format)); pointer = append(parent, fromFormat(formatPlaceholder.format));
} }
pointer = append(pointer, _special_characters__WEBPACK_IMPORTED_MODULE_2__["ZERO_WIDTH_NO_BREAK_SPACE"]); pointer = append(pointer, _special_characters__WEBPACK_IMPORTED_MODULE_3__["ZERO_WIDTH_NO_BREAK_SPACE"]);
} }
return pointer; return pointer;
@ -2988,9 +3113,9 @@ function toTree(_ref2) {
var characterFormats = formats[i]; // Set multiline tags in queue for building the tree. var characterFormats = formats[i]; // Set multiline tags in queue for building the tree.
if (multilineTag) { if (multilineTag) {
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"]) { if (character === _special_characters__WEBPACK_IMPORTED_MODULE_3__["LINE_SEPARATOR"]) {
characterFormats = lastSeparatorFormats = (characterFormats || []).reduce(function (accumulator, format) { characterFormats = lastSeparatorFormats = (characterFormats || []).reduce(function (accumulator, format) {
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"] && multilineWrapperTags.indexOf(format.type) !== -1) { if (character === _special_characters__WEBPACK_IMPORTED_MODULE_3__["LINE_SEPARATOR"] && multilineWrapperTags.indexOf(format.type) !== -1) {
accumulator.push(format); accumulator.push(format);
accumulator.push(multilineFormat); accumulator.push(multilineFormat);
} }
@ -3004,7 +3129,7 @@ function toTree(_ref2) {
var pointer = getLastChild(tree); // Set selection for the start of line. var pointer = getLastChild(tree); // Set selection for the start of line.
if (lastCharacter === _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"]) { if (lastCharacter === _special_characters__WEBPACK_IMPORTED_MODULE_3__["LINE_SEPARATOR"]) {
var node = pointer; var node = pointer;
while (!isText(node)) { while (!isText(node)) {
@ -3024,31 +3149,24 @@ function toTree(_ref2) {
characterFormats.forEach(function (format, formatIndex) { characterFormats.forEach(function (format, formatIndex) {
if (pointer && lastCharacterFormats && format === lastCharacterFormats[formatIndex] && ( // Do not reuse the last element if the character is a if (pointer && lastCharacterFormats && format === lastCharacterFormats[formatIndex] && ( // Do not reuse the last element if the character is a
// line separator. // line separator.
character !== _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"] || characterFormats.length - 1 !== formatIndex)) { character !== _special_characters__WEBPACK_IMPORTED_MODULE_3__["LINE_SEPARATOR"] || characterFormats.length - 1 !== formatIndex)) {
pointer = getLastChild(pointer); pointer = getLastChild(pointer);
return; return;
} }
var type = format.type,
attributes = format.attributes,
object = format.object;
var parent = getParent(pointer); var parent = getParent(pointer);
var newNode = append(parent, fromFormat({ var newNode = append(parent, fromFormat(format));
type: type,
attributes: attributes,
object: object
}));
if (isText(pointer) && getText(pointer).length === 0) { if (isText(pointer) && getText(pointer).length === 0) {
remove(pointer); remove(pointer);
} }
pointer = append(object ? parent : newNode, ''); pointer = append(format.object ? parent : newNode, '');
}); });
} // No need for further processing if the character is a line separator. } // No need for further processing if the character is a line separator.
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"]) { if (character === _special_characters__WEBPACK_IMPORTED_MODULE_3__["LINE_SEPARATOR"]) {
lastCharacterFormats = characterFormats; lastCharacterFormats = characterFormats;
lastCharacter = character; lastCharacter = character;
return "continue"; return "continue";
@ -3066,7 +3184,7 @@ function toTree(_ref2) {
} }
} }
if (character !== _special_characters__WEBPACK_IMPORTED_MODULE_2__["OBJECT_REPLACEMENT_CHARACTER"]) { if (character !== _special_characters__WEBPACK_IMPORTED_MODULE_3__["OBJECT_REPLACEMENT_CHARACTER"]) {
if (character === '\n') { if (character === '\n') {
pointer = append(getParent(pointer), { pointer = append(getParent(pointer), {
type: 'br', type: 'br',
@ -3158,10 +3276,13 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return unregisterFormatType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return unregisterFormatType; });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
/** /**
* Unregisters a format. * Unregisters a format.
* *
@ -3179,6 +3300,10 @@ function unregisterFormatType(name) {
return; return;
} }
if (oldFormat.__experimentalCreatePrepareEditableTree && oldFormat.__experimentalGetPropsForEditableTreePreparation) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["removeFilter"])('experimentalRichText', name);
}
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["dispatch"])('core/rich-text').removeFormatTypes(name); Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["dispatch"])('core/rich-text').removeFormatTypes(name);
return oldFormat; return oldFormat;
} }
@ -3495,6 +3620,17 @@ function isShallowEqual( a, b, fromIndex ) {
/***/ }), /***/ }),
/***/ "@wordpress/element":
/*!******************************************!*\
!*** external {"this":["wp","element"]} ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["element"]; }());
/***/ }),
/***/ "@wordpress/escape-html": /***/ "@wordpress/escape-html":
/*!*********************************************!*\ /*!*********************************************!*\
!*** external {"this":["wp","escapeHtml"]} ***! !*** external {"this":["wp","escapeHtml"]} ***!
@ -3506,6 +3642,17 @@ function isShallowEqual( a, b, fromIndex ) {
/***/ }), /***/ }),
/***/ "@wordpress/hooks":
/*!****************************************!*\
!*** external {"this":["wp","hooks"]} ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["hooks"]; }());
/***/ }),
/***/ "lodash": /***/ "lodash":
/*!*************************!*\ /*!*************************!*\
!*** external "lodash" ***! !*** external "lodash" ***!

File diff suppressed because one or more lines are too long

View File

@ -151,12 +151,22 @@ function _objectSpread(target) {
/*!***********************************************************!*\ /*!***********************************************************!*\
!*** ./node_modules/@wordpress/url/build-module/index.js ***! !*** ./node_modules/@wordpress/url/build-module/index.js ***!
\***********************************************************/ \***********************************************************/
/*! exports provided: isURL, addQueryArgs, getQueryArg, hasQueryArg, removeQueryArgs, prependHTTP, safeDecodeURI, filterURLForDisplay */ /*! exports provided: isURL, getProtocol, isValidProtocol, getAuthority, isValidAuthority, getPath, isValidPath, getQueryString, isValidQueryString, getFragment, isValidFragment, addQueryArgs, getQueryArg, hasQueryArg, removeQueryArgs, prependHTTP, safeDecodeURI, filterURLForDisplay */
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProtocol", function() { return getProtocol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidProtocol", function() { return isValidProtocol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAuthority", function() { return getAuthority; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidAuthority", function() { return isValidAuthority; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPath", function() { return getPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidPath", function() { return isValidPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getQueryString", function() { return getQueryString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidQueryString", function() { return isValidQueryString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFragment", function() { return getFragment; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidFragment", function() { return isValidFragment; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return addQueryArgs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return addQueryArgs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getQueryArg", function() { return getQueryArg; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getQueryArg", function() { return getQueryArg; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasQueryArg", function() { return hasQueryArg; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasQueryArg", function() { return hasQueryArg; });
@ -187,6 +197,156 @@ var USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
function isURL(url) { function isURL(url) {
return URL_REGEXP.test(url); return URL_REGEXP.test(url);
} }
/**
* Returns the protocol part of the URL.
*
* @param {string} url The full URL.
*
* @return {?string} The protocol part of the URL.
*/
function getProtocol(url) {
var matches = /^([^\s:]+:)/.exec(url);
if (matches) {
return matches[1];
}
}
/**
* Tests if a url protocol is valid.
*
* @param {string} protocol The url protocol.
*
* @return {boolean} True if the argument is a valid protocol (e.g. http://, tel:).
*/
function isValidProtocol(protocol) {
if (!protocol) {
return false;
}
return /^[a-z\-.\+]+[0-9]*:(?:\/\/)?\/?$/i.test(protocol);
}
/**
* Returns the authority part of the URL.
*
* @param {string} url The full URL.
*
* @return {?string} The authority part of the URL.
*/
function getAuthority(url) {
var matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
/**
* Checks for invalid characters within the provided authority.
*
* @param {string} authority A string containing the URL authority.
*
* @return {boolean} True if the argument contains a valid authority.
*/
function isValidAuthority(authority) {
if (!authority) {
return false;
}
return /^[^\s#?]+$/.test(authority);
}
/**
* Returns the path part of the URL.
*
* @param {string} url The full URL.
*
* @return {?string} The path part of the URL.
*/
function getPath(url) {
var matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
/**
* Checks for invalid characters within the provided path.
*
* @param {string} path The URL path.
*
* @return {boolean} True if the argument contains a valid path
*/
function isValidPath(path) {
if (!path) {
return false;
}
return /^[^\s#?]+$/.test(path);
}
/**
* Returns the query string part of the URL.
*
* @param {string} url The full URL.
*
* @return {?string} The query string part of the URL.
*/
function getQueryString(url) {
var matches = /^\S+?\?([^\s#]+)/.exec(url);
if (matches) {
return matches[1];
}
}
/**
* Checks for invalid characters within the provided query string.
*
* @param {string} queryString The query string.
*
* @return {boolean} True if the argument contains a valid query string.
*/
function isValidQueryString(queryString) {
if (!queryString) {
return false;
}
return /^[^\s#?\/]+$/.test(queryString);
}
/**
* Returns the fragment part of the URL.
*
* @param {string} url The full URL
*
* @return {?string} The fragment part of the URL.
*/
function getFragment(url) {
var matches = /^\S+(#[^\s\?]*)/.exec(url);
if (matches) {
return matches[1];
}
}
/**
* Checks for invalid characters within the provided fragment.
*
* @param {string} fragment The url fragment.
*
* @return {boolean} True if the argument contains a valid fragment.
*/
function isValidFragment(fragment) {
if (!fragment) {
return false;
}
return /^#[^\s#?\/]*$/.test(fragment);
}
/** /**
* Appends arguments to the query string of the url * Appends arguments to the query string of the url
* *

File diff suppressed because one or more lines are too long

6568
wp-includes/js/dist/vendor/wp-polyfill.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-beta3-43884'; $wp_version = '5.0-beta3-43885';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.