Gutenberg - Version 12.7.2

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 12.7.2
Comparing to
See all releases

Code changes from version 12.7.1 to 12.7.2

build/url/index.js CHANGED
@@ -455,9 +455,10 @@ function setPath(object, path, value) {
455
  // If key is empty string and next value is array, derive key from
456
  // the current length of the array.
457
  key = object.length.toString();
458
- } // If the next key in the path is numeric (or empty string), it will be
459
- // created as an array. Otherwise, it will be created as an object.
460
 
 
 
461
 
462
  const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
463
  object[key] = i === lastIndex ? // If at end of path, assign the intended value.
@@ -508,7 +509,7 @@ function getQueryArgs(url) {
508
  }
509
 
510
  return accumulator;
511
- }, {});
512
  }
513
 
514
  ;// CONCATENATED MODULE: ./packages/url/build-module/add-query-args.js
455
  // If key is empty string and next value is array, derive key from
456
  // the current length of the array.
457
  key = object.length.toString();
458
+ }
 
459
 
460
+ key = ['__proto__', 'constructor', 'prototype'].includes(key) ? key.toUpperCase() : key; // If the next key in the path is numeric (or empty string), it will be
461
+ // created as an array. Otherwise, it will be created as an object.
462
 
463
  const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
464
  object[key] = i === lastIndex ? // If at end of path, assign the intended value.
509
  }
510
 
511
  return accumulator;
512
+ }, Object.create(null));
513
  }
514
 
515
  ;// CONCATENATED MODULE: ./packages/url/build-module/add-query-args.js
