mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-20 19:56:49 +01:00
Editor: Update block editor packages to the latest patch releases.
This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.2.1 RC1. Updated packages: - @wordpress/annotations@2.26.4 - @wordpress/block-directory@4.3.12 - @wordpress/block-editor@11.3.10 - @wordpress/block-library@8.3.12 - @wordpress/components@23.3.7 - @wordpress/customize-widgets@4.3.12 - @wordpress/edit-post@7.3.12 - @wordpress/edit-site@5.3.12 - @wordpress/edit-widgets@5.3.12 - @wordpress/editor@13.3.10 - @wordpress/format-library@4.3.10 - @wordpress/interface@5.3.8 - @wordpress/list-reusable-blocks@4.3.7 - @wordpress/preferences@3.3.7 - @wordpress/reusable-blocks@4.3.10 - @wordpress/rich-text@6.3.4 - @wordpress/server-side-render@4.3.7 - @wordpress/widgets@3.3.10 This changeset includes the following fixes: - i18n: Add context to labels related to CSS position properties gutenberg#49135 - Comments: Fix 'sprintf requires more than 1 params' error gutenberg#49054 - Fix the site editor loading in multi-site installs gutenberg#49861 - Fix quick inserter going off-screen in some situations gutenberg#49881 - Site Editor: Decode the site title properly gutenberg#49685 - Firefox: fix input rules (React async state issue) gutenberg#48210 - Only show alignment info when parent layout is constrained. gutenberg#49703 - [Inserter]: Fix onHover error on patterns tab in mobile gutenberg#49450 - Fix site editor redirection after creating new template or template part gutenberg#49364 Props mamaduka, audrasjb, wildworks, ocean90, aristath, costdev, hellofromtonya, youknowriad, mdxfr, oandregal, mattwiebe, bph, ndiego, talldanwp, joen, ellatrix, kevin940726, isabel_brison, andrewserong, ntsekouras, welcher. Fixes #58274. Built from https://develop.svn.wordpress.org/trunk@55737 git-svn-id: http://core.svn.wordpress.org/trunk@55249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e0592d8f4
commit
4935678150
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -58,11 +58,10 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|||
$block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
|
||||
--$comment_depth;
|
||||
} else {
|
||||
$inner_content = block_core_comment_template_render_comments(
|
||||
$block_content .= block_core_comment_template_render_comments(
|
||||
$children,
|
||||
$block
|
||||
);
|
||||
$block_content .= sprintf( $inner_content );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
38
wp-includes/js/dist/block-editor.js
vendored
38
wp-includes/js/dist/block-editor.js
vendored
File diff suppressed because one or more lines are too long
4
wp-includes/js/dist/block-editor.min.js
vendored
4
wp-includes/js/dist/block-editor.min.js
vendored
File diff suppressed because one or more lines are too long
1062
wp-includes/js/dist/components.js
vendored
1062
wp-includes/js/dist/components.js
vendored
File diff suppressed because one or more lines are too long
4
wp-includes/js/dist/components.min.js
vendored
4
wp-includes/js/dist/components.min.js
vendored
File diff suppressed because one or more lines are too long
33
wp-includes/js/dist/edit-site.js
vendored
33
wp-includes/js/dist/edit-site.js
vendored
|
|
@ -6986,8 +6986,7 @@ function NewTemplate(_ref) {
|
|||
createSuccessNotice
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
|
||||
const {
|
||||
setTemplate,
|
||||
setCanvasMode
|
||||
setTemplate
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
|
||||
async function createTemplate(template) {
|
||||
|
|
@ -7032,13 +7031,12 @@ function NewTemplate(_ref) {
|
|||
throwOnError: true
|
||||
}); // Set template before navigating away to avoid initial stale value.
|
||||
|
||||
setTemplate(newTemplate.id, newTemplate.slug); // Switch to edit mode.
|
||||
|
||||
setCanvasMode('edit'); // Navigate to the created template editor.
|
||||
setTemplate(newTemplate.id, newTemplate.slug); // Navigate to the created template editor.
|
||||
|
||||
history.push({
|
||||
postId: newTemplate.id,
|
||||
postType: newTemplate.type
|
||||
postType: newTemplate.type,
|
||||
canvas: 'edit'
|
||||
});
|
||||
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created template e.g: "Category".
|
||||
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), title), {
|
||||
|
|
@ -7346,8 +7344,6 @@ const getCleanTemplatePartSlug = title => {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
function NewTemplatePart(_ref) {
|
||||
let {
|
||||
postType,
|
||||
|
|
@ -7362,9 +7358,6 @@ function NewTemplatePart(_ref) {
|
|||
const {
|
||||
saveEntityRecord
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
|
||||
const {
|
||||
setCanvasMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
const existingTemplateParts = useExistingTemplateParts();
|
||||
|
||||
async function createTemplatePart(_ref2) {
|
||||
|
|
@ -7391,13 +7384,12 @@ function NewTemplatePart(_ref) {
|
|||
}, {
|
||||
throwOnError: true
|
||||
});
|
||||
setIsModalOpen(false); // Switch to edit mode.
|
||||
|
||||
setCanvasMode('edit'); // Navigate to the created template part editor.
|
||||
setIsModalOpen(false); // Navigate to the created template part editor.
|
||||
|
||||
history.push({
|
||||
postId: templatePart.id,
|
||||
postType: 'wp_template_part'
|
||||
postType: 'wp_template_part',
|
||||
canvas: 'edit'
|
||||
}); // TODO: Add a success notice?
|
||||
} catch (error) {
|
||||
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.');
|
||||
|
|
@ -17187,13 +17179,15 @@ function useInitEditedEntityFromURL() {
|
|||
url
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
getSite
|
||||
getSite,
|
||||
getUnstableBase
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
const siteData = getSite();
|
||||
const base = getUnstableBase();
|
||||
return {
|
||||
isRequestingSite: !siteData,
|
||||
isRequestingSite: !base,
|
||||
homepageId: (siteData === null || siteData === void 0 ? void 0 : siteData.show_on_front) === 'page' ? siteData.page_on_front : null,
|
||||
url: siteData === null || siteData === void 0 ? void 0 : siteData.url
|
||||
url: base === null || base === void 0 ? void 0 : base.home
|
||||
};
|
||||
}, []);
|
||||
const {
|
||||
|
|
@ -17330,6 +17324,7 @@ function SiteIcon(_ref) {
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
|
@ -17405,7 +17400,7 @@ const SiteHub = (0,external_wp_element_namespaceObject.forwardRef)((props, ref)
|
|||
className: "edit-site-layout__view-mode-toggle-icon"
|
||||
}))), showLabels && (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-site-hub__site-title"
|
||||
}, siteTitle)));
|
||||
}, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle))));
|
||||
});
|
||||
/* harmony default export */ var site_hub = (SiteHub);
|
||||
|
||||
|
|
|
|||
2
wp-includes/js/dist/edit-site.min.js
vendored
2
wp-includes/js/dist/edit-site.min.js
vendored
File diff suppressed because one or more lines are too long
127
wp-includes/js/dist/editor.js
vendored
127
wp-includes/js/dist/editor.js
vendored
|
|
@ -9117,6 +9117,16 @@ function usePostVisibilityLabel() {
|
|||
return (_visibilityOptions$vi = visibilityOptions[visibility]) === null || _visibilityOptions$vi === void 0 ? void 0 : _visibilityOptions$vi.label;
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/date-fns/node_modules/@babel/runtime/helpers/esm/typeof.js
|
||||
function _typeof(obj) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
||||
return typeof obj;
|
||||
} : function (obj) {
|
||||
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
||||
}, _typeof(obj);
|
||||
}
|
||||
;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/requiredArgs/index.js
|
||||
function requiredArgs(required, args) {
|
||||
if (args.length < required) {
|
||||
|
|
@ -9124,7 +9134,6 @@ function requiredArgs(required, args) {
|
|||
}
|
||||
}
|
||||
;// CONCATENATED MODULE: ./node_modules/date-fns/esm/toDate/index.js
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -9157,11 +9166,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|||
* const result = toDate(1392098430000)
|
||||
* //=> Tue Feb 11 2014 11:30:30
|
||||
*/
|
||||
|
||||
function toDate(argument) {
|
||||
requiredArgs(1, arguments);
|
||||
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
||||
var argStr = Object.prototype.toString.call(argument);
|
||||
|
||||
// Clone the date
|
||||
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
||||
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
||||
return new Date(argument.getTime());
|
||||
|
|
@ -9170,11 +9179,10 @@ function toDate(argument) {
|
|||
} else {
|
||||
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
|
||||
|
||||
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(new Error().stack);
|
||||
}
|
||||
|
||||
return new Date(NaN);
|
||||
}
|
||||
}
|
||||
|
|
@ -9199,7 +9207,6 @@ function toDate(argument) {
|
|||
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
||||
* //=> Mon Sep 01 2014 00:00:00
|
||||
*/
|
||||
|
||||
function startOfMonth(dirtyDate) {
|
||||
requiredArgs(1, arguments);
|
||||
var date = toDate(dirtyDate);
|
||||
|
|
@ -9228,7 +9235,6 @@ function startOfMonth(dirtyDate) {
|
|||
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
||||
* //=> Tue Sep 30 2014 23:59:59.999
|
||||
*/
|
||||
|
||||
function endOfMonth(dirtyDate) {
|
||||
requiredArgs(1, arguments);
|
||||
var date = toDate(dirtyDate);
|
||||
|
|
@ -9247,6 +9253,7 @@ function endOfMonth(dirtyDate) {
|
|||
* @default
|
||||
*/
|
||||
var daysInWeek = 7;
|
||||
|
||||
/**
|
||||
* Days in 1 year
|
||||
* One years equals 365.2425 days according to the formula:
|
||||
|
|
@ -9259,8 +9266,8 @@ var daysInWeek = 7;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var daysInYear = 365.2425;
|
||||
|
||||
/**
|
||||
* Maximum allowed time.
|
||||
*
|
||||
|
|
@ -9269,8 +9276,8 @@ var daysInYear = 365.2425;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Milliseconds in 1 minute
|
||||
*
|
||||
|
|
@ -9279,8 +9286,8 @@ var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var millisecondsInMinute = 60000;
|
||||
|
||||
/**
|
||||
* Milliseconds in 1 hour
|
||||
*
|
||||
|
|
@ -9289,8 +9296,8 @@ var millisecondsInMinute = 60000;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var millisecondsInHour = 3600000;
|
||||
|
||||
/**
|
||||
* Milliseconds in 1 second
|
||||
*
|
||||
|
|
@ -9299,8 +9306,8 @@ var millisecondsInHour = 3600000;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var millisecondsInSecond = 1000;
|
||||
|
||||
/**
|
||||
* Minimum allowed time.
|
||||
*
|
||||
|
|
@ -9309,8 +9316,8 @@ var millisecondsInSecond = 1000;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var minTime = -maxTime;
|
||||
|
||||
/**
|
||||
* Minutes in 1 hour
|
||||
*
|
||||
|
|
@ -9319,8 +9326,8 @@ var minTime = -maxTime;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var minutesInHour = 60;
|
||||
|
||||
/**
|
||||
* Months in 1 quarter
|
||||
*
|
||||
|
|
@ -9329,8 +9336,8 @@ var minutesInHour = 60;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var monthsInQuarter = 3;
|
||||
|
||||
/**
|
||||
* Months in 1 year
|
||||
*
|
||||
|
|
@ -9339,8 +9346,8 @@ var monthsInQuarter = 3;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var monthsInYear = 12;
|
||||
|
||||
/**
|
||||
* Quarters in 1 year
|
||||
*
|
||||
|
|
@ -9349,8 +9356,8 @@ var monthsInYear = 12;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var quartersInYear = 4;
|
||||
|
||||
/**
|
||||
* Seconds in 1 hour
|
||||
*
|
||||
|
|
@ -9359,8 +9366,8 @@ var quartersInYear = 4;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInHour = 3600;
|
||||
|
||||
/**
|
||||
* Seconds in 1 minute
|
||||
*
|
||||
|
|
@ -9369,8 +9376,8 @@ var secondsInHour = 3600;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInMinute = 60;
|
||||
|
||||
/**
|
||||
* Seconds in 1 day
|
||||
*
|
||||
|
|
@ -9379,8 +9386,8 @@ var secondsInMinute = 60;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInDay = secondsInHour * 24;
|
||||
|
||||
/**
|
||||
* Seconds in 1 week
|
||||
*
|
||||
|
|
@ -9389,8 +9396,8 @@ var secondsInDay = secondsInHour * 24;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInWeek = secondsInDay * 7;
|
||||
|
||||
/**
|
||||
* Seconds in 1 year
|
||||
*
|
||||
|
|
@ -9399,8 +9406,8 @@ var secondsInWeek = secondsInDay * 7;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInYear = secondsInDay * daysInYear;
|
||||
|
||||
/**
|
||||
* Seconds in 1 month
|
||||
*
|
||||
|
|
@ -9409,8 +9416,8 @@ var secondsInYear = secondsInDay * daysInYear;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInMonth = secondsInYear / 12;
|
||||
|
||||
/**
|
||||
* Seconds in 1 quarter
|
||||
*
|
||||
|
|
@ -9419,20 +9426,16 @@ var secondsInMonth = secondsInYear / 12;
|
|||
* @type {number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
var secondsInQuarter = secondsInMonth * 3;
|
||||
;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/toInteger/index.js
|
||||
function toInteger(dirtyNumber) {
|
||||
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
var number = Number(dirtyNumber);
|
||||
|
||||
if (isNaN(number)) {
|
||||
return number;
|
||||
}
|
||||
|
||||
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
||||
}
|
||||
;// CONCATENATED MODULE: ./node_modules/date-fns/esm/parseISO/index.js
|
||||
|
|
@ -9471,64 +9474,51 @@ function toInteger(dirtyNumber) {
|
|||
* const result = parseISO('+02014101', { additionalDigits: 1 })
|
||||
* //=> Fri Apr 11 2014 00:00:00
|
||||
*/
|
||||
|
||||
function parseISO(argument, options) {
|
||||
var _options$additionalDi;
|
||||
|
||||
requiredArgs(1, arguments);
|
||||
var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
||||
|
||||
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
||||
throw new RangeError('additionalDigits must be 0, 1 or 2');
|
||||
}
|
||||
|
||||
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
var dateStrings = splitDateString(argument);
|
||||
var date;
|
||||
|
||||
if (dateStrings.date) {
|
||||
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
||||
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
||||
}
|
||||
|
||||
if (!date || isNaN(date.getTime())) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
var timestamp = date.getTime();
|
||||
var time = 0;
|
||||
var offset;
|
||||
|
||||
if (dateStrings.time) {
|
||||
time = parseTime(dateStrings.time);
|
||||
|
||||
if (isNaN(time)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
}
|
||||
|
||||
if (dateStrings.timezone) {
|
||||
offset = parseTimezone(dateStrings.timezone);
|
||||
|
||||
if (isNaN(offset)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
} else {
|
||||
var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone
|
||||
var dirtyDate = new Date(timestamp + time);
|
||||
// js parsed string assuming it's in UTC timezone
|
||||
// but we need it to be parsed in our timezone
|
||||
// so we use utc values to build date in our timezone.
|
||||
// Year values from 0 to 99 map to the years 1900 to 1999
|
||||
// so set year explicitly with setFullYear.
|
||||
|
||||
var result = new Date(0);
|
||||
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
||||
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
||||
return result;
|
||||
}
|
||||
|
||||
return new Date(timestamp + time + offset);
|
||||
}
|
||||
var patterns = {
|
||||
|
|
@ -9539,32 +9529,28 @@ var patterns = {
|
|||
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
||||
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
||||
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
||||
|
||||
function splitDateString(dateString) {
|
||||
var dateStrings = {};
|
||||
var array = dateString.split(patterns.dateTimeDelimiter);
|
||||
var timeString; // The regex match should only return at maximum two array elements.
|
||||
// [date], [time], or [date, time].
|
||||
var timeString;
|
||||
|
||||
// The regex match should only return at maximum two array elements.
|
||||
// [date], [time], or [date, time].
|
||||
if (array.length > 2) {
|
||||
return dateStrings;
|
||||
}
|
||||
|
||||
if (/:/.test(array[0])) {
|
||||
timeString = array[0];
|
||||
} else {
|
||||
dateStrings.date = array[0];
|
||||
timeString = array[1];
|
||||
|
||||
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
||||
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
||||
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
||||
}
|
||||
}
|
||||
|
||||
if (timeString) {
|
||||
var token = patterns.timezone.exec(timeString);
|
||||
|
||||
if (token) {
|
||||
dateStrings.time = timeString.replace(token[1], '');
|
||||
dateStrings.timezone = token[1];
|
||||
|
|
@ -9572,32 +9558,30 @@ function splitDateString(dateString) {
|
|||
dateStrings.time = timeString;
|
||||
}
|
||||
}
|
||||
|
||||
return dateStrings;
|
||||
}
|
||||
|
||||
function parseYear(dateString, additionalDigits) {
|
||||
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
|
||||
var captures = dateString.match(regex); // Invalid ISO-formatted year
|
||||
|
||||
var captures = dateString.match(regex);
|
||||
// Invalid ISO-formatted year
|
||||
if (!captures) return {
|
||||
year: NaN,
|
||||
restDateString: ''
|
||||
};
|
||||
var year = captures[1] ? parseInt(captures[1]) : null;
|
||||
var century = captures[2] ? parseInt(captures[2]) : null; // either year or century is null, not both
|
||||
var century = captures[2] ? parseInt(captures[2]) : null;
|
||||
|
||||
// either year or century is null, not both
|
||||
return {
|
||||
year: century === null ? year : century * 100,
|
||||
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
||||
};
|
||||
}
|
||||
|
||||
function parseDate(dateString, year) {
|
||||
// Invalid ISO-formatted year
|
||||
if (year === null) return new Date(NaN);
|
||||
var captures = dateString.match(dateRegex); // Invalid ISO-formatted string
|
||||
|
||||
var captures = dateString.match(dateRegex);
|
||||
// Invalid ISO-formatted string
|
||||
if (!captures) return new Date(NaN);
|
||||
var isWeekDate = !!captures[4];
|
||||
var dayOfYear = parseDateUnit(captures[1]);
|
||||
|
|
@ -9605,29 +9589,23 @@ function parseDate(dateString, year) {
|
|||
var day = parseDateUnit(captures[3]);
|
||||
var week = parseDateUnit(captures[4]);
|
||||
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
||||
|
||||
if (isWeekDate) {
|
||||
if (!validateWeekDate(year, week, dayOfWeek)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
return dayOfISOWeekYear(year, week, dayOfWeek);
|
||||
} else {
|
||||
var date = new Date(0);
|
||||
|
||||
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
function parseDateUnit(value) {
|
||||
return value ? parseInt(value) : 1;
|
||||
}
|
||||
|
||||
function parseTime(timeString) {
|
||||
var captures = timeString.match(timeRegex);
|
||||
if (!captures) return NaN; // Invalid ISO-formatted time
|
||||
|
|
@ -9635,18 +9613,14 @@ function parseTime(timeString) {
|
|||
var hours = parseTimeUnit(captures[1]);
|
||||
var minutes = parseTimeUnit(captures[2]);
|
||||
var seconds = parseTimeUnit(captures[3]);
|
||||
|
||||
if (!validateTime(hours, minutes, seconds)) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
|
||||
}
|
||||
|
||||
function parseTimeUnit(value) {
|
||||
return value && parseFloat(value.replace(',', '.')) || 0;
|
||||
}
|
||||
|
||||
function parseTimezone(timezoneString) {
|
||||
if (timezoneString === 'Z') return 0;
|
||||
var captures = timezoneString.match(timezoneRegex);
|
||||
|
|
@ -9654,14 +9628,11 @@ function parseTimezone(timezoneString) {
|
|||
var sign = captures[1] === '+' ? -1 : 1;
|
||||
var hours = parseInt(captures[2]);
|
||||
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
||||
|
||||
if (!validateTimezone(hours, minutes)) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
||||
}
|
||||
|
||||
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
||||
var date = new Date(0);
|
||||
date.setUTCFullYear(isoWeekYear, 0, 4);
|
||||
|
|
@ -9669,36 +9640,30 @@ function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|||
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
||||
date.setUTCDate(date.getUTCDate() + diff);
|
||||
return date;
|
||||
} // Validation functions
|
||||
}
|
||||
|
||||
// Validation functions
|
||||
|
||||
// February is null to handle the leap year (using ||)
|
||||
|
||||
|
||||
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
|
||||
function isLeapYearIndex(year) {
|
||||
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
||||
}
|
||||
|
||||
function validateDate(year, month, date) {
|
||||
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
||||
}
|
||||
|
||||
function validateDayOfYearDate(year, dayOfYear) {
|
||||
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
||||
}
|
||||
|
||||
function validateWeekDate(_year, week, day) {
|
||||
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
||||
}
|
||||
|
||||
function validateTime(hours, minutes, seconds) {
|
||||
if (hours === 24) {
|
||||
return minutes === 0 && seconds === 0;
|
||||
}
|
||||
|
||||
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
||||
}
|
||||
|
||||
function validateTimezone(_hours, minutes) {
|
||||
return minutes >= 0 && minutes <= 59;
|
||||
}
|
||||
|
|
|
|||
2
wp-includes/js/dist/editor.min.js
vendored
2
wp-includes/js/dist/editor.min.js
vendored
File diff suppressed because one or more lines are too long
6
wp-includes/js/dist/rich-text.js
vendored
6
wp-includes/js/dist/rich-text.js
vendored
|
|
@ -4436,6 +4436,12 @@ function useRichText(_ref) {
|
|||
}, [placeholder, ...__unstableDependencies])]);
|
||||
return {
|
||||
value: record.current,
|
||||
// A function to get the most recent value so event handlers in
|
||||
// useRichText implementations have access to it. For example when
|
||||
// listening to input events, we internally update the state, but this
|
||||
// state is not yet available to the input event handler because React
|
||||
// may re-render asynchronously.
|
||||
getValue: () => record.current,
|
||||
onChange: handleChange,
|
||||
ref: mergedRefs
|
||||
};
|
||||
|
|
|
|||
2
wp-includes/js/dist/rich-text.min.js
vendored
2
wp-includes/js/dist/rich-text.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.3-alpha-55734';
|
||||
$wp_version = '6.3-alpha-55737';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user