Preview: block-library.js
Size: 1.81 MB
/home/nshryvcy/himaltourism.com/wp-includes/js/dist/block-library.js
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 7078:
/***/ (function(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;
};
/***/ }),
/***/ 5619:
/***/ (function(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;
};
/***/ }),
/***/ 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;
/***/ }),
/***/ 4793:
/***/ (function(module) {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ù": "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",
"ß": "ss",
"Ţ": "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;
/***/ }),
/***/ 4526:
/***/ (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 && !object.toString.toString().includes('[native code]')) {
resultSet[object.toString()] = true;
return;
}
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];
}
}
}
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 {}
}());
/***/ }),
/***/ 7153:
/***/ (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) {
classes = appendClass(classes, parseValue(arg));
}
}
return classes;
}
function parseValue (arg) {
if (typeof arg === 'string' || typeof arg === 'number') {
return arg;
}
if (typeof arg !== 'object') {
return '';
}
if (Array.isArray(arg)) {
return classNames.apply(null, arg);
}
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
return arg.toString();
}
var classes = '';
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes = appendClass(classes, key);
}
}
return classes;
}
function appendClass (value, newClass) {
if (!newClass) {
return value;
}
if (value) {
return value + ' ' + newClass;
}
return value + newClass;
}
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 {}
}());
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return 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) {
/******/ 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/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(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; }
});
// 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, {
"init": function() { return init; },
"metadata": function() { return metadata; },
"name": function() { return archives_name; },
"settings": function() { return 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, {
"init": function() { return avatar_init; },
"metadata": function() { return avatar_metadata; },
"name": function() { return avatar_name; },
"settings": function() { return 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, {
"init": function() { return audio_init; },
"metadata": function() { return audio_metadata; },
"name": function() { return audio_name; },
"settings": function() { return 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, {
"init": function() { return button_init; },
"metadata": function() { return button_metadata; },
"name": function() { return button_name; },
"settings": function() { return 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, {
"init": function() { return buttons_init; },
"metadata": function() { return buttons_metadata; },
"name": function() { return buttons_name; },
"settings": function() { return 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, {
"init": function() { return calendar_init; },
"metadata": function() { return calendar_metadata; },
"name": function() { return calendar_name; },
"settings": function() { return 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, {
"init": function() { return categories_init; },
"metadata": function() { return categories_metadata; },
"name": function() { return categories_name; },
"settings": function() { return 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, {
"init": function() { return freeform_init; },
"metadata": function() { return freeform_metadata; },
"name": function() { return freeform_name; },
"settings": function() { return 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, {
"init": function() { return code_init; },
"metadata": function() { return code_metadata; },
"name": function() { return code_name; },
"settings": function() { return 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, {
"init": function() { return column_init; },
"metadata": function() { return column_metadata; },
"name": function() { return column_name; },
"settings": function() { return 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, {
"init": function() { return columns_init; },
"metadata": function() { return columns_metadata; },
"name": function() { return columns_name; },
"settings": function() { return 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": function() { return comments_init; },
"metadata": function() { return comments_metadata; },
"name": function() { return comments_name; },
"settings": function() { return 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": function() { return comment_author_avatar_init; },
"metadata": function() { return comment_author_avatar_metadata; },
"name": function() { return comment_author_avatar_name; },
"settings": function() { return 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, {
"init": function() { return comment_author_name_init; },
"metadata": function() { return comment_author_name_metadata; },
"name": function() { return comment_author_name_name; },
"settings": function() { return 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, {
"init": function() { return comment_content_init; },
"metadata": function() { return comment_content_metadata; },
"name": function() { return comment_content_name; },
"settings": function() { return 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, {
"init": function() { return comment_date_init; },
"metadata": function() { return comment_date_metadata; },
"name": function() { return comment_date_name; },
"settings": function() { return 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, {
"init": function() { return comment_edit_link_init; },
"metadata": function() { return comment_edit_link_metadata; },
"name": function() { return comment_edit_link_name; },
"settings": function() { return 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, {
"init": function() { return comment_reply_link_init; },
"metadata": function() { return comment_reply_link_metadata; },
"name": function() { return comment_reply_link_name; },
"settings": function() { return 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, {
"init": function() { return comment_template_init; },
"metadata": function() { return comment_template_metadata; },
"name": function() { return comment_template_name; },
"settings": function() { return 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, {
"init": function() { return comments_pagination_previous_init; },
"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-pagination/index.js
var comments_pagination_namespaceObject = {};
__webpack_require__.r(comments_pagination_namespaceObject);
__webpack_require__.d(comments_pagination_namespaceObject, {
"init": function() { return comments_pagination_init; },
"metadata": function() { return comments_pagination_metadata; },
"name": function() { return comments_pagination_name; },
"settings": function() { return 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, {
"init": function() { return comments_pagination_next_init; },
"metadata": function() { return comments_pagination_next_metadata; },
"name": function() { return comments_pagination_next_name; },
"settings": function() { return 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, {
"init": function() { return comments_pagination_numbers_init; },
"metadata": function() { return comments_pagination_numbers_metadata; },
"name": function() { return comments_pagination_numbers_name; },
"settings": function() { return 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, {
"init": function() { return comments_title_init; },
"metadata": function() { return comments_title_metadata; },
"name": function() { return comments_title_name; },
"settings": function() { return 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, {
"init": function() { return cover_init; },
"metadata": function() { return cover_metadata; },
"name": function() { return cover_name; },
"settings": function() { return cover_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, {
"init": function() { return embed_init; },
"metadata": function() { return embed_metadata; },
"name": function() { return embed_name; },
"settings": function() { return 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, {
"init": function() { return file_init; },
"metadata": function() { return file_metadata; },
"name": function() { return file_name; },
"settings": function() { return file_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, {
"init": function() { return gallery_init; },
"metadata": function() { return gallery_metadata; },
"name": function() { return gallery_name; },
"settings": function() { return 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, {
"init": function() { return group_init; },
"metadata": function() { return group_metadata; },
"name": function() { return group_name; },
"settings": function() { return 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, {
"init": function() { return heading_init; },
"metadata": function() { return heading_metadata; },
"name": function() { return heading_name; },
"settings": function() { return 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, {
"init": function() { return home_link_init; },
"metadata": function() { return home_link_metadata; },
"name": function() { return home_link_name; },
"settings": function() { return 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, {
"init": function() { return html_init; },
"metadata": function() { return html_metadata; },
"name": function() { return html_name; },
"settings": function() { return 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, {
"init": function() { return image_init; },
"metadata": function() { return image_metadata; },
"name": function() { return image_name; },
"settings": function() { return 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, {
"init": function() { return latest_comments_init; },
"metadata": function() { return latest_comments_metadata; },
"name": function() { return latest_comments_name; },
"settings": function() { return 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, {
"init": function() { return latest_posts_init; },
"metadata": function() { return latest_posts_metadata; },
"name": function() { return latest_posts_name; },
"settings": function() { return 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, {
"init": function() { return list_init; },
"metadata": function() { return list_metadata; },
"name": function() { return list_name; },
"settings": function() { return 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": function() { return list_item_init; },
"metadata": function() { return list_item_metadata; },
"name": function() { return list_item_name; },
"settings": function() { return 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, {
"init": function() { return loginout_init; },
"metadata": function() { return loginout_metadata; },
"name": function() { return loginout_name; },
"settings": function() { return 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, {
"init": function() { return media_text_init; },
"metadata": function() { return media_text_metadata; },
"name": function() { return media_text_name; },
"settings": function() { return 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, {
"init": function() { return missing_init; },
"metadata": function() { return missing_metadata; },
"name": function() { return missing_name; },
"settings": function() { return 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, {
"init": function() { return more_init; },
"metadata": function() { return more_metadata; },
"name": function() { return more_name; },
"settings": function() { return 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, {
"init": function() { return navigation_init; },
"metadata": function() { return navigation_metadata; },
"name": function() { return navigation_name; },
"settings": function() { return 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, {
"init": function() { return navigation_link_init; },
"metadata": function() { return navigation_link_metadata; },
"name": function() { return navigation_link_name; },
"settings": function() { return 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, {
"init": function() { return navigation_submenu_init; },
"metadata": function() { return navigation_submenu_metadata; },
"name": function() { return navigation_submenu_name; },
"settings": function() { return 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, {
"init": function() { return nextpage_init; },
"metadata": function() { return nextpage_metadata; },
"name": function() { return nextpage_name; },
"settings": function() { return 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, {
"init": function() { return pattern_init; },
"metadata": function() { return pattern_metadata; },
"name": function() { return pattern_name; },
"settings": function() { return 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, {
"init": function() { return page_list_init; },
"metadata": function() { return page_list_metadata; },
"name": function() { return page_list_name; },
"settings": function() { return 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": function() { return page_list_item_init; },
"metadata": function() { return page_list_item_metadata; },
"name": function() { return page_list_item_name; },
"settings": function() { return 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, {
"init": function() { return paragraph_init; },
"metadata": function() { return paragraph_metadata; },
"name": function() { return paragraph_name; },
"settings": function() { return 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, {
"init": function() { return post_author_init; },
"metadata": function() { return post_author_metadata; },
"name": function() { return post_author_name; },
"settings": function() { return 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": function() { return post_author_name_init; },
"metadata": function() { return post_author_name_metadata; },
"name": function() { return post_author_name_name; },
"settings": function() { return 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, {
"init": function() { return post_author_biography_init; },
"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-comment/index.js
var post_comment_namespaceObject = {};
__webpack_require__.r(post_comment_namespaceObject);
__webpack_require__.d(post_comment_namespaceObject, {
"init": function() { return post_comment_init; },
"metadata": function() { return post_comment_metadata; },
"name": function() { return post_comment_name; },
"settings": function() { return 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": function() { return post_comments_count_init; },
"metadata": function() { return post_comments_count_metadata; },
"name": function() { return post_comments_count_name; },
"settings": function() { return 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, {
"init": function() { return post_comments_form_init; },
"metadata": function() { return post_comments_form_metadata; },
"name": function() { return post_comments_form_name; },
"settings": function() { return 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": function() { return post_comments_link_init; },
"metadata": function() { return post_comments_link_metadata; },
"name": function() { return post_comments_link_name; },
"settings": function() { return 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, {
"init": function() { return post_content_init; },
"metadata": function() { return post_content_metadata; },
"name": function() { return post_content_name; },
"settings": function() { return 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, {
"init": function() { return post_date_init; },
"metadata": function() { return post_date_metadata; },
"name": function() { return post_date_name; },
"settings": function() { return 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, {
"init": function() { return post_excerpt_init; },
"metadata": function() { return post_excerpt_metadata; },
"name": function() { return post_excerpt_name; },
"settings": function() { return 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, {
"init": function() { return post_featured_image_init; },
"metadata": function() { return post_featured_image_metadata; },
"name": function() { return post_featured_image_name; },
"settings": function() { return 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, {
"init": function() { return post_navigation_link_init; },
"metadata": function() { return post_navigation_link_metadata; },
"name": function() { return post_navigation_link_name; },
"settings": function() { return 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, {
"init": function() { return post_template_init; },
"metadata": function() { return post_template_metadata; },
"name": function() { return post_template_name; },
"settings": function() { return 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, {
"init": function() { return post_terms_init; },
"metadata": function() { return post_terms_metadata; },
"name": function() { return post_terms_name; },
"settings": function() { return post_terms_settings; }
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
var post_title_namespaceObject = {};
__webpack_require__.r(post_title_namespaceObject);
__webpack_require__.d(post_title_namespaceObject, {
"init": function() { return post_title_init; },
"metadata": function() { return post_title_metadata; },
"name": function() { return post_title_name; },
"settings": function() { return 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, {
"init": function() { return preformatted_init; },
"metadata": function() { return preformatted_metadata; },
"name": function() { return preformatted_name; },
"settings": function() { return 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, {
"init": function() { return pullquote_init; },
"metadata": function() { return pullquote_metadata; },
"name": function() { return pullquote_name; },
"settings": function() { return 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, {
"init": function() { return query_init; },
"metadata": function() { return query_metadata; },
"name": function() { return query_name; },
"settings": function() { return 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, {
"init": function() { return query_no_results_init; },
"metadata": function() { return query_no_results_metadata; },
"name": function() { return query_no_results_name; },
"settings": function() { return 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, {
"init": function() { return query_pagination_init; },
"metadata": function() { return query_pagination_metadata; },
"name": function() { return query_pagination_name; },
"settings": function() { return 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, {
"init": function() { return query_pagination_next_init; },
"metadata": function() { return query_pagination_next_metadata; },
"name": function() { return query_pagination_next_name; },
"settings": function() { return 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, {
"init": function() { return query_pagination_numbers_init; },
"metadata": function() { return query_pagination_numbers_metadata; },
"name": function() { return query_pagination_numbers_name; },
"settings": function() { return 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, {
"init": function() { return query_pagination_previous_init; },
"metadata": function() { return query_pagination_previous_metadata; },
"name": function() { return query_pagination_previous_name; },
"settings": function() { return query_pagination_previous_settings; }
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
var query_title_namespaceObject = {};
__webpack_require__.r(query_title_namespaceObject);
__webpack_require__.d(query_title_namespaceObject, {
"init": function() { return query_title_init; },
"metadata": function() { return query_title_metadata; },
"name": function() { return query_title_name; },
"settings": function() { return 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, {
"init": function() { return quote_init; },
"metadata": function() { return quote_metadata; },
"name": function() { return quote_name; },
"settings": function() { return 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, {
"init": function() { return block_init; },
"metadata": function() { return block_metadata; },
"name": function() { return block_name; },
"settings": function() { return 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, {
"init": function() { return read_more_init; },
"metadata": function() { return read_more_metadata; },
"name": function() { return read_more_name; },
"settings": function() { return 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, {
"init": function() { return rss_init; },
"metadata": function() { return rss_metadata; },
"name": function() { return rss_name; },
"settings": function() { return 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, {
"init": function() { return search_init; },
"metadata": function() { return search_metadata; },
"name": function() { return search_name; },
"settings": function() { return 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, {
"init": function() { return separator_init; },
"metadata": function() { return separator_metadata; },
"name": function() { return separator_name; },
"settings": function() { return 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, {
"init": function() { return shortcode_init; },
"metadata": function() { return shortcode_metadata; },
"name": function() { return shortcode_name; },
"settings": function() { return 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, {
"init": function() { return site_logo_init; },
"metadata": function() { return site_logo_metadata; },
"name": function() { return site_logo_name; },
"settings": function() { return 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, {
"init": function() { return site_tagline_init; },
"metadata": function() { return site_tagline_metadata; },
"name": function() { return site_tagline_name; },
"settings": function() { return 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, {
"init": function() { return site_title_init; },
"metadata": function() { return site_title_metadata; },
"name": function() { return site_title_name; },
"settings": function() { return 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, {
"init": function() { return social_link_init; },
"metadata": function() { return social_link_metadata; },
"name": function() { return social_link_name; },
"settings": function() { return 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, {
"init": function() { return social_links_init; },
"metadata": function() { return social_links_metadata; },
"name": function() { return social_links_name; },
"settings": function() { return 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, {
"init": function() { return spacer_init; },
"metadata": function() { return spacer_metadata; },
"name": function() { return spacer_name; },
"settings": function() { return 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, {
"init": function() { return table_init; },
"metadata": function() { return table_metadata; },
"name": function() { return table_name; },
"settings": function() { return table_settings; }
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js
var table_of_contents_namespaceObject = {};
__webpack_require__.r(table_of_contents_namespaceObject);
__webpack_require__.d(table_of_contents_namespaceObject, {
"init": function() { return table_of_contents_init; },
"metadata": function() { return table_of_contents_metadata; },
"name": function() { return table_of_contents_name; },
"settings": function() { return 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, {
"init": function() { return tag_cloud_init; },
"metadata": function() { return tag_cloud_metadata; },
"name": function() { return tag_cloud_name; },
"settings": function() { return 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, {
"init": function() { return template_part_init; },
"metadata": function() { return template_part_metadata; },
"name": function() { return template_part_name; },
"settings": function() { return 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, {
"init": function() { return term_description_init; },
"metadata": function() { return term_description_metadata; },
"name": function() { return term_description_name; },
"settings": function() { return 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, {
"init": function() { return text_columns_init; },
"metadata": function() { return text_columns_metadata; },
"name": function() { return text_columns_name; },
"settings": function() { return 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, {
"init": function() { return verse_init; },
"metadata": function() { return verse_metadata; },
"name": function() { return verse_name; },
"settings": function() { return 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, {
"init": function() { return video_init; },
"metadata": function() { return video_metadata; },
"name": function() { return video_name; },
"settings": function() { return video_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"];
;// CONCATENATED MODULE: external ["wp","primitives"]
var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// 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);
;// 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"];
;// CONCATENATED MODULE: external ["wp","i18n"]
var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// CONCATENATED MODULE: external ["wp","blockEditor"]
var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: external ["wp","serverSideRender"]
var 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 {
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.__)('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
})
}), displayAsDropdown && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Show label'),
checked: showLabel,
onChange: () => setAttributes({
showLabel: !showLabel
})
}), (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, {
__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
})
}))), (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",
skipBlockSupportAttributes: true,
attributes: attributes
}))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/archives",
title: "Archives",
category: "widgets",
description: "Display a date archive of your posts.",
textdomain: "default",
attributes: {
displayAsDropdown: {
type: "boolean",
"default": false
},
showLabel: {
type: "boolean",
"default": true
},
showPostCounts: {
type: "boolean",
"default": false
},
type: {
type: "string",
"default": "monthly"
}
},
supports: {
align: true,
html: false,
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
editorStyle: "wp-block-archives-editor"
};
const {
name: archives_name
} = metadata;
const settings = {
icon: library_archive,
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() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(7153);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
;// CONCATENATED MODULE: external ["wp","url"]
var external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: external ["wp","coreData"]
var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// CONCATENATED MODULE: external ["wp","data"]
var external_wp_data_namespaceObject = window["wp"]["data"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
/**
* WordPress dependencies
*/
function getAvatarSizes(sizes) {
const minSize = sizes ? sizes[0] : 24;
const maxSize = sizes ? sizes[sizes.length - 1] : 96;
const maxSizeBuffer = Math.floor(maxSize * 2.5);
return {
minSize,
maxSize: maxSizeBuffer
};
}
function useDefaultAvatar() {
const {
avatarURL: defaultAvatarUrl
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
const {
__experimentalDiscussionSettings
} = getSettings();
return __experimentalDiscussionSettings;
});
return defaultAvatarUrl;
}
function useCommentAvatar(_ref) {
let {
commentId
} = _ref;
const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
const avatarUrls = avatars ? Object.values(avatars) : null;
const sizes = avatars ? Object.keys(avatars) : null;
const {
minSize,
maxSize
} = getAvatarSizes(sizes);
const defaultAvatar = useDefaultAvatar();
return {
src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
minSize,
maxSize,
// translators: %s is the Author name.
alt: authorName ? // translators: %s is the Author name.
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
};
}
function useUserAvatar(_ref2) {
let {
userId,
postId,
postType
} = _ref2;
const {
authorDetails
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
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;
return {
authorDetails: _authorId ? getUser(_authorId) : null
};
}, [postType, postId, userId]);
const avatarUrls = authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.values(authorDetails.avatar_urls) : null;
const sizes = authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null;
const {
minSize,
maxSize
} = getAvatarSizes(sizes);
const defaultAvatar = useDefaultAvatar();
return {
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')
};
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
/**
* WordPress dependencies
*/
const AUTHORS_QUERY = {
who: 'authors',
per_page: -1,
_fields: 'id,name',
context: 'view'
};
function UserControl(_ref) {
let {
value,
onChange
} = _ref;
const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)();
const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getUsers
} = 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, {
__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,
onChange: onChange,
options: filteredAuthorsList || options,
onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
});
}
/* harmony default export */ var 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, {
__nextHasNoMarginBottom: true,
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;
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 {
commentId
} = context;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
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;
const {
postId,
postType
} = context;
const avatar = useUserAvatar({
userId: attributes === null || attributes === void 0 ? void 0 : 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
})));
};
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);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const avatar_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/avatar",
title: "Avatar",
category: "theme",
description: "Add a user\u2019s avatar.",
textdomain: "default",
attributes: {
userId: {
type: "number"
},
size: {
type: "number",
"default": 96
},
isLink: {
type: "boolean",
"default": false
},
linkTarget: {
type: "string",
"default": "_self"
}
},
usesContext: ["postType", "postId", "commentId"],
supports: {
html: false,
align: true,
alignWide: false,
spacing: {
margin: true,
padding: true
},
__experimentalBorder: {
__experimentalSkipSerialization: true,
radius: true,
width: true,
color: true,
style: true,
__experimentalDefaultControls: {
radius: true
}
},
color: {
text: false,
background: false,
__experimentalDuotone: "img"
}
},
editorStyle: "wp-block-avatar",
style: "wp-block-avatar"
};
const {
name: avatar_name
} = avatar_metadata;
const avatar_settings = {
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
/**
* WordPress dependencies
*/
/* harmony default export */ var deprecated = ([{
attributes: {
src: {
type: 'string',
source: 'attribute',
selector: 'audio',
attribute: 'src'
},
caption: {
type: 'string',
source: 'html',
selector: 'figcaption'
},
id: {
type: 'number'
},
autoplay: {
type: 'boolean',
source: 'attribute',
selector: 'audio',
attribute: 'autoplay'
},
loop: {
type: 'boolean',
source: 'attribute',
selector: 'audio',
attribute: 'loop'
},
preload: {
type: 'string',
source: 'attribute',
selector: 'audio',
attribute: 'preload'
}
},
supports: {
align: true
},
save(_ref) {
let {
attributes
} = _ref;
const {
autoplay,
caption,
loop,
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
}));
}
}]);
;// CONCATENATED MODULE: external ["wp","blob"]
var external_wp_blob_namespaceObject = window["wp"]["blob"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/caption.js
/**
* WordPress dependencies
*/
const caption = (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, {
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 */ var library_caption = (caption);
;// CONCATENATED MODULE: external ["wp","notices"]
var external_wp_notices_namespaceObject = window["wp"]["notices"];
;// CONCATENATED MODULE: external ["wp","compose"]
var external_wp_compose_namespaceObject = window["wp"]["compose"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js
const ASPECT_RATIOS = [// Common video resolutions.
{
ratio: '2.33',
className: 'wp-embed-aspect-21-9'
}, {
ratio: '2.00',
className: 'wp-embed-aspect-18-9'
}, {
ratio: '1.78',
className: 'wp-embed-aspect-16-9'
}, {
ratio: '1.33',
className: 'wp-embed-aspect-4-3'
}, // Vertical video and instagram square video support.
{
ratio: '1.00',
className: 'wp-embed-aspect-1-1'
}, {
ratio: '0.56',
className: 'wp-embed-aspect-9-16'
}, {
ratio: '0.50',
className: 'wp-embed-aspect-1-2'
}];
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__(4526);
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: ./node_modules/@wordpress/block-library/build-module/embed/util.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const util_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/embed",
title: "Embed",
category: "embed",
description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
textdomain: "default",
attributes: {
url: {
type: "string",
__experimentalRole: "content"
},
caption: {
type: "string",
source: "html",
selector: "figcaption",
__experimentalRole: "content"
},
type: {
type: "string",
__experimentalRole: "content"
},
providerNameSlug: {
type: "string",
__experimentalRole: "content"
},
allowResponsive: {
type: "boolean",
"default": true
},
responsive: {
type: "boolean",
"default": false,
__experimentalRole: "content"
},
previewable: {
type: "boolean",
"default": true,
__experimentalRole: "content"
}
},
supports: {
align: true
},
editorStyle: "wp-block-embed-editor",
style: "wp-block-embed"
};
const {
name: DEFAULT_EMBED_BLOCK
} = util_metadata;
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
/**
* Returns the embed block's information by matching the provided service provider
*
* @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;
});
};
/**
* Returns true if any of the regular expressions match the URL.
*
* @param {string} url The URL to test.
* @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));
};
/**
* Finds the block variation that should be used for the URL,
* based on the provided URL and the variation's patterns.
*
* @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 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.
const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("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.
*
* We require `attributesFromPreview` to be generated from the latest attributes
* and preview, and because of the way the react lifecycle operates, we can't
* guarantee that the attributes contained in the block's props are the latest
* versions, so we require that these are generated separately.
* See `getAttributesFromPreview` in the generated embed edit component.
*
* @param {Object} props The block's props.
* @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 {
preview,
attributes = {}
} = props;
const {
url,
providerNameSlug,
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,
// 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
// 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,
...restAttributes,
...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.
if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
return;
} // 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,
// By now we have the preview, but when the new block first renders, it
// won't have had all the attributes set, and so won't get the correct
// type and it won't render correctly. So, we pass through the current attributes
// here so that the initial render works when we switch to the WordPress
// block. This only affects the WordPress block because it can't be
// rendered in the usual Sandbox (it has a sandbox of its own) and it
// relies on the preview to set the correct render type.
...attributesFromPreview
});
};
/**
* Removes all previously set aspect ratio related classes and return the rest
* existing class names.
*
* @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.
return existingClassNames;
}
const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => {
let {
className
} = _ref4;
accumulator[className] = false;
return accumulator;
}, {
'wp-has-aspect-ratio': false
});
return dedupe_default()(existingClassNames, aspectRatioClassNames);
};
/**
* Returns class names with any relevant responsive aspect ratio names.
*
* @param {string} html The preview HTML that possibly contains an iframe with width and height set.
* @param {string} existingClassNames Any existing class names.
* @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;
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.
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.
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');
}
}
}
return existingClassNames;
}
/**
* Fallback behaviour for unembeddable URLs.
* Creates a paragraph block containing a link to the URL, and calls `onReplace`.
*
* @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);
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.
*
* @param {Object} preview The preview data.
* @param {string} title The block's title, e.g. Twitter.
* @param {Object} currentClassNames The block's current class names.
* @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
* @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;
if (!preview) {
return {};
}
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,
// 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());
if (isFromWordPress(html)) {
type = WP_EMBED_TYPE;
}
if (html || 'photo' === type) {
attributes.type = type;
attributes.providerNameSlug = providerNameSlug;
}
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.
* @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.
* @return {Object} Merged attributes.
*/
const getMergedAttributesWithPreview = function (currentAttributes, preview, title, isResponsive) {
let ignorePreviousClassName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
const {
allowResponsive,
className
} = currentAttributes;
return { ...currentAttributes,
...getAttributesFromPreview(preview, title, ignorePreviousClassName ? undefined : className, isResponsive, allowResponsive)
};
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const ALLOWED_MEDIA_TYPES = ['audio'];
function AudioEdit(_ref) {
let {
attributes,
className,
setAttributes,
onReplace,
isSelected,
insertBlocksAfter
} = _ref;
const {
id,
autoplay,
caption,
loop,
preload,
src
} = attributes;
const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption);
const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!!caption);
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 [media] = _ref2;
return onSelectAudio(media);
},
onError: e => onUploadError(e),
allowedTypes: ALLOWED_MEDIA_TYPES
});
}
}
}, []); // We need to show the caption when changes come from
// history navigation(undo/redo).
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (caption && !prevCaption) {
setShowCaption(true);
}
}, [caption, prevCaption]); // Focus the caption when we click to add one.
const captionRef = (0,external_wp_element_namespaceObject.useCallback)(node => {
if (node && !caption) {
node.focus();
}
}, [caption]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected && !caption) {
setShowCaption(false);
}
}, [isSelected, caption]);
function toggleAttribute(attribute) {
return newValue => {
setAttributes({
[attribute]: newValue
});
};
}
function onSelectURL(newSrc) {
// Set the block's src from the edit component's state, and switch off
// the editing UI.
if (newSrc !== src) {
// Check if there's an embed block that handles this URL.
const embedBlock = createUpgradedEmbedBlock({
attributes: {
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) {
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,
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,
caption: media.caption
});
}
const classes = classnames_default()(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,
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: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => {
setShowCaption(!showCaption);
if (showCaption && caption) {
setAttributes({
caption: undefined
});
}
},
icon: library_caption,
isPressed: showCaption,
label: showCaption ? (0,external_wp_i18n_namespaceObject.__)('Remove caption') : (0,external_wp_i18n_namespaceObject.__)('Add caption')
})), (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.__)('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, {
__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')
}]
}))), (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), showCaption && (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "caption",
tagName: "figcaption",
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
ref: captionRef,
"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)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
})));
}
/* harmony default export */ var edit = (AudioEdit);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js
/**
* WordPress dependencies
*/
function save(_ref) {
let {
attributes
} = _ref;
const {
autoplay,
caption,
loop,
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,
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
/**
* WordPress dependencies
*/
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
// 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;
return src || mp3 || m4a || ogg || wav || wma;
}
},
loop: {
type: 'string',
shortcode: _ref2 => {
let {
named: {
loop
}
} = _ref2;
return loop;
}
},
autoplay: {
type: 'string',
shortcode: _ref3 => {
let {
named: {
autoplay
}
} = _ref3;
return autoplay;
}
},
preload: {
type: 'string',
shortcode: _ref4 => {
let {
named: {
preload
}
} = _ref4;
return preload;
}
}
}
}]
};
/* harmony default export */ var audio_transforms = (transforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const audio_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/audio",
title: "Audio",
category: "media",
description: "Embed a simple audio player.",
keywords: ["music", "sound", "podcast", "recording"],
textdomain: "default",
attributes: {
src: {
type: "string",
source: "attribute",
selector: "audio",
attribute: "src",
__experimentalRole: "content"
},
caption: {
type: "string",
source: "html",
selector: "figcaption",
__experimentalRole: "content"
},
id: {
type: "number",
__experimentalRole: "content"
},
autoplay: {
type: "boolean",
source: "attribute",
selector: "audio",
attribute: "autoplay"
},
loop: {
type: "boolean",
source: "attribute",
selector: "audio",
attribute: "loop"
},
preload: {
type: "string",
source: "attribute",
selector: "audio",
attribute: "preload"
}
},
supports: {
anchor: true,
align: true,
spacing: {
margin: true,
padding: true
}
},
editorStyle: "wp-block-audio-editor",
style: "wp-block-audio"
};
const {
name: audio_name
} = audio_metadata;
const audio_settings = {
icon: library_audio,
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: ./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 (object === null || typeof object !== 'object' || Array.isArray(object)) {
return object;
}
const cleanedNestedObjects = Object.fromEntries(Object.entries((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject)).filter(_ref => {
let [, value] = _ref;
return Boolean(value);
}));
return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
};
/* harmony default export */ var clean_empty_object = (cleanEmptyObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
/**
* Internal dependencies
*/
/**
* Migrates the current style.typography.fontFamily attribute,
* whose value was "var:preset|font-family|helvetica-arial",
* to the style.fontFamily attribute, whose value will be "helvetica-arial".
*
* @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)) {
return attributes;
}
const {
fontFamily,
...typography
} = attributes.style.typography;
return { ...attributes,
style: clean_empty_object({ ...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
*/
const migrateBorderRadius = attributes => {
var _newAttributes$style, _newAttributes$style$, _newAttributes$style2;
const {
borderRadius,
...newAttributes
} = 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 => {
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),
radius: `${oldBorderRadius}px`
}
}
};
};
function migrateAlign(attributes) {
if (!attributes.align) {
return attributes;
}
const {
align,
...otherAttributes
} = attributes;
return { ...otherAttributes,
className: classnames_default()(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;
}
const {
customTextColor,
customBackgroundColor,
customGradient,
...restAttributes
} = attributes;
return { ...restAttributes,
style
};
};
const oldColorsMigration = attributes => {
const {
color,
textColor,
...restAttributes
} = { ...attributes,
customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined
};
return migrateCustomColorsAndGradients(restAttributes);
};
const blockAttributes = {
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'
}
};
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(_ref) {
var _style$border, _style$typography;
let {
attributes,
className
} = _ref;
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 = classnames_default()('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,
...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 = classnames_default()(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
}));
}
};
const v10 = {
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
},
typography: {
fontSize: true,
__experimentalFontFamily: true
},
reusable: false,
spacing: {
__experimentalSkipSerialization: true,
padding: ['horizontal', 'vertical'],
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
radius: true,
__experimentalSkipSerialization: true
},
__experimentalSelector: '.wp-block-button__link'
},
save(_ref2) {
var _style$border2, _style$typography2;
let {
attributes,
className
} = _ref2;
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 = classnames_default()('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$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.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 = classnames_default()(className, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.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
}));
},
migrate: migrate_font_family,
isEligible(_ref3) {
var _style$typography3;
let {
style
} = _ref3;
return style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontFamily;
}
};
const deprecated_deprecated = [v11, v10, {
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true
},
typography: {
fontSize: true,
__experimentalFontFamily: true
},
reusable: false,
__experimentalSelector: '.wp-block-button__link'
},
attributes: { ...blockAttributes,
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'
}
},
isEligible(_ref4) {
var _style$border3;
let {
style
} = _ref4;
return typeof (style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius) === 'number';
},
save(_ref5) {
var _style$border4, _style$border5, _style$typography4;
let {
attributes,
className
} = _ref5;
const {
fontSize,
linkTarget,
rel,
style,
text,
title,
url,
width
} = attributes;
if (!text) {
return null;
}
const borderRadius = style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.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$border5 = style.border) === null || _style$border5 === void 0 ? void 0 : _style$border5.radius) === 0
});
const buttonStyle = {
borderRadius: borderRadius ? borderRadius : undefined,
...colorProps.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, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography4 = style.typography) === null || _style$typography4 === void 0 ? void 0 : _style$typography4.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
}));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
}, {
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true
},
reusable: false,
__experimentalSelector: '.wp-block-button__link'
},
attributes: { ...blockAttributes,
linkTarget: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'target'
},
rel: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'rel'
},
placeholder: {
type: 'string'
},
borderRadius: {
type: 'number'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
gradient: {
type: 'string'
},
style: {
type: 'object'
},
width: {
type: 'number'
}
},
save(_ref6) {
let {
attributes,
className
} = _ref6;
const {
borderRadius,
linkTarget,
rel,
text,
title,
url,
width
} = attributes;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const buttonClasses = classnames_default()('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
// 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, {
[`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
}));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
}, {
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true
},
reusable: false,
__experimentalSelector: '.wp-block-button__link'
},
attributes: { ...blockAttributes,
linkTarget: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'target'
},
rel: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'rel'
},
placeholder: {
type: 'string'
},
borderRadius: {
type: 'number'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
gradient: {
type: 'string'
},
style: {
type: 'object'
},
width: {
type: 'number'
}
},
save(_ref7) {
let {
attributes,
className
} = _ref7;
const {
borderRadius,
linkTarget,
rel,
text,
title,
url,
width
} = attributes;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const buttonClasses = classnames_default()('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
// 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, {
[`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
}));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
}, {
supports: {
align: true,
alignWide: false,
color: {
gradients: true
}
},
attributes: { ...blockAttributes,
linkTarget: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'target'
},
rel: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'rel'
},
placeholder: {
type: 'string'
},
borderRadius: {
type: 'number'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
gradient: {
type: 'string'
},
style: {
type: 'object'
}
},
save(_ref8) {
let {
attributes
} = _ref8;
const {
borderRadius,
linkTarget,
rel,
text,
title,
url
} = attributes;
const buttonClasses = classnames_default()('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, {
tagName: "a",
className: buttonClasses,
href: url,
title: title,
style: buttonStyle,
value: text,
target: linkTarget,
rel: rel
});
},
migrate: migrateBorderRadius
}, {
supports: {
align: true,
alignWide: false
},
attributes: { ...blockAttributes,
linkTarget: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'target'
},
rel: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'rel'
},
placeholder: {
type: 'string'
},
borderRadius: {
type: 'number'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customTextColor: {
type: 'string'
},
customGradient: {
type: 'string'
},
gradient: {
type: 'string'
}
},
isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align,
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients, migrateAlign),
save(_ref9) {
let {
attributes
} = _ref9;
const {
backgroundColor,
borderRadius,
customBackgroundColor,
customTextColor,
customGradient,
linkTarget,
gradient,
rel,
text,
textColor,
title,
url
} = 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', {
'has-text-color': textColor || customTextColor,
[textClass]: textClass,
'has-background': backgroundColor || customBackgroundColor || customGradient || gradient,
[backgroundClass]: backgroundClass,
'no-border-radius': borderRadius === 0,
[gradientClass]: gradientClass
});
const buttonStyle = {
background: customGradient ? customGradient : undefined,
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
// 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,
align: {
type: 'string',
default: 'none'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customTextColor: {
type: 'string'
},
linkTarget: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'target'
},
rel: {
type: 'string',
source: 'attribute',
selector: 'a',
attribute: 'rel'
},
placeholder: {
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,
className: newClassName ? newClassName : undefined,
borderRadius: 0
}));
},
save(_ref10) {
let {
attributes
} = _ref10;
const {
backgroundColor,
customBackgroundColor,
customTextColor,
linkTarget,
rel,
text,
textColor,
title,
url
} = 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', {
'has-text-color': textColor || customTextColor,
[textClass]: textClass,
'has-background': backgroundColor || customBackgroundColor,
[backgroundClass]: backgroundClass
});
const buttonStyle = {
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,
align: {
type: 'string',
default: 'none'
},
backgroundColor: {
type: 'string'
},
textColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customTextColor: {
type: 'string'
}
},
migrate: oldColorsMigration,
save(_ref11) {
let {
attributes
} = _ref11;
const {
url,
text,
title,
backgroundColor,
textColor,
customBackgroundColor,
customTextColor
} = 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', {
'has-text-color': textColor || customTextColor,
[textClass]: textClass,
'has-background': backgroundColor || customBackgroundColor,
[backgroundClass]: backgroundClass
});
const buttonStyle = {
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,
color: {
type: 'string'
},
textColor: {
type: 'string'
},
align: {
type: 'string',
default: 'none'
}
},
save(_ref12) {
let {
attributes
} = _ref12;
const {
url,
text,
title,
align,
color,
textColor
} = attributes;
const buttonStyle = {
backgroundColor: color,
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
}));
},
migrate: oldColorsMigration
}, {
attributes: { ...blockAttributes,
color: {
type: 'string'
},
textColor: {
type: 'string'
},
align: {
type: 'string',
default: 'none'
}
},
save(_ref13) {
let {
attributes
} = _ref13;
const {
url,
text,
title,
align,
color,
textColor
} = attributes;
return (0,external_wp_element_namespaceObject.createElement)("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
}));
},
migrate: oldColorsMigration
}];
/* harmony default export */ var button_deprecated = (deprecated_deprecated);
;// CONCATENATED MODULE: external ["wp","keycodes"]
var 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);
;// 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);
;// 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;
function handleChange(newWidth) {
// Check if we are toggling the width off
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, "%");
})));
}
function ButtonEdit(props) {
var _style$border;
const {
attributes,
setAttributes,
className,
isSelected,
onReplace,
mergeBlocks
} = props;
const {
textAlign,
linkTarget,
placeholder,
rel,
style,
text,
url,
width
} = attributes;
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, '')
});
}
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();
}
} // 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 ref = (0,external_wp_element_namespaceObject.useRef)();
const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]),
onKeyDown
});
const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
const isURLSet = !!url;
const opensInNewTab = linkTarget === '_blank';
function startEditing(event) {
event.preventDefault();
setIsEditingURL(true);
}
function unlink() {
setAttributes({
url: undefined,
linkTarget: undefined,
rel: undefined
});
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, {
[`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
}, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
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"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
}), !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, {
placement: "bottom",
onClose: () => {
var _richTextRef$current2;
setIsEditingURL(false);
(_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
},
anchor: popoverAnchor,
focusOnMount: isEditingURL ? 'firstElement' : false,
__unstableSlotName: '__unstable-block-tools-after',
shift: true
}, (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, {
group: "advanced"
}, (0,external_wp_element_namespaceObject.createElement)(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 */ var 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 {
textAlign,
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 = classnames_default()('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
}, (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
// 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, {
[`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
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const button_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/button",
title: "Button",
category: "design",
parent: ["core/buttons"],
description: "Prompt visitors to take action with a button-style link.",
keywords: ["link"],
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
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: false,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
reusable: false,
shadow: true,
spacing: {
__experimentalSkipSerialization: true,
padding: ["horizontal", "vertical"],
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
radius: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
radius: true
}
},
__experimentalSelector: ".wp-block-button .wp-block-button__link"
},
styles: [{
name: "fill",
label: "Fill",
isDefault: true
}, {
name: "outline",
label: "Outline"
}],
editorStyle: "wp-block-button-editor",
style: "wp-block-button"
};
const {
name: button_name
} = button_metadata;
const button_settings = {
icon: library_button,
example: {
attributes: {
className: 'is-style-fill',
text: (0,external_wp_i18n_namespaceObject.__)('Call to Action')
}
},
edit: button_edit,
save: save_save,
deprecated: button_deprecated,
merge: (a, _ref) => {
let {
text = ''
} = _ref;
return { ...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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* @param {Object} attributes Block's attributes.
*/
const migrateWithLayout = attributes => {
if (!!attributes.layout) {
return attributes;
}
const {
contentJustification,
orientation,
...updatedAttributes
} = attributes;
if (contentJustification || orientation) {
Object.assign(updatedAttributes, {
layout: {
type: 'flex',
...(contentJustification && {
justifyContent: contentJustification
}),
...(orientation && {
orientation
})
}
});
}
return updatedAttributes;
};
const buttons_deprecated_deprecated = [{
attributes: {
contentJustification: {
type: 'string'
},
orientation: {
type: 'string',
default: 'horizontal'
}
},
supports: {
anchor: true,
align: ['wide', 'full'],
__experimentalExposeControlsToChildren: true,
spacing: {
blockGap: true,
margin: ['top', 'bottom'],
__experimentalDefaultControls: {
blockGap: true
}
}
},
isEligible: _ref => {
let {
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));
}
}, {
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 align && ['center', 'left', 'right'].includes(align);
},
migrate(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
// act like content justification controls, so these blocks are
// migrated to use content justification.
// As for center-aligned Buttons blocks, the content justification
// equivalent will create an identical end result in most cases.
contentJustification: attributes.align
});
}
}];
/* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated);
;// CONCATENATED MODULE: external ["wp","richText"]
var external_wp_richText_namespaceObject = window["wp"]["richText"];
;// 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
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalLayout: {
allowSwitching: false,
allowInheriting: false,
"default": {
type: "flex"
}
}
},
editorStyle: "wp-block-buttons-editor",
style: "wp-block-buttons"
};
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.
(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.
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 link = element.querySelector('a');
const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block.
return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', {
text,
url
});
})),
isMatch: paragraphs => {
return paragraphs.every(attributes => {
const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content);
const text = element.innerText || '';
const links = element.querySelectorAll('a');
return text.length <= 30 && links.length <= 1;
});
}
}]
};
/* harmony default export */ var buttons_transforms = (transforms_transforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const ALLOWED_BLOCKS = [button_name];
const DEFAULT_BLOCK = {
name: button_name,
attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width']
};
function ButtonsEdit(_ref) {
var _style$typography;
let {
attributes,
className
} = _ref;
const {
fontSize,
style
} = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()(className, {
'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)
})
});
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];
}, []);
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}`
}]],
templateInsertUpdatesSelection: true
});
return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
}
/* harmony default export */ var buttons_edit = (ButtonsEdit);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function buttons_save_save(_ref) {
var _style$typography;
let {
attributes,
className
} = _ref;
const {
fontSize,
style
} = attributes;
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classnames_default()(className, {
'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)
})
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const buttons_metadata = {
$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
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalLayout: {
allowSwitching: false,
allowInheriting: false,
"default": {
type: "flex"
}
}
},
editorStyle: "wp-block-buttons-editor",
style: "wp-block-buttons"
};
const {
name: buttons_name
} = buttons_metadata;
const buttons_settings = {
icon: library_buttons,
example: {
innerBlocks: [{
name: 'core/button',
attributes: {
text: (0,external_wp_i18n_namespaceObject.__)('Find out more')
}
}, {
name: 'core/button',
attributes: {
text: (0,external_wp_i18n_namespaceObject.__)('Contact us')
}
}]
},
deprecated: buttons_deprecated,
transforms: buttons_transforms,
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: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
/**
* 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_default()(date => {
if (!date) {
return {};
}
const dateObj = new Date(date);
return {
year: dateObj.getFullYear(),
month: dateObj.getMonth() + 1
};
});
function CalendarEdit(_ref) {
let {
attributes
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const {
date,
hasPosts,
hasPostsResolved
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords,
hasFinishedResolution
} = select(external_wp_coreData_namespaceObject.store);
const singlePublishedPostQuery = {
status: 'publish',
per_page: 1
};
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.
// 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.
// 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
};
}, []);
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)
}
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
/**
* WordPress dependencies
*/
const calendar_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/archives'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar')
}],
to: [{
type: 'block',
blocks: ['core/archives'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives')
}]
};
/* harmony default export */ var 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,
name: "core/calendar",
title: "Calendar",
category: "widgets",
description: "A calendar of your site\u2019s posts.",
keywords: ["posts", "archive"],
textdomain: "default",
attributes: {
month: {
type: "integer"
},
year: {
type: "integer"
}
},
supports: {
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
}
}
},
style: "wp-block-calendar"
};
const {
name: calendar_name
} = calendar_metadata;
const calendar_settings = {
icon: library_calendar,
example: {},
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);
;// CONCATENATED MODULE: external ["wp","htmlEntities"]
var 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);
;// 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,
showEmpty
},
setAttributes,
className
} = _ref;
const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
const query = {
per_page: -1,
hide_empty: !showEmpty,
context: 'view'
};
if (showOnlyTopLevel) {
query.parent = 0;
}
const {
records: categories,
isResolving
} = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', query);
const getCategoriesList = parentId => {
if (!(categories !== null && categories !== void 0 && categories.length)) {
return [];
}
if (parentId === null) {
return categories;
}
return categories.filter(_ref2 => {
let {
parent
} = _ref2;
return parent === parentId;
});
};
const toggleAttribute = attributeName => newValue => setAttributes({
[attributeName]: newValue
});
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 categoriesList.map(category => renderCategoryListItem(category));
};
const renderCategoryListItem = category => {
const childCategories = getCategoriesList(category.id);
const {
id,
link,
count,
name
} = category;
return (0,external_wp_element_namespaceObject.createElement)("li", {
key: id,
className: `cat-item cat-item-${id}`
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: link,
target: "_blank",
rel: "noreferrer noopener"
}, renderCategoryName(name)), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", {
className: "children"
}, childCategories.map(childCategory => renderCategoryListItem(childCategory))));
};
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
}, (0,external_wp_element_namespaceObject.createElement)("option", null, (0,external_wp_i18n_namespaceObject.__)('Select Category')), categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
};
const renderCategoryDropdownItem = (category, level) => {
const {
id,
count,
name
} = category;
const childCategories = getCategoriesList(id);
return [(0,external_wp_element_namespaceObject.createElement)("option", {
key: id,
className: `level-${level}`
}, Array.from({
length: level * 3
}).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
};
const TagName = !!(categories !== null && categories !== void 0 && categories.length) && !displayAsDropdown && !isResolving ? 'ul' : 'div';
const classes = classnames_default()(className, {
'wp-block-categories-list': !!(categories !== null && categories !== void 0 && categories.length) && !displayAsDropdown && !isResolving,
'wp-block-categories-dropdown': !!(categories !== null && categories !== void 0 && categories.length) && displayAsDropdown && !isResolving
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (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.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')
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Show empty categories'),
checked: showEmpty,
onChange: toggleAttribute('showEmpty')
}), !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()));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const categories_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/categories",
title: "Categories List",
category: "widgets",
description: "Display a list of all categories.",
textdomain: "default",
attributes: {
displayAsDropdown: {
type: "boolean",
"default": false
},
showHierarchy: {
type: "boolean",
"default": false
},
showPostCounts: {
type: "boolean",
"default": false
},
showOnlyTopLevel: {
type: "boolean",
"default": false
},
showEmpty: {
type: "boolean",
"default": false
}
},
supports: {
align: true,
html: false,
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
editorStyle: "wp-block-categories-editor",
style: "wp-block-categories"
};
const {
name: categories_name
} = categories_metadata;
const categories_settings = {
icon: library_category,
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
/**
* WordPress dependencies
*/
const ConvertToBlocksButton = _ref => {
let {
clientId
} = _ref;
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, {
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/modal.js
/**
* WordPress dependencies
*/
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,
height: 500,
setup(editor) {
editor.on('init', () => {
const doc = editor.getDoc();
styles.forEach(_ref => {
let {
css
} = _ref;
const styleEl = doc.createElement('style');
styleEl.innerHTML = css;
doc.head.appendChild(styleEl);
});
});
}
}
});
return () => {
window.wp.oldEditor.remove(props.id);
};
}, []);
return (0,external_wp_element_namespaceObject.createElement)("textarea", props);
}
function ModalEdit(props) {
const {
clientId,
attributes: {
content
},
setAttributes,
onReplace
} = props;
const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const id = `editor-${clientId}`;
const label = (0,external_wp_i18n_namespaceObject.__)('Classic Edit');
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)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => setOpen(true)
}, label))), content && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content), (isOpen || !content) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: label,
__experimentalHideHeader: true
}, (0,external_wp_element_namespaceObject.createElement)("h2", {
style: {
display: 'flex',
justifyContent: 'space-between'
}
}, (0,external_wp_element_namespaceObject.createElement)("div", null, label), (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
onClick: () => content ? setOpen(false) : onReplace([])
}, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
isPrimary: true,
onClick: () => {
setAttributes({
content: window.wp.oldEditor.getContent(id)
});
setOpen(false);
}
}, (0,external_wp_i18n_namespaceObject.__)('Save')))), (0,external_wp_element_namespaceObject.createElement)(ClassicEdit, {
id: id,
defaultValue: content
})));
}
;// 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:
// <p><br data-mce-bogus="1"></p>
// 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 (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, canRemove && (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)({
ref
}), isIframed ? (0,external_wp_element_namespaceObject.createElement)(ModalEdit, props) : (0,external_wp_element_namespaceObject.createElement)(edit_ClassicEdit, props)));
}
function edit_ClassicEdit(_ref) {
let {
clientId,
attributes: {
content
},
setAttributes,
onReplace
} = _ref;
const {
getMultiSelectedBlockClientIds
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const didMount = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!didMount.current) {
return;
}
const editor = window.tinymce.get(`editor-${clientId}`);
const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent();
if (currentContent !== content) {
editor.setContent(content || '');
}
}, [content]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const {
baseURL,
suffix
} = window.wpEditorL10n.tinymce;
didMount.current = true;
window.tinymce.EditorManager.overrideDefaults({
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.
// 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.
// Updating during multi-selection can overwrite attributes of other blocks.
if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) {
setAttributes({
content: editor.getContent()
});
}
editor.once('focus', () => {
if (bookmark) {
editor.selection.moveToBookmark(bookmark);
if (scrollContainer.scrollTop !== scrollPosition) {
scrollContainer.scrollTop = scrollPosition;
}
}
});
return false;
});
editor.on('mousedown touchstart', () => {
bookmark = null;
});
const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => {
const value = editor.getContent();
if (value !== editor._lastChange) {
editor._lastChange = value;
setAttributes({
content: value
});
}
}, 250);
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;
/*
* 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.
if (rootNode.ownerDocument.activeElement === rootNode) {
rootNode.blur();
editor.focus();
}
});
}
function initialize() {
const {
settings
} = window.wpEditorL10n.tinymce;
wp.oldEditor.initialize(`editor-${clientId}`, {
tinymce: { ...settings,
inline: true,
content_css: false,
fixed_toolbar_container: `#toolbar-${clientId}`,
setup: onSetup
}
});
}
function onReadyStateChange() {
if (document.readyState === 'complete') {
initialize();
}
}
if (document.readyState === 'complete') {
initialize();
} else {
document.addEventListener('readystatechange', onReadyStateChange);
}
return () => {
document.removeEventListener('readystatechange', onReadyStateChange);
wp.oldEditor.remove(`editor-${clientId}`);
};
}, []);
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.nativeEvent.stopImmediatePropagation();
} // 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)("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"
}));
/* 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;
const {
content
} = attributes;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const freeform_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/freeform",
title: "Classic",
category: "text",
description: "Use the classic WordPress editor.",
textdomain: "default",
attributes: {
content: {
type: "string",
source: "html"
}
},
supports: {
className: false,
customClassName: false,
reusable: false
},
editorStyle: "wp-block-freeform-editor"
};
const {
name: freeform_name
} = freeform_metadata;
const freeform_settings = {
icon: library_classic,
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js
/**
* WordPress dependencies
*/
function CodeEdit(_ref) {
let {
attributes,
setAttributes,
onRemove
} = _ref;
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
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js
/**
* WordPress dependencies
*/
/**
* Escapes ampersands, shortcodes, and links.
*
* @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_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
* shortcode like [embed] becomes [embed]
*
* This function replicates the escaping of HTML tags, where a tag like
* <strong> becomes <strong>.
*
* @param {string} content The content of a code block.
* @return {string} The given content with its opening shortcode characters
* 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
* becomes https://youtube.com/watch?x.
*
* An isolated URL is a URL that sits in its own line, surrounded only by spacing
* characters.
*
* See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403
*
* @param {string} content The content of a code block.
* @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)
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js
/**
* WordPress dependencies
*/
const code_transforms_transforms = {
from: [{
type: 'enter',
regExp: /^```$/,
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code')
}, {
type: 'block',
blocks: ['core/html', 'core/paragraph'],
transform: _ref => {
let {
content
} = _ref;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', {
content
});
}
}, {
type: 'raw',
isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE',
schema: {
pre: {
children: {
code: {
children: {
'#text': {}
}
}
}
}
}
}],
to: [{
type: 'block',
blocks: ['core/paragraph'],
transform: _ref2 => {
let {
content
} = _ref2;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: content.replace(/\n/g, '<br>')
});
}
}]
};
/* harmony default export */ var code_transforms = (code_transforms_transforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const code_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/code",
title: "Code",
category: "text",
description: "Display code snippets that respect your spacing and tabs.",
textdomain: "default",
attributes: {
content: {
type: "string",
source: "html",
selector: "code"
}
},
supports: {
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
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
width: true,
color: true
}
},
color: {
text: true,
background: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
}
},
style: "wp-block-code"
};
const {
name: code_name
} = code_metadata;
const code_settings = {
icon: library_code,
example: {
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 );')
/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
}
},
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const column_deprecated_deprecated = [{
attributes: {
verticalAlignment: {
type: 'string'
},
width: {
type: 'number',
min: 0,
max: 100
}
},
isEligible(_ref) {
let {
width
} = _ref;
return isFinite(width);
},
migrate(attributes) {
return { ...attributes,
width: `${attributes.width}%`
};
},
save(_ref2) {
let {
attributes
} = _ref2;
const {
verticalAlignment,
width
} = attributes;
const wrapperClasses = classnames_default()({
[`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
const style = {
flexBasis: width + '%'
};
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: wrapperClasses,
style: style
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
}
}];
/* harmony default export */ var 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,
allowedBlocks
},
setAttributes,
clientId
} = _ref;
const classes = classnames_default()('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,
rootClientId
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockOrder,
getBlockRootClientId
} = select(external_wp_blockEditor_namespaceObject.store);
const rootId = getBlockRootClientId(clientId);
return {
hasChildBlocks: getBlockOrder(clientId).length > 0,
rootClientId: rootId,
columnsIds: getBlockOrder(rootId)
};
}, [clientId]);
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.
updateBlockAttributes(rootClientId, {
verticalAlignment: null
});
};
const widthWithUnit = Number.isFinite(width) ? width + '%' : width;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes,
style: widthWithUnit ? {
flexBasis: widthWithUnit
} : undefined
});
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 */
(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,
'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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function column_save_save(_ref) {
let {
attributes
} = _ref;
const {
verticalAlignment,
width
} = attributes;
const wrapperClasses = classnames_default()({
[`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.
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);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const column_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/column",
title: "Column",
category: "text",
parent: ["core/columns"],
description: "A single column within a columns block.",
textdomain: "default",
attributes: {
verticalAlignment: {
type: "string"
},
width: {
type: "string"
},
allowedBlocks: {
type: "array"
},
templateLock: {
type: ["string", "boolean"],
"enum": ["all", "insert", "contentOnly", false]
}
},
supports: {
anchor: true,
reusable: false,
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
blockGap: true,
padding: true,
__experimentalDefaultControls: {
padding: 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
}
},
__experimentalLayout: true
}
};
const {
name: column_name
} = column_metadata;
const column_settings = {
icon: library_column,
edit: column_edit,
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Given an HTML string for a deprecated columns inner block, returns the
* column index to which the migrated inner block should be assigned. Returns
* undefined if the inner block was not assigned to a column.
*
* @param {string} originalContent Deprecated Columns inner block HTML.
*
* @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;
}
const {
customTextColor,
customBackgroundColor,
...restAttributes
} = attributes;
return { ...restAttributes,
style,
isStackedOnMobile: true
};
};
/* harmony default export */ var columns_deprecated = ([{
attributes: {
verticalAlignment: {
type: 'string'
},
backgroundColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customTextColor: {
type: 'string'
},
textColor: {
type: 'string'
}
},
migrate: migrateCustomColors,
save(_ref) {
let {
attributes
} = _ref;
const {
verticalAlignment,
backgroundColor,
customBackgroundColor,
textColor,
customTextColor
} = 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()({
'has-background': backgroundColor || customBackgroundColor,
'has-text-color': textColor || customTextColor,
[backgroundClass]: backgroundClass,
[textClass]: textClass,
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
const style = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
color: textClass ? undefined : customTextColor
};
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: className ? className : undefined,
style: style
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
}
}, {
attributes: {
columns: {
type: 'number',
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
// 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));
const {
columns: ignoredColumns,
...restAttributes
} = attributes;
return [{ ...restAttributes,
isStackedOnMobile: true
}, migratedInnerBlocks];
},
save(_ref2) {
let {
attributes
} = _ref2;
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));
}
}, {
attributes: {
columns: {
type: 'number',
default: 2
}
},
migrate(attributes, innerBlocks) {
const {
columns,
...restAttributes
} = attributes;
attributes = { ...restAttributes,
isStackedOnMobile: true
};
return [attributes, innerBlocks];
},
save(_ref3) {
let {
attributes
} = _ref3;
const {
verticalAlignment,
columns
} = attributes;
const wrapperClasses = classnames_default()(`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));
}
}]);
;// 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.
*
* @param {?number} value Raw value.
*
* @return {number} Value rounded to standard precision.
*/
const toWidthPrecision = value => {
const unitlessValue = parseFloat(value);
return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
};
/**
* Returns an effective width for a given block. An effective width is equal to
* its attribute value if set, or a computed value assuming equal distribution.
*
* @param {WPBlock} block Block object.
* @param {number} totalBlockCount Total number of blocks in Columns.
*
* @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.
*
* @param {WPBlock[]} blocks Block objects.
* @param {?number} totalBlockCount Total number of blocks in Columns.
* Defaults to number of blocks passed.
*
* @return {number} Total width occupied by blocks.
*/
function getTotalColumnsWidth(blocks) {
let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0);
}
/**
* Returns an object of `clientId` → `width` of effective column widths.
*
* @param {WPBlock[]} blocks Block objects.
* @param {?number} totalBlockCount Total number of blocks in Columns.
* Defaults to number of blocks passed.
*
* @return {Object<string,number>} Column widths.
*/
function getColumnWidths(blocks) {
let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
return blocks.reduce((accumulator, block) => {
const width = getEffectiveColumnWidth(block, totalBlockCount);
return Object.assign(accumulator, {
[block.clientId]: width
});
}, {});
}
/**
* Returns an object of `clientId` → `width` of column widths as redistributed
* proportional to their current widths, constrained or expanded to fit within
* the given available width.
*
* @param {WPBlock[]} blocks Block objects.
* @param {number} availableWidth Maximum width to fit within.
* @param {?number} totalBlockCount Total number of blocks in Columns.
* Defaults to number of blocks passed.
*
* @return {Object<string,number>} Redistributed column widths.
*/
function getRedistributedColumnWidths(blocks, availableWidth) {
let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length;
const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => {
const newWidth = availableWidth * width / totalWidth;
return toWidthPrecision(newWidth);
});
}
/**
* Returns true if column blocks within the provided set are assigned with
* explicit widths, or false otherwise.
*
* @param {WPBlock[]} blocks Block objects.
*
* @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);
});
}
/**
* Returns a copy of the given set of blocks with new widths assigned from the
* provided object of redistributed column widths.
*
* @param {WPBlock[]} blocks Block objects.
* @param {Object<string,number>} widths Redistributed column widths.
*
* @return {WPBlock[]} blocks Mapped block objects.
*/
function getMappedColumnWidths(blocks, widths) {
return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, {
attributes: {
width: `${widths[block.clientId]}%`
}
}));
}
/**
* Returns an array with columns widths values, parsed or no depends on `withParsing` flag.
*
* @param {WPBlock[]} blocks Block objects.
* @param {?boolean} withParsing Whether value has to be parsed.
*
* @return {Array<number,string>} Column widths.
*/
function getWidths(blocks) {
let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return blocks.map(innerColumn => {
const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
});
}
/**
* Returns a column width with unit.
*
* @param {string} width Column width.
* @param {string} unit Column width unit.
*
* @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
*
* @param {string} unit Column width unit.
*
* @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
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
return {
count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId)
};
}, [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, {
__nextHasNoMarginBottom: true,
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
});
});
},
/**
* Updates the column count, including necessary revisions to child Column
* blocks to grant required or redistribute available space.
*
* @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);
let innerBlocks = getBlocks(clientId);
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
// constraining the available working width.
const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({
length: newColumns - previousColumns
}).map(() => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {
width: `${newColumnWidth}%`
});
})];
} else if (isAddingColumn) {
innerBlocks = [...innerBlocks, ...Array.from({
length: newColumns - previousColumns
}).map(() => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/column');
})];
} else {
// The removed column will be the last of the inner blocks.
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;
const {
blockType,
defaultVariation,
variations
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockVariations,
getBlockType,
getDefaultBlockVariation
} = select(external_wp_blocks_namespaceObject.store);
return {
blockType: getBlockType(name),
defaultVariation: getDefaultBlockVariation(name, 'block'),
variations: getBlockVariations(name, 'block')
};
}, [name]);
const {
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
}));
}
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);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function columns_save_save(_ref) {
let {
attributes
} = _ref;
const {
isStackedOnMobile,
verticalAlignment
} = attributes;
const className = classnames_default()({
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
[`is-not-stacked-on-mobile`]: !isStackedOnMobile
});
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js
/**
* WordPress dependencies
*/
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
/**
* Template option choices for predefined columns layouts.
*
* @type {WPBlockVariation[]}
*/
const variations = [{
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, {
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"
})),
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, {
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"
})),
isDefault: true,
innerBlocks: [['core/column'], ['core/column']],
scope: ['block']
}, {
name: 'two-columns-one-third-two-thirds',
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, {
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"
})),
innerBlocks: [['core/column', {
width: '33.33%'
}], ['core/column', {
width: '66.66%'
}]],
scope: ['block']
}, {
name: 'two-columns-two-thirds-one-third',
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, {
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"
})),
innerBlocks: [['core/column', {
width: '66.66%'
}], ['core/column', {
width: '33.33%'
}]],
scope: ['block']
}, {
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, {
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"
})),
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, {
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"
})),
innerBlocks: [['core/column', {
width: '25%'
}], ['core/column', {
width: '50%'
}], ['core/column', {
width: '25%'
}]],
scope: ['block']
}];
/* harmony default export */ var columns_variations = (variations);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
/**
* WordPress dependencies
*/
const MAXIMUM_SELECTED_BLOCKS = 6;
const columns_transforms_transforms = {
from: [{
type: 'block',
isMultiBlock: true,
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]]];
});
return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
},
isMatch: (_ref2, blocks) => {
let {
length: selectedBlocksLength
} = _ref2;
// 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;
}
}, {
type: 'block',
blocks: ['core/media-text'],
priority: 1,
transform: (attributes, innerBlocks) => {
const {
align,
backgroundColor,
textColor,
style,
mediaAlt: alt,
mediaId: id,
mediaPosition,
mediaSizeSlug: sizeSlug,
mediaType,
mediaUrl: url,
mediaWidth,
verticalAlignment
} = attributes;
let media;
if (mediaType === 'image' || !mediaType) {
const imageAttrs = {
id,
alt,
url,
sizeSlug
};
const linkAttrs = {
href: attributes.href,
linkClass: attributes.linkClass,
linkDestination: attributes.linkDestination,
linkTarget: attributes.linkTarget,
rel: attributes.rel
};
media = ['core/image', { ...imageAttrs,
...linkAttrs
}];
} else {
media = ['core/video', {
id,
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,
textColor,
style,
verticalAlignment
}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
}
}],
to: [{
type: 'block',
blocks: ['*'],
transform: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks)
}]
};
/* harmony default export */ var columns_transforms = (columns_transforms_transforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const columns_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/columns",
title: "Columns",
category: "design",
description: "Display content in multiple columns, with blocks added to each column.",
textdomain: "default",
attributes: {
verticalAlignment: {
type: "string"
},
isStackedOnMobile: {
type: "boolean",
"default": true
}
},
supports: {
anchor: true,
align: ["wide", "full"],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
blockGap: {
__experimentalDefault: "2em",
sides: ["horizontal", "vertical"]
},
margin: ["top", "bottom"],
padding: true,
__experimentalDefaultControls: {
padding: true
}
},
__experimentalLayout: {
allowSwitching: false,
allowInheriting: false,
allowEditing: false,
"default": {
type: "flex",
flexWrap: "nowrap"
}
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
radius: 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
}
}
},
editorStyle: "wp-block-columns-editor",
style: "wp-block-columns"
};
const {
name: columns_name
} = columns_metadata;
const columns_settings = {
icon: library_columns,
variations: columns_variations,
example: {
viewportWidth: 600,
// Columns collapse "@media (max-width: 599px)".
innerBlocks: [{
name: 'core/column',
innerBlocks: [{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.')
}
}, {
name: 'core/image',
attributes: {
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
}
}, {
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.')
}
}]
}, {
name: 'core/column',
innerBlocks: [{
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.')
}
}, {
name: 'core/paragraph',
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.')
}
}]
}]
},
deprecated: columns_deprecated,
edit: columns_edit,
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 = (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: "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 */ var 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: 2,
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
}
},
save(_ref) {
let {
attributes: {
tagName: Tag
}
} = _ref;
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const {
className
} = blockProps;
const classes = (className === null || className === void 0 ? void 0 : 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 === null || classes === void 0 ? void 0 : classes.filter(cls => cls !== 'wp-block-comments');
const newBlockProps = { ...blockProps,
className: newClasses.join(' ')
};
return (0,external_wp_element_namespaceObject.createElement)(Tag, newBlockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
}
};
/* harmony default export */ var comments_deprecated = ([v1]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js
/**
* WordPress dependencies
*/
function CommentsInspectorControls(_ref) {
let {
attributes: {
tagName
},
setAttributes
} = _ref;
const htmlElementMessages = {
section: (0,external_wp_i18n_namespaceObject.__)("The <section> 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 <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.")
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
options: [{
label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
value: 'div'
}, {
label: '<section>',
value: 'section'
}, {
label: '<aside>',
value: 'aside'
}],
value: tagName,
onChange: value => setAttributes({
tagName: value
}),
help: htmlElementMessages[tagName]
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const CommentsFormPlaceholder = () => {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder);
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-respond"
}, (0,external_wp_element_namespaceObject.createElement)("h3", {
className: "comment-reply-title"
}, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
noValidate: true,
className: "comment-form",
inert: "true"
}, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("label", {
htmlFor: `comment-${instanceId}`
}, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_wp_element_namespaceObject.createElement)("textarea", {
id: `comment-${instanceId}`,
name: "comment",
cols: "45",
rows: "8"
})), (0,external_wp_element_namespaceObject.createElement)("p", {
className: "form-submit wp-block-button"
}, (0,external_wp_element_namespaceObject.createElement)("input", {
name: "submit",
type: "submit",
className: classnames_default()('wp-block-button__link', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
value: (0,external_wp_i18n_namespaceObject.__)('Post Comment')
}))));
};
const CommentsForm = _ref => {
let {
postId,
postType
} = _ref;
const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
const isSiteEditor = postType === undefined || postId === undefined;
const {
defaultCommentStatus
} = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$getPostType;
return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
});
if (!isSiteEditor && 'open' !== commentStatus) {
if ('closed' === commentStatus) {
const actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
key: "enableComments",
onClick: () => setCommentStatus('open'),
variant: "primary"
}, (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))];
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
actions: actions
}, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.'));
} else if (!postTypeSupportsComments) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Post type (i.e. "post", "page") */
(0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType));
} else if ('open' !== defaultCommentStatus) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.'));
}
}
return (0,external_wp_element_namespaceObject.createElement)(CommentsFormPlaceholder, null);
};
/* harmony default export */ var post_comments_form_form = (CommentsForm);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PostCommentsPlaceholder(_ref) {
let {
postType,
postId
} = _ref;
let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title');
const {
avatarURL
} = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-comments__legacy-placeholder",
inert: "true"
}, (0,external_wp_element_namespaceObject.createElement)("h3", null,
/* translators: %s: Post title. */
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "navigation"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "alignleft"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "alignright"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("ol", {
className: "commentlist"
}, (0,external_wp_element_namespaceObject.createElement)("li", {
className: "comment even thread-even depth-1"
}, (0,external_wp_element_namespaceObject.createElement)("article", {
className: "comment-body"
}, (0,external_wp_element_namespaceObject.createElement)("footer", {
className: "comment-meta"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-author vcard"
}, (0,external_wp_element_namespaceObject.createElement)("img", {
alt: "Commenter Avatar",
src: avatarURL,
className: "avatar avatar-32 photo",
height: "32",
width: "32",
loading: "lazy"
}), (0,external_wp_element_namespaceObject.createElement)("b", {
className: "fn"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top",
className: "url"
}, (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
className: "says"
}, (0,external_wp_i18n_namespaceObject.__)('says'), ":")), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-metadata"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, (0,external_wp_element_namespaceObject.createElement)("time", {
dateTime: "2000-01-01T00:00:00+00:00"
}, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
className: "edit-link"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
className: "comment-edit-link",
href: "#top"
}, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-content"
}, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from'), ' ', (0,external_wp_element_namespaceObject.createElement)("a", {
href: "https://gravatar.com/"
}, "Gravatar"), ".")), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "reply"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
className: "comment-reply-link",
href: "#top",
"aria-label": "Reply to A WordPress Commenter"
}, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "navigation"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "alignleft"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "alignright"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, {
postId: postId,
postType: postType
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function CommentsLegacy(_ref) {
let {
attributes,
setAttributes,
context: {
postType,
postId
}
} = _ref;
const {
textAlign
} = attributes;
const actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
key: "convert",
onClick: () => void setAttributes({
legacy: false
}),
variant: "primary"
}, (0,external_wp_i18n_namespaceObject.__)('Switch to editable mode'))];
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
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: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
})), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
actions: actions
}, (0,external_wp_i18n_namespaceObject.__)('Comments block: You’re currently using the legacy version of the block. ' + 'The following is just a placeholder - the final styling will likely look different. ' + 'For a better representation and more customization options, ' + 'switch the block to its editable mode.')), (0,external_wp_element_namespaceObject.createElement)(PostCommentsPlaceholder, {
postId: postId,
postType: postType
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js
const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
width: '40px'
}, [['core/avatar', {
size: 40,
style: {
border: {
radius: '20px'
}
}
}]]], ['core/column', {}, [['core/comment-author-name', {
fontSize: 'small'
}], ['core/group', {
layout: {
type: 'flex'
},
style: {
spacing: {
margin: {
top: '0px',
bottom: '0px'
}
}
}
}, [['core/comment-date', {
fontSize: 'small'
}], ['core/comment-edit-link', {
fontSize: 'small'
}]]], ['core/comment-content'], ['core/comment-reply-link', {
fontSize: 'small'
}]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
/* harmony default export */ var template = (TEMPLATE);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function CommentsEdit(props) {
const {
attributes,
setAttributes
} = props;
const {
tagName: TagName,
legacy
} = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: template
});
if (legacy) {
return (0,external_wp_element_namespaceObject.createElement)(CommentsLegacy, props);
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(CommentsInspectorControls, {
attributes: attributes,
setAttributes: setAttributes
}), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/save.js
/**
* WordPress dependencies
*/
function comments_save_save(_ref) {
let {
attributes: {
tagName: Tag,
legacy
}
} = _ref;
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner
// blocks, so nothing is saved in that case.
return legacy ? null : (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments",
title: "Comments",
category: "theme",
description: "An advanced block that allows displaying post comments using different visual configurations.",
textdomain: "default",
attributes: {
tagName: {
type: "string",
"default": "div"
},
legacy: {
type: "boolean",
"default": false
}
},
supports: {
align: ["wide", "full"],
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
html: false,
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
editorStyle: "wp-block-comments-editor",
usesContext: ["postId", "postType"]
};
const {
name: comments_name
} = comments_metadata;
const comments_settings = {
icon: post_comments,
edit: CommentsEdit,
save: comments_save_save,
deprecated: comments_deprecated
};
const comments_init = () => initBlock({
name: comments_name,
metadata: comments_metadata,
settings: comments_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js
/**
* WordPress dependencies
*/
function edit_Edit(_ref) {
let {
attributes,
context: {
commentId
},
setAttributes,
isSelected
} = _ref;
const {
height,
width
} = attributes;
const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
const avatarUrls = avatars ? Object.values(avatars) : null;
const sizes = avatars ? Object.keys(avatars) : null;
const minSize = sizes ? sizes[0] : 24;
const maxSize = sizes ? sizes[sizes.length - 1] : 96;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const maxSizeBuffer = Math.floor(maxSize * 2.5);
const {
avatarURL
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
const {
__experimentalDiscussionSettings
} = getSettings();
return __experimentalDiscussionSettings;
});
const inspectorControls = (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.__)('Avatar Settings')
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
onChange: newWidth => setAttributes({
width: newWidth,
height: newWidth
}),
min: minSize,
max: maxSizeBuffer,
initialPosition: width,
value: width
})));
const resizableAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width,
height
},
showHandle: isSelected,
onResizeStop: (event, direction, elt, delta) => {
setAttributes({
height: parseInt(height + delta.height, 10),
width: parseInt(width + 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: minSize,
maxWidth: maxSizeBuffer
}, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL,
alt: `${authorName} ${(0,external_wp_i18n_namespaceObject.__)('Avatar')}`
}, blockProps)));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", spacingProps, resizableAvatar));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_author_avatar_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
__experimental: "fse",
name: "core/comment-author-avatar",
title: "Comment Author Avatar (deprecated)",
category: "theme",
ancestor: ["core/comment-template"],
description: "This block is deprecated. Please use the Avatar block instead.",
textdomain: "default",
attributes: {
width: {
type: "number",
"default": 96
},
height: {
type: "number",
"default": 96
}
},
usesContext: ["commentId"],
supports: {
html: false,
inserter: false,
__experimentalBorder: {
radius: true,
width: true,
color: true,
style: true
},
color: {
background: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
spacing: {
__experimentalSkipSerialization: true,
margin: true,
padding: true
}
}
};
const {
name: comment_author_avatar_name
} = comment_author_avatar_metadata;
const comment_author_avatar_settings = {
icon: comment_author_avatar,
edit: edit_Edit
};
const comment_author_avatar_init = () => initBlock({
name: comment_author_avatar_name,
metadata: comment_author_avatar_metadata,
settings: comment_author_avatar_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
/**
* WordPress dependencies
*/
const commentAuthorName = (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: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
fillRule: "evenodd",
clipRule: "evenodd"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
fillRule: "evenodd",
clipRule: "evenodd"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
cx: "12",
cy: "9",
r: "2",
fillRule: "evenodd",
clipRule: "evenodd"
}));
/* harmony default export */ var comment_author_name = (commentAuthorName);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Renders the `core/comment-author-name` block on the editor.
*
* @param {Object} props React props.
* @param {Object} props.setAttributes Callback for updating block attributes.
* @param {Object} props.attributes Block attributes.
* @param {string} props.attributes.isLink Whether the author name should be linked.
* @param {string} props.attributes.linkTarget Target of the link.
* @param {string} props.attributes.textAlign Text alignment.
* @param {Object} props.context Inherited context.
* @param {string} props.context.commentId The comment ID.
*
* @return {JSX.Element} React element.
*/
function comment_author_name_edit_Edit(_ref) {
let {
attributes: {
isLink,
linkTarget,
textAlign
},
context: {
commentId
},
setAttributes
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const comment = getEntityRecord('root', 'comment', commentId);
const authorName = comment === null || comment === void 0 ? void 0 : comment.author_name; // eslint-disable-line camelcase
if (comment && !authorName) {
var _user$name;
const user = getEntityRecord('root', 'user', comment.author);
return (_user$name = user === null || user === void 0 ? void 0 : user.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous');
}
return authorName !== null && authorName !== void 0 ? authorName : '';
}, [commentId]);
const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
}));
const inspectorControls = (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.__)('Link settings')
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
}), 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: linkTarget === '_blank'
})));
if (!commentId || !displayName) {
displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title');
}
const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#comment-author-pseudo-link",
onClick: event => event.preventDefault()
}, displayName) : displayName;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayAuthor));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
/**
* Internal dependencies
*/
const deprecated_v1 = {
attributes: {
isLink: {
type: 'boolean',
default: false
},
linkTarget: {
type: 'string',
default: '_self'
}
},
supports: {
html: false,
color: {
gradients: true,
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
migrate: migrate_font_family,
isEligible(_ref) {
var _style$typography;
let {
style
} = _ref;
return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
}
};
/**
* New deprecations need to be placed first
* for them to have higher priority.
*
* Old deprecations may need to be updated as well.
*
* See block-deprecation.md
*/
/* harmony default export */ var comment_author_name_deprecated = ([deprecated_v1]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_author_name_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-author-name",
title: "Comment Author Name",
category: "theme",
ancestor: ["core/comment-template"],
description: "Displays the name of the author of the comment.",
textdomain: "default",
attributes: {
isLink: {
type: "boolean",
"default": true
},
linkTarget: {
type: "string",
"default": "_self"
},
textAlign: {
type: "string"
}
},
usesContext: ["commentId"],
supports: {
html: false,
spacing: {
margin: true,
padding: true
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comment_author_name_name
} = comment_author_name_metadata;
const comment_author_name_settings = {
icon: comment_author_name,
edit: comment_author_name_edit_Edit,
deprecated: comment_author_name_deprecated
};
const comment_author_name_init = () => initBlock({
name: comment_author_name_name,
metadata: comment_author_name_metadata,
settings: comment_author_name_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js
/**
* WordPress dependencies
*/
const commentContent = (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, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
}));
/* harmony default export */ var comment_content = (commentContent);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Renders the `core/comment-content` block on the editor.
*
* @param {Object} props React props.
* @param {Object} props.setAttributes Callback for updating block attributes.
* @param {Object} props.attributes Block attributes.
* @param {string} props.attributes.textAlign The `textAlign` attribute.
* @param {Object} props.context Inherited context.
* @param {string} props.context.commentId The comment ID.
*
* @return {JSX.Element} React element.
*/
function comment_content_edit_Edit(_ref) {
let {
setAttributes,
attributes: {
textAlign
},
context: {
commentId
}
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
}));
if (!commentId || !content) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title'))));
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (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_element_namespaceObject.RawHTML, {
key: "html"
}, content.rendered))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_content_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-content",
title: "Comment Content",
category: "theme",
ancestor: ["core/comment-template"],
description: "Displays the contents of a comment.",
textdomain: "default",
usesContext: ["commentId"],
attributes: {
textAlign: {
type: "string"
}
},
supports: {
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
spacing: {
padding: ["horizontal", "vertical"],
__experimentalDefaultControls: {
padding: true
}
},
html: false
}
};
const {
name: comment_content_name
} = comment_content_metadata;
const comment_content_settings = {
icon: comment_content,
edit: comment_content_edit_Edit
};
const comment_content_init = () => initBlock({
name: comment_content_name,
metadata: comment_content_metadata,
settings: comment_content_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
/**
* WordPress dependencies
*/
const postDate = (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: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
}));
/* harmony default export */ var post_date = (postDate);
;// CONCATENATED MODULE: external ["wp","date"]
var external_wp_date_namespaceObject = window["wp"]["date"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
/**
* WordPress dependencies
*/
/**
* Renders the `core/comment-date` block on the editor.
*
* @param {Object} props React props.
* @param {Object} props.setAttributes Callback for updating block attributes.
* @param {Object} props.attributes Block attributes.
* @param {string} props.attributes.format Format of the date.
* @param {string} props.attributes.isLink Whether the author name should be linked.
* @param {Object} props.context Inherited context.
* @param {string} props.context.commentId The comment ID.
*
* @return {JSX.Element} React element.
*/
function comment_date_edit_Edit(_ref) {
let {
attributes: {
format,
isLink
},
context: {
commentId
},
setAttributes
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
const inspectorControls = (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_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
format: format,
defaultFormat: siteFormat,
onChange: nextFormat => setAttributes({
format: nextFormat
})
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
})));
if (!commentId || !date) {
date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title');
}
let commentDate = date instanceof Date ? (0,external_wp_element_namespaceObject.createElement)("time", {
dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date)
}, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_element_namespaceObject.createElement)("time", null, date);
if (isLink) {
commentDate = (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#comment-date-pseudo-link",
onClick: event => event.preventDefault()
}, commentDate);
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, commentDate));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
/**
* Internal dependencies
*/
const comment_date_deprecated_v1 = {
attributes: {
format: {
type: 'string'
},
isLink: {
type: 'boolean',
default: false
}
},
supports: {
html: false,
color: {
gradients: true,
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
migrate: migrate_font_family,
isEligible(_ref) {
var _style$typography;
let {
style
} = _ref;
return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
}
};
/**
* New deprecations need to be placed first
* for them to have higher priority.
*
* Old deprecations may need to be updated as well.
*
* See block-deprecation.md
*/
/* harmony default export */ var comment_date_deprecated = ([comment_date_deprecated_v1]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_date_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-date",
title: "Comment Date",
category: "theme",
ancestor: ["core/comment-template"],
description: "Displays the date on which the comment was posted.",
textdomain: "default",
attributes: {
format: {
type: "string"
},
isLink: {
type: "boolean",
"default": true
}
},
usesContext: ["commentId"],
supports: {
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comment_date_name
} = comment_date_metadata;
const comment_date_settings = {
icon: post_date,
edit: comment_date_edit_Edit,
deprecated: comment_date_deprecated
};
const comment_date_init = () => initBlock({
name: comment_date_name,
metadata: comment_date_metadata,
settings: comment_date_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
/**
* WordPress dependencies
*/
const commentEditLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
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.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"
}));
/* harmony default export */ var comment_edit_link = (commentEditLink);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function comment_edit_link_edit_Edit(_ref) {
let {
attributes: {
linkTarget,
textAlign
},
setAttributes
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
}));
const inspectorControls = (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.__)('Link settings')
}, (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: linkTarget === '_blank'
})));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#edit-comment-pseudo-link",
onClick: event => event.preventDefault()
}, (0,external_wp_i18n_namespaceObject.__)('Edit'))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_edit_link_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-edit-link",
title: "Comment Edit Link",
category: "theme",
ancestor: ["core/comment-template"],
description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
textdomain: "default",
usesContext: ["commentId"],
attributes: {
linkTarget: {
type: "string",
"default": "_self"
},
textAlign: {
type: "string"
}
},
supports: {
html: false,
color: {
link: true,
gradients: true,
text: false,
__experimentalDefaultControls: {
background: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comment_edit_link_name
} = comment_edit_link_metadata;
const comment_edit_link_settings = {
icon: comment_edit_link,
edit: comment_edit_link_edit_Edit
};
const comment_edit_link_init = () => initBlock({
name: comment_edit_link_name,
metadata: comment_edit_link_metadata,
settings: comment_edit_link_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
/**
* WordPress dependencies
*/
const commentReplyLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
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.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"
}));
/* harmony default export */ var comment_reply_link = (commentReplyLink);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Renders the `core/comment-reply-link` block on the editor.
*
* @param {Object} props React props.
* @param {Object} props.setAttributes Callback for updating block attributes.
* @param {Object} props.attributes Block attributes.
* @param {string} props.attributes.textAlign The `textAlign` attribute.
*
* @return {JSX.Element} React element.
*/
function comment_reply_link_edit_Edit(_ref) {
let {
setAttributes,
attributes: {
textAlign
}
} = _ref;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
}));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#comment-reply-pseudo-link",
onClick: event => event.preventDefault()
}, (0,external_wp_i18n_namespaceObject.__)('Reply'))));
}
/* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_reply_link_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-reply-link",
title: "Comment Reply Link",
category: "theme",
ancestor: ["core/comment-template"],
description: "Displays a link to reply to a comment.",
textdomain: "default",
usesContext: ["commentId"],
attributes: {
textAlign: {
type: "string"
}
},
supports: {
color: {
gradients: true,
link: true,
text: false,
__experimentalDefaultControls: {
background: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
html: false
}
};
const {
name: comment_reply_link_name
} = comment_reply_link_metadata;
const comment_reply_link_settings = {
edit: comment_reply_link_edit,
icon: comment_reply_link
};
const comment_reply_link_init = () => initBlock({
name: comment_reply_link_name,
metadata: comment_reply_link_metadata,
settings: comment_reply_link_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
/**
* WordPress dependencies
*/
const layout = (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: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
}));
/* harmony default export */ var library_layout = (layout);
;// CONCATENATED MODULE: external ["wp","apiFetch"]
var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
/**
* WordPress dependencies
*/
// This is limited by WP REST API
const MAX_COMMENTS_PER_PAGE = 100;
/**
* Return an object with the query args needed to fetch the default page of
* comments.
*
* @param {Object} props Hook props.
* @param {number} props.postId ID of the post that contains the comments.
* discussion settings.
*
* @return {Object} Query args to retrieve the comments.
*/
const useCommentQueryArgs = _ref => {
let {
postId
} = _ref;
// Initialize the query args that are not going to change.
const queryArgs = {
status: 'approve',
order: 'asc',
context: 'embed',
parent: 0,
_embed: 'children'
}; // Get the Discussion settings that may be needed to query the comments.
const {
pageComments,
commentsPerPage,
defaultCommentsPage: defaultPage
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
const {
__experimentalDiscussionSettings
} = getSettings();
return __experimentalDiscussionSettings;
}); // WP REST API doesn't allow fetching more than max items limit set per single page of data.
// As for the editor performance is more important than completeness of data and fetching only the
// max allowed for single page should be enough for the purpose of design and laying out the page.
// Fetching over the limit would return an error here but would work with backend query.
const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page.
const page = useDefaultPageIndex({
defaultPage,
postId,
perPage,
queryArgs
}); // Merge, memoize and return all query arguments, unless the default page's
// number is not known yet.
return (0,external_wp_element_namespaceObject.useMemo)(() => {
return page ? { ...queryArgs,
post: postId,
per_page: perPage,
page
} : null;
}, [postId, perPage, page]);
};
/**
* Return the index of the default page, depending on whether `defaultPage` is
* `newest` or `oldest`. In the first case, the only way to know the page's
* index is by using the `X-WP-TotalPages` header, which forces to make an
* additional request.
*
* @param {Object} props Hook props.
* @param {string} props.defaultPage Page shown by default (newest/oldest).
* @param {number} props.postId ID of the post that contains the comments.
* @param {number} props.perPage The number of comments included per page.
* @param {Object} props.queryArgs Other query args.
*
* @return {number} Index of the default comments page.
*/
const useDefaultPageIndex = _ref2 => {
let {
defaultPage,
postId,
perPage,
queryArgs
} = _ref2;
// Store the default page indices.
const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
const key = `${postId}_${perPage}`;
const page = defaultPages[key] || 0;
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Do nothing if the page is already known or not the newest page.
if (page || defaultPage !== 'newest') {
return;
} // We need to fetch comments to know the index. Use HEAD and limit
// fields just to ID, to make this call as light as possible.
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs,
post: postId,
per_page: perPage,
_fields: 'id'
}),
method: 'HEAD',
parse: false
}).then(res => {
const pages = parseInt(res.headers.get('X-WP-TotalPages'));
setDefaultPages({ ...defaultPages,
[key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page.
});
});
}, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one.
return defaultPage === 'newest' ? page : 1;
};
/**
* Generate a tree structure of comment IDs from a list of comment entities. The
* children of each comment are obtained from `_embedded`.
*
* @typedef {{ commentId: number, children: CommentNode }} CommentNode
*
* @param {Object[]} topLevelComments List of comment entities.
* @return {{ commentTree: CommentNode[]}} Tree of comment IDs.
*/
const useCommentTree = topLevelComments => {
const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments === null || topLevelComments === void 0 ? void 0 : topLevelComments.map(_ref3 => {
let {
id,
_embedded
} = _ref3;
const [children] = (_embedded === null || _embedded === void 0 ? void 0 : _embedded.children) || [[]];
return {
commentId: id,
children: children.map(child => ({
commentId: child.id
}))
};
}), [topLevelComments]);
return commentTree;
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
/**
* Function that returns a comment structure that will be rendered with default placehoders.
*
* Each comment has a `commentId` property that is always a negative number in
* case of the placeholders. This is to ensure that the comment does not
* conflict with the actual (real) comments.
*
* @param {Object} settings Discussion Settings.
* @param {number} [settings.perPage] - Comments per page setting or block attribute.
* @param {boolean} [settings.pageComments] - Enable break comments into pages setting.
* @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
* @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
*
* @typedef {{id: null, children: EmptyComment[]}} EmptyComment
* @return {EmptyComment[]} Inner blocks of the Comment Template
*/
const getCommentsPlaceholder = _ref => {
let {
perPage,
pageComments,
threadComments,
threadCommentsDepth
} = _ref;
// Limit commentsDepth to 3
const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3);
const buildChildrenComment = commentsLevel => {
// Render children comments until commentsDepth is reached
if (commentsLevel < commentsDepth) {
const nextLevel = commentsLevel + 1;
return [{
commentId: -(commentsLevel + 3),
children: buildChildrenComment(nextLevel)
}];
}
return [];
}; // Add the first comment and its children
const placeholderComments = [{
commentId: -1,
children: buildChildrenComment(1)
}]; // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max
if ((!pageComments || perPage >= 2) && commentsDepth < 3) {
placeholderComments.push({
commentId: -2,
children: []
});
} // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments
if ((!pageComments || perPage >= 3) && commentsDepth < 2) {
placeholderComments.push({
commentId: -3,
children: []
});
} // In case that the value is set but larger than 3 we truncate it to 3.
return placeholderComments;
};
/**
* Component which renders the inner blocks of the Comment Template.
*
* @param {Object} props Component props.
* @param {Array} [props.comment] - A comment object.
* @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
* @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
* @param {Array} [props.firstCommentId] - ID of the first comment in the array.
* @param {Array} [props.blocks] - Array of blocks returned from
* getBlocks() in parent .
* @return {WPElement} Inner blocks of the Comment Template
*/
function CommentTemplateInnerBlocks(_ref2) {
var _comment$children;
let {
comment,
activeCommentId,
setActiveCommentId,
firstCommentId,
blocks
} = _ref2;
const {
children,
...innerBlocksProps
} = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
template: edit_TEMPLATE
});
return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
blocks: blocks,
commentId: comment.commentId,
setActiveCommentId: setActiveCommentId,
isHidden: comment.commentId === (activeCommentId || firstCommentId)
}), (comment === null || comment === void 0 ? void 0 : (_comment$children = comment.children) === null || _comment$children === void 0 ? void 0 : _comment$children.length) > 0 ? (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
comments: comment.children,
activeCommentId: activeCommentId,
setActiveCommentId: setActiveCommentId,
blocks: blocks,
firstCommentId: firstCommentId
}) : null);
}
const CommentTemplatePreview = _ref3 => {
let {
blocks,
commentId,
setActiveCommentId,
isHidden
} = _ref3;
const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
blocks
});
const handleOnClick = () => {
setActiveCommentId(commentId);
}; // We have to hide the preview block if the `comment` props points to
// the curently active block!
// Or, to put it differently, every preview block is visible unless it is the
// currently active block - in this case we render its inner blocks.
const style = {
display: isHidden ? 'none' : undefined
};
return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockPreviewProps, {
tabIndex: 0,
role: "button",
style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
,
onClick: handleOnClick,
onKeyPress: handleOnClick
}));
};
const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
/**
* Component that renders a list of (nested) comments. It is called recursively.
*
* @param {Object} props Component props.
* @param {Array} [props.comments] - Array of comment objects.
* @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
* @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
* @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
* @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.
* @param {Object} [props.firstCommentId] - The ID of the first comment in the array of
* comment objects.
* @return {WPElement} List of comments.
*/
const CommentsList = _ref4 => {
let {
comments,
blockProps,
activeCommentId,
setActiveCommentId,
blocks,
firstCommentId
} = _ref4;
return (0,external_wp_element_namespaceObject.createElement)("ol", blockProps, comments && comments.map((_ref5, index) => {
let {
commentId,
...comment
} = _ref5;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
key: comment.commentId || index,
value: {
// If the commentId is negative it means that this comment is a
// "placeholder" and that the block is most likely being used in the
// site editor. In this case, we have to set the commentId to `null`
// because otherwise the (non-existent) comment with a negative ID
// would be reqested from the REST API.
commentId: commentId < 0 ? null : commentId
}
}, (0,external_wp_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
comment: {
commentId,
...comment
},
activeCommentId: activeCommentId,
setActiveCommentId: setActiveCommentId,
blocks: blocks,
firstCommentId: firstCommentId
}));
}));
};
function CommentTemplateEdit(_ref6) {
var _commentTree$;
let {
clientId,
context: {
postId
}
} = _ref6;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
const {
commentOrder,
threadCommentsDepth,
threadComments,
commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().__experimentalDiscussionSettings;
});
const commentQuery = useCommentQueryArgs({
postId
});
const {
topLevelComments,
blocks
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords
} = select(external_wp_coreData_namespaceObject.store);
const {
getBlocks
} = select(external_wp_blockEditor_namespaceObject.store);
return {
// Request only top-level comments. Replies are embedded.
topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null,
blocks: getBlocks(clientId)
};
}, [clientId, commentQuery]); // Generate a tree structure of comment IDs.
let commentTree = useCommentTree( // Reverse the order of top comments if needed.
commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments);
if (!topLevelComments) {
return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
}
if (!postId) {
commentTree = getCommentsPlaceholder({
perPage: commentsPerPage,
pageComments,
threadComments,
threadCommentsDepth
});
}
if (!commentTree.length) {
return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_i18n_namespaceObject.__)('No results found.'));
}
return (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
comments: commentTree,
blockProps: blockProps,
blocks: blocks,
activeCommentId: activeCommentId,
setActiveCommentId: setActiveCommentId,
firstCommentId: (_commentTree$ = commentTree[0]) === null || _commentTree$ === void 0 ? void 0 : _commentTree$.commentId
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
/**
* WordPress dependencies
*/
function CommentTemplateSave() {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comment_template_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comment-template",
title: "Comment Template",
category: "design",
parent: ["core/comments"],
description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.",
textdomain: "default",
usesContext: ["postId"],
supports: {
align: true,
html: false,
reusable: false,
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
style: "wp-block-comment-template"
};
const {
name: comment_template_name
} = comment_template_metadata;
const comment_template_settings = {
icon: library_layout,
edit: CommentTemplateEdit,
save: CommentTemplateSave
};
const comment_template_init = () => initBlock({
name: comment_template_name,
metadata: comment_template_metadata,
settings: comment_template_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
/**
* WordPress dependencies
*/
const queryPaginationPrevious = (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: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"
}));
/* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
/**
* WordPress dependencies
*/
const arrowMap = {
none: '',
arrow: '←',
chevron: '«'
};
function CommentsPaginationPreviousEdit(_ref) {
let {
attributes: {
label
},
setAttributes,
context: {
'comments/paginationArrow': paginationArrow
}
} = _ref;
const displayArrow = arrowMap[paginationArrow];
return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
href: "#comments-pagination-previous-pseudo-link",
onClick: event => event.preventDefault()
}, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
}, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_pagination_previous_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-pagination-previous",
title: "Comments Previous Page",
category: "theme",
parent: ["core/comments-pagination"],
description: "Displays the previous comment's page link.",
textdomain: "default",
attributes: {
label: {
type: "string"
}
},
usesContext: ["postId", "comments/paginationArrow"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comments_pagination_previous_name
} = comments_pagination_previous_metadata;
const comments_pagination_previous_settings = {
icon: query_pagination_previous,
edit: CommentsPaginationPreviousEdit
};
const comments_pagination_previous_init = () => initBlock({
name: comments_pagination_previous_name,
metadata: comments_pagination_previous_metadata,
settings: comments_pagination_previous_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
/**
* WordPress dependencies
*/
const queryPagination = (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: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
}));
/* harmony default export */ var query_pagination = (queryPagination);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
/**
* WordPress dependencies
*/
function CommentsPaginationArrowControls(_ref) {
let {
value,
onChange
} = _ref;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
value: value,
onChange: onChange,
help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'),
isBlock: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks')
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "arrow",
label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "chevron",
label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
const comments_pagination_edit_ALLOWED_BLOCKS = ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'];
function QueryPaginationEdit(_ref) {
let {
attributes: {
paginationArrow
},
setAttributes,
clientId
} = _ref;
const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlocks
} = select(external_wp_blockEditor_namespaceObject.store);
const innerBlocks = getBlocks(clientId);
/**
* Show the `paginationArrow` control only if a
* Comments Pagination Next or Comments Pagination Previous
* block exists.
*/
return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name);
});
}, []);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: comments_pagination_edit_TEMPLATE,
allowedBlocks: comments_pagination_edit_ALLOWED_BLOCKS
}); // Get the Discussion settings
const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
const {
__experimentalDiscussionSettings
} = getSettings();
return __experimentalDiscussionSettings === null || __experimentalDiscussionSettings === void 0 ? void 0 : __experimentalDiscussionSettings.pageComments;
}, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination
// controls. We don't want to remove them from the template so that when the user enables
// paging comments, the controls will be visible.
if (!pageComments) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings'));
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (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)(CommentsPaginationArrowControls, {
value: paginationArrow,
onChange: value => {
setAttributes({
paginationArrow: value
});
}
}))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
/**
* WordPress dependencies
*/
function comments_pagination_save_save() {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_pagination_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-pagination",
title: "Comments Pagination",
category: "theme",
parent: ["core/comments"],
description: "Displays a paginated navigation to next/previous set of comments, when applicable.",
textdomain: "default",
attributes: {
paginationArrow: {
type: "string",
"default": "none"
}
},
providesContext: {
"comments/paginationArrow": "paginationArrow"
},
supports: {
align: true,
reusable: false,
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
__experimentalLayout: {
allowSwitching: false,
allowInheriting: false,
"default": {
type: "flex"
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
editorStyle: "wp-block-comments-pagination-editor",
style: "wp-block-comments-pagination"
};
const {
name: comments_pagination_name
} = comments_pagination_metadata;
const comments_pagination_settings = {
icon: query_pagination,
edit: QueryPaginationEdit,
save: comments_pagination_save_save
};
const comments_pagination_init = () => initBlock({
name: comments_pagination_name,
metadata: comments_pagination_metadata,
settings: comments_pagination_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
/**
* WordPress dependencies
*/
const queryPaginationNext = (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: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"
}));
/* harmony default export */ var query_pagination_next = (queryPaginationNext);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
/**
* WordPress dependencies
*/
const edit_arrowMap = {
none: '',
arrow: '→',
chevron: '»'
};
function CommentsPaginationNextEdit(_ref) {
let {
attributes: {
label
},
setAttributes,
context: {
'comments/paginationArrow': paginationArrow
}
} = _ref;
const displayArrow = edit_arrowMap[paginationArrow];
return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
href: "#comments-pagination-next-pseudo-link",
onClick: event => event.preventDefault()
}, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
}), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
}, displayArrow));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_pagination_next_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-pagination-next",
title: "Comments Next Page",
category: "theme",
parent: ["core/comments-pagination"],
description: "Displays the next comment's page link.",
textdomain: "default",
attributes: {
label: {
type: "string"
}
},
usesContext: ["postId", "comments/paginationArrow"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comments_pagination_next_name
} = comments_pagination_next_metadata;
const comments_pagination_next_settings = {
icon: query_pagination_next,
edit: CommentsPaginationNextEdit
};
const comments_pagination_next_init = () => initBlock({
name: comments_pagination_next_name,
metadata: comments_pagination_next_metadata,
settings: comments_pagination_next_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
/**
* WordPress dependencies
*/
const queryPaginationNumbers = (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: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"
}));
/* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
/**
* WordPress dependencies
*/
const PaginationItem = _ref => {
let {
content,
tag: Tag = 'a',
extraClass = ''
} = _ref;
return Tag === 'a' ? (0,external_wp_element_namespaceObject.createElement)(Tag, {
className: `page-numbers ${extraClass}`,
href: "#comments-pagination-numbers-pseudo-link",
onClick: event => event.preventDefault()
}, content) : (0,external_wp_element_namespaceObject.createElement)(Tag, {
className: `page-numbers ${extraClass}`
}, content);
};
function CommentsPaginationNumbersEdit() {
return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "1"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "2"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "3",
tag: "span",
extraClass: "current"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "4"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "5"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "...",
tag: "span",
extraClass: "dots"
}), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
content: "8"
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_pagination_numbers_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-pagination-numbers",
title: "Comments Page Numbers",
category: "theme",
parent: ["core/comments-pagination"],
description: "Displays a list of page numbers for comments pagination.",
textdomain: "default",
usesContext: ["postId"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
}
};
const {
name: comments_pagination_numbers_name
} = comments_pagination_numbers_metadata;
const comments_pagination_numbers_settings = {
icon: query_pagination_numbers,
edit: CommentsPaginationNumbersEdit
};
const comments_pagination_numbers_init = () => initBlock({
name: comments_pagination_numbers_name,
metadata: comments_pagination_numbers_metadata,
settings: comments_pagination_numbers_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/title.js
/**
* WordPress dependencies
*/
const title = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "https://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M4 5.417h2.267V12h1.466V5.417H10V4H4v1.417ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z"
}));
/* harmony default export */ var library_title = (title);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
/**
* WordPress dependencies
*/
/** @typedef {import('@wordpress/element').WPComponent} WPComponent */
/**
* HeadingLevelIcon props.
*
* @typedef WPHeadingLevelIconProps
*
* @property {number} level The heading level to show an icon for.
* @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false.
*/
/**
* Heading level icon.
*
* @param {WPHeadingLevelIconProps} props Component props.
*
* @return {?WPComponent} The icon.
*/
function HeadingLevelIcon(_ref) {
let {
level,
isPressed = false
} = _ref;
const levelToPath = {
1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
};
if (!levelToPath.hasOwnProperty(level)) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 20 20",
xmlns: "http://www.w3.org/2000/svg",
isPressed: isPressed
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: levelToPath[level]
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
const POPOVER_PROPS = {
className: 'block-library-heading-level-dropdown'
};
/** @typedef {import('@wordpress/element').WPComponent} WPComponent */
/**
* HeadingLevelDropdown props.
*
* @typedef WPHeadingLevelDropdownProps
*
* @property {number} selectedLevel The chosen heading level.
* @property {(newValue:number)=>any} onChange Callback to run when
* toolbar value is changed.
*/
/**
* Dropdown for selecting a heading level (1 through 6).
*
* @param {WPHeadingLevelDropdownProps} props Component props.
*
* @return {WPComponent} The toolbar.
*/
function HeadingLevelDropdown(_ref) {
let {
selectedLevel,
onChange
} = _ref;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
popoverProps: POPOVER_PROPS,
icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
level: selectedLevel
}),
label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
controls: HEADING_LEVELS.map(targetLevel => {
{
const isActive = targetLevel === selectedLevel;
return {
icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
level: targetLevel,
isPressed: isActive
}),
label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
(0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
isActive,
onClick() {
onChange(targetLevel);
},
role: 'menuitemradio'
};
}
})
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function comments_title_edit_Edit(_ref) {
let {
attributes: {
textAlign,
showPostTitle,
showCommentsCount,
level
},
setAttributes,
context: {
postType,
postId
}
} = _ref;
const TagName = 'h' + level;
const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
const isSiteEditor = typeof postId === 'undefined';
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
const {
threadCommentsDepth,
threadComments,
commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().__experimentalDiscussionSettings;
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isSiteEditor) {
// Match the number of comments that will be shown in the comment-template/edit.js placeholder
const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0;
const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber);
setCommentsCount(Math.min(commentsNumber, 3));
return;
}
const currentPostId = postId;
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
post: postId,
_fields: 'id'
}),
method: 'HEAD',
parse: false
}).then(res => {
// Stale requests will have the `currentPostId` of an older closure.
if (currentPostId === postId) {
setCommentsCount(parseInt(res.headers.get('X-WP-Total')));
}
}).catch(() => {
setCommentsCount(0);
});
}, [postId]);
const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
}), (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
selectedLevel: level,
onChange: newLevel => setAttributes({
level: newLevel
})
}));
const inspectorControls = (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.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
checked: showPostTitle,
onChange: value => setAttributes({
showPostTitle: value
})
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'),
checked: showCommentsCount,
onChange: value => setAttributes({
showCommentsCount: value
})
})));
const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('“Post Title”') : `"${rawTitle}"`;
let placeholder;
if (showCommentsCount && commentsCount !== undefined) {
if (showPostTitle) {
if (commentsCount === 1) {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Number of comments, 2: Post title. */
(0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Number of comments. */
(0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount);
}
} else if (showPostTitle) {
if (commentsCount === 1) {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
} else {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
} else {
placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
/**
* Internal dependencies
*/
const deprecated_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-title",
title: "Comments Title",
category: "theme",
ancestor: ["core/comments"],
description: "Displays a title with the number of comments",
textdomain: "default",
usesContext: ["postId", "postType"],
attributes: {
textAlign: {
type: "string"
},
showPostTitle: {
type: "boolean",
"default": true
},
showCommentsCount: {
type: "boolean",
"default": true
},
level: {
type: "number",
"default": 2
}
},
supports: {
anchor: false,
align: true,
html: false,
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true
}
}
}
};
const {
attributes,
supports
} = deprecated_metadata;
/* harmony default export */ var comments_title_deprecated = ([{
attributes: { ...attributes,
singleCommentLabel: {
type: 'string'
},
multipleCommentsLabel: {
type: 'string'
}
},
supports,
migrate: oldAttributes => {
const {
singleCommentLabel,
multipleCommentsLabel,
...newAttributes
} = oldAttributes;
return newAttributes;
},
isEligible: _ref => {
let {
multipleCommentsLabel,
singleCommentLabel
} = _ref;
return multipleCommentsLabel || singleCommentLabel;
},
save: () => null
}]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const comments_title_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-title",
title: "Comments Title",
category: "theme",
ancestor: ["core/comments"],
description: "Displays a title with the number of comments",
textdomain: "default",
usesContext: ["postId", "postType"],
attributes: {
textAlign: {
type: "string"
},
showPostTitle: {
type: "boolean",
"default": true
},
showCommentsCount: {
type: "boolean",
"default": true
},
level: {
type: "number",
"default": 2
}
},
supports: {
anchor: false,
align: true,
html: false,
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true
}
}
}
};
const {
name: comments_title_name
} = comments_title_metadata;
const comments_title_settings = {
icon: library_title,
edit: comments_title_edit_Edit,
deprecated: comments_title_deprecated
};
const comments_title_init = () => initBlock({
name: comments_title_name,
metadata: comments_title_metadata,
settings: comments_title_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
/**
* WordPress dependencies
*/
const cover = (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: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"
}));
/* harmony default export */ var library_cover = (cover);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js
/**
* WordPress dependencies
*/
const POSITION_CLASSNAMES = {
'top left': 'is-position-top-left',
'top center': 'is-position-top-center',
'top right': 'is-position-top-right',
'center left': 'is-position-center-left',
'center center': 'is-position-center-center',
center: 'is-position-center-center',
'center right': 'is-position-center-right',
'bottom left': 'is-position-bottom-left',
'bottom center': 'is-position-bottom-center',
'bottom right': 'is-position-bottom-right'
};
const IMAGE_BACKGROUND_TYPE = 'image';
const VIDEO_BACKGROUND_TYPE = 'video';
const COVER_MIN_HEIGHT = 50;
const COVER_MAX_HEIGHT = 1000;
const COVER_DEFAULT_HEIGHT = 300;
const DEFAULT_FOCAL_POINT = {
x: 0.5,
y: 0.5
};
const shared_ALLOWED_MEDIA_TYPES = ['image', 'video'];
function mediaPosition() {
let {
x,
y
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_FOCAL_POINT;
return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
}
function dimRatioToClass(ratio) {
return ratio === 50 || !ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
}
function attributesFromMedia(setAttributes, dimRatio) {
return media => {
if (!media || !media.url) {
setAttributes({
url: undefined,
id: undefined
});
return;
}
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
}
let mediaType; // For media selections originated from a file upload.
if (media.media_type) {
if (media.media_type === IMAGE_BACKGROUND_TYPE) {
mediaType = IMAGE_BACKGROUND_TYPE;
} else {
// only images and videos are accepted so if the media_type is not an image we can assume it is a video.
// Videos contain the media type of 'file' in the object returned from the rest api.
mediaType = VIDEO_BACKGROUND_TYPE;
}
} else {
// For media selections originated from existing files in the media library.
if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
return;
}
mediaType = media.type;
}
setAttributes({
dimRatio: dimRatio === 100 ? 50 : dimRatio,
url: media.url,
id: media.id,
alt: media === null || media === void 0 ? void 0 : media.alt,
backgroundType: mediaType,
focalPoint: undefined,
...(mediaType === VIDEO_BACKGROUND_TYPE ? {
hasParallax: undefined
} : {})
});
};
}
/**
* Checks of the contentPosition is the center (default) position.
*
* @param {string} contentPosition The current content position.
* @return {boolean} Whether the contentPosition is center.
*/
function isContentPositionCenter(contentPosition) {
return !contentPosition || contentPosition === 'center center' || contentPosition === 'center';
}
/**
* Retrieves the className for the current contentPosition.
* The default position (center) will not have a className.
*
* @param {string} contentPosition The current content position.
* @return {string} The className assigned to the contentPosition.
*/
function getPositionClassName(contentPosition) {
/*
* Only render a className if the contentPosition is not center (the default).
*/
if (isContentPositionCenter(contentPosition)) return '';
return POSITION_CLASSNAMES[contentPosition];
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function backgroundImageStyles(url) {
return url ? {
backgroundImage: `url(${url})`
} : {};
}
/**
* Original function to determine the background opacity classname
*
* Used in deprecations: v1-7.
*
* @param {number} ratio ratio to use for opacity.
* @return {string} background opacity class .
*/
function dimRatioToClassV1(ratio) {
return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
}
function migrateDimRatio(attributes) {
return { ...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio
};
}
function migrateTag(attributes) {
if (!attributes.tagName) {
attributes = { ...attributes,
tagName: 'div'
};
}
return { ...attributes
};
}
const deprecated_blockAttributes = {
url: {
type: 'string'
},
id: {
type: 'number'
},
hasParallax: {
type: 'boolean',
default: false
},
dimRatio: {
type: 'number',
default: 50
},
overlayColor: {
type: 'string'
},
customOverlayColor: {
type: 'string'
},
backgroundType: {
type: 'string',
default: 'image'
},
focalPoint: {
type: 'object'
}
};
const v8ToV10BlockAttributes = {
url: {
type: 'string'
},
id: {
type: 'number'
},
alt: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'alt',
default: ''
},
hasParallax: {
type: 'boolean',
default: false
},
isRepeated: {
type: 'boolean',
default: false
},
dimRatio: {
type: 'number',
default: 100
},
overlayColor: {
type: 'string'
},
customOverlayColor: {
type: 'string'
},
backgroundType: {
type: 'string',
default: 'image'
},
focalPoint: {
type: 'object'
},
minHeight: {
type: 'number'
},
minHeightUnit: {
type: 'string'
},
gradient: {
type: 'string'
},
customGradient: {
type: 'string'
},
contentPosition: {
type: 'string'
},
isDark: {
type: 'boolean',
default: true
},
allowedBlocks: {
type: 'array'
},
templateLock: {
type: ['string', 'boolean'],
enum: ['all', 'insert', false]
}
};
const v7toV10BlockSupports = {
anchor: true,
align: true,
html: false,
spacing: {
padding: true,
__experimentalDefaultControls: {
padding: true
}
},
color: {
__experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
text: false,
background: false
}
}; // Deprecation for blocks that does not have a HTML tag option.
const deprecated_v11 = {
attributes: v8ToV10BlockAttributes,
supports: v7toV10BlockSupports,
save(_ref) {
let {
attributes
} = _ref;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || undefined
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient ? customGradient : undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined;
const backgroundImage = url ? `url(${url})` : undefined;
const backgroundPosition = mediaPosition(focalPoint);
const classes = classnames_default()({
'is-light': !isDark,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
'has-parallax': hasParallax,
'is-repeated': isRepeated
});
const gradientValue = gradient || customGradient;
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== undefined,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}),
style: bgStyle
}), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_wp_element_namespaceObject.createElement)("img", {
className: imgClasses,
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
role: "img",
className: imgClasses,
style: {
backgroundPosition,
backgroundImage
}
})), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-cover__inner-container'
})));
}
}; // Deprecation for blocks that renders fixed background as backgroud from the main block container.
const deprecated_v10 = {
attributes: v8ToV10BlockAttributes,
supports: v7toV10BlockSupports,
save(_ref2) {
let {
attributes
} = _ref2;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
minHeight: minHeight || undefined
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient ? customGradient : undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
const classes = classnames_default()({
'is-light': !isDark,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
const gradientValue = gradient || customGradient;
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== undefined,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}),
style: bgStyle
}), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-cover__inner-container'
})));
}
}; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
const v9 = {
attributes: v8ToV10BlockAttributes,
supports: v7toV10BlockSupports,
save(_ref3) {
let {
attributes
} = _ref3;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
minHeight: minHeight || undefined
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient ? customGradient : undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
const classes = classnames_default()({
'is-light': !isDark,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
const gradientValue = gradient || customGradient;
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== undefined,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}),
style: bgStyle
}), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-cover__inner-container'
})));
},
migrate: migrateTag
}; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
const v8 = {
attributes: v8ToV10BlockAttributes,
supports: v7toV10BlockSupports,
save(_ref4) {
let {
attributes
} = _ref4;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
minHeight: minHeight || undefined
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient ? customGradient : undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
const classes = classnames_default()({
'is-light': !isDark,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, {
'has-background-dim': dimRatio !== undefined,
'has-background-gradient': gradient || customGradient,
[gradientClass]: !url && gradientClass
}),
style: bgStyle
}), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-cover__inner-container'
})));
},
migrate: migrateTag
};
const v7 = {
attributes: { ...deprecated_blockAttributes,
isRepeated: {
type: 'boolean',
default: false
},
minHeight: {
type: 'number'
},
minHeightUnit: {
type: 'string'
},
gradient: {
type: 'string'
},
customGradient: {
type: 'string'
},
contentPosition: {
type: 'string'
},
alt: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'alt',
default: ''
}
},
supports: v7toV10BlockSupports,
save(_ref5) {
let {
attributes
} = _ref5;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient && !url ? customGradient : undefined,
minHeight: minHeight || undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-background-gradient': gradient || customGradient,
[gradientClass]: !url && gradientClass,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
style: customGradient ? {
background: customGradient
} : undefined
}), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-cover__inner-container"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v6 = {
attributes: { ...deprecated_blockAttributes,
isRepeated: {
type: 'boolean',
default: false
},
minHeight: {
type: 'number'
},
minHeightUnit: {
type: 'string'
},
gradient: {
type: 'string'
},
customGradient: {
type: 'string'
},
contentPosition: {
type: 'string'
}
},
supports: {
align: true
},
save(_ref6) {
let {
attributes
} = _ref6;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
overlayColor,
url,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const style = isImageBackground ? backgroundImageStyles(url) : {};
const videoStyle = {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || undefined;
let positionValue;
if (focalPoint) {
positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
if (isImageBackground && !hasParallax) {
style.backgroundPosition = positionValue;
}
if (isVideoBackground) {
videoStyle.objectPosition = positionValue;
}
}
const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-background-gradient': gradient || customGradient,
[gradientClass]: !url && gradientClass,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
style: customGradient ? {
background: customGradient
} : undefined
}), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: videoStyle
}), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-cover__inner-container"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v5 = {
attributes: { ...deprecated_blockAttributes,
minHeight: {
type: 'number'
},
gradient: {
type: 'string'
},
customGradient: {
type: 'string'
}
},
supports: {
align: true
},
save(_ref7) {
let {
attributes
} = _ref7;
const {
backgroundType,
gradient,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
url,
minHeight
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || undefined;
const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
'has-background-gradient': customGradient,
[gradientClass]: !url && gradientClass
});
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: classes,
style: style
}, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
style: customGradient ? {
background: customGradient
} : undefined
}), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-cover__inner-container"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v4 = {
attributes: { ...deprecated_blockAttributes,
minHeight: {
type: 'number'
},
gradient: {
type: 'string'
},
customGradient: {
type: 'string'
}
},
supports: {
align: true
},
save(_ref8) {
let {
attributes
} = _ref8;
const {
backgroundType,
gradient,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
url,
minHeight
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || undefined;
const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
'has-background-gradient': customGradient,
[gradientClass]: !url && gradientClass
});
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: classes,
style: style
}, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
style: customGradient ? {
background: customGradient
} : undefined
}), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-cover__inner-container"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v3 = {
attributes: { ...deprecated_blockAttributes,
title: {
type: 'string',
source: 'html',
selector: 'p'
},
contentAlign: {
type: 'string',
default: 'center'
}
},
supports: {
align: true
},
save(_ref9) {
let {
attributes
} = _ref9;
const {
backgroundType,
contentAlign,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
title,
url
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
}
const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
[`has-${contentAlign}-content`]: contentAlign !== 'center'
});
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: classes,
style: style
}, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
className: "wp-block-cover-text",
value: title
}));
},
migrate(attributes) {
const newAttribs = { ...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? 'div' : attributes.tagName
};
const {
title,
contentAlign,
...restAttributes
} = newAttribs;
return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: attributes.title,
align: attributes.contentAlign,
fontSize: 'large',
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
})]];
}
};
const v2 = {
attributes: { ...deprecated_blockAttributes,
title: {
type: 'string',
source: 'html',
selector: 'p'
},
contentAlign: {
type: 'string',
default: 'center'
},
align: {
type: 'string'
}
},
supports: {
className: false
},
save(_ref10) {
let {
attributes
} = _ref10;
const {
url,
title,
hasParallax,
dimRatio,
align,
contentAlign,
overlayColor,
customOverlayColor
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const style = backgroundImageStyles(url);
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax,
[`has-${contentAlign}-content`]: contentAlign !== 'center'
}, align ? `align${align}` : null);
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: classes,
style: style
}, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
className: "wp-block-cover-image-text",
value: title
}));
},
migrate(attributes) {
const newAttribs = { ...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? 'div' : attributes.tagName
};
const {
title,
contentAlign,
align,
...restAttributes
} = newAttribs;
return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: attributes.title,
align: attributes.contentAlign,
fontSize: 'large',
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
})]];
}
};
const cover_deprecated_v1 = {
attributes: { ...deprecated_blockAttributes,
title: {
type: 'string',
source: 'html',
selector: 'h2'
},
align: {
type: 'string'
},
contentAlign: {
type: 'string',
default: 'center'
}
},
supports: {
className: false
},
save(_ref11) {
let {
attributes
} = _ref11;
const {
url,
title,
hasParallax,
dimRatio,
align
} = attributes;
const style = backgroundImageStyles(url);
const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
'has-background-dim': dimRatio !== 0,
'has-parallax': hasParallax
}, align ? `align${align}` : null);
return (0,external_wp_element_namespaceObject.createElement)("section", {
className: classes,
style: style
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "h2",
value: title
}));
},
migrate(attributes) {
const newAttribs = { ...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? 'div' : attributes.tagName
};
const {
title,
contentAlign,
align,
...restAttributes
} = newAttribs;
return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: attributes.title,
align: attributes.contentAlign,
fontSize: 'large',
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
})]];
}
};
/* harmony default export */ var cover_deprecated = ([deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);
;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs
/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
;// CONCATENATED MODULE: ./node_modules/fast-average-color/dist/index.esm.js
/*! Fast Average Color | © 2023 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */
function toHex(num) {
var str = num.toString(16);
return str.length === 1 ? '0' + str : str;
}
function arrayToHex(arr) {
return '#' + arr.map(toHex).join('');
}
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;
}
function prepareIgnoredColor(color) {
if (!color) {
return [];
}
return isRGBArray(color) ? color : [color];
}
function isRGBArray(value) {
return Array.isArray(value[0]);
}
function isIgnoredColor(data, index, ignoredColor) {
for (var i = 0; i < ignoredColor.length; i++) {
if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) {
return true;
}
}
return false;
}
function isIgnoredColorAsNumbers(data, index, ignoredColor) {
switch (ignoredColor.length) {
case 3:
// [red, green, blue]
if (isIgnoredRGBColor(data, index, ignoredColor)) {
return true;
}
break;
case 4:
// [red, green, blue, alpha]
if (isIgnoredRGBAColor(data, index, ignoredColor)) {
return true;
}
break;
case 5:
// [red, green, blue, alpha, threshold]
if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) {
return true;
}
break;
default:
return false;
}
}
function isIgnoredRGBColor(data, index, ignoredColor) {
// Ignore if the pixel are transparent.
if (data[index + 3] !== 255) {
return true;
}
if (data[index] === ignoredColor[0] &&
data[index + 1] === ignoredColor[1] &&
data[index + 2] === ignoredColor[2]) {
return true;
}
return false;
}
function isIgnoredRGBAColor(data, index, ignoredColor) {
if (data[index + 3] && ignoredColor[3]) {
return data[index] === ignoredColor[0] &&
data[index + 1] === ignoredColor[1] &&
data[index + 2] === ignoredColor[2] &&
data[index + 3] === ignoredColor[3];
}
// Ignore rgb components if the pixel are fully transparent.
return data[index + 3] === ignoredColor[3];
}
function inRange(colorComponent, ignoredColorComponent, value) {
return colorComponent >= (ignoredColorComponent - value) &&
colorComponent <= (ignoredColorComponent + value);
}
function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) {
var redIgnored = ignoredColor[0];
var greenIgnored = ignoredColor[1];
var blueIgnored = ignoredColor[2];
var alphaIgnored = ignoredColor[3];
var threshold = ignoredColor[4];
var alphaData = data[index + 3];
var alphaInRange = inRange(alphaData, alphaIgnored, threshold);
if (!alphaIgnored) {
return alphaInRange;
}
if (!alphaData && alphaInRange) {
return true;
}
if (inRange(data[index], redIgnored, threshold) &&
inRange(data[index + 1], greenIgnored, threshold) &&
inRange(data[index + 2], blueIgnored, threshold) &&
alphaInRange) {
return true;
}
return false;
}
var DEFAULT_DOMINANT_DIVIDER = 24;
function dominantAlgorithm(arr, len, options) {
var colorHash = {};
var divider = options.dominantDivider || DEFAULT_DOMINANT_DIVIDER;
var ignoredColor = options.ignoredColor;
var step = options.step;
var max = [0, 0, 0, 0, 0];
for (var i = 0; i < len; i += step) {
var red = arr[i];
var green = arr[i + 1];
var blue = arr[i + 2];
var alpha = arr[i + 3];
if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) {
continue;
}
var 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];
}
if (max[4] < colorHash[key][4]) {
max = colorHash[key];
}
}
var redTotal = max[0];
var greenTotal = max[1];
var blueTotal = max[2];
var alphaTotal = max[3];
var count = max[4];
return alphaTotal ? [
Math.round(redTotal / alphaTotal),
Math.round(greenTotal / alphaTotal),
Math.round(blueTotal / alphaTotal),
Math.round(alphaTotal / count)
] : options.defaultColor;
}
function simpleAlgorithm(arr, len, options) {
var redTotal = 0;
var greenTotal = 0;
var blueTotal = 0;
var alphaTotal = 0;
var count = 0;
var ignoredColor = options.ignoredColor;
var step = options.step;
for (var i = 0; i < len; i += step) {
var alpha = arr[i + 3];
var red = arr[i] * alpha;
var green = arr[i + 1] * alpha;
var blue = arr[i + 2] * alpha;
if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) {
continue;
}
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)
] : options.defaultColor;
}
function sqrtAlgorithm(arr, len, options) {
var redTotal = 0;
var greenTotal = 0;
var blueTotal = 0;
var alphaTotal = 0;
var count = 0;
var ignoredColor = options.ignoredColor;
var step = options.step;
for (var i = 0; i < len; i += step) {
var red = arr[i];
var green = arr[i + 1];
var blue = arr[i + 2];
var alpha = arr[i + 3];
if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) {
continue;
}
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)
] : options.defaultColor;
}
function getDefaultColor(options) {
return getOption(options, 'defaultColor', [0, 0, 0, 0]);
}
function getOption(options, name, defaultValue) {
return (options[name] === undefined ? defaultValue : options[name]);
}
var MIN_SIZE = 10;
var MAX_SIZE = 100;
function isSvg(filename) {
return filename.search(/\.svg(\?|$)/i) !== -1;
}
function getOriginalSize(resource) {
if (isInstanceOfHTMLImageElement(resource)) {
var width = resource.naturalWidth;
var height = resource.naturalHeight;
// For SVG images with only viewBox attribute
if (!resource.naturalWidth && isSvg(resource.src)) {
width = height = MAX_SIZE;
}
return {
width: width,
height: height,
};
}
if (isInstanceOfHTMLVideoElement(resource)) {
return {
width: resource.videoWidth,
height: resource.videoHeight
};
}
return {
width: resource.width,
height: resource.height
};
}
function getSrc(resource) {
if (isInstanceOfHTMLCanvasElement(resource)) {
return 'canvas';
}
if (isInstanceOfOffscreenCanvas(resource)) {
return 'offscreencanvas';
}
if (isInstanceOfImageBitmap(resource)) {
return 'imagebitmap';
}
return resource.src;
}
function isInstanceOfHTMLImageElement(resource) {
return typeof HTMLImageElement !== 'undefined' && resource instanceof HTMLImageElement;
}
var hasOffscreenCanvas = typeof OffscreenCanvas !== 'undefined';
function isInstanceOfOffscreenCanvas(resource) {
return hasOffscreenCanvas && resource instanceof OffscreenCanvas;
}
function isInstanceOfHTMLVideoElement(resource) {
return typeof HTMLVideoElement !== 'undefined' && resource instanceof HTMLVideoElement;
}
function isInstanceOfHTMLCanvasElement(resource) {
return typeof HTMLCanvasElement !== 'undefined' && resource instanceof HTMLCanvasElement;
}
function isInstanceOfImageBitmap(resource) {
return typeof ImageBitmap !== 'undefined' && resource instanceof ImageBitmap;
}
function prepareSizeAndPosition(originalSize, options) {
var srcLeft = getOption(options, 'left', 0);
var srcTop = getOption(options, 'top', 0);
var srcWidth = getOption(options, 'width', originalSize.width);
var srcHeight = getOption(options, 'height', originalSize.height);
var destWidth = srcWidth;
var destHeight = srcHeight;
if (options.mode === 'precision') {
return {
srcLeft: srcLeft,
srcTop: srcTop,
srcWidth: srcWidth,
srcHeight: srcHeight,
destWidth: destWidth,
destHeight: destHeight
};
}
var factor;
if (srcWidth > srcHeight) {
factor = srcWidth / srcHeight;
destWidth = MAX_SIZE;
destHeight = Math.round(destWidth / factor);
}
else {
factor = srcHeight / srcWidth;
destHeight = MAX_SIZE;
destWidth = Math.round(destHeight / factor);
}
if (destWidth > srcWidth || destHeight > srcHeight ||
destWidth < MIN_SIZE || destHeight < MIN_SIZE) {
destWidth = srcWidth;
destHeight = srcHeight;
}
return {
srcLeft: srcLeft,
srcTop: srcTop,
srcWidth: srcWidth,
srcHeight: srcHeight,
destWidth: destWidth,
destHeight: destHeight
};
}
var isWebWorkers = typeof window === 'undefined';
function makeCanvas() {
if (isWebWorkers) {
return hasOffscreenCanvas ? new OffscreenCanvas(1, 1) : null;
}
return document.createElement('canvas');
}
var ERROR_PREFIX = 'FastAverageColor: ';
function getError(message) {
return Error(ERROR_PREFIX + message);
}
function outputError(error, silent) {
if (!silent) {
console.error(error);
}
}
var FastAverageColor = /** @class */ (function () {
function FastAverageColor() {
this.canvas = null;
this.ctx = null;
}
FastAverageColor.prototype.getColorAsync = function (resource, options) {
if (!resource) {
return Promise.reject(getError('call .getColorAsync() without resource'));
}
if (typeof resource === 'string') {
// Web workers
if (typeof Image === 'undefined') {
return Promise.reject(getError('resource as string is not supported in this environment'));
}
var img = new Image();
img.crossOrigin = options && options.crossOrigin || '';
img.src = resource;
return this.bindImageEvents(img, options);
}
else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) {
return this.bindImageEvents(resource, options);
}
else {
var result = this.getColor(resource, options);
return result.error ? Promise.reject(result.error) : Promise.resolve(result);
}
};
/**
* Get the average color from images, videos and canvas.
*/
FastAverageColor.prototype.getColor = function (resource, options) {
options = options || {};
var defaultColor = getDefaultColor(options);
if (!resource) {
var error = getError('call .getColor() without resource');
outputError(error, options.silent);
return this.prepareResult(defaultColor, error);
}
var originalSize = getOriginalSize(resource);
var size = prepareSizeAndPosition(originalSize, options);
if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) {
var error = getError("incorrect sizes for resource \"".concat(getSrc(resource), "\""));
outputError(error, options.silent);
return this.prepareResult(defaultColor, error);
}
if (!this.canvas) {
this.canvas = makeCanvas();
if (!this.canvas) {
var error = getError('OffscreenCanvas is not supported in this browser');
outputError(error, options.silent);
return this.prepareResult(defaultColor, error);
}
}
if (!this.ctx) {
this.ctx = this.canvas.getContext('2d', { willReadFrequently: true });
if (!this.ctx) {
var error = getError('Canvas Context 2D is not supported in this browser');
outputError(error, options.silent);
return this.prepareResult(defaultColor);
}
this.ctx.imageSmoothingEnabled = false;
}
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;
return this.prepareResult(this.getColorFromArray4(bitmapData, options));
}
catch (originalError) {
var error = getError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image"));
outputError(error, options.silent);
!options.silent && console.error(originalError);
return this.prepareResult(defaultColor, error);
}
};
/**
* Get the average color from a array when 1 pixel is 4 bytes.
*/
FastAverageColor.prototype.getColorFromArray4 = function (arr, options) {
options = options || {};
var bytesPerPixel = 4;
var arrLength = arr.length;
var defaultColor = getDefaultColor(options);
if (arrLength < bytesPerPixel) {
return defaultColor;
}
var len = arrLength - arrLength % bytesPerPixel;
var step = (options.step || 1) * bytesPerPixel;
var algorithm;
switch (options.algorithm || 'sqrt') {
case 'simple':
algorithm = simpleAlgorithm;
break;
case 'sqrt':
algorithm = sqrtAlgorithm;
break;
case 'dominant':
algorithm = dominantAlgorithm;
break;
default:
throw getError("".concat(options.algorithm, " is unknown algorithm"));
}
return algorithm(arr, len, {
defaultColor: defaultColor,
ignoredColor: prepareIgnoredColor(options.ignoredColor),
step: step,
dominantDivider: options.dominantDivider,
});
};
/**
* Get color data from value ([r, g, b, a]).
*/
FastAverageColor.prototype.prepareResult = function (value, error) {
var rgb = value.slice(0, 3);
var rgba = [value[0], value[1], value[2], value[3] / 255];
var isDarkColor = isDark(value);
return {
value: [value[0], value[1], value[2], value[3]],
rgb: 'rgb(' + rgb.join(',') + ')',
rgba: 'rgba(' + rgba.join(',') + ')',
hex: arrayToHex(rgb),
hexa: arrayToHex(value),
isDark: isDarkColor,
isLight: !isDarkColor,
error: error,
};
};
/**
* Destroy the instance.
*/
FastAverageColor.prototype.destroy = function () {
if (this.canvas) {
this.canvas.width = 1;
this.canvas.height = 1;
this.canvas = null;
}
this.ctx = null;
};
FastAverageColor.prototype.bindImageEvents = function (resource, options) {
var _this = this;
return new Promise(function (resolve, reject) {
var onload = function () {
unbindEvents();
var result = _this.getColor(resource, options);
if (result.error) {
reject(result.error);
}
else {
resolve(result);
}
};
var onerror = function () {
unbindEvents();
reject(getError("Error loading image \"".concat(resource.src, "\"")));
};
var onabort = function () {
unbindEvents();
reject(getError("Image \"".concat(resource.src, "\" loading aborted")));
};
var unbindEvents = function () {
resource.removeEventListener('load', onload);
resource.removeEventListener('error', onerror);
resource.removeEventListener('abort', onabort);
};
resource.addEventListener('load', onload);
resource.addEventListener('error', onerror);
resource.addEventListener('abort', onabort);
});
};
return FastAverageColor;
}());
;// CONCATENATED MODULE: external ["wp","hooks"]
var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/use-cover-is-dark.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function retrieveFastAverageColor() {
if (!retrieveFastAverageColor.fastAverageColor) {
retrieveFastAverageColor.fastAverageColor = new FastAverageColor();
}
return retrieveFastAverageColor.fastAverageColor;
}
/**
* useCoverIsDark is a hook that returns a boolean variable specifying if the cover
* background is dark or not.
*
* @param {?string} url Url of the media background.
* @param {?number} dimRatio Transparency of the overlay color. If an image and
* color are set, dimRatio is used to decide what is used
* for background darkness checking purposes.
* @param {?string} overlayColor String containing the overlay color value if one exists.
*
* @return {boolean} True if the cover background is considered "dark" and false otherwise.
*/
function useCoverIsDark(url) {
let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// If opacity is lower than 50 the dominant color is the image or video color,
// so use that color for the dark mode computation.
if (url && dimRatio <= 50) {
const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url);
retrieveFastAverageColor().getColorAsync(url, {
// Previously the default color was white, but that changed
// in v6.0.0 so it has to be manually set now.
defaultColor: [255, 255, 255, 255],
// Errors that come up don't reject the promise, so error
// logging has to be silenced with this option.
silent: "production" === 'production',
crossOrigin: imgCrossOrigin
}).then(color => setIsDark(color.isDark));
}
}, [url, url && dimRatio <= 50, setIsDark]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// If opacity is greater than 50 the dominant color is the overlay color,
// so use that color for the dark mode computation.
if (dimRatio > 50 || !url) {
if (!overlayColor) {
// If no overlay color exists the overlay color is black (isDark )
setIsDark(true);
return;
}
setIsDark(w(overlayColor).isDark());
}
}, [overlayColor, dimRatio > 50 || !url, setIsDark]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!url && !overlayColor) {
// Reset isDark.
setIsDark(false);
}
}, [!url && !overlayColor, setIsDark]);
return isDark;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function CoverHeightInput(_ref) {
let {
onChange,
onUnitChange,
unit = 'px',
value = ''
} = _ref;
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
const inputId = `block-cover-height-input-${instanceId}`;
const isPx = unit === 'px';
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
defaultValues: {
px: 430,
'%': 20,
em: 20,
rem: 20,
vw: 20,
vh: 50
}
});
const handleOnChange = unprocessedValue => {
const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined;
if (isNaN(inputValue) && inputValue !== undefined) {
return;
}
onChange(inputValue);
};
const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
return [parsedQuantity, unit].join('');
}, [unit, value]);
const min = isPx ? COVER_MIN_HEIGHT : 0;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
id: inputId,
isResetValueOnUnitChange: true,
min: min,
onChange: handleOnChange,
onUnitChange: onUnitChange,
__unstableInputWidth: '80px',
units: units,
value: computedValue
});
}
function CoverInspectorControls(_ref2) {
let {
attributes,
setAttributes,
clientId,
setOverlayColor,
coverRef,
currentSettings
} = _ref2;
const {
useFeaturedImage,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
minHeight,
minHeightUnit,
alt,
tagName
} = attributes;
const {
isVideoBackground,
isImageBackground,
mediaElement,
url,
isImgElement,
overlayColor
} = currentSettings;
const {
gradientValue,
setGradient
} = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
const toggleParallax = () => {
setAttributes({
hasParallax: !hasParallax,
...(!hasParallax ? {
focalPoint: undefined
} : {})
});
};
const toggleIsRepeated = () => {
setAttributes({
isRepeated: !isRepeated
});
};
const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
const imperativeFocalPointPreview = value => {
const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition'];
styleOfRef[property] = mediaPosition(value);
};
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
const htmlElementMessages = {
header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
};
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, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Media settings')
}, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'),
checked: hasParallax,
onChange: toggleParallax
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'),
checked: isRepeated,
onChange: toggleIsRepeated
})), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
url: url,
value: focalPoint,
onDragStart: imperativeFocalPointPreview,
onDrag: imperativeFocalPointPreview,
onChange: newFocalPoint => setAttributes({
focalPoint: newFocalPoint
})
}), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
value: alt,
onChange: newAlt => setAttributes({
alt: newAlt
}),
help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
}, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
isSmall: true,
className: "block-library-cover__reset-button",
onClick: () => setAttributes({
url: undefined,
id: undefined,
backgroundType: undefined,
focalPoint: undefined,
hasParallax: undefined,
isRepeated: undefined,
useFeaturedImage: false
})
}, (0,external_wp_i18n_namespaceObject.__)('Clear Media'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "color"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, _extends({
__experimentalIsRenderedInSidebar: true,
settings: [{
colorValue: overlayColor.color,
gradientValue,
label: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
onColorChange: setOverlayColor,
onGradientChange: setGradient,
isShownByDefault: true,
resetAllFilter: () => ({
overlayColor: undefined,
customOverlayColor: undefined,
gradient: undefined,
customGradient: undefined
})
}],
panelId: clientId
}, colorGradientSettings)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => {
// If there's a media background the dimRatio will be
// defaulted to 50 whereas it will be 100 for colors.
return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100);
},
label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
onDeselect: () => setAttributes({
dimRatio: url ? 50 : 100
}),
resetAllFilter: () => ({
dimRatio: url ? 50 : 100
}),
isShownByDefault: true,
panelId: clientId
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
value: dimRatio,
onChange: newDimRation => setAttributes({
dimRatio: newDimRation
}),
min: 0,
max: 100,
step: 10,
required: true
}))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "dimensions"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!minHeight,
label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
onDeselect: () => setAttributes({
minHeight: undefined,
minHeightUnit: undefined
}),
resetAllFilter: () => ({
minHeight: undefined,
minHeightUnit: undefined
}),
isShownByDefault: true,
panelId: clientId
}, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, {
value: minHeight,
unit: minHeightUnit,
onChange: newMinHeight => setAttributes({
minHeight: newMinHeight
}),
onUnitChange: nextUnit => setAttributes({
minHeightUnit: nextUnit
})
}))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
options: [{
label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
value: 'div'
}, {
label: '<header>',
value: 'header'
}, {
label: '<main>',
value: 'main'
}, {
label: '<section>',
value: 'section'
}, {
label: '<article>',
value: 'article'
}, {
label: '<aside>',
value: 'aside'
}, {
label: '<footer>',
value: 'footer'
}],
value: tagName,
onChange: value => setAttributes({
tagName: value
}),
help: htmlElementMessages[tagName]
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function CoverBlockControls(_ref) {
let {
attributes,
setAttributes,
onSelectMedia,
currentSettings,
toggleUseFeaturedImage
} = _ref;
const {
contentPosition,
id,
useFeaturedImage,
minHeight,
minHeightUnit
} = attributes;
const {
hasInnerBlocks,
url
} = currentSettings;
const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
const toggleMinFullHeight = () => {
if (isMinFullHeight) {
// If there aren't previous values, take the default ones.
if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) {
return setAttributes({
minHeight: undefined,
minHeightUnit: undefined
});
} // Set the previous values of height.
return setAttributes({
minHeight: prevMinHeightValue,
minHeightUnit: prevMinHeightUnit
});
}
setPrevMinHeightValue(minHeight);
setPrevMinHeightUnit(minHeightUnit); // Set full height.
return setAttributes({
minHeight: 100,
minHeightUnit: 'vh'
});
};
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: "block"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Change content position'),
value: contentPosition,
onChange: nextPosition => setAttributes({
contentPosition: nextPosition
}),
isDisabled: !hasInnerBlocks
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
isActive: isMinFullHeight,
onToggle: toggleMinFullHeight,
isDisabled: !hasInnerBlocks
})), (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: url,
allowedTypes: shared_ALLOWED_MEDIA_TYPES,
accept: "image/*,video/*",
onSelect: onSelectMedia,
onToggleFeaturedImage: toggleUseFeaturedImage,
useFeaturedImage: useFeaturedImage,
name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace')
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function CoverPlaceholder(_ref) {
let {
disableMediaButtons = false,
children,
onSelectMedia,
onError,
style,
toggleUseFeaturedImage
} = _ref;
return (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_cover
}),
labels: {
title: (0,external_wp_i18n_namespaceObject.__)('Cover'),
instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.')
},
onSelect: onSelectMedia,
accept: "image/*,video/*",
allowedTypes: shared_ALLOWED_MEDIA_TYPES,
disableMediaButtons: disableMediaButtons,
onToggleFeaturedImage: toggleUseFeaturedImage,
onError: onError,
style: style
}, children);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const RESIZABLE_BOX_ENABLE_OPTION = {
top: false,
right: false,
bottom: true,
left: false,
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: false
};
function ResizableCover(_ref) {
let {
className,
onResizeStart,
onResize,
onResizeStop,
...props
} = _ref;
const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
className: classnames_default()(className, {
'is-resizing': isResizing
}),
enable: RESIZABLE_BOX_ENABLE_OPTION,
onResizeStart: (_event, _direction, elt) => {
onResizeStart(elt.clientHeight);
onResize(elt.clientHeight);
},
onResize: (_event, _direction, elt) => {
onResize(elt.clientHeight);
if (!isResizing) {
setIsResizing(true);
}
},
onResizeStop: (_event, _direction, elt) => {
onResizeStop(elt.clientHeight);
setIsResizing(false);
},
__experimentalShowTooltip: true,
__experimentalTooltipProps: {
axis: 'y',
position: 'bottom',
isVisible: isResizing
}
}, props));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
k([names]);
function getInnerBlocksTemplate(attributes) {
return [['core/paragraph', {
align: 'center',
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
...attributes
}]];
}
/**
* Is the URL a temporary blob URL? A blob URL is one that is used temporarily while
* the media (image or video) is being uploaded and will not have an id allocated yet.
*
* @param {number} id The id of the media.
* @param {string} url The url of the media.
*
* @return {boolean} Is the URL a Blob URL.
*/
const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
function CoverEdit(_ref) {
var _attributes$url, _useSetting;
let {
attributes,
clientId,
isSelected,
overlayColor,
setAttributes,
setOverlayColor,
toggleSelection,
context: {
postId,
postType
}
} = _ref;
const {
contentPosition,
id,
useFeaturedImage,
dimRatio,
focalPoint,
hasParallax,
isDark,
isRepeated,
minHeight,
minHeightUnit,
alt,
allowedBlocks,
templateLock,
tagName: TagName = 'div'
} = attributes;
const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
context: 'view'
}), [featuredImage]);
const mediaUrl = media === null || media === void 0 ? void 0 : media.source_url; // instead of destructuring the attributes
// we define the url and background type
// depending on the value of the useFeaturedImage flag
// to preview in edit the dynamic featured image
const url = useFeaturedImage ? mediaUrl : // Ensure the url is not malformed due to sanitization through `wp_kses`.
(_attributes$url = attributes.url) === null || _attributes$url === void 0 ? void 0 : _attributes$url.replaceAll('&', '&');
const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const {
gradientClass,
gradientValue
} = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
const isUploadingMedia = isTemporaryMedia(id, url);
const onUploadError = message => {
createErrorNotice(message, {
type: 'snackbar'
});
};
const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
isDark: isCoverDark
});
}, [isCoverDark]);
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeightWithUnit || undefined
};
const backgroundImage = url ? `url(${url})` : undefined;
const backgroundPosition = mediaPosition(focalPoint);
const bgStyle = {
backgroundColor: overlayColor.color
};
const mediaStyle = {
objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined
};
const hasBackground = !!(url || overlayColor.color || gradientValue);
const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
const ref = (0,external_wp_element_namespaceObject.useRef)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref
}); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length);
const innerBlocksTemplate = getInnerBlocksTemplate({
fontSize: hasFontSizes ? 'large' : undefined
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
className: 'wp-block-cover__inner-container'
}, {
// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.
// See: https://github.com/WordPress/gutenberg/pull/45632
template: !hasInnerBlocks ? innerBlocksTemplate : undefined,
templateInsertUpdatesSelection: true,
allowedBlocks,
templateLock
});
const mediaElement = (0,external_wp_element_namespaceObject.useRef)();
const currentSettings = {
isVideoBackground,
isImageBackground,
mediaElement,
hasInnerBlocks,
url,
isImgElement,
overlayColor
};
const toggleUseFeaturedImage = () => {
setAttributes({
id: undefined,
url: undefined,
useFeaturedImage: !useFeaturedImage,
dimRatio: dimRatio === 100 ? 50 : dimRatio,
backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
});
};
const blockControls = (0,external_wp_element_namespaceObject.createElement)(CoverBlockControls, {
attributes: attributes,
setAttributes: setAttributes,
onSelectMedia: onSelectMedia,
currentSettings: currentSettings,
toggleUseFeaturedImage: toggleUseFeaturedImage
});
const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(CoverInspectorControls, {
attributes: attributes,
setAttributes: setAttributes,
clientId: clientId,
setOverlayColor: setOverlayColor,
coverRef: ref,
currentSettings: currentSettings,
toggleUseFeaturedImage: toggleUseFeaturedImage
});
if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
className: classnames_default()('is-placeholder', blockProps.className)
}), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
onSelectMedia: onSelectMedia,
onError: onUploadError,
style: {
minHeight: minHeightWithUnit || undefined
},
toggleUseFeaturedImage: toggleUseFeaturedImage
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-cover__placeholder-background-options"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
disableCustomColors: true,
value: overlayColor.color,
onChange: setOverlayColor,
clearable: false
}))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
className: "block-library-cover__resize-container",
onResizeStart: () => {
setAttributes({
minHeightUnit: 'px'
});
toggleSelection(false);
},
onResize: value => {
setAttributes({
minHeight: value
});
},
onResizeStop: newMinHeight => {
toggleSelection(true);
setAttributes({
minHeight: newMinHeight
});
},
showHandle: isSelected
})));
}
const classes = classnames_default()({
'is-dark-theme': isDark,
'is-light': !isDark,
'is-transient': isUploadingMedia,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
className: classnames_default()(classes, blockProps.className),
style: { ...style,
...blockProps.style
},
"data-url": url
}), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
className: "block-library-cover__resize-container",
onResizeStart: () => {
setAttributes({
minHeightUnit: 'px'
});
toggleSelection(false);
},
onResize: value => {
setAttributes({
minHeight: value
});
},
onResizeStop: newMinHeight => {
toggleSelection(true);
setAttributes({
minHeight: newMinHeight
});
},
showHandle: isSelected
}), (!useFeaturedImage || url) && (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), {
[overlayColor.class]: overlayColor.class,
'has-background-dim': dimRatio !== undefined,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}),
style: {
backgroundImage: gradientValue,
...bgStyle
}
}), !url && useFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
className: "wp-block-cover__image--placeholder-image",
withIllustration: true
}), url && isImageBackground && (isImgElement ? (0,external_wp_element_namespaceObject.createElement)("img", {
ref: mediaElement,
className: "wp-block-cover__image-background",
alt: alt,
src: url,
style: mediaStyle
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
ref: mediaElement,
role: "img",
className: classnames_default()(classes, 'wp-block-cover__image-background'),
style: {
backgroundImage,
backgroundPosition
}
})), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", {
ref: mediaElement,
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url,
style: mediaStyle
}), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
disableMediaButtons: true,
onSelectMedia: onSelectMedia,
onError: onUploadError,
toggleUseFeaturedImage: toggleUseFeaturedImage
}), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
}
/* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
overlayColor: 'background-color'
})])(CoverEdit));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function cover_save_save(_ref) {
let {
attributes
} = _ref;
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit,
tagName: Tag
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || undefined
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
background: customGradient ? customGradient : undefined
};
const objectPosition = // prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined;
const backgroundImage = url ? `url(${url})` : undefined;
const backgroundPosition = mediaPosition(focalPoint);
const classes = classnames_default()({
'is-light': !isDark,
'has-parallax': hasParallax,
'is-repeated': isRepeated,
'has-custom-content-position': !isContentPositionCenter(contentPosition)
}, getPositionClassName(contentPosition));
const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
'has-parallax': hasParallax,
'is-repeated': isRepeated
});
const gradientValue = gradient || customGradient;
return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classes,
style
}), (0,external_wp_element_namespaceObject.createElement)("span", {
"aria-hidden": "true",
className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
'has-background-dim': dimRatio !== undefined,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}),
style: bgStyle
}), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_wp_element_namespaceObject.createElement)("img", {
className: imgClasses,
alt: alt,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
role: "img",
className: imgClasses,
style: {
backgroundPosition,
backgroundImage
}
})), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: {
objectPosition
},
"data-object-fit": "cover",
"data-object-position": objectPosition
}), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-cover__inner-container'
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const cover_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/image'],
transform: _ref => {
var _style$color;
let {
caption,
url,
alt,
align,
id,
anchor,
style
} = _ref;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
dimRatio: 50,
url,
alt,
align,
id,
anchor,
style: {
color: {
duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone
}
}
}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: caption,
fontSize: 'large',
align: 'center'
})]);
}
}, {
type: 'block',
blocks: ['core/video'],
transform: _ref2 => {
let {
caption,
src,
align,
id,
anchor
} = _ref2;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
dimRatio: 50,
url: src,
align,
id,
backgroundType: VIDEO_BACKGROUND_TYPE,
anchor
}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: caption,
fontSize: 'large',
align: 'center'
})]);
}
}, {
type: 'block',
blocks: ['core/group'],
transform: (attributes, innerBlocks) => {
var _innerBlocks$, _style$color2, _style$color3, _style$color4, _style$color5;
const {
align,
anchor,
backgroundColor,
gradient,
style
} = attributes; // If the Group block being transformed has a Cover block as its
// only child return that Cover block.
if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$ = innerBlocks[0]) === null || _innerBlocks$ === void 0 ? void 0 : _innerBlocks$.name) === 'core/cover') {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks);
} // If no background or gradient color is provided, default to 50% opacity.
// This matches the styling of a Cover block with a background image,
// in the state where a background image has been removed.
const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
const parentAttributes = {
align,
anchor,
dimRatio,
overlayColor: backgroundColor,
customOverlayColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background,
gradient,
customGradient: style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient
};
const attributesWithoutBackgroundColors = { ...attributes,
backgroundColor: undefined,
gradient: undefined,
style: clean_empty_object({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
color: style !== null && style !== void 0 && style.color ? { ...(style === null || style === void 0 ? void 0 : style.color),
background: undefined,
gradient: undefined
} : undefined
})
}; // Preserve the block by nesting it within the Cover block,
// instead of converting the Group block directly to the Cover block.
return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]);
}
}],
to: [{
type: 'block',
blocks: ['core/image'],
isMatch: _ref3 => {
let {
backgroundType,
url,
overlayColor,
customOverlayColor,
gradient,
customGradient
} = _ref3;
if (url) {
// If a url exists the transform could happen if that URL represents an image background.
return backgroundType === IMAGE_BACKGROUND_TYPE;
} // If a url is not set the transform could happen if the cover has no background color or gradient;
return !overlayColor && !customOverlayColor && !gradient && !customGradient;
},
transform: _ref4 => {
var _style$color6;
let {
title,
url,
alt,
align,
id,
anchor,
style
} = _ref4;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
caption: title,
url,
alt,
align,
id,
anchor,
style: {
color: {
duotone: style === null || style === void 0 ? void 0 : (_style$color6 = style.color) === null || _style$color6 === void 0 ? void 0 : _style$color6.duotone
}
}
});
}
}, {
type: 'block',
blocks: ['core/video'],
isMatch: _ref5 => {
let {
backgroundType,
url,
overlayColor,
customOverlayColor,
gradient,
customGradient
} = _ref5;
if (url) {
// If a url exists the transform could happen if that URL represents a video background.
return backgroundType === VIDEO_BACKGROUND_TYPE;
} // If a url is not set the transform could happen if the cover has no background color or gradient;
return !overlayColor && !customOverlayColor && !gradient && !customGradient;
},
transform: _ref6 => {
let {
title,
url,
align,
id,
anchor
} = _ref6;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
caption: title,
src: url,
id,
align,
anchor
});
}
}, {
type: 'block',
blocks: ['core/group'],
isMatch: _ref7 => {
let {
url,
useFeaturedImage
} = _ref7;
// If the Cover block uses background media, skip this transform,
// and instead use the Group block's default transform.
if (url || useFeaturedImage) {
return false;
}
return true;
},
transform: (attributes, innerBlocks) => {
var _attributes$style, _attributes$style2, _innerBlocks$2;
// Convert Cover overlay colors to comparable Group background colors.
const transformedColorAttributes = {
backgroundColor: attributes === null || attributes === void 0 ? void 0 : attributes.overlayColor,
gradient: attributes === null || attributes === void 0 ? void 0 : attributes.gradient,
style: clean_empty_object({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
color: attributes !== null && attributes !== void 0 && attributes.customOverlayColor || attributes !== null && attributes !== void 0 && attributes.customGradient || attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && _attributes$style.color ? {
background: attributes === null || attributes === void 0 ? void 0 : attributes.customOverlayColor,
gradient: attributes === null || attributes === void 0 ? void 0 : attributes.customGradient,
...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : _attributes$style2.color)
} : undefined
})
}; // If the Cover block contains only a single Group block as a direct child,
// then attempt to merge the Cover's background colors with the child Group block,
// and remove the Cover block as the wrapper.
if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$2 = innerBlocks[0]) === null || _innerBlocks$2 === void 0 ? void 0 : _innerBlocks$2.name) === 'core/group') {
var _groupAttributes$styl, _groupAttributes$styl2, _groupAttributes$styl3, _groupAttributes$styl4, _transformedColorAttr, _groupAttributes$styl5, _transformedColorAttr2, _groupAttributes$styl6, _innerBlocks$4;
const groupAttributes = clean_empty_object(innerBlocks[0].attributes || {}); // If the Group block contains any kind of background color or gradient,
// skip merging Cover background colors, and preserve the Group block's colors.
if (groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.backgroundColor || groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.gradient || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl = groupAttributes.style) !== null && _groupAttributes$styl !== void 0 && (_groupAttributes$styl2 = _groupAttributes$styl.color) !== null && _groupAttributes$styl2 !== void 0 && _groupAttributes$styl2.background || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl3 = groupAttributes.style) !== null && _groupAttributes$styl3 !== void 0 && (_groupAttributes$styl4 = _groupAttributes$styl3.color) !== null && _groupAttributes$styl4 !== void 0 && _groupAttributes$styl4.gradient) {
var _innerBlocks$3;
return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, (_innerBlocks$3 = innerBlocks[0]) === null || _innerBlocks$3 === void 0 ? void 0 : _innerBlocks$3.innerBlocks);
}
return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...transformedColorAttributes,
...groupAttributes,
style: clean_empty_object({ ...(groupAttributes === null || groupAttributes === void 0 ? void 0 : groupAttributes.style),
color: transformedColorAttributes !== null && transformedColorAttributes !== void 0 && (_transformedColorAttr = transformedColorAttributes.style) !== null && _transformedColorAttr !== void 0 && _transformedColorAttr.color || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl5 = groupAttributes.style) !== null && _groupAttributes$styl5 !== void 0 && _groupAttributes$styl5.color ? { ...(transformedColorAttributes === null || transformedColorAttributes === void 0 ? void 0 : (_transformedColorAttr2 = transformedColorAttributes.style) === null || _transformedColorAttr2 === void 0 ? void 0 : _transformedColorAttr2.color),
...(groupAttributes === null || groupAttributes === void 0 ? void 0 : (_groupAttributes$styl6 = groupAttributes.style) === null || _groupAttributes$styl6 === void 0 ? void 0 : _groupAttributes$styl6.color)
} : undefined
})
}, (_innerBlocks$4 = innerBlocks[0]) === null || _innerBlocks$4 === void 0 ? void 0 : _innerBlocks$4.innerBlocks);
} // In all other cases, transform the Cover block directly to a Group block.
return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...attributes,
...transformedColorAttributes
}, innerBlocks);
}
}]
};
/* harmony default export */ var cover_transforms = (cover_transforms_transforms);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const cover_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/cover",
title: "Cover",
category: "media",
description: "Add an image or video with a text overlay \u2014 great for headers.",
textdomain: "default",
attributes: {
url: {
type: "string"
},
useFeaturedImage: {
type: "boolean",
"default": false
},
id: {
type: "number"
},
alt: {
type: "string",
source: "attribute",
selector: "img",
attribute: "alt",
"default": ""
},
hasParallax: {
type: "boolean",
"default": false
},
isRepeated: {
type: "boolean",
"default": false
},
dimRatio: {
type: "number",
"default": 100
},
overlayColor: {
type: "string"
},
customOverlayColor: {
type: "string"
},
backgroundType: {
type: "string",
"default": "image"
},
focalPoint: {
type: "object"
},
minHeight: {
type: "number"
},
minHeightUnit: {
type: "string"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
},
contentPosition: {
type: "string"
},
isDark: {
type: "boolean",
"default": true
},
allowedBlocks: {
type: "array"
},
templateLock: {
type: ["string", "boolean"],
"enum": ["all", "insert", "contentOnly", false]
},
tagName: {
type: "string",
"default": "div"
}
},
usesContext: ["postId", "postType"],
supports: {
anchor: true,
align: true,
html: false,
spacing: {
padding: true,
margin: ["top", "bottom"],
__experimentalDefaultControls: {
padding: true
}
},
color: {
__experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
text: false,
background: false
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
}
},
editorStyle: "wp-block-cover-editor",
style: "wp-block-cover"
};
const {
name: cover_name
} = cover_metadata;
const cover_settings = {
icon: library_cover,
example: {
attributes: {
customOverlayColor: '#065174',
dimRatio: 40,
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
},
innerBlocks: [{
name: 'core/paragraph',
attributes: {
content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
align: 'center',
style: {
typography: {
fontSize: 48
},
color: {
text: 'white'
}
}
}
}]
},
transforms: cover_transforms,
save: cover_save_save,
edit: cover_edit,
deprecated: cover_deprecated
};
const cover_init = () => initBlock({
name: cover_name,
metadata: cover_metadata,
settings: cover_settings
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
/**
* WordPress dependencies
*/
const pencil = (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: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
}));
/* harmony default export */ var library_pencil = (pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
/**
* Internal dependencies
*/
/* harmony default export */ var library_edit = (library_pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js
/**
* WordPress dependencies
*/
function getResponsiveHelp(checked) {
return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.');
}
const EmbedControls = _ref => {
let {
blockSupportsResponsive,
showEditButton,
themeSupportsResponsive,
allowResponsive,
toggleResponsive,
switchBackToURLInput
} = _ref;
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, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
className: "components-toolbar__control",
label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'),
icon: library_edit,
onClick: switchBackToURLInput
}))), themeSupportsResponsive && blockSupportsResponsive && (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.__)('Media settings'),
className: "blocks-responsive"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'),
checked: allowResponsive,
help: getResponsiveHelp,
onChange: toggleResponsive
}))));
};
/* harmony default export */ var embed_controls = (EmbedControls);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js
/**
* WordPress dependencies
*/
const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"
}));
const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"
}));
const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_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-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
}));
const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_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-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"
}));
const embedTwitterIcon = {
foreground: '#1da1f2',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"
})))
};
const embedYouTubeIcon = {
foreground: '#ff0000',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"
}))
};
const embedFacebookIcon = {
foreground: '#3b5998',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"
}))
};
const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"
})));
const embedWordPressIcon = {
foreground: '#0073AA',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"
})))
};
const embedSpotifyIcon = {
foreground: '#1db954',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"
}))
};
const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"
}));
const embedVimeoIcon = {
foreground: '#1ab7ea',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"
})))
};
const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"
}));
const embedTumblrIcon = {
foreground: '#35465c',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"
}))
};
const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"
}));
const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",
fill: "#4bc7ee"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",
fill: "#d4cdcb"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",
fill: "#c3d82e"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",
fill: "#e4ecb0"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z",
fill: "#209dbd"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",
fill: "#7cb3c9"
}));
const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",
fill: "#333436"
}));
const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
}));
const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
viewBox: "0 0 44 44"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"
}));
const embedPocketCastsIcon = {
foreground: '#f43e37',
src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z",
fill: "#fff"
}))
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js
/**
* WordPress dependencies
*/
const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-embed is-loading"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
/* harmony default export */ var embed_loading = (EmbedLoading);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js
/**
* WordPress dependencies
*/
const EmbedPlaceholder = _ref => {
let {
icon,
label,
value,
onSubmit,
onChange,
cannotEmbed,
fallback,
tryAgain
} = _ref;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: icon,
showColors: true
}),
label: label,
className: "wp-block-embed",
instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.')
}, (0,external_wp_element_namespaceObject.createElement)("form", {
onSubmit: onSubmit
}, (0,external_wp_element_namespaceObject.createElement)("input", {
type: "url",
value: value || '',
className: "components-placeholder__input",
"aria-label": label,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'),
onChange: onChange
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
type: "submit"
}, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "components-placeholder__learn-more"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/')
}, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "components-placeholder__error"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "components-placeholder__instructions"
}, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
onClick: tryAgain
}, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
onClick: fallback
}, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label'))));
};
/* harmony default export */ var embed_placeholder = (EmbedPlaceholder);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js
/**
* WordPress dependencies
*/
/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
const attributeMap = {
class: 'className',
frameborder: 'frameBorder',
marginheight: 'marginHeight',
marginwidth: 'marginWidth'
};
function WpEmbedPreview(_ref) {
let {
html
} = _ref;
const ref = (0,external_wp_element_namespaceObject.useRef)();
const props = (0,external_wp_element_namespaceObject.useMemo)(() => {
const doc = new window.DOMParser().parseFromString(html, 'text/html');
const iframe = doc.querySelector('iframe');
const iframeProps = {};
if (!iframe) return iframeProps;
Array.from(iframe.attributes).forEach(_ref2 => {
let {
name,
value
} = _ref2;
if (name === 'style') return;
iframeProps[attributeMap[name] || name] = value;
});
return iframeProps;
}, [html]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const {
ownerDocument
} = ref.current;
const {
defaultView
} = ownerDocument;
/**
* Checks for WordPress embed events signaling the height change when
* iframe content loads or iframe's window is resized. The event is
* sent from WordPress core via the window.postMessage API.
*
* References:
* window.postMessage:
* https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
* WordPress core embed-template on load:
* https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143
* WordPress core embed-template on resize:
* https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187
*
* @param {MessageEvent} event Message event.
*/
function resizeWPembeds(_ref3) {
let {
data: {
secret,
message,
value
} = {}
} = _ref3;
if (message !== 'height' || secret !== props['data-secret']) {
return;
}
ref.current.height = value;
}
defaultView.addEventListener('message', resizeWPembeds);
return () => {
defaultView.removeEventListener('message', resizeWPembeds);
};
}, []);
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-embed__wrapper"
}, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
title: props.title
}, props)));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
class EmbedPreview extends external_wp_element_namespaceObject.Component {
constructor() {
super(...arguments);
this.hideOverlay = this.hideOverlay.bind(this);
this.state = {
interactive: false
};
}
static getDerivedStateFromProps(nextProps, state) {
if (!nextProps.isSelected && state.interactive) {
// We only want to change this when the block is not selected, because changing it when
// the block becomes selected makes the overlap disappear too early. Hiding the overlay
// happens on mouseup when the overlay is clicked.
return {
interactive: false
};
}
return null;
}
hideOverlay() {
// This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
// changing, because that happens on mouse down, and the overlay immediately disappears,
// and the mouse event can end up in the preview content. We can't use onClick on
// the overlay to hide it either, because then the editor misses the mouseup event, and
// thinks we're multi-selecting blocks.
this.setState({
interactive: true
});
}
render() {
const {
preview,
previewable,
url,
type,
caption,
onCaptionChange,
isSelected,
className,
icon,
label,
insertBlocksAfter
} = this.props;
const {
scripts
} = preview;
const {
interactive
} = this.state;
const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
const parsedHost = new URL(url).host.split('.');
const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com
(0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl);
const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality
// as far as the user is concerned. We're just catching the first click so that
// the block can be selected without interacting with the embed preview that the overlay covers.
/* eslint-disable jsx-a11y/no-static-element-interactions */
const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, {
html: html
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-embed__wrapper"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
html: html,
scripts: scripts,
title: iframeTitle,
type: sandboxClassnames,
onFocus: this.hideOverlay
}), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-library-embed__interactive-overlay",
onMouseUp: this.hideOverlay
}));
/* eslint-enable jsx-a11y/no-static-element-interactions */
return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: dedupe_default()(className, 'wp-block-embed', {
'is-type-video': 'video' === type
})
}, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: icon,
showColors: true
}),
label: label
}, (0,external_wp_element_namespaceObject.createElement)("p", {
className: "components-placeholder__error"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: url
}, url)), (0,external_wp_element_namespaceObject.createElement)("p", {
className: "components-placeholder__error"
}, (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: host providing embed content e.g: www.youtube.com */
(0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "caption",
tagName: "figcaption",
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
value: caption,
onChange: onCaptionChange,
inlineToolbar: true,
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
}));
}
}
/* harmony default export */ var embed_preview = (EmbedPreview);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js
/**
* Internal dependencies
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const EmbedEdit = props => {
const {
attributes: {
providerNameSlug,
previewable,
responsive,
url: attributesUrl
},
attributes,
isSelected,
onReplace,
setAttributes,
insertBlocksAfter,
onFocus
} = props;
const defaultEmbedInfo = {
title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'),
icon: embedContentIcon
};
const {
icon,
title
} = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl);
const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
const {
invalidateResolution
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
preview,
fetching,
themeSupportsResponsive,
cannotEmbed
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _embedPreview$data;
const {
getEmbedPreview,
isPreviewEmbedFallback,
isRequestingEmbedPreview,
getThemeSupports
} = select(external_wp_coreData_namespaceObject.store);
if (!attributesUrl) {
return {
fetching: false,
cannotEmbed: false
};
}
const embedPreview = getEmbedPreview(attributesUrl);
const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html.
const badEmbedProvider = (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.html) === false && (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.type) === undefined; // Some WordPress URLs that can't be embedded will cause the API to return
// a valid JSON response with no HTML and `data.status` set to 404, rather
// than generating a fallback response as other embeds do.
const wordpressCantEmbed = (embedPreview === null || embedPreview === void 0 ? void 0 : (_embedPreview$data = embedPreview.data) === null || _embedPreview$data === void 0 ? void 0 : _embedPreview$data.status) === 404;
const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed;
return {
preview: validPreview ? embedPreview : undefined,
fetching: isRequestingEmbedPreview(attributesUrl),
themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
cannotEmbed: !validPreview || previewIsFallback
};
}, [attributesUrl]);
/**
* Returns the attributes derived from the preview, merged with the current attributes.
*
* @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.
* @return {Object} Merged attributes.
*/
const getMergedAttributes = function () {
let ignorePreviousClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return getMergedAttributesWithPreview(attributes, preview, title, responsive, ignorePreviousClassName);
};
const toggleResponsive = () => {
const {
allowResponsive,
className
} = attributes;
const {
html
} = preview;
const newAllowResponsive = !allowResponsive;
setAttributes({
allowResponsive: newAllowResponsive,
className: getClassNames(html, className, responsive && newAllowResponsive)
});
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) {
return;
} // At this stage, we're not fetching the preview and know it can't be embedded,
// so try removing any trailing slash, and resubmit.
const newURL = attributesUrl.replace(/\/$/, '');
setURL(newURL);
setIsEditingURL(false);
setAttributes({
url: newURL
});
}, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (preview && !isEditingURL) {
// When obtaining an incoming preview, we set the attributes derived from
// the preview data. In this case when getting the merged attributes,
// we ignore the previous classname because it might not match the expected
// classes by the new preview.
setAttributes(getMergedAttributes(true));
if (onReplace) {
const upgradedBlock = createUpgradedEmbedBlock(props, getMergedAttributes());
if (upgradedBlock) {
onReplace(upgradedBlock);
}
}
}
}, [preview, isEditingURL]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
if (fetching) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null));
} // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button.
const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL;
if (showEmbedPlaceholder) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, {
icon: icon,
label: label,
onFocus: onFocus,
onSubmit: event => {
if (event) {
event.preventDefault();
}
setIsEditingURL(false);
setAttributes({
url
});
},
value: url,
cannotEmbed: cannotEmbed,
onChange: event => setURL(event.target.value),
fallback: () => fallback(url, onReplace),
tryAgain: () => {
invalidateResolution('getEmbedPreview', [url]);
}
}));
} // Even though we set attributes that get derived from the preview,
// we don't access them directly because for the initial render,
// the `setAttributes` call will not have taken effect. If we're
// rendering responsive content, setting the responsive classes
// after the preview has been rendered can result in unwanted
// clipping or scrollbars. The `getAttributesFromPreview` function
// that `getMergedAttributes` uses is memoized so that we're not
// calculating them on every render.
const {
caption,
type,
allowResponsive,
className: classFromPreview
} = getMergedAttributes();
const className = classnames_default()(classFromPreview, props.className);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, {
showEditButton: preview && !cannotEmbed,
themeSupportsResponsive: themeSupportsResponsive,
blockSupportsResponsive: responsive,
allowResponsive: allowResponsive,
toggleResponsive: toggleResponsive,
switchBackToURLInput: () => setIsEditingURL(true)
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, {
preview: preview,
previewable: previewable,
className: className,
url: url,
type: type,
caption: caption,
onCaptionChange: value => setAttributes({
caption: value
}),
isSelected: isSelected,
icon: icon,
label: label,
insertBlocksAfter: insertBlocksAfter
})));
};
/* harmony default export */ var embed_edit = (EmbedEdit);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function embed_save_save(_ref) {
let {
attributes
} = _ref;
const {
url,
caption,
type,
providerNameSlug
} = attributes;
Showing 512.00 KB of 1.81 MB. Use Edit/Download for full content.
Directory Contents
Dirs: 2 × Files: 110