diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/js/jquery/ui/core.js --- a/wp/wp-includes/js/jquery/ui/core.js Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-includes/js/jquery/ui/core.js Tue Sep 27 16:37:53 2022 +0200 @@ -1,8 +1,10 @@ -/*! jQuery UI - v1.12.1 - 2020-09-25 +/*! jQuery UI - v1.13.1 - 2022-01-20 * http://jqueryui.com * Includes: data.js, disable-selection.js, escape-selector.js, focusable.js, form-reset-mixin.js, form.js, ie.js, jquery-1-7.js, keycode.js, labels.js, plugin.js, position.js, safe-active-element.js, safe-blur.js, scroll-parent.js, tabbable.js, unique-id.js, version.js, widget.js * Copyright jQuery Foundation and other contributors; Licensed */ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -13,15 +15,16 @@ factory( jQuery ); } } ( function( $ ) { +"use strict"; // Source: version.js $.ui = $.ui || {}; -$.ui.version = "1.12.1"; +$.ui.version = "1.13.1"; // Source: data.js /*! - * jQuery UI :data 1.12.1 + * jQuery UI :data 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -34,7 +37,7 @@ //>>description: Selects elements which have data stored under the specified key. //>>docs: http://api.jqueryui.com/data-selector/ -$.extend( $.expr[ ":" ], { +$.extend( $.expr.pseudos, { data: $.expr.createPseudo ? $.expr.createPseudo( function( dataName ) { return function( elem ) { @@ -48,10 +51,9 @@ } } ); - // Source: disable-selection.js /*! - * jQuery UI Disable Selection 1.12.1 + * jQuery UI Disable Selection 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -83,18 +85,9 @@ } } ); -// Source: escape-selector.js -// Internal use only -$.ui.escapeSelector = ( function() { - var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g; - return function( selector ) { - return selector.replace( selectorEscape, "\\$1" ); - }; -} )(); - // Source: focusable.js /*! - * jQuery UI Focusable 1.12.1 + * jQuery UI Focusable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -153,26 +146,25 @@ element = element.parent(); visibility = element.css( "visibility" ); } - return visibility !== "hidden"; + return visibility === "visible"; } -$.extend( $.expr[ ":" ], { +$.extend( $.expr.pseudos, { focusable: function( element ) { return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); } } ); -// Source: form.js // Support: IE8 Only // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop // with a string, so we need to find the proper form. -$.fn.form = function() { +$.fn._form = function() { return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); }; // Source: form-reset-mixin.js /*! - * jQuery UI Form Reset Mixin 1.12.1 + * jQuery UI Form Reset Mixin 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -199,7 +191,7 @@ }, _bindFormResetHandler: function() { - this.form = this.element.form(); + this.form = this.element._form(); if ( !this.form.length ) { return; } @@ -235,9 +227,9 @@ // This file is deprecated $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); -// Source: jquery-1-7.js +// Source: jquery-patch.js /*! - * jQuery UI Support for jQuery core 1.7.x 1.12.1 + * jQuery UI Support for jQuery core 1.8.x and newer 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -246,75 +238,72 @@ * */ -//>>label: jQuery 1.7 Support +//>>label: jQuery 1.8+ Support //>>group: Core -//>>description: Support version 1.7.x of jQuery core +//>>description: Support version 1.8.x and newer of jQuery core -// Support: jQuery 1.7 only -// Not a great way to check versions, but since we only support 1.7+ and only -// need to detect <1.8, this is a simple check that should suffice. Checking -// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0 -// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting -// 1.7 anymore). See #11197 for why we're not using feature detection. -if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) { +// Support: jQuery 1.9.x or older +// $.expr[ ":" ] is deprecated. +if ( !$.expr.pseudos ) { + $.expr.pseudos = $.expr[ ":" ]; +} + +// Support: jQuery 1.11.x or older +// $.unique has been renamed to $.uniqueSort +if ( !$.uniqueSort ) { + $.uniqueSort = $.unique; +} - // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight() - // Unlike jQuery Core 1.8+, these only support numeric values to set the - // dimensions in pixels - $.each( [ "Width", "Height" ], function( i, name ) { - var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], - type = name.toLowerCase(), - orig = { - innerWidth: $.fn.innerWidth, - innerHeight: $.fn.innerHeight, - outerWidth: $.fn.outerWidth, - outerHeight: $.fn.outerHeight - }; +// Support: jQuery 2.2.x or older. +// This method has been defined in jQuery 3.0.0. +// Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js +if ( !$.escapeSelector ) { + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; - function reduce( elem, size, border, margin ) { - $.each( side, function() { - size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; - if ( border ) { - size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; - } - if ( margin ) { - size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; - } - } ); - return size; + var fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } - $.fn[ "inner" + name ] = function( size ) { - if ( size === undefined ) { - return orig[ "inner" + name ].call( this ); - } + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }; - return this.each( function() { - $( this ).css( type, reduce( this, size ) + "px" ); - } ); - }; + $.escapeSelector = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); + }; +} - $.fn[ "outer" + name ] = function( size, margin ) { - if ( typeof size !== "number" ) { - return orig[ "outer" + name ].call( this, size ); - } - - return this.each( function() { - $( this ).css( type, reduce( this, size, true, margin ) + "px" ); +// Support: jQuery 3.4.x or older +// These methods have been defined in jQuery 3.5.0. +if ( !$.fn.even || !$.fn.odd ) { + $.fn.extend( { + even: function() { + return this.filter( function( i ) { + return i % 2 === 0; } ); - }; + }, + odd: function() { + return this.filter( function( i ) { + return i % 2 === 1; + } ); + } } ); - - $.fn.addBack = function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - }; } // Source: keycode.js /*! - * jQuery UI Keycode 1.12.1 + * jQuery UI Keycode 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -348,7 +337,7 @@ // Source: labels.js /*! - * jQuery UI Labels 1.12.1 + * jQuery UI Labels 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -364,6 +353,10 @@ $.fn.labels = function() { var ancestor, selector, id, labels, ancestors; + if ( !this.length ) { + return this.pushStack( [] ); + } + // Check control.labels first if ( this[ 0 ].labels && this[ 0 ].labels.length ) { return this.pushStack( this[ 0 ].labels ); @@ -386,7 +379,7 @@ ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); // Create a selector for the label based on the id - selector = "label[for='" + $.ui.escapeSelector( id ) + "']"; + selector = "label[for='" + $.escapeSelector( id ) + "']"; labels = labels.add( ancestors.find( selector ).addBack( selector ) ); @@ -416,7 +409,7 @@ } if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || - instance.element[ 0 ].parentNode.nodeType === 11 ) ) { + instance.element[ 0 ].parentNode.nodeType === 11 ) ) { return; } @@ -430,7 +423,7 @@ // Source: position.js /*! - * jQuery UI Position 1.12.1 + * jQuery UI Position 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -468,6 +461,10 @@ return parseInt( $.css( element, property ), 10 ) || 0; } +function isWindow( obj ) { + return obj != null && obj === obj.window; +} + function getDimensions( elem ) { var raw = elem[ 0 ]; if ( raw.nodeType === 9 ) { @@ -477,7 +474,7 @@ offset: { top: 0, left: 0 } }; } - if ( $.isWindow( raw ) ) { + if ( isWindow( raw ) ) { return { width: elem.width(), height: elem.height(), @@ -504,9 +501,9 @@ return cachedScrollbarWidth; } var w1, w2, - div = $( "