Block Editor: Update WordPress Packages WordPress 5.4 beta 2.
The following package versions were changed: @wordpress/block-directory: 1.5.0 -> 1.5.1 @wordpress/block-editor: 3.7.0 -> 3.7.1 @wordpress/block-library: 2.14.0 -> 2.14.1 @wordpress/components: 9.2.0 -> 9.2.1 @wordpress/edit-post: 3.13.0 -> 3.13.1 @wordpress/editor: 9.12.0 -> 9.12.1 @wordpress/format-library: 1.14.0 -> 1.14.1 @wordpress/list-reusable-blocks: 1.13.0 -> 1.13.1 @wordpress/media-utils: 1.7.0 -> 1.7.1 @wordpress/nux: 3.12.0 -> 3.12.1 @wordpress/server-side-render: 1.8.0 -> 1.8.1 Props gziolo, youknowriad, epiqueras, aduth. Fixes #49458. Built from https://develop.svn.wordpress.org/trunk@47302 git-svn-id: http://core.svn.wordpress.org/trunk@47102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ce3cd1cd91
commit
b522d90421
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '3160419c6c3d08089a156706223653c1');
|
||||
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'b5ff1c6c60ac9bf9e43e71d7a0f992e4');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => 'a6bfa8e39b19cb3cd4b333593c7c71b6');
|
||||
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '93ef6b67291d3c1f5279c8d78dfd29e9');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'moment', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'aa1d6e733390efb6037d0dbcc937bac4');
|
||||
<?php return array('dependencies' => array('lodash', 'moment', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'a5882b7f029c0a75c9df5b562c076b86');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'moment', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'bc19452f52551d22c926d0ef26bf17b3');
|
||||
<?php return array('dependencies' => array('lodash', 'moment', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '743f2ea082e675f7dbbdf02e3ead6342');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '2e794af1510e3ec2e5154b2e616f0192');
|
||||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'fd429ba1f75a7eee7aef48ce1895249c');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '64e7615751ddfb2863d89b860d83d531');
|
||||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '97c64fbcfbf11cf90ec2699a4cbe0b53');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '6516b95a8c3eaa9d15eb7e4f7bd765a5');
|
||||
<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'c9654deb47ed294f14ff96151af02331');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '8f0bf9c67637787db245984c94be974c');
|
||||
<?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '220e380d11112568564697f39c59323e');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '346c6d77a79bfc91ecf77e26de84248b');
|
||||
<?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '30343cf12ac797ef15c05beb2befdf21');
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '59966d6d1483cdc1a07f10e863e91952');
|
||||
<?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2135d38633323e6ad955646765e4dc06');
|
|
@ -1224,11 +1224,11 @@ body.admin-color-light .block-list-appender.is-drop-target > div::before {
|
|||
.block-editor-default-block-appender .block-editor-inserter {
|
||||
align-items: center; } }
|
||||
|
||||
html {
|
||||
html.block-editor-editor-skeleton__html-container {
|
||||
position: fixed;
|
||||
width: 100%; }
|
||||
@media (min-width: 782px) {
|
||||
html {
|
||||
html.block-editor-editor-skeleton__html-container {
|
||||
position: initial;
|
||||
width: initial; } }
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1228,11 +1228,11 @@ body.admin-color-light .block-list-appender.is-drop-target > div::before {
|
|||
.block-editor-default-block-appender .block-editor-inserter {
|
||||
align-items: center; } }
|
||||
|
||||
html {
|
||||
html.block-editor-editor-skeleton__html-container {
|
||||
position: fixed;
|
||||
width: 100%; }
|
||||
@media (min-width: 782px) {
|
||||
html {
|
||||
html.block-editor-editor-skeleton__html-container {
|
||||
position: initial;
|
||||
width: initial; } }
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -174,10 +174,14 @@ div[data-type="core/button"] {
|
|||
flex-basis: 100%; }
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"] {
|
||||
flex-grow: 1;
|
||||
flex-basis: auto;
|
||||
flex-basis: calc(50% - (16px));
|
||||
flex-grow: 0;
|
||||
margin-right: 0;
|
||||
margin-left: 0; }
|
||||
margin-left: 0; } }
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"] {
|
||||
flex-basis: 0;
|
||||
flex-grow: 1; }
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"][data-has-explicit-width] {
|
||||
flex-grow: 0; } }
|
||||
@media (min-width: 600px) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -175,10 +175,14 @@ div[data-type="core/button"] {
|
|||
flex-basis: 100%; }
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"] {
|
||||
flex-grow: 1;
|
||||
flex-basis: auto;
|
||||
flex-basis: calc(50% - (16px));
|
||||
flex-grow: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0; }
|
||||
margin-right: 0; } }
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"] {
|
||||
flex-basis: 0;
|
||||
flex-grow: 1; }
|
||||
.wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="core/column"][data-has-explicit-width] {
|
||||
flex-grow: 0; } }
|
||||
@media (min-width: 600px) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -140,13 +140,19 @@
|
|||
.wp-block-column {
|
||||
flex-basis: 100% !important; } }
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-column[style] {
|
||||
.wp-block-column {
|
||||
flex-basis: calc(50% - 16px);
|
||||
flex-grow: 0; }
|
||||
.wp-block-column:nth-child(even) {
|
||||
margin-right: 32px; } }
|
||||
.wp-block-column:nth-child(even) {
|
||||
margin-right: 32px; } }
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-column:not(:first-child) {
|
||||
margin-right: 32px; } }
|
||||
.wp-block-column {
|
||||
flex-basis: 0;
|
||||
flex-grow: 1; }
|
||||
.wp-block-column[style] {
|
||||
flex-grow: 0; }
|
||||
.wp-block-column:not(:first-child) {
|
||||
margin-right: 32px; } }
|
||||
|
||||
/**
|
||||
* All Columns Alignment
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -143,13 +143,19 @@
|
|||
.wp-block-column {
|
||||
flex-basis: 100% !important; } }
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-column[style] {
|
||||
.wp-block-column {
|
||||
flex-basis: calc(50% - 16px);
|
||||
flex-grow: 0; }
|
||||
.wp-block-column:nth-child(even) {
|
||||
margin-left: 32px; } }
|
||||
.wp-block-column:nth-child(even) {
|
||||
margin-left: 32px; } }
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-column:not(:first-child) {
|
||||
margin-left: 32px; } }
|
||||
.wp-block-column {
|
||||
flex-basis: 0;
|
||||
flex-grow: 1; }
|
||||
.wp-block-column[style] {
|
||||
flex-grow: 0; }
|
||||
.wp-block-column:not(:first-child) {
|
||||
margin-left: 32px; } }
|
||||
|
||||
/**
|
||||
* All Columns Alignment
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -18912,6 +18912,22 @@ function ColorPaletteControl(_ref) {
|
|||
|
||||
|
||||
|
||||
|
||||
function useHTMLClass(className) {
|
||||
Object(external_this_wp_element_["useEffect"])(function () {
|
||||
var element = document && document.querySelector("html:not(.".concat(className));
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.classList.toggle(className);
|
||||
return function () {
|
||||
element.classList.toggle(className);
|
||||
};
|
||||
}, [className]);
|
||||
}
|
||||
|
||||
function EditorSkeleton(_ref) {
|
||||
var footer = _ref.footer,
|
||||
header = _ref.header,
|
||||
|
@ -18919,6 +18935,7 @@ function EditorSkeleton(_ref) {
|
|||
content = _ref.content,
|
||||
publish = _ref.publish,
|
||||
className = _ref.className;
|
||||
useHTMLClass('block-editor-editor-skeleton__html-container');
|
||||
return Object(external_this_wp_element_["createElement"])("div", {
|
||||
className: classnames_default()(className, 'block-editor-editor-skeleton')
|
||||
}, !!header && Object(external_this_wp_element_["createElement"])("div", {
|
||||
|
@ -19588,7 +19605,7 @@ function settings_drawer_objectSpread(target) { for (var i = 1; i < arguments.le
|
|||
|
||||
var defaultSettings = [{
|
||||
id: 'opensInNewTab',
|
||||
title: Object(external_this_wp_i18n_["__"])('Open in New Tab')
|
||||
title: Object(external_this_wp_i18n_["__"])('Open in new tab')
|
||||
}];
|
||||
|
||||
var settings_drawer_LinkControlSettingsDrawer = function LinkControlSettingsDrawer(_ref) {
|
||||
|
@ -22854,7 +22871,7 @@ var image_url_input_ui_ImageURLInputUI = function ImageURLInputUI(_ref) {
|
|||
};
|
||||
|
||||
var advancedOptions = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToggleControl"], {
|
||||
label: Object(external_this_wp_i18n_["__"])('Open in New Tab'),
|
||||
label: Object(external_this_wp_i18n_["__"])('Open in new tab'),
|
||||
onChange: onSetNewTab,
|
||||
checked: linkTarget === '_blank'
|
||||
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -18449,7 +18449,8 @@ var group_deprecated_deprecated = [// Version of the group block with a bug that
|
|||
|
||||
|
||||
function GroupEdit(_ref) {
|
||||
var hasInnerBlocks = _ref.hasInnerBlocks;
|
||||
var hasInnerBlocks = _ref.hasInnerBlocks,
|
||||
className = _ref.className;
|
||||
var ref = Object(external_this_wp_element_["useRef"])();
|
||||
|
||||
var _experimentalUseColo = Object(external_this_wp_blockEditor_["__experimentalUseColors"])([{
|
||||
|
@ -18472,7 +18473,7 @@ function GroupEdit(_ref) {
|
|||
InspectorControlsColorPanel = _experimentalUseColo.InspectorControlsColorPanel;
|
||||
|
||||
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, InspectorControlsColorPanel, Object(external_this_wp_element_["createElement"])(BackgroundColor, null, Object(external_this_wp_element_["createElement"])(TextColor, null, Object(external_this_wp_element_["createElement"])("div", {
|
||||
className: "wp-block-group",
|
||||
className: className,
|
||||
ref: ref
|
||||
}, Object(external_this_wp_element_["createElement"])("div", {
|
||||
className: "wp-block-group__inner-container"
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -37253,12 +37253,12 @@ var custom_gradient_picker_GradientTypePicker = function GradientTypePicker(_ref
|
|||
className: "components-custom-gradient-picker__toolbar",
|
||||
controls: [{
|
||||
icon: Object(external_this_wp_element_["createElement"])(LinearGradientIcon, null),
|
||||
title: 'Linear Gradient',
|
||||
title: Object(external_this_wp_i18n_["__"])('Linear Gradient'),
|
||||
isActive: hasGradient && type === 'linear-gradient',
|
||||
onClick: onSetLinearGradient
|
||||
}, {
|
||||
icon: Object(external_this_wp_element_["createElement"])(RadialGradientIcon, null),
|
||||
title: 'Radial Gradient',
|
||||
title: Object(external_this_wp_i18n_["__"])('Radial Gradient'),
|
||||
isActive: hasGradient && type === 'radial-gradient',
|
||||
onClick: onSetRadialGradient
|
||||
}]
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -766,6 +766,7 @@ var image_image = {
|
|||
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
||||
_this.openModal = _this.openModal.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
||||
_this.closeModal = _this.closeModal.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
||||
_this.anchorRef = null;
|
||||
_this.state = {
|
||||
modal: false
|
||||
};
|
||||
|
@ -801,6 +802,20 @@ var image_image = {
|
|||
modal: false
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.anchorRef = getRange();
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
// When the popover is open or when the selected image changes,
|
||||
// update the anchorRef.
|
||||
if (!prevProps.isObjectActive && this.props.isObjectActive || prevProps.activeObjectAttributes.url !== this.props.activeObjectAttributes.url) {
|
||||
this.anchorRef = getRange();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
|
@ -852,7 +867,7 @@ var image_image = {
|
|||
}), isObjectActive && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Popover"], {
|
||||
position: "bottom center",
|
||||
focusOnMount: false,
|
||||
anchorRef: getRange()
|
||||
anchorRef: this.anchorRef
|
||||
}, Object(external_this_wp_element_["createElement"])("form", {
|
||||
className: "block-editor-format-toolbar__image-container-content",
|
||||
onKeyPress: stopKeyPropagation,
|
||||
|
@ -1020,7 +1035,6 @@ var external_this_lodash_ = __webpack_require__(2);
|
|||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check for issues with the provided href.
|
||||
*
|
||||
|
@ -1099,8 +1113,7 @@ function isValidHref(href) {
|
|||
|
||||
function createLinkFormat(_ref) {
|
||||
var url = _ref.url,
|
||||
opensInNewWindow = _ref.opensInNewWindow,
|
||||
text = _ref.text;
|
||||
opensInNewWindow = _ref.opensInNewWindow;
|
||||
var format = {
|
||||
type: 'core/link',
|
||||
attributes: {
|
||||
|
@ -1109,11 +1122,8 @@ function createLinkFormat(_ref) {
|
|||
};
|
||||
|
||||
if (opensInNewWindow) {
|
||||
// translators: accessibility label for external links, where the argument is the link text
|
||||
var label = Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('%s (opens in a new tab)'), text);
|
||||
format.attributes.target = '_blank';
|
||||
format.attributes.rel = 'noreferrer noopener';
|
||||
format.attributes['aria-label'] = label;
|
||||
}
|
||||
|
||||
return format;
|
||||
|
@ -1235,11 +1245,9 @@ function InlineLinkUI(_ref) {
|
|||
}
|
||||
|
||||
var newUrl = Object(external_this_wp_url_["prependHTTP"])(nextValue.url);
|
||||
var selectedText = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(value));
|
||||
var format = createLinkFormat({
|
||||
url: newUrl,
|
||||
opensInNewWindow: nextValue.opensInNewTab,
|
||||
text: selectedText
|
||||
opensInNewWindow: nextValue.opensInNewTab
|
||||
});
|
||||
|
||||
if (Object(external_this_wp_richText_["isCollapsed"])(value) && !isActive) {
|
||||
|
@ -1717,6 +1725,7 @@ var inline_InlineColorUI = function InlineColorUI(_ref3) {
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -1733,16 +1742,24 @@ function TextColorEdit(_ref) {
|
|||
onChange = _ref.onChange,
|
||||
isActive = _ref.isActive,
|
||||
activeAttributes = _ref.activeAttributes;
|
||||
var colors = Object(external_this_wp_data_["useSelect"])(function (select) {
|
||||
var _select = select('core/block-editor'),
|
||||
getSettings = _select.getSettings;
|
||||
|
||||
if (getSettings) {
|
||||
return Object(external_this_lodash_["get"])(getSettings(), ['colors'], EMPTY_ARRAY);
|
||||
var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
|
||||
var blockEditorSelect = select('core/block-editor');
|
||||
var settings;
|
||||
|
||||
if (blockEditorSelect && blockEditorSelect.getSettings) {
|
||||
settings = blockEditorSelect.getSettings();
|
||||
} else {
|
||||
settings = {};
|
||||
}
|
||||
|
||||
return EMPTY_ARRAY;
|
||||
});
|
||||
return {
|
||||
colors: Object(external_this_lodash_["get"])(settings, ['colors'], EMPTY_ARRAY),
|
||||
disableCustomColors: settings.disableCustomColors
|
||||
};
|
||||
}),
|
||||
colors = _useSelect.colors,
|
||||
disableCustomColors = _useSelect.disableCustomColors;
|
||||
|
||||
var _useState = Object(external_this_wp_element_["useState"])(false),
|
||||
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
||||
|
@ -1766,6 +1783,12 @@ function TextColorEdit(_ref) {
|
|||
backgroundColor: activeColor
|
||||
};
|
||||
}, [value, colors]);
|
||||
var hasColorsToChoose = !Object(external_this_lodash_["isEmpty"])(colors) || disableCustomColors !== true;
|
||||
|
||||
if (!hasColorsToChoose && !isActive) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
|
||||
key: isActive ? 'text-color' : 'text-color-not-active',
|
||||
className: "format-library-text-color-button",
|
||||
|
@ -1776,8 +1799,11 @@ function TextColorEdit(_ref) {
|
|||
className: "format-library-text-color-button__indicator",
|
||||
style: colorIndicatorStyle
|
||||
})),
|
||||
title: text_color_title,
|
||||
onClick: enableIsAddingColor
|
||||
title: text_color_title // If has no colors to choose but a color is active remove the color onClick
|
||||
,
|
||||
onClick: hasColorsToChoose ? enableIsAddingColor : function () {
|
||||
return onChange(Object(external_this_wp_richText_["removeFormat"])(value, text_color_name));
|
||||
}
|
||||
}), isAddingColor && Object(external_this_wp_element_["createElement"])(text_color_inline, {
|
||||
name: text_color_name,
|
||||
addingColor: isAddingColor,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -426,6 +426,11 @@ var external_this_wp_i18n_ = __webpack_require__(1);
|
|||
|
||||
var _window = window,
|
||||
wp = _window.wp;
|
||||
/**
|
||||
* Prepares the Featured Image toolbars and frames.
|
||||
*
|
||||
* @return {wp.media.view.MediaFrame.Select} The default media workflow.
|
||||
*/
|
||||
|
||||
var getFeaturedImageMediaFrame = function getFeaturedImageMediaFrame() {
|
||||
return wp.media.view.MediaFrame.Select.extend({
|
||||
|
@ -442,6 +447,23 @@ var getFeaturedImageMediaFrame = function getFeaturedImageMediaFrame() {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle the edit state requirements of selected media item.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
editState: function editState() {
|
||||
var selection = this.state('featured-image').get('selection');
|
||||
var view = new wp.media.view.EditImage({
|
||||
model: selection.single(),
|
||||
controller: this
|
||||
}).render(); // Set the view to the EditImage frame using the selected image.
|
||||
|
||||
this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
|
||||
|
||||
view.loadEditor();
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the default states.
|
||||
*
|
||||
|
@ -449,10 +471,18 @@ var getFeaturedImageMediaFrame = function getFeaturedImageMediaFrame() {
|
|||
*/
|
||||
createStates: function createStates() {
|
||||
this.on('toolbar:create:featured-image', this.featuredImageToolbar, this);
|
||||
this.states.add([new wp.media.controller.FeaturedImage()]);
|
||||
this.on('content:render:edit-image', this.editState, this);
|
||||
this.states.add([new wp.media.controller.FeaturedImage(), new wp.media.controller.EditImage({
|
||||
model: this.options.editImage
|
||||
})]);
|
||||
}
|
||||
});
|
||||
}; // Getter for the sake of unit tests.
|
||||
};
|
||||
/**
|
||||
* Prepares the Gallery toolbars and frames.
|
||||
*
|
||||
* @return {wp.media.view.MediaFrame.Select} The default media workflow.
|
||||
*/
|
||||
|
||||
|
||||
var media_upload_getGalleryDetailsMediaFrame = function getGalleryDetailsMediaFrame() {
|
||||
|
@ -463,13 +493,67 @@ var media_upload_getGalleryDetailsMediaFrame = function getGalleryDetailsMediaFr
|
|||
* @class GalleryDetailsMediaFrame
|
||||
* @class
|
||||
*/
|
||||
return wp.media.view.MediaFrame.Post.extend({
|
||||
return wp.media.view.MediaFrame.Select.extend({
|
||||
/**
|
||||
* Set up gallery toolbar.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
galleryToolbar: function galleryToolbar() {
|
||||
var editing = this.state().get('editing');
|
||||
this.toolbar.set(new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
style: 'primary',
|
||||
text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
|
||||
priority: 80,
|
||||
requires: {
|
||||
library: true
|
||||
},
|
||||
|
||||
/**
|
||||
* @fires wp.media.controller.State#update
|
||||
*/
|
||||
click: function click() {
|
||||
var controller = this.controller,
|
||||
state = controller.state();
|
||||
controller.close();
|
||||
state.trigger('update', state.get('library')); // Restore and reset the default state.
|
||||
|
||||
controller.setState(controller.options.state);
|
||||
controller.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle the edit state requirements of selected media item.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
editState: function editState() {
|
||||
var selection = this.state('gallery').get('selection');
|
||||
var view = new wp.media.view.EditImage({
|
||||
model: selection.single(),
|
||||
controller: this
|
||||
}).render(); // Set the view to the EditImage frame using the selected image.
|
||||
|
||||
this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
|
||||
|
||||
view.loadEditor();
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the default states.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
createStates: function createStates() {
|
||||
this.on('toolbar:create:main-gallery', this.galleryToolbar, this);
|
||||
this.on('content:render:edit-image', this.editState, this);
|
||||
this.states.add([new wp.media.controller.Library({
|
||||
id: 'gallery',
|
||||
title: wp.media.view.l10n.createGalleryTitle,
|
||||
|
@ -481,6 +565,8 @@ var media_upload_getGalleryDetailsMediaFrame = function getGalleryDetailsMediaFr
|
|||
library: wp.media.query(Object(external_this_lodash_["defaults"])({
|
||||
type: 'image'
|
||||
}, this.options.library))
|
||||
}), new wp.media.controller.EditImage({
|
||||
model: this.options.editImage
|
||||
}), new wp.media.controller.GalleryEdit({
|
||||
library: this.options.selection,
|
||||
editing: this.options.editing,
|
||||
|
@ -577,6 +663,12 @@ function (_Component) {
|
|||
this.frame.on('open', this.onOpen);
|
||||
this.frame.on('close', this.onClose);
|
||||
}
|
||||
/**
|
||||
* Sets the Gallery frame and initializes listeners.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "buildAndSetGalleryFrame",
|
||||
value: function buildAndSetGalleryFrame() {
|
||||
|
@ -627,6 +719,12 @@ function (_Component) {
|
|||
wp.media.frame = this.frame;
|
||||
this.initializeListeners();
|
||||
}
|
||||
/**
|
||||
* Initializes the Media Library requirements for the featured image flow.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "buildAndSetFeatureImageFrame",
|
||||
value: function buildAndSetFeatureImageFrame() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.4-beta1-47301';
|
||||
$wp_version = '5.4-beta1-47302';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue