diff --git a/package-lock.json b/package-lock.json index e024ec3598..961959b061 100644 --- a/package-lock.json +++ b/package-lock.json @@ -139,9 +139,9 @@ } }, "@babel/helper-define-polyfill-provider": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz", - "integrity": "sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.1.tgz", + "integrity": "sha512-x3AUTVZNPunaw1opRTa5OwVA5N0YxGlIad9xQ5QflK1uIS7PnAGGU5O2Dj/G183fR//N8AzTq+Q8+oiu9m0VFg==", "dev": true, "requires": { "@babel/helper-compilation-targets": "^7.13.0", @@ -1866,9 +1866,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "rimraf": { @@ -2080,9 +2080,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "source-map": { @@ -2498,6 +2498,12 @@ "resolved": "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz", "integrity": "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw==" }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, "@types/babel__core": { "version": "7.1.14", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", @@ -2540,9 +2546,9 @@ } }, "@types/cheerio": { - "version": "0.22.28", - "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.28.tgz", - "integrity": "sha512-ehUMGSW5IeDxJjbru4awKYMlKGmo1wSSGUVqXtYwlgmUM8X1a0PZttEIm6yEY7vHsY/hh6iPnklF213G0UColw==", + "version": "0.22.29", + "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.29.tgz", + "integrity": "sha512-rNX1PsrDPxiNiyLnRKiW2NXHJFHqx0Fl3J2WsZq0MTBspa/FgwlqhXJE2crIcc+/2IglLHtSWw7g053oUR8fOg==", "dev": true, "requires": { "@types/node": "*" @@ -3214,9 +3220,9 @@ } }, "@wordpress/block-directory": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-2.1.0.tgz", - "integrity": "sha512-jTiz6LHWxFoUSCd053FnIYyJDBj64Zi3jf4W2kGeeLL/UAxoJmnHNw/7dfD+udT+/3dVLiUvr5eVuImeKTURSQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-2.1.2.tgz", + "integrity": "sha512-jjJxJ/RonDbAgNl+Vbrdhub+RxuJwaSUxumxmUcCuiwaK2tc8eLcS0rkHhq0cOILvTzLFsmk4Ql0Pjbemnx1JQ==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.0", @@ -3225,11 +3231,11 @@ "@wordpress/blocks": "^9.1.0", "@wordpress/components": "^14.1.0", "@wordpress/compose": "^4.1.0", - "@wordpress/core-data": "^3.1.0", + "@wordpress/core-data": "^3.1.1", "@wordpress/data": "^5.1.0", "@wordpress/data-controls": "^2.1.0", - "@wordpress/edit-post": "^4.1.0", - "@wordpress/editor": "^10.1.0", + "@wordpress/edit-post": "^4.1.2", + "@wordpress/editor": "^10.1.1", "@wordpress/element": "^3.1.0", "@wordpress/hooks": "^3.1.0", "@wordpress/html-entities": "^3.1.0", @@ -3284,12 +3290,416 @@ "rememo": "^3.0.0", "tinycolor2": "^1.4.2", "traverse": "^0.6.6" + }, + "dependencies": { + "@wordpress/a11y": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.1.0.tgz", + "integrity": "sha512-wYDXl9/JQuryAsqLaM/9g9edqq+ZXCmqyvc6OH8zjZAUuIc7zzCxzrI0A/mMyZBaBPK9BequCEoqIlbjrJqI5A==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/dom-ready": "^3.1.0", + "@wordpress/i18n": "^4.1.0" + } + }, + "@wordpress/api-fetch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-5.1.0.tgz", + "integrity": "sha512-UEB+CAv5rKV1wRZBW/hh/0fqwCtiUD6dLs0XRhESa3LdU5TRnera+bvXZ6wo5BJt/D+cSFcndznpSoFmHFFFMg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^4.1.0", + "@wordpress/url": "^3.1.0" + } + }, + "@wordpress/autop": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.1.0.tgz", + "integrity": "sha512-vfrNXODE3QNpjHQE0j5f/TDzIQcRWw9+jrwyfohV+xl0LJXgXduRcSooiRiWzEbosYp9BGieMuQql28gQ+VAhQ==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/blob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.1.0.tgz", + "integrity": "sha512-f17a5x/z5ugIfzjowh393IJ0pi8WUqrAdafHT3F9v5w7zBq4C1zkam5pE1qja3AWdS4VT4drF+1LOwFRAJK1UQ==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/block-serialization-default-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.1.0.tgz", + "integrity": "sha512-uzmp8qf9+CG9+fCq8ceQGzhbbNbeC3pVPtlnED433BoLJqJn99aXV/hkL0fGW8wRO1l8JVjwfY+uTlcPv//IjA==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/blocks": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-9.1.0.tgz", + "integrity": "sha512-gbLq+335j+NvoR2uP5/X/pjs8b35Bz1qL3j4mZkC87ZPiFIOZYakwa6Uuuq86IO+w9nMHqq83yUUjMYPkAZhSA==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/autop": "^3.1.0", + "@wordpress/blob": "^3.1.0", + "@wordpress/block-serialization-default-parser": "^4.1.0", + "@wordpress/compose": "^4.1.0", + "@wordpress/data": "^5.1.0", + "@wordpress/deprecated": "^3.1.0", + "@wordpress/dom": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/hooks": "^3.1.0", + "@wordpress/html-entities": "^3.1.0", + "@wordpress/i18n": "^4.1.0", + "@wordpress/icons": "^4.0.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/shortcode": "^3.1.0", + "hpq": "^1.3.0", + "lodash": "^4.17.21", + "rememo": "^3.0.0", + "showdown": "^1.9.1", + "simple-html-tokenizer": "^0.5.7", + "tinycolor2": "^1.4.2", + "uuid": "^8.3.0" + } + }, + "@wordpress/components": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-14.1.0.tgz", + "integrity": "sha512-K+/NU0Tvz53U6EI5SanF6YzndJfaVcG4wdTkEieitI71oJn3wgNDJz+exzuTN6tdG971NlnioWI4oGvgljt4NA==", + "requires": { + "@babel/runtime": "^7.13.10", + "@emotion/cache": "^10.0.27", + "@emotion/core": "^10.1.1", + "@emotion/css": "^10.0.22", + "@emotion/native": "^10.0.22", + "@emotion/styled": "^10.0.23", + "@wordpress/a11y": "^3.1.0", + "@wordpress/compose": "^4.1.0", + "@wordpress/date": "^4.1.0", + "@wordpress/deprecated": "^3.1.0", + "@wordpress/dom": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/hooks": "^3.1.0", + "@wordpress/i18n": "^4.1.0", + "@wordpress/icons": "^4.0.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/keycodes": "^3.1.0", + "@wordpress/primitives": "^2.1.0", + "@wordpress/rich-text": "^4.1.0", + "@wordpress/warning": "^2.1.0", + "classnames": "^2.2.5", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "emotion": "^10.0.23", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "moment": "^2.22.1", + "re-resizable": "^6.4.0", + "react-dates": "^17.1.1", + "react-resize-aware": "^3.1.0", + "react-spring": "^8.0.20", + "react-use-gesture": "^9.0.0", + "reakit": "^1.3.5", + "rememo": "^3.0.0", + "tinycolor2": "^1.4.2", + "uuid": "^8.3.0" + } + }, + "@wordpress/compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-4.1.0.tgz", + "integrity": "sha512-/luv2I9XdHT/4mRCsH2Tv9OHT4wuShRd2+9VYVvadQYg26s0OvOPBct88gYKBq4g/XlH4hJmVodCbv2hOJRw6Q==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/deprecated": "^3.1.0", + "@wordpress/dom": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/keycodes": "^3.1.0", + "@wordpress/priority-queue": "^2.1.0", + "clipboard": "^2.0.1", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "mousetrap": "^1.6.5", + "react-resize-aware": "^3.1.0", + "use-memo-one": "^1.1.1" + } + }, + "@wordpress/data": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-5.1.0.tgz", + "integrity": "sha512-P0TT9UJLfCdi8fXChfLGwtkWAl1Qtw49tZ580RdC2wiDym52EDcDiiHhALKCPprNS23bYXxBw46kAJxhUNwNHA==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/compose": "^4.1.0", + "@wordpress/deprecated": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/priority-queue": "^2.1.0", + "@wordpress/redux-routine": "^4.1.0", + "equivalent-key-map": "^0.2.2", + "is-promise": "^4.0.0", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "redux": "^4.1.0", + "turbo-combine-reducers": "^1.0.2", + "use-memo-one": "^1.1.1" + } + }, + "@wordpress/data-controls": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/data-controls/-/data-controls-2.1.0.tgz", + "integrity": "sha512-jBid81RK56cF6GDVoWiGI0yaPYBKwepa4q/HunlLwKS+mEdJTng24azRh38EvsxZLdgbXAwKb9FVcacNag7sTg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/api-fetch": "^5.1.0", + "@wordpress/data": "^5.1.0", + "@wordpress/deprecated": "^3.1.0" + } + }, + "@wordpress/date": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.1.0.tgz", + "integrity": "sha512-hMId0AQ8tcBRiG9dlMOy0q0oTZ1PM4u5S3lIUPJPIV1K/IHr4nWB1/ODvK/gMLP6JSzNr/sLQlgtCfD0hVQh+w==", + "requires": { + "@babel/runtime": "^7.13.10", + "moment": "^2.22.1", + "moment-timezone": "^0.5.31" + } + }, + "@wordpress/deprecated": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.1.0.tgz", + "integrity": "sha512-rgEOkBSiarmL68nkn+5CrZWUkr7LNJkBzdIrEIChENEbC26GvkskeoZxGw+xXs9GBWyv6NRRu9NvftQKcQPgUg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/hooks": "^3.1.0" + } + }, + "@wordpress/dom": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.1.0.tgz", + "integrity": "sha512-gjLbvmRIGi8PcxxPvzWLp6Y3SEn/t5V8rEOpLypTbE18wEcU7tZzjG1wtARLwtoKdBSwKfs5hY7B/HPkm+37tg==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.21" + } + }, + "@wordpress/dom-ready": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.1.0.tgz", + "integrity": "sha512-w/SYZfZrCDMRaes2odJZ+m0P3n7bKUNcliZUhNIvSz3iNq/xIt7Ean5YJQa17M2kqGz2R1t8D7gYabT0mDZMQA==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/element": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-3.1.0.tgz", + "integrity": "sha512-dDCs7zIH4CCa6q+BzDHpn99NLvgKDcM9/p4pAcCppNnR352wipmWK3EK6faWfzv1M6o+VJXhIQuXahxKPLpBsg==", + "requires": { + "@babel/runtime": "^7.13.10", + "@types/react": "^16.9.0", + "@types/react-dom": "^16.9.0", + "@wordpress/escape-html": "^2.1.0", + "lodash": "^4.17.21", + "react": "^16.13.1", + "react-dom": "^16.13.1" + } + }, + "@wordpress/escape-html": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.1.0.tgz", + "integrity": "sha512-N0EZokyky5O5ib8jyqIyzd7Bg+z0XOxrUmHv6kE8o1FpdVwZYFAVg9ZAhb9YQYfFVqIrfbste+v3Mak0iKrD4A==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/hooks": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.1.0.tgz", + "integrity": "sha512-mE94KYLanCj3YK3TF4L1pBtLplcKVHBwv+n1u3jkrnNuH8C7LWhZMddnip0B1FlSPut3Sut+R2pQcI9xuH4fPQ==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/html-entities": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-3.1.0.tgz", + "integrity": "sha512-zKDc00lP9H7d+8vSXzUgxtDRLA/Pf+42R7sqOFpvdFM2GlGxjRP0pj10PmYov2HYO2FmIwQqCpdITX+a4/tX4Q==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/i18n": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.1.0.tgz", + "integrity": "sha512-wn4z/bspItNFghUQ3tGdXd7BgTNt0XknEvxr5yeZ9wEeXK02SBwET1GNYJMcpOCXBaYBKJ9Va80jk5bW60JJ/w==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/hooks": "^3.1.0", + "gettext-parser": "^1.3.1", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" + } + }, + "@wordpress/icons": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-4.0.0.tgz", + "integrity": "sha512-WuHEHwuI1NtoK2poJjSE7s14Tv8JZEOaAvK0CFN0NJPOznuLzPmykrL0FtVStDDnsaFqPdnsSzk9JE+nTojeBQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/element": "^3.1.0", + "@wordpress/primitives": "^2.1.0" + } + }, + "@wordpress/is-shallow-equal": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.1.0.tgz", + "integrity": "sha512-qj0X9r1eVYX+XYCNA5pdNq42OU/To68aYY6iZwpJ3jaaAYmUdA9T4tjGwSgU3MSqFDV4NUE6X+kf71XgNxjFjQ==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/keyboard-shortcuts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-2.1.0.tgz", + "integrity": "sha512-tY1Vr0ZeFtPJUhHOj8UUY8E3C6l521E44a5CKC1oJURXDbIriVPQIN/Cvv8gMDDhX31Fj94Qzz+0du3znUxd8Q==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/compose": "^4.1.0", + "@wordpress/data": "^5.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/keycodes": "^3.1.0", + "lodash": "^4.17.21", + "rememo": "^3.0.0" + } + }, + "@wordpress/keycodes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.1.0.tgz", + "integrity": "sha512-P9w9e68cSrQo8ypG+nHXMhQOm7YkCxwqkrFz8L5Y2T1hGqb3SJF9/IrBQiBjV5e6yTQRgWk5mGZqK8pEAM+WZQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/i18n": "^4.1.0", + "lodash": "^4.17.21" + } + }, + "@wordpress/notices": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-3.1.0.tgz", + "integrity": "sha512-PiqHUT4Ftk4KdvEUZ89BTIGugFA60NdAquu5OVj5373vWtezaJO8gwcKvA+qY7sIroWEiN+7etcsq4SJR0i6oQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/a11y": "^3.1.0", + "@wordpress/data": "^5.1.0", + "lodash": "^4.17.21" + } + }, + "@wordpress/primitives": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-2.1.0.tgz", + "integrity": "sha512-MAWLEN5ZhNBlHBDbjq3HIp78Ny53KAjLzGJ5OHTxspsbyOp+AbWMaxxkZ3k8Cm6sXWVD8UOiTbDElK70U+X/MQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/element": "^3.1.0", + "classnames": "^2.2.5" + } + }, + "@wordpress/priority-queue": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.1.0.tgz", + "integrity": "sha512-0jfdKTFQnOPg+t2x/Zs6vkpb76lzClT8QP+dnUjHJvsn8WZ+b2BC9R7Qo7RBeQjnz5ii3nFnRAA0YgpsLBRXdQ==", + "requires": { + "@babel/runtime": "^7.13.10" + } + }, + "@wordpress/redux-routine": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.1.0.tgz", + "integrity": "sha512-Ju+YKXQOo6S8gy/ctfCf+bQ4eR7zsCMABLF7X/yk2+WE5kA91+STuWLHMX9AwKW2LOwS1cOhYzqJnmGPrY14uw==", + "requires": { + "@babel/runtime": "^7.13.10", + "is-promise": "^4.0.0", + "lodash": "^4.17.21", + "rungen": "^0.3.2" + } + }, + "@wordpress/rich-text": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-4.1.0.tgz", + "integrity": "sha512-+7DvKaD+NmgrMWYHb+bsZ+2C+hq6OUiQzMdIlZH0XdsY95CF83b6Fp+MMLJ0tWR0dw5YShKOQnY3gm969AJTxA==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/compose": "^4.1.0", + "@wordpress/data": "^5.1.0", + "@wordpress/dom": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/escape-html": "^2.1.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/keycodes": "^3.1.0", + "classnames": "^2.2.5", + "lodash": "^4.17.21", + "memize": "^1.1.0", + "rememo": "^3.0.0" + } + }, + "@wordpress/shortcode": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.1.0.tgz", + "integrity": "sha512-a32GLIvW57j2crzAR05gDgtYuE8B00eoex79t27kFL9C/qftD28qpF63KpkM4E9+fyDFEaZFLxQoLiRYpcVenQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.21", + "memize": "^1.1.0" + } + }, + "@wordpress/token-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.1.0.tgz", + "integrity": "sha512-EE+Kt0R+FgZtEa4lbYDlWSIA9KAr7wjOIogpBFPbDmwD6f2tEa3gFvIX5LlffvMjIm8ftWCN2oYCHdI1r2AqnA==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.21" + } + }, + "@wordpress/url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.1.0.tgz", + "integrity": "sha512-XGvM4WZhQveRZOalGwUaj0xfrohMPtUZY5rfwWWTdSX9yo3fZECFsfg0msm0x1UwRxcxS9fBk9YgixtyaGdnCA==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.21", + "react-native-url-polyfill": "^1.1.2" + } + }, + "@wordpress/warning": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.1.0.tgz", + "integrity": "sha512-/pGUDZK5ONnsvLAhHXFGI6bRPBJvKzY0/6G9ZpA37oNa49S/BB9cxt5cNFEt+mFapRg6U+Tz8FAsi0qJ8ruupQ==" + }, + "@wordpress/wordcount": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.1.0.tgz", + "integrity": "sha512-a9K1KUGl9KcWP1j0LuYEJw1OXYWTKNh9R8jEw8Jc5v4DiMABaxY97l2SZGpJoFfVWJt93bgp2v3YadAoKnsNGg==", + "requires": { + "@babel/runtime": "^7.13.10", + "lodash": "^4.17.21" + } + } } }, "@wordpress/block-library": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-3.1.0.tgz", - "integrity": "sha512-m1oMg64kfB2qR+A+eXQCNIue9+4S901csm4gI18Gz5bV1cOPC76DabRJADnC2+JOwtuFunWAQkz1cPLQMaC20w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-3.2.1.tgz", + "integrity": "sha512-4vwOJSIijBQsgY1paqdvolfyFIkHkjmYJX7svQYACyarUl4wPMiA3unBARE0dcsq2vNGuKr69uAwf5fYk0d3Kw==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.0", @@ -3300,12 +3710,12 @@ "@wordpress/blocks": "^9.1.0", "@wordpress/components": "^14.1.0", "@wordpress/compose": "^4.1.0", - "@wordpress/core-data": "^3.1.0", + "@wordpress/core-data": "^3.1.1", "@wordpress/data": "^5.1.0", "@wordpress/date": "^4.1.0", "@wordpress/deprecated": "^3.1.0", "@wordpress/dom": "^3.1.0", - "@wordpress/editor": "^10.1.0", + "@wordpress/editor": "^10.1.1", "@wordpress/element": "^3.1.0", "@wordpress/escape-html": "^2.1.0", "@wordpress/hooks": "^3.1.0", @@ -3315,7 +3725,7 @@ "@wordpress/keycodes": "^3.1.0", "@wordpress/notices": "^3.1.0", "@wordpress/primitives": "^2.1.0", - "@wordpress/reusable-blocks": "^2.1.0", + "@wordpress/reusable-blocks": "^2.1.1", "@wordpress/rich-text": "^4.1.0", "@wordpress/server-side-render": "^2.1.0", "@wordpress/url": "^3.1.0", @@ -3439,9 +3849,9 @@ } }, "@wordpress/core-data": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-3.1.0.tgz", - "integrity": "sha512-Wh3MJERzhpAEkQBcfnutx1U8hgBU9DDR2Cu9SpDhKocZgDueU+HyZ6i6tlE38Ous1R8gk1r9b5W0N9YXQfbL3Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-3.1.1.tgz", + "integrity": "sha512-O9aEqVdLRjo0g9UlgNaFsa/swbPdsdscQ/q8IBirDTWMoeRJTaINa2fQHe5G9QeeGA1frKwrKRPeWQ9lwM6ANg==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/api-fetch": "^5.1.0", @@ -3468,6 +3878,34 @@ "escape-string-regexp": "^1.0.5" } }, + "@wordpress/customize-widgets": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-1.0.1.tgz", + "integrity": "sha512-ndGtrDdXqrD1FrBUM5wwzcYrj1gfvhZtKmJudJQ+L17lxPWNnpxRHWDNsK80/UxaTluatDU782kuucTu3S5Icw==", + "requires": { + "@babel/runtime": "^7.11.2", + "@wordpress/a11y": "^3.1.0", + "@wordpress/block-editor": "^6.1.0", + "@wordpress/block-library": "^3.2.1", + "@wordpress/blocks": "^9.1.0", + "@wordpress/components": "^14.1.0", + "@wordpress/compose": "^4.1.0", + "@wordpress/core-data": "^3.1.1", + "@wordpress/data": "^5.1.0", + "@wordpress/dom": "^3.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/hooks": "^3.1.0", + "@wordpress/i18n": "^4.1.0", + "@wordpress/icons": "^4.0.0", + "@wordpress/is-shallow-equal": "^4.1.0", + "@wordpress/keyboard-shortcuts": "^2.1.0", + "@wordpress/keycodes": "^3.1.0", + "@wordpress/media-utils": "^2.1.0", + "@wordpress/widgets": "^1.1.1", + "classnames": "^2.2.6", + "lodash": "^4.17.21" + } + }, "@wordpress/data": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-5.1.0.tgz", @@ -3578,22 +4016,22 @@ } }, "@wordpress/edit-post": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-4.1.0.tgz", - "integrity": "sha512-JkWuOSkBtpIUzzG78S+AUaAHE8oBT7lzJyRhMlOX+yThhPGWgGyqB670vvDBUFk59BCPTEknZGGtYLrMYmrjCQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-4.1.2.tgz", + "integrity": "sha512-BJrBXqK/2AcC+ooNNLWkxNrBKcbDJSVtCpE76jNyk/Qv7211p++HrcaubY0z5veMeRTB4ayEa0ky9HYwgcy3Nw==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/a11y": "^3.1.0", "@wordpress/api-fetch": "^5.1.0", "@wordpress/block-editor": "^6.1.0", - "@wordpress/block-library": "^3.1.0", + "@wordpress/block-library": "^3.2.1", "@wordpress/blocks": "^9.1.0", "@wordpress/components": "^14.1.0", "@wordpress/compose": "^4.1.0", - "@wordpress/core-data": "^3.1.0", + "@wordpress/core-data": "^3.1.1", "@wordpress/data": "^5.1.0", "@wordpress/data-controls": "^2.1.0", - "@wordpress/editor": "^10.1.0", + "@wordpress/editor": "^10.1.1", "@wordpress/element": "^3.1.0", "@wordpress/hooks": "^3.1.0", "@wordpress/i18n": "^4.1.0", @@ -3623,10 +4061,46 @@ } } }, + "@wordpress/edit-widgets": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-2.1.2.tgz", + "integrity": "sha512-P4aH1KikWJmJxWo+MnFoi+x7b3b4WLDRmWEwU06XcrMtcYN1U4Zmu0aygp+e949qPSbcSYPMOyIKVK32NuNpMA==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/a11y": "^3.1.0", + "@wordpress/api-fetch": "^5.1.0", + "@wordpress/block-editor": "^6.1.0", + "@wordpress/block-library": "^3.2.1", + "@wordpress/blocks": "^9.1.0", + "@wordpress/components": "^14.1.0", + "@wordpress/compose": "^4.1.0", + "@wordpress/core-data": "^3.1.1", + "@wordpress/data": "^5.1.0", + "@wordpress/data-controls": "^2.1.0", + "@wordpress/element": "^3.1.0", + "@wordpress/hooks": "^3.1.0", + "@wordpress/i18n": "^4.1.0", + "@wordpress/icons": "^4.0.0", + "@wordpress/interface": "^3.1.0", + "@wordpress/keyboard-shortcuts": "^2.1.0", + "@wordpress/keycodes": "^3.1.0", + "@wordpress/media-utils": "^2.1.0", + "@wordpress/notices": "^3.1.0", + "@wordpress/plugins": "^3.1.0", + "@wordpress/reusable-blocks": "^2.1.1", + "@wordpress/server-side-render": "^2.1.0", + "@wordpress/url": "^3.1.0", + "@wordpress/widgets": "^1.1.1", + "classnames": "^2.2.5", + "lodash": "^4.17.21", + "rememo": "^3.0.0", + "uuid": "^8.3.0" + } + }, "@wordpress/editor": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-10.1.0.tgz", - "integrity": "sha512-dEudn+0DQCD8Ryiq1J7BrKEU+kttgnKIX1dZEs60gD+dNwrTPMBr78g0qsxwVZlWIbFT/honHRWgLHBo4qeg9g==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-10.1.1.tgz", + "integrity": "sha512-4o4s8Mxyn06h+JtzQOnsLloYLvkn4gu/7bIm5g5ubA7W4BJ/DGYxt5bBM21Qh1E+SVaClM7+5dFQ8RK+QYZIBA==", "requires": { "@babel/runtime": "^7.13.10", "@wordpress/api-fetch": "^5.1.0", @@ -3636,7 +4110,7 @@ "@wordpress/blocks": "^9.1.0", "@wordpress/components": "^14.1.0", "@wordpress/compose": "^4.1.0", - "@wordpress/core-data": "^3.1.0", + "@wordpress/core-data": "^3.1.1", "@wordpress/data": "^5.1.0", "@wordpress/data-controls": "^2.1.0", "@wordpress/date": "^4.1.0", @@ -3651,7 +4125,7 @@ "@wordpress/keycodes": "^3.1.0", "@wordpress/media-utils": "^2.1.0", "@wordpress/notices": "^3.1.0", - "@wordpress/reusable-blocks": "^2.1.0", + "@wordpress/reusable-blocks": "^2.1.1", "@wordpress/rich-text": "^4.1.0", "@wordpress/server-side-render": "^2.1.0", "@wordpress/url": "^3.1.0", @@ -4086,15 +4560,15 @@ } }, "@wordpress/reusable-blocks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-2.1.0.tgz", - "integrity": "sha512-5xXMgLTaULcaBLYSeRegacz3mC9dPEZUssySFx10ill6yxnNR7W5QXtdXxeuQE43la7fPuCdqCf6W0nrCoxSgA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-2.1.1.tgz", + "integrity": "sha512-SD4oEYBBqYnuKBiCGM3sSO3tOdi5JhCCjdos2MXbD5oaoY8QeVKYvCYIwdDk1xlGIoV0PaX7dinUEB0Hu5a2bQ==", "requires": { "@wordpress/block-editor": "^6.1.0", "@wordpress/blocks": "^9.1.0", "@wordpress/components": "^14.1.0", "@wordpress/compose": "^4.1.0", - "@wordpress/core-data": "^3.1.0", + "@wordpress/core-data": "^3.1.1", "@wordpress/data": "^5.1.0", "@wordpress/element": "^3.1.0", "@wordpress/i18n": "^4.1.0", @@ -4756,6 +5230,20 @@ "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.1.0.tgz", "integrity": "sha512-/pGUDZK5ONnsvLAhHXFGI6bRPBJvKzY0/6G9ZpA37oNa49S/BB9cxt5cNFEt+mFapRg6U+Tz8FAsi0qJ8ruupQ==" }, + "@wordpress/widgets": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-1.1.1.tgz", + "integrity": "sha512-DnPvVcjx/QfGRX57vecpL1vIQFrijsVB6t6dzlZjCM+Kw4QY/qjmyyTg32G8TKhHg+d6amsscc9CTLawdArBtQ==", + "requires": { + "@babel/runtime": "^7.13.10", + "@wordpress/blocks": "^9.1.0", + "@wordpress/components": "^14.1.0", + "@wordpress/core-data": "^3.1.1", + "@wordpress/data": "^5.1.0", + "@wordpress/i18n": "^4.1.0", + "@wordpress/icons": "^4.0.0" + } + }, "@wordpress/wordcount": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.1.0.tgz", @@ -5972,13 +6460,13 @@ } }, "babel-plugin-polyfill-corejs2": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz", - "integrity": "sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.1.tgz", + "integrity": "sha512-hXGSPbr6IbjeMyGew+3uGIAkRjBFSOJ9FLDZNOfHuyJZCcoia4nd/72J0bSgvfytcVfUcP/dxEVcUhVJuQRtSw==", "dev": true, "requires": { "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.1", "semver": "^6.1.1" }, "dependencies": { @@ -5991,22 +6479,22 @@ } }, "babel-plugin-polyfill-corejs3": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz", - "integrity": "sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.1.tgz", + "integrity": "sha512-WZCqF3DLUhdTD/P381MDJfuP18hdCZ+iqJ+wHtzhWENpsiof284JJ1tMQg1CE+hfCWyG48F7e5gDMk2c3Laz7w==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.1", "core-js-compat": "^3.9.1" } }, "babel-plugin-polyfill-regenerator": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz", - "integrity": "sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.1.tgz", + "integrity": "sha512-T3bYyL3Sll2EtC94v3f+fA8M28q7YPTOZdB++SRHjvYZTvtd+WorMUq3tDTD4Q7Kjk1LG0gGromslKjcO5p2TA==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.0" + "@babel/helper-define-polyfill-provider": "^0.2.1" } }, "babel-plugin-syntax-jsx": { @@ -7856,27 +8344,6 @@ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, - "contains-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-1.0.0.tgz", - "integrity": "sha1-NFizMhhWA+ju0Y9RjUoQiIo6vJE=", - "dev": true, - "requires": { - "normalize-path": "^2.1.1", - "path-starts-with": "^1.0.0" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -9745,9 +10212,9 @@ } }, "eslint": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", - "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.27.0.tgz", + "integrity": "sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", @@ -9758,12 +10225,14 @@ "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.1", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", @@ -9775,7 +10244,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -9784,7 +10253,7 @@ "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -9824,6 +10293,12 @@ "esutils": "^2.0.2" } }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -9994,14 +10469,13 @@ } }, "eslint-plugin-import": { - "version": "2.23.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.2.tgz", - "integrity": "sha512-LmNoRptHBxOP+nb0PIKz1y6OSzCJlB+0g0IGS3XV4KaKk2q4szqQ6s6F1utVf5ZRkxk/QOTjdxe7v4VjS99Bsg==", + "version": "2.23.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.3.tgz", + "integrity": "sha512-wDxdYbSB55F7T5CC7ucDjY641VvKmlRwT0Vxh7PkY1mI4rclVRFWYfsrjDgZvwYYDZ5ee0ZtfFKXowWjqvEoRQ==", "dev": true, "requires": { "array-includes": "^3.1.3", "array.prototype.flat": "^1.2.4", - "contains-path": "^1.0.0", "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.4", @@ -11141,9 +11615,9 @@ }, "dependencies": { "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true } } @@ -11652,9 +12126,9 @@ "dev": true }, "fraction.js": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.1.0.tgz", - "integrity": "sha512-o9lSKpK0TDqDwTL24Hxqi6I99s942l6TYkfl6WvGWgLOIFz/YonSGKfiSeMadoiNvTfqnfOa9mjb5SGVbBK9/w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.1.1.tgz", + "integrity": "sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg==", "dev": true }, "fragment-cache": { @@ -13400,6 +13874,28 @@ "requires-port": "^1.0.0" } }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + } + } + }, "http-proxy-middleware": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", @@ -14933,9 +15429,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "to-regex-range": { @@ -15154,9 +15650,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "to-regex-range": { @@ -15270,9 +15766,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "to-regex-range": { @@ -15703,9 +16199,9 @@ } }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "to-regex-range": { @@ -15942,13 +16438,13 @@ "dev": true }, "jsdom": { - "version": "16.5.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.3.tgz", - "integrity": "sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", + "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", "dev": true, "requires": { "abab": "^2.0.5", - "acorn": "^8.1.0", + "acorn": "^8.2.4", "acorn-globals": "^6.0.0", "cssom": "^0.4.4", "cssstyle": "^2.3.0", @@ -15956,12 +16452,13 @@ "decimal.js": "^10.2.1", "domexception": "^2.0.1", "escodegen": "^2.0.0", + "form-data": "^3.0.0", "html-encoding-sniffer": "^2.0.1", - "is-potential-custom-element-name": "^1.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", "parse5": "6.0.1", - "request": "^2.88.2", - "request-promise-native": "^1.0.9", "saxes": "^5.0.1", "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", @@ -15971,7 +16468,7 @@ "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.5.0", - "ws": "^7.4.4", + "ws": "^7.4.5", "xml-name-validator": "^3.0.0" }, "dependencies": { @@ -15981,6 +16478,36 @@ "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==", "dev": true }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", @@ -16577,6 +17104,12 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -18984,26 +19517,6 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, - "path-starts-with": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-starts-with/-/path-starts-with-1.0.0.tgz", - "integrity": "sha1-soJDAV6LE43lcmgqxS2kLmRq2E4=", - "dev": true, - "requires": { - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -21110,38 +21623,6 @@ } } }, - "request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "dev": true, - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "dependencies": { - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -22702,12 +23183,6 @@ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, "stream-browserify": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", @@ -23523,9 +23998,9 @@ "dev": true }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "postcss-selector-parser": { @@ -24337,9 +24812,9 @@ } }, "tr46": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", - "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", "dev": true, "requires": { "punycode": "^2.1.1" diff --git a/package.json b/package.json index 5defc3c786..9dfe439594 100644 --- a/package.json +++ b/package.json @@ -82,22 +82,24 @@ "@wordpress/api-fetch": "5.1.0", "@wordpress/autop": "3.1.0", "@wordpress/blob": "3.1.0", - "@wordpress/block-directory": "2.1.0", + "@wordpress/block-directory": "2.1.2", "@wordpress/block-editor": "6.1.0", - "@wordpress/block-library": "3.1.0", + "@wordpress/block-library": "3.2.1", "@wordpress/block-serialization-default-parser": "4.1.0", "@wordpress/blocks": "9.1.0", "@wordpress/components": "14.1.0", "@wordpress/compose": "4.1.0", - "@wordpress/core-data": "3.1.0", + "@wordpress/core-data": "3.1.1", + "@wordpress/customize-widgets": "1.0.1", "@wordpress/data": "5.1.0", "@wordpress/data-controls": "2.1.0", "@wordpress/date": "4.1.0", "@wordpress/deprecated": "3.1.0", "@wordpress/dom": "3.1.0", "@wordpress/dom-ready": "3.1.0", - "@wordpress/edit-post": "4.1.0", - "@wordpress/editor": "10.1.0", + "@wordpress/edit-post": "4.1.2", + "@wordpress/edit-widgets": "2.1.2", + "@wordpress/editor": "10.1.1", "@wordpress/element": "3.1.0", "@wordpress/escape-html": "2.1.0", "@wordpress/format-library": "2.1.0", @@ -117,7 +119,7 @@ "@wordpress/primitives": "2.1.0", "@wordpress/priority-queue": "2.1.0", "@wordpress/redux-routine": "4.1.0", - "@wordpress/reusable-blocks": "2.1.0", + "@wordpress/reusable-blocks": "2.1.1", "@wordpress/rich-text": "4.1.0", "@wordpress/server-side-render": "2.1.0", "@wordpress/shortcode": "3.1.0", @@ -125,6 +127,7 @@ "@wordpress/url": "3.1.0", "@wordpress/viewport": "3.1.0", "@wordpress/warning": "2.1.0", + "@wordpress/widgets": "1.1.1", "@wordpress/wordcount": "3.1.0", "backbone": "1.4.0", "clipboard": "2.0.8", diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index d2b5fda09e..7ee3d03b74 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -190,8 +190,7 @@ if ( is_network_admin() ) { $admin_body_class .= ' no-customize-support no-svg'; if ( $current_screen->is_block_editor() ) { - // Default to is-fullscreen-mode to avoid jumps in the UI. - $admin_body_class .= ' block-editor-page is-fullscreen-mode wp-embed-responsive'; + $admin_body_class .= ' block-editor-page wp-embed-responsive'; } $error_get_last = error_get_last(); diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 848157de96..eaf0138412 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -29,6 +29,14 @@ $block_editor_context = new WP_Block_Editor_Context( array( 'post' => $post ) ); $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); +// Default to is-fullscreen-mode to avoid jumps in the UI. +add_filter( + 'admin_body_class', + function( $classes ) { + return "$classes is-fullscreen-mode"; + } +); + /* * Emoji replacement is disabled for now, until it plays nicely with React. */ diff --git a/src/wp-admin/widgets.php b/src/wp-admin/widgets.php index ef9c8737eb..303ebb0bc9 100644 --- a/src/wp-admin/widgets.php +++ b/src/wp-admin/widgets.php @@ -1,6 +1,6 @@ add_help_tab( - array( - 'id' => 'overview', - 'title' => __( 'Overview' ), - 'content' => - '

' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '

-

' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '

', - ) -); -get_current_screen()->add_help_tab( - array( - 'id' => 'removing-reusing', - 'title' => __( 'Removing and Reusing' ), - 'content' => - '

' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '

-

' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.' ) . '

-

' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '

', - ) -); -get_current_screen()->add_help_tab( - array( - 'id' => 'missing-widgets', - 'title' => __( 'Missing Widgets' ), - 'content' => - '

' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '

' . - '

' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '

', - ) -); - -get_current_screen()->set_help_sidebar( - '

' . __( 'For more information:' ) . '

' . - '

' . __( 'Documentation on Widgets' ) . '

' . - '

' . __( 'Support' ) . '

' -); - -if ( ! current_theme_supports( 'widgets' ) ) { - wp_die( __( 'The theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.' ) ); -} - -// These are the widgets grouped by sidebar. -$sidebars_widgets = wp_get_sidebars_widgets(); - -if ( empty( $sidebars_widgets ) ) { - $sidebars_widgets = wp_get_widget_defaults(); -} - -foreach ( $sidebars_widgets as $sidebar_id => $widgets ) { - if ( 'wp_inactive_widgets' === $sidebar_id ) { - continue; - } - - if ( ! is_registered_sidebar( $sidebar_id ) ) { - if ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar. - register_sidebar( - array( - 'name' => __( 'Inactive Sidebar (not used)' ), - 'id' => $sidebar_id, - 'class' => 'inactive-sidebar orphan-sidebar', - 'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ), - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', - ) - ); - } else { - unset( $sidebars_widgets[ $sidebar_id ] ); - } - } -} - -// Register the inactive_widgets area as sidebar. -register_sidebar( - array( - 'name' => __( 'Inactive Widgets' ), - 'id' => 'wp_inactive_widgets', - 'class' => 'inactive-sidebar', - 'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ), - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', - ) -); - -retrieve_widgets(); - -// We're saving a widget without JS. -if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) { - $widget_id = $_POST['widget-id']; - check_admin_referer( "save-delete-widget-$widget_id" ); - - $number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : ''; - if ( $number ) { - foreach ( $_POST as $key => $val ) { - if ( is_array( $val ) && preg_match( '/__i__|%i%/', key( $val ) ) ) { - $_POST[ $key ] = array( $number => array_shift( $val ) ); - break; - } - } - } - - $sidebar_id = $_POST['sidebar']; - $position = isset( $_POST[ $sidebar_id . '_position' ] ) ? (int) $_POST[ $sidebar_id . '_position' ] - 1 : 0; - - $id_base = $_POST['id_base']; - $sidebar = isset( $sidebars_widgets[ $sidebar_id ] ) ? $sidebars_widgets[ $sidebar_id ] : array(); - - // Delete. - if ( isset( $_POST['removewidget'] ) && $_POST['removewidget'] ) { - - if ( ! in_array( $widget_id, $sidebar, true ) ) { - wp_redirect( admin_url( 'widgets.php?error=0' ) ); - exit; - } - - $sidebar = array_diff( $sidebar, array( $widget_id ) ); - $_POST = array( - 'sidebar' => $sidebar_id, - 'widget-' . $id_base => array(), - 'the-widget-id' => $widget_id, - 'delete_widget' => '1', - ); - - /** - * Fires immediately after a widget has been marked for deletion. - * - * @since 4.4.0 - * - * @param string $widget_id ID of the widget marked for deletion. - * @param string $sidebar_id ID of the sidebar the widget was deleted from. - * @param string $id_base ID base for the widget. - */ - do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base ); - } - - $_POST['widget-id'] = $sidebar; - - foreach ( (array) $wp_registered_widget_updates as $name => $control ) { - if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) { - continue; - } - - ob_start(); - call_user_func_array( $control['callback'], $control['params'] ); - ob_end_clean(); - - break; - } - - $sidebars_widgets[ $sidebar_id ] = $sidebar; - - // Remove old position. - if ( ! isset( $_POST['delete_widget'] ) ) { - foreach ( $sidebars_widgets as $key => $sb ) { - if ( is_array( $sb ) ) { - $sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) ); - } - } - array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id ); - } - - wp_set_sidebars_widgets( $sidebars_widgets ); - wp_redirect( admin_url( 'widgets.php?message=0' ) ); - exit; -} - -// Remove inactive widgets without JS. -if ( isset( $_POST['removeinactivewidgets'] ) ) { - check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); - - if ( $_POST['removeinactivewidgets'] ) { - foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) { - $pieces = explode( '-', $widget_id ); - $multi_number = array_pop( $pieces ); - $id_base = implode( '-', $pieces ); - $widget = get_option( 'widget_' . $id_base ); - unset( $widget[ $multi_number ] ); - update_option( 'widget_' . $id_base, $widget ); - unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] ); - } - - wp_set_sidebars_widgets( $sidebars_widgets ); - } - - wp_redirect( admin_url( 'widgets.php?message=0' ) ); - exit; -} - -// Output the widget form without JS. -if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) { - $widget_id = $_GET['editwidget']; - - if ( isset( $_GET['addnew'] ) ) { - // Default to the first sidebar. - $keys = array_keys( $wp_registered_sidebars ); - $sidebar = reset( $keys ); - - if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // Multi-widget. - // Copy minimal info from an existing instance of this widget to a new instance. - foreach ( $wp_registered_widget_controls as $control ) { - if ( $_GET['base'] === $control['id_base'] ) { - $control_callback = $control['callback']; - $multi_number = (int) $_GET['num']; - $control['params'][0]['number'] = -1; - $control['id'] = $control['id_base'] . '-' . $multi_number; - $widget_id = $control['id']; - $wp_registered_widget_controls[ $control['id'] ] = $control; - break; - } - } - } - } - - if ( isset( $wp_registered_widget_controls[ $widget_id ] ) && ! isset( $control ) ) { - $control = $wp_registered_widget_controls[ $widget_id ]; - $control_callback = $control['callback']; - } elseif ( ! isset( $wp_registered_widget_controls[ $widget_id ] ) && isset( $wp_registered_widgets[ $widget_id ] ) ) { - $name = esc_html( strip_tags( $wp_registered_widgets[ $widget_id ]['name'] ) ); - } - - if ( ! isset( $name ) ) { - $name = esc_html( strip_tags( $control['name'] ) ); - } - - if ( ! isset( $sidebar ) ) { - $sidebar = isset( $_GET['sidebar'] ) ? $_GET['sidebar'] : 'wp_inactive_widgets'; - } - - if ( ! isset( $multi_number ) ) { - $multi_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : ''; - } - - $id_base = isset( $control['id_base'] ) ? $control['id_base'] : $control['id']; - - // Show the widget form. - $width = ' style="width:' . max( $control['width'], 350 ) . 'px"'; - $key = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0; - - require_once ABSPATH . 'wp-admin/admin-header.php'; ?> -
-

-
> -

- -

- -
-
- ' . __( 'There are no options for this widget.' ) . "

\n"; - } - ?> -
- -

-
- - $sbvalue ) { - echo "\t\t\n"; - } - ?> -
"; - if ( 'wp_inactive_widgets' === $sbname || 'orphaned_widgets' === substr( $sbname, 0, 16 ) ) { - echo ' '; - } else { - if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) { - $j = 1; - $sidebars_widgets[ $sbname ] = array(); - } else { - $j = count( $sidebars_widgets[ $sbname ] ); - if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) { - $j++; - } - } - $selected = ''; - echo "\t\t\n"; - } - echo "
-
- -
-
- - - - | - - - - -
-
- - - - - -
-
-
- -
-
-
- - -
-

- -

- -%2$s', - esc_url( - add_query_arg( - array( - array( 'autofocus' => array( 'panel' => 'widgets' ) ), - 'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), - ), - admin_url( 'customize.php' ) - ) - ), - __( 'Manage with Live Preview' ) - ); -} - -$nonce = wp_create_nonce( 'widgets-access' ); -?> - - -
- - -

- - -

- - - - -
-
-
- -
- -
- -
-
-
-
-
- - $registered_sidebar ) { - if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) { - $wrap_class = 'widgets-holder-wrap'; - if ( ! empty( $registered_sidebar['class'] ) ) { - $wrap_class .= ' ' . $registered_sidebar['class']; - } - - $is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id']; - ?> -
-
- - - -
-
-

- 'inactive-widgets-control-remove' ); - - if ( empty( $sidebars_widgets['wp_inactive_widgets'] ) ) { - $attributes['disabled'] = ''; - } - - submit_button( __( 'Clear Inactive Widgets' ), 'delete', 'removeinactivewidgets', false, $attributes ); - ?> - -

- -
-
- -
- -

- -
- -
-
- 1 ) { - $split = (int) ceil( $sidebars_count / 2 ); +if ( wp_use_widgets_block_editor() ) { + require ABSPATH . 'wp-admin/widgets-form-blocks.php'; } else { - $single_sidebar_class = ' single-sidebar'; + require ABSPATH . 'wp-admin/widgets-form.php'; } - -?> -
-
- -
-
-
- -
-
-
- -
- -
- - -
-
- - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '3243bf46da298d46850bacd71bcc111e'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4556c7bbdf2d9d6a81c1ca770cf73893'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '293ce6ecd6439249249485d369385617'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'bed28c77ea305cd8e02b0529011189f9'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8855b04f6a52a7bca89f8d945d46866'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'b471a46218b45512872b205f5684f390'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => 'a812200273a231e6d260752aac4f2947'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '2601f7a7e52d8f54bf93cdb9945634c5'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'cc8e5d0e23cf68bb9944bf2a7a016e52'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'dbaa28491a5400f286411e645eda7fe9'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'a128962c30c40d721c962a0a170f9040'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'c6d0b8dc5425477346847d4ad0688185'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '7e9c84364a96530d0702ecf7e6247aa8'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '9f1a3d6ac652e9da7ef51f01de8243a0'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'ceef9ce8c9c058d69ebf44db39353687'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '2abad43cdd2da929e01f7d7648e392ab'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '13724e4923d40e224e7c99fdc350a6a1'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd964a25eeb2e148dbb51da5fad4cc9fe'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1e1b9c1535c1c32d3236d41aa27c7bf9'), 'edit-post.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '96479639a321f93a46a968730f904911'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '0fdbd123c5f1dff84770a0e41ed87984'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '669f5c11ca4fe7c44d64157347343913'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4f03d9c45a01df8191f6833373fe1cfa'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'eb83de0befbc72e594aab5d708ca128e'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f7ecf196f38940ae0673c46c6c30cd86'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '140ecb91be91e7eec34220584d085033'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'd897c43bea0c2753dd7368eb2d990898'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '798b660598677b39413fdb5f68624aa8'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '8a860f4afab68874dffb1e7eec6c1bc1'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'cf38e80b47baf72f4822ddb8847f4f24'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '80af68069161321e8e131bad6a00d5dc'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df373dcd13d7abc3f8b042f369b88557'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'b08e53c1e070954fa0884cad9a164683'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '0575a03bf7a434453e3768c23cd45a54'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'f976fd36733989ed2c1409c712cd0e02'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dc0962ac2885a26f8c2abdbe0cf0e333'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18c93919f04bb681234310b314675b17'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c50c6bd1563bc7fb88433198400a74c'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'ec5d97a08f4ba305bcc6f0de27fda10f'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => '17198c4dd83a20f1f820c6cf500bd5f1'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '7c732c1add9f9667bdf8dd66fbf74759'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '15757929bc8d52a3b184c3fcaeb38c64'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7bcd3684420783ef1f6ebb7680fe958e'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e9868cffba8a348b31011f87dd53b3c4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '0a54bbdc44c5f135018c568a887b8279'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '02339c8ad03da1e7a03f9212da004007')); \ No newline at end of file + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '3243bf46da298d46850bacd71bcc111e'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4556c7bbdf2d9d6a81c1ca770cf73893'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '293ce6ecd6439249249485d369385617'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'bed28c77ea305cd8e02b0529011189f9'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8855b04f6a52a7bca89f8d945d46866'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'b471a46218b45512872b205f5684f390'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => '927dc1a8606097f0469f0c17289e43b5'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'e7b7530300d138c846fa48ebce04182c'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'cc8e5d0e23cf68bb9944bf2a7a016e52'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'dbaa28491a5400f286411e645eda7fe9'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'a128962c30c40d721c962a0a170f9040'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'c6d0b8dc5425477346847d4ad0688185'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '7e9c84364a96530d0702ecf7e6247aa8'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-primitives', 'wp-widgets'), 'version' => 'ef58a9c27a99310c423ffb7fe74b9617'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '9f1a3d6ac652e9da7ef51f01de8243a0'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'ceef9ce8c9c058d69ebf44db39353687'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '2abad43cdd2da929e01f7d7648e392ab'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '13724e4923d40e224e7c99fdc350a6a1'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd964a25eeb2e148dbb51da5fad4cc9fe'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1e1b9c1535c1c32d3236d41aa27c7bf9'), 'edit-post.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '96479639a321f93a46a968730f904911'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'e573e5743f31c14c6550cbf475612924'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '0fdbd123c5f1dff84770a0e41ed87984'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '669f5c11ca4fe7c44d64157347343913'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4f03d9c45a01df8191f6833373fe1cfa'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'eb83de0befbc72e594aab5d708ca128e'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f7ecf196f38940ae0673c46c6c30cd86'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '140ecb91be91e7eec34220584d085033'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'd897c43bea0c2753dd7368eb2d990898'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '798b660598677b39413fdb5f68624aa8'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '8a860f4afab68874dffb1e7eec6c1bc1'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'cf38e80b47baf72f4822ddb8847f4f24'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '80af68069161321e8e131bad6a00d5dc'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df373dcd13d7abc3f8b042f369b88557'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'b08e53c1e070954fa0884cad9a164683'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '0575a03bf7a434453e3768c23cd45a54'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'f976fd36733989ed2c1409c712cd0e02'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dc0962ac2885a26f8c2abdbe0cf0e333'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18c93919f04bb681234310b314675b17'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c50c6bd1563bc7fb88433198400a74c'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'ec5d97a08f4ba305bcc6f0de27fda10f'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => '17198c4dd83a20f1f820c6cf500bd5f1'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '7c732c1add9f9667bdf8dd66fbf74759'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '15757929bc8d52a3b184c3fcaeb38c64'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '7bcd3684420783ef1f6ebb7680fe958e'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'e9868cffba8a348b31011f87dd53b3c4'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '0a54bbdc44c5f135018c568a887b8279'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '202ac16e99afe7c33c257b248625a947'), 'widgets.js' => array('dependencies' => array('wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '71f70729a158b4f607a172e7f488545b'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '02339c8ad03da1e7a03f9212da004007')); \ No newline at end of file diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php index 8a110ccbda..0fb57a280d 100644 --- a/src/wp-includes/block-editor.php +++ b/src/wp-includes/block-editor.php @@ -225,6 +225,40 @@ function get_default_block_editor_settings() { $editor_settings['gradients'] = $gradient_presets; } + /** + * Filters the list of widget-type IDs that should **not** be offered by the + * Legacy Widget block. + * + * Returning an empty array will make all widgets available. + * + * @since 5.8.0 + * + * @param array $widgets An array of excluded widget-type IDs. + */ + $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters( + 'widget_types_to_hide_from_legacy_widget_block', + array( + 'pages', + 'calendar', + 'archives', + 'media_audio', + 'media_image', + 'media_gallery', + 'media_video', + 'meta', + 'search', + 'text', + 'categories', + 'recent-posts', + 'recent-comments', + 'rss', + 'tag_cloud', + 'nav_menu', + 'custom_html', + 'block', + ) + ); + return $editor_settings; } diff --git a/src/wp-includes/blocks/index.php b/src/wp-includes/blocks/index.php index 22d0a63559..2d8fddab98 100644 --- a/src/wp-includes/blocks/index.php +++ b/src/wp-includes/blocks/index.php @@ -13,6 +13,7 @@ require ABSPATH . WPINC . '/blocks/categories.php'; require ABSPATH . WPINC . '/blocks/file.php'; require ABSPATH . WPINC . '/blocks/latest-comments.php'; require ABSPATH . WPINC . '/blocks/latest-posts.php'; +require ABSPATH . WPINC . '/blocks/legacy-widget.php'; require ABSPATH . WPINC . '/blocks/loginout.php'; require ABSPATH . WPINC . '/blocks/post-content.php'; require ABSPATH . WPINC . '/blocks/post-date.php'; diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index 25964fb7bc..04db0d4e4c 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -795,3 +795,8 @@ require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add- * WP_Customize_Date_Time_Control class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php'; + +/** + * WP_Sidebar_Block_Editor_Control class. + */ +require_once ABSPATH . WPINC . '/customize/class-wp-sidebar-block-editor-control.php'; diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index ed9bbe3dfd..b2ab25601d 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -118,6 +118,7 @@ final class WP_Customize_Widgets { add_action( 'customize_controls_print_footer_scripts', array( $this, 'output_widget_control_templates' ) ); add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); add_filter( 'customize_refresh_nonces', array( $this, 'refresh_nonces' ) ); + add_filter( 'should_load_block_editor_scripts_and_styles', array( $this, 'should_load_block_editor_scripts_and_styles' ) ); add_action( 'dynamic_sidebar', array( $this, 'tally_rendered_widgets' ) ); add_filter( 'is_active_sidebar', array( $this, 'tally_sidebars_via_is_active_sidebar_calls' ), 10, 2 ); @@ -368,6 +369,8 @@ final class WP_Customize_Widgets { public function customize_register() { global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars; + $use_widgets_block_editor = wp_use_widgets_block_editor(); + add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 ); $sidebars_widgets = array_merge( @@ -446,13 +449,18 @@ final class WP_Customize_Widgets { if ( $is_active_sidebar ) { $section_args = array( - 'title' => $wp_registered_sidebars[ $sidebar_id ]['name'], - 'description' => $wp_registered_sidebars[ $sidebar_id ]['description'], - 'priority' => array_search( $sidebar_id, array_keys( $wp_registered_sidebars ), true ), - 'panel' => 'widgets', - 'sidebar_id' => $sidebar_id, + 'title' => $wp_registered_sidebars[ $sidebar_id ]['name'], + 'priority' => array_search( $sidebar_id, array_keys( $wp_registered_sidebars ), true ), + 'panel' => 'widgets', + 'sidebar_id' => $sidebar_id, ); + if ( $use_widgets_block_editor ) { + $section_args['description'] = ''; + } else { + $section_args['description'] = $wp_registered_sidebars[ $sidebar_id ]['description']; + } + /** * Filters Customizer widget section arguments for a given sidebar. * @@ -467,49 +475,63 @@ final class WP_Customize_Widgets { $section = new WP_Customize_Sidebar_Section( $this->manager, $section_id, $section_args ); $this->manager->add_section( $section ); - $control = new WP_Widget_Area_Customize_Control( - $this->manager, - $setting_id, - array( - 'section' => $section_id, - 'sidebar_id' => $sidebar_id, - 'priority' => count( $sidebar_widget_ids ), // place 'Add Widget' and 'Reorder' buttons at end. - ) - ); - $new_setting_ids[] = $setting_id; + if ( $use_widgets_block_editor ) { + $control = new WP_Sidebar_Block_Editor_Control( + $this->manager, + $setting_id, + array( + 'section' => $section_id, + 'sidebar_id' => $sidebar_id, + ) + ); + } else { + $control = new WP_Widget_Area_Customize_Control( + $this->manager, + $setting_id, + array( + 'section' => $section_id, + 'sidebar_id' => $sidebar_id, + 'priority' => count( $sidebar_widget_ids ), // place 'Add Widget' and 'Reorder' buttons at end. + ) + ); + } $this->manager->add_control( $control ); + + $new_setting_ids[] = $setting_id; } } - // Add a control for each active widget (located in a sidebar). - foreach ( $sidebar_widget_ids as $i => $widget_id ) { + if ( ! $use_widgets_block_editor ) { + // Add a control for each active widget (located in a sidebar). + foreach ( $sidebar_widget_ids as $i => $widget_id ) { - // Skip widgets that may have gone away due to a plugin being deactivated. - if ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[ $widget_id ] ) ) { - continue; + // Skip widgets that may have gone away due to a plugin being deactivated. + if ( ! $is_active_sidebar || ! isset( $wp_registered_widgets[ $widget_id ] ) ) { + continue; + } + + $registered_widget = $wp_registered_widgets[ $widget_id ]; + $setting_id = $this->get_setting_id( $widget_id ); + $id_base = $wp_registered_widget_controls[ $widget_id ]['id_base']; + + $control = new WP_Widget_Form_Customize_Control( + $this->manager, + $setting_id, + array( + 'label' => $registered_widget['name'], + 'section' => $section_id, + 'sidebar_id' => $sidebar_id, + 'widget_id' => $widget_id, + 'widget_id_base' => $id_base, + 'priority' => $i, + 'width' => $wp_registered_widget_controls[ $widget_id ]['width'], + 'height' => $wp_registered_widget_controls[ $widget_id ]['height'], + 'is_wide' => $this->is_wide_widget( $widget_id ), + ) + ); + $this->manager->add_control( $control ); } - - $registered_widget = $wp_registered_widgets[ $widget_id ]; - $setting_id = $this->get_setting_id( $widget_id ); - $id_base = $wp_registered_widget_controls[ $widget_id ]['id_base']; - - $control = new WP_Widget_Form_Customize_Control( - $this->manager, - $setting_id, - array( - 'label' => $registered_widget['name'], - 'section' => $section_id, - 'sidebar_id' => $sidebar_id, - 'widget_id' => $widget_id, - 'widget_id_base' => $id_base, - 'priority' => $i, - 'width' => $wp_registered_widget_controls[ $widget_id ]['width'], - 'height' => $wp_registered_widget_controls[ $widget_id ]['height'], - 'is_wide' => $this->is_wide_widget( $widget_id ), - ) - ); - $this->manager->add_control( $control ); } } @@ -805,6 +827,46 @@ final class WP_Customize_Widgets { 'data', sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) ) ); + + // TODO: Update 'wp-customize-widgets' to not rely so much on things in + // 'customize-widgets'. This will let us skip most of the above and not + // enqueue 'customize-widgets' which saves bytes. + + if ( wp_use_widgets_block_editor() ) { + $block_editor_context = new WP_Block_Editor_Context(); + + $editor_settings = get_block_editor_settings( array(), $block_editor_context ); + + wp_add_inline_script( + 'wp-customize-widgets', + sprintf( + 'wp.domReady( function() { + wp.customizeWidgets.initialize( "widgets-customizer", %s ); + } );', + wp_json_encode( $editor_settings ) + ) + ); + + // Preload server-registered block schemas. + wp_add_inline_script( + 'wp-blocks', + 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' + ); + + wp_add_inline_script( + 'wp-blocks', + sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( 'widgets-customizer' ) ) ), + 'after' + ); + + wp_enqueue_script( 'wp-customize-widgets' ); + wp_enqueue_style( 'wp-customize-widgets' ); + wp_enqueue_script( 'wp-format-library' ); + wp_enqueue_style( 'wp-format-library' ); + + /** This action is documented in edit-form-blocks.php */ + do_action( 'enqueue_block_editor_assets' ); + } } /** @@ -888,8 +950,13 @@ final class WP_Customize_Widgets { $args['sanitize_js_callback'] = array( $this, 'sanitize_sidebar_widgets_js_instance' ); $args['transport'] = current_theme_supports( 'customize-selective-refresh-widgets' ) ? 'postMessage' : 'refresh'; } elseif ( preg_match( $this->setting_id_patterns['widget_instance'], $id, $matches ) ) { - $args['sanitize_callback'] = array( $this, 'sanitize_widget_instance' ); - $args['sanitize_js_callback'] = array( $this, 'sanitize_widget_js_instance' ); + $id_base = $matches['id_base']; + $args['sanitize_callback'] = function( $value ) use ( $id_base ) { + return $this->sanitize_widget_instance( $value, $id_base ); + }; + $args['sanitize_js_callback'] = function( $value ) use ( $id_base ) { + return $this->sanitize_widget_js_instance( $value, $id_base ); + }; $args['transport'] = $this->is_widget_selective_refreshable( $matches['id_base'] ) ? 'postMessage' : 'refresh'; } @@ -1108,6 +1175,23 @@ final class WP_Customize_Widgets { return $nonces; } + /** + * Tells the script loader to load the scripts and styles of custom blocks + * if the widgets block editor is enabled. + * + * @since 5.8.0 + * + * @param bool $is_block_editor_screen Current decision about loading block assets. + * @return bool Filtered decision about loading block assets. + */ + public function should_load_block_editor_scripts_and_styles( $is_block_editor_screen ) { + if ( wp_use_widgets_block_editor() ) { + return true; + } + + return $is_block_editor_screen; + } + /** * When previewing, ensures the proper previewing widgets are used. * @@ -1314,16 +1398,28 @@ final class WP_Customize_Widgets { * @since 3.9.0 * * @param array $value Widget instance to sanitize. + * @param string $id_base Base of the ID of the widget being sanitized. * @return array|void Sanitized widget instance. */ - public function sanitize_widget_instance( $value ) { + public function sanitize_widget_instance( $value, $id_base = null ) { + global $wp_widget_factory; + if ( array() === $value ) { - return $value; + return; } - if ( empty( $value['is_widget_customizer_js_value'] ) - || empty( $value['instance_hash_key'] ) - || empty( $value['encoded_serialized_instance'] ) ) { + if ( isset( $value['raw_instance'] ) && $id_base && wp_use_widgets_block_editor() ) { + $widget_object = $wp_widget_factory->get_widget_object( $id_base ); + if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) { + return $value['raw_instance']; + } + } + + if ( + empty( $value['is_widget_customizer_js_value'] ) || + empty( $value['instance_hash_key'] ) || + empty( $value['encoded_serialized_instance'] ) + ) { return; } @@ -1350,19 +1446,32 @@ final class WP_Customize_Widgets { * @since 3.9.0 * * @param array $value Widget instance to convert to JSON. + * @param string $id_base Base of the ID of the widget being sanitized. * @return array JSON-converted widget instance. */ - public function sanitize_widget_js_instance( $value ) { + public function sanitize_widget_js_instance( $value, $id_base = null ) { + global $wp_widget_factory; + if ( empty( $value['is_widget_customizer_js_value'] ) ) { $serialized = serialize( $value ); - $value = array( + $js_value = array( 'encoded_serialized_instance' => base64_encode( $serialized ), 'title' => empty( $value['title'] ) ? '' : $value['title'], 'is_widget_customizer_js_value' => true, 'instance_hash_key' => $this->get_instance_hash_key( $serialized ), ); + + if ( $id_base && wp_use_widgets_block_editor() ) { + $widget_object = $wp_widget_factory->get_widget_object( $id_base ); + if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) { + $js_value['raw_instance'] = (object) $value; + } + } + + return $js_value; } + return $value; } @@ -1432,7 +1541,7 @@ final class WP_Customize_Widgets { return new WP_Error( 'widget_setting_malformed' ); } - $instance = $this->sanitize_widget_instance( $sanitized_widget_setting ); + $instance = $this->sanitize_widget_instance( $sanitized_widget_setting, $parsed_id['id_base'] ); if ( is_null( $instance ) ) { $this->stop_capturing_option_updates(); return new WP_Error( 'widget_setting_unsanitized' ); @@ -1498,7 +1607,7 @@ final class WP_Customize_Widgets { * in place from WP_Customize_Setting::preview() will use this value * instead of the default widget instance value (an empty array). */ - $this->manager->set_post_value( $setting_id, $this->sanitize_widget_js_instance( $instance ) ); + $this->manager->set_post_value( $setting_id, $this->sanitize_widget_js_instance( $instance, $parsed_id['id_base'] ) ); // Obtain the widget control with the updated instance in place. ob_start(); @@ -1571,7 +1680,7 @@ final class WP_Customize_Widgets { } $form = $updated_widget['form']; - $instance = $this->sanitize_widget_js_instance( $updated_widget['instance'] ); + $instance = $this->sanitize_widget_js_instance( $updated_widget['instance'], $id_base ); wp_send_json_success( compact( 'form', 'instance' ) ); } diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 0f28ef4030..f82f08d29e 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1552,6 +1552,20 @@ function wp_default_styles( $styles ) { 'list-reusable-blocks' => array( 'wp-components' ), 'reusable-blocks' => array( 'wp-components' ), 'nux' => array( 'wp-components' ), + 'edit-widgets' => array( + 'wp-components', + 'wp-block-editor', + 'wp-edit-blocks', + 'wp-block-library', + 'wp-reusable-blocks', + ), + 'customize-widgets' => array( + 'wp-components', + 'wp-block-editor', + 'wp-edit-blocks', + 'wp-block-library', + 'wp-reusable-blocks', + ), ); foreach ( $package_styles as $package => $dependencies ) { diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php index 5736467301..ba6aea7a6b 100644 --- a/src/wp-includes/widgets.php +++ b/src/wp-includes/widgets.php @@ -1801,6 +1801,8 @@ function wp_widgets_init() { register_widget( 'WP_Widget_Block' ); + add_theme_support( 'widgets-block-editor' ); + /** * Fires after all default WordPress widgets have been registered. * @@ -1809,6 +1811,27 @@ function wp_widgets_init() { do_action( 'widgets_init' ); } +/** + * Whether or not to use the block editor to manage widgets. Defaults to true + * unless a theme has removed support for widgets-block-editor or a plugin has + * filtered the return value of this function. + * + * @since 5.8.0 + * + * @return boolean Whether or not to use the block editor to manage widgets. + */ +function wp_use_widgets_block_editor() { + /** + * Filters whether or not to use the block editor to manage widgets. + * + * @param boolean $use_widgets_block_editor Whether or not to use the block editor to manage widgets. + */ + return apply_filters( + 'use_widgets_block_editor', + get_theme_support( 'widgets-block-editor' ) + ); +} + /** * Converts a widget ID into its id_base and number components. * @@ -1971,3 +1994,16 @@ function wp_render_widget_control( $id ) { return ob_get_clean(); } + +// Needed until src/blocks/legacy-widget/index.php in @wordpress/block-library +// is updated to use the 'wp_' functions. +function gutenberg_find_widgets_sidebar( $widget_id ) { + return wp_find_widgets_sidebar( $widget_id ); +} +function gutenberg_render_widget( $widget_id, $sidebar_id ) { + return wp_render_widget( $widget_id, $sidebar_id ); +} +function gutenberg_get_widget_object( $id_base ) { + global $wp_widget_factory; + return $wp_widget_factory->get_widget_object( $id_base ); +} diff --git a/tests/phpunit/includes/functions.php b/tests/phpunit/includes/functions.php index 7e409d5fce..b8274c0a11 100644 --- a/tests/phpunit/includes/functions.php +++ b/tests/phpunit/includes/functions.php @@ -310,6 +310,7 @@ function _unhook_block_registration() { remove_action( 'init', 'register_block_core_loginout' ); remove_action( 'init', 'register_block_core_latest_comments' ); remove_action( 'init', 'register_block_core_latest_posts' ); + remove_action( 'init', 'register_block_core_legacy_widget', 20 ); remove_action( 'init', 'register_block_core_post_author' ); remove_action( 'init', 'register_block_core_post_content' ); remove_action( 'init', 'register_block_core_post_date' ); diff --git a/tests/phpunit/tests/blocks/block-editor.php b/tests/phpunit/tests/blocks/block-editor.php index b11ac707c8..896a1ae36f 100644 --- a/tests/phpunit/tests/blocks/block-editor.php +++ b/tests/phpunit/tests/blocks/block-editor.php @@ -159,7 +159,7 @@ class WP_Test_Block_Editor extends WP_UnitTestCase { function test_get_default_block_editor_settings() { $settings = get_default_block_editor_settings(); - $this->assertCount( 16, $settings ); + $this->assertCount( 17, $settings ); $this->assertFalse( $settings['alignWide'] ); $this->assertInternalType( 'array', $settings['allowedMimeTypes'] ); $this->assertTrue( $settings['allowedBlockTypes'] ); @@ -254,6 +254,29 @@ class WP_Test_Block_Editor extends WP_UnitTestCase { $settings['imageSizes'] ); $this->assertInternalType( 'int', $settings['maxUploadFileSize'] ); + $this->assertSameSets( + array( + 'archives', + 'block', + 'calendar', + 'categories', + 'custom_html', + 'media_audio', + 'media_gallery', + 'media_image', + 'media_video', + 'meta', + 'nav_menu', + 'pages', + 'recent-comments', + 'recent-posts', + 'rss', + 'search', + 'tag_cloud', + 'text', + ), + $settings['widgetTypesToHideFromLegacyWidgetBlock'] + ); } /** diff --git a/tests/phpunit/tests/customize/widgets.php b/tests/phpunit/tests/customize/widgets.php index 46ab3f81b5..19bf9772be 100644 --- a/tests/phpunit/tests/customize/widgets.php +++ b/tests/phpunit/tests/customize/widgets.php @@ -25,6 +25,7 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase { require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; add_theme_support( 'customize-selective-refresh-widgets' ); + add_action( 'widgets_init', array( $this, 'remove_widgets_block_editor' ) ); $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); wp_set_current_user( $user_id ); $GLOBALS['wp_customize'] = new WP_Customize_Manager(); @@ -85,6 +86,10 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase { do_action( 'wp', $GLOBALS['wp'] ); } + function remove_widgets_block_editor() { + remove_theme_support( 'widgets-block-editor' ); + } + /** * Test WP_Customize_Widgets::__construct() */ @@ -258,31 +263,31 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase { add_filter( 'widget_customizer_setting_args', array( $this, 'filter_widget_customizer_setting_args' ), 10, 2 ); $default_args = array( - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'refresh', - 'default' => array(), - 'sanitize_callback' => array( $this->manager->widgets, 'sanitize_widget_instance' ), - 'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_widget_js_instance' ), + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'transport' => 'refresh', + 'default' => array(), ); $args = $this->manager->widgets->get_setting_args( 'widget_foo[2]' ); foreach ( $default_args as $key => $default_value ) { $this->assertSame( $default_value, $args[ $key ] ); } + $this->assertTrue( is_callable( $args['sanitize_callback'] ), 'sanitize_callback is callable' ); + $this->asserttrue( is_callable( $args['sanitize_js_callback'] ), 'sanitize_js_callback is callable' ); $this->assertSame( 'WIDGET_FOO[2]', $args['uppercase_id_set_by_filter'] ); $default_args = array( - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'default' => array(), - 'sanitize_callback' => array( $this->manager->widgets, 'sanitize_widget_instance' ), - 'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_widget_js_instance' ), + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'transport' => 'postMessage', + 'default' => array(), ); $args = $this->manager->widgets->get_setting_args( 'widget_search[2]' ); foreach ( $default_args as $key => $default_value ) { $this->assertSame( $default_value, $args[ $key ] ); } + $this->assertTrue( is_callable( $args['sanitize_callback'] ), 'sanitize_callback is callable' ); + $this->asserttrue( is_callable( $args['sanitize_js_callback'] ), 'sanitize_js_callback is callable' ); remove_theme_support( 'customize-selective-refresh-widgets' ); $args = $this->manager->widgets->get_setting_args( 'widget_search[2]' ); @@ -304,17 +309,17 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase { $this->assertSame( 'WIDGET_BAR[3]', $args['uppercase_id_set_by_filter'] ); $default_args = array( - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'default' => array(), - 'sanitize_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets' ), - 'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets_js_instance' ), + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'transport' => 'postMessage', + 'default' => array(), ); $args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-1]' ); foreach ( $default_args as $key => $default_value ) { $this->assertSame( $default_value, $args[ $key ] ); } + $this->assertTrue( is_callable( $args['sanitize_callback'] ), 'sanitize_callback is callable' ); + $this->asserttrue( is_callable( $args['sanitize_js_callback'] ), 'sanitize_js_callback is callable' ); $this->assertSame( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] ); $override_args = array( diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index a7a78e997a..a2deeaf577 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -112,6 +112,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil 'file', 'latest-comments', 'latest-posts', + 'legacy-widget', 'loginout', 'post-content', 'post-date',