diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/js/dist/shortcode.js --- a/wp/wp-includes/js/dist/shortcode.js Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/js/dist/shortcode.js Fri Sep 05 18:52:52 2025 +0200 @@ -31,7 +31,7 @@ // UNUSED EXPORTS: attrs, fromMatch, next, regexp, replace, string -;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js +;// ./node_modules/memize/dist/index.js /** * Memize options object. * @@ -193,40 +193,12 @@ -;// CONCATENATED MODULE: ./node_modules/@wordpress/shortcode/build-module/index.js +;// ./node_modules/@wordpress/shortcode/build-module/index.js /** * External dependencies */ -/** - * Shortcode attributes object. - * - * @typedef {Object} WPShortcodeAttrs - * - * @property {Object} named Object with named attributes. - * @property {Array} numeric Array with numeric attributes. - */ - -/** - * Shortcode object. - * - * @typedef {Object} WPShortcode - * - * @property {string} tag Shortcode tag. - * @property {WPShortcodeAttrs} attrs Shortcode attributes. - * @property {string} content Shortcode content. - * @property {string} type Shortcode type: `self-closing`, - * `closed`, or `single`. - */ - -/** - * @typedef {Object} WPShortcodeMatch - * - * @property {number} index Index the shortcode is found at. - * @property {string} content Matched content. - * @property {WPShortcode} shortcode Shortcode instance of the match. - */ /** * Find the next matching shortcode. @@ -235,7 +207,7 @@ * @param {string} text Text to search. * @param {number} index Index to start search from. * - * @return {WPShortcodeMatch | undefined} Matched information. + * @return {import('./types').ShortcodeMatch | undefined} Matched information. */ function next(tag, text, index = 0) { const re = regexp(tag); @@ -272,10 +244,10 @@ /** * Replace matching shortcodes in a block of text. * - * @param {string} tag Shortcode tag. - * @param {string} text Text to search. - * @param {Function} callback Function to process the match and return - * replacement string. + * @param {string} tag Shortcode tag. + * @param {string} text Text to search. + * @param {import('./types').ReplaceCallback} callback Function to process the match and return + * replacement string. * * @return {string} Text with shortcodes replaced. */ @@ -352,7 +324,7 @@ * * @param {string} text Serialised shortcode attributes. * - * @return {WPShortcodeAttrs} Parsed shortcode attributes. + * @return {import('./types').ShortcodeAttrs} Parsed shortcode attributes. */ const attrs = memize(text => { const named = {}; @@ -407,9 +379,9 @@ * by `regexp()`. `match` can also be set to the `arguments` from a callback * passed to `regexp.replace()`. * - * @param {Array} match Match array. + * @param {import('./types').Match} match Match array. * - * @return {WPShortcode} Shortcode instance. + * @return {InstanceType} Shortcode instance. */ function fromMatch(match) { let type; @@ -436,9 +408,7 @@ * the `type` of the shortcode ('single', 'self-closing', or 'closed'), and a * `content` string. * - * @param {Object} options Options as described. - * - * @return {WPShortcode} Shortcode instance. + * @type {import('./types').shortcode} Shortcode instance. */ const shortcode = Object.assign(function (options) { const { @@ -506,7 +476,7 @@ * @param {(number|string)} attr Attribute key. * @param {string} value Attribute value. * - * @return {WPShortcode} Shortcode instance. + * @return {InstanceType< import('./types').shortcode >} Shortcode instance. */ set(attr, value) { this.attrs[typeof attr === 'number' ? 'numeric' : 'named'][attr] = value;