Make WordPress Core


Ignore:
Timestamp:
02/07/2023 07:01:56 AM (4 years ago)
Author:
youknowriad
Message:

Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes.

In addition to all the packages being updated to the latest versions,
this commit also includes some mandatory changes to avoid editor breakage:

  • Update React to to 18.2.0.
  • Add the right stylesheets to support iframed block editors.

Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-parser.php

    r54257 r55246  
    8181         * @param array  $innerContent List of string fragments and null markers where inner blocks were found.
    8282         */
    83         function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {
     83        public function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {
    8484                $this->blockName    = $name;
    8585                $this->attrs        = $attrs;
     
    153153         * @param int                   $leading_html_start Byte offset into document where leading HTML before token starts.
    154154         */
    155         function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
     155        public function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
    156156                $this->block              = $block;
    157157                $this->token_start        = $token_start;
     
    225225         * @return array[]
    226226         */
    227         function parse( $document ) {
     227        public function parse( $document ) {
    228228                $this->document    = $document;
    229229                $this->offset      = 0;
     
    232232                $this->empty_attrs = json_decode( '{}', true );
    233233
    234                 do {
    235                         // twiddle our thumbs.
    236                 } while ( $this->proceed() );
     234                while ( $this->proceed() ) {
     235                        continue;
     236                }
    237237
    238238                return $this->output;
     
    253253         * @return bool
    254254         */
    255         function proceed() {
     255        public function proceed() {
    256256                $next_token = $this->next_token();
    257257                list( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token;
     
    399399         * @return array
    400400         */
    401         function next_token() {
     401        public function next_token() {
    402402                $matches = null;
    403403
     
    474474         * @return WP_Block_Parser_Block freeform block object.
    475475         */
    476         function freeform( $innerHTML ) {
     476        public function freeform( $innerHTML ) {
    477477                return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) );
    478478        }
     
    486486         * @param null $length how many bytes of document text to output.
    487487         */
    488         function add_freeform( $length = null ) {
     488        public function add_freeform( $length = null ) {
    489489                $length = $length ? $length : strlen( $this->document ) - $this->offset;
    490490
     
    507507         * @param int|null              $last_offset  Last byte offset into document if continuing form earlier output.
    508508         */
    509         function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {
     509        public function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {
    510510                $parent                       = $this->stack[ count( $this->stack ) - 1 ];
    511511                $parent->block->innerBlocks[] = (array) $block;
     
    528528         * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML.
    529529         */
    530         function add_block_from_stack( $end_offset = null ) {
     530        public function add_block_from_stack( $end_offset = null ) {
    531531                $stack_top   = array_pop( $this->stack );
    532532                $prev_offset = $stack_top->prev_offset;
Note: See TracChangeset for help on using the changeset viewer.