diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/js/dist/block-library.js --- a/wp/wp-includes/js/dist/block-library.js Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/js/dist/block-library.js Fri Sep 05 18:40:08 2025 +0200 @@ -1,809 +1,592 @@ -/******/ (function() { // webpackBootstrap +/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 3827: -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var classNames = (function () { - // don't inherit from Object so we can skip hasOwnProperty check later - // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 - function StorageObject() {} - StorageObject.prototype = Object.create(null); - - function _parseArray (resultSet, array) { - var length = array.length; - - for (var i = 0; i < length; ++i) { - _parse(resultSet, array[i]); - } - } - - var hasOwn = {}.hasOwnProperty; - - function _parseNumber (resultSet, num) { - resultSet[num] = true; - } - - function _parseObject (resultSet, object) { - if (object.toString === Object.prototype.toString) { - for (var k in object) { - if (hasOwn.call(object, k)) { - // set value to false instead of deleting it to avoid changing object structure - // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions - resultSet[k] = !!object[k]; - } - } - } else { - resultSet[object.toString()] = true; - } - } - - var SPACE = /\s+/; - function _parseString (resultSet, str) { - var array = str.split(SPACE); - var length = array.length; - - for (var i = 0; i < length; ++i) { - resultSet[array[i]] = true; - } - } - - function _parse (resultSet, arg) { - if (!arg) return; - var argType = typeof arg; - - // 'foo bar' - if (argType === 'string') { - _parseString(resultSet, arg); - - // ['foo', 'bar', ...] - } else if (Array.isArray(arg)) { - _parseArray(resultSet, arg); - - // { 'foo': true, ... } - } else if (argType === 'object') { - _parseObject(resultSet, arg); - - // '130' - } else if (argType === 'number') { - _parseNumber(resultSet, arg); - } - } - - function _classNames () { - // don't leak arguments - // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments - var len = arguments.length; - var args = Array(len); - for (var i = 0; i < len; i++) { - args[i] = arguments[i]; - } - - var classSet = new StorageObject(); - _parseArray(classSet, args); - - var list = []; - - for (var k in classSet) { - if (classSet[k]) { - list.push(k) - } - } - - return list.join(' '); - } - - return _classNames; - })(); - - if ( true && module.exports) { - classNames.default = classNames; - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return classNames; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}()); +/***/ 2321: +/***/ ((module) => { + +/** + * Checks if the block is experimental based on the metadata loaded + * from block.json. + * + * This function is in a separate file and uses the older JS syntax so + * that it can be imported in both: + * – block-library/src/index.js + * – block-library/src/babel-plugin.js + * + * @param {Object} metadata Parsed block.json metadata. + * @return {boolean} Is the block experimental? + */ +module.exports = function isBlockMetadataExperimental(metadata) { + return metadata && '__experimental' in metadata && metadata.__experimental !== false; +}; /***/ }), -/***/ 4403: -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var hasOwn = {}.hasOwnProperty; - - function classNames() { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - if (arg.length) { - var inner = classNames.apply(null, arg); - if (inner) { - classes.push(inner); - } - } - } else if (argType === 'object') { - if (arg.toString === Object.prototype.toString) { - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } else { - classes.push(arg.toString()); - } - } - } - - return classes.join(' '); - } - - if ( true && module.exports) { - classNames.default = classNames; - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return classNames; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}()); +/***/ 7734: +/***/ ((module) => { + +"use strict"; + + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; /***/ }), -/***/ 5027: -/***/ (function(module) { - -/*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */ -(function (global, factory) { - true ? module.exports = factory() : - 0; -}(this, (function () { 'use strict'; - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); -} - -var FastAverageColor = -/*#__PURE__*/ -function () { - function FastAverageColor() { - _classCallCheck(this, FastAverageColor); - } - - _createClass(FastAverageColor, [{ - key: "getColorAsync", - - /** - * Get asynchronously the average color from not loaded image. - * - * @param {HTMLImageElement} resource - * @param {Function} callback - * @param {Object|null} [options] - * @param {Array} [options.defaultColor=[255, 255, 255, 255]] - * @param {*} [options.data] - * @param {string} [options.mode="speed"] "precision" or "speed" - * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" - * @param {number} [options.step=1] - * @param {number} [options.left=0] - * @param {number} [options.top=0] - * @param {number} [options.width=width of resource] - * @param {number} [options.height=height of resource] - */ - value: function getColorAsync(resource, callback, options) { - if (resource.complete) { - callback.call(resource, this.getColor(resource, options), options && options.data); - } else { - this._bindImageEvents(resource, callback, options); - } - } - /** - * Get the average color from images, videos and canvas. - * - * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource - * @param {Object|null} [options] - * @param {Array} [options.defaultColor=[255, 255, 255, 255]] - * @param {*} [options.data] - * @param {string} [options.mode="speed"] "precision" or "speed" - * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" - * @param {number} [options.step=1] - * @param {number} [options.left=0] - * @param {number} [options.top=0] - * @param {number} [options.width=width of resource] - * @param {number} [options.height=height of resource] - * - * @returns {Object} - */ - - }, { - key: "getColor", - value: function getColor(resource, options) { - options = options || {}; - - var defaultColor = this._getDefaultColor(options), - originalSize = this._getOriginalSize(resource), - size = this._prepareSizeAndPosition(originalSize, options); - - var error = null, - value = defaultColor; - - if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { - return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.')); - } - - if (!this._ctx) { - this._canvas = this._makeCanvas(); - this._ctx = this._canvas.getContext && this._canvas.getContext('2d'); - - if (!this._ctx) { - return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.')); - } - } - - this._canvas.width = size.destWidth; - this._canvas.height = size.destHeight; - - try { - this._ctx.clearRect(0, 0, size.destWidth, size.destHeight); - - this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); - - var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; - - value = this.getColorFromArray4(bitmapData, options); - } catch (e) { - // Security error, CORS - // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image - error = e; - } - - return this._prepareResult(value, error); - } - /** - * Get the average color from a array when 1 pixel is 4 bytes. - * - * @param {Array|Uint8Array} arr - * @param {Object} [options] - * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant" - * @param {Array} [options.defaultColor=[255, 255, 255, 255]] - * @param {number} [options.step=1] - * - * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)] - */ - - }, { - key: "getColorFromArray4", - value: function getColorFromArray4(arr, options) { - options = options || {}; - var bytesPerPixel = 4, - arrLength = arr.length; - - if (arrLength < bytesPerPixel) { - return this._getDefaultColor(options); - } - - var len = arrLength - arrLength % bytesPerPixel, - preparedStep = (options.step || 1) * bytesPerPixel, - algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm'; - - if (typeof this[algorithm] !== 'function') { - throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm.")); - } - - return this[algorithm](arr, len, preparedStep); - } - /** - * Destroy the instance. - */ - - }, { - key: "destroy", - value: function destroy() { - delete this._canvas; - delete this._ctx; - } - }, { - key: "_getDefaultColor", - value: function _getDefaultColor(options) { - return this._getOption(options, 'defaultColor', [255, 255, 255, 255]); - } - }, { - key: "_getOption", - value: function _getOption(options, name, defaultValue) { - return typeof options[name] === 'undefined' ? defaultValue : options[name]; - } - }, { - key: "_prepareSizeAndPosition", - value: function _prepareSizeAndPosition(originalSize, options) { - var srcLeft = this._getOption(options, 'left', 0), - srcTop = this._getOption(options, 'top', 0), - srcWidth = this._getOption(options, 'width', originalSize.width), - srcHeight = this._getOption(options, 'height', originalSize.height), - destWidth = srcWidth, - destHeight = srcHeight; - - if (options.mode === 'precision') { - return { - srcLeft: srcLeft, - srcTop: srcTop, - srcWidth: srcWidth, - srcHeight: srcHeight, - destWidth: destWidth, - destHeight: destHeight - }; - } - - var maxSize = 100, - minSize = 10; - var factor; - - if (srcWidth > srcHeight) { - factor = srcWidth / srcHeight; - destWidth = maxSize; - destHeight = Math.round(destWidth / factor); - } else { - factor = srcHeight / srcWidth; - destHeight = maxSize; - destWidth = Math.round(destHeight / factor); - } - - if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) { - destWidth = srcWidth; - destHeight = srcHeight; - } - - return { - srcLeft: srcLeft, - srcTop: srcTop, - srcWidth: srcWidth, - srcHeight: srcHeight, - destWidth: destWidth, - destHeight: destHeight - }; - } - }, { - key: "_simpleAlgorithm", - value: function _simpleAlgorithm(arr, len, preparedStep) { - var redTotal = 0, - greenTotal = 0, - blueTotal = 0, - alphaTotal = 0, - count = 0; - - for (var i = 0; i < len; i += preparedStep) { - var alpha = arr[i + 3], - red = arr[i] * alpha, - green = arr[i + 1] * alpha, - blue = arr[i + 2] * alpha; - redTotal += red; - greenTotal += green; - blueTotal += blue; - alphaTotal += alpha; - count++; - } - - return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; - } - }, { - key: "_sqrtAlgorithm", - value: function _sqrtAlgorithm(arr, len, preparedStep) { - var redTotal = 0, - greenTotal = 0, - blueTotal = 0, - alphaTotal = 0, - count = 0; - - for (var i = 0; i < len; i += preparedStep) { - var red = arr[i], - green = arr[i + 1], - blue = arr[i + 2], - alpha = arr[i + 3]; - redTotal += red * red * alpha; - greenTotal += green * green * alpha; - blueTotal += blue * blue * alpha; - alphaTotal += alpha; - count++; - } - - return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; - } - }, { - key: "_dominantAlgorithm", - value: function _dominantAlgorithm(arr, len, preparedStep) { - var colorHash = {}, - divider = 24; - - for (var i = 0; i < len; i += preparedStep) { - var red = arr[i], - green = arr[i + 1], - blue = arr[i + 2], - alpha = arr[i + 3], - key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider); - - if (colorHash[key]) { - colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1]; - } else { - colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; - } - } - - var buffer = Object.keys(colorHash).map(function (key) { - return colorHash[key]; - }).sort(function (a, b) { - var countA = a[4], - countB = b[4]; - return countA > countB ? -1 : countA === countB ? 0 : 1; - }); - - var _buffer$ = _slicedToArray(buffer[0], 5), - redTotal = _buffer$[0], - greenTotal = _buffer$[1], - blueTotal = _buffer$[2], - alphaTotal = _buffer$[3], - count = _buffer$[4]; - - return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0]; - } - }, { - key: "_bindImageEvents", - value: function _bindImageEvents(resource, callback, options) { - var _this = this; - - options = options || {}; - - var data = options && options.data, - defaultColor = this._getDefaultColor(options), - onload = function onload() { - unbindEvents(); - callback.call(resource, _this.getColor(resource, options), data); - }, - onerror = function onerror() { - unbindEvents(); - callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data); - }, - onabort = function onabort() { - unbindEvents(); - callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data); - }, - unbindEvents = function unbindEvents() { - resource.removeEventListener('load', onload); - resource.removeEventListener('error', onerror); - resource.removeEventListener('abort', onabort); - }; - - resource.addEventListener('load', onload); - resource.addEventListener('error', onerror); - resource.addEventListener('abort', onabort); - } - }, { - key: "_prepareResult", - value: function _prepareResult(value, error) { - var rgb = value.slice(0, 3), - rgba = [].concat(rgb, value[3] / 255), - isDark = this._isDark(value); - - return { - error: error, - value: value, - rgb: 'rgb(' + rgb.join(',') + ')', - rgba: 'rgba(' + rgba.join(',') + ')', - hex: this._arrayToHex(rgb), - hexa: this._arrayToHex(value), - isDark: isDark, - isLight: !isDark - }; - } - }, { - key: "_getOriginalSize", - value: function _getOriginalSize(resource) { - if (resource instanceof HTMLImageElement) { - return { - width: resource.naturalWidth, - height: resource.naturalHeight - }; - } - - if (resource instanceof HTMLVideoElement) { - return { - width: resource.videoWidth, - height: resource.videoHeight - }; - } - - return { - width: resource.width, - height: resource.height - }; - } - }, { - key: "_toHex", - value: function _toHex(num) { - var str = num.toString(16); - return str.length === 1 ? '0' + str : str; - } - }, { - key: "_arrayToHex", - value: function _arrayToHex(arr) { - return '#' + arr.map(this._toHex).join(''); - } - }, { - key: "_isDark", - value: function _isDark(color) { - // http://www.w3.org/TR/AERT#color-contrast - var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; - return result < 128; - } - }, { - key: "_makeCanvas", - value: function _makeCanvas() { - return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas'); - } - }]); - - return FastAverageColor; -}(); - -return FastAverageColor; - -}))); - - -/***/ }), - -/***/ 9756: -/***/ (function(module) { - -/** - * Memize options object. - * - * @typedef MemizeOptions - * - * @property {number} [maxSize] Maximum size of the cache. - */ - -/** - * Internal cache entry. - * - * @typedef MemizeCacheNode - * - * @property {?MemizeCacheNode|undefined} [prev] Previous node. - * @property {?MemizeCacheNode|undefined} [next] Next node. - * @property {Array<*>} args Function arguments for cache - * entry. - * @property {*} val Function result. - */ - -/** - * Properties of the enhanced function for controlling cache. - * - * @typedef MemizeMemoizedFunction - * - * @property {()=>void} clear Clear the cache. - */ - -/** - * Accepts a function to be memoized, and returns a new memoized function, with - * optional options. - * - * @template {Function} F - * - * @param {F} fn Function to memoize. - * @param {MemizeOptions} [options] Options object. - * - * @return {F & MemizeMemoizedFunction} Memoized function. - */ -function memize( fn, options ) { - var size = 0; - - /** @type {?MemizeCacheNode|undefined} */ - var head; - - /** @type {?MemizeCacheNode|undefined} */ - var tail; - - options = options || {}; - - function memoized( /* ...args */ ) { - var node = head, - len = arguments.length, - args, i; - - searchCache: while ( node ) { - // Perform a shallow equality test to confirm that whether the node - // under test is a candidate for the arguments passed. Two arrays - // are shallowly equal if their length matches and each entry is - // strictly equal between the two sets. Avoid abstracting to a - // function which could incur an arguments leaking deoptimization. - - // Check whether node arguments match arguments length - if ( node.args.length !== arguments.length ) { - node = node.next; - continue; - } - - // Check whether node arguments match arguments values - for ( i = 0; i < len; i++ ) { - if ( node.args[ i ] !== arguments[ i ] ) { - node = node.next; - continue searchCache; - } - } - - // At this point we can assume we've found a match - - // Surface matched node to head if not already - if ( node !== head ) { - // As tail, shift to previous. Must only shift if not also - // head, since if both head and tail, there is no previous. - if ( node === tail ) { - tail = node.prev; - } - - // Adjust siblings to point to each other. If node was tail, - // this also handles new tail's empty `next` assignment. - /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; - if ( node.next ) { - node.next.prev = node.prev; - } - - node.next = head; - node.prev = null; - /** @type {MemizeCacheNode} */ ( head ).prev = node; - head = node; - } - - // Return immediately - return node.val; - } - - // No cached value found. Continue to insertion phase: - - // Create a copy of arguments (avoid leaking deoptimization) - args = new Array( len ); - for ( i = 0; i < len; i++ ) { - args[ i ] = arguments[ i ]; - } - - node = { - args: args, - - // Generate the result from original function - val: fn.apply( null, args ), - }; - - // Don't need to check whether node is already head, since it would - // have been returned above already if it was - - // Shift existing head down list - if ( head ) { - head.prev = node; - node.next = head; - } else { - // If no head, follows that there's no tail (at initial or reset) - tail = node; - } - - // Trim tail if we're reached max size and are pending cache insertion - if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { - tail = /** @type {MemizeCacheNode} */ ( tail ).prev; - /** @type {MemizeCacheNode} */ ( tail ).next = null; - } else { - size++; - } - - head = node; - - return node.val; - } - - memoized.clear = function() { - head = null; - tail = null; - size = 0; - }; - - if ( false ) {} - - // Ignore reason: There's not a clear solution to create an intersection of - // the function with additional properties, where the goal is to retain the - // function signature of the incoming argument and add control properties - // on the return value. - - // @ts-ignore - return memoized; -} - -module.exports = memize; +/***/ 9681: +/***/ ((module) => { + +var characterMap = { + "À": "A", + "Á": "A", + "Â": "A", + "Ã": "A", + "Ä": "A", + "Å": "A", + "Ấ": "A", + "Ắ": "A", + "Ẳ": "A", + "Ẵ": "A", + "Ặ": "A", + "Æ": "AE", + "Ầ": "A", + "Ằ": "A", + "Ȃ": "A", + "Ả": "A", + "Ạ": "A", + "Ẩ": "A", + "Ẫ": "A", + "Ậ": "A", + "Ç": "C", + "Ḉ": "C", + "È": "E", + "É": "E", + "Ê": "E", + "Ë": "E", + "Ế": "E", + "Ḗ": "E", + "Ề": "E", + "Ḕ": "E", + "Ḝ": "E", + "Ȇ": "E", + "Ẻ": "E", + "Ẽ": "E", + "Ẹ": "E", + "Ể": "E", + "Ễ": "E", + "Ệ": "E", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ï": "I", + "Ḯ": "I", + "Ȋ": "I", + "Ỉ": "I", + "Ị": "I", + "Ð": "D", + "Ñ": "N", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Õ": "O", + "Ö": "O", + "Ø": "O", + "Ố": "O", + "Ṍ": "O", + "Ṓ": "O", + "Ȏ": "O", + "Ỏ": "O", + "Ọ": "O", + "Ổ": "O", + "Ỗ": "O", + "Ộ": "O", + "Ờ": "O", + "Ở": "O", + "Ỡ": "O", + "Ớ": "O", + "Ợ": "O", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ü": "U", + "Ủ": "U", + "Ụ": "U", + "Ử": "U", + "Ữ": "U", + "Ự": "U", + "Ý": "Y", + "à": "a", + "á": "a", + "â": "a", + "ã": "a", + "ä": "a", + "å": "a", + "ấ": "a", + "ắ": "a", + "ẳ": "a", + "ẵ": "a", + "ặ": "a", + "æ": "ae", + "ầ": "a", + "ằ": "a", + "ȃ": "a", + "ả": "a", + "ạ": "a", + "ẩ": "a", + "ẫ": "a", + "ậ": "a", + "ç": "c", + "ḉ": "c", + "è": "e", + "é": "e", + "ê": "e", + "ë": "e", + "ế": "e", + "ḗ": "e", + "ề": "e", + "ḕ": "e", + "ḝ": "e", + "ȇ": "e", + "ẻ": "e", + "ẽ": "e", + "ẹ": "e", + "ể": "e", + "ễ": "e", + "ệ": "e", + "ì": "i", + "í": "i", + "î": "i", + "ï": "i", + "ḯ": "i", + "ȋ": "i", + "ỉ": "i", + "ị": "i", + "ð": "d", + "ñ": "n", + "ò": "o", + "ó": "o", + "ô": "o", + "õ": "o", + "ö": "o", + "ø": "o", + "ố": "o", + "ṍ": "o", + "ṓ": "o", + "ȏ": "o", + "ỏ": "o", + "ọ": "o", + "ổ": "o", + "ỗ": "o", + "ộ": "o", + "ờ": "o", + "ở": "o", + "ỡ": "o", + "ớ": "o", + "ợ": "o", + "ù": "u", + "ú": "u", + "û": "u", + "ü": "u", + "ủ": "u", + "ụ": "u", + "ử": "u", + "ữ": "u", + "ự": "u", + "ý": "y", + "ÿ": "y", + "Ā": "A", + "ā": "a", + "Ă": "A", + "ă": "a", + "Ą": "A", + "ą": "a", + "Ć": "C", + "ć": "c", + "Ĉ": "C", + "ĉ": "c", + "Ċ": "C", + "ċ": "c", + "Č": "C", + "č": "c", + "C̆": "C", + "c̆": "c", + "Ď": "D", + "ď": "d", + "Đ": "D", + "đ": "d", + "Ē": "E", + "ē": "e", + "Ĕ": "E", + "ĕ": "e", + "Ė": "E", + "ė": "e", + "Ę": "E", + "ę": "e", + "Ě": "E", + "ě": "e", + "Ĝ": "G", + "Ǵ": "G", + "ĝ": "g", + "ǵ": "g", + "Ğ": "G", + "ğ": "g", + "Ġ": "G", + "ġ": "g", + "Ģ": "G", + "ģ": "g", + "Ĥ": "H", + "ĥ": "h", + "Ħ": "H", + "ħ": "h", + "Ḫ": "H", + "ḫ": "h", + "Ĩ": "I", + "ĩ": "i", + "Ī": "I", + "ī": "i", + "Ĭ": "I", + "ĭ": "i", + "Į": "I", + "į": "i", + "İ": "I", + "ı": "i", + "IJ": "IJ", + "ij": "ij", + "Ĵ": "J", + "ĵ": "j", + "Ķ": "K", + "ķ": "k", + "Ḱ": "K", + "ḱ": "k", + "K̆": "K", + "k̆": "k", + "Ĺ": "L", + "ĺ": "l", + "Ļ": "L", + "ļ": "l", + "Ľ": "L", + "ľ": "l", + "Ŀ": "L", + "ŀ": "l", + "Ł": "l", + "ł": "l", + "Ḿ": "M", + "ḿ": "m", + "M̆": "M", + "m̆": "m", + "Ń": "N", + "ń": "n", + "Ņ": "N", + "ņ": "n", + "Ň": "N", + "ň": "n", + "ʼn": "n", + "N̆": "N", + "n̆": "n", + "Ō": "O", + "ō": "o", + "Ŏ": "O", + "ŏ": "o", + "Ő": "O", + "ő": "o", + "Œ": "OE", + "œ": "oe", + "P̆": "P", + "p̆": "p", + "Ŕ": "R", + "ŕ": "r", + "Ŗ": "R", + "ŗ": "r", + "Ř": "R", + "ř": "r", + "R̆": "R", + "r̆": "r", + "Ȓ": "R", + "ȓ": "r", + "Ś": "S", + "ś": "s", + "Ŝ": "S", + "ŝ": "s", + "Ş": "S", + "Ș": "S", + "ș": "s", + "ş": "s", + "Š": "S", + "š": "s", + "Ţ": "T", + "ţ": "t", + "ț": "t", + "Ț": "T", + "Ť": "T", + "ť": "t", + "Ŧ": "T", + "ŧ": "t", + "T̆": "T", + "t̆": "t", + "Ũ": "U", + "ũ": "u", + "Ū": "U", + "ū": "u", + "Ŭ": "U", + "ŭ": "u", + "Ů": "U", + "ů": "u", + "Ű": "U", + "ű": "u", + "Ų": "U", + "ų": "u", + "Ȗ": "U", + "ȗ": "u", + "V̆": "V", + "v̆": "v", + "Ŵ": "W", + "ŵ": "w", + "Ẃ": "W", + "ẃ": "w", + "X̆": "X", + "x̆": "x", + "Ŷ": "Y", + "ŷ": "y", + "Ÿ": "Y", + "Y̆": "Y", + "y̆": "y", + "Ź": "Z", + "ź": "z", + "Ż": "Z", + "ż": "z", + "Ž": "Z", + "ž": "z", + "ſ": "s", + "ƒ": "f", + "Ơ": "O", + "ơ": "o", + "Ư": "U", + "ư": "u", + "Ǎ": "A", + "ǎ": "a", + "Ǐ": "I", + "ǐ": "i", + "Ǒ": "O", + "ǒ": "o", + "Ǔ": "U", + "ǔ": "u", + "Ǖ": "U", + "ǖ": "u", + "Ǘ": "U", + "ǘ": "u", + "Ǚ": "U", + "ǚ": "u", + "Ǜ": "U", + "ǜ": "u", + "Ứ": "U", + "ứ": "u", + "Ṹ": "U", + "ṹ": "u", + "Ǻ": "A", + "ǻ": "a", + "Ǽ": "AE", + "ǽ": "ae", + "Ǿ": "O", + "ǿ": "o", + "Þ": "TH", + "þ": "th", + "Ṕ": "P", + "ṕ": "p", + "Ṥ": "S", + "ṥ": "s", + "X́": "X", + "x́": "x", + "Ѓ": "Г", + "ѓ": "г", + "Ќ": "К", + "ќ": "к", + "A̋": "A", + "a̋": "a", + "E̋": "E", + "e̋": "e", + "I̋": "I", + "i̋": "i", + "Ǹ": "N", + "ǹ": "n", + "Ồ": "O", + "ồ": "o", + "Ṑ": "O", + "ṑ": "o", + "Ừ": "U", + "ừ": "u", + "Ẁ": "W", + "ẁ": "w", + "Ỳ": "Y", + "ỳ": "y", + "Ȁ": "A", + "ȁ": "a", + "Ȅ": "E", + "ȅ": "e", + "Ȉ": "I", + "ȉ": "i", + "Ȍ": "O", + "ȍ": "o", + "Ȑ": "R", + "ȑ": "r", + "Ȕ": "U", + "ȕ": "u", + "B̌": "B", + "b̌": "b", + "Č̣": "C", + "č̣": "c", + "Ê̌": "E", + "ê̌": "e", + "F̌": "F", + "f̌": "f", + "Ǧ": "G", + "ǧ": "g", + "Ȟ": "H", + "ȟ": "h", + "J̌": "J", + "ǰ": "j", + "Ǩ": "K", + "ǩ": "k", + "M̌": "M", + "m̌": "m", + "P̌": "P", + "p̌": "p", + "Q̌": "Q", + "q̌": "q", + "Ř̩": "R", + "ř̩": "r", + "Ṧ": "S", + "ṧ": "s", + "V̌": "V", + "v̌": "v", + "W̌": "W", + "w̌": "w", + "X̌": "X", + "x̌": "x", + "Y̌": "Y", + "y̌": "y", + "A̧": "A", + "a̧": "a", + "B̧": "B", + "b̧": "b", + "Ḑ": "D", + "ḑ": "d", + "Ȩ": "E", + "ȩ": "e", + "Ɛ̧": "E", + "ɛ̧": "e", + "Ḩ": "H", + "ḩ": "h", + "I̧": "I", + "i̧": "i", + "Ɨ̧": "I", + "ɨ̧": "i", + "M̧": "M", + "m̧": "m", + "O̧": "O", + "o̧": "o", + "Q̧": "Q", + "q̧": "q", + "U̧": "U", + "u̧": "u", + "X̧": "X", + "x̧": "x", + "Z̧": "Z", + "z̧": "z", + "й":"и", + "Й":"И", + "ё":"е", + "Ё":"Е", +}; + +var chars = Object.keys(characterMap).join('|'); +var allAccents = new RegExp(chars, 'g'); +var firstAccent = new RegExp(chars, ''); + +function matcher(match) { + return characterMap[match]; +} + +var removeAccents = function(string) { + return string.replace(allAccents, matcher); +}; + +var hasAccents = function(string) { + return !!string.match(firstAccent); +}; + +module.exports = removeAccents; +module.exports.has = hasAccents; +module.exports.remove = removeAccents; /***/ }) @@ -828,7 +611,7 @@ /******/ }; /******/ /******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; @@ -836,931 +619,1211 @@ /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ -/******/ !function() { +/******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { +/******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ -/******/ !function() { +/******/ (() => { /******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { +/******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ -/******/ !function() { +/******/ (() => { /******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { +/******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; -/******/ }(); +/******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. -!function() { +(() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { - "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; }, - "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; }, - "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; } + __experimentalGetCoreBlocks: () => (/* binding */ __experimentalGetCoreBlocks), + __experimentalRegisterExperimentalCoreBlocks: () => (/* binding */ __experimentalRegisterExperimentalCoreBlocks), + privateApis: () => (/* reexport */ privateApis), + registerCoreBlocks: () => (/* binding */ registerCoreBlocks) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js var archives_namespaceObject = {}; __webpack_require__.r(archives_namespaceObject); __webpack_require__.d(archives_namespaceObject, { - "metadata": function() { return metadata; }, - "name": function() { return archives_name; }, - "settings": function() { return settings; } + init: () => (init), + metadata: () => (metadata), + name: () => (archives_name), + settings: () => (settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js var avatar_namespaceObject = {}; __webpack_require__.r(avatar_namespaceObject); __webpack_require__.d(avatar_namespaceObject, { - "metadata": function() { return avatar_metadata; }, - "name": function() { return avatar_name; }, - "settings": function() { return avatar_settings; } + init: () => (avatar_init), + metadata: () => (avatar_metadata), + name: () => (avatar_name), + settings: () => (avatar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js var build_module_audio_namespaceObject = {}; __webpack_require__.r(build_module_audio_namespaceObject); __webpack_require__.d(build_module_audio_namespaceObject, { - "metadata": function() { return audio_metadata; }, - "name": function() { return audio_name; }, - "settings": function() { return audio_settings; } + init: () => (audio_init), + metadata: () => (audio_metadata), + name: () => (audio_name), + settings: () => (audio_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js var build_module_button_namespaceObject = {}; __webpack_require__.r(build_module_button_namespaceObject); __webpack_require__.d(build_module_button_namespaceObject, { - "metadata": function() { return button_metadata; }, - "name": function() { return button_name; }, - "settings": function() { return button_settings; } + init: () => (button_init), + metadata: () => (button_metadata), + name: () => (button_name), + settings: () => (button_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js var build_module_buttons_namespaceObject = {}; __webpack_require__.r(build_module_buttons_namespaceObject); __webpack_require__.d(build_module_buttons_namespaceObject, { - "metadata": function() { return buttons_metadata; }, - "name": function() { return buttons_name; }, - "settings": function() { return buttons_settings; } + init: () => (buttons_init), + metadata: () => (buttons_metadata), + name: () => (buttons_name), + settings: () => (buttons_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js var build_module_calendar_namespaceObject = {}; __webpack_require__.r(build_module_calendar_namespaceObject); __webpack_require__.d(build_module_calendar_namespaceObject, { - "metadata": function() { return calendar_metadata; }, - "name": function() { return calendar_name; }, - "settings": function() { return calendar_settings; } + init: () => (calendar_init), + metadata: () => (calendar_metadata), + name: () => (calendar_name), + settings: () => (calendar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js var categories_namespaceObject = {}; __webpack_require__.r(categories_namespaceObject); __webpack_require__.d(categories_namespaceObject, { - "metadata": function() { return categories_metadata; }, - "name": function() { return categories_name; }, - "settings": function() { return categories_settings; } + init: () => (categories_init), + metadata: () => (categories_metadata), + name: () => (categories_name), + settings: () => (categories_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js var freeform_namespaceObject = {}; __webpack_require__.r(freeform_namespaceObject); __webpack_require__.d(freeform_namespaceObject, { - "metadata": function() { return freeform_metadata; }, - "name": function() { return freeform_name; }, - "settings": function() { return freeform_settings; } + init: () => (freeform_init), + metadata: () => (freeform_metadata), + name: () => (freeform_name), + settings: () => (freeform_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js var build_module_code_namespaceObject = {}; __webpack_require__.r(build_module_code_namespaceObject); __webpack_require__.d(build_module_code_namespaceObject, { - "metadata": function() { return code_metadata; }, - "name": function() { return code_name; }, - "settings": function() { return code_settings; } + init: () => (code_init), + metadata: () => (code_metadata), + name: () => (code_name), + settings: () => (code_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js var build_module_column_namespaceObject = {}; __webpack_require__.r(build_module_column_namespaceObject); __webpack_require__.d(build_module_column_namespaceObject, { - "metadata": function() { return column_metadata; }, - "name": function() { return column_name; }, - "settings": function() { return column_settings; } + init: () => (column_init), + metadata: () => (column_metadata), + name: () => (column_name), + settings: () => (column_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js var build_module_columns_namespaceObject = {}; __webpack_require__.r(build_module_columns_namespaceObject); __webpack_require__.d(build_module_columns_namespaceObject, { - "metadata": function() { return columns_metadata; }, - "name": function() { return columns_name; }, - "settings": function() { return columns_settings; } + init: () => (columns_init), + metadata: () => (columns_metadata), + name: () => (columns_name), + settings: () => (columns_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js +var comments_namespaceObject = {}; +__webpack_require__.r(comments_namespaceObject); +__webpack_require__.d(comments_namespaceObject, { + init: () => (comments_init), + metadata: () => (comments_metadata), + name: () => (comments_name), + settings: () => (comments_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js +var build_module_comment_author_avatar_namespaceObject = {}; +__webpack_require__.r(build_module_comment_author_avatar_namespaceObject); +__webpack_require__.d(build_module_comment_author_avatar_namespaceObject, { + init: () => (comment_author_avatar_init), + metadata: () => (comment_author_avatar_metadata), + name: () => (comment_author_avatar_name), + settings: () => (comment_author_avatar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js var build_module_comment_author_name_namespaceObject = {}; __webpack_require__.r(build_module_comment_author_name_namespaceObject); __webpack_require__.d(build_module_comment_author_name_namespaceObject, { - "metadata": function() { return comment_author_name_metadata; }, - "name": function() { return comment_author_name_name; }, - "settings": function() { return comment_author_name_settings; } + init: () => (comment_author_name_init), + metadata: () => (comment_author_name_metadata), + name: () => (comment_author_name_name), + settings: () => (comment_author_name_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js var build_module_comment_content_namespaceObject = {}; __webpack_require__.r(build_module_comment_content_namespaceObject); __webpack_require__.d(build_module_comment_content_namespaceObject, { - "metadata": function() { return comment_content_metadata; }, - "name": function() { return comment_content_name; }, - "settings": function() { return comment_content_settings; } + init: () => (comment_content_init), + metadata: () => (comment_content_metadata), + name: () => (comment_content_name), + settings: () => (comment_content_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js var comment_date_namespaceObject = {}; __webpack_require__.r(comment_date_namespaceObject); __webpack_require__.d(comment_date_namespaceObject, { - "metadata": function() { return comment_date_metadata; }, - "name": function() { return comment_date_name; }, - "settings": function() { return comment_date_settings; } + init: () => (comment_date_init), + metadata: () => (comment_date_metadata), + name: () => (comment_date_name), + settings: () => (comment_date_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js var build_module_comment_edit_link_namespaceObject = {}; __webpack_require__.r(build_module_comment_edit_link_namespaceObject); __webpack_require__.d(build_module_comment_edit_link_namespaceObject, { - "metadata": function() { return comment_edit_link_metadata; }, - "name": function() { return comment_edit_link_name; }, - "settings": function() { return comment_edit_link_settings; } + init: () => (comment_edit_link_init), + metadata: () => (comment_edit_link_metadata), + name: () => (comment_edit_link_name), + settings: () => (comment_edit_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js var build_module_comment_reply_link_namespaceObject = {}; __webpack_require__.r(build_module_comment_reply_link_namespaceObject); __webpack_require__.d(build_module_comment_reply_link_namespaceObject, { - "metadata": function() { return comment_reply_link_metadata; }, - "name": function() { return comment_reply_link_name; }, - "settings": function() { return comment_reply_link_settings; } + init: () => (comment_reply_link_init), + metadata: () => (comment_reply_link_metadata), + name: () => (comment_reply_link_name), + settings: () => (comment_reply_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js var comment_template_namespaceObject = {}; __webpack_require__.r(comment_template_namespaceObject); __webpack_require__.d(comment_template_namespaceObject, { - "metadata": function() { return comment_template_metadata; }, - "name": function() { return comment_template_name; }, - "settings": function() { return comment_template_settings; } + init: () => (comment_template_init), + metadata: () => (comment_template_metadata), + name: () => (comment_template_name), + settings: () => (comment_template_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js var comments_pagination_previous_namespaceObject = {}; __webpack_require__.r(comments_pagination_previous_namespaceObject); __webpack_require__.d(comments_pagination_previous_namespaceObject, { - "metadata": function() { return comments_pagination_previous_metadata; }, - "name": function() { return comments_pagination_previous_name; }, - "settings": function() { return comments_pagination_previous_settings; } -}); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js -var comments_query_loop_namespaceObject = {}; -__webpack_require__.r(comments_query_loop_namespaceObject); -__webpack_require__.d(comments_query_loop_namespaceObject, { - "metadata": function() { return comments_query_loop_metadata; }, - "name": function() { return comments_query_loop_name; }, - "settings": function() { return comments_query_loop_settings; } + init: () => (comments_pagination_previous_init), + metadata: () => (comments_pagination_previous_metadata), + name: () => (comments_pagination_previous_name), + settings: () => (comments_pagination_previous_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js var comments_pagination_namespaceObject = {}; __webpack_require__.r(comments_pagination_namespaceObject); __webpack_require__.d(comments_pagination_namespaceObject, { - "metadata": function() { return comments_pagination_metadata; }, - "name": function() { return comments_pagination_name; }, - "settings": function() { return comments_pagination_settings; } + init: () => (comments_pagination_init), + metadata: () => (comments_pagination_metadata), + name: () => (comments_pagination_name), + settings: () => (comments_pagination_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js var comments_pagination_next_namespaceObject = {}; __webpack_require__.r(comments_pagination_next_namespaceObject); __webpack_require__.d(comments_pagination_next_namespaceObject, { - "metadata": function() { return comments_pagination_next_metadata; }, - "name": function() { return comments_pagination_next_name; }, - "settings": function() { return comments_pagination_next_settings; } + init: () => (comments_pagination_next_init), + metadata: () => (comments_pagination_next_metadata), + name: () => (comments_pagination_next_name), + settings: () => (comments_pagination_next_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js var comments_pagination_numbers_namespaceObject = {}; __webpack_require__.r(comments_pagination_numbers_namespaceObject); __webpack_require__.d(comments_pagination_numbers_namespaceObject, { - "metadata": function() { return comments_pagination_numbers_metadata; }, - "name": function() { return comments_pagination_numbers_name; }, - "settings": function() { return comments_pagination_numbers_settings; } + init: () => (comments_pagination_numbers_init), + metadata: () => (comments_pagination_numbers_metadata), + name: () => (comments_pagination_numbers_name), + settings: () => (comments_pagination_numbers_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js var comments_title_namespaceObject = {}; __webpack_require__.r(comments_title_namespaceObject); __webpack_require__.d(comments_title_namespaceObject, { - "metadata": function() { return comments_title_metadata; }, - "name": function() { return comments_title_name; }, - "settings": function() { return comments_title_settings; } + init: () => (comments_title_init), + metadata: () => (comments_title_metadata), + name: () => (comments_title_name), + settings: () => (comments_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js var build_module_cover_namespaceObject = {}; __webpack_require__.r(build_module_cover_namespaceObject); __webpack_require__.d(build_module_cover_namespaceObject, { - "metadata": function() { return cover_metadata; }, - "name": function() { return cover_name; }, - "settings": function() { return cover_settings; } + init: () => (cover_init), + metadata: () => (cover_metadata), + name: () => (cover_name), + settings: () => (cover_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/details/index.js +var build_module_details_namespaceObject = {}; +__webpack_require__.r(build_module_details_namespaceObject); +__webpack_require__.d(build_module_details_namespaceObject, { + init: () => (details_init), + metadata: () => (details_metadata), + name: () => (details_name), + settings: () => (details_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js var embed_namespaceObject = {}; __webpack_require__.r(embed_namespaceObject); __webpack_require__.d(embed_namespaceObject, { - "metadata": function() { return embed_metadata; }, - "name": function() { return embed_name; }, - "settings": function() { return embed_settings; } + init: () => (embed_init), + metadata: () => (embed_metadata), + name: () => (embed_name), + settings: () => (embed_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js var build_module_file_namespaceObject = {}; __webpack_require__.r(build_module_file_namespaceObject); __webpack_require__.d(build_module_file_namespaceObject, { - "metadata": function() { return file_metadata; }, - "name": function() { return file_name; }, - "settings": function() { return file_settings; } + init: () => (file_init), + metadata: () => (file_metadata), + name: () => (file_name), + settings: () => (file_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form/index.js +var build_module_form_namespaceObject = {}; +__webpack_require__.r(build_module_form_namespaceObject); +__webpack_require__.d(build_module_form_namespaceObject, { + init: () => (form_init), + metadata: () => (form_metadata), + name: () => (form_name), + settings: () => (form_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-input/index.js +var form_input_namespaceObject = {}; +__webpack_require__.r(form_input_namespaceObject); +__webpack_require__.d(form_input_namespaceObject, { + init: () => (form_input_init), + metadata: () => (form_input_metadata), + name: () => (form_input_name), + settings: () => (form_input_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js +var form_submit_button_namespaceObject = {}; +__webpack_require__.r(form_submit_button_namespaceObject); +__webpack_require__.d(form_submit_button_namespaceObject, { + init: () => (form_submit_button_init), + metadata: () => (form_submit_button_metadata), + name: () => (form_submit_button_name), + settings: () => (form_submit_button_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js +var form_submission_notification_namespaceObject = {}; +__webpack_require__.r(form_submission_notification_namespaceObject); +__webpack_require__.d(form_submission_notification_namespaceObject, { + init: () => (form_submission_notification_init), + metadata: () => (form_submission_notification_metadata), + name: () => (form_submission_notification_name), + settings: () => (form_submission_notification_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js var build_module_gallery_namespaceObject = {}; __webpack_require__.r(build_module_gallery_namespaceObject); __webpack_require__.d(build_module_gallery_namespaceObject, { - "metadata": function() { return gallery_metadata; }, - "name": function() { return gallery_name; }, - "settings": function() { return gallery_settings; } + init: () => (gallery_init), + metadata: () => (gallery_metadata), + name: () => (gallery_name), + settings: () => (gallery_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js var build_module_group_namespaceObject = {}; __webpack_require__.r(build_module_group_namespaceObject); __webpack_require__.d(build_module_group_namespaceObject, { - "metadata": function() { return group_metadata; }, - "name": function() { return group_name; }, - "settings": function() { return group_settings; } + init: () => (group_init), + metadata: () => (group_metadata), + name: () => (group_name), + settings: () => (group_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js var build_module_heading_namespaceObject = {}; __webpack_require__.r(build_module_heading_namespaceObject); __webpack_require__.d(build_module_heading_namespaceObject, { - "metadata": function() { return heading_metadata; }, - "name": function() { return heading_name; }, - "settings": function() { return heading_settings; } + init: () => (heading_init), + metadata: () => (heading_metadata), + name: () => (heading_name), + settings: () => (heading_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js var home_link_namespaceObject = {}; __webpack_require__.r(home_link_namespaceObject); __webpack_require__.d(home_link_namespaceObject, { - "metadata": function() { return home_link_metadata; }, - "name": function() { return home_link_name; }, - "settings": function() { return home_link_settings; } + init: () => (home_link_init), + metadata: () => (home_link_metadata), + name: () => (home_link_name), + settings: () => (home_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js var build_module_html_namespaceObject = {}; __webpack_require__.r(build_module_html_namespaceObject); __webpack_require__.d(build_module_html_namespaceObject, { - "metadata": function() { return html_metadata; }, - "name": function() { return html_name; }, - "settings": function() { return html_settings; } + init: () => (html_init), + metadata: () => (html_metadata), + name: () => (html_name), + settings: () => (html_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js var build_module_image_namespaceObject = {}; __webpack_require__.r(build_module_image_namespaceObject); __webpack_require__.d(build_module_image_namespaceObject, { - "metadata": function() { return image_metadata; }, - "name": function() { return image_name; }, - "settings": function() { return image_settings; } + init: () => (image_init), + metadata: () => (image_metadata), + name: () => (image_name), + settings: () => (image_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js var latest_comments_namespaceObject = {}; __webpack_require__.r(latest_comments_namespaceObject); __webpack_require__.d(latest_comments_namespaceObject, { - "metadata": function() { return latest_comments_metadata; }, - "name": function() { return latest_comments_name; }, - "settings": function() { return latest_comments_settings; } + init: () => (latest_comments_init), + metadata: () => (latest_comments_metadata), + name: () => (latest_comments_name), + settings: () => (latest_comments_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js var latest_posts_namespaceObject = {}; __webpack_require__.r(latest_posts_namespaceObject); __webpack_require__.d(latest_posts_namespaceObject, { - "metadata": function() { return latest_posts_metadata; }, - "name": function() { return latest_posts_name; }, - "settings": function() { return latest_posts_settings; } + init: () => (latest_posts_init), + metadata: () => (latest_posts_metadata), + name: () => (latest_posts_name), + settings: () => (latest_posts_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js var build_module_list_namespaceObject = {}; __webpack_require__.r(build_module_list_namespaceObject); __webpack_require__.d(build_module_list_namespaceObject, { - "metadata": function() { return list_metadata; }, - "name": function() { return list_name; }, - "settings": function() { return list_settings; } + init: () => (list_init), + metadata: () => (list_metadata), + name: () => (list_name), + settings: () => (list_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js +var build_module_list_item_namespaceObject = {}; +__webpack_require__.r(build_module_list_item_namespaceObject); +__webpack_require__.d(build_module_list_item_namespaceObject, { + init: () => (list_item_init), + metadata: () => (list_item_metadata), + name: () => (list_item_name), + settings: () => (list_item_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js var loginout_namespaceObject = {}; __webpack_require__.r(loginout_namespaceObject); __webpack_require__.d(loginout_namespaceObject, { - "metadata": function() { return loginout_metadata; }, - "name": function() { return loginout_name; }, - "settings": function() { return loginout_settings; } + init: () => (loginout_init), + metadata: () => (loginout_metadata), + name: () => (loginout_name), + settings: () => (loginout_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js var media_text_namespaceObject = {}; __webpack_require__.r(media_text_namespaceObject); __webpack_require__.d(media_text_namespaceObject, { - "metadata": function() { return media_text_metadata; }, - "name": function() { return media_text_name; }, - "settings": function() { return media_text_settings; } + init: () => (media_text_init), + metadata: () => (media_text_metadata), + name: () => (media_text_name), + settings: () => (media_text_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js var missing_namespaceObject = {}; __webpack_require__.r(missing_namespaceObject); __webpack_require__.d(missing_namespaceObject, { - "metadata": function() { return missing_metadata; }, - "name": function() { return missing_name; }, - "settings": function() { return missing_settings; } + init: () => (missing_init), + metadata: () => (missing_metadata), + name: () => (missing_name), + settings: () => (missing_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js var build_module_more_namespaceObject = {}; __webpack_require__.r(build_module_more_namespaceObject); __webpack_require__.d(build_module_more_namespaceObject, { - "metadata": function() { return more_metadata; }, - "name": function() { return more_name; }, - "settings": function() { return more_settings; } + init: () => (more_init), + metadata: () => (more_metadata), + name: () => (more_name), + settings: () => (more_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js var build_module_navigation_namespaceObject = {}; __webpack_require__.r(build_module_navigation_namespaceObject); __webpack_require__.d(build_module_navigation_namespaceObject, { - "metadata": function() { return navigation_metadata; }, - "name": function() { return navigation_name; }, - "settings": function() { return navigation_settings; } + init: () => (navigation_init), + metadata: () => (navigation_metadata), + name: () => (navigation_name), + settings: () => (navigation_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js var navigation_link_namespaceObject = {}; __webpack_require__.r(navigation_link_namespaceObject); __webpack_require__.d(navigation_link_namespaceObject, { - "metadata": function() { return navigation_link_metadata; }, - "name": function() { return navigation_link_name; }, - "settings": function() { return navigation_link_settings; } + init: () => (navigation_link_init), + metadata: () => (navigation_link_metadata), + name: () => (navigation_link_name), + settings: () => (navigation_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js var navigation_submenu_namespaceObject = {}; __webpack_require__.r(navigation_submenu_namespaceObject); __webpack_require__.d(navigation_submenu_namespaceObject, { - "metadata": function() { return navigation_submenu_metadata; }, - "name": function() { return navigation_submenu_name; }, - "settings": function() { return navigation_submenu_settings; } + init: () => (navigation_submenu_init), + metadata: () => (navigation_submenu_metadata), + name: () => (navigation_submenu_name), + settings: () => (navigation_submenu_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js var nextpage_namespaceObject = {}; __webpack_require__.r(nextpage_namespaceObject); __webpack_require__.d(nextpage_namespaceObject, { - "metadata": function() { return nextpage_metadata; }, - "name": function() { return nextpage_name; }, - "settings": function() { return nextpage_settings; } + init: () => (nextpage_init), + metadata: () => (nextpage_metadata), + name: () => (nextpage_name), + settings: () => (nextpage_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js var pattern_namespaceObject = {}; __webpack_require__.r(pattern_namespaceObject); __webpack_require__.d(pattern_namespaceObject, { - "metadata": function() { return pattern_metadata; }, - "name": function() { return pattern_name; }, - "settings": function() { return pattern_settings; } + init: () => (pattern_init), + metadata: () => (pattern_metadata), + name: () => (pattern_name), + settings: () => (pattern_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js var page_list_namespaceObject = {}; __webpack_require__.r(page_list_namespaceObject); __webpack_require__.d(page_list_namespaceObject, { - "metadata": function() { return page_list_metadata; }, - "name": function() { return page_list_name; }, - "settings": function() { return page_list_settings; } + init: () => (page_list_init), + metadata: () => (page_list_metadata), + name: () => (page_list_name), + settings: () => (page_list_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js +var page_list_item_namespaceObject = {}; +__webpack_require__.r(page_list_item_namespaceObject); +__webpack_require__.d(page_list_item_namespaceObject, { + init: () => (page_list_item_init), + metadata: () => (page_list_item_metadata), + name: () => (page_list_item_name), + settings: () => (page_list_item_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js var build_module_paragraph_namespaceObject = {}; __webpack_require__.r(build_module_paragraph_namespaceObject); __webpack_require__.d(build_module_paragraph_namespaceObject, { - "metadata": function() { return paragraph_metadata; }, - "name": function() { return paragraph_name; }, - "settings": function() { return paragraph_settings; } + init: () => (paragraph_init), + metadata: () => (paragraph_metadata), + name: () => (paragraph_name), + settings: () => (paragraph_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js var build_module_post_author_namespaceObject = {}; __webpack_require__.r(build_module_post_author_namespaceObject); __webpack_require__.d(build_module_post_author_namespaceObject, { - "metadata": function() { return post_author_metadata; }, - "name": function() { return post_author_name; }, - "settings": function() { return post_author_settings; } + init: () => (post_author_init), + metadata: () => (post_author_metadata), + name: () => (post_author_name), + settings: () => (post_author_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js +var post_author_name_namespaceObject = {}; +__webpack_require__.r(post_author_name_namespaceObject); +__webpack_require__.d(post_author_name_namespaceObject, { + init: () => (post_author_name_init), + metadata: () => (post_author_name_metadata), + name: () => (post_author_name_name), + settings: () => (post_author_name_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js var post_author_biography_namespaceObject = {}; __webpack_require__.r(post_author_biography_namespaceObject); __webpack_require__.d(post_author_biography_namespaceObject, { - "metadata": function() { return post_author_biography_metadata; }, - "name": function() { return post_author_biography_name; }, - "settings": function() { return post_author_biography_settings; } -}); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js -var build_module_post_comments_namespaceObject = {}; -__webpack_require__.r(build_module_post_comments_namespaceObject); -__webpack_require__.d(build_module_post_comments_namespaceObject, { - "metadata": function() { return post_comments_metadata; }, - "name": function() { return post_comments_name; }, - "settings": function() { return post_comments_settings; } + init: () => (post_author_biography_init), + metadata: () => (post_author_biography_metadata), + name: () => (post_author_biography_name), + settings: () => (post_author_biography_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js +var post_comment_namespaceObject = {}; +__webpack_require__.r(post_comment_namespaceObject); +__webpack_require__.d(post_comment_namespaceObject, { + init: () => (post_comment_init), + metadata: () => (post_comment_metadata), + name: () => (post_comment_name), + settings: () => (post_comment_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js +var build_module_post_comments_count_namespaceObject = {}; +__webpack_require__.r(build_module_post_comments_count_namespaceObject); +__webpack_require__.d(build_module_post_comments_count_namespaceObject, { + init: () => (post_comments_count_init), + metadata: () => (post_comments_count_metadata), + name: () => (post_comments_count_name), + settings: () => (post_comments_count_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js var build_module_post_comments_form_namespaceObject = {}; __webpack_require__.r(build_module_post_comments_form_namespaceObject); __webpack_require__.d(build_module_post_comments_form_namespaceObject, { - "metadata": function() { return post_comments_form_metadata; }, - "name": function() { return post_comments_form_name; }, - "settings": function() { return post_comments_form_settings; } + init: () => (post_comments_form_init), + metadata: () => (post_comments_form_metadata), + name: () => (post_comments_form_name), + settings: () => (post_comments_form_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js +var post_comments_link_namespaceObject = {}; +__webpack_require__.r(post_comments_link_namespaceObject); +__webpack_require__.d(post_comments_link_namespaceObject, { + init: () => (post_comments_link_init), + metadata: () => (post_comments_link_metadata), + name: () => (post_comments_link_name), + settings: () => (post_comments_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js var build_module_post_content_namespaceObject = {}; __webpack_require__.r(build_module_post_content_namespaceObject); __webpack_require__.d(build_module_post_content_namespaceObject, { - "metadata": function() { return post_content_metadata; }, - "name": function() { return post_content_name; }, - "settings": function() { return post_content_settings; } + init: () => (post_content_init), + metadata: () => (post_content_metadata), + name: () => (post_content_name), + settings: () => (post_content_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js var build_module_post_date_namespaceObject = {}; __webpack_require__.r(build_module_post_date_namespaceObject); __webpack_require__.d(build_module_post_date_namespaceObject, { - "metadata": function() { return post_date_metadata; }, - "name": function() { return post_date_name; }, - "settings": function() { return post_date_settings; } + init: () => (post_date_init), + metadata: () => (post_date_metadata), + name: () => (post_date_name), + settings: () => (post_date_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js var build_module_post_excerpt_namespaceObject = {}; __webpack_require__.r(build_module_post_excerpt_namespaceObject); __webpack_require__.d(build_module_post_excerpt_namespaceObject, { - "metadata": function() { return post_excerpt_metadata; }, - "name": function() { return post_excerpt_name; }, - "settings": function() { return post_excerpt_settings; } + init: () => (post_excerpt_init), + metadata: () => (post_excerpt_metadata), + name: () => (post_excerpt_name), + settings: () => (post_excerpt_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js var build_module_post_featured_image_namespaceObject = {}; __webpack_require__.r(build_module_post_featured_image_namespaceObject); __webpack_require__.d(build_module_post_featured_image_namespaceObject, { - "metadata": function() { return post_featured_image_metadata; }, - "name": function() { return post_featured_image_name; }, - "settings": function() { return post_featured_image_settings; } + init: () => (post_featured_image_init), + metadata: () => (post_featured_image_metadata), + name: () => (post_featured_image_name), + settings: () => (post_featured_image_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js var post_navigation_link_namespaceObject = {}; __webpack_require__.r(post_navigation_link_namespaceObject); __webpack_require__.d(post_navigation_link_namespaceObject, { - "metadata": function() { return post_navigation_link_metadata; }, - "name": function() { return post_navigation_link_name; }, - "settings": function() { return post_navigation_link_settings; } + init: () => (post_navigation_link_init), + metadata: () => (post_navigation_link_metadata), + name: () => (post_navigation_link_name), + settings: () => (post_navigation_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js var post_template_namespaceObject = {}; __webpack_require__.r(post_template_namespaceObject); __webpack_require__.d(post_template_namespaceObject, { - "metadata": function() { return post_template_metadata; }, - "name": function() { return post_template_name; }, - "settings": function() { return post_template_settings; } + init: () => (post_template_init), + metadata: () => (post_template_metadata), + name: () => (post_template_name), + settings: () => (post_template_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js var build_module_post_terms_namespaceObject = {}; __webpack_require__.r(build_module_post_terms_namespaceObject); __webpack_require__.d(build_module_post_terms_namespaceObject, { - "metadata": function() { return post_terms_metadata; }, - "name": function() { return post_terms_name; }, - "settings": function() { return post_terms_settings; } + init: () => (post_terms_init), + metadata: () => (post_terms_metadata), + name: () => (post_terms_name), + settings: () => (post_terms_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js +var post_time_to_read_namespaceObject = {}; +__webpack_require__.r(post_time_to_read_namespaceObject); +__webpack_require__.d(post_time_to_read_namespaceObject, { + init: () => (post_time_to_read_init), + metadata: () => (post_time_to_read_metadata), + name: () => (post_time_to_read_name), + settings: () => (post_time_to_read_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js -var build_module_post_title_namespaceObject = {}; -__webpack_require__.r(build_module_post_title_namespaceObject); -__webpack_require__.d(build_module_post_title_namespaceObject, { - "metadata": function() { return post_title_metadata; }, - "name": function() { return post_title_name; }, - "settings": function() { return post_title_settings; } +var post_title_namespaceObject = {}; +__webpack_require__.r(post_title_namespaceObject); +__webpack_require__.d(post_title_namespaceObject, { + init: () => (post_title_init), + metadata: () => (post_title_metadata), + name: () => (post_title_name), + settings: () => (post_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js var build_module_preformatted_namespaceObject = {}; __webpack_require__.r(build_module_preformatted_namespaceObject); __webpack_require__.d(build_module_preformatted_namespaceObject, { - "metadata": function() { return preformatted_metadata; }, - "name": function() { return preformatted_name; }, - "settings": function() { return preformatted_settings; } + init: () => (preformatted_init), + metadata: () => (preformatted_metadata), + name: () => (preformatted_name), + settings: () => (preformatted_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js var build_module_pullquote_namespaceObject = {}; __webpack_require__.r(build_module_pullquote_namespaceObject); __webpack_require__.d(build_module_pullquote_namespaceObject, { - "metadata": function() { return pullquote_metadata; }, - "name": function() { return pullquote_name; }, - "settings": function() { return pullquote_settings; } + init: () => (pullquote_init), + metadata: () => (pullquote_metadata), + name: () => (pullquote_name), + settings: () => (pullquote_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js var query_namespaceObject = {}; __webpack_require__.r(query_namespaceObject); __webpack_require__.d(query_namespaceObject, { - "metadata": function() { return query_metadata; }, - "name": function() { return query_name; }, - "settings": function() { return query_settings; } + init: () => (query_init), + metadata: () => (query_metadata), + name: () => (query_name), + settings: () => (query_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js var query_no_results_namespaceObject = {}; __webpack_require__.r(query_no_results_namespaceObject); __webpack_require__.d(query_no_results_namespaceObject, { - "metadata": function() { return query_no_results_metadata; }, - "name": function() { return query_no_results_name; }, - "settings": function() { return query_no_results_settings; } + init: () => (query_no_results_init), + metadata: () => (query_no_results_metadata), + name: () => (query_no_results_name), + settings: () => (query_no_results_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js var build_module_query_pagination_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_namespaceObject); __webpack_require__.d(build_module_query_pagination_namespaceObject, { - "metadata": function() { return query_pagination_metadata; }, - "name": function() { return query_pagination_name; }, - "settings": function() { return query_pagination_settings; } + init: () => (query_pagination_init), + metadata: () => (query_pagination_metadata), + name: () => (query_pagination_name), + settings: () => (query_pagination_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js var build_module_query_pagination_next_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_next_namespaceObject); __webpack_require__.d(build_module_query_pagination_next_namespaceObject, { - "metadata": function() { return query_pagination_next_metadata; }, - "name": function() { return query_pagination_next_name; }, - "settings": function() { return query_pagination_next_settings; } + init: () => (query_pagination_next_init), + metadata: () => (query_pagination_next_metadata), + name: () => (query_pagination_next_name), + settings: () => (query_pagination_next_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js var build_module_query_pagination_numbers_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject); __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, { - "metadata": function() { return query_pagination_numbers_metadata; }, - "name": function() { return query_pagination_numbers_name; }, - "settings": function() { return query_pagination_numbers_settings; } + init: () => (query_pagination_numbers_init), + metadata: () => (query_pagination_numbers_metadata), + name: () => (query_pagination_numbers_name), + settings: () => (query_pagination_numbers_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js var build_module_query_pagination_previous_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_previous_namespaceObject); __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, { - "metadata": function() { return query_pagination_previous_metadata; }, - "name": function() { return query_pagination_previous_name; }, - "settings": function() { return query_pagination_previous_settings; } + init: () => (query_pagination_previous_init), + metadata: () => (query_pagination_previous_metadata), + name: () => (query_pagination_previous_name), + settings: () => (query_pagination_previous_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js -var build_module_query_title_namespaceObject = {}; -__webpack_require__.r(build_module_query_title_namespaceObject); -__webpack_require__.d(build_module_query_title_namespaceObject, { - "metadata": function() { return query_title_metadata; }, - "name": function() { return query_title_name; }, - "settings": function() { return query_title_settings; } +var query_title_namespaceObject = {}; +__webpack_require__.r(query_title_namespaceObject); +__webpack_require__.d(query_title_namespaceObject, { + init: () => (query_title_init), + metadata: () => (query_title_metadata), + name: () => (query_title_name), + settings: () => (query_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js var build_module_quote_namespaceObject = {}; __webpack_require__.r(build_module_quote_namespaceObject); __webpack_require__.d(build_module_quote_namespaceObject, { - "metadata": function() { return quote_metadata; }, - "name": function() { return quote_name; }, - "settings": function() { return quote_settings; }, - "settingsV1": function() { return quote_settingsV1; } + init: () => (quote_init), + metadata: () => (quote_metadata), + name: () => (quote_name), + settings: () => (quote_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js var block_namespaceObject = {}; __webpack_require__.r(block_namespaceObject); __webpack_require__.d(block_namespaceObject, { - "metadata": function() { return block_metadata; }, - "name": function() { return block_name; }, - "settings": function() { return block_settings; } + init: () => (block_init), + metadata: () => (block_metadata), + name: () => (block_name), + settings: () => (block_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js var read_more_namespaceObject = {}; __webpack_require__.r(read_more_namespaceObject); __webpack_require__.d(read_more_namespaceObject, { - "metadata": function() { return read_more_metadata; }, - "name": function() { return read_more_name; }, - "settings": function() { return read_more_settings; } + init: () => (read_more_init), + metadata: () => (read_more_metadata), + name: () => (read_more_name), + settings: () => (read_more_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js var build_module_rss_namespaceObject = {}; __webpack_require__.r(build_module_rss_namespaceObject); __webpack_require__.d(build_module_rss_namespaceObject, { - "metadata": function() { return rss_metadata; }, - "name": function() { return rss_name; }, - "settings": function() { return rss_settings; } + init: () => (rss_init), + metadata: () => (rss_metadata), + name: () => (rss_name), + settings: () => (rss_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js var build_module_search_namespaceObject = {}; __webpack_require__.r(build_module_search_namespaceObject); __webpack_require__.d(build_module_search_namespaceObject, { - "metadata": function() { return search_metadata; }, - "name": function() { return search_name; }, - "settings": function() { return search_settings; } + init: () => (search_init), + metadata: () => (search_metadata), + name: () => (search_name), + settings: () => (search_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js var build_module_separator_namespaceObject = {}; __webpack_require__.r(build_module_separator_namespaceObject); __webpack_require__.d(build_module_separator_namespaceObject, { - "metadata": function() { return separator_metadata; }, - "name": function() { return separator_name; }, - "settings": function() { return separator_settings; } + init: () => (separator_init), + metadata: () => (separator_metadata), + name: () => (separator_name), + settings: () => (separator_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js var build_module_shortcode_namespaceObject = {}; __webpack_require__.r(build_module_shortcode_namespaceObject); __webpack_require__.d(build_module_shortcode_namespaceObject, { - "metadata": function() { return shortcode_metadata; }, - "name": function() { return shortcode_name; }, - "settings": function() { return shortcode_settings; } + init: () => (shortcode_init), + metadata: () => (shortcode_metadata), + name: () => (shortcode_name), + settings: () => (shortcode_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js var build_module_site_logo_namespaceObject = {}; __webpack_require__.r(build_module_site_logo_namespaceObject); __webpack_require__.d(build_module_site_logo_namespaceObject, { - "metadata": function() { return site_logo_metadata; }, - "name": function() { return site_logo_name; }, - "settings": function() { return site_logo_settings; } + init: () => (site_logo_init), + metadata: () => (site_logo_metadata), + name: () => (site_logo_name), + settings: () => (site_logo_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js var site_tagline_namespaceObject = {}; __webpack_require__.r(site_tagline_namespaceObject); __webpack_require__.d(site_tagline_namespaceObject, { - "metadata": function() { return site_tagline_metadata; }, - "name": function() { return site_tagline_name; }, - "settings": function() { return site_tagline_settings; } + init: () => (site_tagline_init), + metadata: () => (site_tagline_metadata), + name: () => (site_tagline_name), + settings: () => (site_tagline_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js var site_title_namespaceObject = {}; __webpack_require__.r(site_title_namespaceObject); __webpack_require__.d(site_title_namespaceObject, { - "metadata": function() { return site_title_metadata; }, - "name": function() { return site_title_name; }, - "settings": function() { return site_title_settings; } + init: () => (site_title_init), + metadata: () => (site_title_metadata), + name: () => (site_title_name), + settings: () => (site_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js var social_link_namespaceObject = {}; __webpack_require__.r(social_link_namespaceObject); __webpack_require__.d(social_link_namespaceObject, { - "metadata": function() { return social_link_metadata; }, - "name": function() { return social_link_name; }, - "settings": function() { return social_link_settings; } + init: () => (social_link_init), + metadata: () => (social_link_metadata), + name: () => (social_link_name), + settings: () => (social_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js var social_links_namespaceObject = {}; __webpack_require__.r(social_links_namespaceObject); __webpack_require__.d(social_links_namespaceObject, { - "metadata": function() { return social_links_metadata; }, - "name": function() { return social_links_name; }, - "settings": function() { return social_links_settings; } + init: () => (social_links_init), + metadata: () => (social_links_metadata), + name: () => (social_links_name), + settings: () => (social_links_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js var spacer_namespaceObject = {}; __webpack_require__.r(spacer_namespaceObject); __webpack_require__.d(spacer_namespaceObject, { - "metadata": function() { return spacer_metadata; }, - "name": function() { return spacer_name; }, - "settings": function() { return spacer_settings; } + init: () => (spacer_init), + metadata: () => (spacer_metadata), + name: () => (spacer_name), + settings: () => (spacer_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js var build_module_table_namespaceObject = {}; __webpack_require__.r(build_module_table_namespaceObject); __webpack_require__.d(build_module_table_namespaceObject, { - "metadata": function() { return table_metadata; }, - "name": function() { return table_name; }, - "settings": function() { return table_settings; } + init: () => (table_init), + metadata: () => (table_metadata), + name: () => (table_name), + settings: () => (table_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js +var build_module_table_of_contents_namespaceObject = {}; +__webpack_require__.r(build_module_table_of_contents_namespaceObject); +__webpack_require__.d(build_module_table_of_contents_namespaceObject, { + init: () => (table_of_contents_init), + metadata: () => (table_of_contents_metadata), + name: () => (table_of_contents_name), + settings: () => (table_of_contents_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js var tag_cloud_namespaceObject = {}; __webpack_require__.r(tag_cloud_namespaceObject); __webpack_require__.d(tag_cloud_namespaceObject, { - "metadata": function() { return tag_cloud_metadata; }, - "name": function() { return tag_cloud_name; }, - "settings": function() { return tag_cloud_settings; } + init: () => (tag_cloud_init), + metadata: () => (tag_cloud_metadata), + name: () => (tag_cloud_name), + settings: () => (tag_cloud_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js var template_part_namespaceObject = {}; __webpack_require__.r(template_part_namespaceObject); __webpack_require__.d(template_part_namespaceObject, { - "metadata": function() { return template_part_metadata; }, - "name": function() { return template_part_name; }, - "settings": function() { return template_part_settings; } + init: () => (template_part_init), + metadata: () => (template_part_metadata), + name: () => (template_part_name), + settings: () => (template_part_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js var build_module_term_description_namespaceObject = {}; __webpack_require__.r(build_module_term_description_namespaceObject); __webpack_require__.d(build_module_term_description_namespaceObject, { - "metadata": function() { return term_description_metadata; }, - "name": function() { return term_description_name; }, - "settings": function() { return term_description_settings; } + init: () => (term_description_init), + metadata: () => (term_description_metadata), + name: () => (term_description_name), + settings: () => (term_description_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js var text_columns_namespaceObject = {}; __webpack_require__.r(text_columns_namespaceObject); __webpack_require__.d(text_columns_namespaceObject, { - "metadata": function() { return text_columns_metadata; }, - "name": function() { return text_columns_name; }, - "settings": function() { return text_columns_settings; } + init: () => (text_columns_init), + metadata: () => (text_columns_metadata), + name: () => (text_columns_name), + settings: () => (text_columns_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js var build_module_verse_namespaceObject = {}; __webpack_require__.r(build_module_verse_namespaceObject); __webpack_require__.d(build_module_verse_namespaceObject, { - "metadata": function() { return verse_metadata; }, - "name": function() { return verse_name; }, - "settings": function() { return verse_settings; } + init: () => (verse_init), + metadata: () => (verse_metadata), + name: () => (verse_name), + settings: () => (verse_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js var build_module_video_namespaceObject = {}; __webpack_require__.r(build_module_video_namespaceObject); __webpack_require__.d(build_module_video_namespaceObject, { - "metadata": function() { return video_metadata; }, - "name": function() { return video_name; }, - "settings": function() { return video_settings; } + init: () => (video_init), + metadata: () => (video_metadata), + name: () => (video_name), + settings: () => (video_settings) +}); + +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js +var footnotes_namespaceObject = {}; +__webpack_require__.r(footnotes_namespaceObject); +__webpack_require__.d(footnotes_namespaceObject, { + init: () => (footnotes_init), + metadata: () => (footnotes_metadata), + name: () => (footnotes_name), + settings: () => (footnotes_settings) }); ;// CONCATENATED MODULE: external ["wp","blocks"] -var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; -;// CONCATENATED MODULE: external ["wp","element"] -var external_wp_element_namespaceObject = window["wp"]["element"]; +const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// CONCATENATED MODULE: external ["wp","primitives"] -var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +;// CONCATENATED MODULE: external "ReactJSXRuntime" +const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js - - -/** - * WordPress dependencies - */ - -const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z" -})); -/* harmony default export */ var library_archive = (archive); +/** + * WordPress dependencies + */ + + +const archive = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" + }) +}); +/* harmony default export */ const library_archive = (archive); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/init-block.js +/** + * WordPress dependencies + */ + + +/** + * Function to register an individual block. + * + * @param {Object} block The block to be registered. + * + * @return {WPBlockType | undefined} The block, if it has been successfully registered; + * otherwise `undefined`. + */ +function initBlock(block) { + if (!block) { + return; + } + const { + metadata, + settings, + name + } = block; + return (0,external_wp_blocks_namespaceObject.registerBlockType)({ + name, + ...metadata + }, settings); +} ;// CONCATENATED MODULE: external ["wp","components"] -var external_wp_components_namespaceObject = window["wp"]["components"]; +const external_wp_components_namespaceObject = window["wp"]["components"]; ;// CONCATENATED MODULE: external ["wp","i18n"] -var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","blockEditor"] -var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; +const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// CONCATENATED MODULE: external ["wp","serverSideRender"] -var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; +const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js - - -/** - * WordPress dependencies - */ - - - - -function ArchivesEdit(_ref) { - let { - attributes, - setAttributes - } = _ref; - const { +/** + * WordPress dependencies + */ + + + + + + + +function ArchivesEdit({ + attributes, + setAttributes +}) { + const { + showLabel, showPostCounts, displayAsDropdown, type } = attributes; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Archives settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), - checked: displayAsDropdown, - onChange: () => setAttributes({ - displayAsDropdown: !displayAsDropdown - }) - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), - checked: showPostCounts, - onChange: () => setAttributes({ - showPostCounts: !showPostCounts - }) - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Group by:'), - options: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Year'), - value: 'yearly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Month'), - value: 'monthly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Week'), - value: 'weekly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Day'), - value: 'daily' - }], - value: type, - onChange: value => setAttributes({ - type: value - }) - }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), { - block: "core/archives", - attributes: attributes - })))); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), + checked: displayAsDropdown, + onChange: () => setAttributes({ + displayAsDropdown: !displayAsDropdown + }) + }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show label'), + checked: showLabel, + onChange: () => setAttributes({ + showLabel: !showLabel + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), + checked: showPostCounts, + onChange: () => setAttributes({ + showPostCounts: !showPostCounts + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Group by:'), + options: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Year'), + value: 'yearly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Month'), + value: 'monthly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Week'), + value: 'weekly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Day'), + value: 'daily' + }], + value: type, + onChange: value => setAttributes({ + type: value + }) + })] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { + block: "core/archives", + skipBlockSupportAttributes: true, + attributes: attributes + }) + }) + })] + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js @@ -1768,13 +1831,14 @@ * WordPress dependencies */ + /** * Internal dependencies */ const metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/archives", title: "Archives", category: "widgets", @@ -1785,6 +1849,10 @@ type: "boolean", "default": false }, + showLabel: { + type: "boolean", + "default": true + }, showPostCounts: { type: "boolean", "default": false @@ -1796,7 +1864,31 @@ }, supports: { align: true, - html: false + html: false, + spacing: { + margin: true, + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false + } + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + interactivity: { + clientNavigation: true + } }, editorStyle: "wp-block-archives-editor" }; @@ -1810,50 +1902,37 @@ example: {}, edit: ArchivesEdit }; +const init = () => initBlock({ + name: archives_name, + metadata, + settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js - - -/** - * WordPress dependencies - */ - -const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", - clipRule: "evenodd" -})); -/* harmony default export */ var comment_author_avatar = (commentAuthorAvatar); - -;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - return _extends.apply(this, arguments); -} -// EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__(4403); -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); +/** + * WordPress dependencies + */ + + +const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", + clipRule: "evenodd" + }) +}); +/* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); + +;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs +function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t { - var _getEditedEntityRecor; - const { getEditedEntityRecord, getUser } = select(external_wp_coreData_namespaceObject.store); - if (userId) { return { authorDetails: getUser(userId) }; } - - const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author; - + const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; return { authorDetails: _authorId ? getUser(_authorId) : null }; }, [postType, postId, userId]); - const avatarUrls = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; - const sizes = authorDetails && authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; + const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; + const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; const { minSize, maxSize @@ -1949,17 +2019,19 @@ src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, minSize, maxSize, - alt: authorDetails ? // translators: %s is the Author name. - (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') - }; -} - + alt: authorDetails ? + // translators: %s is the Author name. + (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails?.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') + }; +} + +;// CONCATENATED MODULE: external ["wp","element"] +const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js - - -/** - * WordPress dependencies - */ +/** + * WordPress dependencies + */ + @@ -1971,12 +2043,10 @@ _fields: 'id,name', context: 'view' }; - -function UserControl(_ref) { - let { - value, - onChange - } = _ref; +function UserControl({ + value, + onChange +}) { const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)(); const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { const { @@ -1984,18 +2054,17 @@ } = select(external_wp_coreData_namespaceObject.store); return getUsers(AUTHORS_QUERY); }, []); - if (!authorsList) { return null; } - const options = authorsList.map(author => { return { label: author.name, value: author.id }; }); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { + __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('User'), help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'), value: value, @@ -2004,122 +2073,120 @@ onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase()))) }); } - -/* harmony default export */ var user_control = (UserControl); +/* harmony default export */ const user_control = (UserControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const AvatarInspectorControls = _ref => { - let { - setAttributes, - avatar, - attributes, - selectUser - } = _ref; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Image size'), - onChange: newSize => setAttributes({ - size: newSize - }), - min: avatar.minSize, - max: avatar.maxSize, - initialPosition: attributes === null || attributes === void 0 ? void 0 : attributes.size, - value: attributes === null || attributes === void 0 ? void 0 : attributes.size - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'), - onChange: () => setAttributes({ - isLink: !attributes.isLink - }), - checked: attributes.isLink - }), attributes.isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), - onChange: value => setAttributes({ - linkTarget: value ? '_blank' : '_self' - }), - checked: attributes.linkTarget === '_blank' - }), selectUser && (0,external_wp_element_namespaceObject.createElement)(user_control, { - value: attributes === null || attributes === void 0 ? void 0 : attributes.userId, - onChange: value => { - setAttributes({ - userId: value - }); - } - }))); -}; - -const ResizableAvatar = _ref2 => { - let { - setAttributes, - attributes, - avatar, - blockProps, - isSelected - } = _ref2; +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + +const AvatarInspectorControls = ({ + setAttributes, + avatar, + attributes, + selectUser +}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Image size'), + onChange: newSize => setAttributes({ + size: newSize + }), + min: avatar.minSize, + max: avatar.maxSize, + initialPosition: attributes?.size, + value: attributes?.size + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'), + onChange: () => setAttributes({ + isLink: !attributes.isLink + }), + checked: attributes.isLink + }), attributes.isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), + onChange: value => setAttributes({ + linkTarget: value ? '_blank' : '_self' + }), + checked: attributes.linkTarget === '_blank' + }), selectUser && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(user_control, { + value: attributes?.userId, + onChange: value => { + setAttributes({ + userId: value + }); + } + })] + }) +}); +const ResizableAvatar = ({ + setAttributes, + attributes, + avatar, + blockProps, + isSelected +}) => { const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); - const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar === null || avatar === void 0 ? void 0 : avatar.src, ['s']), { - s: (attributes === null || attributes === void 0 ? void 0 : attributes.size) * 2 - }); - return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { - size: { - width: attributes.size, - height: attributes.size - }, - showHandle: isSelected, - onResizeStop: (event, direction, elt, delta) => { - setAttributes({ - size: parseInt(attributes.size + (delta.height || delta.width), 10) - }); - }, - lockAspectRatio: true, - enable: { - top: false, - right: !(0,external_wp_i18n_namespaceObject.isRTL)(), - bottom: true, - left: (0,external_wp_i18n_namespaceObject.isRTL)() - }, - minWidth: avatar.minSize, - maxWidth: avatar.maxSize - }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({ - src: doubledSizedSrc, - alt: avatar.alt - }, borderProps, { - className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className), - style: { ...borderProps.style // Border radius, width and style. - - } - })))); -}; - -const CommentEdit = _ref3 => { - let { - attributes, - context, - setAttributes, - isSelected - } = _ref3; + const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar?.src, ['s']), { + s: attributes?.size * 2 + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { + size: { + width: attributes.size, + height: attributes.size + }, + showHandle: isSelected, + onResizeStop: (event, direction, elt, delta) => { + setAttributes({ + size: parseInt(attributes.size + (delta.height || delta.width), 10) + }); + }, + lockAspectRatio: true, + enable: { + top: false, + right: !(0,external_wp_i18n_namespaceObject.isRTL)(), + bottom: true, + left: (0,external_wp_i18n_namespaceObject.isRTL)() + }, + minWidth: avatar.minSize, + maxWidth: avatar.maxSize, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + src: doubledSizedSrc, + alt: avatar.alt, + className: dist_clsx('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className), + style: borderProps.style + }) + }) + }); +}; +const CommentEdit = ({ + attributes, + context, + setAttributes, + isSelected +}) => { const { commentId } = context; @@ -2127,80 +2194,84 @@ const avatar = useCommentAvatar({ commentId }); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, { - avatar: avatar, - setAttributes: setAttributes, - attributes: attributes, - selectUser: false - }), attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", { - href: "#avatar-pseudo-link", - className: "wp-block-avatar__link", - onClick: event => event.preventDefault() - }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, { - attributes: attributes, - avatar: avatar, - blockProps: blockProps, - isSelected: isSelected, - setAttributes: setAttributes - })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, { - attributes: attributes, - avatar: avatar, - blockProps: blockProps, - isSelected: isSelected, - setAttributes: setAttributes - })); -}; - -const UserEdit = _ref4 => { - let { - attributes, - context, - setAttributes, - isSelected - } = _ref4; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { + avatar: avatar, + setAttributes: setAttributes, + attributes: attributes, + selectUser: false + }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + href: "#avatar-pseudo-link", + className: "wp-block-avatar__link", + onClick: event => event.preventDefault(), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { + attributes: attributes, + avatar: avatar, + blockProps: blockProps, + isSelected: isSelected, + setAttributes: setAttributes + }) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { + attributes: attributes, + avatar: avatar, + blockProps: blockProps, + isSelected: isSelected, + setAttributes: setAttributes + })] + }); +}; +const UserEdit = ({ + attributes, + context, + setAttributes, + isSelected +}) => { const { postId, postType } = context; const avatar = useUserAvatar({ - userId: attributes === null || attributes === void 0 ? void 0 : attributes.userId, + userId: attributes?.userId, postId, postType }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, { - selectUser: true, - attributes: attributes, - avatar: avatar, - setAttributes: setAttributes - }), (0,external_wp_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", { - href: "#avatar-pseudo-link", - className: "wp-block-avatar__link", - onClick: event => event.preventDefault() - }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, { - attributes: attributes, - avatar: avatar, - blockProps: blockProps, - isSelected: isSelected, - setAttributes: setAttributes - })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, { - attributes: attributes, - avatar: avatar, - blockProps: blockProps, - isSelected: isSelected, - setAttributes: setAttributes - }))); -}; - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { + selectUser: true, + attributes: attributes, + avatar: avatar, + setAttributes: setAttributes + }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + href: "#avatar-pseudo-link", + className: "wp-block-avatar__link", + onClick: event => event.preventDefault(), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { + attributes: attributes, + avatar: avatar, + blockProps: blockProps, + isSelected: isSelected, + setAttributes: setAttributes + }) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { + attributes: attributes, + avatar: avatar, + blockProps: blockProps, + isSelected: isSelected, + setAttributes: setAttributes + })] + }); +}; function Edit(props) { - var _props$context, _props$context2; - // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`). - if (props !== null && props !== void 0 && (_props$context = props.context) !== null && _props$context !== void 0 && _props$context.commentId || (props === null || props === void 0 ? void 0 : (_props$context2 = props.context) === null || _props$context2 === void 0 ? void 0 : _props$context2.commentId) === null) { - return (0,external_wp_element_namespaceObject.createElement)(CommentEdit, props); - } - - return (0,external_wp_element_namespaceObject.createElement)(UserEdit, props); + if (props?.context?.commentId || props?.context?.commentId === null) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentEdit, { + ...props + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UserEdit, { + ...props + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js @@ -2208,17 +2279,18 @@ * WordPress dependencies */ + /** * Internal dependencies */ const avatar_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/avatar", title: "Avatar", category: "theme", - description: "Add a user's avatar.", + description: "Add a user\u2019s avatar.", textdomain: "default", attributes: { userId: { @@ -2243,7 +2315,12 @@ align: true, alignWide: false, spacing: { - margin: true + margin: true, + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false + } }, __experimentalBorder: { __experimentalSkipSerialization: true, @@ -2259,9 +2336,15 @@ text: false, background: false, __experimentalDuotone: "img" - } - }, - editorStyle: "wp-block-avatar", + }, + interactivity: { + clientNavigation: true + } + }, + selectors: { + border: ".wp-block-avatar img" + }, + editorStyle: "wp-block-avatar-editor", style: "wp-block-avatar" }; @@ -2273,30 +2356,35 @@ icon: comment_author_avatar, edit: Edit }; +const avatar_init = () => initBlock({ + name: avatar_name, + metadata: avatar_metadata, + settings: avatar_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js - - -/** - * WordPress dependencies - */ - -const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" -})); -/* harmony default export */ var library_audio = (audio); +/** + * WordPress dependencies + */ + + +const audio = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" + }) +}); +/* harmony default export */ const library_audio = (audio); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js - - -/** - * WordPress dependencies - */ - -/* harmony default export */ var deprecated = ([{ +/** + * WordPress dependencies + */ + + + +/* harmony default export */ const deprecated = ([{ attributes: { src: { type: 'string', @@ -2334,11 +2422,9 @@ supports: { align: true }, - - save(_ref) { - let { - attributes - } = _ref; + save({ + attributes + }) { const { autoplay, caption, @@ -2346,24 +2432,190 @@ preload, src } = attributes; - return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", { - controls: "controls", - src: src, - autoPlay: autoplay, - loop: loop, - preload: preload - }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "figcaption", - value: caption - })); - } - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { + controls: "controls", + src: src, + autoPlay: autoplay, + loop: loop, + preload: preload + }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "figcaption", + value: caption + })] + }); + } }]); ;// CONCATENATED MODULE: external ["wp","blob"] -var external_wp_blob_namespaceObject = window["wp"]["blob"]; +const external_wp_blob_namespaceObject = window["wp"]["blob"]; +;// CONCATENATED MODULE: external ["wp","notices"] +const external_wp_notices_namespaceObject = window["wp"]["notices"]; +;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js +/** + * Memize options object. + * + * @typedef MemizeOptions + * + * @property {number} [maxSize] Maximum size of the cache. + */ + +/** + * Internal cache entry. + * + * @typedef MemizeCacheNode + * + * @property {?MemizeCacheNode|undefined} [prev] Previous node. + * @property {?MemizeCacheNode|undefined} [next] Next node. + * @property {Array<*>} args Function arguments for cache + * entry. + * @property {*} val Function result. + */ + +/** + * Properties of the enhanced function for controlling cache. + * + * @typedef MemizeMemoizedFunction + * + * @property {()=>void} clear Clear the cache. + */ + +/** + * Accepts a function to be memoized, and returns a new memoized function, with + * optional options. + * + * @template {(...args: any[]) => any} F + * + * @param {F} fn Function to memoize. + * @param {MemizeOptions} [options] Options object. + * + * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function. + */ +function memize(fn, options) { + var size = 0; + + /** @type {?MemizeCacheNode|undefined} */ + var head; + + /** @type {?MemizeCacheNode|undefined} */ + var tail; + + options = options || {}; + + function memoized(/* ...args */) { + var node = head, + len = arguments.length, + args, + i; + + searchCache: while (node) { + // Perform a shallow equality test to confirm that whether the node + // under test is a candidate for the arguments passed. Two arrays + // are shallowly equal if their length matches and each entry is + // strictly equal between the two sets. Avoid abstracting to a + // function which could incur an arguments leaking deoptimization. + + // Check whether node arguments match arguments length + if (node.args.length !== arguments.length) { + node = node.next; + continue; + } + + // Check whether node arguments match arguments values + for (i = 0; i < len; i++) { + if (node.args[i] !== arguments[i]) { + node = node.next; + continue searchCache; + } + } + + // At this point we can assume we've found a match + + // Surface matched node to head if not already + if (node !== head) { + // As tail, shift to previous. Must only shift if not also + // head, since if both head and tail, there is no previous. + if (node === tail) { + tail = node.prev; + } + + // Adjust siblings to point to each other. If node was tail, + // this also handles new tail's empty `next` assignment. + /** @type {MemizeCacheNode} */ (node.prev).next = node.next; + if (node.next) { + node.next.prev = node.prev; + } + + node.next = head; + node.prev = null; + /** @type {MemizeCacheNode} */ (head).prev = node; + head = node; + } + + // Return immediately + return node.val; + } + + // No cached value found. Continue to insertion phase: + + // Create a copy of arguments (avoid leaking deoptimization) + args = new Array(len); + for (i = 0; i < len; i++) { + args[i] = arguments[i]; + } + + node = { + args: args, + + // Generate the result from original function + val: fn.apply(null, args), + }; + + // Don't need to check whether node is already head, since it would + // have been returned above already if it was + + // Shift existing head down list + if (head) { + head.prev = node; + node.next = head; + } else { + // If no head, follows that there's no tail (at initial or reset) + tail = node; + } + + // Trim tail if we're reached max size and are pending cache insertion + if (size === /** @type {MemizeOptions} */ (options).maxSize) { + tail = /** @type {MemizeCacheNode} */ (tail).prev; + /** @type {MemizeCacheNode} */ (tail).next = null; + } else { + size++; + } + + head = node; + + return node.val; + } + + memoized.clear = function () { + head = null; + tail = null; + size = 0; + }; + + // Ignore reason: There's not a clear solution to create an intersection of + // the function with additional properties, where the goal is to retain the + // function signature of the incoming argument and add control properties + // on the return value. + + // @ts-ignore + return memoized; +} + + + ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js -const ASPECT_RATIOS = [// Common video resolutions. +const ASPECT_RATIOS = [ +// Common video resolutions. { ratio: '2.33', className: 'wp-embed-aspect-21-9' @@ -2376,7 +2628,8 @@ }, { ratio: '1.33', className: 'wp-embed-aspect-4-3' -}, // Vertical video and instagram square video support. +}, +// Vertical video and instagram square video support. { ratio: '1.00', className: 'wp-embed-aspect-1-1' @@ -2389,41 +2642,38 @@ }]; const WP_EMBED_TYPE = 'wp-embed'; -;// CONCATENATED MODULE: external "lodash" -var external_lodash_namespaceObject = window["lodash"]; -// EXTERNAL MODULE: ./node_modules/classnames/dedupe.js -var dedupe = __webpack_require__(3827); -var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe); -// EXTERNAL MODULE: ./node_modules/memize/index.js -var memize = __webpack_require__(9756); -var memize_default = /*#__PURE__*/__webpack_require__.n(memize); +;// CONCATENATED MODULE: external ["wp","privateApis"] +const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/lock-unlock.js +/** + * WordPress dependencies + */ + +const { + lock, + unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library'); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js - - -/** - * Internal dependencies - */ - -/** - * External dependencies - */ - - - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ const util_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", @@ -2431,18 +2681,22 @@ textdomain: "default", attributes: { url: { - type: "string" + type: "string", + __experimentalRole: "content" }, caption: { - type: "string", - source: "html", - selector: "figcaption" + type: "rich-text", + source: "rich-text", + selector: "figcaption", + __experimentalRole: "content" }, type: { - type: "string" + type: "string", + __experimentalRole: "content" }, providerNameSlug: { - type: "string" + type: "string", + __experimentalRole: "content" }, allowResponsive: { type: "boolean", @@ -2450,22 +2704,37 @@ }, responsive: { type: "boolean", - "default": false + "default": false, + __experimentalRole: "content" }, previewable: { type: "boolean", - "default": true - } - }, - supports: { - align: true + "default": true, + __experimentalRole: "content" + } + }, + supports: { + align: true, + spacing: { + margin: true + }, + interactivity: { + clientNavigation: true + } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; + + + const { name: DEFAULT_EMBED_BLOCK } = util_metadata; +const { + kebabCase +} = unlock(external_wp_components_namespaceObject.privateApis); + /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ /** @@ -2474,17 +2743,10 @@ * @param {string} provider The embed block's provider * @return {WPBlockVariation} The embed block's information */ - -const getEmbedInfoByProvider = provider => { - var _getBlockVariations; - - return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => { - let { - name - } = _ref; - return name === provider; - }); -}; +const getEmbedInfoByProvider = provider => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ + name +}) => name === provider); + /** * Returns true if any of the regular expressions match the URL. * @@ -2492,11 +2754,8 @@ * @param {Array} patterns The list of regular expressions to test agains. * @return {boolean} True if any of the regular expressions match the URL. */ - -const matchesPatterns = function (url) { - let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - return patterns.some(pattern => url.match(pattern)); -}; +const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern)); + /** * Finds the block variation that should be used for the URL, * based on the provided URL and the variation's patterns. @@ -2504,29 +2763,26 @@ * @param {string} url The URL to test. * @return {WPBlockVariation} The block variation that should be used for this URL */ - -const findMoreSuitableBlock = url => { - var _getBlockVariations2; - - return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => { - let { - patterns - } = _ref2; - return matchesPatterns(url, patterns); - }); -}; +const findMoreSuitableBlock = url => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ + patterns +}) => matchesPatterns(url, patterns)); const isFromWordPress = html => html && html.includes('class="wp-embedded-content"'); const getPhotoHtml = photo => { + // If full image url not found use thumbnail. + const imageUrl = photo.url || photo.thumbnail_url; + // 100% width for the preview so it fits nicely into the document, some "thumbnails" are - // actually the full size photo. If thumbnails not found, use full image. - const imageUrl = photo.thumbnail_url || photo.url; - const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", { - src: imageUrl, - alt: photo.title, - width: "100%" - })); + // actually the full size photo. + const photoPreview = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + src: imageUrl, + alt: photo.title, + width: "100%" + }) + }); return (0,external_wp_element_namespaceObject.renderToString)(photoPreview); }; + /** * Creates a more suitable embed block based on the passed in props * and attributes generated from an embed block's preview. @@ -2541,11 +2797,7 @@ * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. * @return {Object|undefined} A more suitable embed block if one exists. */ - -const createUpgradedEmbedBlock = function (props) { - var _getBlockVariations3; - - let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { const { preview, attributes = {} @@ -2556,15 +2808,17 @@ type, ...restAttributes } = attributes; - if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return; - const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns, + if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) { + return; + } + const matchedBlock = findMoreSuitableBlock(url); + + // WordPress blocks can work on multiple sites, and so don't have patterns, // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. - - const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found + const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; + // If current block is not WordPress and a more suitable block found // that is different from the current one, create the new matched block. - const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); - if (shouldCreateNewBlock) { return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, @@ -2572,19 +2826,16 @@ ...matchedBlock.attributes }); } - - const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => { - let { - name - } = _ref3; - return name === 'wordpress'; - }); // We can't match the URL for WordPress embeds, we have to check the HTML instead. - + const wpVariation = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ + name + }) => name === 'wordpress'); + + // We can't match the URL for WordPress embeds, we have to check the HTML instead. if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { return; - } // This is not the WordPress embed block so transform it into one. - - + } + + // This is not the WordPress embed block so transform it into one. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, ...wpVariation.attributes, @@ -2598,6 +2849,22 @@ ...attributesFromPreview }); }; + +/** + * Determine if the block already has an aspect ratio class applied. + * + * @param {string} existingClassNames Existing block classes. + * @return {boolean} True or false if the classnames contain an aspect ratio class. + */ +const hasAspectRatioClass = existingClassNames => { + if (!existingClassNames) { + return false; + } + return ASPECT_RATIOS.some(({ + className + }) => existingClassNames.includes(className)); +}; + /** * Removes all previously set aspect ratio related classes and return the rest * existing class names. @@ -2605,26 +2872,26 @@ * @param {string} existingClassNames Any existing class names. * @return {string} The class names without any aspect ratio related class. */ - const removeAspectRatioClasses = existingClassNames => { if (!existingClassNames) { // Avoids extraneous work and also, by returning the same value as // received, ensures the post is not dirtied by a change of the block - // attribute from `undefined` to an emtpy string. + // attribute from `undefined` to an empty string. return existingClassNames; } - - const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => { - let { - className - } = _ref4; - accumulator[className] = false; + const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, { + className + }) => { + accumulator.push(className); return accumulator; - }, { - 'wp-has-aspect-ratio': false - }); - return dedupe_default()(existingClassNames, aspectRatioClassNames); -}; + }, ['wp-has-aspect-ratio']); + let outputClassNames = existingClassNames; + for (const className of aspectRatioClassNames) { + outputClassNames = outputClassNames.replace(className, ''); + } + return outputClassNames.trim(); +}; + /** * Returns class names with any relevant responsive aspect ratio names. * @@ -2633,42 +2900,36 @@ * @param {boolean} allowResponsive If the responsive class names should be added, or removed. * @return {string} Deduped class names. */ - -function getClassNames(html, existingClassNames) { - let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - +function getClassNames(html, existingClassNames, allowResponsive = true) { if (!allowResponsive) { return removeAspectRatioClasses(existingClassNames); } - const previewDocument = document.implementation.createHTMLDocument(''); previewDocument.body.innerHTML = html; - const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block. - + const iframe = previewDocument.body.querySelector('iframe'); + + // If we have a fixed aspect iframe, and it's a responsive embed block. if (iframe && iframe.height && iframe.width) { - const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it. - + const aspectRatio = (iframe.width / iframe.height).toFixed(2); + // Given the actual aspect ratio, find the widest ratio to support it. for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { const potentialRatio = ASPECT_RATIOS[ratioIndex]; - if (aspectRatio >= potentialRatio.ratio) { // Evaluate the difference between actual aspect ratio and closest match. // If the difference is too big, do not scale the embed according to aspect ratio. const ratioDiff = aspectRatio - potentialRatio.ratio; - if (ratioDiff > 0.1) { // No close aspect ratio match found. return removeAspectRatioClasses(existingClassNames); - } // Close aspect ratio match found. - - - return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); - } - } - } - + } + // Close aspect ratio match found. + return dist_clsx(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); + } + } + } return existingClassNames; } + /** * Fallback behaviour for unembeddable URLs. * Creates a paragraph block containing a link to the URL, and calls `onReplace`. @@ -2676,15 +2937,16 @@ * @param {string} url The URL that could not be embedded. * @param {Function} onReplace Function to call with the created fallback block. */ - function fallback(url, onReplace) { - const link = (0,external_wp_element_namespaceObject.createElement)("a", { - href: url - }, url); + const link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + href: url, + children: url + }); onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: (0,external_wp_element_namespaceObject.renderToString)(link) })); } + /*** * Gets block attributes based on the preview and responsive state. * @@ -2695,122 +2957,326 @@ * @param {boolean} allowResponsive Apply responsive classes to fixed size content. * @return {Object} Attributes and values. */ - -const getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) { - let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; - +const getAttributesFromPreview = memize((preview, title, currentClassNames, isResponsive, allowResponsive = true) => { if (!preview) { return {}; } - - const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'. - + const attributes = {}; + // Some plugins only return HTML with no type info, so default this to 'rich'. let { type = 'rich' - } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title, + } = preview; + // If we got a provider name from the API, use it for the slug, otherwise we use the title, // because not all embed code gives us a provider name. - const { html, provider_name: providerName } = preview; - const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase()); - + const providerNameSlug = kebabCase((providerName || title).toLowerCase()); if (isFromWordPress(html)) { type = WP_EMBED_TYPE; } - if (html || 'photo' === type) { attributes.type = type; attributes.providerNameSlug = providerNameSlug; } + // Aspect ratio classes are removed when the embed URL is updated. + // If the embed already has an aspect ratio class, that means the URL has not changed. + // Which also means no need to regenerate it with getClassNames. + if (hasAspectRatioClass(currentClassNames)) { + return attributes; + } attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); return attributes; }); +/** + * Returns the attributes derived from the preview, merged with the current attributes. + * + * @param {Object} currentAttributes The current attributes of the block. + * @param {Object} preview The preview data. + * @param {string} title The block's title, e.g. Twitter. + * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. + * @return {Object} Merged attributes. + */ +const getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { + const { + allowResponsive, + className + } = currentAttributes; + return { + ...currentAttributes, + ...getAttributesFromPreview(preview, title, className, isResponsive, allowResponsive) + }; +}; + +;// CONCATENATED MODULE: external ["wp","compose"] +const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Returns whether the current user can edit the given entity. + * + * @param {string} kind Entity kind. + * @param {string} name Entity name. + * @param {string} recordId Record's id. + */ +function useCanEditEntity(kind, name, recordId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]); +} + +/** + * Handles uploading a media file from a blob URL on mount. + * + * @param {Object} args Upload media arguments. + * @param {string} args.url Blob URL. + * @param {?Array} args.allowedTypes Array of allowed media types. + * @param {Function} args.onChange Function called when the media is uploaded. + * @param {Function} args.onError Function called when an error happens. + */ +function useUploadMediaFromBlobURL(args = {}) { + const latestArgs = (0,external_wp_element_namespaceObject.useRef)(args); + const hasUploadStarted = (0,external_wp_element_namespaceObject.useRef)(false); + const { + getSettings + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + latestArgs.current = args; + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Uploading is a special effect that can't be canceled via the cleanup method. + // The extra check avoids duplicate uploads in development mode (React.StrictMode). + if (hasUploadStarted.current) { + return; + } + if (!latestArgs.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgs.current.url)) { + return; + } + const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgs.current.url); + if (!file) { + return; + } + const { + url, + allowedTypes, + onChange, + onError + } = latestArgs.current; + const { + mediaUpload + } = getSettings(); + hasUploadStarted.current = true; + mediaUpload({ + filesList: [file], + allowedTypes, + onFileChange: ([media]) => { + if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) { + return; + } + (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); + onChange(media); + hasUploadStarted.current = false; + }, + onError: message => { + (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); + onError(message); + hasUploadStarted.current = false; + } + }); + }, [getSettings]); +} +function useToolsPanelDropdownMenuProps() { + const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + return !isMobile ? { + popoverProps: { + placement: 'left-start', + // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) + offset: 259 + } + } : {}; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/caption.js +/** + * WordPress dependencies + */ + + +const caption = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z" + }) +}); +/* harmony default export */ const library_caption = (caption); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/caption.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + +function Caption({ + attributeKey = 'caption', + attributes, + setAttributes, + isSelected, + insertBlocksAfter, + placeholder = (0,external_wp_i18n_namespaceObject.__)('Add caption'), + label = (0,external_wp_i18n_namespaceObject.__)('Caption text'), + showToolbarButton = true, + excludeElementClassName, + className, + readOnly, + tagName = 'figcaption', + addLabel = (0,external_wp_i18n_namespaceObject.__)('Add caption'), + removeLabel = (0,external_wp_i18n_namespaceObject.__)('Remove caption'), + icon = library_caption, + ...props +}) { + const caption = attributes[attributeKey]; + const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption); + const { + PrivateRichText: RichText + } = unlock(external_wp_blockEditor_namespaceObject.privateApis); + const isCaptionEmpty = RichText.isEmpty(caption); + const isPrevCaptionEmpty = RichText.isEmpty(prevCaption); + const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!isCaptionEmpty); + + // We need to show the caption when changes come from + // history navigation(undo/redo). + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!isCaptionEmpty && isPrevCaptionEmpty) { + setShowCaption(true); + } + }, [isCaptionEmpty, isPrevCaptionEmpty]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!isSelected && isCaptionEmpty) { + setShowCaption(false); + } + }, [isSelected, isCaptionEmpty]); + + // Focus the caption when we click to add one. + const ref = (0,external_wp_element_namespaceObject.useCallback)(node => { + if (node && isCaptionEmpty) { + node.focus(); + } + }, [isCaptionEmpty]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [showToolbarButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + group: "block", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: () => { + setShowCaption(!showCaption); + if (showCaption && caption) { + setAttributes({ + [attributeKey]: undefined + }); + } + }, + icon: icon, + isPressed: showCaption, + label: showCaption ? removeLabel : addLabel + }) + }), showCaption && (!RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RichText, { + identifier: attributeKey, + tagName: tagName, + className: dist_clsx(className, excludeElementClassName ? '' : (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), + ref: ref, + "aria-label": label, + placeholder: placeholder, + value: caption, + onChange: value => setAttributes({ + [attributeKey]: value + }), + inlineToolbar: true, + __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), + readOnly: readOnly, + ...props + })] + }); +} + ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + const ALLOWED_MEDIA_TYPES = ['audio']; - -function AudioEdit(_ref) { - let { - attributes, - className, - noticeOperations, - setAttributes, - onReplace, - isSelected, - noticeUI, - insertBlocksAfter - } = _ref; +function AudioEdit({ + attributes, + className, + setAttributes, + onReplace, + isSelected: isSingleSelected, + insertBlocksAfter +}) { const { id, autoplay, - caption, loop, preload, src } = attributes; const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src); - const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = select(external_wp_blockEditor_namespaceObject.store); - return getSettings().mediaUpload; - }, []); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) { - const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src); - - if (file) { - mediaUpload({ - filesList: [file], - onFileChange: _ref2 => { - let [{ - id: mediaId, - url - }] = _ref2; - setAttributes({ - id: mediaId, - src: url - }); - }, - onError: e => { - setAttributes({ - src: undefined, - id: undefined - }); - noticeOperations.createErrorNotice(e); - }, - allowedTypes: ALLOWED_MEDIA_TYPES - }); - } - } - }, []); - + useUploadMediaFromBlobURL({ + url: src, + allowedTypes: ALLOWED_MEDIA_TYPES, + onChange: onSelectAudio, + onError: onUploadError + }); function toggleAttribute(attribute) { return newValue => { setAttributes({ @@ -2818,7 +3284,6 @@ }); }; } - function onSelectURL(newSrc) { // Set the block's src from the edit component's state, and switch off // the editing UI. @@ -2829,141 +3294,149 @@ url: newSrc } }); - if (undefined !== embedBlock && onReplace) { onReplace(embedBlock); return; } - setAttributes({ src: newSrc, id: undefined }); } } - + const { + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onUploadError(message) { - noticeOperations.removeAllNotices(); - noticeOperations.createErrorNotice(message); - } - + createErrorNotice(message, { + type: 'snackbar' + }); + } function getAutoplayHelp(checked) { return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null; } - function onSelectAudio(media) { if (!media || !media.url) { // In this case there was an error and we should continue in the editing state // previous attributes should be removed because they may be temporary blob urls. setAttributes({ src: undefined, - id: undefined - }); - return; - } // Sets the block's attribute and updates the edit component from the + id: undefined, + caption: undefined + }); + return; + } + // Sets the block's attribute and updates the edit component from the // selected media, then switches off the editing UI. - - setAttributes({ src: media.url, - id: media.id - }); - } - - const classes = classnames_default()(className, { + id: media.id, + caption: media.caption + }); + } + const classes = dist_clsx(className, { 'is-transient': isTemporaryAudio }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); - if (!src) { - return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { - icon: library_audio - }), - onSelect: onSelectAudio, - onSelectURL: onSelectURL, - accept: "audio/*", - allowedTypes: ALLOWED_MEDIA_TYPES, - value: attributes, - notices: noticeUI, - onError: onUploadError - })); - } - - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { - group: "other" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { - mediaId: id, - mediaURL: src, - allowedTypes: ALLOWED_MEDIA_TYPES, - accept: "audio/*", - onSelect: onSelectAudio, - onSelectURL: onSelectURL, - onError: onUploadError - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Audio settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), - onChange: toggleAttribute('autoplay'), - checked: autoplay, - help: getAutoplayHelp - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Loop'), - onChange: toggleAttribute('loop'), - checked: loop - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { - label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), - value: preload || '' // `undefined` is required for the preload attribute to be unset. - , - onChange: value => setAttributes({ - preload: value || undefined - }), - options: [{ - value: '', - label: (0,external_wp_i18n_namespaceObject.__)('Browser default') - }, { - value: 'auto', - label: (0,external_wp_i18n_namespaceObject.__)('Auto') - }, { - value: 'metadata', - label: (0,external_wp_i18n_namespaceObject.__)('Metadata') - }, { - value: 'none', - label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') - }] - }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, { - isDisabled: !isSelected - }, (0,external_wp_element_namespaceObject.createElement)("audio", { - controls: "controls", - src: src - })), isTemporaryAudio && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { - tagName: "figcaption", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), - placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), - value: caption, - onChange: value => setAttributes({ - caption: value - }), - inlineToolbar: true, - __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')) - }))); -} - -/* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withNotices)(AudioEdit)); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { + icon: library_audio + }), + onSelect: onSelectAudio, + onSelectURL: onSelectURL, + accept: "audio/*", + allowedTypes: ALLOWED_MEDIA_TYPES, + value: attributes, + onError: onUploadError + }) + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + group: "other", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { + mediaId: id, + mediaURL: src, + allowedTypes: ALLOWED_MEDIA_TYPES, + accept: "audio/*", + onSelect: onSelectAudio, + onSelectURL: onSelectURL, + onError: onUploadError + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), + onChange: toggleAttribute('autoplay'), + checked: autoplay, + help: getAutoplayHelp + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Loop'), + onChange: toggleAttribute('loop'), + checked: loop + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), + value: preload || '' + // `undefined` is required for the preload attribute to be unset. + , + onChange: value => setAttributes({ + preload: value || undefined + }), + options: [{ + value: '', + label: (0,external_wp_i18n_namespaceObject.__)('Browser default') + }, { + value: 'auto', + label: (0,external_wp_i18n_namespaceObject.__)('Auto') + }, { + value: 'metadata', + label: (0,external_wp_i18n_namespaceObject.__)('Metadata') + }, { + value: 'none', + label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') + }] + })] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { + ...blockProps, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { + isDisabled: !isSingleSelected, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { + controls: "controls", + src: src + }) + }), isTemporaryAudio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { + attributes: attributes, + setAttributes: setAttributes, + isSelected: isSingleSelected, + insertBlocksAfter: insertBlocksAfter, + label: (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), + showToolbarButton: isSingleSelected + })] + })] + }); +} +/* harmony default export */ const edit = (AudioEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js - - -/** - * WordPress dependencies - */ - -function save(_ref) { - let { - attributes - } = _ref; +/** + * WordPress dependencies + */ + + + +function save({ + attributes +}) { const { autoplay, caption, @@ -2971,16 +3444,20 @@ preload, src } = attributes; - return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", { - controls: "controls", - src: src, - autoPlay: autoplay, - loop: loop, - preload: preload - }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "figcaption", - value: caption - })); + return src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { + controls: "controls", + src: src, + autoPlay: autoplay, + loop: loop, + preload: preload + }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "figcaption", + value: caption, + className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') + })] + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js @@ -2992,85 +3469,79 @@ const transforms = { from: [{ type: 'files', - isMatch(files) { return files.length === 1 && files[0].type.indexOf('audio/') === 0; }, - transform(files) { - const file = files[0]; // We don't need to upload the media directly here + const file = files[0]; + // We don't need to upload the media directly here // It's already done as part of the `componentDidMount` // in the audio block. - const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); return block; } - }, { type: 'shortcode', tag: 'audio', attributes: { src: { type: 'string', - shortcode: _ref => { - let { - named: { - src, - mp3, - m4a, - ogg, - wav, - wma - } - } = _ref; + shortcode: ({ + named: { + src, + mp3, + m4a, + ogg, + wav, + wma + } + }) => { return src || mp3 || m4a || ogg || wav || wma; } }, loop: { type: 'string', - shortcode: _ref2 => { - let { - named: { - loop - } - } = _ref2; + shortcode: ({ + named: { + loop + } + }) => { return loop; } }, autoplay: { type: 'string', - shortcode: _ref3 => { - let { - named: { - autoplay - } - } = _ref3; + shortcode: ({ + named: { + autoplay + } + }) => { return autoplay; } }, preload: { type: 'string', - shortcode: _ref4 => { - let { - named: { - preload - } - } = _ref4; + shortcode: ({ + named: { + preload + } + }) => { return preload; } } } }] }; -/* harmony default export */ var audio_transforms = (transforms); +/* harmony default export */ const audio_transforms = (transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js /** * WordPress dependencies */ + /** * Internal dependencies */ @@ -3079,7 +3550,7 @@ const audio_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/audio", title: "Audio", category: "media", @@ -3091,15 +3562,18 @@ type: "string", source: "attribute", selector: "audio", - attribute: "src" + attribute: "src", + __experimentalRole: "content" }, caption: { - type: "string", - source: "html", - selector: "figcaption" + type: "rich-text", + source: "rich-text", + selector: "figcaption", + __experimentalRole: "content" }, id: { - type: "number" + type: "number", + __experimentalRole: "content" }, autoplay: { type: "boolean", @@ -3122,7 +3596,18 @@ }, supports: { anchor: true, - align: true + align: true, + spacing: { + margin: true, + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false + } + }, + interactivity: { + clientNavigation: true + } }, editorStyle: "wp-block-audio-editor", style: "wp-block-audio" @@ -3138,63 +3623,48 @@ example: { attributes: { src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg' - } + }, + viewportWidth: 350 }, transforms: audio_transforms, deprecated: deprecated, edit: edit, save: save }; +const audio_init = () => initBlock({ + name: audio_name, + metadata: audio_metadata, + settings: audio_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js - - -/** - * WordPress dependencies - */ - -const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z" -})); -/* harmony default export */ var library_button = (button_button); - -;// CONCATENATED MODULE: external ["wp","compose"] -var external_wp_compose_namespaceObject = window["wp"]["compose"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js -/** - * External dependencies - */ - -/** - * Removed empty nodes from nested objects. - * - * @param {Object} object - * @return {Object} Object cleaned from empty nodes. - */ - -const cleanEmptyObject = object => { - if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) { - return object; - } - - const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity); - return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects; -}; - -/* harmony default export */ var clean_empty_object = (cleanEmptyObject); +/** + * WordPress dependencies + */ + + +const button_button = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" + }) +}); +/* harmony default export */ const library_button = (button_button); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js /** - * External dependencies - */ - -/** - * Internal dependencies - */ - + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const { + cleanEmptyObject +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); /** * Migrates the current style.typography.fontFamily attribute, @@ -3204,106 +3674,117 @@ * @param {Object} attributes The current attributes * @return {Object} The updated attributes. */ - /* harmony default export */ function migrate_font_family(attributes) { - var _attributes$style, _attributes$style$typ; - - if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) { + if (!attributes?.style?.typography?.fontFamily) { return attributes; - } // Clone first so when we delete the fontFamily - // below we're not modifying the original - // attributes. Because the deprecation may be discarded - // we don't want to alter the original attributes. - - - const atts = (0,external_lodash_namespaceObject.cloneDeep)(attributes); - const fontFamily = atts.style.typography.fontFamily.split('|').pop(); - delete atts.style.typography.fontFamily; - atts.style = clean_empty_object(atts.style); - return { ...atts, - fontFamily + } + const { + fontFamily, + ...typography + } = attributes.style.typography; + return { + ...attributes, + style: cleanEmptyObject({ + ...attributes.style, + typography + }), + fontFamily: fontFamily.split('|').pop() }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ const migrateBorderRadius = attributes => { - var _newAttributes$style, _newAttributes$style$, _newAttributes$style2; - const { borderRadius, ...newAttributes - } = attributes; // We have to check old property `borderRadius` and if + } = attributes; + // We have to check old property `borderRadius` and if // `styles.border.radius` is a `number` - - const oldBorderRadius = [borderRadius, (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius].find(possibleBorderRadius => { + const oldBorderRadius = [borderRadius, newAttributes.style?.border?.radius].find(possibleBorderRadius => { return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0; }); - if (!oldBorderRadius) { return newAttributes; } - - return { ...newAttributes, - style: { ...newAttributes.style, - border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border), + return { + ...newAttributes, + style: { + ...newAttributes.style, + border: { + ...newAttributes.style?.border, radius: `${oldBorderRadius}px` } } }; }; - +function migrateAlign(attributes) { + if (!attributes.align) { + return attributes; + } + const { + align, + ...otherAttributes + } = attributes; + return { + ...otherAttributes, + className: dist_clsx(otherAttributes.className, `align${attributes.align}`) + }; +} const migrateCustomColorsAndGradients = attributes => { if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) { return attributes; } - const style = { color: {} }; - if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } - if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } - if (attributes.customGradient) { style.color.gradient = attributes.customGradient; } - - return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']), + const { + customTextColor, + customBackgroundColor, + customGradient, + ...restAttributes + } = attributes; + return { + ...restAttributes, style }; }; - const oldColorsMigration = attributes => { - return migrateCustomColorsAndGradients((0,external_lodash_namespaceObject.omit)({ ...attributes, + const { + color, + textColor, + ...restAttributes + } = { + ...attributes, customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined - }, ['color', 'textColor'])); -}; - + }; + return migrateCustomColorsAndGradients(restAttributes); +}; const blockAttributes = { url: { type: 'string', @@ -3323,6 +3804,145 @@ selector: 'a' } }; +const v11 = { + attributes: { + url: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'href' + }, + title: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'title' + }, + text: { + type: 'string', + source: 'html', + selector: 'a' + }, + linkTarget: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'target' + }, + rel: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'rel' + }, + placeholder: { + type: 'string' + }, + backgroundColor: { + type: 'string' + }, + textColor: { + type: 'string' + }, + gradient: { + type: 'string' + }, + width: { + type: 'number' + } + }, + supports: { + anchor: true, + align: true, + alignWide: false, + color: { + __experimentalSkipSerialization: true, + gradients: true, + __experimentalDefaultControls: { + background: true, + text: true + } + }, + typography: { + fontSize: true, + __experimentalFontFamily: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + reusable: false, + spacing: { + __experimentalSkipSerialization: true, + padding: ['horizontal', 'vertical'], + __experimentalDefaultControls: { + padding: true + } + }, + __experimentalBorder: { + radius: true, + __experimentalSkipSerialization: true, + __experimentalDefaultControls: { + radius: true + } + }, + __experimentalSelector: '.wp-block-button__link' + }, + save({ + attributes, + className + }) { + const { + fontSize, + linkTarget, + rel, + style, + text, + title, + url, + width + } = attributes; + if (!text) { + return null; + } + const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); + const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { + // For backwards compatibility add style that isn't provided via + // block support. + 'no-border-radius': style?.border?.radius === 0 + }); + const buttonStyle = { + ...borderProps.style, + ...colorProps.style, + ...spacingProps.style + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied + // if it had already been assigned, for the sake of backward-compatibility. + // A title will no longer be assigned for new or updated button block links. + + const wrapperClasses = dist_clsx(className, { + [`has-custom-width wp-block-button__width-${width}`]: width, + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + } +}; const v10 = { attributes: { url: { @@ -3396,14 +4016,10 @@ }, __experimentalSelector: '.wp-block-button__link' }, - - save(_ref) { - var _style$border, _style$typography; - - let { - attributes, - className - } = _ref; + save({ + attributes, + className + }) { const { fontSize, linkTarget, @@ -3414,57 +4030,55 @@ url, width } = attributes; - if (!text) { return null; } - const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); - const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { // For backwards compatibility add style that isn't provided via // block support. - 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0 - }); - const buttonStyle = { ...borderProps.style, + 'no-border-radius': style?.border?.radius === 0 + }); + const buttonStyle = { + ...borderProps.style, ...colorProps.style, ...spacingProps.style - }; // The use of a `title` attribute here is soft-deprecated, but still applied + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - const wrapperClasses = classnames_default()(className, { + const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize) - }); - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: wrapperClasses - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - }, - + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + }, migrate: migrate_font_family, - - isEligible(_ref2) { - var _style$typography2; - - let { - style - } = _ref2; - return style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily; - } - -}; -const deprecated_deprecated = [v10, { + isEligible({ + style + }) { + return style?.typography?.fontFamily; + } +}; +const deprecated_deprecated = [v11, v10, { supports: { anchor: true, align: true, @@ -3480,7 +4094,8 @@ reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3509,23 +4124,15 @@ type: 'number' } }, - - isEligible(_ref3) { - var _style$border2; - - let { - style - } = _ref3; - return typeof (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius) === 'number'; - }, - - save(_ref4) { - var _style$border3, _style$border4, _style$typography3; - - let { - attributes, - className - } = _ref4; + isEligible({ + style + }) { + return typeof style?.border?.radius === 'number'; + }, + save({ + attributes, + className + }) { const { fontSize, linkTarget, @@ -3536,41 +4143,43 @@ url, width } = attributes; - if (!text) { return null; } - - const borderRadius = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius; + const borderRadius = style?.border?.radius; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); - const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { - 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius) === 0 + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { + 'no-border-radius': style?.border?.radius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius : undefined, ...colorProps.style - }; // The use of a `title` attribute here is soft-deprecated, but still applied + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - const wrapperClasses = classnames_default()(className, { + const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontSize) - }); - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: wrapperClasses - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - }, - + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { @@ -3583,7 +4192,8 @@ reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3618,12 +4228,10 @@ type: 'number' } }, - - save(_ref5) { - let { - attributes, - className - } = _ref5; + save({ + attributes, + className + }) { const { borderRadius, linkTarget, @@ -3634,33 +4242,37 @@ width } = attributes; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); - const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined, ...colorProps.style - }; // The use of a `title` attribute here is soft-deprecated, but still applied + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - const wrapperClasses = classnames_default()(className, { + const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: wrapperClasses - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - }, - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { @@ -3673,7 +4285,8 @@ reusable: false, __experimentalSelector: '.wp-block-button__link' }, - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3708,12 +4321,10 @@ type: 'number' } }, - - save(_ref6) { - let { - attributes, - className - } = _ref6; + save({ + attributes, + className + }) { const { borderRadius, linkTarget, @@ -3724,33 +4335,37 @@ width } = attributes; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); - const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined, ...colorProps.style - }; // The use of a `title` attribute here is soft-deprecated, but still applied + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - const wrapperClasses = classnames_default()(className, { + const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: wrapperClasses - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - }, - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { @@ -3760,7 +4375,8 @@ gradients: true } }, - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3792,11 +4408,9 @@ type: 'object' } }, - - save(_ref7) { - let { - attributes - } = _ref7; + save({ + attributes + }) { const { borderRadius, linkTarget, @@ -3805,13 +4419,13 @@ title, url } = attributes; - const buttonClasses = classnames_default()('wp-block-button__link', { + const buttonClasses = dist_clsx('wp-block-button__link', { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined }; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, @@ -3822,14 +4436,14 @@ rel: rel }); }, - migrate: migrateBorderRadius }, { supports: { align: true, alignWide: false }, - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', @@ -3867,13 +4481,11 @@ type: 'string' } }, - isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient, - migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients), - - save(_ref8) { - let { - attributes - } = _ref8; + isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align, + migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients, migrateAlign), + save({ + attributes + }) { const { backgroundColor, borderRadius, @@ -3890,10 +4502,8 @@ } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); - const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); - - const buttonClasses = classnames_default()('wp-block-button__link', { + const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient, @@ -3906,24 +4516,28 @@ backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor, borderRadius: borderRadius ? borderRadius + 'px' : undefined - }; // The use of a `title` attribute here is soft-deprecated, but still applied + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - } - -}, { - attributes: { ...blockAttributes, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + } +}, { + attributes: { + ...blockAttributes, align: { type: 'string', default: 'none' @@ -3956,28 +4570,23 @@ type: 'string' } }, - isEligible(attribute) { return attribute.className && attribute.className.includes('is-style-squared'); }, - migrate(attributes) { let newClassName = attributes.className; - if (newClassName) { newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim(); } - - return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes, + return migrateBorderRadius(migrateCustomColorsAndGradients({ + ...attributes, className: newClassName ? newClassName : undefined, borderRadius: 0 })); }, - - save(_ref9) { - let { - attributes - } = _ref9; + save({ + attributes + }) { const { backgroundColor, customBackgroundColor, @@ -3991,7 +4600,7 @@ } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); - const buttonClasses = classnames_default()('wp-block-button__link', { + const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor, @@ -4001,20 +4610,22 @@ backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); - } - -}, { - attributes: { ...blockAttributes, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text, + target: linkTarget, + rel: rel + }) + }); + } +}, { + attributes: { + ...blockAttributes, align: { type: 'string', default: 'none' @@ -4033,11 +4644,9 @@ } }, migrate: oldColorsMigration, - - save(_ref10) { - let { - attributes - } = _ref10; + save({ + attributes + }) { const { url, text, @@ -4049,7 +4658,7 @@ } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); - const buttonClasses = classnames_default()('wp-block-button__link', { + const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor, @@ -4059,18 +4668,20 @@ backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text - })); - } - -}, { - attributes: { ...blockAttributes, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: buttonClasses, + href: url, + title: title, + style: buttonStyle, + value: text + }) + }); + } +}, { + attributes: { + ...blockAttributes, color: { type: 'string' }, @@ -4082,11 +4693,9 @@ default: 'none' } }, - - save(_ref11) { - let { - attributes - } = _ref11; + save({ + attributes + }) { const { url, text, @@ -4100,21 +4709,22 @@ color: textColor }; const linkClass = 'wp-block-button__link'; - return (0,external_wp_element_namespaceObject.createElement)("div", { - className: `align${align}` - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: linkClass, - href: url, - title: title, - style: buttonStyle, - value: text - })); - }, - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: `align${align}`, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + className: linkClass, + href: url, + title: title, + style: buttonStyle, + value: text + }) + }); + }, migrate: oldColorsMigration }, { - attributes: { ...blockAttributes, + attributes: { + ...blockAttributes, color: { type: 'string' }, @@ -4126,11 +4736,9 @@ default: 'none' } }, - - save(_ref12) { - let { - attributes - } = _ref12; + save({ + attributes + }) { const { url, text, @@ -4139,186 +4747,290 @@ color, textColor } = attributes; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `align${align}`, style: { backgroundColor: color - } - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - href: url, - title: title, - style: { - color: textColor - }, - value: text - })); - }, - + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "a", + href: url, + title: title, + style: { + color: textColor + }, + value: text + }) + }); + }, migrate: oldColorsMigration }]; -/* harmony default export */ var button_deprecated = (deprecated_deprecated); +/* harmony default export */ const button_deprecated = (deprecated_deprecated); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/constants.js +const NEW_TAB_REL = 'noreferrer noopener'; +const NEW_TAB_TARGET = '_blank'; +const NOFOLLOW_REL = 'nofollow'; + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js +/** + * Internal dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Updates the link attributes. + * + * @param {Object} attributes The current block attributes. + * @param {string} attributes.rel The current link rel attribute. + * @param {string} attributes.url The current link url. + * @param {boolean} attributes.opensInNewTab Whether the link should open in a new window. + * @param {boolean} attributes.nofollow Whether the link should be marked as nofollow. + */ +function getUpdatedLinkAttributes({ + rel = '', + url = '', + opensInNewTab, + nofollow +}) { + let newLinkTarget; + // Since `rel` is editable attribute, we need to check for existing values and proceed accordingly. + let updatedRel = rel; + if (opensInNewTab) { + newLinkTarget = NEW_TAB_TARGET; + updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` ${NEW_TAB_REL}`; + } else { + const relRegex = new RegExp(`\\b${NEW_TAB_REL}\\s*`, 'g'); + updatedRel = updatedRel?.replace(relRegex, '').trim(); + } + if (nofollow) { + updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : updatedRel + ` ${NOFOLLOW_REL}`; + } else { + const relRegex = new RegExp(`\\b${NOFOLLOW_REL}\\s*`, 'g'); + updatedRel = updatedRel?.replace(relRegex, '').trim(); + } + return { + url: (0,external_wp_url_namespaceObject.prependHTTP)(url), + linkTarget: newLinkTarget, + rel: updatedRel || undefined + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js +/** + * Removes anchor tags from a string. + * + * @param {string} value The value to remove anchor tags from. + * + * @return {string} The value with anchor tags removed. + */ +function removeAnchorTag(value) { + // To do: Refactor this to use rich text's removeFormat instead. + return value.toString().replace(/<\/?a[^>]*>/g, ''); +} ;// CONCATENATED MODULE: external ["wp","keycodes"] -var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js - - -/** - * WordPress dependencies - */ - -const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" -})); -/* harmony default export */ var library_link = (link_link); +/** + * WordPress dependencies + */ + + +const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" + }) +}); +/* harmony default export */ const library_link = (link_link); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js - - -/** - * WordPress dependencies - */ - -const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" -})); -/* harmony default export */ var link_off = (linkOff); +/** + * WordPress dependencies + */ + + +const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" + }) +}); +/* harmony default export */ const link_off = (linkOff); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js - - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - - -const NEW_TAB_REL = 'noreferrer noopener'; - -function WidthPanel(_ref) { - let { - selectedWidth, - setAttributes - } = _ref; - +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +/** + * WordPress dependencies + */ + + + + + + + + + + + + +const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, { + id: 'nofollow', + title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') +}]; +function useEnter(props) { + const { + replaceBlocks, + selectionChange + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const { + getBlock, + getBlockRootClientId, + getBlockIndex + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); + propsRef.current = props; + return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + function onKeyDown(event) { + if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { + return; + } + const { + content, + clientId + } = propsRef.current; + if (content.length) { + return; + } + event.preventDefault(); + const topParentListBlock = getBlock(getBlockRootClientId(clientId)); + const blockIndex = getBlockIndex(clientId); + const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ + ...topParentListBlock, + innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) + }); + const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); + const after = topParentListBlock.innerBlocks.slice(blockIndex + 1); + const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ + ...topParentListBlock, + innerBlocks: after + })] : []; + replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); + // We manually change the selection here because we are replacing + // a different block than the selected one. + selectionChange(middle.clientId); + } + element.addEventListener('keydown', onKeyDown); + return () => { + element.removeEventListener('keydown', onKeyDown); + }; + }, []); +} +function WidthPanel({ + selectedWidth, + setAttributes +}) { function handleChange(newWidth) { // Check if we are toggling the width off - const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes. - + const width = selectedWidth === newWidth ? undefined : newWidth; + + // Update attributes. setAttributes({ width }); } - - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Width settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width') - }, [25, 50, 75, 100].map(widthValue => { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { - key: widthValue, - isSmall: true, - variant: widthValue === selectedWidth ? 'primary' : undefined, - onClick: () => handleChange(widthValue) - }, widthValue, "%"); - }))); -} - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ButtonGroup, { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width'), + children: [25, 50, 75, 100].map(widthValue => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { + size: "small", + variant: widthValue === selectedWidth ? 'primary' : undefined, + onClick: () => handleChange(widthValue), + children: [widthValue, "%"] + }, widthValue); + }) + }) + }); +} function ButtonEdit(props) { - var _style$border; - const { attributes, setAttributes, className, isSelected, onReplace, - mergeBlocks + mergeBlocks, + clientId, + context } = props; const { + tagName, + textAlign, linkTarget, placeholder, rel, style, text, url, - width - } = attributes; - const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => { - setAttributes({ - rel: value - }); - }, [setAttributes]); - - function onToggleOpenInNewTab(value) { - const newLinkTarget = value ? '_blank' : undefined; - let updatedRel = rel; - - if (newLinkTarget && !rel) { - updatedRel = NEW_TAB_REL; - } else if (!newLinkTarget && rel === NEW_TAB_REL) { - updatedRel = undefined; - } - - setAttributes({ - linkTarget: newLinkTarget, - rel: updatedRel - }); - } - - function setButtonText(newText) { - // Remove anchor tags from button text content. - setAttributes({ - text: newText.replace(/<\/?a[^>]*>/g, '') - }); - } - + width, + metadata + } = attributes; + const TagName = tagName || 'a'; function onKeyDown(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { startEditing(event); } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) { - var _richTextRef$current; - unlink(); - (_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus(); - } - } - + richTextRef.current?.focus(); + } + } + + // Use internal state instead of a ref to make sure that the component + // re-renders when the popover's anchor updates. + const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); + const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const ref = (0,external_wp_element_namespaceObject.useRef)(); const richTextRef = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ - ref, + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), onKeyDown }); + const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const isURLSet = !!url; - const opensInNewTab = linkTarget === '_blank'; - + const opensInNewTab = linkTarget === NEW_TAB_TARGET; + const nofollow = !!rel?.includes(NOFOLLOW_REL); + const isLinkTag = 'a' === TagName; function startEditing(event) { event.preventDefault(); setIsEditingURL(true); } - function unlink() { setAttributes({ url: undefined, @@ -4327,125 +5039,162 @@ }); setIsEditingURL(false); } - (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setIsEditingURL(false); } }, [isSelected]); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, { - className: classnames_default()(blockProps.className, { - [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: blockProps.style.fontSize - }) - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { - ref: richTextRef, - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), - placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), - value: text, - onChange: value => setButtonText(value), - withoutInteractiveFormatting: true, - className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, { - // For backwards compatibility add style that isn't - // provided via block support. - 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0 - }), - style: { ...borderProps.style, - ...colorProps.style, - ...spacingProps.style - }, - onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes, - text: value - }), - onReplace: onReplace, - onMerge: mergeBlocks, - identifier: "text" - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { - group: "block" - }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { - name: "link", - icon: library_link, - title: (0,external_wp_i18n_namespaceObject.__)('Link'), - shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), - onClick: startEditing - }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { - name: "link", - icon: link_off, - title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), - shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), - onClick: unlink, - isActive: true - })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { - position: "bottom center", - onClose: () => { - var _richTextRef$current2; - - setIsEditingURL(false); - (_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus(); - }, - anchorRef: ref === null || ref === void 0 ? void 0 : ref.current, - focusOnMount: isEditingURL ? 'firstElement' : false, - __unstableSlotName: '__unstable-block-tools-after' - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { - className: "wp-block-navigation-link__inline-link-input", - value: { - url, - opensInNewTab - }, - onChange: _ref2 => { - let { - url: newURL = '', - opensInNewTab: newOpensInNewTab - } = _ref2; - setAttributes({ - url: newURL - }); - - if (opensInNewTab !== newOpensInNewTab) { - onToggleOpenInNewTab(newOpensInNewTab); - } - }, - onRemove: () => { - var _richTextRef$current3; - - unlink(); - (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus(); - }, - forceIsEditingLink: isEditingURL - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, { - selectedWidth: width, - setAttributes: setAttributes - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { - __experimentalGroup: "advanced" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), - value: rel || '', - onChange: onSetLinkRel - }))); -} - -/* harmony default export */ var button_edit = (ButtonEdit); + + // Memoize link value to avoid overriding the LinkControl's internal state. + // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256. + const linkValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + url, + opensInNewTab, + nofollow + }), [url, opensInNewTab, nofollow]); + const useEnterRef = useEnter({ + content: text, + clientId + }); + const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, richTextRef]); + const { + lockUrlControls = false + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + if (!isSelected) { + return {}; + } + const blockBindingsSource = unlock(select(external_wp_blocks_namespaceObject.store)).getBlockBindingsSource(metadata?.bindings?.url?.source); + return { + lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue({ + select, + context, + args: metadata?.bindings?.url?.args + }) + }; + }, [isSelected, metadata?.bindings?.url]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + className: dist_clsx(blockProps.className, { + [`has-custom-width wp-block-button__width-${width}`]: width, + [`has-custom-font-size`]: blockProps.style.fontSize + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { + ref: mergedRef, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), + placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), + value: text, + onChange: value => setAttributes({ + text: removeAnchorTag(value) + }), + withoutInteractiveFormatting: true, + className: dist_clsx(className, 'wp-block-button__link', colorProps.className, borderProps.className, { + [`has-text-align-${textAlign}`]: textAlign, + // For backwards compatibility add style that isn't + // provided via block support. + 'no-border-radius': style?.border?.radius === 0 + }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), + style: { + ...borderProps.style, + ...colorProps.style, + ...spacingProps.style, + ...shadowProps.style + }, + onReplace: onReplace, + onMerge: mergeBlocks, + identifier: "text" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { + group: "block", + children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { + value: textAlign, + onChange: nextAlign => { + setAttributes({ + textAlign: nextAlign + }); + } + }), !isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { + name: "link", + icon: library_link, + title: (0,external_wp_i18n_namespaceObject.__)('Link'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), + onClick: startEditing + }), isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { + name: "link", + icon: link_off, + title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), + shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), + onClick: unlink, + isActive: true + })] + }), isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { + placement: "bottom", + onClose: () => { + setIsEditingURL(false); + richTextRef.current?.focus(); + }, + anchor: popoverAnchor, + focusOnMount: isEditingURL ? 'firstElement' : false, + __unstableSlotName: "__unstable-block-tools-after", + shift: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { + value: linkValue, + onChange: ({ + url: newURL, + opensInNewTab: newOpensInNewTab, + nofollow: newNofollow + }) => setAttributes(getUpdatedLinkAttributes({ + rel, + url: newURL, + opensInNewTab: newOpensInNewTab, + nofollow: newNofollow + })), + onRemove: () => { + unlink(); + richTextRef.current?.focus(); + }, + forceIsEditingLink: isEditingURL, + settings: LINK_SETTINGS + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidthPanel, { + selectedWidth: width, + setAttributes: setAttributes + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + group: "advanced", + children: isLinkTag && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), + value: rel || '', + onChange: newRel => setAttributes({ + rel: newRel + }) + }) + })] + }); +} +/* harmony default export */ const button_edit = (ButtonEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -function save_save(_ref) { - var _style$border, _style$typography; - - let { - attributes, - className - } = _ref; - const { +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function save_save({ + attributes, + className +}) { + const { + tagName, + type, + textAlign, fontSize, linkTarget, rel, @@ -4455,42 +5204,50 @@ url, width } = attributes; - - if (!text) { - return null; - } - + const TagName = tagName || 'a'; + const isButtonTag = 'button' === TagName; + const buttonType = type || 'button'; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); - const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { + const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { + [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't provided via // block support. - 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0 - }); - const buttonStyle = { ...borderProps.style, + 'no-border-radius': style?.border?.radius === 0 + }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); + const buttonStyle = { + ...borderProps.style, ...colorProps.style, - ...spacingProps.style - }; // The use of a `title` attribute here is soft-deprecated, but still applied + ...spacingProps.style, + ...shadowProps.style + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. - const wrapperClasses = classnames_default()(className, { + const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize) - }); - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: wrapperClasses - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "a", - className: buttonClasses, - href: url, - title: title, - style: buttonStyle, - value: text, - target: linkTarget, - rel: rel - })); + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: TagName, + type: isButtonTag ? buttonType : null, + className: buttonClasses, + href: isButtonTag ? null : url, + title: title, + style: buttonStyle, + value: text, + target: isButtonTag ? null : linkTarget, + rel: isButtonTag ? null : rel + }) + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js @@ -4499,6 +5256,7 @@ */ + /** * Internal dependencies */ @@ -4507,7 +5265,7 @@ const button_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/button", title: "Button", category: "design", @@ -4516,34 +5274,51 @@ keywords: ["link"], textdomain: "default", attributes: { + tagName: { + type: "string", + "enum": ["a", "button"], + "default": "a" + }, + type: { + type: "string", + "default": "button" + }, + textAlign: { + type: "string" + }, url: { type: "string", source: "attribute", selector: "a", - attribute: "href" + attribute: "href", + __experimentalRole: "content" }, title: { type: "string", source: "attribute", - selector: "a", - attribute: "title" + selector: "a,button", + attribute: "title", + __experimentalRole: "content" }, text: { - type: "string", - source: "html", - selector: "a" + type: "rich-text", + source: "rich-text", + selector: "a,button", + __experimentalRole: "content" }, linkTarget: { type: "string", source: "attribute", selector: "a", - attribute: "target" + attribute: "target", + __experimentalRole: "content" }, rel: { type: "string", source: "attribute", selector: "a", - attribute: "rel" + attribute: "rel", + __experimentalRole: "content" }, placeholder: { type: "string" @@ -4563,7 +5338,8 @@ }, supports: { anchor: true, - align: true, + splitting: true, + align: false, alignWide: false, color: { __experimentalSkipSerialization: true, @@ -4575,12 +5351,21 @@ }, typography: { fontSize: true, - __experimentalFontFamily: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, reusable: false, + shadow: { + __experimentalSkipSerialization: true + }, spacing: { __experimentalSkipSerialization: true, padding: ["horizontal", "vertical"], @@ -4589,13 +5374,22 @@ } }, __experimentalBorder: { + color: true, radius: true, + style: true, + width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { - radius: true - } - }, - __experimentalSelector: ".wp-block-button__link" + color: true, + radius: true, + style: true, + width: true + } + }, + __experimentalSelector: ".wp-block-button .wp-block-button__link", + interactivity: { + clientNavigation: true + } }, styles: [{ name: "fill", @@ -4624,34 +5418,35 @@ edit: button_edit, save: save_save, deprecated: button_deprecated, - merge: (a, _ref) => { - let { - text = '' - } = _ref; - return { ...a, - text: (a.text || '') + text - }; - } -}; + merge: (a, { + text = '' + }) => ({ + ...a, + text: (a.text || '') + text + }) +}; +const button_init = () => initBlock({ + name: button_name, + metadata: button_metadata, + settings: button_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js - - -/** - * WordPress dependencies - */ - -const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z" -})); -/* harmony default export */ var library_buttons = (buttons); +/** + * WordPress dependencies + */ + + +const buttons = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" + }) +}); +/* harmony default export */ const library_buttons = (buttons); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js - - /** * External dependencies */ @@ -4669,13 +5464,11 @@ if (!!attributes.layout) { return attributes; } - const { contentJustification, orientation, ...updatedAttributes } = attributes; - if (contentJustification || orientation) { Object.assign(updatedAttributes, { layout: { @@ -4689,10 +5482,8 @@ } }); } - return updatedAttributes; }; - const buttons_deprecated_deprecated = [{ attributes: { contentJustification: { @@ -4715,49 +5506,45 @@ } } }, - isEligible: _ref => { - let { + isEligible: ({ + contentJustification, + orientation + }) => !!contentJustification || !!orientation, + migrate: migrateWithLayout, + save({ + attributes: { contentJustification, orientation - } = _ref; - return !!contentJustification || !!orientation; - }, - migrate: migrateWithLayout, - - save(_ref2) { - let { - attributes: { - contentJustification, - orientation - } - } = _ref2; - return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({ - className: classnames_default()({ - [`is-content-justification-${contentJustification}`]: contentJustification, - 'is-vertical': orientation === 'vertical' - }) - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - } - + } + }) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: dist_clsx({ + [`is-content-justification-${contentJustification}`]: contentJustification, + 'is-vertical': orientation === 'vertical' + }) + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } }, { supports: { align: ['center', 'left', 'right'], anchor: true }, - save() { - return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - }, - - isEligible(_ref3) { - let { - align - } = _ref3; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + }, + isEligible({ + align + }) { return align && ['center', 'left', 'right'].includes(align); }, - migrate(attributes) { - return migrateWithLayout({ ...attributes, + return migrateWithLayout({ + ...attributes, align: undefined, // Floating Buttons blocks shouldn't have been supported in the // first place. Most users using them probably expected them to @@ -4768,81 +5555,114 @@ contentJustification: attributes.align }); } - }]; -/* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated); +/* harmony default export */ const buttons_deprecated = (buttons_deprecated_deprecated); ;// CONCATENATED MODULE: external ["wp","richText"] -var external_wp_richText_namespaceObject = window["wp"]["richText"]; +const external_wp_richText_namespaceObject = window["wp"]["richText"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js +/** + * WordPress dependencies + */ + + +/** + * Transform the metadata attribute with only the values and bindings specified by each transform. + * Returns `undefined` if the input metadata is falsy. + * + * @param {Object} metadata Original metadata attribute from the block that is being transformed. + * @param {Object} newBlockName Name of the final block after the transformation. + * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object. + * @return {Object|undefined} New metadata object only with the relevant properties. + */ +function getTransformedMetadata(metadata, newBlockName, bindingsCallback) { + if (!metadata) { + return; + } + const { + supports + } = (0,external_wp_blocks_namespaceObject.getBlockType)(newBlockName); + // Fixed until an opt-in mechanism is implemented. + const BLOCK_BINDINGS_SUPPORTED_BLOCKS = ['core/paragraph', 'core/heading', 'core/image', 'core/button']; + // The metadata properties that should be preserved after the transform. + const transformSupportedProps = []; + // If it support bindings, and there is a transform bindings callback, add the `id` and `bindings` properties. + if (BLOCK_BINDINGS_SUPPORTED_BLOCKS.includes(newBlockName) && bindingsCallback) { + transformSupportedProps.push('id', 'bindings'); + } + // If it support block naming (true by default), add the `name` property. + if (supports.renaming !== false) { + transformSupportedProps.push('name'); + } + + // Return early if no supported properties. + if (!transformSupportedProps.length) { + return; + } + const newMetadata = Object.entries(metadata).reduce((obj, [prop, value]) => { + // If prop is not supported, don't add it to the new metadata object. + if (!transformSupportedProps.includes(prop)) { + return obj; + } + obj[prop] = prop === 'bindings' ? bindingsCallback(value) : value; + return obj; + }, {}); + + // Return undefined if object is empty. + return Object.keys(newMetadata).length ? newMetadata : undefined; +} + ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js /** * WordPress dependencies */ -/** - * Internal dependencies - */ - -const { - name: transforms_name -} = { - $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, - name: "core/buttons", - title: "Buttons", - category: "design", - description: "Prompt visitors to take action with a group of button-style links.", - keywords: ["link"], - textdomain: "default", - supports: { - anchor: true, - align: ["wide", "full"], - __experimentalExposeControlsToChildren: true, - spacing: { - blockGap: true, - margin: ["top", "bottom"], - __experimentalDefaultControls: { - blockGap: true - } - }, - __experimentalLayout: { - allowSwitching: false, - allowInheriting: false, - "default": { - type: "flex" - } - } - }, - editorStyle: "wp-block-buttons-editor", - style: "wp-block-buttons" -}; + +/** + * Internal dependencies + */ + const transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/button'], - transform: buttons => // Creates the buttons block. - (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons. - buttons.map(attributes => // Create singular button in the buttons block. + transform: buttons => + // Creates the buttons block. + (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, + // Loop the selected buttons. + buttons.map(attributes => + // Create singular button in the buttons block. (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes))) }, { type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], - transform: buttons => // Creates the buttons block. - (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons. + transform: buttons => + // Creates the buttons block. + (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, + // Loop the selected buttons. buttons.map(attributes => { - const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags. - - const text = element.innerText || ''; // Get first url. - + const { + content, + metadata + } = attributes; + const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, content); + // Remove any HTML tags. + const text = element.innerText || ''; + // Get first url. const link = element.querySelector('a'); - const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block. - + const url = link?.getAttribute('href'); + // Create singular button in the buttons block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { text, - url + url, + metadata: getTransformedMetadata(metadata, 'core/button', ({ + content: contentBinding + }) => ({ + text: contentBinding + })) }); })), isMatch: paragraphs => { @@ -4855,66 +5675,90 @@ } }] }; -/* harmony default export */ var buttons_transforms = (transforms_transforms); +/* harmony default export */ const buttons_transforms = (transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -const ALLOWED_BLOCKS = [button_name]; +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + const DEFAULT_BLOCK = { - name: button_name, + name: 'core/button', attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width'] }; - -function ButtonsEdit(_ref) { - let { - attributes: { - layout = {} - } - } = _ref; - const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); - const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _preferredStyleVariat; - - const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations; - - return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name]; +function ButtonsEdit({ + attributes, + className +}) { + var _layout$orientation; + const { + fontSize, + layout, + style + } = attributes; + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ + className: dist_clsx(className, { + 'has-custom-font-size': fontSize || style?.typography?.fontSize + }) + }); + const { + hasButtonVariations + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const buttonVariations = select(external_wp_blocks_namespaceObject.store).getBlockVariations('core/button', 'inserter'); + return { + hasButtonVariations: buttonVariations.length > 0 + }; }, []); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { - allowedBlocks: ALLOWED_BLOCKS, - __experimentalDefaultBlock: DEFAULT_BLOCK, - __experimentalDirectInsert: true, - template: [[button_name, { - className: preferredStyle && `is-style-${preferredStyle}` - }]], - __experimentalLayout: layout, - templateInsertUpdatesSelection: true - }); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); -} - -/* harmony default export */ var buttons_edit = (ButtonsEdit); + defaultBlock: DEFAULT_BLOCK, + // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. + directInsert: !hasButtonVariations, + template: [['core/button']], + templateInsertUpdatesSelection: true, + orientation: (_layout$orientation = layout?.orientation) !== null && _layout$orientation !== void 0 ? _layout$orientation : 'horizontal' + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + }); +} +/* harmony default export */ const buttons_edit = (ButtonsEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js - - -/** - * WordPress dependencies - */ - -function buttons_save_save() { - const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()); - return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function buttons_save_save({ + attributes, + className +}) { + const { + fontSize, + style + } = attributes; + const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: dist_clsx(className, { + 'has-custom-font-size': fontSize || style?.typography?.fontSize + }) + }); + const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js @@ -4923,6 +5767,7 @@ */ + /** * Internal dependencies */ @@ -4932,16 +5777,18 @@ const buttons_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/buttons", title: "Buttons", category: "design", + allowedBlocks: ["core/button"], description: "Prompt visitors to take action with a group of button-style links.", keywords: ["link"], textdomain: "default", supports: { anchor: true, align: ["wide", "full"], + html: false, __experimentalExposeControlsToChildren: true, spacing: { blockGap: true, @@ -4950,12 +5797,28 @@ blockGap: true } }, - __experimentalLayout: { + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + layout: { allowSwitching: false, allowInheriting: false, "default": { type: "flex" } + }, + interactivity: { + clientNavigation: true } }, editorStyle: "wp-block-buttons-editor", @@ -4986,59 +5849,66 @@ edit: buttons_edit, save: buttons_save_save }; +const buttons_init = () => initBlock({ + name: buttons_name, + metadata: buttons_metadata, + settings: buttons_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js - - -/** - * WordPress dependencies - */ - -const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" -})); -/* harmony default export */ var library_calendar = (calendar); - -;// CONCATENATED MODULE: external "moment" -var external_moment_namespaceObject = window["moment"]; -var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject); +/** + * WordPress dependencies + */ + + +const calendar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" + }) +}); +/* harmony default export */ const library_calendar = (calendar); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - -const getYearMonth = memize_default()(date => { +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Returns the year and month of a specified date. + * + * @see `WP_REST_Posts_Controller::prepare_date_response()`. + * + * @param {string} date Date in `ISO8601/RFC3339` format. + * @return {Object} Year and date of the specified date. + */ + +const getYearMonth = memize(date => { if (!date) { return {}; } - - const momentDate = external_moment_default()(date); + const dateObj = new Date(date); return { - year: momentDate.year(), - month: momentDate.month() + 1 - }; -}); -function CalendarEdit(_ref) { - let { - attributes - } = _ref; + year: dateObj.getFullYear(), + month: dateObj.getMonth() + 1 + }; +}); +function CalendarEdit({ + attributes +}) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { date, @@ -5055,44 +5925,49 @@ }; const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery); const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]); - - let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor. + let _date; + + // FIXME: @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor. // eslint-disable-next-line @wordpress/data-no-store-string-literals - - const editorSelectors = select('core/editor'); - if (editorSelectors) { - const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar. + const postType = editorSelectors.getEditedPostAttribute('type'); + // Dates are used to overwrite year and month used on the calendar. // This overwrite should only happen for 'post' post types. // For other post types the calendar always displays the current month. - if (postType === 'post') { _date = editorSelectors.getEditedPostAttribute('date'); } } - return { date: _date, hasPostsResolved: postsResolved, - hasPosts: postsResolved && (posts === null || posts === void 0 ? void 0 : posts.length) === 1 + hasPosts: postsResolved && posts?.length === 1 }; }, []); - if (!hasPosts) { - return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { - icon: library_calendar, - label: (0,external_wp_i18n_namespaceObject.__)('Calendar') - }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.'))); - } - - return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), { - block: "core/calendar", - attributes: { ...attributes, - ...getYearMonth(date) - } - }))); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { + icon: library_calendar, + label: (0,external_wp_i18n_namespaceObject.__)('Calendar'), + children: !hasPostsResolved ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.') + }) + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { + block: "core/calendar", + attributes: { + ...attributes, + ...getYearMonth(date) + } + }) + }) + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js @@ -5112,20 +5987,21 @@ transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives') }] }; -/* harmony default export */ var calendar_transforms = (calendar_transforms_transforms); +/* harmony default export */ const calendar_transforms = (calendar_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js /** * WordPress dependencies */ + /** * Internal dependencies */ const calendar_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/calendar", title: "Calendar", category: "widgets", @@ -5141,7 +6017,31 @@ } }, supports: { - align: true + align: true, + color: { + link: true, + __experimentalSkipSerialization: ["text", "background"], + __experimentalDefaultControls: { + background: true, + text: true + }, + __experimentalSelector: "table, th" + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + interactivity: { + clientNavigation: true + } }, style: "wp-block-calendar" }; @@ -5157,118 +6057,110 @@ edit: CalendarEdit, transforms: calendar_transforms }; +const calendar_init = () => initBlock({ + name: calendar_name, + metadata: calendar_metadata, + settings: calendar_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js - - -/** - * WordPress dependencies - */ - -const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", - fillRule: "evenodd", - clipRule: "evenodd" -})); -/* harmony default export */ var library_category = (category); - +/** + * WordPress dependencies + */ + + +const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", + fillRule: "evenodd", + clipRule: "evenodd" + }) +}); +/* harmony default export */ const library_category = (category); + +;// CONCATENATED MODULE: external ["wp","htmlEntities"] +const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js - - -/** - * WordPress dependencies - */ - -const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" -})); -/* harmony default export */ var library_pin = (pin); +/** + * WordPress dependencies + */ + + +const pin = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" + }) +}); +/* harmony default export */ const library_pin = (pin); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - -function CategoriesEdit(_ref) { - let { - attributes: { - displayAsDropdown, - showHierarchy, - showPostCounts, - showOnlyTopLevel - }, - setAttributes - } = _ref; +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + + +function CategoriesEdit({ + attributes: { + displayAsDropdown, + showHierarchy, + showPostCounts, + showOnlyTopLevel, + showEmpty + }, + setAttributes, + className +}) { const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); const query = { per_page: -1, - hide_empty: true, + hide_empty: !showEmpty, context: 'view' }; - if (showOnlyTopLevel) { query.parent = 0; } - const { records: categories, isResolving - } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('taxonomy', 'category', query); - + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', query); const getCategoriesList = parentId => { - if (!(categories !== null && categories !== void 0 && categories.length)) { + if (!categories?.length) { return []; } - if (parentId === null) { return categories; } - - return categories.filter(_ref2 => { - let { - parent - } = _ref2; - return parent === parentId; - }); - }; - - const getCategoryListClassName = level => { - return `wp-block-categories__list wp-block-categories__list-level-${level}`; - }; - + return categories.filter(({ + parent + }) => parent === parentId); + }; const toggleAttribute = attributeName => newValue => setAttributes({ [attributeName]: newValue }); - - const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim(); - + const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim(); const renderCategoryList = () => { const parentId = showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); - return (0,external_wp_element_namespaceObject.createElement)("ul", { - className: getCategoryListClassName(0) - }, categoriesList.map(category => renderCategoryListItem(category, 0))); - }; - - const renderCategoryListItem = (category, level) => { + return categoriesList.map(category => renderCategoryListItem(category)); + }; + const renderCategoryListItem = category => { const childCategories = getCategoriesList(category.id); const { id, @@ -5276,31 +6168,35 @@ count, name } = category; - return (0,external_wp_element_namespaceObject.createElement)("li", { - key: id - }, (0,external_wp_element_namespaceObject.createElement)("a", { - href: link, - target: "_blank", - rel: "noreferrer noopener" - }, renderCategoryName(name)), showPostCounts && (0,external_wp_element_namespaceObject.createElement)("span", { - className: "wp-block-categories__post-count" - }, ` (${count})`), showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", { - className: getCategoryListClassName(level + 1) - }, childCategories.map(childCategory => renderCategoryListItem(childCategory, level + 1)))); - }; - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { + className: `cat-item cat-item-${id}`, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { + href: link, + target: "_blank", + rel: "noreferrer noopener", + children: renderCategoryName(name) + }), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + className: "children", + children: childCategories.map(childCategory => renderCategoryListItem(childCategory)) + })] + }, id); + }; const renderCategoryDropdown = () => { const parentId = showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { - as: "label", - htmlFor: selectId - }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", { - id: selectId, - className: "wp-block-categories__dropdown" - }, categoriesList.map(category => renderCategoryDropdownItem(category, 0)))); - }; - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "label", + htmlFor: selectId, + children: (0,external_wp_i18n_namespaceObject.__)('Categories') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("select", { + id: selectId, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { + children: (0,external_wp_i18n_namespaceObject.__)('Select Category') + }), categoriesList.map(category => renderCategoryDropdownItem(category, 0))] + })] + }); + }; const renderCategoryDropdownItem = (category, level) => { const { id, @@ -5308,33 +6204,61 @@ name } = category; const childCategories = getCategoriesList(id); - return [(0,external_wp_element_namespaceObject.createElement)("option", { - key: id - }, (0,external_lodash_namespaceObject.times)(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; - }; - - return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Categories settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), - checked: displayAsDropdown, - onChange: toggleAttribute('displayAsDropdown') - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), - checked: showPostCounts, - onChange: toggleAttribute('showPostCounts') - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'), - checked: showOnlyTopLevel, - onChange: toggleAttribute('showOnlyTopLevel') - }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), - checked: showHierarchy, - onChange: toggleAttribute('showHierarchy') - }))), isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { - icon: library_pin, - label: (0,external_wp_i18n_namespaceObject.__)('Categories') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())); + return [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("option", { + className: `level-${level}`, + children: [Array.from({ + length: level * 3 + }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`] + }, id), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; + }; + const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div'; + const classes = dist_clsx(className, { + 'wp-block-categories-list': !!categories?.length && !displayAsDropdown && !isResolving, + 'wp-block-categories-dropdown': !!categories?.length && displayAsDropdown && !isResolving + }); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ + className: classes + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { + ...blockProps, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), + checked: displayAsDropdown, + onChange: toggleAttribute('displayAsDropdown') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), + checked: showPostCounts, + onChange: toggleAttribute('showPostCounts') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'), + checked: showOnlyTopLevel, + onChange: toggleAttribute('showOnlyTopLevel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show empty categories'), + checked: showEmpty, + onChange: toggleAttribute('showEmpty') + }), !showOnlyTopLevel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), + checked: showHierarchy, + onChange: toggleAttribute('showHierarchy') + })] + }) + }), isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { + icon: library_pin, + label: (0,external_wp_i18n_namespaceObject.__)('Categories'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) + }), !isResolving && categories?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.') + }), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())] + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js @@ -5342,15 +6266,16 @@ * WordPress dependencies */ + /** * Internal dependencies */ const categories_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/categories", - title: "Categories", + title: "Categories List", category: "widgets", description: "Display a list of all categories.", textdomain: "default", @@ -5370,11 +6295,39 @@ showOnlyTopLevel: { type: "boolean", "default": false + }, + showEmpty: { + type: "boolean", + "default": false } }, supports: { align: true, - html: false + html: false, + spacing: { + margin: true, + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false + } + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + interactivity: { + clientNavigation: true + } }, editorStyle: "wp-block-categories-editor", style: "wp-block-categories" @@ -5389,107 +6342,275 @@ example: {}, edit: CategoriesEdit }; +const categories_init = () => initBlock({ + name: categories_name, + metadata: categories_metadata, + settings: categories_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js - - -/** - * WordPress dependencies - */ - -const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" -})); -/* harmony default export */ var library_classic = (classic); +/** + * WordPress dependencies + */ + + +const classic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" + }) +}); +/* harmony default export */ const library_classic = (classic); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js - - -/** - * WordPress dependencies - */ - - - - - - -const ConvertToBlocksButton = _ref => { - let { - clientId - } = _ref; +/** + * WordPress dependencies + */ + + + + + + +const ConvertToBlocksButton = ({ + clientId +}) => { const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const block = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId); }, [clientId]); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) - })) - }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks')); -}; - -/* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - -const { - wp: edit_wp -} = window; - -function isTmceEmpty(editor) { - // When tinyMce is empty the content seems to be: - //


- // avoid expensive checks for large documents - const body = editor.getBody(); - - if (body.childNodes.length > 1) { - return false; - } else if (body.childNodes.length === 0) { - return true; - } - - if (body.childNodes[0].childNodes.length > 1) { - return false; - } - - return /^\n?$/.test(body.innerText || body.textContent); -} - -function ClassicEdit(_ref) { - let { + })), + children: (0,external_wp_i18n_namespaceObject.__)('Convert to blocks') + }); +}; +/* harmony default export */ const convert_to_blocks_button = (ConvertToBlocksButton); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js +/** + * WordPress dependencies + */ + + +const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" + }) +}); +/* harmony default export */ const library_fullscreen = (fullscreen); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/modal.js +/** + * WordPress dependencies + */ + + + + + + + + + + +function ModalAuxiliaryActions({ + onClick, + isModalFullScreen +}) { + // 'small' to match the rules in editor.scss. + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); + if (isMobileViewport) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: onClick, + icon: library_fullscreen, + isPressed: isModalFullScreen, + label: isModalFullScreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen') + }); +} +function ClassicEdit(props) { + const styles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const { + baseURL, + suffix, + settings + } = window.wpEditorL10n.tinymce; + window.tinymce.EditorManager.overrideDefaults({ + base_url: baseURL, + suffix + }); + window.wp.oldEditor.initialize(props.id, { + tinymce: { + ...settings, + setup(editor) { + editor.on('init', () => { + const doc = editor.getDoc(); + styles.forEach(({ + css + }) => { + const styleEl = doc.createElement('style'); + styleEl.innerHTML = css; + doc.head.appendChild(styleEl); + }); + }); + } + } + }); + return () => { + window.wp.oldEditor.remove(props.id); + }; + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { + ...props + }); +} +function ModalEdit(props) { + const { clientId, attributes: { content }, setAttributes, onReplace - } = _ref; + } = props; + const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const [isModalFullScreen, setIsModalFullScreen] = (0,external_wp_element_namespaceObject.useState)(false); + const id = `editor-${clientId}`; + const onClose = () => content ? setOpen(false) : onReplace([]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { + onClick: () => setOpen(true), + children: (0,external_wp_i18n_namespaceObject.__)('Edit') + }) + }) + }), content && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { + children: content + }), (isOpen || !content) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { + title: (0,external_wp_i18n_namespaceObject.__)('Classic Editor'), + onRequestClose: onClose, + shouldCloseOnClickOutside: false, + overlayClassName: "block-editor-freeform-modal", + isFullScreen: isModalFullScreen, + className: "block-editor-freeform-modal__content", + headerActions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalAuxiliaryActions, { + onClick: () => setIsModalFullScreen(!isModalFullScreen), + isModalFullScreen: isModalFullScreen + }), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClassicEdit, { + id: id, + defaultValue: content + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { + className: "block-editor-freeform-modal__actions", + justify: "flex-end", + expanded: false, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "primary", + onClick: () => { + setAttributes({ + content: window.wp.oldEditor.getContent(id) + }); + setOpen(false); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Save') + }) + })] + })] + })] + }); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + +const { + wp +} = window; +function isTmceEmpty(editor) { + // When tinyMce is empty the content seems to be: + //


+ // avoid expensive checks for large documents + const body = editor.getBody(); + if (body.childNodes.length > 1) { + return false; + } else if (body.childNodes.length === 0) { + return true; + } + if (body.childNodes[0].childNodes.length > 1) { + return false; + } + return /^\n?$/.test(body.innerText || body.textContent); +} +function FreeformEdit(props) { + const { + clientId + } = props; + const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); + const [isIframed, setIsIframed] = (0,external_wp_element_namespaceObject.useState)(false); + const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(element => { + setIsIframed(element.ownerDocument !== document); + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(convert_to_blocks_button, { + clientId: clientId + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ + ref + }), + children: isIframed ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalEdit, { + ...props + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ClassicEdit, { + ...props + }) + })] + }); +} +function edit_ClassicEdit({ + clientId, + attributes: { + content + }, + setAttributes, + onReplace +}) { const { getMultiSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); @@ -5498,14 +6619,15 @@ if (!didMount.current) { return; } - const editor = window.tinymce.get(`editor-${clientId}`); - const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent(); - + if (!editor) { + return; + } + const currentContent = editor.getContent(); if (currentContent !== content) { editor.setContent(content || ''); } - }, [content]); + }, [clientId, content]); (0,external_wp_element_namespaceObject.useEffect)(() => { const { baseURL, @@ -5516,35 +6638,29 @@ base_url: baseURL, suffix }); - function onSetup(editor) { let bookmark; - if (content) { editor.on('loadContent', () => editor.setContent(content)); } - editor.on('blur', () => { - var _getMultiSelectedBloc; - - bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451. + bookmark = editor.selection.getBookmark(2, true); + // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451. // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking // scroll position until this is fixed in core. - const scrollContainer = document.querySelector('.interface-interface-skeleton__content'); - const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks. + const scrollPosition = scrollContainer.scrollTop; + + // Only update attributes if we aren't multi-selecting blocks. // Updating during multi-selection can overwrite attributes of other blocks. - - if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) { + if (!getMultiSelectedBlockClientIds()?.length) { setAttributes({ content: editor.getContent() }); } - editor.once('focus', () => { if (bookmark) { editor.selection.moveToBookmark(bookmark); - if (scrollContainer.scrollTop !== scrollPosition) { scrollContainer.scrollTop = scrollPosition; } @@ -5555,9 +6671,8 @@ editor.on('mousedown touchstart', () => { bookmark = null; }); - const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => { + const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => { const value = editor.getContent(); - if (value !== editor._lastChange) { editor._lastChange = value; setAttributes({ @@ -5565,24 +6680,23 @@ }); } }, 250); - editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove + editor.on('Paste Change input Undo Redo', debouncedOnChange); + + // We need to cancel the debounce call because when we remove // the editor (onUnmount) this callback is executed in // another tick. This results in setting the content to empty. - editor.on('remove', debouncedOnChange.cancel); editor.on('keydown', event => { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) { // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected. event.stopPropagation(); } - if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) { // Delete the block. onReplace([]); event.preventDefault(); event.stopImmediatePropagation(); } - const { altKey } = event; @@ -5590,27 +6704,27 @@ * Prevent Mousetrap from kicking in: TinyMCE already uses its own * `alt+f10` shortcut to focus its toolbar. */ - if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) { event.stopPropagation(); } }); editor.on('init', () => { - const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor. - + const rootNode = editor.getBody(); + + // Create the toolbar by refocussing the editor. if (rootNode.ownerDocument.activeElement === rootNode) { rootNode.blur(); editor.focus(); } }); } - function initialize() { const { settings } = window.wpEditorL10n.tinymce; - edit_wp.oldEditor.initialize(`editor-${clientId}`, { - tinymce: { ...settings, + wp.oldEditor.initialize(`editor-${clientId}`, { + tinymce: { + ...settings, inline: true, content_css: false, fixed_toolbar_container: `#toolbar-${clientId}`, @@ -5618,79 +6732,72 @@ } }); } - function onReadyStateChange() { if (document.readyState === 'complete') { initialize(); } } - if (document.readyState === 'complete') { initialize(); } else { document.addEventListener('readystatechange', onReadyStateChange); } - return () => { document.removeEventListener('readystatechange', onReadyStateChange); - edit_wp.oldEditor.remove(`editor-${clientId}`); + wp.oldEditor.remove(`editor-${clientId}`); + didMount.current = false; }; }, []); - function focus() { const editor = window.tinymce.get(`editor-${clientId}`); - if (editor) { editor.focus(); } } - function onToolbarKeyDown(event) { // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar. - event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar. - + event.stopPropagation(); + // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar. event.nativeEvent.stopImmediatePropagation(); - } // Disable reasons: + } + + // Disable reasons: // // jsx-a11y/no-static-element-interactions // - the toolbar itself is non-interactive, but must capture events // from the KeyboardShortcuts component to stop their propagation. /* eslint-disable jsx-a11y/no-static-element-interactions */ - - - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, { - clientId: clientId - }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", { - key: "toolbar", - id: `toolbar-${clientId}`, - className: "block-library-classic__toolbar", - onClick: focus, - "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), - onKeyDown: onToolbarKeyDown - }), (0,external_wp_element_namespaceObject.createElement)("div", { - key: "editor", - id: `editor-${clientId}`, - className: "wp-block-freeform block-library-rich-text__tinymce" - }))); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + id: `toolbar-${clientId}`, + className: "block-library-classic__toolbar", + onClick: focus, + "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), + onKeyDown: onToolbarKeyDown + }, "toolbar"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + id: `editor-${clientId}`, + className: "wp-block-freeform block-library-rich-text__tinymce" + }, "editor")] + }); /* eslint-enable jsx-a11y/no-static-element-interactions */ } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js - - -/** - * WordPress dependencies - */ - -function freeform_save_save(_ref) { - let { - attributes - } = _ref; +/** + * WordPress dependencies + */ + + +function freeform_save_save({ + attributes +}) { const { content } = attributes; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { + children: content + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js @@ -5698,6 +6805,7 @@ * WordPress dependencies */ + /** * Internal dependencies */ @@ -5705,7 +6813,7 @@ const freeform_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/freeform", title: "Classic", category: "text", @@ -5714,7 +6822,7 @@ attributes: { content: { type: "string", - source: "html" + source: "raw" } }, supports: { @@ -5731,58 +6839,71 @@ const freeform_settings = { icon: library_classic, - edit: ClassicEdit, + edit: FreeformEdit, save: freeform_save_save }; +const freeform_init = () => initBlock({ + name: freeform_name, + metadata: freeform_metadata, + settings: freeform_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js - - -/** - * WordPress dependencies - */ - -const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" -})); -/* harmony default export */ var library_code = (code); +/** + * WordPress dependencies + */ + + +const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" + }) +}); +/* harmony default export */ const library_code = (code); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js - - -/** - * WordPress dependencies - */ - - -function CodeEdit(_ref) { - let { - attributes, - setAttributes, - onRemove - } = _ref; +/** + * WordPress dependencies + */ + + + + +function CodeEdit({ + attributes, + setAttributes, + onRemove, + insertBlocksAfter, + mergeBlocks +}) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); - return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { - tagName: "code", - value: attributes.content, - onChange: content => setAttributes({ - content - }), - onRemove: onRemove, - placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), - preserveWhiteSpace: true, - __unstablePastePlainText: true - })); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { + tagName: "code", + identifier: "content", + value: attributes.content, + onChange: content => setAttributes({ + content + }), + onRemove: onRemove, + onMerge: mergeBlocks, + placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), + preserveWhiteSpace: true, + __unstablePastePlainText: true, + __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) + }) + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js /** - * External dependencies - */ + * WordPress dependencies + */ + /** * Escapes ampersands, shortcodes, and links. @@ -5790,10 +6911,10 @@ * @param {string} content The content of a code block. * @return {string} The given content with some characters escaped. */ - function utils_escape(content) { - return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); -} + return (0,external_wp_compose_namespaceObject.pipe)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); +} + /** * Returns the given content with all opening shortcode characters converted * into their HTML entity counterpart (i.e. [ => [). For instance, a @@ -5807,10 +6928,10 @@ * converted into their HTML entity counterpart * (i.e. [ => [) */ - function escapeOpeningSquareBrackets(content) { return content.replace(/\[/g, '['); } + /** * Converts the first two forward slashes of any isolated URL into their HTML * counterparts (i.e. // => //). For instance, https://youtube.com/watch?x @@ -5825,32 +6946,37 @@ * @return {string} The given content with its ampersands converted into * their HTML entity counterpart (i.e. & => &) */ - - function escapeProtocolInIsolatedUrls(content) { return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js - - -/** - * WordPress dependencies - */ - -/** - * Internal dependencies - */ - - -function code_save_save(_ref) { - let { - attributes - } = _ref; - return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { - tagName: "code", - value: utils_escape(attributes.content) - })); +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function code_save_save({ + attributes +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: "code" + // To do: `escape` encodes characters in shortcodes and URLs to + // prevent embedding in PHP. Ideally checks for the code block, + // or pre/code tags, should be made on the PHP side? + , + value: utils_escape(typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString({ + preserveWhiteSpace: true + })) + }) + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js @@ -5858,6 +6984,12 @@ * WordPress dependencies */ + + +/** + * Internal dependencies + */ + const code_transforms_transforms = { from: [{ type: 'enter', @@ -5865,13 +6997,30 @@ transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code') }, { type: 'block', - blocks: ['core/html', 'core/paragraph'], - transform: _ref => { - let { - content - } = _ref; + blocks: ['core/paragraph'], + transform: ({ + content, + metadata + }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { + content, + metadata: getTransformedMetadata(metadata, 'core/code') + }) + }, { + type: 'block', + blocks: ['core/html'], + transform: ({ + content: text, + metadata + }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { - content + // The HTML is plain text (with plain line breaks), so + // convert it to rich text. + content: (0,external_wp_richText_namespaceObject.toHTMLString)({ + value: (0,external_wp_richText_namespaceObject.create)({ + text + }) + }), + metadata: getTransformedMetadata(metadata, 'core/code') }); } }, { @@ -5888,9 +7037,20 @@ } } } + }], + to: [{ + type: 'block', + blocks: ['core/paragraph'], + transform: ({ + content, + metadata + }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content, + metadata: getTransformedMetadata(metadata, 'core/paragraph') + }) }] }; -/* harmony default export */ var code_transforms = (code_transforms_transforms); +/* harmony default export */ const code_transforms = (code_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js /** @@ -5898,6 +7058,7 @@ */ + /** * Internal dependencies */ @@ -5905,7 +7066,7 @@ const code_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/code", title: "Code", category: "text", @@ -5913,27 +7074,35 @@ textdomain: "default", attributes: { content: { - type: "string", - source: "html", - selector: "code" - } - }, - supports: { - anchor: true, - typography: { - fontSize: true, - lineHeight: true, - __experimentalFontStyle: true, - __experimentalFontWeight: true, - __experimentalLetterSpacing: true, - __experimentalTextTransform: true, + type: "rich-text", + source: "rich-text", + selector: "code", + __unstablePreserveWhiteSpace: true + } + }, + supports: { + align: ["wide"], + anchor: true, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { margin: ["top", "bottom"], - padding: true + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false + } }, __experimentalBorder: { radius: true, @@ -5953,6 +7122,9 @@ background: true, text: true } + }, + interactivity: { + clientNavigation: true } }, style: "wp-block-code" @@ -5969,37 +7141,45 @@ attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Preserve \n markers for line breaks - content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );') + content: (0,external_wp_i18n_namespaceObject.__)('// A “block” is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ - - } + } + }, + merge(attributes, attributesToMerge) { + return { + content: attributes.content + '\n\n' + attributesToMerge.content + }; }, transforms: code_transforms, edit: CodeEdit, save: code_save_save }; +const code_init = () => initBlock({ + name: code_name, + metadata: code_metadata, + settings: code_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js - - -/** - * WordPress dependencies - */ - -const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" -})); -/* harmony default export */ var library_column = (column); +/** + * WordPress dependencies + */ + + +const column = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" + }) +}); +/* harmony default export */ const library_column = (column); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js - - -/** - * External dependencies - */ +/** + * External dependencies + */ + /** * WordPress dependencies @@ -6017,76 +7197,93 @@ max: 100 } }, - - isEligible(_ref) { - let { - width - } = _ref; + isEligible({ + width + }) { return isFinite(width); }, - migrate(attributes) { - return { ...attributes, + return { + ...attributes, width: `${attributes.width}%` }; }, - - save(_ref2) { - let { - attributes - } = _ref2; + save({ + attributes + }) { const { verticalAlignment, width } = attributes; - const wrapperClasses = classnames_default()({ + const wrapperClasses = dist_clsx({ [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); const style = { flexBasis: width + '%' }; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: wrapperClasses, - style: style - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - } - + style: style, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } }]; -/* harmony default export */ var column_deprecated = (column_deprecated_deprecated); +/* harmony default export */ const column_deprecated = (column_deprecated_deprecated); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - - -function ColumnEdit(_ref) { - let { - attributes: { - verticalAlignment, - width, - templateLock = false, - allowedBlocks - }, - setAttributes, - clientId - } = _ref; - const classes = classnames_default()('block-core-columns', { +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +function ColumnInspectorControls({ + width, + setAttributes +}) { + const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + labelPosition: "edge", + __unstableInputWidth: "80px", + value: width || '', + onChange: nextWidth => { + nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; + setAttributes({ + width: nextWidth + }); + }, + units: units + }) + }); +} +function ColumnEdit({ + attributes: { + verticalAlignment, + width, + templateLock, + allowedBlocks + }, + setAttributes, + clientId +}) { + const classes = dist_clsx('block-core-columns', { [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); - const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ - availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw'] - }); const { columnsIds, hasChildBlocks, @@ -6106,18 +7303,16 @@ const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const updateAlignment = value => { // Update own alignment. setAttributes({ verticalAlignment: value - }); // Reset parent Columns block. - + }); + // Reset parent Columns block. updateBlockAttributes(rootClientId, { verticalAlignment: null }); }; - const widthWithUnit = Number.isFinite(width) ? width + '%' : width; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes, @@ -6127,84 +7322,78 @@ }); const columnsCount = columnsIds.length; const currentColumnPosition = columnsIds.indexOf(clientId) + 1; - const label = (0,external_wp_i18n_namespaceObject.sprintf)( - /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ + const label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); - const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps, + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ + ...blockProps, 'aria-label': label }, { templateLock, allowedBlocks, renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { - onChange: updateAlignment, - value: verticalAlignment - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Column settings') - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Width'), - labelPosition: "edge", - __unstableInputWidth: "80px", - value: width || '', - onChange: nextWidth => { - nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; - setAttributes({ - width: nextWidth - }); - }, - units: units - }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); -} - -/* harmony default export */ var column_edit = (ColumnEdit); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { + onChange: updateAlignment, + value: verticalAlignment, + controls: ['top', 'center', 'bottom', 'stretch'] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColumnInspectorControls, { + width: width, + setAttributes: setAttributes + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + })] + }); +} +/* harmony default export */ const column_edit = (ColumnEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -function column_save_save(_ref) { - let { - attributes - } = _ref; +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function column_save_save({ + attributes +}) { const { verticalAlignment, width } = attributes; - const wrapperClasses = classnames_default()({ + const wrapperClasses = dist_clsx({ [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); let style; - if (width && /\d/.test(width)) { // Numbers are handled for backward compatibility as they can be still provided with templates. - let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float. - - if (!Number.isFinite(width) && width !== null && width !== void 0 && width.endsWith('%')) { - const multiplier = 1000000000000; // Shrink the number back to a reasonable float. - + let flexBasis = Number.isFinite(width) ? width + '%' : width; + // In some cases we need to round the width to a shorter float. + if (!Number.isFinite(width) && width?.endsWith('%')) { + const multiplier = 1000000000000; + // Shrink the number back to a reasonable float. flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%'; } - style = { flexBasis }; } - const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses, style }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); - return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js @@ -6212,6 +7401,7 @@ * WordPress dependencies */ + /** * Internal dependencies */ @@ -6220,10 +7410,10 @@ const column_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/column", title: "Column", - category: "text", + category: "design", parent: ["core/columns"], description: "A single column within a columns block.", textdomain: "default", @@ -6239,29 +7429,60 @@ }, templateLock: { type: ["string", "boolean"], - "enum": ["all", "insert", false] - } - }, - supports: { + "enum": ["all", "insert", "contentOnly", false] + } + }, + supports: { + __experimentalOnEnter: true, anchor: true, reusable: false, html: false, color: { gradients: true, + heading: true, + button: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, + shadow: true, spacing: { blockGap: true, padding: true, __experimentalDefaultControls: { - padding: true - } - }, - __experimentalLayout: true + padding: true, + blockGap: true + } + }, + __experimentalBorder: { + color: true, + style: true, + width: true, + __experimentalDefaultControls: { + color: true, + style: true, + width: true + } + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + layout: true, + interactivity: { + clientNavigation: true + } } }; @@ -6275,25 +7496,30 @@ save: column_save_save, deprecated: column_deprecated }; +const column_init = () => initBlock({ + name: column_name, + metadata: column_metadata, + settings: column_settings +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js - - -/** - * WordPress dependencies - */ - -const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z" -})); -/* harmony default export */ var library_columns = (columns); +/** + * WordPress dependencies + */ + + +const columns = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z" + }) +}); +/* harmony default export */ const library_columns = (columns); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js - - /** * External dependencies */ @@ -6312,53 +7538,50 @@ * * @param {string} originalContent Deprecated Columns inner block HTML. * - * @return {?number} Column to which inner block is to be assigned. + * @return {number | undefined} Column to which inner block is to be assigned. */ function getDeprecatedLayoutColumn(originalContent) { let { doc } = getDeprecatedLayoutColumn; - if (!doc) { doc = document.implementation.createHTMLDocument(''); getDeprecatedLayoutColumn.doc = doc; } - let columnMatch; doc.body.innerHTML = originalContent; - for (const classListItem of doc.body.firstChild.classList) { if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { return Number(columnMatch[1]) - 1; } } } - const migrateCustomColors = attributes => { if (!attributes.customTextColor && !attributes.customBackgroundColor) { return attributes; } - const style = { color: {} }; - if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } - if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } - - return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']), + const { + customTextColor, + customBackgroundColor, + ...restAttributes + } = attributes; + return { + ...restAttributes, style, isStackedOnMobile: true }; }; - -/* harmony default export */ var columns_deprecated = ([{ +/* harmony default export */ const columns_deprecated = ([{ attributes: { verticalAlignment: { type: 'string' @@ -6377,11 +7600,9 @@ } }, migrate: migrateCustomColors, - - save(_ref) { - let { - attributes - } = _ref; + save({ + attributes + }) { const { verticalAlignment, backgroundColor, @@ -6391,7 +7612,7 @@ } = attributes; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); - const className = classnames_default()({ + const className = dist_clsx({ 'has-background': backgroundColor || customBackgroundColor, 'has-text-color': textColor || customTextColor, [backgroundClass]: backgroundClass, @@ -6402,12 +7623,12 @@ backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className ? className : undefined, - style: style - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - } - + style: style, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } }, { attributes: { columns: { @@ -6415,59 +7636,56 @@ default: 2 } }, - isEligible(attributes, innerBlocks) { // Since isEligible is called on every valid instance of the // Columns block and a deprecation is the unlikely case due to // its subsequent migration, optimize for the `false` condition // by performing a naive, inaccurate pass at inner blocks. const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent)); - if (!isFastPassEligible) { return false; - } // Only if the fast pass is considered eligible is the more + } + + // Only if the fast pass is considered eligible is the more // accurate, durable, slower condition performed. - - return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined); }, - migrate(attributes, innerBlocks) { const columns = innerBlocks.reduce((accumulator, innerBlock) => { const { originalContent } = innerBlock; let columnIndex = getDeprecatedLayoutColumn(originalContent); - if (columnIndex === undefined) { columnIndex = 0; } - if (!accumulator[columnIndex]) { accumulator[columnIndex] = []; } - accumulator[columnIndex].push(innerBlock); return accumulator; }, []); const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks)); - return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']), + const { + columns: ignoredColumns, + ...restAttributes + } = attributes; + return [{ + ...restAttributes, isStackedOnMobile: true }, migratedInnerBlocks]; }, - - save(_ref2) { - let { - attributes - } = _ref2; + save({ + attributes + }) { const { columns } = attributes; - return (0,external_wp_element_namespaceObject.createElement)("div", { - className: `has-${columns}-columns` - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - } - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: `has-${columns}-columns`, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } }, { attributes: { columns: { @@ -6475,38 +7693,36 @@ default: 2 } }, - migrate(attributes, innerBlocks) { - attributes = { ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']), + const { + columns, + ...restAttributes + } = attributes; + attributes = { + ...restAttributes, isStackedOnMobile: true }; return [attributes, innerBlocks]; }, - - save(_ref3) { - let { - attributes - } = _ref3; + save({ + attributes + }) { const { verticalAlignment, columns } = attributes; - const wrapperClasses = classnames_default()(`has-${columns}-columns`, { + const wrapperClasses = dist_clsx(`has-${columns}-columns`, { [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); - return (0,external_wp_element_namespaceObject.createElement)("div", { - className: wrapperClasses - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); - } - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: wrapperClasses, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } }]); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js /** - * External dependencies - */ - -/** * Returns a column width attribute value rounded to standard precision. * Returns `undefined` if the value is not a valid finite number. * @@ -6514,7 +7730,6 @@ * * @return {number} Value rounded to standard precision. */ - const toWidthPrecision = value => { const unitlessValue = parseFloat(value); return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined; @@ -6528,13 +7743,13 @@ * * @return {number} Effective column width. */ - function getEffectiveColumnWidth(block, totalBlockCount) { const { width = 100 / totalBlockCount } = block.attributes; return toWidthPrecision(width); } + /** * Returns the total width occupied by the given set of column blocks. * @@ -6544,11 +7759,10 @@ * * @return {number} Total width occupied by blocks. */ - -function getTotalColumnsWidth(blocks) { - let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length; - return (0,external_lodash_namespaceObject.sumBy)(blocks, block => getEffectiveColumnWidth(block, totalBlockCount)); -} +function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { + return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0); +} + /** * Returns an object of `clientId` → `width` of effective column widths. * @@ -6558,9 +7772,7 @@ * * @return {Object} Column widths. */ - -function getColumnWidths(blocks) { - let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length; +function getColumnWidths(blocks, totalBlockCount = blocks.length) { return blocks.reduce((accumulator, block) => { const width = getEffectiveColumnWidth(block, totalBlockCount); return Object.assign(accumulator, { @@ -6568,6 +7780,7 @@ }); }, {}); } + /** * Returns an object of `clientId` → `width` of column widths as redistributed * proportional to their current widths, constrained or expanded to fit within @@ -6580,15 +7793,14 @@ * * @return {Object} Redistributed column widths. */ - -function getRedistributedColumnWidths(blocks, availableWidth) { - let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length; +function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); - return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => { + return Object.fromEntries(Object.entries(getColumnWidths(blocks, totalBlockCount)).map(([clientId, width]) => { const newWidth = availableWidth * width / totalWidth; - return toWidthPrecision(newWidth); - }); -} + return [clientId, toWidthPrecision(newWidth)]; + })); +} + /** * Returns true if column blocks within the provided set are assigned with * explicit widths, or false otherwise. @@ -6597,15 +7809,13 @@ * * @return {boolean} Whether columns have explicit widths. */ - function hasExplicitPercentColumnWidths(blocks) { return blocks.every(block => { - var _blockWidth$endsWith; - const blockWidth = block.attributes.width; - return Number.isFinite(blockWidth !== null && blockWidth !== void 0 && (_blockWidth$endsWith = blockWidth.endsWith) !== null && _blockWidth$endsWith !== void 0 && _blockWidth$endsWith.call(blockWidth, '%') ? parseFloat(blockWidth) : blockWidth); - }); -} + return Number.isFinite(blockWidth?.endsWith?.('%') ? parseFloat(blockWidth) : blockWidth); + }); +} + /** * Returns a copy of the given set of blocks with new widths assigned from the * provided object of redistributed column widths. @@ -6615,14 +7825,16 @@ * * @return {WPBlock[]} blocks Mapped block objects. */ - function getMappedColumnWidths(blocks, widths) { - return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, { + return blocks.map(block => ({ + ...block, attributes: { + ...block.attributes, width: `${widths[block.clientId]}%` } })); } + /** * Returns an array with columns widths values, parsed or no depends on `withParsing` flag. * @@ -6631,14 +7843,13 @@ * * @return {Array} Column widths. */ - -function getWidths(blocks) { - let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; +function getWidths(blocks, withParsing = true) { return blocks.map(innerColumn => { const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length; return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth; }); } + /** * Returns a column width with unit. * @@ -6647,16 +7858,14 @@ * * @return {string} Column width with unit. */ - function getWidthWithUnit(width, unit) { width = 0 > parseFloat(width) ? '0' : width; - if (isPercentageUnit(unit)) { width = Math.min(width, 100); } - return `${width}${unit}`; } + /** * Returns a boolean whether passed unit is percentage * @@ -6664,128 +7873,73 @@ * * @return {boolean} Whether unit is '%'. */ - function isPercentageUnit(unit) { return unit === '%'; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js - - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - -/** - * Allowed blocks constant is passed to InnerBlocks precisely as specified here. - * The contents of the array should never change. - * The array should contain the name of each block that is allowed. - * In columns block, the only block we allow is 'core/column'. - * - * @constant - * @type {string[]} - */ - -const edit_ALLOWED_BLOCKS = ['core/column']; - -function ColumnsEditContainer(_ref) { - let { - attributes, - setAttributes, - updateAlignment, - updateColumns, - clientId - } = _ref; - const { - isStackedOnMobile, - verticalAlignment - } = attributes; - const { - count +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const edit_DEFAULT_BLOCK = { + name: 'core/column' +}; +function edit_ColumnInspectorControls({ + clientId, + setAttributes, + isStackedOnMobile +}) { + const { + count, + canInsertColumnBlock, + minCount } = (0,external_wp_data_namespaceObject.useSelect)(select => { - return { - count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId) + const { + canInsertBlockType, + canRemoveBlock, + getBlocks, + getBlockCount + } = select(external_wp_blockEditor_namespaceObject.store); + const innerBlocks = getBlocks(clientId); + + // Get the indexes of columns for which removal is prevented. + // The highest index will be used to determine the minimum column count. + const preventRemovalBlockIndexes = innerBlocks.reduce((acc, block, index) => { + if (!canRemoveBlock(block.clientId)) { + acc.push(index); + } + return acc; + }, []); + return { + count: getBlockCount(clientId), + canInsertColumnBlock: canInsertBlockType('core/column', clientId), + minCount: Math.max(...preventRemovalBlockIndexes) + 1 }; }, [clientId]); - const classes = classnames_default()({ - [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, - [`is-not-stacked-on-mobile`]: !isStackedOnMobile - }); - const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ - className: classes - }); - const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { - allowedBlocks: edit_ALLOWED_BLOCKS, - orientation: 'horizontal', - renderAppender: false - }); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { - onChange: updateAlignment, - value: verticalAlignment - })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Columns'), - value: count, - onChange: value => updateColumns(count, value), - min: 1, - max: Math.max(6, count) - }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { - status: "warning", - isDismissible: false - }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), - checked: isStackedOnMobile, - onChange: () => setAttributes({ - isStackedOnMobile: !isStackedOnMobile - }) - }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)); -} - -const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({ - /** - * Update all child Column blocks with a new vertical alignment setting - * based on whatever alignment is passed in. This allows change to parent - * to overide anything set on a individual column basis. - * - * @param {string} verticalAlignment the vertical alignment setting - */ - updateAlignment(verticalAlignment) { - const { - clientId, - setAttributes - } = ownProps; - const { - updateBlockAttributes - } = dispatch(external_wp_blockEditor_namespaceObject.store); - const { - getBlockOrder - } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment. - - setAttributes({ - verticalAlignment - }); // Update all child Column Blocks to match. - - const innerBlockClientIds = getBlockOrder(clientId); - innerBlockClientIds.forEach(innerBlockClientId => { - updateBlockAttributes(innerBlockClientId, { - verticalAlignment - }); - }); - }, + const { + getBlocks + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const { + replaceInnerBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); /** * Updates the column count, including necessary revisions to child Column @@ -6794,59 +7948,146 @@ * @param {number} previousColumns Previous column count. * @param {number} newColumns New column count. */ - updateColumns(previousColumns, newColumns) { - const { - clientId - } = ownProps; - const { - replaceInnerBlocks - } = dispatch(external_wp_blockEditor_namespaceObject.store); - const { - getBlocks - } = registry.select(external_wp_blockEditor_namespaceObject.store); + function updateColumns(previousColumns, newColumns) { let innerBlocks = getBlocks(clientId); - const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks. - + const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); + + // Redistribute available width for existing inner blocks. const isAddingColumn = newColumns > previousColumns; - if (isAddingColumn && hasExplicitWidths) { // If adding a new column, assign width to the new column equal to // as if it were `1 / columns` of the total available space. - const newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as + const newColumnWidth = toWidthPrecision(100 / newColumns); + const newlyAddedColumns = newColumns - previousColumns; + + // Redistribute in consideration of pending block insertion as // constraining the available working width. - - const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth); - innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => { + const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth * newlyAddedColumns); + innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({ + length: newlyAddedColumns + }).map(() => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', { width: `${newColumnWidth}%` }); })]; } else if (isAddingColumn) { - innerBlocks = [...innerBlocks, ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => { + innerBlocks = [...innerBlocks, ...Array.from({ + length: newColumns - previousColumns + }).map(() => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/column'); })]; - } else { + } else if (newColumns < previousColumns) { // The removed column will be the last of the inner blocks. - innerBlocks = (0,external_lodash_namespaceObject.dropRight)(innerBlocks, previousColumns - newColumns); - + innerBlocks = innerBlocks.slice(0, -(previousColumns - newColumns)); if (hasExplicitWidths) { // Redistribute as if block is already removed. const widths = getRedistributedColumnWidths(innerBlocks, 100); innerBlocks = getMappedColumnWidths(innerBlocks, widths); } } - replaceInnerBlocks(clientId, innerBlocks); } - -}))(ColumnsEditContainer); - -function Placeholder(_ref2) { - let { - clientId, - name, - setAttributes - } = _ref2; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { + title: (0,external_wp_i18n_namespaceObject.__)('Settings'), + children: [canInsertColumnBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), + value: count, + onChange: value => updateColumns(count, Math.max(minCount, value)), + min: Math.max(1, minCount), + max: Math.max(6, count) + }), count > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { + status: "warning", + isDismissible: false, + children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), + checked: isStackedOnMobile, + onChange: () => setAttributes({ + isStackedOnMobile: !isStackedOnMobile + }) + })] + }); +} +function ColumnsEditContainer({ + attributes, + setAttributes, + clientId +}) { + const { + isStackedOnMobile, + verticalAlignment, + templateLock + } = attributes; + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + getBlockOrder + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + const { + updateBlockAttributes + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const classes = dist_clsx({ + [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, + [`is-not-stacked-on-mobile`]: !isStackedOnMobile + }); + const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ + className: classes + }); + const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { + defaultBlock: edit_DEFAULT_BLOCK, + directInsert: true, + orientation: 'horizontal', + renderAppender: false, + templateLock + }); + + /** + * Update all child Column blocks with a new vertical alignment setting + * based on whatever alignment is passed in. This allows change to parent + * to overide anything set on a individual column basis. + * + * @param {string} newVerticalAlignment The vertical alignment setting. + */ + function updateAlignment(newVerticalAlignment) { + const innerBlockClientIds = getBlockOrder(clientId); + + // Update own and child Column block vertical alignments. + // This is a single action; the batching prevents creating multiple history records. + registry.batch(() => { + setAttributes({ + verticalAlignment: newVerticalAlignment + }); + updateBlockAttributes(innerBlockClientIds, { + verticalAlignment: newVerticalAlignment + }); + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { + onChange: updateAlignment, + value: verticalAlignment + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ColumnInspectorControls, { + clientId: clientId, + setAttributes: setAttributes, + isStackedOnMobile: isStackedOnMobile + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + })] + }); +} +function Placeholder({ + clientId, + name, + setAttributes +}) { const { blockType, defaultVariation, @@ -6867,57 +8108,56 @@ replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); - return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { - icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']), - label: (0,external_lodash_namespaceObject.get)(blockType, ['title']), - variations: variations, - onSelect: function () { - let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation; - - if (nextVariation.attributes) { - setAttributes(nextVariation.attributes); - } - - if (nextVariation.innerBlocks) { - replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); - } - }, - allowSkip: true - })); -} - + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { + icon: blockType?.icon?.src, + label: blockType?.title, + variations: variations, + instructions: (0,external_wp_i18n_namespaceObject.__)('Divide into columns. Select a layout:'), + onSelect: (nextVariation = defaultVariation) => { + if (nextVariation.attributes) { + setAttributes(nextVariation.attributes); + } + if (nextVariation.innerBlocks) { + replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); + } + }, + allowSkip: true + }) + }); +} const ColumnsEdit = props => { const { clientId } = props; const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]); - const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder; - return (0,external_wp_element_namespaceObject.createElement)(Component, props); -}; - -/* harmony default export */ var columns_edit = (ColumnsEdit); + const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { + ...props + }); +}; +/* harmony default export */ const columns_edit = (ColumnsEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js - - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - -function columns_save_save(_ref) { - let { - attributes - } = _ref; +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function columns_save_save({ + attributes +}) { const { isStackedOnMobile, verticalAlignment } = attributes; - const className = classnames_default()({ + const className = dist_clsx({ [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, [`is-not-stacked-on-mobile`]: !isStackedOnMobile }); @@ -6925,15 +8165,16 @@ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); - return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...innerBlocksProps + }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js - - -/** - * WordPress dependencies - */ +/** + * WordPress dependencies + */ + /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ @@ -6948,49 +8189,46 @@ name: 'one-column-full', title: (0,external_wp_i18n_namespaceObject.__)('100'), description: (0,external_wp_i18n_namespaceObject.__)('One column'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" + }) + }), innerBlocks: [['core/column']], scope: ['block'] }, { name: 'two-columns-equal', title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" + }) + }), isDefault: true, innerBlocks: [['core/column'], ['core/column']], scope: ['block'] }, { name: 'two-columns-one-third-two-thirds', - title: (0,external_wp_i18n_namespaceObject.__)('30 / 70'), + title: (0,external_wp_i18n_namespaceObject.__)('33 / 66'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" + }) + }), innerBlocks: [['core/column', { width: '33.33%' }], ['core/column', { @@ -6999,18 +8237,17 @@ scope: ['block'] }, { name: 'two-columns-two-thirds-one-third', - title: (0,external_wp_i18n_namespaceObject.__)('70 / 30'), + title: (0,external_wp_i18n_namespaceObject.__)('66 / 33'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" + }) + }), innerBlocks: [['core/column', { width: '66.66%' }], ['core/column', { @@ -7021,30 +8258,30 @@ name: 'three-columns-equal', title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'), description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" + }) + }), innerBlocks: [['core/column'], ['core/column'], ['core/column']], scope: ['block'] }, { name: 'three-columns-wider-center', title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'), description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'), - icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { + icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", - xmlns: "http://www.w3.org/2000/svg" - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { - fillRule: "evenodd", - d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z" - })), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { + d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" + }) + }), innerBlocks: [['core/column', { width: '25%' }], ['core/column', { @@ -7054,7 +8291,7 @@ }]], scope: ['block'] }]; -/* harmony default export */ var columns_variations = (variations); +/* harmony default export */ const columns_variations = (variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js /** @@ -7069,23 +8306,27 @@ blocks: ['*'], __experimentalConvert: blocks => { const columnWidth = +(100 / blocks.length).toFixed(2); - const innerBlocksTemplate = blocks.map(_ref => { - let { - name, - attributes, - innerBlocks - } = _ref; - return ['core/column', { - width: `${columnWidth}%` - }, [[name, { ...attributes - }, innerBlocks]]]; - }); + const innerBlocksTemplate = blocks.map(({ + name, + attributes, + innerBlocks + }) => ['core/column', { + width: `${columnWidth}%` + }, [[name, { + ...attributes + }, innerBlocks]]]); return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); }, - isMatch: _ref2 => { - let { - length: selectedBlocksLength - } = _ref2; + isMatch: ({ + length: selectedBlocksLength + }, blocks) => { + // If a user is trying to transform a single Columns block, skip + // the transformation. Enabling this functiontionality creates + // nested Columns blocks resulting in an unintuitive user experience. + // Multiple Columns blocks can still be transformed. + if (blocks.length === 1 && blocks[0].name === 'core/columns') { + return false; + } return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; } }, { @@ -7108,7 +8349,6 @@ verticalAlignment } = attributes; let media; - if (mediaType === 'image' || !mediaType) { const imageAttrs = { id, @@ -7123,7 +8363,8 @@ linkTarget: attributes.linkTarget, rel: attributes.rel }; - media = ['core/image', { ...imageAttrs, + media = ['core/image', { + ...imageAttrs, ...linkAttrs }]; } else { @@ -7132,17 +8373,14 @@ src: url }]; } - const innerBlocksTemplate = [['core/column', { width: `${mediaWidth}%` }, [media]], ['core/column', { width: `${100 - mediaWidth}%` }, innerBlocks]]; - if (mediaPosition === 'right') { innerBlocksTemplate.reverse(); } - return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { align, backgroundColor, @@ -7151,9 +8389,10 @@ verticalAlignment }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); } - }] -}; -/* harmony default export */ var columns_transforms = (columns_transforms_transforms); + }], + ungroup: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks) +}; +/* harmony default export */ const columns_transforms = (columns_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js /** @@ -7161,6 +8400,7 @@ */ + /** * Internal dependencies */ @@ -7169,10 +8409,11 @@ const columns_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", - apiVersion: 2, + apiVersion: 3, name: "core/columns", title: "Columns", category: "design", + allowedBlocks: ["core/column"], description: "Display content in multiple columns, with blocks added to each column.", textdomain: "default", attributes: { @@ -7182,6 +8423,10 @@ isStackedOnMobile: { type: "boolean", "default": true + }, + templateLock: { + type: ["string", "boolean"], + "enum": ["all", "insert", "contentOnly", false] } }, supports: { @@ -7191,6 +8436,8 @@ color: { gradients: true, link: true, + heading: true, + button: true, __experimentalDefaultControls: { background: true, text: true @@ -7198,15 +8445,17 @@ }, spacing: { blockGap: { - __experimentalDefault: "2em" + __experimentalDefault: "2em", + sides: ["horizontal", "vertical"] }, margin: ["top", "bottom"], padding: true, __experimentalDefaultControls: { - padding: true - } - }, - __experimentalLayout: { + padding: true, + blockGap: true + } + }, + layout: { allowSwitching: false, allowInheriting: false, allowEditing: false, @@ -7226,7 +8475,24 @@ style: true, width: true } - } + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + interactivity: { + clientNavigation: true + }, + shadow: true }, editorStyle: "wp-block-columns-editor", style: "wp-block-columns" @@ -7286,40 +8552,802 @@ save: columns_save_save, transforms: columns_transforms }; +const columns_init = () => initBlock({ + name: columns_name, + metadata: columns_metadata, + settings: columns_settings +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js +/** + * WordPress dependencies + */ + + +const postComments = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" + }) +}); +/* harmony default export */ const post_comments = (postComments); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js +/** + * WordPress dependencies + */ + + +// v1: Deprecate the initial version of the block which was called "Comments +// Query Loop" instead of "Comments". + +const v1 = { + attributes: { + tagName: { + type: 'string', + default: 'div' + } + }, + apiVersion: 3, + supports: { + align: ['wide', 'full'], + html: false, + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + link: true + } + } + }, + save({ + attributes: { + tagName: Tag + } + }) { + const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); + const { + className + } = blockProps; + const classes = className?.split(' ') || []; + + // The ID of the previous version of the block + // didn't have the `wp-block-comments` class, + // so we need to remove it here in order to mimic it. + const newClasses = classes?.filter(cls => cls !== 'wp-block-comments'); + const newBlockProps = { + ...blockProps, + className: newClasses.join(' ') + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { + ...newBlockProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) + }); + } +}; +/* harmony default export */ const comments_deprecated = ([v1]); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js +/** + * WordPress dependencies + */ + + + + +function CommentsInspectorControls({ + attributes: { + tagName + }, + setAttributes +}) { + const htmlElementMessages = { + section: (0,external_wp_i18n_namespaceObject.__)("The
element should represent a standalone portion of the document that can't be better represented by another element."), + aside: (0,external_wp_i18n_namespaceObject.__)("The