build/url/index.min.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'bf1ec3bde8081ece1bdaa4fa6384e851');
1
+ <?php return array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3813c32e3f9d938e1994f0e7db569699');
build/url/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t={d:function(n,e){for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};function e(t){try{return new URL(t),!0}catch{return!1}}t.r(n),t.d(n,{addQueryArgs:function(){return b},buildQueryString:function(){return g},cleanForSlug:function(){return U},filterURLForDisplay:function(){return P},getAuthority:function(){return c},getFilename:function(){return x},getFragment:function(){return h},getPath:function(){return f},getPathAndQueryString:function(){return d},getProtocol:function(){return u},getQueryArg:function(){return w},getQueryArgs:function(){return m},getQueryString:function(){return a},hasQueryArg:function(){return A},isEmail:function(){return o},isURL:function(){return e},isValidAuthority:function(){return s},isValidFragment:function(){return y},isValidPath:function(){return l},isValidProtocol:function(){return i},isValidQueryString:function(){return p},normalizePath:function(){return Q},prependHTTP:function(){return S},removeQueryArgs:function(){return j},safeDecodeURI:function(){return O},safeDecodeURIComponent:function(){return $}});const r=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function o(t){return r.test(t)}function u(t){const n=/^([^\s:]+:)/.exec(t);if(n)return n[1]}function i(t){return!!t&&/^[a-z\-.\+]+[0-9]*:$/i.test(t)}function c(t){const n=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(t);if(n)return n[1]}function s(t){return!!t&&/^[^\s#?]+$/.test(t)}function f(t){const n=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(t);if(n)return n[1]}function l(t){return!!t&&/^[^\s#?]+$/.test(t)}function a(t){let n;try{n=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(n)return n}function g(t){let n="";const e=Object.entries(t);let r;for(;r=e.shift();){let[t,o]=r;if(Array.isArray(o)||o&&o.constructor===Object){const n=Object.entries(o).reverse();for(const[r,o]of n)e.unshift([`${t}[${r}]`,o])}else void 0!==o&&(null===o&&(o=""),n+="&"+[t,o].map(encodeURIComponent).join("="))}return n.substr(1)}function p(t){return!!t&&/^[^\s#?\/]+$/.test(t)}function d(t){const n=f(t),e=a(t);let r="/";return n&&(r+=n),e&&(r+=`?${e}`),r}function h(t){const n=/^\S+?(#[^\s\?]*)/.exec(t);if(n)return n[1]}function y(t){return!!t&&/^#[^\s#?\/]*$/.test(t)}function m(t){return(a(t)||"").replace(/\+/g,"%20").split("&").reduce(((t,n)=>{const[e,r=""]=n.split("=").filter(Boolean).map(decodeURIComponent);return e&&function(t,n,e){const r=n.length,o=r-1;for(let u=0;u<r;u++){let r=n[u];!r&&Array.isArray(t)&&(r=t.length.toString());const i=!isNaN(Number(n[u+1]));t[r]=u===o?e:t[r]||(i?[]:{}),Array.isArray(t[r])&&!i&&(t[r]={...t[r]}),t=t[r]}}(t,e.replace(/\]/g,"").split("["),r),t}),{})}function b(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;if(!n||!Object.keys(n).length)return t;let e=t;const r=t.indexOf("?");return-1!==r&&(n=Object.assign(m(t),n),e=e.substr(0,r)),e+"?"+g(n)}function w(t,n){return m(t)[n]}function A(t,n){return void 0!==w(t,n)}function j(t){const n=t.indexOf("?");if(-1===n)return t;const e=m(t),r=t.substr(0,n);for(var o=arguments.length,u=new Array(o>1?o-1:0),i=1;i<o;i++)u[i-1]=arguments[i];u.forEach((t=>delete e[t]));const c=g(e);return c?r+"?"+c:r}const v=/^(?:[a-z]+:|#|\?|\.|\/)/i;function S(t){return t?(t=t.trim(),v.test(t)||o(t)?t:"http://"+t):t}function O(t){try{return decodeURI(t)}catch(n){return t}}function $(t){try{return decodeURIComponent(t)}catch(n){return t}}function P(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=t.replace(/^(?:https?:)\/\/(?:www\.)?/,"");e.match(/^[^\/]+\/$/)&&(e=e.replace("/",""));const r=/([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/;if(!n||e.length<=n||!e.match(r))return e;e=e.split("?")[0];const o=e.split("/"),u=o[o.length-1];if(u.length<=n)return"…"+e.slice(-n);const i=u.lastIndexOf("."),[c,s]=[u.slice(0,i),u.slice(i+1)],f=c.slice(-3)+"."+s;return u.slice(0,n-f.length-1)+"…"+f}var R=window.lodash;function U(t){return t?(0,R.trim)((0,R.deburr)(t).replace(/[\s\./]+/g,"-").replace(/[^\w-]+/g,"").toLowerCase(),"-"):""}function x(t){let n;try{n=new URL(t,"http://example.com").pathname.split("/").pop()}catch(t){}if(n)return n}function Q(t){const n=t.split("?"),e=n[1],r=n[0];return e?r+"?"+e.split("&").map((t=>t.split("="))).sort(((t,n)=>t[0].localeCompare(n[0]))).map((t=>t.join("="))).join("&"):r}(window.wp=window.wp||{}).url=n}();
2
  //# sourceMappingURL=index.min.js.map
1
+ !function(){"use strict";var t={d:function(n,e){for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};function e(t){try{return new URL(t),!0}catch{return!1}}t.r(n),t.d(n,{addQueryArgs:function(){return b},buildQueryString:function(){return p},cleanForSlug:function(){return R},filterURLForDisplay:function(){return $},getAuthority:function(){return c},getFilename:function(){return x},getFragment:function(){return h},getPath:function(){return f},getPathAndQueryString:function(){return d},getProtocol:function(){return u},getQueryArg:function(){return w},getQueryArgs:function(){return m},getQueryString:function(){return a},hasQueryArg:function(){return j},isEmail:function(){return o},isURL:function(){return e},isValidAuthority:function(){return s},isValidFragment:function(){return y},isValidPath:function(){return l},isValidProtocol:function(){return i},isValidQueryString:function(){return g},normalizePath:function(){return Q},prependHTTP:function(){return O},removeQueryArgs:function(){return A},safeDecodeURI:function(){return S},safeDecodeURIComponent:function(){return U}});const r=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function o(t){return r.test(t)}function u(t){const n=/^([^\s:]+:)/.exec(t);if(n)return n[1]}function i(t){return!!t&&/^[a-z\-.\+]+[0-9]*:$/i.test(t)}function c(t){const n=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(t);if(n)return n[1]}function s(t){return!!t&&/^[^\s#?]+$/.test(t)}function f(t){const n=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(t);if(n)return n[1]}function l(t){return!!t&&/^[^\s#?]+$/.test(t)}function a(t){let n;try{n=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(n)return n}function p(t){let n="";const e=Object.entries(t);let r;for(;r=e.shift();){let[t,o]=r;if(Array.isArray(o)||o&&o.constructor===Object){const n=Object.entries(o).reverse();for(const[r,o]of n)e.unshift([`${t}[${r}]`,o])}else void 0!==o&&(null===o&&(o=""),n+="&"+[t,o].map(encodeURIComponent).join("="))}return n.substr(1)}function g(t){return!!t&&/^[^\s#?\/]+$/.test(t)}function d(t){const n=f(t),e=a(t);let r="/";return n&&(r+=n),e&&(r+=`?${e}`),r}function h(t){const n=/^\S+?(#[^\s\?]*)/.exec(t);if(n)return n[1]}function y(t){return!!t&&/^#[^\s#?\/]*$/.test(t)}function m(t){return(a(t)||"").replace(/\+/g,"%20").split("&").reduce(((t,n)=>{const[e,r=""]=n.split("=").filter(Boolean).map(decodeURIComponent);return e&&function(t,n,e){const r=n.length,o=r-1;for(let u=0;u<r;u++){let r=n[u];!r&&Array.isArray(t)&&(r=t.length.toString()),r=["__proto__","constructor","prototype"].includes(r)?r.toUpperCase():r;const i=!isNaN(Number(n[u+1]));t[r]=u===o?e:t[r]||(i?[]:{}),Array.isArray(t[r])&&!i&&(t[r]={...t[r]}),t=t[r]}}(t,e.replace(/\]/g,"").split("["),r),t}),Object.create(null))}function b(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;if(!n||!Object.keys(n).length)return t;let e=t;const r=t.indexOf("?");return-1!==r&&(n=Object.assign(m(t),n),e=e.substr(0,r)),e+"?"+p(n)}function w(t,n){return m(t)[n]}function j(t,n){return void 0!==w(t,n)}function A(t){const n=t.indexOf("?");if(-1===n)return t;const e=m(t),r=t.substr(0,n);for(var o=arguments.length,u=new Array(o>1?o-1:0),i=1;i<o;i++)u[i-1]=arguments[i];u.forEach((t=>delete e[t]));const c=p(e);return c?r+"?"+c:r}const v=/^(?:[a-z]+:|#|\?|\.|\/)/i;function O(t){return t?(t=t.trim(),v.test(t)||o(t)?t:"http://"+t):t}function S(t){try{return decodeURI(t)}catch(n){return t}}function U(t){try{return decodeURIComponent(t)}catch(n){return t}}function $(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=t.replace(/^(?:https?:)\/\/(?:www\.)?/,"");e.match(/^[^\/]+\/$/)&&(e=e.replace("/",""));const r=/([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/;if(!n||e.length<=n||!e.match(r))return e;e=e.split("?")[0];const o=e.split("/"),u=o[o.length-1];if(u.length<=n)return"…"+e.slice(-n);const i=u.lastIndexOf("."),[c,s]=[u.slice(0,i),u.slice(i+1)],f=c.slice(-3)+"."+s;return u.slice(0,n-f.length-1)+"…"+f}var P=window.lodash;function R(t){return t?(0,P.trim)((0,P.deburr)(t).replace(/[\s\./]+/g,"-").replace(/[^\w-]+/g,"").toLowerCase(),"-"):""}function x(t){let n;try{n=new URL(t,"http://example.com").pathname.split("/").pop()}catch(t){}if(n)return n}function Q(t){const n=t.split("?"),e=n[1],r=n[0];return e?r+"?"+e.split("&").map((t=>t.split("="))).sort(((t,n)=>t[0].localeCompare(n[0]))).map((t=>t.join("="))).join("&"):r}(window.wp=window.wp||{}).url=n}();
2
  //# sourceMappingURL=index.min.js.map
build/url/index.min.js.map CHANGED
@@ -1 +1 @@
1
- {"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C,EAAQ6F,EAAU,GAClBC,EAAOD,EAAU,GACvB,OAAO7F,EAMN8F,EACA,IACA9F,EAEEgC,MAAO,KAEPZ,KAAO2E,GAAWA,EAAM/D,MAAO,OAE/BgE,MAAM,CAAEC,EAAGC,IAAOD,EAAG,GAAIE,cAAeD,EAAG,MAE3C9E,KAAOX,GAAUA,EAAKa,KAAM,OAE5BA,KAAM,KAjBDwE,G","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-url.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-email.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-protocol.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-protocol.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-authority.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-authority.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-path.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-path.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/build-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-path-and-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-fragment.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-fragment.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/add-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-arg.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/has-query-arg.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/remove-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/prepend-http.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/safe-decode-uri.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/safe-decode-uri-component.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/filter-url-for-display.js","webpack://wp/external window \"lodash\"","webpack://wp/./packages/url/build-module/@wordpress/url/src/clean-for-slug.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-filename.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/normalize-path.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Determines whether the given string looks like a URL.\n *\n * @param {string} url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return {boolean} Whether or not it looks like a URL.\n */\nexport function isURL( url ) {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n","const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param {string} email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return {boolean} Whether or not it looks like an email.\n */\nexport function isEmail( email ) {\n\treturn EMAIL_REGEXP.test( email );\n}\n","/**\n * Returns the protocol part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'\n * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'\n * ```\n *\n * @return {string|void} The protocol part of the URL.\n */\nexport function getProtocol( url ) {\n\tconst matches = /^([^\\s:]+:)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Tests if a url protocol is valid.\n *\n * @param {string} protocol The url protocol.\n *\n * @example\n * ```js\n * const isValid = isValidProtocol( 'https:' ); // true\n * const isNotValid = isValidProtocol( 'https :' ); // false\n * ```\n *\n * @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).\n */\nexport function isValidProtocol( protocol ) {\n\tif ( ! protocol ) {\n\t\treturn false;\n\t}\n\treturn /^[a-z\\-.\\+]+[0-9]*:$/i.test( protocol );\n}\n","/**\n * Returns the authority part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'\n * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'\n * ```\n *\n * @return {string|void} The authority part of the URL.\n */\nexport function getAuthority( url ) {\n\tconst matches = /^[^\\/\\s:]+:(?:\\/\\/)?\\/?([^\\/\\s#?]+)[\\/#?]{0,1}\\S*$/.exec(\n\t\turl\n\t);\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided authority.\n *\n * @param {string} authority A string containing the URL authority.\n *\n * @example\n * ```js\n * const isValid = isValidAuthority( 'wordpress.org' ); // true\n * const isNotValid = isValidAuthority( 'wordpress#org' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid authority.\n */\nexport function isValidAuthority( authority ) {\n\tif ( ! authority ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( authority );\n}\n","/**\n * Returns the path part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'\n * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'\n * ```\n *\n * @return {string|void} The path part of the URL.\n */\nexport function getPath( url ) {\n\tconst matches = /^[^\\/\\s:]+:(?:\\/\\/)?[^\\/\\s#?]+[\\/]([^\\s#?]+)[#?]{0,1}\\S*$/.exec(\n\t\turl\n\t);\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided path.\n *\n * @param {string} path The URL path.\n *\n * @example\n * ```js\n * const isValid = isValidPath( 'test/path/' ); // true\n * const isNotValid = isValidPath( '/invalid?test/path/' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid path\n */\nexport function isValidPath( path ) {\n\tif ( ! path ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( path );\n}\n","/**\n * Returns the query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return {string|void} The query string part of the URL.\n */\nexport function getQueryString( url ) {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n","/**\n * Generates URL-encoded query string using input query data.\n *\n * It is intended to behave equivalent as PHP's `http_build_query`, configured\n * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).\n *\n * @example\n * ```js\n * const queryString = buildQueryString( {\n * simple: 'is ok',\n * arrays: [ 'are', 'fine', 'too' ],\n * objects: {\n * evenNested: {\n * ok: 'yes',\n * },\n * },\n * } );\n * // \"simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes\"\n * ```\n *\n * @param {Record<string,*>} data Data to encode.\n *\n * @return {string} Query string.\n */\nexport function buildQueryString( data ) {\n\tlet string = '';\n\n\tconst stack = Object.entries( data );\n\n\tlet pair;\n\twhile ( ( pair = stack.shift() ) ) {\n\t\tlet [ key, value ] = pair;\n\n\t\t// Support building deeply nested data, from array or object values.\n\t\tconst hasNestedData =\n\t\t\tArray.isArray( value ) || ( value && value.constructor === Object );\n\n\t\tif ( hasNestedData ) {\n\t\t\t// Push array or object values onto the stack as composed of their\n\t\t\t// original key and nested index or key, retaining order by a\n\t\t\t// combination of Array#reverse and Array#unshift onto the stack.\n\t\t\tconst valuePairs = Object.entries( value ).reverse();\n\t\t\tfor ( const [ member, memberValue ] of valuePairs ) {\n\t\t\t\tstack.unshift( [ `${ key }[${ member }]`, memberValue ] );\n\t\t\t}\n\t\t} else if ( value !== undefined ) {\n\t\t\t// Null is treated as special case, equivalent to empty string.\n\t\t\tif ( value === null ) {\n\t\t\t\tvalue = '';\n\t\t\t}\n\n\t\t\tstring +=\n\t\t\t\t'&' + [ key, value ].map( encodeURIComponent ).join( '=' );\n\t\t}\n\t}\n\n\t// Loop will concatenate with leading `&`, but it's only expected for all\n\t// but the first query parameter. This strips the leading `&`, while still\n\t// accounting for the case that the string may in-fact be empty.\n\treturn string.substr( 1 );\n}\n","/**\n * Checks for invalid characters within the provided query string.\n *\n * @param {string} queryString The query string.\n *\n * @example\n * ```js\n * const isValid = isValidQueryString( 'query=true&another=false' ); // true\n * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid query string.\n */\nexport function isValidQueryString( queryString ) {\n\tif ( ! queryString ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?\\/]+$/.test( queryString );\n}\n","/**\n * Internal dependencies\n */\nimport { getPath, getQueryString } from '.';\n\n/**\n * Returns the path part and query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'\n * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'\n * ```\n *\n * @return {string} The path part and query string part of the URL.\n */\nexport function getPathAndQueryString( url ) {\n\tconst path = getPath( url );\n\tconst queryString = getQueryString( url );\n\tlet value = '/';\n\tif ( path ) value += path;\n\tif ( queryString ) value += `?${ queryString }`;\n\treturn value;\n}\n","/**\n * Returns the fragment part of the URL.\n *\n * @param {string} url The full URL\n *\n * @example\n * ```js\n * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'\n * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'\n * ```\n *\n * @return {string|void} The fragment part of the URL.\n */\nexport function getFragment( url ) {\n\tconst matches = /^\\S+?(#[^\\s\\?]*)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided fragment.\n *\n * @param {string} fragment The url fragment.\n *\n * @example\n * ```js\n * const isValid = isValidFragment( '#valid-fragment' ); // true\n * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid fragment.\n */\nexport function isValidFragment( fragment ) {\n\tif ( ! fragment ) {\n\t\treturn false;\n\t}\n\treturn /^#[^\\s#?\\/]*$/.test( fragment );\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryString } from './get-query-string';\n\n/** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */\n\n/**\n * @typedef {Record<string,QueryArgParsed>} QueryArgs\n */\n\n/**\n * Sets a value in object deeply by a given array of path segments. Mutates the\n * object reference.\n *\n * @param {Record<string,*>} object Object in which to assign.\n * @param {string[]} path Path segment at which to set value.\n * @param {*} value Value to set.\n */\nfunction setPath( object, path, value ) {\n\tconst length = path.length;\n\tconst lastIndex = length - 1;\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tlet key = path[ i ];\n\n\t\tif ( ! key && Array.isArray( object ) ) {\n\t\t\t// If key is empty string and next value is array, derive key from\n\t\t\t// the current length of the array.\n\t\t\tkey = object.length.toString();\n\t\t}\n\n\t\t// If the next key in the path is numeric (or empty string), it will be\n\t\t// created as an array. Otherwise, it will be created as an object.\n\t\tconst isNextKeyArrayIndex = ! isNaN( Number( path[ i + 1 ] ) );\n\n\t\tobject[ key ] =\n\t\t\ti === lastIndex\n\t\t\t\t? // If at end of path, assign the intended value.\n\t\t\t\t value\n\t\t\t\t: // Otherwise, advance to the next object in the path, creating\n\t\t\t\t // it if it does not yet exist.\n\t\t\t\t object[ key ] || ( isNextKeyArrayIndex ? [] : {} );\n\n\t\tif ( Array.isArray( object[ key ] ) && ! isNextKeyArrayIndex ) {\n\t\t\t// If we current key is non-numeric, but the next value is an\n\t\t\t// array, coerce the value to an object.\n\t\t\tobject[ key ] = { ...object[ key ] };\n\t\t}\n\n\t\t// Update working reference object to the next in the path.\n\t\tobject = object[ key ];\n\t}\n}\n\n/**\n * Returns an object of query arguments of the given URL. If the given URL is\n * invalid or has no querystring, an empty object is returned.\n *\n * @param {string} url URL.\n *\n * @example\n * ```js\n * const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' );\n * // { \"foo\": \"bar\", \"bar\": \"baz\" }\n * ```\n *\n * @return {QueryArgs} Query args object.\n */\nexport function getQueryArgs( url ) {\n\treturn (\n\t\t( getQueryString( url ) || '' )\n\t\t\t// Normalize space encoding, accounting for PHP URL encoding\n\t\t\t// corresponding to `application/x-www-form-urlencoded`.\n\t\t\t//\n\t\t\t// See: https://tools.ietf.org/html/rfc1866#section-8.2.1\n\t\t\t.replace( /\\+/g, '%20' )\n\t\t\t.split( '&' )\n\t\t\t.reduce( ( accumulator, keyValue ) => {\n\t\t\t\tconst [ key, value = '' ] = keyValue\n\t\t\t\t\t.split( '=' )\n\t\t\t\t\t// Filtering avoids decoding as `undefined` for value, where\n\t\t\t\t\t// default is restored in destructuring assignment.\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.map( decodeURIComponent );\n\n\t\t\t\tif ( key ) {\n\t\t\t\t\tconst segments = key.replace( /\\]/g, '' ).split( '[' );\n\t\t\t\t\tsetPath( accumulator, segments, value );\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, {} )\n\t);\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Appends arguments as querystring to the provided URL. If the URL already\n * includes query arguments, the arguments are merged with (and take precedent\n * over) the existing set.\n *\n * @param {string} [url=''] URL to which arguments should be appended. If omitted,\n * only the resulting querystring is returned.\n * @param {Object} [args] Query arguments to apply to URL.\n *\n * @example\n * ```js\n * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test\n * ```\n *\n * @return {string} URL with arguments applied.\n */\nexport function addQueryArgs( url = '', args ) {\n\t// If no arguments are to be appended, return original URL.\n\tif ( ! args || ! Object.keys( args ).length ) {\n\t\treturn url;\n\t}\n\n\tlet baseUrl = url;\n\n\t// Determine whether URL already had query arguments.\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex !== -1 ) {\n\t\t// Merge into existing query arguments.\n\t\targs = Object.assign( getQueryArgs( url ), args );\n\n\t\t// Change working base URL to omit previous query arguments.\n\t\tbaseUrl = baseUrl.substr( 0, queryStringIndex );\n\t}\n\n\treturn baseUrl + '?' + buildQueryString( args );\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\n\n/**\n * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject\n */\n\n/**\n * @typedef {string|string[]|QueryArgObject} QueryArgParsed\n */\n\n/**\n * Returns a single query argument of the url\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar\n * ```\n *\n * @return {QueryArgParsed|void} Query arg value.\n */\nexport function getQueryArg( url, arg ) {\n\treturn getQueryArgs( url )[ arg ];\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArg } from './get-query-arg';\n\n/**\n * Determines whether the URL contains a given query arg.\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true\n * ```\n *\n * @return {boolean} Whether or not the URL contains the query arg.\n */\nexport function hasQueryArg( url, arg ) {\n\treturn getQueryArg( url, arg ) !== undefined;\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Removes arguments from the query string of the url\n *\n * @param {string} url URL.\n * @param {...string} args Query Args.\n *\n * @example\n * ```js\n * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar\n * ```\n *\n * @return {string} Updated URL.\n */\nexport function removeQueryArgs( url, ...args ) {\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex === -1 ) {\n\t\treturn url;\n\t}\n\n\tconst query = getQueryArgs( url );\n\tconst baseURL = url.substr( 0, queryStringIndex );\n\targs.forEach( ( arg ) => delete query[ arg ] );\n\tconst queryString = buildQueryString( query );\n\treturn queryString ? baseURL + '?' + queryString : baseURL;\n}\n","/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTP( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n","/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param {string} uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return {string} Decoded URI if possible.\n */\nexport function safeDecodeURI( uri ) {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n","/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param {string} uriComponent URI component to decode.\n *\n * @return {string} Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent ) {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n","/**\n * Returns a URL for display.\n *\n * @param {string} url Original URL.\n * @param {number|null} maxLength URL length.\n *\n * @example\n * ```js\n * const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg\n * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png\n * ```\n *\n * @return {string} Displayed URL.\n */\nexport function filterURLForDisplay( url, maxLength = null ) {\n\t// Remove protocol and www prefixes.\n\tlet filteredURL = url.replace( /^(?:https?:)\\/\\/(?:www\\.)?/, '' );\n\n\t// Ends with / and only has that single slash, strip it.\n\tif ( filteredURL.match( /^[^\\/]+\\/$/ ) ) {\n\t\tfilteredURL = filteredURL.replace( '/', '' );\n\t}\n\n\tconst mediaRegexp = /([\\w|:])*\\.(?:jpg|jpeg|gif|png|svg)/;\n\n\tif (\n\t\t! maxLength ||\n\t\tfilteredURL.length <= maxLength ||\n\t\t! filteredURL.match( mediaRegexp )\n\t) {\n\t\treturn filteredURL;\n\t}\n\n\t// If the file is not greater than max length, return last portion of URL.\n\tfilteredURL = filteredURL.split( '?' )[ 0 ];\n\tconst urlPieces = filteredURL.split( '/' );\n\tconst file = urlPieces[ urlPieces.length - 1 ];\n\tif ( file.length <= maxLength ) {\n\t\treturn '…' + filteredURL.slice( -maxLength );\n\t}\n\n\t// If the file is greater than max length, truncate the file.\n\tconst index = file.lastIndexOf( '.' );\n\tconst [ fileName, extension ] = [\n\t\tfile.slice( 0, index ),\n\t\tfile.slice( index + 1 ),\n\t];\n\tconst truncatedFile = fileName.slice( -3 ) + '.' + extension;\n\treturn (\n\t\tfile.slice( 0, maxLength - truncatedFile.length - 1 ) +\n\t\t'…' +\n\t\ttruncatedFile\n\t);\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\nimport { deburr, trim } from 'lodash';\n\n/**\n * Performs some basic cleanup of a string for use as a post slug.\n *\n * This replicates some of what `sanitize_title()` does in WordPress core, but\n * is only designed to approximate what the slug will be.\n *\n * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin\n * letters. Removes combining diacritical marks. Converts whitespace, periods,\n * and forward slashes to hyphens. Removes any remaining non-word characters\n * except hyphens. Converts remaining string to lowercase. It does not account\n * for octets, HTML entities, or other encoded characters.\n *\n * @param {string} string Title or slug to be processed.\n *\n * @return {string} Processed string.\n */\nexport function cleanForSlug( string ) {\n\tif ( ! string ) {\n\t\treturn '';\n\t}\n\treturn trim(\n\t\tdeburr( string )\n\t\t\t.replace( /[\\s\\./]+/g, '-' )\n\t\t\t.replace( /[^\\w-]+/g, '' )\n\t\t\t.toLowerCase(),\n\t\t'-'\n\t);\n}\n","/**\n * Returns the filename part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return {string|void} The filename part of the URL.\n */\nexport function getFilename( url ) {\n\tlet filename;\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch ( error ) {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n","/**\n * Given a path, returns a normalized path where equal query parameter values\n * will be treated as identical, regardless of order they appear in the original\n * text.\n *\n * @param {string} path Original path.\n *\n * @return {string} Normalized path.\n */\nexport function normalizePath( path ) {\n\tconst splitted = path.split( '?' );\n\tconst query = splitted[ 1 ];\n\tconst base = splitted[ 0 ];\n\tif ( ! query ) {\n\t\treturn base;\n\t}\n\n\t// 'b=1&c=2&a=5'\n\treturn (\n\t\tbase +\n\t\t'?' +\n\t\tquery\n\t\t\t// [ 'b=1', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( entry ) => entry.split( '=' ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n\t\t\t.sort( ( a, b ) => a[ 0 ].localeCompare( b[ 0 ] ) )\n\t\t\t// [ 'a=5', 'b=1', 'c=2' ]\n\t\t\t.map( ( pair ) => pair.join( '=' ) )\n\t\t\t// 'a=5&b=1&c=2'\n\t\t\t.join( '&' )\n\t);\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","isURL","url","URL","EMAIL_REGEXP","isEmail","email","test","getProtocol","matches","exec","isValidProtocol","protocol","getAuthority","isValidAuthority","authority","getPath","isValidPath","path","getQueryString","query","search","substring","error","buildQueryString","data","string","stack","entries","pair","shift","Array","isArray","constructor","valuePairs","reverse","member","memberValue","unshift","undefined","map","encodeURIComponent","join","substr","isValidQueryString","queryString","getPathAndQueryString","getFragment","isValidFragment","fragment","getQueryArgs","replace","split","reduce","accumulator","keyValue","filter","Boolean","decodeURIComponent","object","length","lastIndex","i","toString","isNextKeyArrayIndex","isNaN","Number","setPath","addQueryArgs","args","keys","baseUrl","queryStringIndex","indexOf","assign","getQueryArg","arg","hasQueryArg","removeQueryArgs","baseURL","forEach","USABLE_HREF_REGEXP","prependHTTP","trim","safeDecodeURI","uri","decodeURI","uriError","safeDecodeURIComponent","uriComponent","uriComponentError","filterURLForDisplay","maxLength","filteredURL","match","mediaRegexp","urlPieces","file","slice","index","lastIndexOf","fileName","extension","truncatedFile","window","cleanForSlug","deburr","toLowerCase","getFilename","filename","pathname","pop","normalizePath","splitted","base","entry","sort","a","b","localeCompare"],"sourceRoot":""}
1
+ {"version":3,"file":"./build/url/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,KCUhD,SAASC,EAAOC,GAGtB,IAEC,OADA,IAAIC,IAAKD,IACF,EACN,MACD,OAAO,G,i6BCtBT,MAAME,EAAe,+DAcd,SAASC,EAASC,GACxB,OAAOF,EAAaG,KAAMD,GCFpB,SAASE,EAAaN,GAC5B,MAAMO,EAAU,cAAcC,KAAMR,GACpC,GAAKO,EACJ,OAAOA,EAAS,GCHX,SAASE,EAAiBC,GAChC,QAAOA,GA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O,EAAQF,EAAKG,YAAa,MACxBC,EAAUC,GAAc,CAC/BL,EAAKC,MAAO,EAAGC,GACfF,EAAKC,MAAOC,EAAQ,IAEfI,EAAgBF,EAASH,OAAQ,GAAM,IAAMI,EACnD,OACCL,EAAKC,MAAO,EAAGN,EAAYW,EAAc9C,OAAS,GAClD,IACA8C,ECnDF,IAAI,EAA+BC,OAAe,OCqB3C,SAASC,EAAclF,GAC7B,OAAOA,GAGA4D,EAAAA,EAAAA,OACNuB,EAAAA,EAAAA,QAAQnF,GACNyB,QAAS,YAAa,KACtBA,QAAS,WAAY,IACrB2D,cACF,KAPO,GCVF,SAASC,EAAa7G,GAC5B,IAAI8G,EACJ,IACCA,EAAW,IAAI7G,IAAKD,EAAK,sBAAuB+G,SAC9C7D,MAAO,KACP8D,MACD,MAAQ3F,IAEV,GAAKyF,EACJ,OAAOA,ECbF,SAASG,EAAejG,GAC9B,MAAMkG,EAAWlG,EAAKkC,MAAO,KACvBhC,EAAQgG,EAAU,GAClBC,EAAOD,EAAU,GACvB,OAAOhG,EAMNiG,EACA,IACAjG,EAEEgC,MAAO,KAEPZ,KAAO8E,GAAWA,EAAMlE,MAAO,OAE/BmE,MAAM,CAAEC,EAAGC,IAAOD,EAAG,GAAIE,cAAeD,EAAG,MAE3CjF,KAAOX,GAAUA,EAAKa,KAAM,OAE5BA,KAAM,KAjBD2E,G","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-url.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-email.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-protocol.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-protocol.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-authority.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-authority.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-path.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-path.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/build-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-path-and-query-string.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-fragment.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/is-valid-fragment.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/add-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-query-arg.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/has-query-arg.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/remove-query-args.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/prepend-http.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/safe-decode-uri.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/safe-decode-uri-component.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/filter-url-for-display.js","webpack://wp/external window \"lodash\"","webpack://wp/./packages/url/build-module/@wordpress/url/src/clean-for-slug.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/get-filename.js","webpack://wp/./packages/url/build-module/@wordpress/url/src/normalize-path.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Determines whether the given string looks like a URL.\n *\n * @param {string} url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return {boolean} Whether or not it looks like a URL.\n */\nexport function isURL( url ) {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n","const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param {string} email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return {boolean} Whether or not it looks like an email.\n */\nexport function isEmail( email ) {\n\treturn EMAIL_REGEXP.test( email );\n}\n","/**\n * Returns the protocol part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'\n * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'\n * ```\n *\n * @return {string|void} The protocol part of the URL.\n */\nexport function getProtocol( url ) {\n\tconst matches = /^([^\\s:]+:)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Tests if a url protocol is valid.\n *\n * @param {string} protocol The url protocol.\n *\n * @example\n * ```js\n * const isValid = isValidProtocol( 'https:' ); // true\n * const isNotValid = isValidProtocol( 'https :' ); // false\n * ```\n *\n * @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).\n */\nexport function isValidProtocol( protocol ) {\n\tif ( ! protocol ) {\n\t\treturn false;\n\t}\n\treturn /^[a-z\\-.\\+]+[0-9]*:$/i.test( protocol );\n}\n","/**\n * Returns the authority part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'\n * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'\n * ```\n *\n * @return {string|void} The authority part of the URL.\n */\nexport function getAuthority( url ) {\n\tconst matches = /^[^\\/\\s:]+:(?:\\/\\/)?\\/?([^\\/\\s#?]+)[\\/#?]{0,1}\\S*$/.exec(\n\t\turl\n\t);\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided authority.\n *\n * @param {string} authority A string containing the URL authority.\n *\n * @example\n * ```js\n * const isValid = isValidAuthority( 'wordpress.org' ); // true\n * const isNotValid = isValidAuthority( 'wordpress#org' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid authority.\n */\nexport function isValidAuthority( authority ) {\n\tif ( ! authority ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( authority );\n}\n","/**\n * Returns the path part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'\n * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'\n * ```\n *\n * @return {string|void} The path part of the URL.\n */\nexport function getPath( url ) {\n\tconst matches = /^[^\\/\\s:]+:(?:\\/\\/)?[^\\/\\s#?]+[\\/]([^\\s#?]+)[#?]{0,1}\\S*$/.exec(\n\t\turl\n\t);\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided path.\n *\n * @param {string} path The URL path.\n *\n * @example\n * ```js\n * const isValid = isValidPath( 'test/path/' ); // true\n * const isNotValid = isValidPath( '/invalid?test/path/' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid path\n */\nexport function isValidPath( path ) {\n\tif ( ! path ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( path );\n}\n","/**\n * Returns the query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return {string|void} The query string part of the URL.\n */\nexport function getQueryString( url ) {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n","/**\n * Generates URL-encoded query string using input query data.\n *\n * It is intended to behave equivalent as PHP's `http_build_query`, configured\n * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).\n *\n * @example\n * ```js\n * const queryString = buildQueryString( {\n * simple: 'is ok',\n * arrays: [ 'are', 'fine', 'too' ],\n * objects: {\n * evenNested: {\n * ok: 'yes',\n * },\n * },\n * } );\n * // \"simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes\"\n * ```\n *\n * @param {Record<string,*>} data Data to encode.\n *\n * @return {string} Query string.\n */\nexport function buildQueryString( data ) {\n\tlet string = '';\n\n\tconst stack = Object.entries( data );\n\n\tlet pair;\n\twhile ( ( pair = stack.shift() ) ) {\n\t\tlet [ key, value ] = pair;\n\n\t\t// Support building deeply nested data, from array or object values.\n\t\tconst hasNestedData =\n\t\t\tArray.isArray( value ) || ( value && value.constructor === Object );\n\n\t\tif ( hasNestedData ) {\n\t\t\t// Push array or object values onto the stack as composed of their\n\t\t\t// original key and nested index or key, retaining order by a\n\t\t\t// combination of Array#reverse and Array#unshift onto the stack.\n\t\t\tconst valuePairs = Object.entries( value ).reverse();\n\t\t\tfor ( const [ member, memberValue ] of valuePairs ) {\n\t\t\t\tstack.unshift( [ `${ key }[${ member }]`, memberValue ] );\n\t\t\t}\n\t\t} else if ( value !== undefined ) {\n\t\t\t// Null is treated as special case, equivalent to empty string.\n\t\t\tif ( value === null ) {\n\t\t\t\tvalue = '';\n\t\t\t}\n\n\t\t\tstring +=\n\t\t\t\t'&' + [ key, value ].map( encodeURIComponent ).join( '=' );\n\t\t}\n\t}\n\n\t// Loop will concatenate with leading `&`, but it's only expected for all\n\t// but the first query parameter. This strips the leading `&`, while still\n\t// accounting for the case that the string may in-fact be empty.\n\treturn string.substr( 1 );\n}\n","/**\n * Checks for invalid characters within the provided query string.\n *\n * @param {string} queryString The query string.\n *\n * @example\n * ```js\n * const isValid = isValidQueryString( 'query=true&another=false' ); // true\n * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid query string.\n */\nexport function isValidQueryString( queryString ) {\n\tif ( ! queryString ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?\\/]+$/.test( queryString );\n}\n","/**\n * Internal dependencies\n */\nimport { getPath, getQueryString } from '.';\n\n/**\n * Returns the path part and query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'\n * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'\n * ```\n *\n * @return {string} The path part and query string part of the URL.\n */\nexport function getPathAndQueryString( url ) {\n\tconst path = getPath( url );\n\tconst queryString = getQueryString( url );\n\tlet value = '/';\n\tif ( path ) value += path;\n\tif ( queryString ) value += `?${ queryString }`;\n\treturn value;\n}\n","/**\n * Returns the fragment part of the URL.\n *\n * @param {string} url The full URL\n *\n * @example\n * ```js\n * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'\n * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'\n * ```\n *\n * @return {string|void} The fragment part of the URL.\n */\nexport function getFragment( url ) {\n\tconst matches = /^\\S+?(#[^\\s\\?]*)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n","/**\n * Checks for invalid characters within the provided fragment.\n *\n * @param {string} fragment The url fragment.\n *\n * @example\n * ```js\n * const isValid = isValidFragment( '#valid-fragment' ); // true\n * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid fragment.\n */\nexport function isValidFragment( fragment ) {\n\tif ( ! fragment ) {\n\t\treturn false;\n\t}\n\treturn /^#[^\\s#?\\/]*$/.test( fragment );\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryString } from './get-query-string';\n\n/** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */\n\n/**\n * @typedef {Record<string,QueryArgParsed>} QueryArgs\n */\n\n/**\n * Sets a value in object deeply by a given array of path segments. Mutates the\n * object reference.\n *\n * @param {Record<string,*>} object Object in which to assign.\n * @param {string[]} path Path segment at which to set value.\n * @param {*} value Value to set.\n */\nfunction setPath( object, path, value ) {\n\tconst length = path.length;\n\tconst lastIndex = length - 1;\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tlet key = path[ i ];\n\n\t\tif ( ! key && Array.isArray( object ) ) {\n\t\t\t// If key is empty string and next value is array, derive key from\n\t\t\t// the current length of the array.\n\t\t\tkey = object.length.toString();\n\t\t}\n\n\t\tkey = [ '__proto__', 'constructor', 'prototype' ].includes( key )\n\t\t\t? key.toUpperCase()\n\t\t\t: key;\n\n\t\t// If the next key in the path is numeric (or empty string), it will be\n\t\t// created as an array. Otherwise, it will be created as an object.\n\t\tconst isNextKeyArrayIndex = ! isNaN( Number( path[ i + 1 ] ) );\n\n\t\tobject[ key ] =\n\t\t\ti === lastIndex\n\t\t\t\t? // If at end of path, assign the intended value.\n\t\t\t\t value\n\t\t\t\t: // Otherwise, advance to the next object in the path, creating\n\t\t\t\t // it if it does not yet exist.\n\t\t\t\t object[ key ] || ( isNextKeyArrayIndex ? [] : {} );\n\n\t\tif ( Array.isArray( object[ key ] ) && ! isNextKeyArrayIndex ) {\n\t\t\t// If we current key is non-numeric, but the next value is an\n\t\t\t// array, coerce the value to an object.\n\t\t\tobject[ key ] = { ...object[ key ] };\n\t\t}\n\n\t\t// Update working reference object to the next in the path.\n\t\tobject = object[ key ];\n\t}\n}\n\n/**\n * Returns an object of query arguments of the given URL. If the given URL is\n * invalid or has no querystring, an empty object is returned.\n *\n * @param {string} url URL.\n *\n * @example\n * ```js\n * const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' );\n * // { \"foo\": \"bar\", \"bar\": \"baz\" }\n * ```\n *\n * @return {QueryArgs} Query args object.\n */\nexport function getQueryArgs( url ) {\n\treturn (\n\t\t( getQueryString( url ) || '' )\n\t\t\t// Normalize space encoding, accounting for PHP URL encoding\n\t\t\t// corresponding to `application/x-www-form-urlencoded`.\n\t\t\t//\n\t\t\t// See: https://tools.ietf.org/html/rfc1866#section-8.2.1\n\t\t\t.replace( /\\+/g, '%20' )\n\t\t\t.split( '&' )\n\t\t\t.reduce( ( accumulator, keyValue ) => {\n\t\t\t\tconst [ key, value = '' ] = keyValue\n\t\t\t\t\t.split( '=' )\n\t\t\t\t\t// Filtering avoids decoding as `undefined` for value, where\n\t\t\t\t\t// default is restored in destructuring assignment.\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.map( decodeURIComponent );\n\n\t\t\t\tif ( key ) {\n\t\t\t\t\tconst segments = key.replace( /\\]/g, '' ).split( '[' );\n\t\t\t\t\tsetPath( accumulator, segments, value );\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, Object.create( null ) )\n\t);\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Appends arguments as querystring to the provided URL. If the URL already\n * includes query arguments, the arguments are merged with (and take precedent\n * over) the existing set.\n *\n * @param {string} [url=''] URL to which arguments should be appended. If omitted,\n * only the resulting querystring is returned.\n * @param {Object} [args] Query arguments to apply to URL.\n *\n * @example\n * ```js\n * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test\n * ```\n *\n * @return {string} URL with arguments applied.\n */\nexport function addQueryArgs( url = '', args ) {\n\t// If no arguments are to be appended, return original URL.\n\tif ( ! args || ! Object.keys( args ).length ) {\n\t\treturn url;\n\t}\n\n\tlet baseUrl = url;\n\n\t// Determine whether URL already had query arguments.\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex !== -1 ) {\n\t\t// Merge into existing query arguments.\n\t\targs = Object.assign( getQueryArgs( url ), args );\n\n\t\t// Change working base URL to omit previous query arguments.\n\t\tbaseUrl = baseUrl.substr( 0, queryStringIndex );\n\t}\n\n\treturn baseUrl + '?' + buildQueryString( args );\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\n\n/**\n * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject\n */\n\n/**\n * @typedef {string|string[]|QueryArgObject} QueryArgParsed\n */\n\n/**\n * Returns a single query argument of the url\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar\n * ```\n *\n * @return {QueryArgParsed|void} Query arg value.\n */\nexport function getQueryArg( url, arg ) {\n\treturn getQueryArgs( url )[ arg ];\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArg } from './get-query-arg';\n\n/**\n * Determines whether the URL contains a given query arg.\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true\n * ```\n *\n * @return {boolean} Whether or not the URL contains the query arg.\n */\nexport function hasQueryArg( url, arg ) {\n\treturn getQueryArg( url, arg ) !== undefined;\n}\n","/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Removes arguments from the query string of the url\n *\n * @param {string} url URL.\n * @param {...string} args Query Args.\n *\n * @example\n * ```js\n * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar\n * ```\n *\n * @return {string} Updated URL.\n */\nexport function removeQueryArgs( url, ...args ) {\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex === -1 ) {\n\t\treturn url;\n\t}\n\n\tconst query = getQueryArgs( url );\n\tconst baseURL = url.substr( 0, queryStringIndex );\n\targs.forEach( ( arg ) => delete query[ arg ] );\n\tconst queryString = buildQueryString( query );\n\treturn queryString ? baseURL + '?' + queryString : baseURL;\n}\n","/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTP( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n","/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param {string} uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return {string} Decoded URI if possible.\n */\nexport function safeDecodeURI( uri ) {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n","/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param {string} uriComponent URI component to decode.\n *\n * @return {string} Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent ) {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n","/**\n * Returns a URL for display.\n *\n * @param {string} url Original URL.\n * @param {number|null} maxLength URL length.\n *\n * @example\n * ```js\n * const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg\n * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png\n * ```\n *\n * @return {string} Displayed URL.\n */\nexport function filterURLForDisplay( url, maxLength = null ) {\n\t// Remove protocol and www prefixes.\n\tlet filteredURL = url.replace( /^(?:https?:)\\/\\/(?:www\\.)?/, '' );\n\n\t// Ends with / and only has that single slash, strip it.\n\tif ( filteredURL.match( /^[^\\/]+\\/$/ ) ) {\n\t\tfilteredURL = filteredURL.replace( '/', '' );\n\t}\n\n\tconst mediaRegexp = /([\\w|:])*\\.(?:jpg|jpeg|gif|png|svg)/;\n\n\tif (\n\t\t! maxLength ||\n\t\tfilteredURL.length <= maxLength ||\n\t\t! filteredURL.match( mediaRegexp )\n\t) {\n\t\treturn filteredURL;\n\t}\n\n\t// If the file is not greater than max length, return last portion of URL.\n\tfilteredURL = filteredURL.split( '?' )[ 0 ];\n\tconst urlPieces = filteredURL.split( '/' );\n\tconst file = urlPieces[ urlPieces.length - 1 ];\n\tif ( file.length <= maxLength ) {\n\t\treturn '…' + filteredURL.slice( -maxLength );\n\t}\n\n\t// If the file is greater than max length, truncate the file.\n\tconst index = file.lastIndexOf( '.' );\n\tconst [ fileName, extension ] = [\n\t\tfile.slice( 0, index ),\n\t\tfile.slice( index + 1 ),\n\t];\n\tconst truncatedFile = fileName.slice( -3 ) + '.' + extension;\n\treturn (\n\t\tfile.slice( 0, maxLength - truncatedFile.length - 1 ) +\n\t\t'…' +\n\t\ttruncatedFile\n\t);\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\nimport { deburr, trim } from 'lodash';\n\n/**\n * Performs some basic cleanup of a string for use as a post slug.\n *\n * This replicates some of what `sanitize_title()` does in WordPress core, but\n * is only designed to approximate what the slug will be.\n *\n * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin\n * letters. Removes combining diacritical marks. Converts whitespace, periods,\n * and forward slashes to hyphens. Removes any remaining non-word characters\n * except hyphens. Converts remaining string to lowercase. It does not account\n * for octets, HTML entities, or other encoded characters.\n *\n * @param {string} string Title or slug to be processed.\n *\n * @return {string} Processed string.\n */\nexport function cleanForSlug( string ) {\n\tif ( ! string ) {\n\t\treturn '';\n\t}\n\treturn trim(\n\t\tdeburr( string )\n\t\t\t.replace( /[\\s\\./]+/g, '-' )\n\t\t\t.replace( /[^\\w-]+/g, '' )\n\t\t\t.toLowerCase(),\n\t\t'-'\n\t);\n}\n","/**\n * Returns the filename part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return {string|void} The filename part of the URL.\n */\nexport function getFilename( url ) {\n\tlet filename;\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch ( error ) {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n","/**\n * Given a path, returns a normalized path where equal query parameter values\n * will be treated as identical, regardless of order they appear in the original\n * text.\n *\n * @param {string} path Original path.\n *\n * @return {string} Normalized path.\n */\nexport function normalizePath( path ) {\n\tconst splitted = path.split( '?' );\n\tconst query = splitted[ 1 ];\n\tconst base = splitted[ 0 ];\n\tif ( ! query ) {\n\t\treturn base;\n\t}\n\n\t// 'b=1&c=2&a=5'\n\treturn (\n\t\tbase +\n\t\t'?' +\n\t\tquery\n\t\t\t// [ 'b=1', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( entry ) => entry.split( '=' ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n\t\t\t.sort( ( a, b ) => a[ 0 ].localeCompare( b[ 0 ] ) )\n\t\t\t// [ 'a=5', 'b=1', 'c=2' ]\n\t\t\t.map( ( pair ) => pair.join( '=' ) )\n\t\t\t// 'a=5&b=1&c=2'\n\t\t\t.join( '&' )\n\t);\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","isURL","url","URL","EMAIL_REGEXP","isEmail","email","test","getProtocol","matches","exec","isValidProtocol","protocol","getAuthority","isValidAuthority","authority","getPath","isValidPath","path","getQueryString","query","search","substring","error","buildQueryString","data","string","stack","entries","pair","shift","Array","isArray","constructor","valuePairs","reverse","member","memberValue","unshift","undefined","map","encodeURIComponent","join","substr","isValidQueryString","queryString","getPathAndQueryString","getFragment","isValidFragment","fragment","getQueryArgs","replace","split","reduce","accumulator","keyValue","filter","Boolean","decodeURIComponent","object","length","lastIndex","i","toString","includes","toUpperCase","isNextKeyArrayIndex","isNaN","Number","setPath","create","addQueryArgs","args","keys","baseUrl","queryStringIndex","indexOf","assign","getQueryArg","arg","hasQueryArg","removeQueryArgs","baseURL","forEach","USABLE_HREF_REGEXP","prependHTTP","trim","safeDecodeURI","uri","decodeURI","uriError","safeDecodeURIComponent","uriComponent","uriComponentError","filterURLForDisplay","maxLength","filteredURL","match","mediaRegexp","urlPieces","file","slice","index","lastIndexOf","fileName","extension","truncatedFile","window","cleanForSlug","deburr","toLowerCase","getFilename","filename","pathname","pop","normalizePath","splitted","base","entry","sort","a","b","localeCompare"],"sourceRoot":""}
changelog.txt CHANGED
@@ -1,21 +1,290 @@
1
  == Changelog ==
2
 
3
- = 12.7.1 =
4
 
5
 
6
 
7
  ## Changelog
8
 
9
- ### Bug Fixes
10
 
11
- #### Block Library
12
- - Image block: Add additional selector to account for the move of is-style classes. ([39295](https://github.com/WordPress/gutenberg/pull/39295))
13
 
14
  ## Contributors
15
 
16
  The following contributors merged PRs in this release:
17
 
18
- @glendaviesnz
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
 
21
  = 12.7.0 =
1
  == Changelog ==
2
 
3
+ = 12.7.2 =
4
 
5
 
6
 
7
  ## Changelog
8
 
9
+ ### Enhancements
10
 
11
+ - Block Editor: Improve Global Styles filtering order. ([39364](https://github.com/WordPress/gutenberg/pull/39364))
12
+ - getQueryArgs: Improvement to prototype handling. ([39365](https://github.com/WordPress/gutenberg/pull/39365))
13
 
14
  ## Contributors
15
 
16
  The following contributors merged PRs in this release:
17
 
18
+ @jorgefilipecosta
19
+
20
+
21
+ = 12.8.0-rc.1 =
22
+
23
+
24
+
25
+ ## Changelog
26
+
27
+ ### Enhancements
28
+
29
+ - Change copying PHP files to dist directory to opt-in via a CLI flag. ([39171](https://github.com/WordPress/gutenberg/pull/39171))
30
+ - Raise z-index of content div relative to sidebars. ([38893](https://github.com/WordPress/gutenberg/pull/38893))
31
+
32
+ #### Components
33
+ - Enhance/confirmdialog add custom button text. ([38994](https://github.com/WordPress/gutenberg/pull/38994))
34
+ - InputControl: Allow onBlur for empty values to commit the change, move reset behaviour to ESCAPE key. ([39109](https://github.com/WordPress/gutenberg/pull/39109))
35
+ - Update framer motion to 6.2.8. ([38999](https://github.com/WordPress/gutenberg/pull/38999))
36
+ - `UnitControl`: Tidy up utils and types. ([38987](https://github.com/WordPress/gutenberg/pull/38987))
37
+
38
+ #### Post Editor
39
+ - Add interface preferences modal to edit post. ([39176](https://github.com/WordPress/gutenberg/pull/39176))
40
+ - Migrate hidden block types (block manager data) to new preferences packages. ([39132](https://github.com/WordPress/gutenberg/pull/39132))
41
+ - Migrate post editor feature preferences to use new preferences package. ([39115](https://github.com/WordPress/gutenberg/pull/39115))
42
+
43
+ #### Block Library
44
+ - Improve create new UI feedback in Nav block. ([39219](https://github.com/WordPress/gutenberg/pull/39219))
45
+ - Media & Text: Display media while uploading. ([39275](https://github.com/WordPress/gutenberg/pull/39275))
46
+
47
+ #### Testing
48
+ - Add Home/End keyboard end-to-end test for List View. ([39265](https://github.com/WordPress/gutenberg/pull/39265))
49
+ - Improve switch to draft button end-to-end test robustness. ([38971](https://github.com/WordPress/gutenberg/pull/38971))
50
+
51
+ #### Site Editor
52
+ - Migrate site editor to use new preferences package. ([39158](https://github.com/WordPress/gutenberg/pull/39158))
53
+ - Resolve homepage template on server-side. ([38817](https://github.com/WordPress/gutenberg/pull/38817))
54
+
55
+ #### Widgets Editor
56
+ - Migrate customize widgets editor to use new preferences package. ([39112](https://github.com/WordPress/gutenberg/pull/39112))
57
+ - Migrate standalone widgets editor to use new preferences package. ([39084](https://github.com/WordPress/gutenberg/pull/39084))
58
+
59
+ #### Media
60
+ - MediaReplaceFlow: Add 'onError' prop to handle error notifications. ([39197](https://github.com/WordPress/gutenberg/pull/39197))
61
+
62
+ #### Accessibility
63
+ - Block settings dropdown: Use block display title in remove label. ([39110](https://github.com/WordPress/gutenberg/pull/39110))
64
+
65
+ #### Global Styles
66
+ - Site Editor: Add theme.json to export file. ([39048](https://github.com/WordPress/gutenberg/pull/39048))
67
+
68
+ #### npm Packages
69
+ - Packages: Update CLI publishing tool to run in CI mode. ([38993](https://github.com/WordPress/gutenberg/pull/38993))
70
+
71
+ #### Block Editor
72
+ - Add a link completer for inline links to posts. ([29172](https://github.com/WordPress/gutenberg/pull/29172))
73
+
74
+
75
+ ### New APIs
76
+
77
+ - Add new `@wordpress/preferences` package. ([38873](https://github.com/WordPress/gutenberg/pull/38873))
78
+ - Create Block: Add support for more plugin header fields. ([39096](https://github.com/WordPress/gutenberg/pull/39096))
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ - Compose: Avoid memory leak in use-drop-zone. ([39038](https://github.com/WordPress/gutenberg/pull/39038))
84
+ - Fix Global styles overriding block's element styles. ([39012](https://github.com/WordPress/gutenberg/pull/39012))
85
+ - Fix: Button highlight popover overflow conflict with link popover. ([38771](https://github.com/WordPress/gutenberg/pull/38771))
86
+ - Fixes block highlight after block move. ([38915](https://github.com/WordPress/gutenberg/pull/38915))
87
+ - Render SVG props that have dashes correctly. ([38936](https://github.com/WordPress/gutenberg/pull/38936))
88
+ - apiFetch preloading middleware: Handle urlencoded and rest_route query params. ([38914](https://github.com/WordPress/gutenberg/pull/38914))
89
+
90
+ #### Block Library
91
+ - Added aria label to the button block with icon. ([38966](https://github.com/WordPress/gutenberg/pull/38966))
92
+ - File: Check if 'fileId' exists before setting the attribute. ([39088](https://github.com/WordPress/gutenberg/pull/39088))
93
+ - File: Don't display loading animation on upload error. ([39213](https://github.com/WordPress/gutenberg/pull/39213))
94
+ - File: Fix the undo trap. ([39215](https://github.com/WordPress/gutenberg/pull/39215))
95
+ - Fix Comments Pagination Number with no pagination settings. ([39204](https://github.com/WordPress/gutenberg/pull/39204))
96
+ - Fix file block validation error by not outputting aria-describedby if there's no description. ([39083](https://github.com/WordPress/gutenberg/pull/39083))
97
+ - Fix navigation menu error when menus are not yet fetched. ([39151](https://github.com/WordPress/gutenberg/pull/39151))
98
+ - Hide border panel when all border features have been disabled. ([36791](https://github.com/WordPress/gutenberg/pull/36791))
99
+ - Hide current menu from dropdown list in Nav block. ([38916](https://github.com/WordPress/gutenberg/pull/38916))
100
+ - Image: Display errors after failed upload. ([39178](https://github.com/WordPress/gutenberg/pull/39178))
101
+ - Media & Text: Display errors after failed upload. ([39245](https://github.com/WordPress/gutenberg/pull/39245))
102
+ - Post Expert: Fix missing class in post excerpt. ([38747](https://github.com/WordPress/gutenberg/pull/38747))
103
+ - Post Terms: Unescape HTML entities in term names. ([39216](https://github.com/WordPress/gutenberg/pull/39216))
104
+ - Restructure code bock styling. ([38712](https://github.com/WordPress/gutenberg/pull/38712))
105
+ - Try: Fix image responsive rules. ([39045](https://github.com/WordPress/gutenberg/pull/39045))
106
+ - Widget Group: Make `save()` markup the same as `render_callback` markup. ([38510](https://github.com/WordPress/gutenberg/pull/38510))
107
+ - [Cover]: Fix keep selected unit on deleting minHeight value. ([39145](https://github.com/WordPress/gutenberg/pull/39145))
108
+
109
+ #### Global Styles
110
+ - Fix Blocks list ordering in Global Styles. ([39093](https://github.com/WordPress/gutenberg/pull/39093))
111
+ - Fix default duotone preset SVG and style generation. ([38681](https://github.com/WordPress/gutenberg/pull/38681))
112
+ - [Global Styles]: Fix header panel height. ([39119](https://github.com/WordPress/gutenberg/pull/39119))
113
+
114
+ #### Testing
115
+ - Fix performance tests by adding backwards compatibility to welcome guide utility. ([39300](https://github.com/WordPress/gutenberg/pull/39300))
116
+ - e2e-tests: Update preview test to wait for publish panel to appear before closing it. ([39100](https://github.com/WordPress/gutenberg/pull/39100))
117
+
118
+ #### Components
119
+ - Update drag gesture of `InputControl`-based controls with axial constraint. ([38968](https://github.com/WordPress/gutenberg/pull/38968))
120
+ - `UnitControl`: Fix controlled `unit` behavior. ([39148](https://github.com/WordPress/gutenberg/pull/39148))
121
+
122
+ #### Post Editor
123
+ - Avoid error when 'styles' settings are removed. ([39091](https://github.com/WordPress/gutenberg/pull/39091))
124
+ - URL: Fix code drift in the Editor package by removing duplicate cleanForSlug function. ([39033](https://github.com/WordPress/gutenberg/pull/39033))
125
+
126
+ #### Build Tooling
127
+ - Fix `npm run docs:Build` crashing when a `block.json` lacks `supports` key. ([39241](https://github.com/WordPress/gutenberg/pull/39241))
128
+
129
+ #### npm Packages
130
+ - Packages: Automatically acceppt all Lerna commands when run with CI flag. ([39199](https://github.com/WordPress/gutenberg/pull/39199))
131
+
132
+ #### CSS & Styling
133
+ - Fixes #38761 by removing obsolete `::Before` pseudo element. ([38762](https://github.com/WordPress/gutenberg/pull/38762))
134
+
135
+
136
+ ### Documentation
137
+
138
+ - Add import useBlockProps. ([39072](https://github.com/WordPress/gutenberg/pull/39072))
139
+ - Docs: Emphasized requirement to enclose in quotation marks wp-env run…. ([39101](https://github.com/WordPress/gutenberg/pull/39101))
140
+ - Spelling error in `JustifyContentControl` example. ([39234](https://github.com/WordPress/gutenberg/pull/39234))
141
+ - [Gutenberg Data Tutorial] Part 3: Building an edit form. ([38581](https://github.com/WordPress/gutenberg/pull/38581))
142
+
143
+ #### Components
144
+ - Move recent CHANGELOG entry to `Unreleased` section. ([39169](https://github.com/WordPress/gutenberg/pull/39169))
145
+ - Storybook: Support proper extraction of TypeScript prop types. ([38842](https://github.com/WordPress/gutenberg/pull/38842))
146
+ - fix: Code example in flyout component. ([39156](https://github.com/WordPress/gutenberg/pull/39156))
147
+
148
+
149
+ ### Code Quality
150
+
151
+ - Core Data: Rename `types` directory to `entity-types`. ([39225](https://github.com/WordPress/gutenberg/pull/39225))
152
+ - Core data: Fix some typing issues. ([39212](https://github.com/WordPress/gutenberg/pull/39212))
153
+ - Core data: Fix some typing issues. ([39214](https://github.com/WordPress/gutenberg/pull/39214))
154
+ - Fix `@wordpress/comment-case` ESlint errors but without adding the disable-rule pragma. ([37006](https://github.com/WordPress/gutenberg/pull/37006))
155
+ - Refactor useSelect usages to useEntityRecords. ([38827](https://github.com/WordPress/gutenberg/pull/38827))
156
+
157
+ #### Post Editor
158
+ - useBlockEditorSettings: Remove unused unstableBase fetch. ([39221](https://github.com/WordPress/gutenberg/pull/39221))
159
+
160
+ #### Widgets Editor
161
+ - Delete widget editor redundant css for more menu. ([39113](https://github.com/WordPress/gutenberg/pull/39113))
162
+
163
+ #### Plugin
164
+ - Layout: Remove duplicate var declaration. ([39111](https://github.com/WordPress/gutenberg/pull/39111))
165
+
166
+ #### Global Styles
167
+ - Move editor settings code to compat folder. ([39030](https://github.com/WordPress/gutenberg/pull/39030))
168
+
169
+ #### Themes
170
+ - Don't filter 'theme_templates' when running WP 5.9. ([39017](https://github.com/WordPress/gutenberg/pull/39017))
171
+
172
+ #### Components
173
+ - TreeGrid: Update callback unit tests to use TreeGridRow and TreeGridCell sub components. ([39002](https://github.com/WordPress/gutenberg/pull/39002))
174
+
175
+ #### Block Library
176
+ - Improve Nav block loading and placeholder states. ([38907](https://github.com/WordPress/gutenberg/pull/38907))
177
+
178
+
179
+ ### Tools
180
+
181
+ - Code owners: Remove users without write access and fix typos. ([39238](https://github.com/WordPress/gutenberg/pull/39238))
182
+ - Simplify Pull Request template. ([39229](https://github.com/WordPress/gutenberg/pull/39229))
183
+
184
+ #### Testing
185
+ - Add end-to-end testing for experimental nav menu deletion. ([38955](https://github.com/WordPress/gutenberg/pull/38955))
186
+ - Add test case for post locking feature saving. ([39022](https://github.com/WordPress/gutenberg/pull/39022))
187
+ - Add tests for media replace flow. ([39005](https://github.com/WordPress/gutenberg/pull/39005))
188
+ - Block Test Fixtures: Add additional error message for serialized test fixtures that reserialize identically. ([39039](https://github.com/WordPress/gutenberg/pull/39039))
189
+ - Update 'clickMenuItem' test util to use full label matching. ([39274](https://github.com/WordPress/gutenberg/pull/39274))
190
+
191
+ #### Build Tooling
192
+ - Fix spelling of contributors in changelog script. ([39029](https://github.com/WordPress/gutenberg/pull/39029))
193
+ - Resolve peer dependency warnings. ([39043](https://github.com/WordPress/gutenberg/pull/39043))
194
+
195
+ #### npm Packages
196
+ - Packages: Automate npm publishing as part of Gutenberg release workflow. ([39259](https://github.com/WordPress/gutenberg/pull/39259))
197
+
198
+
199
+ ### Various
200
+
201
+ - Add a resolvable JavaScript entry point to base-styles. ([39240](https://github.com/WordPress/gutenberg/pull/39240))
202
+ - Add reusable preferences modal to interface package. ([39153](https://github.com/WordPress/gutenberg/pull/39153))
203
+ - Create Block: Add confirm prompt before showing the plugin options. ([39105](https://github.com/WordPress/gutenberg/pull/39105))
204
+ - Create Block: Improve custom project template configuration. ([39049](https://github.com/WordPress/gutenberg/pull/39049))
205
+ - Element: Add changelog notes for serialize attribute casing. ([39141](https://github.com/WordPress/gutenberg/pull/39141))
206
+ - Missing `,toggleFormat` from last code block. ([39146](https://github.com/WordPress/gutenberg/pull/39146))
207
+ - Remove rename rn UI tests. ([39042](https://github.com/WordPress/gutenberg/pull/39042))
208
+
209
+ #### Block Library
210
+ - Adding a GIF badge to image blocks with gifs in them. ([38996](https://github.com/WordPress/gutenberg/pull/38996))
211
+ - Buttons: Don't set a placeholder text color. ([39034](https://github.com/WordPress/gutenberg/pull/39034))
212
+ - Post author name: Add "post" prefix to CSS class. ([38320](https://github.com/WordPress/gutenberg/pull/38320))
213
+ - Post comments form block show warning wrt to post/page. ([38011](https://github.com/WordPress/gutenberg/pull/38011))
214
+ - Refactor classic menu conversion process. ([38858](https://github.com/WordPress/gutenberg/pull/38858))
215
+ - Social Icons - Begin Automating Existing Manual Test Cases. ([39027](https://github.com/WordPress/gutenberg/pull/39027))
216
+ - Tag Cloud: Use flex for the Outline style. ([38995](https://github.com/WordPress/gutenberg/pull/38995))
217
+
218
+ #### Components
219
+ - FontSizePicker: Refactor stories to use Controls. ([38727](https://github.com/WordPress/gutenberg/pull/38727))
220
+ - Normalize font-family. ([38969](https://github.com/WordPress/gutenberg/pull/38969))
221
+ - Storybook: Add webpack loader for easier story descriptions. ([39165](https://github.com/WordPress/gutenberg/pull/39165))
222
+ - [Components]: Update changelog follow up for #38985. ([39013](https://github.com/WordPress/gutenberg/pull/39013))
223
+
224
+ #### Themes
225
+ - Theme Export: Add index.php and style.css. ([39173](https://github.com/WordPress/gutenberg/pull/39173))
226
+
227
+ #### Icons
228
+ - Update Pin icon, add new Post icon. ([39139](https://github.com/WordPress/gutenberg/pull/39139))
229
+
230
+ #### Block Conversion
231
+ - [Block Conversion]: Show `group` option in `Group` blocks. ([39094](https://github.com/WordPress/gutenberg/pull/39094))
232
+
233
+ #### Accessibility
234
+ - Try allowing tab into block placeholder. ([39085](https://github.com/WordPress/gutenberg/pull/39085))
235
+
236
+ #### Full Site Editing
237
+ - Expose plugin area to site editor's List page. ([39078](https://github.com/WordPress/gutenberg/pull/39078))
238
+
239
+ #### Data Layer
240
+ - Handle resolution errors in @wordpress/data. ([38669](https://github.com/WordPress/gutenberg/pull/38669))
241
+
242
+ #### Design Tools
243
+ - Webfonts API. ([37140](https://github.com/WordPress/gutenberg/pull/37140))
244
+
245
+ #### Global Styles
246
+ - Account for upcoming changes in styles metadata in WordPress 5.9. ([36327](https://github.com/WordPress/gutenberg/pull/36327))
247
+
248
+
249
+ ## First time contributors
250
+
251
+ The following PRs were merged by first time contributors:
252
+
253
+ - @ahsanshaheen199: fix: Code example in flyout component. ([39156](https://github.com/WordPress/gutenberg/pull/39156))
254
+ - @alshakerM: Render SVG props that have dashes correctly. ([38936](https://github.com/WordPress/gutenberg/pull/38936))
255
+ - @awps: Missing `,toggleFormat` from last code block. ([39146](https://github.com/WordPress/gutenberg/pull/39146))
256
+ - @francisei: Docs: Emphasized requirement to enclose in quotation marks wp-env run…. ([39101](https://github.com/WordPress/gutenberg/pull/39101))
257
+ - @ironprogrammer: Raise z-index of content div relative to sidebars. ([38893](https://github.com/WordPress/gutenberg/pull/38893))
258
+ - @joshuafredrickson: Add a resolvable JavaScript entry point to base-styles. ([39240](https://github.com/WordPress/gutenberg/pull/39240))
259
+ - @jostnes: Remove rename rn UI tests. ([39042](https://github.com/WordPress/gutenberg/pull/39042))
260
+ - @mashikag: Fix Blocks list ordering in Global Styles. ([39093](https://github.com/WordPress/gutenberg/pull/39093))
261
+ - @tomasztunik: Fix Global styles overriding block's element styles. ([39012](https://github.com/WordPress/gutenberg/pull/39012))
262
+ - @Tumas2: Spelling error in `JustifyContentControl` example. ([39234](https://github.com/WordPress/gutenberg/pull/39234))
263
+
264
+
265
+ ## Contributors
266
+
267
+ The following contributors merged PRs in this release:
268
+
269
+ @adamziel @ahsanshaheen199 @ajlende @alexstine @alshakerM @amustaque97 @andrewserong @aristath @awps @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @delowardev @dmsnell @draganescu @fluiddot @francisei @getdave @gwwar @gziolo @illusaen @ironprogrammer @jasmussen @joshuafredrickson @jostnes @jsnajdr @Mamaduka @mashikag @mirka @ndiego @noahtallen @noisysocks @ntsekouras @oandregal @ocean90 @opr @priethor @ramonjd @ryanwelcher @scruffian @Sidsector9 @SiobhyB @Sisanu @stokesman @talldan @tellthemachines @tomasztunik @ttahmouch @Tumas2 @walbo @webmandesign @zaguiini @ZebulanStanphill
270
+
271
+
272
+ = 12.7.1 =
273
+
274
+
275
+
276
+ ## Changelog
277
+
278
+ ### Bug Fixes
279
+
280
+ #### Block Library
281
+ - Image block: Add additional selector to account for the move of is-style classes. ([39295](https://github.com/WordPress/gutenberg/pull/39295))
282
+
283
+ ## Contributors
284
+
285
+ The following contributors merged PRs in this release:
286
+
287
+ @glendaviesnz
288
 
289
 
290
  = 12.7.0 =
gutenberg.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.8
7
  * Requires PHP: 5.6
8
- * Version: 12.7.1
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
@@ -13,8 +13,8 @@
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
- define( 'GUTENBERG_VERSION', '12.7.1' );
17
- define( 'GUTENBERG_GIT_COMMIT', '98cd5b55ff55692073e3c00694cb16cd060963be' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.8
7
  * Requires PHP: 5.6
8
+ * Version: 12.7.2
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
+ define( 'GUTENBERG_VERSION', '12.7.2' );
17
+ define( 'GUTENBERG_GIT_COMMIT', 'e5daf514281d836d5e4cdb1b46548264d43b3bff' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
lib/global-styles.php CHANGED
@@ -171,14 +171,15 @@ function gutenberg_global_styles_filter_post( $content ) {
171
  * Adds the filters to filter global styles user theme.json.
172
  */
173
  function gutenberg_global_styles_kses_init_filters() {
174
- add_filter( 'content_save_pre', 'gutenberg_global_styles_filter_post' );
 
175
  }
176
 
177
  /**
178
  * Removes the filters to filter global styles user theme.json.
179
  */
180
  function gutenberg_global_styles_kses_remove_filters() {
181
- remove_filter( 'content_save_pre', 'gutenberg_global_styles_filter_post' );
182
  }
183
 
184
  /**
171
  * Adds the filters to filter global styles user theme.json.
172
  */
173
  function gutenberg_global_styles_kses_init_filters() {
174
+ // Global Styles filters should be executed before normal post_kses HTML filters which has the default priority of 10.
175
+ add_filter( 'content_save_pre', 'gutenberg_global_styles_filter_post', 9 );
176
  }
177
 
178
  /**
179
  * Removes the filters to filter global styles user theme.json.
180
  */
181
  function gutenberg_global_styles_kses_remove_filters() {
182
+ remove_filter( 'content_save_pre', 'gutenberg_global_styles_filter_post', 9 );
183
  }
184
 
185
  /**
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.9
4
- Stable tag: 12.7.0
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.9
4
+ Stable tag: 12.7.1
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7