Block Editor: Upgrade `@WordPress` packages to the latest versions.

Updated packages:

- @wordpress/annotations@1.0.5
- @wordpress/api-fetch@2.2.7
- @wordpress/block-library@2.2.12
- @wordpress/block-serialization-default-parser@2.0.3
- @wordpress/blocks@6.0.5
- @wordpress/components@7.0.5
- @wordpress/core-data@2.0.16
- @wordpress/data@4.2.0
- @wordpress/deprecated@2.0.4
- @wordpress/dom@2.0.8
- @wordpress/edit-post@3.1.7
- @wordpress/editor@9.0.7
- @wordpress/format-library@1.2.10
- @wordpress/hooks@2.0.4
- @wordpress/list-reusable-blocks@1.1.18
- @wordpress/notices@1.1.2
- @wordpress/nux@3.0.6
- @wordpress/plugins@2.0.10
- @wordpress/rich-text@3.0.4
- @wordpress/url@2.3.3
- @wordpress/viewport@2.1.0

Props: youknowriad, gziolo, desrosj.

Fixes #45814.
Built from https://develop.svn.wordpress.org/trunk@44389


git-svn-id: http://core.svn.wordpress.org/trunk@44219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-01-04 19:38:57 +00:00
parent 8ac2091f5d
commit 0ee1a0e4e1
37 changed files with 601 additions and 448 deletions

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* Block Serialization Parser
*
* @package WordPress
*/
/** /**
* Class WP_Block_Parser_Block * Class WP_Block_Parser_Block
@ -62,6 +67,19 @@ class WP_Block_Parser_Block {
*/ */
public $innerContent; public $innerContent;
/**
* Constructor.
*
* Will populate object properties from the provided arguments.
*
* @since 3.8.0
*
* @param string $name Name of block.
* @param array $attrs Optional set of attributes from block comment delimiters.
* @param array $innerBlocks List of inner blocks (of this same class).
* @param string $innerHTML Resultant HTML from inside block comment delimiters after removing inner blocks.
* @param array $innerContent List of string fragments and null markers where inner blocks were found.
*/
function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {
$this->blockName = $name; $this->blockName = $name;
$this->attrs = $attrs; $this->attrs = $attrs;
@ -121,6 +139,19 @@ class WP_Block_Parser_Frame {
*/ */
public $leading_html_start; public $leading_html_start;
/**
* Constructor
*
* Will populate object properties from the provided arguments.
*
* @since 3.8.0
*
* @param WP_Block_Parser_Block $block Full or partial block.
* @param int $token_start Byte offset into document for start of parse token.
* @param int $token_length Byte length of entire parse token string.
* @param int $prev_offset Byte offset into document for after parse token ends.
* @param int $leading_html_start Byte offset into document where leading HTML before token starts.
*/
function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) { function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
$this->block = $block; $this->block = $block;
$this->token_start = $token_start; $this->token_start = $token_start;
@ -190,7 +221,7 @@ class WP_Block_Parser {
* *
* @since 3.8.0 * @since 3.8.0
* *
* @param string $document * @param string $document Input document being parsed.
* @return WP_Block_Parser_Block[] * @return WP_Block_Parser_Block[]
*/ */
function parse( $document ) { function parse( $document ) {
@ -201,7 +232,7 @@ class WP_Block_Parser {
$this->empty_attrs = json_decode( '{}', true ); $this->empty_attrs = json_decode( '{}', true );
do { do {
// twiddle our thumbs // twiddle our thumbs.
} while ( $this->proceed() ); } while ( $this->proceed() );
return $this->output; return $this->output;
@ -226,12 +257,12 @@ class WP_Block_Parser {
list( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token; list( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token;
$stack_depth = count( $this->stack ); $stack_depth = count( $this->stack );
// we may have some HTML soup before the next block // we may have some HTML soup before the next block.
$leading_html_start = $start_offset > $this->offset ? $this->offset : null; $leading_html_start = $start_offset > $this->offset ? $this->offset : null;
switch ( $token_type ) { switch ( $token_type ) {
case 'no-more-tokens': case 'no-more-tokens':
// if not in a block then flush output // if not in a block then flush output.
if ( 0 === $stack_depth ) { if ( 0 === $stack_depth ) {
$this->add_freeform(); $this->add_freeform();
return false; return false;
@ -246,7 +277,7 @@ class WP_Block_Parser {
* - assume an implicit closer (easiest when not nesting) * - assume an implicit closer (easiest when not nesting)
*/ */
// for the easy case we'll assume an implicit closer // for the easy case we'll assume an implicit closer.
if ( 1 === $stack_depth ) { if ( 1 === $stack_depth ) {
$this->add_block_from_stack(); $this->add_block_from_stack();
return false; return false;
@ -281,7 +312,7 @@ class WP_Block_Parser {
return true; return true;
} }
// otherwise we found an inner block // otherwise we found an inner block.
$this->add_inner_block( $this->add_inner_block(
new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ),
$start_offset, $start_offset,
@ -291,7 +322,7 @@ class WP_Block_Parser {
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.
array_push( $this->stack, new WP_Block_Parser_Frame( array_push( $this->stack, new WP_Block_Parser_Frame(
new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ),
$start_offset, $start_offset,
@ -318,7 +349,7 @@ class WP_Block_Parser {
return false; return false;
} }
// if we're not nesting then this is easy - close the block // if we're not nesting then this is easy - close the block.
if ( 1 === $stack_depth ) { if ( 1 === $stack_depth ) {
$this->add_block_from_stack( $start_offset ); $this->add_block_from_stack( $start_offset );
$this->offset = $start_offset + $token_length; $this->offset = $start_offset + $token_length;
@ -345,7 +376,7 @@ class WP_Block_Parser {
return true; return true;
default: default:
// This is an error // This is an error.
$this->add_freeform(); $this->add_freeform();
return false; return false;
} }
@ -381,12 +412,12 @@ class WP_Block_Parser {
$this->offset $this->offset
); );
// if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE // if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE.
if ( false === $has_match ) { if ( false === $has_match ) {
return array( 'no-more-tokens', null, null, null, null ); return array( 'no-more-tokens', null, null, null, null );
} }
// we have no more tokens // we have no more tokens.
if ( 0 === $has_match ) { if ( 0 === $has_match ) {
return array( 'no-more-tokens', null, null, null, null ); return array( 'no-more-tokens', null, null, null, null );
} }
@ -414,7 +445,7 @@ class WP_Block_Parser {
* This is an error * This is an error
*/ */
if ( $is_closer && ( $is_void || $has_attrs ) ) { if ( $is_closer && ( $is_void || $has_attrs ) ) {
// we can ignore them since they don't hurt anything // we can ignore them since they don't hurt anything.
} }
if ( $is_void ) { if ( $is_void ) {
@ -434,8 +465,8 @@ class WP_Block_Parser {
* @internal * @internal
* @since 3.9.0 * @since 3.9.0
* *
* @param string $innerHTML HTML content of block * @param string $innerHTML HTML content of block.
* @return WP_Block_Parser_Block freeform block object * @return WP_Block_Parser_Block freeform block object.
*/ */
function freeform( $innerHTML ) { function freeform( $innerHTML ) {
return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) ); return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) );
@ -443,11 +474,11 @@ class WP_Block_Parser {
/** /**
* Pushes a length of text from the input document * Pushes a length of text from the input document
* to the output list as a freeform block * to the output list as a freeform block.
* *
* @internal * @internal
* @since 3.8.0 * @since 3.8.0
* @param null $length how many bytes of document text to output * @param null $length how many bytes of document text to output.
*/ */
function add_freeform( $length = null ) { function add_freeform( $length = null ) {
$length = $length ? $length : strlen( $this->document ) - $this->offset; $length = $length ? $length : strlen( $this->document ) - $this->offset;
@ -461,14 +492,14 @@ class WP_Block_Parser {
/** /**
* Given a block structure from memory pushes * Given a block structure from memory pushes
* a new block to the output list * a new block to the output list.
* *
* @internal * @internal
* @since 3.8.0 * @since 3.8.0
* @param WP_Block_Parser_Block $block the block to add to the output * @param WP_Block_Parser_Block $block The block to add to the output.
* @param int $token_start byte offset into the document where the first token for the block starts * @param int $token_start Byte offset into the document where the first token for the block starts.
* @param int $token_length byte length of entire block from start of opening token to end of closing token * @param int $token_length Byte length of entire block from start of opening token to end of closing token.
* @param int|null $last_offset last byte offset into document if continuing form earlier output * @param int|null $last_offset Last byte offset into document if continuing form earlier output.
*/ */
function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {
$parent = $this->stack[ count( $this->stack ) - 1 ]; $parent = $this->stack[ count( $this->stack ) - 1 ];
@ -485,11 +516,11 @@ class WP_Block_Parser {
} }
/** /**
* Pushes the top block from the parsing stack to the output list * Pushes the top block from the parsing stack to the output list.
* *
* @internal * @internal
* @since 3.8.0 * @since 3.8.0
* @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML.
*/ */
function add_block_from_stack( $end_offset = null ) { function add_block_from_stack( $end_offset = null ) {
$stack_top = array_pop( $this->stack ); $stack_top = array_pop( $this->stack );

View File

@ -710,6 +710,12 @@ p.has-drop-cap:not(:focus)::first-letter {
text-transform: uppercase; text-transform: uppercase;
font-style: normal; } font-style: normal; }
p.has-drop-cap:not(:focus)::after {
content: "";
display: table;
clear: both;
padding-top: 14px; }
p.has-background { p.has-background {
padding: 20px 30px; } padding: 20px 30px; }

File diff suppressed because one or more lines are too long

View File

@ -720,6 +720,12 @@ p.has-drop-cap:not(:focus)::first-letter {
text-transform: uppercase; text-transform: uppercase;
font-style: normal; } font-style: normal; }
p.has-drop-cap:not(:focus)::after {
content: "";
display: table;
clear: both;
padding-top: 14px; }
p.has-background { p.has-background {
padding: 20px 30px; } padding: 20px 30px; }

File diff suppressed because one or more lines are too long

View File

@ -731,7 +731,6 @@
svg.dashicon { svg.dashicon {
fill: currentColor; fill: currentColor;
outline: none; } outline: none; }
.PresetDateRangePicker_panel { .PresetDateRangePicker_panel {
padding: 0 22px 11px; } padding: 0 22px 11px; }
@ -739,11 +738,11 @@ svg.dashicon {
position: relative; position: relative;
height: 100%; height: 100%;
text-align: center; text-align: center;
background: 100% 0; background: 0 0;
border: 2px solid #00a699; border: 2px solid #00a699;
color: #00a699; color: #00a699;
padding: 4px 12px; padding: 4px 12px;
margin-left: 8px; margin-right: 8px;
font: inherit; font: inherit;
font-weight: 700; font-weight: 700;
line-height: normal; line-height: normal;
@ -767,7 +766,7 @@ svg.dashicon {
border: 1px solid #dbdbdb; } border: 1px solid #dbdbdb; }
.SingleDatePickerInput__rtl { .SingleDatePickerInput__rtl {
direction: ltr; } direction: rtl; }
.SingleDatePickerInput__disabled { .SingleDatePickerInput__disabled {
background-color: #f2f2f2; } background-color: #f2f2f2; }
@ -776,10 +775,10 @@ svg.dashicon {
display: block; } display: block; }
.SingleDatePickerInput__showClearDate { .SingleDatePickerInput__showClearDate {
padding-left: 30px; } padding-right: 30px; }
.SingleDatePickerInput_clearDate { .SingleDatePickerInput_clearDate {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -787,9 +786,9 @@ svg.dashicon {
overflow: visible; overflow: visible;
cursor: pointer; cursor: pointer;
padding: 10px; padding: 10px;
margin: 0 5px 0 10px; margin: 0 10px 0 5px;
position: absolute; position: absolute;
left: 0; right: 0;
top: 50%; top: 50%;
transform: translateY(-50%); } transform: translateY(-50%); }
@ -814,7 +813,7 @@ svg.dashicon {
height: 9px; } height: 9px; }
.SingleDatePickerInput_calendarIcon { .SingleDatePickerInput_calendarIcon {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -824,7 +823,7 @@ svg.dashicon {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
padding: 10px; padding: 10px;
margin: 0 10px 0 5px; } margin: 0 5px 0 10px; }
.SingleDatePickerInput_calendarIcon_svg { .SingleDatePickerInput_calendarIcon_svg {
fill: #82888a; fill: #82888a;
@ -845,19 +844,19 @@ svg.dashicon {
position: absolute; } position: absolute; }
.SingleDatePicker_picker__rtl { .SingleDatePicker_picker__rtl {
direction: ltr; } direction: rtl; }
.SingleDatePicker_picker__directionLeft { .SingleDatePicker_picker__directionLeft {
right: 0; } left: 0; }
.SingleDatePicker_picker__directionRight { .SingleDatePicker_picker__directionRight {
left: 0; } right: 0; }
.SingleDatePicker_picker__portal { .SingleDatePicker_picker__portal {
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; left: 0;
height: 100%; height: 100%;
width: 100%; } width: 100%; }
@ -865,7 +864,7 @@ svg.dashicon {
background-color: #fff; } background-color: #fff; }
.SingleDatePicker_closeButton { .SingleDatePicker_closeButton {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -874,7 +873,7 @@ svg.dashicon {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; right: 0;
padding: 15px; padding: 15px;
z-index: 2; } z-index: 2; }
@ -889,7 +888,7 @@ svg.dashicon {
fill: #cacccd; } fill: #cacccd; }
.DayPickerKeyboardShortcuts_buttonReset { .DayPickerKeyboardShortcuts_buttonReset {
background: 100% 0; background: 0 0;
border: 0; border: 0;
border-radius: 0; border-radius: 0;
color: inherit; color: inherit;
@ -910,46 +909,46 @@ svg.dashicon {
.DayPickerKeyboardShortcuts_show__bottomRight { .DayPickerKeyboardShortcuts_show__bottomRight {
border-top: 26px solid transparent; border-top: 26px solid transparent;
border-left: 33px solid #00a699; border-right: 33px solid #00a699;
bottom: 0; bottom: 0;
left: 0; } right: 0; }
.DayPickerKeyboardShortcuts_show__bottomRight:hover { .DayPickerKeyboardShortcuts_show__bottomRight:hover {
border-left: 33px solid #008489; } border-right: 33px solid #008489; }
.DayPickerKeyboardShortcuts_show__topRight { .DayPickerKeyboardShortcuts_show__topRight {
border-bottom: 26px solid transparent;
border-left: 33px solid #00a699;
top: 0;
left: 0; }
.DayPickerKeyboardShortcuts_show__topRight:hover {
border-left: 33px solid #008489; }
.DayPickerKeyboardShortcuts_show__topLeft {
border-bottom: 26px solid transparent; border-bottom: 26px solid transparent;
border-right: 33px solid #00a699; border-right: 33px solid #00a699;
top: 0; top: 0;
right: 0; } right: 0; }
.DayPickerKeyboardShortcuts_show__topLeft:hover { .DayPickerKeyboardShortcuts_show__topRight:hover {
border-right: 33px solid #008489; } border-right: 33px solid #008489; }
.DayPickerKeyboardShortcuts_show__topLeft {
border-bottom: 26px solid transparent;
border-left: 33px solid #00a699;
top: 0;
left: 0; }
.DayPickerKeyboardShortcuts_show__topLeft:hover {
border-left: 33px solid #008489; }
.DayPickerKeyboardShortcuts_showSpan { .DayPickerKeyboardShortcuts_showSpan {
color: #fff; color: #fff;
position: absolute; } position: absolute; }
.DayPickerKeyboardShortcuts_showSpan__bottomRight { .DayPickerKeyboardShortcuts_showSpan__bottomRight {
bottom: 0; bottom: 0;
left: -28px; } right: -28px; }
.DayPickerKeyboardShortcuts_showSpan__topRight { .DayPickerKeyboardShortcuts_showSpan__topRight {
top: 1px; top: 1px;
left: -28px; } right: -28px; }
.DayPickerKeyboardShortcuts_showSpan__topLeft { .DayPickerKeyboardShortcuts_showSpan__topLeft {
top: 1px; top: 1px;
right: -28px; } left: -28px; }
.DayPickerKeyboardShortcuts_panel { .DayPickerKeyboardShortcuts_panel {
overflow: auto; overflow: auto;
@ -959,8 +958,8 @@ svg.dashicon {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0;
right: 0; right: 0;
left: 0;
z-index: 2; z-index: 2;
padding: 22px; padding: 22px;
margin: 33px; } margin: 33px; }
@ -977,7 +976,7 @@ svg.dashicon {
.DayPickerKeyboardShortcuts_close { .DayPickerKeyboardShortcuts_close {
position: absolute; position: absolute;
left: 22px; right: 22px;
top: 22px; top: 22px;
z-index: 2; } z-index: 2; }
@ -1059,7 +1058,7 @@ svg.dashicon {
color: #fff; } color: #fff; }
.CalendarDay__last_in_range { .CalendarDay__last_in_range {
border-left: #00a699; } border-right: #00a699; }
.CalendarDay__selected, .CalendarDay__selected,
.CalendarDay__selected:active, .CalendarDay__selected:active,
@ -1123,7 +1122,7 @@ svg.dashicon {
.CalendarMonthGrid { .CalendarMonthGrid {
background: #fff; background: #fff;
text-align: right; text-align: left;
z-index: 0; } z-index: 0; }
.CalendarMonthGrid__animating { .CalendarMonthGrid__animating {
@ -1131,7 +1130,7 @@ svg.dashicon {
.CalendarMonthGrid__horizontal { .CalendarMonthGrid__horizontal {
position: absolute; position: absolute;
right: 9px; } left: 9px; }
.CalendarMonthGrid__vertical { .CalendarMonthGrid__vertical {
margin: 0 auto; } margin: 0 auto; }
@ -1166,7 +1165,7 @@ svg.dashicon {
width: 100%; width: 100%;
height: 52px; height: 52px;
bottom: 0; bottom: 0;
right: 0; } left: 0; }
.DayPickerNavigation__verticalScrollableDefault { .DayPickerNavigation__verticalScrollableDefault {
position: relative; } position: relative; }
@ -1201,10 +1200,10 @@ svg.dashicon {
padding: 6px 9px; } padding: 6px 9px; }
.DayPickerNavigation_leftButton__horizontalDefault { .DayPickerNavigation_leftButton__horizontalDefault {
right: 22px; } left: 22px; }
.DayPickerNavigation_rightButton__horizontalDefault { .DayPickerNavigation_rightButton__horizontalDefault {
left: 22px; } right: 22px; }
.DayPickerNavigation_button__verticalDefault { .DayPickerNavigation_button__verticalDefault {
padding: 5px; padding: 5px;
@ -1216,7 +1215,7 @@ svg.dashicon {
width: 50%; } width: 50%; }
.DayPickerNavigation_nextButton__verticalDefault { .DayPickerNavigation_nextButton__verticalDefault {
border-right: 0; } border-left: 0; }
.DayPickerNavigation_nextButton__verticalScrollableDefault { .DayPickerNavigation_nextButton__verticalScrollableDefault {
width: 100%; } width: 100%; }
@ -1236,7 +1235,7 @@ svg.dashicon {
.DayPicker { .DayPicker {
background: #fff; background: #fff;
position: relative; position: relative;
text-align: right; } text-align: left; }
.DayPicker__horizontal { .DayPicker__horizontal {
background: #fff; } background: #fff; }
@ -1254,7 +1253,7 @@ svg.dashicon {
.DayPicker_portal__horizontal { .DayPicker_portal__horizontal {
box-shadow: none; box-shadow: none;
position: absolute; position: absolute;
right: 50%; left: 50%;
top: 50%; } top: 50%; }
.DayPicker_portal__vertical { .DayPicker_portal__vertical {
@ -1272,33 +1271,33 @@ svg.dashicon {
position: relative; } position: relative; }
.DayPicker_weekHeaders__horizontal { .DayPicker_weekHeaders__horizontal {
margin-right: 9px; } margin-left: 9px; }
.DayPicker_weekHeader { .DayPicker_weekHeader {
color: #757575; color: #757575;
position: absolute; position: absolute;
top: 62px; top: 62px;
z-index: 2; z-index: 2;
text-align: right; } text-align: left; }
.DayPicker_weekHeader__vertical { .DayPicker_weekHeader__vertical {
right: 50%; } left: 50%; }
.DayPicker_weekHeader__verticalScrollable { .DayPicker_weekHeader__verticalScrollable {
top: 0; top: 0;
display: table-row; display: table-row;
border-bottom: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb;
background: #fff; background: #fff;
margin-right: 0; margin-left: 0;
right: 0; left: 0;
width: 100%; width: 100%;
text-align: center; } text-align: center; }
.DayPicker_weekHeader_ul { .DayPicker_weekHeader_ul {
list-style: none; list-style: none;
margin: 1px 0; margin: 1px 0;
padding-right: 0;
padding-left: 0; padding-left: 0;
padding-right: 0;
font-size: 14px; } font-size: 14px; }
.DayPicker_weekHeader_li { .DayPicker_weekHeader_li {
@ -1322,8 +1321,8 @@ svg.dashicon {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0;
right: 0; right: 0;
left: 0;
overflow-y: scroll; } overflow-y: scroll; }
.DateInput { .DateInput {
@ -1355,9 +1354,9 @@ svg.dashicon {
padding: 11px 11px 9px; padding: 11px 11px 9px;
border: 0; border: 0;
border-top: 0; border-top: 0;
border-left: 0;
border-bottom: 2px solid transparent;
border-right: 0; border-right: 0;
border-bottom: 2px solid transparent;
border-left: 0;
border-radius: 0; } border-radius: 0; }
.DateInput_input__small { .DateInput_input__small {
@ -1380,9 +1379,9 @@ svg.dashicon {
background: #fff; background: #fff;
border: 0; border: 0;
border-top: 0; border-top: 0;
border-left: 0; border-right: 0;
border-bottom: 2px solid #008489; border-bottom: 2px solid #008489;
border-right: 0; } border-left: 0; }
.DateInput_input__disabled { .DateInput_input__disabled {
background: #f2f2f2; background: #f2f2f2;
@ -1402,7 +1401,7 @@ svg.dashicon {
position: absolute; position: absolute;
width: 20px; width: 20px;
height: 10px; height: 10px;
right: 22px; left: 22px;
z-index: 2; } z-index: 2; }
.DateInput_fangShape { .DateInput_fangShape {
@ -1424,13 +1423,13 @@ svg.dashicon {
border: 1px solid #dbdbdb; } border: 1px solid #dbdbdb; }
.DateRangePickerInput__rtl { .DateRangePickerInput__rtl {
direction: ltr; } direction: rtl; }
.DateRangePickerInput__block { .DateRangePickerInput__block {
display: block; } display: block; }
.DateRangePickerInput__showClearDates { .DateRangePickerInput__showClearDates {
padding-left: 30px; } padding-right: 30px; }
.DateRangePickerInput_arrow { .DateRangePickerInput_arrow {
display: inline-block; display: inline-block;
@ -1444,7 +1443,7 @@ svg.dashicon {
width: 24px; } width: 24px; }
.DateRangePickerInput_clearDates { .DateRangePickerInput_clearDates {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -1452,9 +1451,9 @@ svg.dashicon {
overflow: visible; overflow: visible;
cursor: pointer; cursor: pointer;
padding: 10px; padding: 10px;
margin: 0 5px 0 10px; margin: 0 10px 0 5px;
position: absolute; position: absolute;
left: 0; right: 0;
top: 50%; top: 50%;
transform: translateY(-50%); } transform: translateY(-50%); }
@ -1479,7 +1478,7 @@ svg.dashicon {
height: 9px; } height: 9px; }
.DateRangePickerInput_calendarIcon { .DateRangePickerInput_calendarIcon {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -1489,7 +1488,7 @@ svg.dashicon {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
padding: 10px; padding: 10px;
margin: 0 10px 0 5px; } margin: 0 5px 0 10px; }
.DateRangePickerInput_calendarIcon_svg { .DateRangePickerInput_calendarIcon_svg {
fill: #82888a; fill: #82888a;
@ -1510,19 +1509,19 @@ svg.dashicon {
position: absolute; } position: absolute; }
.DateRangePicker_picker__rtl { .DateRangePicker_picker__rtl {
direction: ltr; } direction: rtl; }
.DateRangePicker_picker__directionLeft { .DateRangePicker_picker__directionLeft {
right: 0; } left: 0; }
.DateRangePicker_picker__directionRight { .DateRangePicker_picker__directionRight {
left: 0; } right: 0; }
.DateRangePicker_picker__portal { .DateRangePicker_picker__portal {
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; left: 0;
height: 100%; height: 100%;
width: 100%; } width: 100%; }
@ -1530,7 +1529,7 @@ svg.dashicon {
background-color: #fff; } background-color: #fff; }
.DateRangePicker_closeButton { .DateRangePicker_closeButton {
background: 100% 0; background: 0 0;
border: 0; border: 0;
color: inherit; color: inherit;
font: inherit; font: inherit;
@ -1539,7 +1538,7 @@ svg.dashicon {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; right: 0;
padding: 15px; padding: 15px;
z-index: 2; } z-index: 2; }
@ -1552,7 +1551,6 @@ svg.dashicon {
height: 15px; height: 15px;
width: 15px; width: 15px;
fill: #cacccd; } fill: #cacccd; }
.components-datetime .components-datetime__calendar-help { .components-datetime .components-datetime__calendar-help {
padding: 8px; } padding: 8px; }
.components-datetime .components-datetime__calendar-help h4 { .components-datetime .components-datetime__calendar-help h4 {
@ -1751,8 +1749,6 @@ body.is-dragging-components-draggable {
transition: 0.3s opacity, 0.3s background-color; } transition: 0.3s opacity, 0.3s background-color; }
.components-drop-zone.is-dragging-over-element { .components-drop-zone.is-dragging-over-element {
background-color: rgba(0, 113, 161, 0.8); } background-color: rgba(0, 113, 161, 0.8); }
.components-drop-zone.is-dragging-over-element .components-drop-zone__content {
display: block; }
.components-drop-zone__content { .components-drop-zone__content {
position: absolute; position: absolute;
@ -1764,8 +1760,7 @@ body.is-dragging-components-draggable {
width: 100%; width: 100%;
text-align: center; text-align: center;
color: #fff; color: #fff;
transition: transform 0.2s ease-in-out; transition: transform 0.2s ease-in-out; }
display: none; }
.components-drop-zone.is-dragging-over-element .components-drop-zone__content { .components-drop-zone.is-dragging-over-element .components-drop-zone__content {
transform: translateY(-50%) scale(1.05); } transform: translateY(-50%) scale(1.05); }

File diff suppressed because one or more lines are too long

View File

@ -732,6 +732,7 @@ svg.dashicon {
fill: currentColor; fill: currentColor;
outline: none; } outline: none; }
/*rtl:begin:ignore*/
.PresetDateRangePicker_panel { .PresetDateRangePicker_panel {
padding: 0 22px 11px; } padding: 0 22px 11px; }
@ -1553,6 +1554,7 @@ svg.dashicon {
width: 15px; width: 15px;
fill: #cacccd; } fill: #cacccd; }
/*rtl:end:ignore*/
.components-datetime .components-datetime__calendar-help { .components-datetime .components-datetime__calendar-help {
padding: 8px; } padding: 8px; }
.components-datetime .components-datetime__calendar-help h4 { .components-datetime .components-datetime__calendar-help h4 {
@ -1751,8 +1753,6 @@ body.is-dragging-components-draggable {
transition: 0.3s opacity, 0.3s background-color; } transition: 0.3s opacity, 0.3s background-color; }
.components-drop-zone.is-dragging-over-element { .components-drop-zone.is-dragging-over-element {
background-color: rgba(0, 113, 161, 0.8); } background-color: rgba(0, 113, 161, 0.8); }
.components-drop-zone.is-dragging-over-element .components-drop-zone__content {
display: block; }
.components-drop-zone__content { .components-drop-zone__content {
position: absolute; position: absolute;
@ -1764,8 +1764,7 @@ body.is-dragging-components-draggable {
width: 100%; width: 100%;
text-align: center; text-align: center;
color: #fff; color: #fff;
transition: transform 0.2s ease-in-out; transition: transform 0.2s ease-in-out; }
display: none; }
.components-drop-zone.is-dragging-over-element .components-drop-zone__content { .components-drop-zone.is-dragging-over-element .components-drop-zone__content {
transform: translateY(-50%) scale(1.05); } transform: translateY(-50%) scale(1.05); }

File diff suppressed because one or more lines are too long

View File

@ -858,7 +858,8 @@ body.admin-color-light .editor-block-list__insertion-point-indicator{
margin-top: 14px; } margin-top: 14px; }
.editor-block-compare__wrapper .editor-block-compare__heading { .editor-block-compare__wrapper .editor-block-compare__heading {
font-size: 1em; font-size: 1em;
font-weight: 400; } font-weight: 400;
margin: 0.67em 0; }
.editor-block-mover { .editor-block-mover {
min-height: 56px; min-height: 56px;

File diff suppressed because one or more lines are too long

View File

@ -870,7 +870,8 @@ body.admin-color-light .editor-block-list__insertion-point-indicator{
margin-top: 14px; } margin-top: 14px; }
.editor-block-compare__wrapper .editor-block-compare__heading { .editor-block-compare__wrapper .editor-block-compare__heading {
font-size: 1em; font-size: 1em;
font-weight: 400; } font-weight: 400;
margin: 0.67em 0; }
.editor-block-mover { .editor-block-mover {
min-height: 56px; min-height: 56px;

File diff suppressed because one or more lines are too long

View File

@ -3203,7 +3203,6 @@ function (_Component) {
height = attributes.height, height = attributes.height,
linkTarget = attributes.linkTarget; linkTarget = attributes.linkTarget;
var isExternal = edit_isExternalImage(id, url); var isExternal = edit_isExternalImage(id, url);
var imageSizeOptions = this.getImageSizeOptions();
var toolbarEditButton; var toolbarEditButton;
if (url) { if (url) {
@ -3262,6 +3261,7 @@ function (_Component) {
}); });
var isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport; var isResizable = ['wide', 'full'].indexOf(align) === -1 && isLargeViewport;
var isLinkURLInputReadOnly = linkDestination !== LINK_DESTINATION_CUSTOM; var isLinkURLInputReadOnly = linkDestination !== LINK_DESTINATION_CUSTOM;
var imageSizeOptions = this.getImageSizeOptions();
var getInspectorControls = function getInspectorControls(imageWidth, imageHeight) { var getInspectorControls = function getInspectorControls(imageWidth, imageHeight) {
return Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["InspectorControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelBody"], { return Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["InspectorControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelBody"], {
@ -3612,6 +3612,19 @@ var image_schema = {
}) })
} }
}; };
function getFirstAnchorAttributeFormHTML(html, attributeName) {
var _document$implementat = document.implementation.createHTMLDocument(''),
body = _document$implementat.body;
body.innerHTML = html;
var firstElementChild = body.firstElementChild;
if (firstElementChild && firstElementChild.nodeName === 'A') {
return firstElementChild.getAttribute(attributeName) || undefined;
}
}
var image_settings = { var image_settings = {
title: Object(external_this_wp_i18n_["__"])('Image'), title: Object(external_this_wp_i18n_["__"])('Image'),
description: Object(external_this_wp_i18n_["__"])('Insert an image to make a visual statement.'), description: Object(external_this_wp_i18n_["__"])('Insert an image to make a visual statement.'),
@ -3694,32 +3707,37 @@ var image_settings = {
caption: { caption: {
shortcode: function shortcode(attributes, _ref) { shortcode: function shortcode(attributes, _ref) {
var _shortcode = _ref.shortcode; var _shortcode = _ref.shortcode;
var content = _shortcode.content;
return content.replace(/\s*<img[^>]*>\s/, ''); var _document$implementat2 = document.implementation.createHTMLDocument(''),
body = _document$implementat2.body;
body.innerHTML = _shortcode.content;
body.removeChild(body.firstElementChild);
return body.innerHTML.trim();
} }
}, },
href: { href: {
type: 'string', shortcode: function shortcode(attributes, _ref2) {
source: 'attribute', var _shortcode2 = _ref2.shortcode;
attribute: 'href', return getFirstAnchorAttributeFormHTML(_shortcode2.content, 'href');
selector: 'a' }
}, },
rel: { rel: {
type: 'string', shortcode: function shortcode(attributes, _ref3) {
source: 'attribute', var _shortcode3 = _ref3.shortcode;
attribute: 'rel', return getFirstAnchorAttributeFormHTML(_shortcode3.content, 'rel');
selector: 'a' }
}, },
linkClass: { linkClass: {
type: 'string', shortcode: function shortcode(attributes, _ref4) {
source: 'attribute', var _shortcode4 = _ref4.shortcode;
attribute: 'class', return getFirstAnchorAttributeFormHTML(_shortcode4.content, 'class');
selector: 'a' }
}, },
id: { id: {
type: 'number', type: 'number',
shortcode: function shortcode(_ref2) { shortcode: function shortcode(_ref5) {
var id = _ref2.named.id; var id = _ref5.named.id;
if (!id) { if (!id) {
return; return;
@ -3730,9 +3748,9 @@ var image_settings = {
}, },
align: { align: {
type: 'string', type: 'string',
shortcode: function shortcode(_ref3) { shortcode: function shortcode(_ref6) {
var _ref3$named$align = _ref3.named.align, var _ref6$named$align = _ref6.named.align,
align = _ref3$named$align === void 0 ? 'alignnone' : _ref3$named$align; align = _ref6$named$align === void 0 ? 'alignnone' : _ref6$named$align;
return align.replace('align', ''); return align.replace('align', '');
} }
} }
@ -3751,10 +3769,10 @@ var image_settings = {
} }
}, },
edit: image_edit, edit: image_edit,
save: function save(_ref4) { save: function save(_ref7) {
var _classnames; var _classnames;
var attributes = _ref4.attributes; var attributes = _ref7.attributes;
var url = attributes.url, var url = attributes.url,
alt = attributes.alt, alt = attributes.alt,
caption = attributes.caption, caption = attributes.caption,
@ -3796,10 +3814,10 @@ var image_settings = {
}, },
deprecated: [{ deprecated: [{
attributes: image_blockAttributes, attributes: image_blockAttributes,
save: function save(_ref5) { save: function save(_ref8) {
var _classnames2; var _classnames2;
var attributes = _ref5.attributes; var attributes = _ref8.attributes;
var url = attributes.url, var url = attributes.url,
alt = attributes.alt, alt = attributes.alt,
caption = attributes.caption, caption = attributes.caption,
@ -3827,8 +3845,8 @@ var image_settings = {
} }
}, { }, {
attributes: image_blockAttributes, attributes: image_blockAttributes,
save: function save(_ref6) { save: function save(_ref9) {
var attributes = _ref6.attributes; var attributes = _ref9.attributes;
var url = attributes.url, var url = attributes.url,
alt = attributes.alt, alt = attributes.alt,
caption = attributes.caption, caption = attributes.caption,
@ -3855,8 +3873,8 @@ var image_settings = {
} }
}, { }, {
attributes: image_blockAttributes, attributes: image_blockAttributes,
save: function save(_ref7) { save: function save(_ref10) {
var attributes = _ref7.attributes; var attributes = _ref10.attributes;
var url = attributes.url, var url = attributes.url,
alt = attributes.alt, alt = attributes.alt,
caption = attributes.caption, caption = attributes.caption,
@ -7313,10 +7331,6 @@ var cover_settings = {
backgroundColor: overlayColor.color backgroundColor: overlayColor.color
}); });
var classes = classnames_default()(className, contentAlign !== 'center' && "has-".concat(contentAlign, "-content"), dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax
});
var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["BlockAlignmentToolbar"], { var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["BlockControls"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["BlockAlignmentToolbar"], {
value: align, value: align,
onChange: updateAlignment onChange: updateAlignment
@ -7387,6 +7401,10 @@ var cover_settings = {
})); }));
} }
var classes = classnames_default()(className, contentAlign !== 'center' && "has-".concat(contentAlign, "-content"), dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax
});
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, controls, Object(external_this_wp_element_["createElement"])("div", { return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, controls, Object(external_this_wp_element_["createElement"])("div", {
"data-url": url, "data-url": url,
style: style, style: style,
@ -9826,8 +9844,6 @@ function (_Component) {
}, { }, {
key: "render", key: "render",
value: function render() { value: function render() {
var _this3 = this;
var _this$props = this.props, var _this$props = this.props,
attributes = _this$props.attributes, attributes = _this$props.attributes,
setAttributes = _this$props.setAttributes, setAttributes = _this$props.setAttributes,
@ -9941,7 +9957,7 @@ function (_Component) {
target: "_blank" target: "_blank"
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(post.title.rendered.trim()) || Object(external_this_wp_i18n_["__"])('(Untitled)')), displayPostDate && post.date_gmt && Object(external_this_wp_element_["createElement"])("time", { }, Object(external_this_wp_htmlEntities_["decodeEntities"])(post.title.rendered.trim()) || Object(external_this_wp_i18n_["__"])('(Untitled)')), displayPostDate && post.date_gmt && Object(external_this_wp_element_["createElement"])("time", {
dateTime: Object(external_this_wp_date_["format"])('c', post.date_gmt), dateTime: Object(external_this_wp_date_["format"])('c', post.date_gmt),
className: "".concat(_this3.props.className, "__post-date") className: "wp-block-latest-posts__post-date"
}, Object(external_this_wp_date_["dateI18n"])(dateFormat, post.date_gmt))); }, Object(external_this_wp_date_["dateI18n"])(dateFormat, post.date_gmt)));
}))); })));
} }
@ -10037,7 +10053,7 @@ var latest_posts_settings = {
getEditWrapperProps: function getEditWrapperProps(attributes) { getEditWrapperProps: function getEditWrapperProps(attributes) {
var align = attributes.align; var align = attributes.align;
if ('left' === align || 'right' === align || 'wide' === align || 'full' === align) { if (['left', 'center', 'right', 'wide', 'full'].includes(align)) {
return { return {
'data-align': align 'data-align': align
}; };

File diff suppressed because one or more lines are too long

View File

@ -6543,11 +6543,10 @@ function cloneBlock(block) {
var factory_isPossibleTransformForSource = function isPossibleTransformForSource(transform, direction, blocks) { var factory_isPossibleTransformForSource = function isPossibleTransformForSource(transform, direction, blocks) {
if (Object(external_lodash_["isEmpty"])(blocks)) { if (Object(external_lodash_["isEmpty"])(blocks)) {
return false; return false;
} } // If multiple blocks are selected, only multi block transforms are allowed.
var isMultiBlock = blocks.length > 1; var isMultiBlock = blocks.length > 1;
var sourceBlock = Object(external_lodash_["first"])(blocks); // If multiple blocks are selected, only multi block transforms are allowed.
var isValidForMultiBlocks = !isMultiBlock || transform.isMultiBlock; var isValidForMultiBlocks = !isMultiBlock || transform.isMultiBlock;
if (!isValidForMultiBlocks) { if (!isValidForMultiBlocks) {
@ -6562,6 +6561,7 @@ var factory_isPossibleTransformForSource = function isPossibleTransformForSource
} // Check if the transform's block name matches the source block only if this is a transform 'from'. } // Check if the transform's block name matches the source block only if this is a transform 'from'.
var sourceBlock = Object(external_lodash_["first"])(blocks);
var hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1; var hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1;
if (!hasMatchingName) { if (!hasMatchingName) {
@ -7955,9 +7955,7 @@ function getCommentDelimitedContent(rawBlockName, attributes, content) {
function serializeBlock(block) { function serializeBlock(block) {
var blockName = block.name; var blockName = block.name;
var blockType = registration_getBlockType(blockName);
var saveContent = getBlockContent(block); var saveContent = getBlockContent(block);
var saveAttributes = getCommentAttributes(blockType, block.attributes);
switch (blockName) { switch (blockName) {
case getFreeformContentHandlerName(): case getFreeformContentHandlerName():
@ -7965,9 +7963,13 @@ function serializeBlock(block) {
return saveContent; return saveContent;
default: default:
{
var blockType = registration_getBlockType(blockName);
var saveAttributes = getCommentAttributes(blockType, block.attributes);
return getCommentDelimitedContent(blockName, saveAttributes, saveContent); return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
} }
} }
}
/** /**
* Takes a block or set of blocks and returns the serialized post content. * Takes a block or set of blocks and returns the serialized post content.
* *

File diff suppressed because one or more lines are too long

View File

@ -29050,6 +29050,10 @@ var react_dates = __webpack_require__(187);
var TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss'; var TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
var date_isRTL = function isRTL() {
return document.documentElement.dir === 'rtl';
};
var date_DatePicker = var date_DatePicker =
/*#__PURE__*/ /*#__PURE__*/
function (_Component) { function (_Component) {
@ -29099,7 +29103,8 @@ function (_Component) {
numberOfMonths: 1, numberOfMonths: 1,
onDateChange: this.onChangeMoment, onDateChange: this.onChangeMoment,
transitionDuration: 0, transitionDuration: 0,
weekDayFormat: "ddd" weekDayFormat: "ddd",
isRTL: date_isRTL()
})); }));
} }
}]); }]);
@ -30346,20 +30351,24 @@ function (_Component) {
'is-close-to-left': position && position.x === 'left', 'is-close-to-left': position && position.x === 'left',
'is-close-to-right': position && position.x === 'right' 'is-close-to-right': position && position.x === 'right'
}, "is-dragging-".concat(type), !!type)); }, "is-dragging-".concat(type), !!type));
return Object(external_this_wp_element_["createElement"])("div", { var children;
ref: this.dropZoneElement,
className: classes if (isDraggingOverElement) {
}, Object(external_this_wp_element_["createElement"])("div", { children = Object(external_this_wp_element_["createElement"])("div", {
className: "components-drop-zone__content" className: "components-drop-zone__content"
}, [Object(external_this_wp_element_["createElement"])(dashicon_Dashicon, { }, Object(external_this_wp_element_["createElement"])(dashicon_Dashicon, {
key: "icon",
icon: "upload", icon: "upload",
size: "40", size: "40",
className: "components-drop-zone__content-icon" className: "components-drop-zone__content-icon"
}), Object(external_this_wp_element_["createElement"])("span", { }), Object(external_this_wp_element_["createElement"])("span", {
key: "text",
className: "components-drop-zone__content-text" className: "components-drop-zone__content-text"
}, label ? label : Object(external_this_wp_i18n_["__"])('Drop files to upload'))])); }, label ? label : Object(external_this_wp_i18n_["__"])('Drop files to upload')));
}
return Object(external_this_wp_element_["createElement"])("div", {
ref: this.dropZoneElement,
className: classes
}, children);
} }
}]); }]);
@ -33749,7 +33758,7 @@ var getStringSize = function getStringSize(n) {
return n + 'px'; return n + 'px';
}; };
var definedProps = ['style', 'className', 'grid', 'snap', 'bounds', 'size', 'defaultSize', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'lockAspectRatio', 'lockAspectRatioExtraWidth', 'lockAspectRatioExtraHeight', 'enable', 'handleStyles', 'handleClasses', 'handleWrapperStyle', 'handleWrapperClass', 'children', 'onResizeStart', 'onResize', 'onResizeStop', 'handleComponent', 'scale']; var definedProps = ['style', 'className', 'grid', 'snap', 'bounds', 'size', 'defaultSize', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'lockAspectRatio', 'lockAspectRatioExtraWidth', 'lockAspectRatioExtraHeight', 'enable', 'handleStyles', 'handleClasses', 'handleWrapperStyle', 'handleWrapperClass', 'children', 'onResizeStart', 'onResize', 'onResizeStop', 'handleComponent', 'scale', 'resizeRatio'];
var baseClassName = '__resizable_base__'; var baseClassName = '__resizable_base__';
@ -33947,8 +33956,9 @@ var lib_Resizable = function (_React$Component) {
minWidth = _props2.minWidth, minWidth = _props2.minWidth,
minHeight = _props2.minHeight; minHeight = _props2.minHeight;
// TODO: refactor var resizeRatio = this.props.resizeRatio || 1;
// TODO: refactor
var parentSize = this.getParentSize(); var parentSize = this.getParentSize();
if (maxWidth && typeof maxWidth === 'string' && endsWith(maxWidth, '%')) { if (maxWidth && typeof maxWidth === 'string' && endsWith(maxWidth, '%')) {
var _ratio = Number(maxWidth.replace('%', '')) / 100; var _ratio = Number(maxWidth.replace('%', '')) / 100;
@ -33975,19 +33985,19 @@ var lib_Resizable = function (_React$Component) {
var newWidth = original.width; var newWidth = original.width;
var newHeight = original.height; var newHeight = original.height;
if (/right/i.test(direction)) { if (/right/i.test(direction)) {
newWidth = original.width + (clientX - original.x) / scale; newWidth = original.width + (clientX - original.x) * resizeRatio / scale;
if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight; if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
} }
if (/left/i.test(direction)) { if (/left/i.test(direction)) {
newWidth = original.width - (clientX - original.x) / scale; newWidth = original.width - (clientX - original.x) * resizeRatio / scale;
if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight; if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
} }
if (/bottom/i.test(direction)) { if (/bottom/i.test(direction)) {
newHeight = original.height + (clientY - original.y) / scale; newHeight = original.height + (clientY - original.y) * resizeRatio / scale;
if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth; if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
} }
if (/top/i.test(direction)) { if (/top/i.test(direction)) {
newHeight = original.height - (clientY - original.y) / scale; newHeight = original.height - (clientY - original.y) * resizeRatio / scale;
if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth; if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
} }
@ -34292,7 +34302,8 @@ lib_Resizable.defaultProps = {
lockAspectRatio: false, lockAspectRatio: false,
lockAspectRatioExtraWidth: 0, lockAspectRatioExtraWidth: 0,
lockAspectRatioExtraHeight: 0, lockAspectRatioExtraHeight: 0,
scale: 1 scale: 1,
resizeRatio: 1
}; };
/* harmony default export */ var re_resizable_lib = (lib_Resizable); /* harmony default export */ var re_resizable_lib = (lib_Resizable);

File diff suppressed because one or more lines are too long

View File

@ -1704,7 +1704,7 @@ function embedPreviews() {
*/ */
function hasUploadPermissions() { function hasUploadPermissions() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var action = arguments.length > 1 ? arguments[1] : undefined; var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) { switch (action.type) {

File diff suppressed because one or more lines are too long

View File

@ -690,12 +690,23 @@ function createReduxStore(reducer, key, registry) {
function mapSelectors(selectors, store) { function mapSelectors(selectors, store) {
var createStateSelector = function createStateSelector(selector) { var createStateSelector = function createStateSelector(selector) {
return function () { return function runSelector() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { // This function is an optimized implementation of:
args[_key] = arguments[_key]; //
// selector( store.getState(), ...arguments )
//
// Where the above would incur an `Array#concat` in its application,
// the logic here instead efficiently constructs an arguments array via
// direct assignment.
var argsLength = arguments.length;
var args = new Array(argsLength + 1);
args[0] = store.getState();
for (var i = 0; i < argsLength; i++) {
args[i + 1] = arguments[i];
} }
return selector.apply(void 0, [store.getState()].concat(args)); return selector.apply(void 0, args);
}; };
}; };
@ -741,8 +752,8 @@ function mapResolvers(resolvers, selectors, fulfillment, store) {
} }
return function () { return function () {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key2] = arguments[_key2]; args[_key] = arguments[_key];
} }
function fulfillSelector() { function fulfillSelector() {
@ -829,29 +840,29 @@ function getCoreDataFulfillment(registry, key) {
return { return {
hasStarted: function hasStarted() { hasStarted: function hasStarted() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key3] = arguments[_key3]; args[_key2] = arguments[_key2];
} }
return hasStartedResolution.apply(void 0, [key].concat(args)); return hasStartedResolution.apply(void 0, [key].concat(args));
}, },
start: function start() { start: function start() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key4] = arguments[_key4]; args[_key3] = arguments[_key3];
} }
return startResolution.apply(void 0, [key].concat(args)); return startResolution.apply(void 0, [key].concat(args));
}, },
finish: function finish() { finish: function finish() {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key5] = arguments[_key5]; args[_key4] = arguments[_key4];
} }
return finishResolution.apply(void 0, [key].concat(args)); return finishResolution.apply(void 0, [key].concat(args));
}, },
fulfill: function fulfill() { fulfill: function fulfill() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key6] = arguments[_key6]; args[_key5] = arguments[_key5];
} }
return fulfillWithRegistry.apply(void 0, [registry, key].concat(args)); return fulfillWithRegistry.apply(void 0, [registry, key].concat(args));
@ -879,9 +890,9 @@ function _fulfillWithRegistry() {
regeneratorRuntime.mark(function _callee2(registry, key, selectorName) { regeneratorRuntime.mark(function _callee2(registry, key, selectorName) {
var namespace, var namespace,
resolver, resolver,
_len7, _len6,
args, args,
_key7, _key6,
action, action,
_args2 = arguments; _args2 = arguments;
@ -900,8 +911,8 @@ function _fulfillWithRegistry() {
return _context2.abrupt("return"); return _context2.abrupt("return");
case 4: case 4:
for (_len7 = _args2.length, args = new Array(_len7 > 3 ? _len7 - 3 : 0), _key7 = 3; _key7 < _len7; _key7++) { for (_len6 = _args2.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
args[_key7 - 3] = _args2[_key7]; args[_key6 - 3] = _args2[_key6];
} }
action = resolver.fulfill.apply(resolver, args); action = resolver.fulfill.apply(resolver, args);

File diff suppressed because one or more lines are too long

View File

@ -697,7 +697,6 @@ function placeCaretAtVerticalEdge(container, isReverse, rect) {
var editableRect = container.getBoundingClientRect(); var editableRect = container.getBoundingClientRect();
var x = rect.left; var x = rect.left;
var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer; var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer;
var selection = window.getSelection();
var range = hiddenCaretRangeFromPoint(document, x, y, container); var range = hiddenCaretRangeFromPoint(document, x, y, container);
if (!range || !container.contains(range.startContainer)) { if (!range || !container.contains(range.startContainer)) {
@ -727,6 +726,7 @@ function placeCaretAtVerticalEdge(container, isReverse, rect) {
} }
} }
var selection = window.getSelection();
selection.removeAllRanges(); selection.removeAllRanges();
selection.addRange(range); selection.addRange(range);
container.focus(); // Editable was already focussed, it goes back to old range... container.focus(); // Editable was already focussed, it goes back to old range...

File diff suppressed because one or more lines are too long

View File

@ -4899,8 +4899,9 @@ function PostLink(_ref) {
var isEnabled = _ref2.isEnabled, var isEnabled = _ref2.isEnabled,
isNew = _ref2.isNew, isNew = _ref2.isNew,
postLink = _ref2.postLink, postLink = _ref2.postLink,
isViewable = _ref2.isViewable; isViewable = _ref2.isViewable,
return isEnabled && !isNew && postLink && isViewable; permalinkParts = _ref2.permalinkParts;
return isEnabled && !isNew && postLink && isViewable && permalinkParts;
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
var _dispatch = dispatch('core/edit-post'), var _dispatch = dispatch('core/edit-post'),
toggleEditorPanelOpened = _dispatch.toggleEditorPanelOpened; toggleEditorPanelOpened = _dispatch.toggleEditorPanelOpened;

File diff suppressed because one or more lines are too long

View File

@ -7854,7 +7854,7 @@ __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_LOW", functio
__webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_NONE", function() { return INSERTER_UTILITY_NONE; }); __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_NONE", function() { return INSERTER_UTILITY_NONE; });
__webpack_require__.d(selectors_namespaceObject, "hasEditorUndo", function() { return hasEditorUndo; }); __webpack_require__.d(selectors_namespaceObject, "hasEditorUndo", function() { return hasEditorUndo; });
__webpack_require__.d(selectors_namespaceObject, "hasEditorRedo", function() { return hasEditorRedo; }); __webpack_require__.d(selectors_namespaceObject, "hasEditorRedo", function() { return hasEditorRedo; });
__webpack_require__.d(selectors_namespaceObject, "isEditedPostNew", function() { return isEditedPostNew; }); __webpack_require__.d(selectors_namespaceObject, "isEditedPostNew", function() { return selectors_isEditedPostNew; });
__webpack_require__.d(selectors_namespaceObject, "hasChangedContent", function() { return hasChangedContent; }); __webpack_require__.d(selectors_namespaceObject, "hasChangedContent", function() { return hasChangedContent; });
__webpack_require__.d(selectors_namespaceObject, "isEditedPostDirty", function() { return selectors_isEditedPostDirty; }); __webpack_require__.d(selectors_namespaceObject, "isEditedPostDirty", function() { return selectors_isEditedPostDirty; });
__webpack_require__.d(selectors_namespaceObject, "isCleanNewPost", function() { return selectors_isCleanNewPost; }); __webpack_require__.d(selectors_namespaceObject, "isCleanNewPost", function() { return selectors_isCleanNewPost; });
@ -7901,8 +7901,8 @@ __webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function()
__webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return selectors_getBlockRootClientId; }); __webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return selectors_getBlockRootClientId; });
__webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; }); __webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; });
__webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; }); __webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; });
__webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return selectors_getPreviousBlockClientId; }); __webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; });
__webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return selectors_getNextBlockClientId; }); __webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; });
__webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return selectors_getSelectedBlocksInitialCaretPosition; }); __webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return selectors_getSelectedBlocksInitialCaretPosition; });
__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return selectors_getMultiSelectedBlockClientIds; }); __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return selectors_getMultiSelectedBlockClientIds; });
__webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; }); __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; });
@ -7947,9 +7947,9 @@ __webpack_require__.d(selectors_namespaceObject, "__experimentalIsFetchingReusab
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlocks", function() { return __experimentalGetReusableBlocks; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlocks", function() { return __experimentalGetReusableBlocks; });
__webpack_require__.d(selectors_namespaceObject, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; }); __webpack_require__.d(selectors_namespaceObject, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; });
__webpack_require__.d(selectors_namespaceObject, "isPublishingPost", function() { return selectors_isPublishingPost; }); __webpack_require__.d(selectors_namespaceObject, "isPublishingPost", function() { return selectors_isPublishingPost; });
__webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function() { return isPermalinkEditable; }); __webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function() { return selectors_isPermalinkEditable; });
__webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; }); __webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; });
__webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return getPermalinkParts; }); __webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return selectors_getPermalinkParts; });
__webpack_require__.d(selectors_namespaceObject, "inSomeHistory", function() { return inSomeHistory; }); __webpack_require__.d(selectors_namespaceObject, "inSomeHistory", function() { return inSomeHistory; });
__webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; }); __webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; });
__webpack_require__.d(selectors_namespaceObject, "getEditorSettings", function() { return selectors_getEditorSettings; }); __webpack_require__.d(selectors_namespaceObject, "getEditorSettings", function() { return selectors_getEditorSettings; });
@ -8464,33 +8464,64 @@ function mapBlockOrder(blocks) {
return result; return result;
} }
/** /**
* Given an array of blocks, returns an object containing all blocks, recursing * Helper method to iterate through all blocks, recursing into inner blocks,
* into inner blocks. Keys correspond to the block client ID, the value of * applying a transformation function to each one.
* which is the block object. * Returns a flattened object with the transformed blocks.
* *
* @param {Array} blocks Blocks to flatten. * @param {Array} blocks Blocks to flatten.
* @param {Function} transform Transforming function to be applied to each block.
* *
* @return {Object} Flattened blocks object. * @return {Object} Flattened object.
*/ */
function getFlattenedBlocks(blocks) { function flattenBlocks(blocks, transform) {
var flattenedBlocks = {}; var result = {};
var stack = Object(toConsumableArray["a" /* default */])(blocks); var stack = Object(toConsumableArray["a" /* default */])(blocks);
while (stack.length) { while (stack.length) {
// `innerBlocks` is redundant data which can fall out of sync, since
// this is reflected in `blocks.order`, so exclude from appended block.
var _stack$shift = stack.shift(), var _stack$shift = stack.shift(),
innerBlocks = _stack$shift.innerBlocks, innerBlocks = _stack$shift.innerBlocks,
block = Object(objectWithoutProperties["a" /* default */])(_stack$shift, ["innerBlocks"]); block = Object(objectWithoutProperties["a" /* default */])(_stack$shift, ["innerBlocks"]);
stack.push.apply(stack, Object(toConsumableArray["a" /* default */])(innerBlocks)); stack.push.apply(stack, Object(toConsumableArray["a" /* default */])(innerBlocks));
flattenedBlocks[block.clientId] = block; result[block.clientId] = transform(block);
} }
return flattenedBlocks; return result;
}
/**
* Given an array of blocks, returns an object containing all blocks, without
* attributes, recursing into inner blocks. Keys correspond to the block client
* ID, the value of which is the attributes object.
*
* @param {Array} blocks Blocks to flatten.
*
* @return {Object} Flattened block attributes object.
*/
function getFlattenedBlocksWithoutAttributes(blocks) {
return flattenBlocks(blocks, function (block) {
return Object(external_lodash_["omit"])(block, 'attributes');
});
}
/**
* Given an array of blocks, returns an object containing all block attributes,
* recursing into inner blocks. Keys correspond to the block client ID, the
* value of which is the attributes object.
*
* @param {Array} blocks Blocks to flatten.
*
* @return {Object} Flattened block attributes object.
*/
function getFlattenedBlockAttributes(blocks) {
return flattenBlocks(blocks, function (block) {
return block.attributes;
});
} }
/** /**
* Given a block order map object, returns *all* of the block client IDs that are * Given a block order map object, returns *all* of the block client IDs that are
@ -8637,7 +8668,8 @@ var reducer_withBlockReset = function withBlockReset(reducer) {
if (state && action.type === 'RESET_BLOCKS') { if (state && action.type === 'RESET_BLOCKS') {
var visibleClientIds = getNestedBlockClientIds(state.order); var visibleClientIds = getNestedBlockClientIds(state.order);
return Object(objectSpread["a" /* default */])({}, state, { return Object(objectSpread["a" /* default */])({}, state, {
byClientId: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.byClientId, visibleClientIds), getFlattenedBlocks(action.blocks)), byClientId: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.byClientId, visibleClientIds), getFlattenedBlocksWithoutAttributes(action.blocks)),
attributes: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.attributes, visibleClientIds), getFlattenedBlockAttributes(action.blocks)),
order: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.order, visibleClientIds), mapBlockOrder(action.blocks)) order: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.order, visibleClientIds), mapBlockOrder(action.blocks))
}); });
} }
@ -8645,6 +8677,45 @@ var reducer_withBlockReset = function withBlockReset(reducer) {
return reducer(state, action); return reducer(state, action);
}; };
}; };
/**
* Higher-order reducer which targets the combined blocks reducer and handles
* the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by
* regular reducers and needs a higher-order reducer since it needs access to
* both `byClientId` and `attributes` simultaneously.
*
* @param {Function} reducer Original reducer function.
*
* @return {Function} Enhanced reducer function.
*/
var reducer_withSaveReusableBlock = function withSaveReusableBlock(reducer) {
return function (state, action) {
if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') {
var id = action.id,
updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one
if (id === updatedId) {
return state;
}
state = Object(objectSpread["a" /* default */])({}, state);
state.attributes = Object(external_lodash_["mapValues"])(state.attributes, function (attributes, clientId) {
var name = state.byClientId[clientId].name;
if (name === 'core/block' && attributes.ref === id) {
return Object(objectSpread["a" /* default */])({}, attributes, {
ref: updatedId
});
}
return attributes;
});
}
return reducer(state, action);
};
};
/** /**
* Undoable reducer returning the editor post state, including blocks parsed * Undoable reducer returning the editor post state, including blocks parsed
* from current HTML markup. * from current HTML markup.
@ -8717,7 +8788,7 @@ with_history({
return state; return state;
}, },
blocks: Object(external_lodash_["flow"])([external_this_wp_data_["combineReducers"], reducer_withBlockReset, // Track whether changes exist, resetting at each post save. Relies on blocks: Object(external_lodash_["flow"])([external_this_wp_data_["combineReducers"], reducer_withBlockReset, reducer_withSaveReusableBlock, // Track whether changes exist, resetting at each post save. Relies on
// editor initialization firing post reset as an effect. // editor initialization firing post reset as an effect.
with_change_detection({ with_change_detection({
resetTypes: ['SETUP_EDITOR_STATE', 'REQUEST_POST_UPDATE_START'], resetTypes: ['SETUP_EDITOR_STATE', 'REQUEST_POST_UPDATE_START'],
@ -8729,10 +8800,60 @@ with_history({
switch (action.type) { switch (action.type) {
case 'SETUP_EDITOR_STATE': case 'SETUP_EDITOR_STATE':
return getFlattenedBlocks(action.blocks); return getFlattenedBlocksWithoutAttributes(action.blocks);
case 'RECEIVE_BLOCKS': case 'RECEIVE_BLOCKS':
return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocks(action.blocks)); return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocksWithoutAttributes(action.blocks));
case 'UPDATE_BLOCK':
// Ignore updates if block isn't known
if (!state[action.clientId]) {
return state;
} // Do nothing if only attributes change.
var changes = Object(external_lodash_["omit"])(action.updates, 'attributes');
if (Object(external_lodash_["isEmpty"])(changes)) {
return state;
}
return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], changes)));
case 'INSERT_BLOCKS':
return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocksWithoutAttributes(action.blocks));
case 'REPLACE_BLOCKS':
if (!action.blocks) {
return state;
}
return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state, action.clientIds), getFlattenedBlocksWithoutAttributes(action.blocks));
case 'REMOVE_BLOCKS':
return Object(external_lodash_["omit"])(state, action.clientIds);
}
return state;
},
attributes: function attributes() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) {
case 'SETUP_EDITOR_STATE':
return getFlattenedBlockAttributes(action.blocks);
case 'RECEIVE_BLOCKS':
return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlockAttributes(action.blocks));
case 'UPDATE_BLOCK':
// Ignore updates if block isn't known or there are no attribute changes.
if (!state[action.clientId] || !action.updates.attributes) {
return state;
}
return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], action.updates.attributes)));
case 'UPDATE_BLOCK_ATTRIBUTES': case 'UPDATE_BLOCK_ATTRIBUTES':
// Ignore updates if block isn't known // Ignore updates if block isn't known
@ -8743,65 +8864,33 @@ with_history({
var nextAttributes = Object(external_lodash_["reduce"])(action.attributes, function (result, value, key) { var nextAttributes = Object(external_lodash_["reduce"])(action.attributes, function (result, value, key) {
if (value !== result[key]) { if (value !== result[key]) {
result = getMutateSafeObject(state[action.clientId].attributes, result); result = getMutateSafeObject(state[action.clientId], result);
result[key] = value; result[key] = value;
} }
return result; return result;
}, state[action.clientId].attributes); // Skip update if nothing has been changed. The reference will }, state[action.clientId]); // Skip update if nothing has been changed. The reference will
// match the original block if `reduce` had no changed values. // match the original block if `reduce` had no changed values.
if (nextAttributes === state[action.clientId].attributes) { if (nextAttributes === state[action.clientId]) {
return state; return state;
} // Otherwise merge attributes into state } // Otherwise replace attributes in state
return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], { return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, nextAttributes));
attributes: nextAttributes
})));
case 'UPDATE_BLOCK':
// Ignore updates if block isn't known
if (!state[action.clientId]) {
return state;
}
return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], action.updates)));
case 'INSERT_BLOCKS': case 'INSERT_BLOCKS':
return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocks(action.blocks)); return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlockAttributes(action.blocks));
case 'REPLACE_BLOCKS': case 'REPLACE_BLOCKS':
if (!action.blocks) { if (!action.blocks) {
return state; return state;
} }
return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state, action.clientIds), getFlattenedBlocks(action.blocks)); return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state, action.clientIds), getFlattenedBlockAttributes(action.blocks));
case 'REMOVE_BLOCKS': case 'REMOVE_BLOCKS':
return Object(external_lodash_["omit"])(state, action.clientIds); return Object(external_lodash_["omit"])(state, action.clientIds);
case 'SAVE_REUSABLE_BLOCK_SUCCESS':
{
var id = action.id,
updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one
if (id === updatedId) {
return state;
}
return Object(external_lodash_["mapValues"])(state, function (block) {
if (block.name === 'core/block' && block.attributes.ref === id) {
return Object(objectSpread["a" /* default */])({}, block, {
attributes: Object(objectSpread["a" /* default */])({}, block.attributes, {
ref: updatedId
})
});
}
return block;
});
}
} }
return state; return state;
@ -8831,7 +8920,7 @@ with_history({
case 'MOVE_BLOCK_TO_POSITION': case 'MOVE_BLOCK_TO_POSITION':
{ {
var _objectSpread6; var _objectSpread7;
var _action$fromRootClien = action.fromRootClientId, var _action$fromRootClien = action.fromRootClientId,
fromRootClientId = _action$fromRootClien === void 0 ? '' : _action$fromRootClien, fromRootClientId = _action$fromRootClien === void 0 ? '' : _action$fromRootClien,
@ -8852,7 +8941,7 @@ with_history({
} // Moving from a parent block to another } // Moving from a parent block to another
return Object(objectSpread["a" /* default */])({}, state, (_objectSpread6 = {}, Object(defineProperty["a" /* default */])(_objectSpread6, fromRootClientId, Object(external_lodash_["without"])(state[fromRootClientId], clientId)), Object(defineProperty["a" /* default */])(_objectSpread6, toRootClientId, insertAt(state[toRootClientId], clientId, _index)), _objectSpread6)); return Object(objectSpread["a" /* default */])({}, state, (_objectSpread7 = {}, Object(defineProperty["a" /* default */])(_objectSpread7, fromRootClientId, Object(external_lodash_["without"])(state[fromRootClientId], clientId)), Object(defineProperty["a" /* default */])(_objectSpread7, toRootClientId, insertAt(state[toRootClientId], clientId, _index)), _objectSpread7));
} }
case 'MOVE_BLOCKS_UP': case 'MOVE_BLOCKS_UP':
@ -9622,7 +9711,7 @@ function autosave() {
return state; return state;
} }
/** /**
* Reducer returning the poost preview link * Reducer returning the post preview link.
* *
* @param {string?} state The preview link * @param {string?} state The preview link
* @param {Object} action Dispatched action. * @param {Object} action Dispatched action.
@ -9636,9 +9725,15 @@ function reducer_previewLink() {
switch (action.type) { switch (action.type) {
case 'REQUEST_POST_UPDATE_SUCCESS': case 'REQUEST_POST_UPDATE_SUCCESS':
return action.post.preview_link || Object(external_this_wp_url_["addQueryArgs"])(action.post.link, { if (action.post.preview_link) {
return action.post.preview_link;
} else if (action.post.link) {
return Object(external_this_wp_url_["addQueryArgs"])(action.post.link, {
preview: true preview: true
}); });
}
return state;
case 'REQUEST_POST_UPDATE_START': case 'REQUEST_POST_UPDATE_START':
// Invalidate known preview link when autosave starts. // Invalidate known preview link when autosave starts.
@ -10571,7 +10666,7 @@ function hasEditorRedo(state) {
* @return {boolean} Whether the post is new. * @return {boolean} Whether the post is new.
*/ */
function isEditedPostNew(state) { function selectors_isEditedPostNew(state) {
return selectors_getCurrentPost(state).status === 'auto-draft'; return selectors_getCurrentPost(state).status === 'auto-draft';
} }
/** /**
@ -10628,7 +10723,7 @@ function selectors_isEditedPostDirty(state) {
*/ */
function selectors_isCleanNewPost(state) { function selectors_isCleanNewPost(state) {
return !selectors_isEditedPostDirty(state) && isEditedPostNew(state); return !selectors_isEditedPostDirty(state) && selectors_isEditedPostNew(state);
} }
/** /**
* Returns the post currently being edited in its last known saved state, not * Returns the post currently being edited in its last known saved state, not
@ -10755,14 +10850,15 @@ function selectors_getCurrentPostAttribute(state, attributeName) {
*/ */
function selectors_getEditedPostAttribute(state, attributeName) { function selectors_getEditedPostAttribute(state, attributeName) {
var edits = getPostEdits(state); // Special cases // Special cases
switch (attributeName) { switch (attributeName) {
case 'content': case 'content':
return getEditedPostContent(state); return getEditedPostContent(state);
} // Fall back to saved post value if not edited. } // Fall back to saved post value if not edited.
var edits = getPostEdits(state);
if (!edits.hasOwnProperty(attributeName)) { if (!edits.hasOwnProperty(attributeName)) {
return selectors_getCurrentPostAttribute(state, attributeName); return selectors_getCurrentPostAttribute(state, attributeName);
} // Merge properties are objects which contain only the patch edit in state, } // Merge properties are objects which contain only the patch edit in state,
@ -10811,11 +10907,14 @@ function getAutosaveAttribute(state, attributeName) {
function selectors_getEditedPostVisibility(state) { function selectors_getEditedPostVisibility(state) {
var status = selectors_getEditedPostAttribute(state, 'status'); var status = selectors_getEditedPostAttribute(state, 'status');
var password = selectors_getEditedPostAttribute(state, 'password');
if (status === 'private') { if (status === 'private') {
return 'private'; return 'private';
} else if (password) { }
var password = selectors_getEditedPostAttribute(state, 'password');
if (password) {
return 'password'; return 'password';
} }
@ -11096,7 +11195,7 @@ var getBlockAttributes = Object(rememo["a" /* default */])(function (state, clie
return null; return null;
} }
var attributes = block.attributes; // Inject custom source attribute values. var attributes = state.editor.present.blocks.attributes[clientId]; // Inject custom source attribute values.
// //
// TODO: Create generic external sourcing pattern, not explicitly // TODO: Create generic external sourcing pattern, not explicitly
// targeting meta attributes. // targeting meta attributes.
@ -11119,7 +11218,7 @@ var getBlockAttributes = Object(rememo["a" /* default */])(function (state, clie
return attributes; return attributes;
}, function (state, clientId) { }, function (state, clientId) {
return [state.editor.present.blocks.byClientId[clientId], state.editor.present.edits.meta, state.initialEdits.meta, state.currentPost.meta]; return [state.editor.present.blocks.byClientId[clientId], state.editor.present.blocks.attributes[clientId], state.editor.present.edits.meta, state.initialEdits.meta, state.currentPost.meta];
}); });
/** /**
* Returns a block given its client ID. This is a parsed copy of the block, * Returns a block given its client ID. This is a parsed copy of the block,
@ -11145,7 +11244,7 @@ var selectors_getBlock = Object(rememo["a" /* default */])(function (state, clie
innerBlocks: selectors_getBlocks(state, clientId) innerBlocks: selectors_getBlocks(state, clientId)
}); });
}, function (state, clientId) { }, function (state, clientId) {
return [state.editor.present.blocks.byClientId[clientId], getBlockDependantsCacheBust(state, clientId)].concat(Object(toConsumableArray["a" /* default */])(getBlockAttributes.getDependants(state, clientId))); return Object(toConsumableArray["a" /* default */])(getBlockAttributes.getDependants(state, clientId)).concat([getBlockDependantsCacheBust(state, clientId)]);
}); });
var selectors_unstableGetBlockWithoutInnerBlocks = Object(rememo["a" /* default */])(function (state, clientId) { var selectors_unstableGetBlockWithoutInnerBlocks = Object(rememo["a" /* default */])(function (state, clientId) {
var block = state.editor.present.blocks.byClientId[clientId]; var block = state.editor.present.blocks.byClientId[clientId];
@ -11476,7 +11575,7 @@ function getAdjacentBlockClientId(state, startClientId) {
* @return {?string} Adjacent block's client ID, or null if none exists. * @return {?string} Adjacent block's client ID, or null if none exists.
*/ */
function selectors_getPreviousBlockClientId(state, startClientId) { function getPreviousBlockClientId(state, startClientId) {
return getAdjacentBlockClientId(state, startClientId, -1); return getAdjacentBlockClientId(state, startClientId, -1);
} }
/** /**
@ -11491,7 +11590,7 @@ function selectors_getPreviousBlockClientId(state, startClientId) {
* @return {?string} Adjacent block's client ID, or null if none exists. * @return {?string} Adjacent block's client ID, or null if none exists.
*/ */
function selectors_getNextBlockClientId(state, startClientId) { function getNextBlockClientId(state, startClientId) {
return getAdjacentBlockClientId(state, startClientId, 1); return getAdjacentBlockClientId(state, startClientId, 1);
} }
/** /**
@ -11573,7 +11672,7 @@ var getMultiSelectedBlocks = Object(rememo["a" /* default */])(function (state)
return selectors_getBlock(state, clientId); return selectors_getBlock(state, clientId);
}); });
}, function (state) { }, function (state) {
return [state.editor.present.blocks.order, state.blockSelection.start, state.blockSelection.end, state.editor.present.blocks.byClientId, state.editor.present.edits.meta, state.initialEdits.meta, state.currentPost.meta]; return Object(toConsumableArray["a" /* default */])(selectors_getMultiSelectedBlockClientIds.getDependants(state)).concat([state.editor.present.blocks, state.editor.present.edits.meta, state.initialEdits.meta, state.currentPost.meta]);
}); });
/** /**
* Returns the client ID of the first block in the multi-selection set, or null * Returns the client ID of the first block in the multi-selection set, or null
@ -11619,7 +11718,7 @@ var isAncestorOf = Object(rememo["a" /* default */])(function (state, possibleAn
return possibleAncestorId === idToCheck; return possibleAncestorId === idToCheck;
}, function (state) { }, function (state) {
return [state.editor.present.blocks]; return [state.editor.present.blocks.order];
}); });
/** /**
* Returns true if a multi-selection exists, and the block corresponding to the * Returns true if a multi-selection exists, and the block corresponding to the
@ -12449,7 +12548,7 @@ var selectors_getInserterItems = Object(rememo["a" /* default */])(function (sta
return Object(external_lodash_["orderBy"])(Object(toConsumableArray["a" /* default */])(blockTypeInserterItems).concat(Object(toConsumableArray["a" /* default */])(reusableBlockInserterItems)), ['utility', 'frecency'], ['desc', 'desc']); return Object(external_lodash_["orderBy"])(Object(toConsumableArray["a" /* default */])(blockTypeInserterItems).concat(Object(toConsumableArray["a" /* default */])(reusableBlockInserterItems)), ['utility', 'frecency'], ['desc', 'desc']);
}, function (state, rootClientId) { }, function (state, rootClientId) {
return [state.blockListSettings[rootClientId], state.editor.present.blocks, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, state.reusableBlocks.data, Object(external_this_wp_blocks_["getBlockTypes"])()]; return [state.blockListSettings[rootClientId], state.editor.present.blocks.byClientId, state.editor.present.blocks.order, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, state.reusableBlocks.data, Object(external_this_wp_blocks_["getBlockTypes"])()];
}); });
/** /**
* Determines whether there are items to show in the inserter. * Determines whether there are items to show in the inserter.
@ -12474,7 +12573,7 @@ var hasInserterItems = Object(rememo["a" /* default */])(function (state) {
}); });
return hasReusableBlock; return hasReusableBlock;
}, function (state, rootClientId) { }, function (state, rootClientId) {
return [state.blockListSettings[rootClientId], state.editor.present.blocks, state.settings.allowedBlockTypes, state.settings.templateLock, state.reusableBlocks.data, Object(external_this_wp_blocks_["getBlockTypes"])()]; return [state.blockListSettings[rootClientId], state.editor.present.blocks.byClientId, state.settings.allowedBlockTypes, state.settings.templateLock, state.reusableBlocks.data, Object(external_this_wp_blocks_["getBlockTypes"])()];
}); });
/** /**
* Returns the reusable block with the given ID. * Returns the reusable block with the given ID.
@ -12588,7 +12687,7 @@ function selectors_isPublishingPost(state) {
* @return {boolean} Whether or not the permalink is editable. * @return {boolean} Whether or not the permalink is editable.
*/ */
function isPermalinkEditable(state) { function selectors_isPermalinkEditable(state) {
var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template'); var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate); return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
} }
@ -12601,7 +12700,7 @@ function isPermalinkEditable(state) {
*/ */
function getPermalink(state) { function getPermalink(state) {
var permalinkParts = getPermalinkParts(state); var permalinkParts = selectors_getPermalinkParts(state);
if (!permalinkParts) { if (!permalinkParts) {
return null; return null;
@ -12611,7 +12710,7 @@ function getPermalink(state) {
postName = permalinkParts.postName, postName = permalinkParts.postName,
suffix = permalinkParts.suffix; suffix = permalinkParts.suffix;
if (isPermalinkEditable(state)) { if (selectors_isPermalinkEditable(state)) {
return prefix + postName + suffix; return prefix + postName + suffix;
} }
@ -12627,7 +12726,7 @@ function getPermalink(state) {
* the permalink, or null if the post is not viewable. * the permalink, or null if the post is not viewable.
*/ */
function getPermalinkParts(state) { function selectors_getPermalinkParts(state) {
var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template'); var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
if (!permalinkTemplate) { if (!permalinkTemplate) {
@ -13319,26 +13418,25 @@ function () {
var _ref = Object(asyncToGenerator["a" /* default */])( var _ref = Object(asyncToGenerator["a" /* default */])(
/*#__PURE__*/ /*#__PURE__*/
regeneratorRuntime.mark(function _callee(action, store) { regeneratorRuntime.mark(function _callee(action, store) {
var dispatch, getState, state, post, isAutosave, edits, toSend, postType, request, newPost, reset, isRevision; var dispatch, getState, state, edits, isAutosave, post, toSend, postType, request, newPost, reset, isRevision;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
dispatch = store.dispatch, getState = store.getState; dispatch = store.dispatch, getState = store.getState;
state = getState(); state = getState(); // Prevent save if not saveable.
post = selectors_getCurrentPost(state);
isAutosave = !!action.options.isAutosave; // Prevent save if not saveable.
// We don't check for dirtiness here as this can be overriden in the UI. // We don't check for dirtiness here as this can be overriden in the UI.
if (selectors_isEditedPostSaveable(state)) { if (selectors_isEditedPostSaveable(state)) {
_context.next = 6; _context.next = 4;
break; break;
} }
return _context.abrupt("return"); return _context.abrupt("return");
case 6: case 4:
edits = getPostEdits(state); edits = getPostEdits(state);
isAutosave = !!action.options.isAutosave;
if (isAutosave) { if (isAutosave) {
edits = Object(external_lodash_["pick"])(edits, ['title', 'content', 'excerpt']); edits = Object(external_lodash_["pick"])(edits, ['title', 'content', 'excerpt']);
@ -13355,12 +13453,13 @@ function () {
// See: https://core.trac.wordpress.org/ticket/43316#comment:89 // See: https://core.trac.wordpress.org/ticket/43316#comment:89
if (isEditedPostNew(state)) { if (selectors_isEditedPostNew(state)) {
edits = Object(objectSpread["a" /* default */])({ edits = Object(objectSpread["a" /* default */])({
status: 'draft' status: 'draft'
}, edits); }, edits);
} }
post = selectors_getCurrentPost(state);
toSend = Object(objectSpread["a" /* default */])({}, edits, { toSend = Object(objectSpread["a" /* default */])({}, edits, {
content: getEditedPostContent(state), content: getEditedPostContent(state),
id: post.id id: post.id
@ -13758,7 +13857,7 @@ function selectPreviousBlock(action, store) {
var rootClientId = selectors_getBlockRootClientId(previousState, firstRemovedBlockClientId); // Client ID of the block that was before the removed block or the var rootClientId = selectors_getBlockRootClientId(previousState, firstRemovedBlockClientId); // Client ID of the block that was before the removed block or the
// rootClientId if the removed block was first amongst its siblings. // rootClientId if the removed block was first amongst its siblings.
var blockClientIdToSelect = selectors_getPreviousBlockClientId(previousState, firstRemovedBlockClientId) || rootClientId; // Dispatch select block action if the currently selected block var blockClientIdToSelect = getPreviousBlockClientId(previousState, firstRemovedBlockClientId) || rootClientId; // Dispatch select block action if the currently selected block
// is not already the block we want to be selected. // is not already the block we want to be selected.
if (blockClientIdToSelect !== selectedBlockClientId) { if (blockClientIdToSelect !== selectedBlockClientId) {
@ -13804,7 +13903,6 @@ function ensureDefaultBlock(action, store) {
secondBlockClientId = _action$blocks[1]; secondBlockClientId = _action$blocks[1];
var blockA = selectors_getBlock(state, firstBlockClientId); var blockA = selectors_getBlock(state, firstBlockClientId);
var blockB = selectors_getBlock(state, secondBlockClientId);
var blockType = Object(external_this_wp_blocks_["getBlockType"])(blockA.name); // Only focus the previous block if it's not mergeable var blockType = Object(external_this_wp_blocks_["getBlockType"])(blockA.name); // Only focus the previous block if it's not mergeable
if (!blockType.merge) { if (!blockType.merge) {
@ -13814,6 +13912,7 @@ function ensureDefaultBlock(action, store) {
// thus, we transform the block to merge first // thus, we transform the block to merge first
var blockB = selectors_getBlock(state, secondBlockClientId);
var blocksWithTheSameType = blockA.name === blockB.name ? [blockB] : Object(external_this_wp_blocks_["switchToBlockType"])(blockB, blockA.name); // If the block types can not match, do nothing var blocksWithTheSameType = blockA.name === blockB.name ? [blockB] : Object(external_this_wp_blocks_["switchToBlockType"])(blockB, blockA.name); // If the block types can not match, do nothing
if (!blocksWithTheSameType || !blocksWithTheSameType.length) { if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
@ -16204,7 +16303,7 @@ var block_view_BlockView = function BlockView(_ref) {
className: className className: className
}, Object(external_this_wp_element_["createElement"])("div", { }, Object(external_this_wp_element_["createElement"])("div", {
className: "editor-block-compare__content" className: "editor-block-compare__content"
}, Object(external_this_wp_element_["createElement"])("h1", { }, Object(external_this_wp_element_["createElement"])("h2", {
className: "editor-block-compare__heading" className: "editor-block-compare__heading"
}, title), Object(external_this_wp_element_["createElement"])("div", { }, title), Object(external_this_wp_element_["createElement"])("div", {
className: "editor-block-compare__html" className: "editor-block-compare__html"
@ -18513,7 +18612,6 @@ function (_Component) {
_this.maybeHover = _this.maybeHover.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.maybeHover = _this.maybeHover.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.forceFocusedContextualToolbar = _this.forceFocusedContextualToolbar.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.forceFocusedContextualToolbar = _this.forceFocusedContextualToolbar.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.hideHoverEffects = _this.hideHoverEffects.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.hideHoverEffects = _this.hideHoverEffects.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.mergeBlocks = _this.mergeBlocks.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.insertBlocksAfter = _this.insertBlocksAfter.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.insertBlocksAfter = _this.insertBlocksAfter.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.preventDrag = _this.preventDrag.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); _this.preventDrag = _this.preventDrag.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
@ -18698,28 +18796,6 @@ function (_Component) {
}); });
} }
} }
}, {
key: "mergeBlocks",
value: function mergeBlocks() {
var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var _this$props3 = this.props,
clientId = _this$props3.clientId,
getPreviousBlockClientId = _this$props3.getPreviousBlockClientId,
getNextBlockClientId = _this$props3.getNextBlockClientId,
onMerge = _this$props3.onMerge;
var previousBlockClientId = getPreviousBlockClientId(clientId);
var nextBlockClientId = getNextBlockClientId(clientId); // Do nothing when it's the first block.
if (!forward && !previousBlockClientId || forward && !nextBlockClientId) {
return;
}
if (forward) {
onMerge(clientId, nextBlockClientId);
} else {
onMerge(previousBlockClientId, clientId);
}
}
}, { }, {
key: "insertBlocksAfter", key: "insertBlocksAfter",
value: function insertBlocksAfter(blocks) { value: function insertBlocksAfter(blocks) {
@ -18818,9 +18894,9 @@ function (_Component) {
case external_this_wp_keycodes_["BACKSPACE"]: case external_this_wp_keycodes_["BACKSPACE"]:
case external_this_wp_keycodes_["DELETE"]: case external_this_wp_keycodes_["DELETE"]:
// Remove block on backspace. // Remove block on backspace.
var _this$props4 = this.props, var _this$props3 = this.props,
clientId = _this$props4.clientId, clientId = _this$props3.clientId,
onRemove = _this$props4.onRemove; onRemove = _this$props3.onRemove;
onRemove(clientId); onRemove(clientId);
event.preventDefault(); event.preventDefault();
break; break;
@ -18953,7 +19029,7 @@ function (_Component) {
setAttributes: _this3.setAttributes, setAttributes: _this3.setAttributes,
insertBlocksAfter: isLocked ? undefined : _this3.insertBlocksAfter, insertBlocksAfter: isLocked ? undefined : _this3.insertBlocksAfter,
onReplace: isLocked ? undefined : onReplace, onReplace: isLocked ? undefined : onReplace,
mergeBlocks: isLocked ? undefined : _this3.mergeBlocks, mergeBlocks: isLocked ? undefined : _this3.props.onMerge,
clientId: clientId, clientId: clientId,
isSelectionEnabled: _this3.props.isSelectionEnabled, isSelectionEnabled: _this3.props.isSelectionEnabled,
toggleSelection: _this3.props.toggleSelection toggleSelection: _this3.props.toggleSelection
@ -19079,8 +19155,6 @@ var applyWithSelect = Object(external_this_wp_data_["withSelect"])(function (sel
getEditorSettings = _select.getEditorSettings, getEditorSettings = _select.getEditorSettings,
hasSelectedInnerBlock = _select.hasSelectedInnerBlock, hasSelectedInnerBlock = _select.hasSelectedInnerBlock,
getTemplateLock = _select.getTemplateLock, getTemplateLock = _select.getTemplateLock,
getPreviousBlockClientId = _select.getPreviousBlockClientId,
getNextBlockClientId = _select.getNextBlockClientId,
__unstableGetBlockWithoutInnerBlocks = _select.__unstableGetBlockWithoutInnerBlocks; __unstableGetBlockWithoutInnerBlocks = _select.__unstableGetBlockWithoutInnerBlocks;
var block = __unstableGetBlockWithoutInnerBlocks(clientId); var block = __unstableGetBlockWithoutInnerBlocks(clientId);
@ -19129,11 +19203,7 @@ var applyWithSelect = Object(external_this_wp_data_["withSelect"])(function (sel
attributes: attributes, attributes: attributes,
isValid: isValid, isValid: isValid,
isSelected: isSelected, isSelected: isSelected,
isParentOfSelectedBlock: isParentOfSelectedBlock, isParentOfSelectedBlock: isParentOfSelectedBlock
// We only care about these selectors when events are triggered.
// We call them dynamically in the event handlers to avoid unnecessary re-renders.
getPreviousBlockClientId: getPreviousBlockClientId,
getNextBlockClientId: getNextBlockClientId
}; };
}); });
var applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function (dispatch, ownProps, _ref4) { var applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function (dispatch, ownProps, _ref4) {
@ -19175,8 +19245,26 @@ var applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function
onRemove: function onRemove(clientId) { onRemove: function onRemove(clientId) {
removeBlock(clientId); removeBlock(clientId);
}, },
onMerge: function onMerge() { onMerge: function onMerge(forward) {
mergeBlocks.apply(void 0, arguments); var clientId = ownProps.clientId;
var _select3 = select('core/editor'),
getPreviousBlockClientId = _select3.getPreviousBlockClientId,
getNextBlockClientId = _select3.getNextBlockClientId;
if (forward) {
var nextBlockClientId = getNextBlockClientId(clientId);
if (nextBlockClientId) {
mergeBlocks(clientId, nextBlockClientId);
}
} else {
var previousBlockClientId = getPreviousBlockClientId(clientId);
if (previousBlockClientId) {
mergeBlocks(previousBlockClientId, clientId);
}
}
}, },
onReplace: function onReplace(blocks) { onReplace: function onReplace(blocks) {
replaceBlocks([ownProps.clientId], blocks); replaceBlocks([ownProps.clientId], blocks);
@ -21232,10 +21320,6 @@ function (_Component) {
items = Object(external_lodash_["isNil"])(items) ? [] : items; items = Object(external_lodash_["isNil"])(items) ? [] : items;
files = Object(external_lodash_["isNil"])(files) ? [] : files; files = Object(external_lodash_["isNil"])(files) ? [] : files;
var item = Object(external_lodash_["find"])(Object(toConsumableArray["a" /* default */])(items).concat(Object(toConsumableArray["a" /* default */])(files)), function (_ref3) {
var type = _ref3.type;
return /^image\/(?:jpe?g|png|gif)$/.test(type);
});
var plainText = ''; var plainText = '';
var html = ''; // IE11 only supports `Text` as an argument for `getData` and will var html = ''; // IE11 only supports `Text` as an argument for `getData` and will
// otherwise throw an invalid argument error, so we try the standard // otherwise throw an invalid argument error, so we try the standard
@ -21261,6 +21345,11 @@ function (_Component) {
window.console.log('Received plain text:\n\n', plainText); // Only process file if no HTML is present. window.console.log('Received plain text:\n\n', plainText); // Only process file if no HTML is present.
// Note: a pasted file may have the URL as plain text. // Note: a pasted file may have the URL as plain text.
var item = Object(external_lodash_["find"])(Object(toConsumableArray["a" /* default */])(items).concat(Object(toConsumableArray["a" /* default */])(files)), function (_ref3) {
var type = _ref3.type;
return /^image\/(?:jpe?g|png|gif)$/.test(type);
});
if (item && !html) { if (item && !html) {
var file = item.getAsFile ? item.getAsFile() : item; var file = item.getAsFile ? item.getAsFile() : item;
@ -21647,12 +21736,13 @@ function (_Component) {
value: function splitContent() { value: function splitContent() {
var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var record = this.createRecord();
if (!this.onSplit) { if (!this.onSplit) {
return; return;
} }
var record = this.createRecord();
var _split = Object(external_this_wp_richText_["split"])(record), var _split = Object(external_this_wp_richText_["split"])(record),
_split2 = Object(slicedToArray["a" /* default */])(_split, 2), _split2 = Object(slicedToArray["a" /* default */])(_split, 2),
before = _split2[0], before = _split2[0],
@ -25904,6 +25994,10 @@ function (_Component) {
} }
var onClick = function onClick() { var onClick = function onClick() {
if (isButtonDisabled) {
return;
}
onSubmit(); onSubmit();
onStatusChange(publishStatus); onStatusChange(publishStatus);
onSave(); onSave();
@ -27299,7 +27393,6 @@ function (_Component) {
isPending = _this$props.isPending, isPending = _this$props.isPending,
isLargeViewport = _this$props.isLargeViewport; isLargeViewport = _this$props.isLargeViewport;
var forceSavedMessage = this.state.forceSavedMessage; var forceSavedMessage = this.state.forceSavedMessage;
var hasPublishAction = Object(external_lodash_["get"])(post, ['_links', 'wp:action-publish'], false);
if (isSaving) { if (isSaving) {
// TODO: Classes generation should be common across all return // TODO: Classes generation should be common across all return
@ -27333,6 +27426,8 @@ function (_Component) {
// is not needed for the contributor role. // is not needed for the contributor role.
var hasPublishAction = Object(external_lodash_["get"])(post, ['_links', 'wp:action-publish'], false);
if (!hasPublishAction && isPending) { if (!hasPublishAction && isPending) {
return null; return null;
} }
@ -28104,7 +28199,9 @@ function PostTaxonomiesCheck(_ref) {
/* harmony default export */ var post_taxonomies_check = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) { /* harmony default export */ var post_taxonomies_check = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
return { return {
postType: select('core/editor').getCurrentPostType(), postType: select('core/editor').getCurrentPostType(),
taxonomies: select('core').getTaxonomies() taxonomies: select('core').getTaxonomies({
per_page: -1
})
}; };
})])(PostTaxonomiesCheck)); })])(PostTaxonomiesCheck));
@ -28379,6 +28476,7 @@ function (_Component) {
* External dependencies * External dependencies
*/ */
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -28452,16 +28550,17 @@ function (_Component) {
var _this2 = this; var _this2 = this;
var _this$props2 = this.props, var _this$props2 = this.props,
isNew = _this$props2.isNew,
postLink = _this$props2.postLink,
permalinkParts = _this$props2.permalinkParts,
postSlug = _this$props2.postSlug,
postTitle = _this$props2.postTitle,
postID = _this$props2.postID,
isEditable = _this$props2.isEditable, isEditable = _this$props2.isEditable,
isPublished = _this$props2.isPublished; isNew = _this$props2.isNew,
isPublished = _this$props2.isPublished,
isViewable = _this$props2.isViewable,
permalinkParts = _this$props2.permalinkParts,
postLink = _this$props2.postLink,
postSlug = _this$props2.postSlug,
postID = _this$props2.postID,
postTitle = _this$props2.postTitle;
if (isNew || !postLink) { if (isNew || !isViewable || !permalinkParts || !postLink) {
return null; return null;
} }
@ -28534,10 +28633,15 @@ function (_Component) {
getEditedPostAttribute = _select.getEditedPostAttribute, getEditedPostAttribute = _select.getEditedPostAttribute,
isCurrentPostPublished = _select.isCurrentPostPublished; isCurrentPostPublished = _select.isCurrentPostPublished;
var _select2 = select('core'),
getPostType = _select2.getPostType;
var _getCurrentPost = getCurrentPost(), var _getCurrentPost = getCurrentPost(),
id = _getCurrentPost.id, id = _getCurrentPost.id,
link = _getCurrentPost.link; link = _getCurrentPost.link;
var postTypeName = getEditedPostAttribute('type');
var postType = getPostType(postTypeName);
return { return {
isNew: isEditedPostNew(), isNew: isEditedPostNew(),
postLink: link, postLink: link,
@ -28546,7 +28650,8 @@ function (_Component) {
isEditable: isPermalinkEditable(), isEditable: isPermalinkEditable(),
isPublished: isCurrentPostPublished(), isPublished: isCurrentPostPublished(),
postTitle: getEditedPostAttribute('title'), postTitle: getEditedPostAttribute('title'),
postID: id postID: id,
isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false)
}; };
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
var _dispatch = dispatch('core/editor'), var _dispatch = dispatch('core/editor'),
@ -31374,6 +31479,8 @@ function (_Component) {
// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/editor-styles/ast/parse.js // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/editor-styles/ast/parse.js
/* eslint-disable @wordpress/no-unused-vars-before-return */
// Adapted from https://github.com/reworkcss/css // Adapted from https://github.com/reworkcss/css
// because we needed to remove source map support. // because we needed to remove source map support.
// http://www.w3.org/TR/CSS21/grammar.htm // http://www.w3.org/TR/CSS21/grammar.htm
@ -32295,6 +32402,7 @@ compress_Compiler.prototype.declaration = function (node) {
}; };
// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/identity.js // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/editor-styles/ast/stringify/identity.js
/* eslint-disable @wordpress/no-unused-vars-before-return */
// Adapted from https://github.com/reworkcss/css // Adapted from https://github.com/reworkcss/css
// because we needed to remove source map support. // because we needed to remove source map support.

File diff suppressed because one or more lines are too long

View File

@ -208,22 +208,26 @@ function createAddHook(hooks) {
if (hooks[hookName]) { if (hooks[hookName]) {
// Find the correct insert index of the new hook. // Find the correct insert index of the new hook.
var handlers = hooks[hookName].handlers; var handlers = hooks[hookName].handlers;
var i = 0; var i;
while (i < handlers.length) { for (i = handlers.length; i > 0; i--) {
if (handlers[i].priority > priority) { if (priority >= handlers[i - 1].priority) {
break; break;
} }
}
i++; if (i === handlers.length) {
} // Insert (or append) the new hook. // If append, operate via direct assignment.
handlers[i] = handler;
} else {
handlers.splice(i, 0, handler); // We may also be currently executing this hook. If the callback // Otherwise, insert before index via splice.
handlers.splice(i, 0, handler);
} // We may also be currently executing this hook. If the callback
// we're adding would come after the current callback, there's no // we're adding would come after the current callback, there's no
// problem; otherwise we need to increase the execution index of // problem; otherwise we need to increase the execution index of
// any other runs by 1 to account for the added element. // any other runs by 1 to account for the added element.
(hooks.__current || []).forEach(function (hookInfo) { (hooks.__current || []).forEach(function (hookInfo) {
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) { if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
hookInfo.currentIndex++; hookInfo.currentIndex++;

View File

@ -1 +1 @@
this.wp=this.wp||{},this.wp.hooks=function(n){var r={};function e(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=r,e.d=function(n,r,t){e.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:t})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,r){if(1&r&&(n=e(n)),8&r)return n;if(4&r&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(e.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&r&&"string"!=typeof n)for(var o in n)e.d(t,o,function(r){return n[r]}.bind(null,o));return t},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s=312)}({312:function(n,r,e){"use strict";e.r(r);var t=function(n){return"string"!=typeof n||""===n?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(n)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var o=function(n){return"string"!=typeof n||""===n?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(n)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(n)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var i=function(n){return function(r,e,i){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(o(r)&&t(e))if("function"==typeof i)if("number"==typeof u){var c={callback:i,priority:u,namespace:e};if(n[r]){for(var l=n[r].handlers,a=0;a<l.length&&!(l[a].priority>u);)a++;l.splice(a,0,c),(n.__current||[]).forEach(function(n){n.name===r&&n.currentIndex>=a&&n.currentIndex++})}else n[r]={handlers:[c],runs:0};"hookAdded"!==r&&F("hookAdded",r,e,i,u)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var u=function(n,r){return function(e,i){if(o(e)&&(r||t(i))){if(!n[e])return 0;var u=0;if(r)u=n[e].handlers.length,n[e]={runs:n[e].runs,handlers:[]};else for(var c=n[e].handlers,l=function(r){c[r].namespace===i&&(c.splice(r,1),u++,(n.__current||[]).forEach(function(n){n.name===e&&n.currentIndex>=r&&n.currentIndex--}))},a=c.length-1;a>=0;a--)l(a);return"hookRemoved"!==e&&F("hookRemoved",e,i),u}}};var c=function(n){return function(r){return r in n}};var l=function(n,r){return function(e){n[e]||(n[e]={handlers:[],runs:0}),n[e].runs++;for(var t=n[e].handlers,o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];if(!t||!t.length)return r?i[0]:void 0;var c={name:e,currentIndex:0};for(n.__current.push(c);c.currentIndex<t.length;){var l=t[c.currentIndex].callback.apply(null,i);r&&(i[0]=l),c.currentIndex++}return n.__current.pop(),r?i[0]:void 0}};var a=function(n){return function(){return n.__current&&n.__current.length?n.__current[n.__current.length-1].name:null}};var d=function(n){return function(r){return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};var s=function(n){return function(r){if(o(r))return n[r]&&n[r].runs?n[r].runs:0}};var f=function(){var n=Object.create(null),r=Object.create(null);return n.__current=[],r.__current=[],{addAction:i(n),addFilter:i(r),removeAction:u(n),removeFilter:u(r),hasAction:c(n),hasFilter:c(r),removeAllActions:u(n,!0),removeAllFilters:u(r,!0),doAction:l(n),applyFilters:l(r,!0),currentAction:a(n),currentFilter:a(r),doingAction:d(n),doingFilter:d(r),didAction:s(n),didFilter:s(r),actions:n,filters:r}};e.d(r,"addAction",function(){return p}),e.d(r,"addFilter",function(){return v}),e.d(r,"removeAction",function(){return m}),e.d(r,"removeFilter",function(){return _}),e.d(r,"hasAction",function(){return A}),e.d(r,"hasFilter",function(){return y}),e.d(r,"removeAllActions",function(){return b}),e.d(r,"removeAllFilters",function(){return g}),e.d(r,"doAction",function(){return F}),e.d(r,"applyFilters",function(){return k}),e.d(r,"currentAction",function(){return x}),e.d(r,"currentFilter",function(){return j}),e.d(r,"doingAction",function(){return I}),e.d(r,"doingFilter",function(){return O}),e.d(r,"didAction",function(){return T}),e.d(r,"didFilter",function(){return w}),e.d(r,"actions",function(){return P}),e.d(r,"filters",function(){return S}),e.d(r,"createHooks",function(){return f});var h=f(),p=h.addAction,v=h.addFilter,m=h.removeAction,_=h.removeFilter,A=h.hasAction,y=h.hasFilter,b=h.removeAllActions,g=h.removeAllFilters,F=h.doAction,k=h.applyFilters,x=h.currentAction,j=h.currentFilter,I=h.doingAction,O=h.doingFilter,T=h.didAction,w=h.didFilter,P=h.actions,S=h.filters}}); this.wp=this.wp||{},this.wp.hooks=function(n){var r={};function e(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=r,e.d=function(n,r,t){e.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:t})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,r){if(1&r&&(n=e(n)),8&r)return n;if(4&r&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(e.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&r&&"string"!=typeof n)for(var o in n)e.d(t,o,function(r){return n[r]}.bind(null,o));return t},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s=312)}({312:function(n,r,e){"use strict";e.r(r);var t=function(n){return"string"!=typeof n||""===n?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(n)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var o=function(n){return"string"!=typeof n||""===n?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(n)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(n)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var i=function(n){return function(r,e,i){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(o(r)&&t(e))if("function"==typeof i)if("number"==typeof u){var c={callback:i,priority:u,namespace:e};if(n[r]){var l,a=n[r].handlers;for(l=a.length;l>0&&!(u>=a[l-1].priority);l--);l===a.length?a[l]=c:a.splice(l,0,c),(n.__current||[]).forEach(function(n){n.name===r&&n.currentIndex>=l&&n.currentIndex++})}else n[r]={handlers:[c],runs:0};"hookAdded"!==r&&F("hookAdded",r,e,i,u)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var u=function(n,r){return function(e,i){if(o(e)&&(r||t(i))){if(!n[e])return 0;var u=0;if(r)u=n[e].handlers.length,n[e]={runs:n[e].runs,handlers:[]};else for(var c=n[e].handlers,l=function(r){c[r].namespace===i&&(c.splice(r,1),u++,(n.__current||[]).forEach(function(n){n.name===e&&n.currentIndex>=r&&n.currentIndex--}))},a=c.length-1;a>=0;a--)l(a);return"hookRemoved"!==e&&F("hookRemoved",e,i),u}}};var c=function(n){return function(r){return r in n}};var l=function(n,r){return function(e){n[e]||(n[e]={handlers:[],runs:0}),n[e].runs++;for(var t=n[e].handlers,o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];if(!t||!t.length)return r?i[0]:void 0;var c={name:e,currentIndex:0};for(n.__current.push(c);c.currentIndex<t.length;){var l=t[c.currentIndex].callback.apply(null,i);r&&(i[0]=l),c.currentIndex++}return n.__current.pop(),r?i[0]:void 0}};var a=function(n){return function(){return n.__current&&n.__current.length?n.__current[n.__current.length-1].name:null}};var d=function(n){return function(r){return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};var s=function(n){return function(r){if(o(r))return n[r]&&n[r].runs?n[r].runs:0}};var f=function(){var n=Object.create(null),r=Object.create(null);return n.__current=[],r.__current=[],{addAction:i(n),addFilter:i(r),removeAction:u(n),removeFilter:u(r),hasAction:c(n),hasFilter:c(r),removeAllActions:u(n,!0),removeAllFilters:u(r,!0),doAction:l(n),applyFilters:l(r,!0),currentAction:a(n),currentFilter:a(r),doingAction:d(n),doingFilter:d(r),didAction:s(n),didFilter:s(r),actions:n,filters:r}};e.d(r,"addAction",function(){return p}),e.d(r,"addFilter",function(){return v}),e.d(r,"removeAction",function(){return m}),e.d(r,"removeFilter",function(){return _}),e.d(r,"hasAction",function(){return A}),e.d(r,"hasFilter",function(){return y}),e.d(r,"removeAllActions",function(){return b}),e.d(r,"removeAllFilters",function(){return g}),e.d(r,"doAction",function(){return F}),e.d(r,"applyFilters",function(){return k}),e.d(r,"currentAction",function(){return x}),e.d(r,"currentFilter",function(){return j}),e.d(r,"doingAction",function(){return I}),e.d(r,"doingFilter",function(){return O}),e.d(r,"didAction",function(){return T}),e.d(r,"didFilter",function(){return w}),e.d(r,"actions",function(){return P}),e.d(r,"filters",function(){return S}),e.d(r,"createHooks",function(){return f});var h=f(),p=h.addAction,v=h.addFilter,m=h.removeAction,_=h.removeFilter,A=h.hasAction,y=h.hasFilter,b=h.removeAllActions,g=h.removeAllFilters,F=h.doAction,k=h.applyFilters,x=h.currentAction,j=h.currentFilter,I=h.doingAction,O=h.doingFilter,T=h.didAction,w=h.didFilter,P=h.actions,S=h.filters}});

View File

@ -87,28 +87,6 @@ this["wp"] = this["wp"] || {}; this["wp"]["url"] =
/************************************************************************/ /************************************************************************/
/******/ ({ /******/ ({
/***/ 15:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/***/ }),
/***/ 179: /***/ 179:
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
@ -394,11 +372,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return prependHTTP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return prependHTTP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return safeDecodeURI; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return safeDecodeURI; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterURLForDisplay", function() { return filterURLForDisplay; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterURLForDisplay", function() { return filterURLForDisplay; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76);
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76); /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_1__);
/** /**
* External dependencies * External dependencies
*/ */
@ -568,19 +543,32 @@ function isValidFragment(fragment) {
return /^#[^\s#?\/]*$/.test(fragment); return /^#[^\s#?\/]*$/.test(fragment);
} }
/** /**
* Appends arguments to the query string of the url * Appends arguments as querystring to the provided URL. If the URL already
* includes query arguments, the arguments are merged with (and take precedent
* over) the existing set.
* *
* @param {string} url URL * @param {?string} url URL to which arguments should be appended. If omitted,
* @param {Object} args Query Args * only the resulting querystring is returned.
* @param {Object} args Query arguments to apply to URL.
* *
* @return {string} Updated URL * @return {string} URL with arguments applied.
*/ */
function addQueryArgs(url, args) { function addQueryArgs() {
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var args = arguments.length > 1 ? arguments[1] : undefined;
var baseUrl = url; // Determine whether URL already had query arguments.
var queryStringIndex = url.indexOf('?'); var queryStringIndex = url.indexOf('?');
var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_1__["parse"])(url.substr(queryStringIndex + 1)) : {};
var baseUrl = queryStringIndex !== -1 ? url.substr(0, queryStringIndex) : url; if (queryStringIndex !== -1) {
return baseUrl + '?' + Object(qs__WEBPACK_IMPORTED_MODULE_1__["stringify"])(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, query, args)); // Merge into existing query arguments.
args = Object.assign(Object(qs__WEBPACK_IMPORTED_MODULE_0__["parse"])(url.substr(queryStringIndex + 1)), args); // Change working base URL to omit previous query arguments.
baseUrl = baseUrl.substr(0, queryStringIndex);
}
return baseUrl + '?' + Object(qs__WEBPACK_IMPORTED_MODULE_0__["stringify"])(args);
} }
/** /**
* Returns a single query argument of the url * Returns a single query argument of the url
@ -593,7 +581,7 @@ function addQueryArgs(url, args) {
function getQueryArg(url, arg) { function getQueryArg(url, arg) {
var queryStringIndex = url.indexOf('?'); var queryStringIndex = url.indexOf('?');
var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_1__["parse"])(url.substr(queryStringIndex + 1)) : {}; var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_0__["parse"])(url.substr(queryStringIndex + 1)) : {};
return query[arg]; return query[arg];
} }
/** /**
@ -619,7 +607,7 @@ function hasQueryArg(url, arg) {
function removeQueryArgs(url) { function removeQueryArgs(url) {
var queryStringIndex = url.indexOf('?'); var queryStringIndex = url.indexOf('?');
var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_1__["parse"])(url.substr(queryStringIndex + 1)) : {}; var query = queryStringIndex !== -1 ? Object(qs__WEBPACK_IMPORTED_MODULE_0__["parse"])(url.substr(queryStringIndex + 1)) : {};
var baseUrl = queryStringIndex !== -1 ? url.substr(0, queryStringIndex) : url; var baseUrl = queryStringIndex !== -1 ? url.substr(0, queryStringIndex) : url;
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@ -629,7 +617,7 @@ function removeQueryArgs(url) {
args.forEach(function (arg) { args.forEach(function (arg) {
return delete query[arg]; return delete query[arg];
}); });
return baseUrl + '?' + Object(qs__WEBPACK_IMPORTED_MODULE_1__["stringify"])(query); return baseUrl + '?' + Object(qs__WEBPACK_IMPORTED_MODULE_0__["stringify"])(query);
} }
/** /**
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD. * Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
@ -1185,34 +1173,6 @@ module.exports = {
}; };
/***/ }),
/***/ 8:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
});
}
return target;
}
/***/ }) /***/ })
/******/ }); /******/ });

File diff suppressed because one or more lines are too long

View File

@ -344,6 +344,7 @@ var build_module_queries = Object(external_lodash_["reduce"])(BREAKPOINTS, funct
window.addEventListener('orientationchange', build_module_setIsMatching); // Set initial values window.addEventListener('orientationchange', build_module_setIsMatching); // Set initial values
build_module_setIsMatching(); build_module_setIsMatching();
build_module_setIsMatching.flush();
/***/ }), /***/ }),

View File

@ -1 +1 @@
this.wp=this.wp||{},this.wp.viewport=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=317)}({2:function(t,e){!function(){t.exports=this.lodash}()},317:function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"setIsMatching",function(){return a});var i={};n.r(i),n.d(i,"isViewportMatch",function(){return f});var o=n(2),c=n(5);var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_MATCHING":return e.values}return t};function a(t){return{type:"SET_IS_MATCHING",values:t}}function f(t,e){return-1===e.indexOf(" ")&&(e=">= "+e),!!t[e]}Object(c.registerStore)("core/viewport",{reducer:u,actions:r,selectors:i});var s=n(7),p=function(t){return Object(s.createHigherOrderComponent)(Object(c.withSelect)(function(e){return Object(o.mapValues)(t,function(t){return e("core/viewport").isViewportMatch(t)})}),"withViewportMatch")},d=function(t){return Object(s.createHigherOrderComponent)(Object(s.compose)([p({isViewportMatch:t}),Object(s.ifCondition)(function(t){return t.isViewportMatch})]),"ifViewportMatches")};n.d(e,"ifViewportMatches",function(){return d}),n.d(e,"withViewportMatch",function(){return p});var l={"<":"max-width",">=":"min-width"},h=Object(o.debounce)(function(){var t=Object(o.mapValues)(w,function(t){return t.matches});Object(c.dispatch)("core/viewport").setIsMatching(t)},{leading:!0}),w=Object(o.reduce)({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},function(t,e,n){return Object(o.forEach)(l,function(r,i){var o=window.matchMedia("(".concat(r,": ").concat(e,"px)"));o.addListener(h);var c=[i,n].join(" ");t[c]=o}),t},{});window.addEventListener("orientationchange",h),h()},5:function(t,e){!function(){t.exports=this.wp.data}()},7:function(t,e){!function(){t.exports=this.wp.compose}()}}); this.wp=this.wp||{},this.wp.viewport=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=317)}({2:function(t,e){!function(){t.exports=this.lodash}()},317:function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"setIsMatching",function(){return a});var i={};n.r(i),n.d(i,"isViewportMatch",function(){return f});var o=n(2),c=n(5);var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_MATCHING":return e.values}return t};function a(t){return{type:"SET_IS_MATCHING",values:t}}function f(t,e){return-1===e.indexOf(" ")&&(e=">= "+e),!!t[e]}Object(c.registerStore)("core/viewport",{reducer:u,actions:r,selectors:i});var s=n(7),p=function(t){return Object(s.createHigherOrderComponent)(Object(c.withSelect)(function(e){return Object(o.mapValues)(t,function(t){return e("core/viewport").isViewportMatch(t)})}),"withViewportMatch")},d=function(t){return Object(s.createHigherOrderComponent)(Object(s.compose)([p({isViewportMatch:t}),Object(s.ifCondition)(function(t){return t.isViewportMatch})]),"ifViewportMatches")};n.d(e,"ifViewportMatches",function(){return d}),n.d(e,"withViewportMatch",function(){return p});var l={"<":"max-width",">=":"min-width"},h=Object(o.debounce)(function(){var t=Object(o.mapValues)(w,function(t){return t.matches});Object(c.dispatch)("core/viewport").setIsMatching(t)},{leading:!0}),w=Object(o.reduce)({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},function(t,e,n){return Object(o.forEach)(l,function(r,i){var o=window.matchMedia("(".concat(r,": ").concat(e,"px)"));o.addListener(h);var c=[i,n].join(" ");t[c]=o}),t},{});window.addEventListener("orientationchange",h),h(),h.flush()},5:function(t,e){!function(){t.exports=this.wp.data}()},7:function(t,e){!function(){t.exports=this.wp.compose}()}});

View File

@ -224,42 +224,42 @@ function wp_default_packages_scripts( &$scripts ) {
$suffix = wp_scripts_get_suffix(); $suffix = wp_scripts_get_suffix();
$packages_versions = array( $packages_versions = array(
'api-fetch' => '2.2.6', 'api-fetch' => '2.2.7',
'a11y' => '2.0.2', 'a11y' => '2.0.2',
'annotations' => '1.0.4', 'annotations' => '1.0.5',
'autop' => '2.0.2', 'autop' => '2.0.2',
'blob' => '2.1.0', 'blob' => '2.1.0',
'block-library' => '2.2.11', 'block-library' => '2.2.12',
'block-serialization-default-parser' => '2.0.2', 'block-serialization-default-parser' => '2.0.3',
'blocks' => '6.0.4', 'blocks' => '6.0.5',
'components' => '7.0.4', 'components' => '7.0.5',
'compose' => '3.0.0', 'compose' => '3.0.0',
'core-data' => '2.0.15', 'core-data' => '2.0.16',
'data' => '4.1.0', 'data' => '4.2.0',
'date' => '3.0.1', 'date' => '3.0.1',
'deprecated' => '2.0.3', 'deprecated' => '2.0.4',
'dom' => '2.0.7', 'dom' => '2.0.8',
'dom-ready' => '2.0.2', 'dom-ready' => '2.0.2',
'edit-post' => '3.1.6', 'edit-post' => '3.1.7',
'editor' => '9.0.6', 'editor' => '9.0.7',
'element' => '2.1.8', 'element' => '2.1.8',
'escape-html' => '1.0.1', 'escape-html' => '1.0.1',
'format-library' => '1.2.9', 'format-library' => '1.2.10',
'hooks' => '2.0.3', 'hooks' => '2.0.4',
'html-entities' => '2.0.4', 'html-entities' => '2.0.4',
'i18n' => '3.1.0', 'i18n' => '3.1.0',
'is-shallow-equal' => '1.1.4', 'is-shallow-equal' => '1.1.4',
'keycodes' => '2.0.5', 'keycodes' => '2.0.5',
'list-reusable-blocks' => '1.1.17', 'list-reusable-blocks' => '1.1.18',
'notices' => '1.1.1', 'notices' => '1.1.2',
'nux' => '3.0.5', 'nux' => '3.0.6',
'plugins' => '2.0.9', 'plugins' => '2.0.10',
'redux-routine' => '3.0.3', 'redux-routine' => '3.0.3',
'rich-text' => '3.0.3', 'rich-text' => '3.0.4',
'shortcode' => '2.0.2', 'shortcode' => '2.0.2',
'token-list' => '1.1.0', 'token-list' => '1.1.0',
'url' => '2.3.2', 'url' => '2.3.3',
'viewport' => '2.0.13', 'viewport' => '2.1.0',
'wordcount' => '2.0.3', 'wordcount' => '2.0.3',
); );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.1-alpha-44388'; $wp_version = '5.1-alpha-44389';
/** /**
* 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.