[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 2321: 5 /***/ ((module) => { 6 7 /** 8 * Checks if the block is experimental based on the metadata loaded 9 * from block.json. 10 * 11 * This function is in a separate file and uses the older JS syntax so 12 * that it can be imported in both: 13 * – block-library/src/index.js 14 * – block-library/src/babel-plugin.js 15 * 16 * @param {Object} metadata Parsed block.json metadata. 17 * @return {boolean} Is the block experimental? 18 */ 19 module.exports = function isBlockMetadataExperimental(metadata) { 20 return metadata && '__experimental' in metadata && metadata.__experimental !== false; 21 }; 22 23 24 /***/ }), 25 26 /***/ 1668: 27 /***/ ((module, exports) => { 28 29 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 30 Copyright (c) 2018 Jed Watson. 31 Licensed under the MIT License (MIT), see 32 http://jedwatson.github.io/classnames 33 */ 34 /* global define */ 35 36 (function () { 37 'use strict'; 38 39 var classNames = (function () { 40 // don't inherit from Object so we can skip hasOwnProperty check later 41 // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 42 function StorageObject() {} 43 StorageObject.prototype = Object.create(null); 44 45 function _parseArray (resultSet, array) { 46 var length = array.length; 47 48 for (var i = 0; i < length; ++i) { 49 _parse(resultSet, array[i]); 50 } 51 } 52 53 var hasOwn = {}.hasOwnProperty; 54 55 function _parseNumber (resultSet, num) { 56 resultSet[num] = true; 57 } 58 59 function _parseObject (resultSet, object) { 60 if (object.toString !== Object.prototype.toString && !object.toString.toString().includes('[native code]')) { 61 resultSet[object.toString()] = true; 62 return; 63 } 64 65 for (var k in object) { 66 if (hasOwn.call(object, k)) { 67 // set value to false instead of deleting it to avoid changing object structure 68 // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions 69 resultSet[k] = !!object[k]; 70 } 71 } 72 } 73 74 var SPACE = /\s+/; 75 function _parseString (resultSet, str) { 76 var array = str.split(SPACE); 77 var length = array.length; 78 79 for (var i = 0; i < length; ++i) { 80 resultSet[array[i]] = true; 81 } 82 } 83 84 function _parse (resultSet, arg) { 85 if (!arg) return; 86 var argType = typeof arg; 87 88 // 'foo bar' 89 if (argType === 'string') { 90 _parseString(resultSet, arg); 91 92 // ['foo', 'bar', ...] 93 } else if (Array.isArray(arg)) { 94 _parseArray(resultSet, arg); 95 96 // { 'foo': true, ... } 97 } else if (argType === 'object') { 98 _parseObject(resultSet, arg); 99 100 // '130' 101 } else if (argType === 'number') { 102 _parseNumber(resultSet, arg); 103 } 104 } 105 106 function _classNames () { 107 // don't leak arguments 108 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments 109 var len = arguments.length; 110 var args = Array(len); 111 for (var i = 0; i < len; i++) { 112 args[i] = arguments[i]; 113 } 114 115 var classSet = new StorageObject(); 116 _parseArray(classSet, args); 117 118 var list = []; 119 120 for (var k in classSet) { 121 if (classSet[k]) { 122 list.push(k) 123 } 124 } 125 126 return list.join(' '); 127 } 128 129 return _classNames; 130 })(); 131 132 if ( true && module.exports) { 133 classNames.default = classNames; 134 module.exports = classNames; 135 } else if (true) { 136 // register as 'classnames', consistent with npm package name 137 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 138 return classNames; 139 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 140 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 141 } else {} 142 }()); 143 144 145 /***/ }), 146 147 /***/ 5755: 148 /***/ ((module, exports) => { 149 150 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 151 Copyright (c) 2018 Jed Watson. 152 Licensed under the MIT License (MIT), see 153 http://jedwatson.github.io/classnames 154 */ 155 /* global define */ 156 157 (function () { 158 'use strict'; 159 160 var hasOwn = {}.hasOwnProperty; 161 var nativeCodeString = '[native code]'; 162 163 function classNames() { 164 var classes = []; 165 166 for (var i = 0; i < arguments.length; i++) { 167 var arg = arguments[i]; 168 if (!arg) continue; 169 170 var argType = typeof arg; 171 172 if (argType === 'string' || argType === 'number') { 173 classes.push(arg); 174 } else if (Array.isArray(arg)) { 175 if (arg.length) { 176 var inner = classNames.apply(null, arg); 177 if (inner) { 178 classes.push(inner); 179 } 180 } 181 } else if (argType === 'object') { 182 if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { 183 classes.push(arg.toString()); 184 continue; 185 } 186 187 for (var key in arg) { 188 if (hasOwn.call(arg, key) && arg[key]) { 189 classes.push(key); 190 } 191 } 192 } 193 } 194 195 return classes.join(' '); 196 } 197 198 if ( true && module.exports) { 199 classNames.default = classNames; 200 module.exports = classNames; 201 } else if (true) { 202 // register as 'classnames', consistent with npm package name 203 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 204 return classNames; 205 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 206 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 207 } else {} 208 }()); 209 210 211 /***/ }), 212 213 /***/ 7734: 214 /***/ ((module) => { 215 216 "use strict"; 217 218 219 // do not edit .js files directly - edit src/index.jst 220 221 222 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 223 224 225 module.exports = function equal(a, b) { 226 if (a === b) return true; 227 228 if (a && b && typeof a == 'object' && typeof b == 'object') { 229 if (a.constructor !== b.constructor) return false; 230 231 var length, i, keys; 232 if (Array.isArray(a)) { 233 length = a.length; 234 if (length != b.length) return false; 235 for (i = length; i-- !== 0;) 236 if (!equal(a[i], b[i])) return false; 237 return true; 238 } 239 240 241 if ((a instanceof Map) && (b instanceof Map)) { 242 if (a.size !== b.size) return false; 243 for (i of a.entries()) 244 if (!b.has(i[0])) return false; 245 for (i of a.entries()) 246 if (!equal(i[1], b.get(i[0]))) return false; 247 return true; 248 } 249 250 if ((a instanceof Set) && (b instanceof Set)) { 251 if (a.size !== b.size) return false; 252 for (i of a.entries()) 253 if (!b.has(i[0])) return false; 254 return true; 255 } 256 257 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 258 length = a.length; 259 if (length != b.length) return false; 260 for (i = length; i-- !== 0;) 261 if (a[i] !== b[i]) return false; 262 return true; 263 } 264 265 266 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 267 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 268 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 269 270 keys = Object.keys(a); 271 length = keys.length; 272 if (length !== Object.keys(b).length) return false; 273 274 for (i = length; i-- !== 0;) 275 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 276 277 for (i = length; i-- !== 0;) { 278 var key = keys[i]; 279 280 if (!equal(a[key], b[key])) return false; 281 } 282 283 return true; 284 } 285 286 // true if both NaN, false otherwise 287 return a!==a && b!==b; 288 }; 289 290 291 /***/ }), 292 293 /***/ 9681: 294 /***/ ((module) => { 295 296 var characterMap = { 297 "À": "A", 298 "Á": "A", 299 "Â": "A", 300 "Ã": "A", 301 "Ä": "A", 302 "Å": "A", 303 "Ấ": "A", 304 "Ắ": "A", 305 "Ẳ": "A", 306 "Ẵ": "A", 307 "Ặ": "A", 308 "Æ": "AE", 309 "Ầ": "A", 310 "Ằ": "A", 311 "Ȃ": "A", 312 "Ả": "A", 313 "Ạ": "A", 314 "Ẩ": "A", 315 "Ẫ": "A", 316 "Ậ": "A", 317 "Ç": "C", 318 "Ḉ": "C", 319 "È": "E", 320 "É": "E", 321 "Ê": "E", 322 "Ë": "E", 323 "Ế": "E", 324 "Ḗ": "E", 325 "Ề": "E", 326 "Ḕ": "E", 327 "Ḝ": "E", 328 "Ȇ": "E", 329 "Ẻ": "E", 330 "Ẽ": "E", 331 "Ẹ": "E", 332 "Ể": "E", 333 "Ễ": "E", 334 "Ệ": "E", 335 "Ì": "I", 336 "Í": "I", 337 "Î": "I", 338 "Ï": "I", 339 "Ḯ": "I", 340 "Ȋ": "I", 341 "Ỉ": "I", 342 "Ị": "I", 343 "Ð": "D", 344 "Ñ": "N", 345 "Ò": "O", 346 "Ó": "O", 347 "Ô": "O", 348 "Õ": "O", 349 "Ö": "O", 350 "Ø": "O", 351 "Ố": "O", 352 "Ṍ": "O", 353 "Ṓ": "O", 354 "Ȏ": "O", 355 "Ỏ": "O", 356 "Ọ": "O", 357 "Ổ": "O", 358 "Ỗ": "O", 359 "Ộ": "O", 360 "Ờ": "O", 361 "Ở": "O", 362 "Ỡ": "O", 363 "Ớ": "O", 364 "Ợ": "O", 365 "Ù": "U", 366 "Ú": "U", 367 "Û": "U", 368 "Ü": "U", 369 "Ủ": "U", 370 "Ụ": "U", 371 "Ử": "U", 372 "Ữ": "U", 373 "Ự": "U", 374 "Ý": "Y", 375 "à": "a", 376 "á": "a", 377 "â": "a", 378 "ã": "a", 379 "ä": "a", 380 "å": "a", 381 "ấ": "a", 382 "ắ": "a", 383 "ẳ": "a", 384 "ẵ": "a", 385 "ặ": "a", 386 "æ": "ae", 387 "ầ": "a", 388 "ằ": "a", 389 "ȃ": "a", 390 "ả": "a", 391 "ạ": "a", 392 "ẩ": "a", 393 "ẫ": "a", 394 "ậ": "a", 395 "ç": "c", 396 "ḉ": "c", 397 "è": "e", 398 "é": "e", 399 "ê": "e", 400 "ë": "e", 401 "ế": "e", 402 "ḗ": "e", 403 "ề": "e", 404 "ḕ": "e", 405 "ḝ": "e", 406 "ȇ": "e", 407 "ẻ": "e", 408 "ẽ": "e", 409 "ẹ": "e", 410 "ể": "e", 411 "ễ": "e", 412 "ệ": "e", 413 "ì": "i", 414 "í": "i", 415 "î": "i", 416 "ï": "i", 417 "ḯ": "i", 418 "ȋ": "i", 419 "ỉ": "i", 420 "ị": "i", 421 "ð": "d", 422 "ñ": "n", 423 "ò": "o", 424 "ó": "o", 425 "ô": "o", 426 "õ": "o", 427 "ö": "o", 428 "ø": "o", 429 "ố": "o", 430 "ṍ": "o", 431 "ṓ": "o", 432 "ȏ": "o", 433 "ỏ": "o", 434 "ọ": "o", 435 "ổ": "o", 436 "ỗ": "o", 437 "ộ": "o", 438 "ờ": "o", 439 "ở": "o", 440 "ỡ": "o", 441 "ớ": "o", 442 "ợ": "o", 443 "ù": "u", 444 "ú": "u", 445 "û": "u", 446 "ü": "u", 447 "ủ": "u", 448 "ụ": "u", 449 "ử": "u", 450 "ữ": "u", 451 "ự": "u", 452 "ý": "y", 453 "ÿ": "y", 454 "Ā": "A", 455 "ā": "a", 456 "Ă": "A", 457 "ă": "a", 458 "Ą": "A", 459 "ą": "a", 460 "Ć": "C", 461 "ć": "c", 462 "Ĉ": "C", 463 "ĉ": "c", 464 "Ċ": "C", 465 "ċ": "c", 466 "Č": "C", 467 "č": "c", 468 "C̆": "C", 469 "c̆": "c", 470 "Ď": "D", 471 "ď": "d", 472 "Đ": "D", 473 "đ": "d", 474 "Ē": "E", 475 "ē": "e", 476 "Ĕ": "E", 477 "ĕ": "e", 478 "Ė": "E", 479 "ė": "e", 480 "Ę": "E", 481 "ę": "e", 482 "Ě": "E", 483 "ě": "e", 484 "Ĝ": "G", 485 "Ǵ": "G", 486 "ĝ": "g", 487 "ǵ": "g", 488 "Ğ": "G", 489 "ğ": "g", 490 "Ġ": "G", 491 "ġ": "g", 492 "Ģ": "G", 493 "ģ": "g", 494 "Ĥ": "H", 495 "ĥ": "h", 496 "Ħ": "H", 497 "ħ": "h", 498 "Ḫ": "H", 499 "ḫ": "h", 500 "Ĩ": "I", 501 "ĩ": "i", 502 "Ī": "I", 503 "ī": "i", 504 "Ĭ": "I", 505 "ĭ": "i", 506 "Į": "I", 507 "į": "i", 508 "İ": "I", 509 "ı": "i", 510 "IJ": "IJ", 511 "ij": "ij", 512 "Ĵ": "J", 513 "ĵ": "j", 514 "Ķ": "K", 515 "ķ": "k", 516 "Ḱ": "K", 517 "ḱ": "k", 518 "K̆": "K", 519 "k̆": "k", 520 "Ĺ": "L", 521 "ĺ": "l", 522 "Ļ": "L", 523 "ļ": "l", 524 "Ľ": "L", 525 "ľ": "l", 526 "Ŀ": "L", 527 "ŀ": "l", 528 "Ł": "l", 529 "ł": "l", 530 "Ḿ": "M", 531 "ḿ": "m", 532 "M̆": "M", 533 "m̆": "m", 534 "Ń": "N", 535 "ń": "n", 536 "Ņ": "N", 537 "ņ": "n", 538 "Ň": "N", 539 "ň": "n", 540 "ʼn": "n", 541 "N̆": "N", 542 "n̆": "n", 543 "Ō": "O", 544 "ō": "o", 545 "Ŏ": "O", 546 "ŏ": "o", 547 "Ő": "O", 548 "ő": "o", 549 "Œ": "OE", 550 "œ": "oe", 551 "P̆": "P", 552 "p̆": "p", 553 "Ŕ": "R", 554 "ŕ": "r", 555 "Ŗ": "R", 556 "ŗ": "r", 557 "Ř": "R", 558 "ř": "r", 559 "R̆": "R", 560 "r̆": "r", 561 "Ȓ": "R", 562 "ȓ": "r", 563 "Ś": "S", 564 "ś": "s", 565 "Ŝ": "S", 566 "ŝ": "s", 567 "Ş": "S", 568 "Ș": "S", 569 "ș": "s", 570 "ş": "s", 571 "Š": "S", 572 "š": "s", 573 "Ţ": "T", 574 "ţ": "t", 575 "ț": "t", 576 "Ț": "T", 577 "Ť": "T", 578 "ť": "t", 579 "Ŧ": "T", 580 "ŧ": "t", 581 "T̆": "T", 582 "t̆": "t", 583 "Ũ": "U", 584 "ũ": "u", 585 "Ū": "U", 586 "ū": "u", 587 "Ŭ": "U", 588 "ŭ": "u", 589 "Ů": "U", 590 "ů": "u", 591 "Ű": "U", 592 "ű": "u", 593 "Ų": "U", 594 "ų": "u", 595 "Ȗ": "U", 596 "ȗ": "u", 597 "V̆": "V", 598 "v̆": "v", 599 "Ŵ": "W", 600 "ŵ": "w", 601 "Ẃ": "W", 602 "ẃ": "w", 603 "X̆": "X", 604 "x̆": "x", 605 "Ŷ": "Y", 606 "ŷ": "y", 607 "Ÿ": "Y", 608 "Y̆": "Y", 609 "y̆": "y", 610 "Ź": "Z", 611 "ź": "z", 612 "Ż": "Z", 613 "ż": "z", 614 "Ž": "Z", 615 "ž": "z", 616 "ſ": "s", 617 "ƒ": "f", 618 "Ơ": "O", 619 "ơ": "o", 620 "Ư": "U", 621 "ư": "u", 622 "Ǎ": "A", 623 "ǎ": "a", 624 "Ǐ": "I", 625 "ǐ": "i", 626 "Ǒ": "O", 627 "ǒ": "o", 628 "Ǔ": "U", 629 "ǔ": "u", 630 "Ǖ": "U", 631 "ǖ": "u", 632 "Ǘ": "U", 633 "ǘ": "u", 634 "Ǚ": "U", 635 "ǚ": "u", 636 "Ǜ": "U", 637 "ǜ": "u", 638 "Ứ": "U", 639 "ứ": "u", 640 "Ṹ": "U", 641 "ṹ": "u", 642 "Ǻ": "A", 643 "ǻ": "a", 644 "Ǽ": "AE", 645 "ǽ": "ae", 646 "Ǿ": "O", 647 "ǿ": "o", 648 "Þ": "TH", 649 "þ": "th", 650 "Ṕ": "P", 651 "ṕ": "p", 652 "Ṥ": "S", 653 "ṥ": "s", 654 "X́": "X", 655 "x́": "x", 656 "Ѓ": "Г", 657 "ѓ": "г", 658 "Ќ": "К", 659 "ќ": "к", 660 "A̋": "A", 661 "a̋": "a", 662 "E̋": "E", 663 "e̋": "e", 664 "I̋": "I", 665 "i̋": "i", 666 "Ǹ": "N", 667 "ǹ": "n", 668 "Ồ": "O", 669 "ồ": "o", 670 "Ṑ": "O", 671 "ṑ": "o", 672 "Ừ": "U", 673 "ừ": "u", 674 "Ẁ": "W", 675 "ẁ": "w", 676 "Ỳ": "Y", 677 "ỳ": "y", 678 "Ȁ": "A", 679 "ȁ": "a", 680 "Ȅ": "E", 681 "ȅ": "e", 682 "Ȉ": "I", 683 "ȉ": "i", 684 "Ȍ": "O", 685 "ȍ": "o", 686 "Ȑ": "R", 687 "ȑ": "r", 688 "Ȕ": "U", 689 "ȕ": "u", 690 "B̌": "B", 691 "b̌": "b", 692 "Č̣": "C", 693 "č̣": "c", 694 "Ê̌": "E", 695 "ê̌": "e", 696 "F̌": "F", 697 "f̌": "f", 698 "Ǧ": "G", 699 "ǧ": "g", 700 "Ȟ": "H", 701 "ȟ": "h", 702 "J̌": "J", 703 "ǰ": "j", 704 "Ǩ": "K", 705 "ǩ": "k", 706 "M̌": "M", 707 "m̌": "m", 708 "P̌": "P", 709 "p̌": "p", 710 "Q̌": "Q", 711 "q̌": "q", 712 "Ř̩": "R", 713 "ř̩": "r", 714 "Ṧ": "S", 715 "ṧ": "s", 716 "V̌": "V", 717 "v̌": "v", 718 "W̌": "W", 719 "w̌": "w", 720 "X̌": "X", 721 "x̌": "x", 722 "Y̌": "Y", 723 "y̌": "y", 724 "A̧": "A", 725 "a̧": "a", 726 "B̧": "B", 727 "b̧": "b", 728 "Ḑ": "D", 729 "ḑ": "d", 730 "Ȩ": "E", 731 "ȩ": "e", 732 "Ɛ̧": "E", 733 "ɛ̧": "e", 734 "Ḩ": "H", 735 "ḩ": "h", 736 "I̧": "I", 737 "i̧": "i", 738 "Ɨ̧": "I", 739 "ɨ̧": "i", 740 "M̧": "M", 741 "m̧": "m", 742 "O̧": "O", 743 "o̧": "o", 744 "Q̧": "Q", 745 "q̧": "q", 746 "U̧": "U", 747 "u̧": "u", 748 "X̧": "X", 749 "x̧": "x", 750 "Z̧": "Z", 751 "z̧": "z", 752 "й":"и", 753 "Й":"И", 754 "ё":"е", 755 "Ё":"Е", 756 }; 757 758 var chars = Object.keys(characterMap).join('|'); 759 var allAccents = new RegExp(chars, 'g'); 760 var firstAccent = new RegExp(chars, ''); 761 762 function matcher(match) { 763 return characterMap[match]; 764 } 765 766 var removeAccents = function(string) { 767 return string.replace(allAccents, matcher); 768 }; 769 770 var hasAccents = function(string) { 771 return !!string.match(firstAccent); 772 }; 773 774 module.exports = removeAccents; 775 module.exports.has = hasAccents; 776 module.exports.remove = removeAccents; 777 778 779 /***/ }) 780 781 /******/ }); 782 /************************************************************************/ 783 /******/ // The module cache 784 /******/ var __webpack_module_cache__ = {}; 785 /******/ 786 /******/ // The require function 787 /******/ function __webpack_require__(moduleId) { 788 /******/ // Check if module is in cache 789 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 790 /******/ if (cachedModule !== undefined) { 791 /******/ return cachedModule.exports; 792 /******/ } 793 /******/ // Create a new module (and put it into the cache) 794 /******/ var module = __webpack_module_cache__[moduleId] = { 795 /******/ // no module.id needed 796 /******/ // no module.loaded needed 797 /******/ exports: {} 798 /******/ }; 799 /******/ 800 /******/ // Execute the module function 801 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 802 /******/ 803 /******/ // Return the exports of the module 804 /******/ return module.exports; 805 /******/ } 806 /******/ 807 /************************************************************************/ 808 /******/ /* webpack/runtime/compat get default export */ 809 /******/ (() => { 810 /******/ // getDefaultExport function for compatibility with non-harmony modules 811 /******/ __webpack_require__.n = (module) => { 812 /******/ var getter = module && module.__esModule ? 813 /******/ () => (module['default']) : 814 /******/ () => (module); 815 /******/ __webpack_require__.d(getter, { a: getter }); 816 /******/ return getter; 817 /******/ }; 818 /******/ })(); 819 /******/ 820 /******/ /* webpack/runtime/define property getters */ 821 /******/ (() => { 822 /******/ // define getter functions for harmony exports 823 /******/ __webpack_require__.d = (exports, definition) => { 824 /******/ for(var key in definition) { 825 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 826 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 827 /******/ } 828 /******/ } 829 /******/ }; 830 /******/ })(); 831 /******/ 832 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 833 /******/ (() => { 834 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 835 /******/ })(); 836 /******/ 837 /******/ /* webpack/runtime/make namespace object */ 838 /******/ (() => { 839 /******/ // define __esModule on exports 840 /******/ __webpack_require__.r = (exports) => { 841 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 842 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 843 /******/ } 844 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 845 /******/ }; 846 /******/ })(); 847 /******/ 848 /************************************************************************/ 849 var __webpack_exports__ = {}; 850 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 851 (() => { 852 "use strict"; 853 // ESM COMPAT FLAG 854 __webpack_require__.r(__webpack_exports__); 855 856 // EXPORTS 857 __webpack_require__.d(__webpack_exports__, { 858 __experimentalGetCoreBlocks: () => (/* binding */ __experimentalGetCoreBlocks), 859 __experimentalRegisterExperimentalCoreBlocks: () => (/* binding */ __experimentalRegisterExperimentalCoreBlocks), 860 registerCoreBlocks: () => (/* binding */ registerCoreBlocks) 861 }); 862 863 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js 864 var archives_namespaceObject = {}; 865 __webpack_require__.r(archives_namespaceObject); 866 __webpack_require__.d(archives_namespaceObject, { 867 init: () => (init), 868 metadata: () => (metadata), 869 name: () => (archives_name), 870 settings: () => (settings) 871 }); 872 873 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js 874 var avatar_namespaceObject = {}; 875 __webpack_require__.r(avatar_namespaceObject); 876 __webpack_require__.d(avatar_namespaceObject, { 877 init: () => (avatar_init), 878 metadata: () => (avatar_metadata), 879 name: () => (avatar_name), 880 settings: () => (avatar_settings) 881 }); 882 883 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js 884 var build_module_audio_namespaceObject = {}; 885 __webpack_require__.r(build_module_audio_namespaceObject); 886 __webpack_require__.d(build_module_audio_namespaceObject, { 887 init: () => (audio_init), 888 metadata: () => (audio_metadata), 889 name: () => (audio_name), 890 settings: () => (audio_settings) 891 }); 892 893 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js 894 var build_module_button_namespaceObject = {}; 895 __webpack_require__.r(build_module_button_namespaceObject); 896 __webpack_require__.d(build_module_button_namespaceObject, { 897 init: () => (button_init), 898 metadata: () => (button_metadata), 899 name: () => (button_name), 900 settings: () => (button_settings) 901 }); 902 903 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js 904 var build_module_buttons_namespaceObject = {}; 905 __webpack_require__.r(build_module_buttons_namespaceObject); 906 __webpack_require__.d(build_module_buttons_namespaceObject, { 907 init: () => (buttons_init), 908 metadata: () => (buttons_metadata), 909 name: () => (buttons_name), 910 settings: () => (buttons_settings) 911 }); 912 913 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js 914 var build_module_calendar_namespaceObject = {}; 915 __webpack_require__.r(build_module_calendar_namespaceObject); 916 __webpack_require__.d(build_module_calendar_namespaceObject, { 917 init: () => (calendar_init), 918 metadata: () => (calendar_metadata), 919 name: () => (calendar_name), 920 settings: () => (calendar_settings) 921 }); 922 923 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js 924 var categories_namespaceObject = {}; 925 __webpack_require__.r(categories_namespaceObject); 926 __webpack_require__.d(categories_namespaceObject, { 927 init: () => (categories_init), 928 metadata: () => (categories_metadata), 929 name: () => (categories_name), 930 settings: () => (categories_settings) 931 }); 932 933 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js 934 var freeform_namespaceObject = {}; 935 __webpack_require__.r(freeform_namespaceObject); 936 __webpack_require__.d(freeform_namespaceObject, { 937 init: () => (freeform_init), 938 metadata: () => (freeform_metadata), 939 name: () => (freeform_name), 940 settings: () => (freeform_settings) 941 }); 942 943 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js 944 var build_module_code_namespaceObject = {}; 945 __webpack_require__.r(build_module_code_namespaceObject); 946 __webpack_require__.d(build_module_code_namespaceObject, { 947 init: () => (code_init), 948 metadata: () => (code_metadata), 949 name: () => (code_name), 950 settings: () => (code_settings) 951 }); 952 953 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js 954 var build_module_column_namespaceObject = {}; 955 __webpack_require__.r(build_module_column_namespaceObject); 956 __webpack_require__.d(build_module_column_namespaceObject, { 957 init: () => (column_init), 958 metadata: () => (column_metadata), 959 name: () => (column_name), 960 settings: () => (column_settings) 961 }); 962 963 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js 964 var build_module_columns_namespaceObject = {}; 965 __webpack_require__.r(build_module_columns_namespaceObject); 966 __webpack_require__.d(build_module_columns_namespaceObject, { 967 init: () => (columns_init), 968 metadata: () => (columns_metadata), 969 name: () => (columns_name), 970 settings: () => (columns_settings) 971 }); 972 973 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js 974 var comments_namespaceObject = {}; 975 __webpack_require__.r(comments_namespaceObject); 976 __webpack_require__.d(comments_namespaceObject, { 977 init: () => (comments_init), 978 metadata: () => (comments_metadata), 979 name: () => (comments_name), 980 settings: () => (comments_settings) 981 }); 982 983 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js 984 var build_module_comment_author_avatar_namespaceObject = {}; 985 __webpack_require__.r(build_module_comment_author_avatar_namespaceObject); 986 __webpack_require__.d(build_module_comment_author_avatar_namespaceObject, { 987 init: () => (comment_author_avatar_init), 988 metadata: () => (comment_author_avatar_metadata), 989 name: () => (comment_author_avatar_name), 990 settings: () => (comment_author_avatar_settings) 991 }); 992 993 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js 994 var build_module_comment_author_name_namespaceObject = {}; 995 __webpack_require__.r(build_module_comment_author_name_namespaceObject); 996 __webpack_require__.d(build_module_comment_author_name_namespaceObject, { 997 init: () => (comment_author_name_init), 998 metadata: () => (comment_author_name_metadata), 999 name: () => (comment_author_name_name), 1000 settings: () => (comment_author_name_settings) 1001 }); 1002 1003 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js 1004 var build_module_comment_content_namespaceObject = {}; 1005 __webpack_require__.r(build_module_comment_content_namespaceObject); 1006 __webpack_require__.d(build_module_comment_content_namespaceObject, { 1007 init: () => (comment_content_init), 1008 metadata: () => (comment_content_metadata), 1009 name: () => (comment_content_name), 1010 settings: () => (comment_content_settings) 1011 }); 1012 1013 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js 1014 var comment_date_namespaceObject = {}; 1015 __webpack_require__.r(comment_date_namespaceObject); 1016 __webpack_require__.d(comment_date_namespaceObject, { 1017 init: () => (comment_date_init), 1018 metadata: () => (comment_date_metadata), 1019 name: () => (comment_date_name), 1020 settings: () => (comment_date_settings) 1021 }); 1022 1023 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js 1024 var build_module_comment_edit_link_namespaceObject = {}; 1025 __webpack_require__.r(build_module_comment_edit_link_namespaceObject); 1026 __webpack_require__.d(build_module_comment_edit_link_namespaceObject, { 1027 init: () => (comment_edit_link_init), 1028 metadata: () => (comment_edit_link_metadata), 1029 name: () => (comment_edit_link_name), 1030 settings: () => (comment_edit_link_settings) 1031 }); 1032 1033 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js 1034 var build_module_comment_reply_link_namespaceObject = {}; 1035 __webpack_require__.r(build_module_comment_reply_link_namespaceObject); 1036 __webpack_require__.d(build_module_comment_reply_link_namespaceObject, { 1037 init: () => (comment_reply_link_init), 1038 metadata: () => (comment_reply_link_metadata), 1039 name: () => (comment_reply_link_name), 1040 settings: () => (comment_reply_link_settings) 1041 }); 1042 1043 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js 1044 var comment_template_namespaceObject = {}; 1045 __webpack_require__.r(comment_template_namespaceObject); 1046 __webpack_require__.d(comment_template_namespaceObject, { 1047 init: () => (comment_template_init), 1048 metadata: () => (comment_template_metadata), 1049 name: () => (comment_template_name), 1050 settings: () => (comment_template_settings) 1051 }); 1052 1053 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js 1054 var comments_pagination_previous_namespaceObject = {}; 1055 __webpack_require__.r(comments_pagination_previous_namespaceObject); 1056 __webpack_require__.d(comments_pagination_previous_namespaceObject, { 1057 init: () => (comments_pagination_previous_init), 1058 metadata: () => (comments_pagination_previous_metadata), 1059 name: () => (comments_pagination_previous_name), 1060 settings: () => (comments_pagination_previous_settings) 1061 }); 1062 1063 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js 1064 var comments_pagination_namespaceObject = {}; 1065 __webpack_require__.r(comments_pagination_namespaceObject); 1066 __webpack_require__.d(comments_pagination_namespaceObject, { 1067 init: () => (comments_pagination_init), 1068 metadata: () => (comments_pagination_metadata), 1069 name: () => (comments_pagination_name), 1070 settings: () => (comments_pagination_settings) 1071 }); 1072 1073 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js 1074 var comments_pagination_next_namespaceObject = {}; 1075 __webpack_require__.r(comments_pagination_next_namespaceObject); 1076 __webpack_require__.d(comments_pagination_next_namespaceObject, { 1077 init: () => (comments_pagination_next_init), 1078 metadata: () => (comments_pagination_next_metadata), 1079 name: () => (comments_pagination_next_name), 1080 settings: () => (comments_pagination_next_settings) 1081 }); 1082 1083 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js 1084 var comments_pagination_numbers_namespaceObject = {}; 1085 __webpack_require__.r(comments_pagination_numbers_namespaceObject); 1086 __webpack_require__.d(comments_pagination_numbers_namespaceObject, { 1087 init: () => (comments_pagination_numbers_init), 1088 metadata: () => (comments_pagination_numbers_metadata), 1089 name: () => (comments_pagination_numbers_name), 1090 settings: () => (comments_pagination_numbers_settings) 1091 }); 1092 1093 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js 1094 var comments_title_namespaceObject = {}; 1095 __webpack_require__.r(comments_title_namespaceObject); 1096 __webpack_require__.d(comments_title_namespaceObject, { 1097 init: () => (comments_title_init), 1098 metadata: () => (comments_title_metadata), 1099 name: () => (comments_title_name), 1100 settings: () => (comments_title_settings) 1101 }); 1102 1103 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js 1104 var build_module_cover_namespaceObject = {}; 1105 __webpack_require__.r(build_module_cover_namespaceObject); 1106 __webpack_require__.d(build_module_cover_namespaceObject, { 1107 init: () => (cover_init), 1108 metadata: () => (cover_metadata), 1109 name: () => (cover_name), 1110 settings: () => (cover_settings) 1111 }); 1112 1113 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/details/index.js 1114 var build_module_details_namespaceObject = {}; 1115 __webpack_require__.r(build_module_details_namespaceObject); 1116 __webpack_require__.d(build_module_details_namespaceObject, { 1117 init: () => (details_init), 1118 metadata: () => (details_metadata), 1119 name: () => (details_name), 1120 settings: () => (details_settings) 1121 }); 1122 1123 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js 1124 var embed_namespaceObject = {}; 1125 __webpack_require__.r(embed_namespaceObject); 1126 __webpack_require__.d(embed_namespaceObject, { 1127 init: () => (embed_init), 1128 metadata: () => (embed_metadata), 1129 name: () => (embed_name), 1130 settings: () => (embed_settings) 1131 }); 1132 1133 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js 1134 var build_module_file_namespaceObject = {}; 1135 __webpack_require__.r(build_module_file_namespaceObject); 1136 __webpack_require__.d(build_module_file_namespaceObject, { 1137 init: () => (file_init), 1138 metadata: () => (file_metadata), 1139 name: () => (file_name), 1140 settings: () => (file_settings) 1141 }); 1142 1143 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form/index.js 1144 var build_module_form_namespaceObject = {}; 1145 __webpack_require__.r(build_module_form_namespaceObject); 1146 __webpack_require__.d(build_module_form_namespaceObject, { 1147 init: () => (form_init), 1148 metadata: () => (form_metadata), 1149 name: () => (form_name), 1150 settings: () => (form_settings) 1151 }); 1152 1153 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-input/index.js 1154 var form_input_namespaceObject = {}; 1155 __webpack_require__.r(form_input_namespaceObject); 1156 __webpack_require__.d(form_input_namespaceObject, { 1157 init: () => (form_input_init), 1158 metadata: () => (form_input_metadata), 1159 name: () => (form_input_name), 1160 settings: () => (form_input_settings) 1161 }); 1162 1163 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js 1164 var form_submit_button_namespaceObject = {}; 1165 __webpack_require__.r(form_submit_button_namespaceObject); 1166 __webpack_require__.d(form_submit_button_namespaceObject, { 1167 init: () => (form_submit_button_init), 1168 metadata: () => (form_submit_button_metadata), 1169 name: () => (form_submit_button_name), 1170 settings: () => (form_submit_button_settings) 1171 }); 1172 1173 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js 1174 var form_submission_notification_namespaceObject = {}; 1175 __webpack_require__.r(form_submission_notification_namespaceObject); 1176 __webpack_require__.d(form_submission_notification_namespaceObject, { 1177 init: () => (form_submission_notification_init), 1178 metadata: () => (form_submission_notification_metadata), 1179 name: () => (form_submission_notification_name), 1180 settings: () => (form_submission_notification_settings) 1181 }); 1182 1183 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js 1184 var build_module_gallery_namespaceObject = {}; 1185 __webpack_require__.r(build_module_gallery_namespaceObject); 1186 __webpack_require__.d(build_module_gallery_namespaceObject, { 1187 init: () => (gallery_init), 1188 metadata: () => (gallery_metadata), 1189 name: () => (gallery_name), 1190 settings: () => (gallery_settings) 1191 }); 1192 1193 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js 1194 var build_module_group_namespaceObject = {}; 1195 __webpack_require__.r(build_module_group_namespaceObject); 1196 __webpack_require__.d(build_module_group_namespaceObject, { 1197 init: () => (group_init), 1198 metadata: () => (group_metadata), 1199 name: () => (group_name), 1200 settings: () => (group_settings) 1201 }); 1202 1203 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js 1204 var build_module_heading_namespaceObject = {}; 1205 __webpack_require__.r(build_module_heading_namespaceObject); 1206 __webpack_require__.d(build_module_heading_namespaceObject, { 1207 init: () => (heading_init), 1208 metadata: () => (heading_metadata), 1209 name: () => (heading_name), 1210 settings: () => (heading_settings) 1211 }); 1212 1213 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js 1214 var home_link_namespaceObject = {}; 1215 __webpack_require__.r(home_link_namespaceObject); 1216 __webpack_require__.d(home_link_namespaceObject, { 1217 init: () => (home_link_init), 1218 metadata: () => (home_link_metadata), 1219 name: () => (home_link_name), 1220 settings: () => (home_link_settings) 1221 }); 1222 1223 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js 1224 var build_module_html_namespaceObject = {}; 1225 __webpack_require__.r(build_module_html_namespaceObject); 1226 __webpack_require__.d(build_module_html_namespaceObject, { 1227 init: () => (html_init), 1228 metadata: () => (html_metadata), 1229 name: () => (html_name), 1230 settings: () => (html_settings) 1231 }); 1232 1233 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js 1234 var build_module_image_namespaceObject = {}; 1235 __webpack_require__.r(build_module_image_namespaceObject); 1236 __webpack_require__.d(build_module_image_namespaceObject, { 1237 init: () => (image_init), 1238 metadata: () => (image_metadata), 1239 name: () => (image_name), 1240 settings: () => (image_settings) 1241 }); 1242 1243 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 1244 var latest_comments_namespaceObject = {}; 1245 __webpack_require__.r(latest_comments_namespaceObject); 1246 __webpack_require__.d(latest_comments_namespaceObject, { 1247 init: () => (latest_comments_init), 1248 metadata: () => (latest_comments_metadata), 1249 name: () => (latest_comments_name), 1250 settings: () => (latest_comments_settings) 1251 }); 1252 1253 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 1254 var latest_posts_namespaceObject = {}; 1255 __webpack_require__.r(latest_posts_namespaceObject); 1256 __webpack_require__.d(latest_posts_namespaceObject, { 1257 init: () => (latest_posts_init), 1258 metadata: () => (latest_posts_metadata), 1259 name: () => (latest_posts_name), 1260 settings: () => (latest_posts_settings) 1261 }); 1262 1263 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js 1264 var build_module_list_namespaceObject = {}; 1265 __webpack_require__.r(build_module_list_namespaceObject); 1266 __webpack_require__.d(build_module_list_namespaceObject, { 1267 init: () => (list_init), 1268 metadata: () => (list_metadata), 1269 name: () => (list_name), 1270 settings: () => (list_settings) 1271 }); 1272 1273 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js 1274 var build_module_list_item_namespaceObject = {}; 1275 __webpack_require__.r(build_module_list_item_namespaceObject); 1276 __webpack_require__.d(build_module_list_item_namespaceObject, { 1277 init: () => (list_item_init), 1278 metadata: () => (list_item_metadata), 1279 name: () => (list_item_name), 1280 settings: () => (list_item_settings) 1281 }); 1282 1283 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js 1284 var loginout_namespaceObject = {}; 1285 __webpack_require__.r(loginout_namespaceObject); 1286 __webpack_require__.d(loginout_namespaceObject, { 1287 init: () => (loginout_init), 1288 metadata: () => (loginout_metadata), 1289 name: () => (loginout_name), 1290 settings: () => (loginout_settings) 1291 }); 1292 1293 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js 1294 var media_text_namespaceObject = {}; 1295 __webpack_require__.r(media_text_namespaceObject); 1296 __webpack_require__.d(media_text_namespaceObject, { 1297 init: () => (media_text_init), 1298 metadata: () => (media_text_metadata), 1299 name: () => (media_text_name), 1300 settings: () => (media_text_settings) 1301 }); 1302 1303 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js 1304 var missing_namespaceObject = {}; 1305 __webpack_require__.r(missing_namespaceObject); 1306 __webpack_require__.d(missing_namespaceObject, { 1307 init: () => (missing_init), 1308 metadata: () => (missing_metadata), 1309 name: () => (missing_name), 1310 settings: () => (missing_settings) 1311 }); 1312 1313 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js 1314 var build_module_more_namespaceObject = {}; 1315 __webpack_require__.r(build_module_more_namespaceObject); 1316 __webpack_require__.d(build_module_more_namespaceObject, { 1317 init: () => (more_init), 1318 metadata: () => (more_metadata), 1319 name: () => (more_name), 1320 settings: () => (more_settings) 1321 }); 1322 1323 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js 1324 var build_module_navigation_namespaceObject = {}; 1325 __webpack_require__.r(build_module_navigation_namespaceObject); 1326 __webpack_require__.d(build_module_navigation_namespaceObject, { 1327 init: () => (navigation_init), 1328 metadata: () => (navigation_metadata), 1329 name: () => (navigation_name), 1330 settings: () => (navigation_settings) 1331 }); 1332 1333 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js 1334 var navigation_link_namespaceObject = {}; 1335 __webpack_require__.r(navigation_link_namespaceObject); 1336 __webpack_require__.d(navigation_link_namespaceObject, { 1337 init: () => (navigation_link_init), 1338 metadata: () => (navigation_link_metadata), 1339 name: () => (navigation_link_name), 1340 settings: () => (navigation_link_settings) 1341 }); 1342 1343 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js 1344 var navigation_submenu_namespaceObject = {}; 1345 __webpack_require__.r(navigation_submenu_namespaceObject); 1346 __webpack_require__.d(navigation_submenu_namespaceObject, { 1347 init: () => (navigation_submenu_init), 1348 metadata: () => (navigation_submenu_metadata), 1349 name: () => (navigation_submenu_name), 1350 settings: () => (navigation_submenu_settings) 1351 }); 1352 1353 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 1354 var nextpage_namespaceObject = {}; 1355 __webpack_require__.r(nextpage_namespaceObject); 1356 __webpack_require__.d(nextpage_namespaceObject, { 1357 init: () => (nextpage_init), 1358 metadata: () => (nextpage_metadata), 1359 name: () => (nextpage_name), 1360 settings: () => (nextpage_settings) 1361 }); 1362 1363 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js 1364 var pattern_namespaceObject = {}; 1365 __webpack_require__.r(pattern_namespaceObject); 1366 __webpack_require__.d(pattern_namespaceObject, { 1367 init: () => (pattern_init), 1368 metadata: () => (pattern_metadata), 1369 name: () => (pattern_name), 1370 settings: () => (pattern_settings) 1371 }); 1372 1373 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js 1374 var page_list_namespaceObject = {}; 1375 __webpack_require__.r(page_list_namespaceObject); 1376 __webpack_require__.d(page_list_namespaceObject, { 1377 init: () => (page_list_init), 1378 metadata: () => (page_list_metadata), 1379 name: () => (page_list_name), 1380 settings: () => (page_list_settings) 1381 }); 1382 1383 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js 1384 var page_list_item_namespaceObject = {}; 1385 __webpack_require__.r(page_list_item_namespaceObject); 1386 __webpack_require__.d(page_list_item_namespaceObject, { 1387 init: () => (page_list_item_init), 1388 metadata: () => (page_list_item_metadata), 1389 name: () => (page_list_item_name), 1390 settings: () => (page_list_item_settings) 1391 }); 1392 1393 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 1394 var build_module_paragraph_namespaceObject = {}; 1395 __webpack_require__.r(build_module_paragraph_namespaceObject); 1396 __webpack_require__.d(build_module_paragraph_namespaceObject, { 1397 init: () => (paragraph_init), 1398 metadata: () => (paragraph_metadata), 1399 name: () => (paragraph_name), 1400 settings: () => (paragraph_settings) 1401 }); 1402 1403 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js 1404 var build_module_post_author_namespaceObject = {}; 1405 __webpack_require__.r(build_module_post_author_namespaceObject); 1406 __webpack_require__.d(build_module_post_author_namespaceObject, { 1407 init: () => (post_author_init), 1408 metadata: () => (post_author_metadata), 1409 name: () => (post_author_name), 1410 settings: () => (post_author_settings) 1411 }); 1412 1413 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js 1414 var post_author_name_namespaceObject = {}; 1415 __webpack_require__.r(post_author_name_namespaceObject); 1416 __webpack_require__.d(post_author_name_namespaceObject, { 1417 init: () => (post_author_name_init), 1418 metadata: () => (post_author_name_metadata), 1419 name: () => (post_author_name_name), 1420 settings: () => (post_author_name_settings) 1421 }); 1422 1423 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js 1424 var post_author_biography_namespaceObject = {}; 1425 __webpack_require__.r(post_author_biography_namespaceObject); 1426 __webpack_require__.d(post_author_biography_namespaceObject, { 1427 init: () => (post_author_biography_init), 1428 metadata: () => (post_author_biography_metadata), 1429 name: () => (post_author_biography_name), 1430 settings: () => (post_author_biography_settings) 1431 }); 1432 1433 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js 1434 var post_comment_namespaceObject = {}; 1435 __webpack_require__.r(post_comment_namespaceObject); 1436 __webpack_require__.d(post_comment_namespaceObject, { 1437 init: () => (post_comment_init), 1438 metadata: () => (post_comment_metadata), 1439 name: () => (post_comment_name), 1440 settings: () => (post_comment_settings) 1441 }); 1442 1443 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js 1444 var build_module_post_comments_count_namespaceObject = {}; 1445 __webpack_require__.r(build_module_post_comments_count_namespaceObject); 1446 __webpack_require__.d(build_module_post_comments_count_namespaceObject, { 1447 init: () => (post_comments_count_init), 1448 metadata: () => (post_comments_count_metadata), 1449 name: () => (post_comments_count_name), 1450 settings: () => (post_comments_count_settings) 1451 }); 1452 1453 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js 1454 var build_module_post_comments_form_namespaceObject = {}; 1455 __webpack_require__.r(build_module_post_comments_form_namespaceObject); 1456 __webpack_require__.d(build_module_post_comments_form_namespaceObject, { 1457 init: () => (post_comments_form_init), 1458 metadata: () => (post_comments_form_metadata), 1459 name: () => (post_comments_form_name), 1460 settings: () => (post_comments_form_settings) 1461 }); 1462 1463 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js 1464 var post_comments_link_namespaceObject = {}; 1465 __webpack_require__.r(post_comments_link_namespaceObject); 1466 __webpack_require__.d(post_comments_link_namespaceObject, { 1467 init: () => (post_comments_link_init), 1468 metadata: () => (post_comments_link_metadata), 1469 name: () => (post_comments_link_name), 1470 settings: () => (post_comments_link_settings) 1471 }); 1472 1473 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js 1474 var build_module_post_content_namespaceObject = {}; 1475 __webpack_require__.r(build_module_post_content_namespaceObject); 1476 __webpack_require__.d(build_module_post_content_namespaceObject, { 1477 init: () => (post_content_init), 1478 metadata: () => (post_content_metadata), 1479 name: () => (post_content_name), 1480 settings: () => (post_content_settings) 1481 }); 1482 1483 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js 1484 var build_module_post_date_namespaceObject = {}; 1485 __webpack_require__.r(build_module_post_date_namespaceObject); 1486 __webpack_require__.d(build_module_post_date_namespaceObject, { 1487 init: () => (post_date_init), 1488 metadata: () => (post_date_metadata), 1489 name: () => (post_date_name), 1490 settings: () => (post_date_settings) 1491 }); 1492 1493 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js 1494 var build_module_post_excerpt_namespaceObject = {}; 1495 __webpack_require__.r(build_module_post_excerpt_namespaceObject); 1496 __webpack_require__.d(build_module_post_excerpt_namespaceObject, { 1497 init: () => (post_excerpt_init), 1498 metadata: () => (post_excerpt_metadata), 1499 name: () => (post_excerpt_name), 1500 settings: () => (post_excerpt_settings) 1501 }); 1502 1503 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js 1504 var build_module_post_featured_image_namespaceObject = {}; 1505 __webpack_require__.r(build_module_post_featured_image_namespaceObject); 1506 __webpack_require__.d(build_module_post_featured_image_namespaceObject, { 1507 init: () => (post_featured_image_init), 1508 metadata: () => (post_featured_image_metadata), 1509 name: () => (post_featured_image_name), 1510 settings: () => (post_featured_image_settings) 1511 }); 1512 1513 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js 1514 var post_navigation_link_namespaceObject = {}; 1515 __webpack_require__.r(post_navigation_link_namespaceObject); 1516 __webpack_require__.d(post_navigation_link_namespaceObject, { 1517 init: () => (post_navigation_link_init), 1518 metadata: () => (post_navigation_link_metadata), 1519 name: () => (post_navigation_link_name), 1520 settings: () => (post_navigation_link_settings) 1521 }); 1522 1523 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js 1524 var post_template_namespaceObject = {}; 1525 __webpack_require__.r(post_template_namespaceObject); 1526 __webpack_require__.d(post_template_namespaceObject, { 1527 init: () => (post_template_init), 1528 metadata: () => (post_template_metadata), 1529 name: () => (post_template_name), 1530 settings: () => (post_template_settings) 1531 }); 1532 1533 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js 1534 var build_module_post_terms_namespaceObject = {}; 1535 __webpack_require__.r(build_module_post_terms_namespaceObject); 1536 __webpack_require__.d(build_module_post_terms_namespaceObject, { 1537 init: () => (post_terms_init), 1538 metadata: () => (post_terms_metadata), 1539 name: () => (post_terms_name), 1540 settings: () => (post_terms_settings) 1541 }); 1542 1543 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js 1544 var post_time_to_read_namespaceObject = {}; 1545 __webpack_require__.r(post_time_to_read_namespaceObject); 1546 __webpack_require__.d(post_time_to_read_namespaceObject, { 1547 init: () => (post_time_to_read_init), 1548 metadata: () => (post_time_to_read_metadata), 1549 name: () => (post_time_to_read_name), 1550 settings: () => (post_time_to_read_settings) 1551 }); 1552 1553 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js 1554 var post_title_namespaceObject = {}; 1555 __webpack_require__.r(post_title_namespaceObject); 1556 __webpack_require__.d(post_title_namespaceObject, { 1557 init: () => (post_title_init), 1558 metadata: () => (post_title_metadata), 1559 name: () => (post_title_name), 1560 settings: () => (post_title_settings) 1561 }); 1562 1563 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 1564 var build_module_preformatted_namespaceObject = {}; 1565 __webpack_require__.r(build_module_preformatted_namespaceObject); 1566 __webpack_require__.d(build_module_preformatted_namespaceObject, { 1567 init: () => (preformatted_init), 1568 metadata: () => (preformatted_metadata), 1569 name: () => (preformatted_name), 1570 settings: () => (preformatted_settings) 1571 }); 1572 1573 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 1574 var build_module_pullquote_namespaceObject = {}; 1575 __webpack_require__.r(build_module_pullquote_namespaceObject); 1576 __webpack_require__.d(build_module_pullquote_namespaceObject, { 1577 init: () => (pullquote_init), 1578 metadata: () => (pullquote_metadata), 1579 name: () => (pullquote_name), 1580 settings: () => (pullquote_settings) 1581 }); 1582 1583 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js 1584 var query_namespaceObject = {}; 1585 __webpack_require__.r(query_namespaceObject); 1586 __webpack_require__.d(query_namespaceObject, { 1587 init: () => (query_init), 1588 metadata: () => (query_metadata), 1589 name: () => (query_name), 1590 settings: () => (query_settings) 1591 }); 1592 1593 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js 1594 var query_no_results_namespaceObject = {}; 1595 __webpack_require__.r(query_no_results_namespaceObject); 1596 __webpack_require__.d(query_no_results_namespaceObject, { 1597 init: () => (query_no_results_init), 1598 metadata: () => (query_no_results_metadata), 1599 name: () => (query_no_results_name), 1600 settings: () => (query_no_results_settings) 1601 }); 1602 1603 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js 1604 var build_module_query_pagination_namespaceObject = {}; 1605 __webpack_require__.r(build_module_query_pagination_namespaceObject); 1606 __webpack_require__.d(build_module_query_pagination_namespaceObject, { 1607 init: () => (query_pagination_init), 1608 metadata: () => (query_pagination_metadata), 1609 name: () => (query_pagination_name), 1610 settings: () => (query_pagination_settings) 1611 }); 1612 1613 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js 1614 var build_module_query_pagination_next_namespaceObject = {}; 1615 __webpack_require__.r(build_module_query_pagination_next_namespaceObject); 1616 __webpack_require__.d(build_module_query_pagination_next_namespaceObject, { 1617 init: () => (query_pagination_next_init), 1618 metadata: () => (query_pagination_next_metadata), 1619 name: () => (query_pagination_next_name), 1620 settings: () => (query_pagination_next_settings) 1621 }); 1622 1623 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js 1624 var build_module_query_pagination_numbers_namespaceObject = {}; 1625 __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject); 1626 __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, { 1627 init: () => (query_pagination_numbers_init), 1628 metadata: () => (query_pagination_numbers_metadata), 1629 name: () => (query_pagination_numbers_name), 1630 settings: () => (query_pagination_numbers_settings) 1631 }); 1632 1633 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js 1634 var build_module_query_pagination_previous_namespaceObject = {}; 1635 __webpack_require__.r(build_module_query_pagination_previous_namespaceObject); 1636 __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, { 1637 init: () => (query_pagination_previous_init), 1638 metadata: () => (query_pagination_previous_metadata), 1639 name: () => (query_pagination_previous_name), 1640 settings: () => (query_pagination_previous_settings) 1641 }); 1642 1643 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js 1644 var query_title_namespaceObject = {}; 1645 __webpack_require__.r(query_title_namespaceObject); 1646 __webpack_require__.d(query_title_namespaceObject, { 1647 init: () => (query_title_init), 1648 metadata: () => (query_title_metadata), 1649 name: () => (query_title_name), 1650 settings: () => (query_title_settings) 1651 }); 1652 1653 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js 1654 var build_module_quote_namespaceObject = {}; 1655 __webpack_require__.r(build_module_quote_namespaceObject); 1656 __webpack_require__.d(build_module_quote_namespaceObject, { 1657 init: () => (quote_init), 1658 metadata: () => (quote_metadata), 1659 name: () => (quote_name), 1660 settings: () => (quote_settings) 1661 }); 1662 1663 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js 1664 var block_namespaceObject = {}; 1665 __webpack_require__.r(block_namespaceObject); 1666 __webpack_require__.d(block_namespaceObject, { 1667 init: () => (block_init), 1668 metadata: () => (block_metadata), 1669 name: () => (block_name), 1670 settings: () => (block_settings) 1671 }); 1672 1673 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js 1674 var read_more_namespaceObject = {}; 1675 __webpack_require__.r(read_more_namespaceObject); 1676 __webpack_require__.d(read_more_namespaceObject, { 1677 init: () => (read_more_init), 1678 metadata: () => (read_more_metadata), 1679 name: () => (read_more_name), 1680 settings: () => (read_more_settings) 1681 }); 1682 1683 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js 1684 var build_module_rss_namespaceObject = {}; 1685 __webpack_require__.r(build_module_rss_namespaceObject); 1686 __webpack_require__.d(build_module_rss_namespaceObject, { 1687 init: () => (rss_init), 1688 metadata: () => (rss_metadata), 1689 name: () => (rss_name), 1690 settings: () => (rss_settings) 1691 }); 1692 1693 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js 1694 var build_module_search_namespaceObject = {}; 1695 __webpack_require__.r(build_module_search_namespaceObject); 1696 __webpack_require__.d(build_module_search_namespaceObject, { 1697 init: () => (search_init), 1698 metadata: () => (search_metadata), 1699 name: () => (search_name), 1700 settings: () => (search_settings) 1701 }); 1702 1703 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js 1704 var build_module_separator_namespaceObject = {}; 1705 __webpack_require__.r(build_module_separator_namespaceObject); 1706 __webpack_require__.d(build_module_separator_namespaceObject, { 1707 init: () => (separator_init), 1708 metadata: () => (separator_metadata), 1709 name: () => (separator_name), 1710 settings: () => (separator_settings) 1711 }); 1712 1713 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 1714 var build_module_shortcode_namespaceObject = {}; 1715 __webpack_require__.r(build_module_shortcode_namespaceObject); 1716 __webpack_require__.d(build_module_shortcode_namespaceObject, { 1717 init: () => (shortcode_init), 1718 metadata: () => (shortcode_metadata), 1719 name: () => (shortcode_name), 1720 settings: () => (shortcode_settings) 1721 }); 1722 1723 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js 1724 var build_module_site_logo_namespaceObject = {}; 1725 __webpack_require__.r(build_module_site_logo_namespaceObject); 1726 __webpack_require__.d(build_module_site_logo_namespaceObject, { 1727 init: () => (site_logo_init), 1728 metadata: () => (site_logo_metadata), 1729 name: () => (site_logo_name), 1730 settings: () => (site_logo_settings) 1731 }); 1732 1733 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js 1734 var site_tagline_namespaceObject = {}; 1735 __webpack_require__.r(site_tagline_namespaceObject); 1736 __webpack_require__.d(site_tagline_namespaceObject, { 1737 init: () => (site_tagline_init), 1738 metadata: () => (site_tagline_metadata), 1739 name: () => (site_tagline_name), 1740 settings: () => (site_tagline_settings) 1741 }); 1742 1743 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js 1744 var site_title_namespaceObject = {}; 1745 __webpack_require__.r(site_title_namespaceObject); 1746 __webpack_require__.d(site_title_namespaceObject, { 1747 init: () => (site_title_init), 1748 metadata: () => (site_title_metadata), 1749 name: () => (site_title_name), 1750 settings: () => (site_title_settings) 1751 }); 1752 1753 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js 1754 var social_link_namespaceObject = {}; 1755 __webpack_require__.r(social_link_namespaceObject); 1756 __webpack_require__.d(social_link_namespaceObject, { 1757 init: () => (social_link_init), 1758 metadata: () => (social_link_metadata), 1759 name: () => (social_link_name), 1760 settings: () => (social_link_settings) 1761 }); 1762 1763 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js 1764 var social_links_namespaceObject = {}; 1765 __webpack_require__.r(social_links_namespaceObject); 1766 __webpack_require__.d(social_links_namespaceObject, { 1767 init: () => (social_links_init), 1768 metadata: () => (social_links_metadata), 1769 name: () => (social_links_name), 1770 settings: () => (social_links_settings) 1771 }); 1772 1773 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js 1774 var spacer_namespaceObject = {}; 1775 __webpack_require__.r(spacer_namespaceObject); 1776 __webpack_require__.d(spacer_namespaceObject, { 1777 init: () => (spacer_init), 1778 metadata: () => (spacer_metadata), 1779 name: () => (spacer_name), 1780 settings: () => (spacer_settings) 1781 }); 1782 1783 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js 1784 var build_module_table_namespaceObject = {}; 1785 __webpack_require__.r(build_module_table_namespaceObject); 1786 __webpack_require__.d(build_module_table_namespaceObject, { 1787 init: () => (table_init), 1788 metadata: () => (table_metadata), 1789 name: () => (table_name), 1790 settings: () => (table_settings) 1791 }); 1792 1793 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js 1794 var build_module_table_of_contents_namespaceObject = {}; 1795 __webpack_require__.r(build_module_table_of_contents_namespaceObject); 1796 __webpack_require__.d(build_module_table_of_contents_namespaceObject, { 1797 init: () => (table_of_contents_init), 1798 metadata: () => (table_of_contents_metadata), 1799 name: () => (table_of_contents_name), 1800 settings: () => (table_of_contents_settings) 1801 }); 1802 1803 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 1804 var tag_cloud_namespaceObject = {}; 1805 __webpack_require__.r(tag_cloud_namespaceObject); 1806 __webpack_require__.d(tag_cloud_namespaceObject, { 1807 init: () => (tag_cloud_init), 1808 metadata: () => (tag_cloud_metadata), 1809 name: () => (tag_cloud_name), 1810 settings: () => (tag_cloud_settings) 1811 }); 1812 1813 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js 1814 var template_part_namespaceObject = {}; 1815 __webpack_require__.r(template_part_namespaceObject); 1816 __webpack_require__.d(template_part_namespaceObject, { 1817 init: () => (template_part_init), 1818 metadata: () => (template_part_metadata), 1819 name: () => (template_part_name), 1820 settings: () => (template_part_settings) 1821 }); 1822 1823 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js 1824 var build_module_term_description_namespaceObject = {}; 1825 __webpack_require__.r(build_module_term_description_namespaceObject); 1826 __webpack_require__.d(build_module_term_description_namespaceObject, { 1827 init: () => (term_description_init), 1828 metadata: () => (term_description_metadata), 1829 name: () => (term_description_name), 1830 settings: () => (term_description_settings) 1831 }); 1832 1833 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 1834 var text_columns_namespaceObject = {}; 1835 __webpack_require__.r(text_columns_namespaceObject); 1836 __webpack_require__.d(text_columns_namespaceObject, { 1837 init: () => (text_columns_init), 1838 metadata: () => (text_columns_metadata), 1839 name: () => (text_columns_name), 1840 settings: () => (text_columns_settings) 1841 }); 1842 1843 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js 1844 var build_module_verse_namespaceObject = {}; 1845 __webpack_require__.r(build_module_verse_namespaceObject); 1846 __webpack_require__.d(build_module_verse_namespaceObject, { 1847 init: () => (verse_init), 1848 metadata: () => (verse_metadata), 1849 name: () => (verse_name), 1850 settings: () => (verse_settings) 1851 }); 1852 1853 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js 1854 var build_module_video_namespaceObject = {}; 1855 __webpack_require__.r(build_module_video_namespaceObject); 1856 __webpack_require__.d(build_module_video_namespaceObject, { 1857 init: () => (video_init), 1858 metadata: () => (video_metadata), 1859 name: () => (video_name), 1860 settings: () => (video_settings) 1861 }); 1862 1863 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js 1864 var footnotes_namespaceObject = {}; 1865 __webpack_require__.r(footnotes_namespaceObject); 1866 __webpack_require__.d(footnotes_namespaceObject, { 1867 init: () => (footnotes_init), 1868 metadata: () => (footnotes_metadata), 1869 name: () => (footnotes_name), 1870 settings: () => (footnotes_settings) 1871 }); 1872 1873 ;// CONCATENATED MODULE: external ["wp","blocks"] 1874 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; 1875 ;// CONCATENATED MODULE: external "React" 1876 const external_React_namespaceObject = window["React"]; 1877 ;// CONCATENATED MODULE: external ["wp","primitives"] 1878 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 1879 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js 1880 1881 /** 1882 * WordPress dependencies 1883 */ 1884 1885 const archive = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 1886 viewBox: "0 0 24 24", 1887 xmlns: "http://www.w3.org/2000/svg" 1888 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 1889 fillRule: "evenodd", 1890 clipRule: "evenodd", 1891 d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" 1892 })); 1893 /* harmony default export */ const library_archive = (archive); 1894 1895 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/init-block.js 1896 /** 1897 * WordPress dependencies 1898 */ 1899 1900 1901 /** 1902 * Function to register an individual block. 1903 * 1904 * @param {Object} block The block to be registered. 1905 * 1906 * @return {WPBlockType | undefined} The block, if it has been successfully registered; 1907 * otherwise `undefined`. 1908 */ 1909 function initBlock(block) { 1910 if (!block) { 1911 return; 1912 } 1913 const { 1914 metadata, 1915 settings, 1916 name 1917 } = block; 1918 return (0,external_wp_blocks_namespaceObject.registerBlockType)({ 1919 name, 1920 ...metadata 1921 }, settings); 1922 } 1923 1924 ;// CONCATENATED MODULE: external ["wp","components"] 1925 const external_wp_components_namespaceObject = window["wp"]["components"]; 1926 ;// CONCATENATED MODULE: external ["wp","i18n"] 1927 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 1928 ;// CONCATENATED MODULE: external ["wp","blockEditor"] 1929 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; 1930 ;// CONCATENATED MODULE: external ["wp","serverSideRender"] 1931 const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; 1932 var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); 1933 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js 1934 1935 /** 1936 * WordPress dependencies 1937 */ 1938 1939 1940 1941 1942 function ArchivesEdit({ 1943 attributes, 1944 setAttributes 1945 }) { 1946 const { 1947 showLabel, 1948 showPostCounts, 1949 displayAsDropdown, 1950 type 1951 } = attributes; 1952 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 1953 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 1954 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 1955 __nextHasNoMarginBottom: true, 1956 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 1957 checked: displayAsDropdown, 1958 onChange: () => setAttributes({ 1959 displayAsDropdown: !displayAsDropdown 1960 }) 1961 }), displayAsDropdown && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 1962 __nextHasNoMarginBottom: true, 1963 label: (0,external_wp_i18n_namespaceObject.__)('Show label'), 1964 checked: showLabel, 1965 onChange: () => setAttributes({ 1966 showLabel: !showLabel 1967 }) 1968 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 1969 __nextHasNoMarginBottom: true, 1970 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 1971 checked: showPostCounts, 1972 onChange: () => setAttributes({ 1973 showPostCounts: !showPostCounts 1974 }) 1975 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 1976 __nextHasNoMarginBottom: true, 1977 label: (0,external_wp_i18n_namespaceObject.__)('Group by:'), 1978 options: [{ 1979 label: (0,external_wp_i18n_namespaceObject.__)('Year'), 1980 value: 'yearly' 1981 }, { 1982 label: (0,external_wp_i18n_namespaceObject.__)('Month'), 1983 value: 'monthly' 1984 }, { 1985 label: (0,external_wp_i18n_namespaceObject.__)('Week'), 1986 value: 'weekly' 1987 }, { 1988 label: (0,external_wp_i18n_namespaceObject.__)('Day'), 1989 value: 'daily' 1990 }], 1991 value: type, 1992 onChange: value => setAttributes({ 1993 type: value 1994 }) 1995 }))), (0,external_React_namespaceObject.createElement)("div", { 1996 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 1997 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)((external_wp_serverSideRender_default()), { 1998 block: "core/archives", 1999 skipBlockSupportAttributes: true, 2000 attributes: attributes 2001 })))); 2002 } 2003 2004 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js 2005 /** 2006 * WordPress dependencies 2007 */ 2008 2009 2010 /** 2011 * Internal dependencies 2012 */ 2013 2014 const metadata = { 2015 $schema: "https://schemas.wp.org/trunk/block.json", 2016 apiVersion: 3, 2017 name: "core/archives", 2018 title: "Archives", 2019 category: "widgets", 2020 description: "Display a date archive of your posts.", 2021 textdomain: "default", 2022 attributes: { 2023 displayAsDropdown: { 2024 type: "boolean", 2025 "default": false 2026 }, 2027 showLabel: { 2028 type: "boolean", 2029 "default": true 2030 }, 2031 showPostCounts: { 2032 type: "boolean", 2033 "default": false 2034 }, 2035 type: { 2036 type: "string", 2037 "default": "monthly" 2038 } 2039 }, 2040 supports: { 2041 align: true, 2042 html: false, 2043 spacing: { 2044 margin: true, 2045 padding: true, 2046 __experimentalDefaultControls: { 2047 margin: false, 2048 padding: false 2049 } 2050 }, 2051 typography: { 2052 fontSize: true, 2053 lineHeight: true, 2054 __experimentalFontFamily: true, 2055 __experimentalFontWeight: true, 2056 __experimentalFontStyle: true, 2057 __experimentalTextTransform: true, 2058 __experimentalTextDecoration: true, 2059 __experimentalLetterSpacing: true, 2060 __experimentalDefaultControls: { 2061 fontSize: true 2062 } 2063 }, 2064 interactivity: { 2065 clientNavigation: true 2066 } 2067 }, 2068 editorStyle: "wp-block-archives-editor" 2069 }; 2070 2071 const { 2072 name: archives_name 2073 } = metadata; 2074 2075 const settings = { 2076 icon: library_archive, 2077 example: {}, 2078 edit: ArchivesEdit 2079 }; 2080 const init = () => initBlock({ 2081 name: archives_name, 2082 metadata, 2083 settings 2084 }); 2085 2086 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js 2087 2088 /** 2089 * WordPress dependencies 2090 */ 2091 2092 const commentAuthorAvatar = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 2093 xmlns: "http://www.w3.org/2000/svg", 2094 viewBox: "0 0 24 24" 2095 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 2096 fillRule: "evenodd", 2097 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", 2098 clipRule: "evenodd" 2099 })); 2100 /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); 2101 2102 // EXTERNAL MODULE: ./node_modules/classnames/index.js 2103 var classnames = __webpack_require__(5755); 2104 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 2105 ;// CONCATENATED MODULE: external ["wp","url"] 2106 const external_wp_url_namespaceObject = window["wp"]["url"]; 2107 ;// CONCATENATED MODULE: external ["wp","coreData"] 2108 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; 2109 ;// CONCATENATED MODULE: external ["wp","data"] 2110 const external_wp_data_namespaceObject = window["wp"]["data"]; 2111 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js 2112 /** 2113 * WordPress dependencies 2114 */ 2115 2116 2117 2118 2119 function getAvatarSizes(sizes) { 2120 const minSize = sizes ? sizes[0] : 24; 2121 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 2122 const maxSizeBuffer = Math.floor(maxSize * 2.5); 2123 return { 2124 minSize, 2125 maxSize: maxSizeBuffer 2126 }; 2127 } 2128 function useDefaultAvatar() { 2129 const { 2130 avatarURL: defaultAvatarUrl 2131 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 2132 const { 2133 getSettings 2134 } = select(external_wp_blockEditor_namespaceObject.store); 2135 const { 2136 __experimentalDiscussionSettings 2137 } = getSettings(); 2138 return __experimentalDiscussionSettings; 2139 }); 2140 return defaultAvatarUrl; 2141 } 2142 function useCommentAvatar({ 2143 commentId 2144 }) { 2145 const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); 2146 const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); 2147 const avatarUrls = avatars ? Object.values(avatars) : null; 2148 const sizes = avatars ? Object.keys(avatars) : null; 2149 const { 2150 minSize, 2151 maxSize 2152 } = getAvatarSizes(sizes); 2153 const defaultAvatar = useDefaultAvatar(); 2154 return { 2155 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 2156 minSize, 2157 maxSize, 2158 // translators: %s is the Author name. 2159 alt: authorName ? 2160 // translators: %s is the Author name. 2161 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') 2162 }; 2163 } 2164 function useUserAvatar({ 2165 userId, 2166 postId, 2167 postType 2168 }) { 2169 const { 2170 authorDetails 2171 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 2172 const { 2173 getEditedEntityRecord, 2174 getUser 2175 } = select(external_wp_coreData_namespaceObject.store); 2176 if (userId) { 2177 return { 2178 authorDetails: getUser(userId) 2179 }; 2180 } 2181 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 2182 return { 2183 authorDetails: _authorId ? getUser(_authorId) : null 2184 }; 2185 }, [postType, postId, userId]); 2186 const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; 2187 const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; 2188 const { 2189 minSize, 2190 maxSize 2191 } = getAvatarSizes(sizes); 2192 const defaultAvatar = useDefaultAvatar(); 2193 return { 2194 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 2195 minSize, 2196 maxSize, 2197 alt: authorDetails ? 2198 // translators: %s is the Author name. 2199 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails?.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') 2200 }; 2201 } 2202 2203 ;// CONCATENATED MODULE: external ["wp","element"] 2204 const external_wp_element_namespaceObject = window["wp"]["element"]; 2205 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js 2206 2207 /** 2208 * WordPress dependencies 2209 */ 2210 2211 2212 2213 2214 2215 const AUTHORS_QUERY = { 2216 who: 'authors', 2217 per_page: -1, 2218 _fields: 'id,name', 2219 context: 'view' 2220 }; 2221 function UserControl({ 2222 value, 2223 onChange 2224 }) { 2225 const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)(); 2226 const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { 2227 const { 2228 getUsers 2229 } = select(external_wp_coreData_namespaceObject.store); 2230 return getUsers(AUTHORS_QUERY); 2231 }, []); 2232 if (!authorsList) { 2233 return null; 2234 } 2235 const options = authorsList.map(author => { 2236 return { 2237 label: author.name, 2238 value: author.id 2239 }; 2240 }); 2241 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { 2242 __nextHasNoMarginBottom: true, 2243 label: (0,external_wp_i18n_namespaceObject.__)('User'), 2244 help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'), 2245 value: value, 2246 onChange: onChange, 2247 options: filteredAuthorsList || options, 2248 onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase()))) 2249 }); 2250 } 2251 /* harmony default export */ const user_control = (UserControl); 2252 2253 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js 2254 2255 /** 2256 * External dependencies 2257 */ 2258 2259 2260 /** 2261 * WordPress dependencies 2262 */ 2263 2264 2265 2266 2267 2268 /** 2269 * Internal dependencies 2270 */ 2271 2272 2273 const AvatarInspectorControls = ({ 2274 setAttributes, 2275 avatar, 2276 attributes, 2277 selectUser 2278 }) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 2279 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 2280 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 2281 __nextHasNoMarginBottom: true, 2282 __next40pxDefaultSize: true, 2283 label: (0,external_wp_i18n_namespaceObject.__)('Image size'), 2284 onChange: newSize => setAttributes({ 2285 size: newSize 2286 }), 2287 min: avatar.minSize, 2288 max: avatar.maxSize, 2289 initialPosition: attributes?.size, 2290 value: attributes?.size 2291 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 2292 __nextHasNoMarginBottom: true, 2293 label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'), 2294 onChange: () => setAttributes({ 2295 isLink: !attributes.isLink 2296 }), 2297 checked: attributes.isLink 2298 }), attributes.isLink && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 2299 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 2300 onChange: value => setAttributes({ 2301 linkTarget: value ? '_blank' : '_self' 2302 }), 2303 checked: attributes.linkTarget === '_blank' 2304 }), selectUser && (0,external_React_namespaceObject.createElement)(user_control, { 2305 value: attributes?.userId, 2306 onChange: value => { 2307 setAttributes({ 2308 userId: value 2309 }); 2310 } 2311 }))); 2312 const ResizableAvatar = ({ 2313 setAttributes, 2314 attributes, 2315 avatar, 2316 blockProps, 2317 isSelected 2318 }) => { 2319 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 2320 const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar?.src, ['s']), { 2321 s: attributes?.size * 2 2322 }); 2323 return (0,external_React_namespaceObject.createElement)("div", { 2324 ...blockProps 2325 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 2326 size: { 2327 width: attributes.size, 2328 height: attributes.size 2329 }, 2330 showHandle: isSelected, 2331 onResizeStop: (event, direction, elt, delta) => { 2332 setAttributes({ 2333 size: parseInt(attributes.size + (delta.height || delta.width), 10) 2334 }); 2335 }, 2336 lockAspectRatio: true, 2337 enable: { 2338 top: false, 2339 right: !(0,external_wp_i18n_namespaceObject.isRTL)(), 2340 bottom: true, 2341 left: (0,external_wp_i18n_namespaceObject.isRTL)() 2342 }, 2343 minWidth: avatar.minSize, 2344 maxWidth: avatar.maxSize 2345 }, (0,external_React_namespaceObject.createElement)("img", { 2346 src: doubledSizedSrc, 2347 alt: avatar.alt, 2348 className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className), 2349 style: borderProps.style 2350 }))); 2351 }; 2352 const CommentEdit = ({ 2353 attributes, 2354 context, 2355 setAttributes, 2356 isSelected 2357 }) => { 2358 const { 2359 commentId 2360 } = context; 2361 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 2362 const avatar = useCommentAvatar({ 2363 commentId 2364 }); 2365 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(AvatarInspectorControls, { 2366 avatar: avatar, 2367 setAttributes: setAttributes, 2368 attributes: attributes, 2369 selectUser: false 2370 }), attributes.isLink ? (0,external_React_namespaceObject.createElement)("a", { 2371 href: "#avatar-pseudo-link", 2372 className: "wp-block-avatar__link", 2373 onClick: event => event.preventDefault() 2374 }, (0,external_React_namespaceObject.createElement)(ResizableAvatar, { 2375 attributes: attributes, 2376 avatar: avatar, 2377 blockProps: blockProps, 2378 isSelected: isSelected, 2379 setAttributes: setAttributes 2380 })) : (0,external_React_namespaceObject.createElement)(ResizableAvatar, { 2381 attributes: attributes, 2382 avatar: avatar, 2383 blockProps: blockProps, 2384 isSelected: isSelected, 2385 setAttributes: setAttributes 2386 })); 2387 }; 2388 const UserEdit = ({ 2389 attributes, 2390 context, 2391 setAttributes, 2392 isSelected 2393 }) => { 2394 const { 2395 postId, 2396 postType 2397 } = context; 2398 const avatar = useUserAvatar({ 2399 userId: attributes?.userId, 2400 postId, 2401 postType 2402 }); 2403 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 2404 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(AvatarInspectorControls, { 2405 selectUser: true, 2406 attributes: attributes, 2407 avatar: avatar, 2408 setAttributes: setAttributes 2409 }), attributes.isLink ? (0,external_React_namespaceObject.createElement)("a", { 2410 href: "#avatar-pseudo-link", 2411 className: "wp-block-avatar__link", 2412 onClick: event => event.preventDefault() 2413 }, (0,external_React_namespaceObject.createElement)(ResizableAvatar, { 2414 attributes: attributes, 2415 avatar: avatar, 2416 blockProps: blockProps, 2417 isSelected: isSelected, 2418 setAttributes: setAttributes 2419 })) : (0,external_React_namespaceObject.createElement)(ResizableAvatar, { 2420 attributes: attributes, 2421 avatar: avatar, 2422 blockProps: blockProps, 2423 isSelected: isSelected, 2424 setAttributes: setAttributes 2425 })); 2426 }; 2427 function Edit(props) { 2428 // 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`). 2429 if (props?.context?.commentId || props?.context?.commentId === null) { 2430 return (0,external_React_namespaceObject.createElement)(CommentEdit, { 2431 ...props 2432 }); 2433 } 2434 return (0,external_React_namespaceObject.createElement)(UserEdit, { 2435 ...props 2436 }); 2437 } 2438 2439 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js 2440 /** 2441 * WordPress dependencies 2442 */ 2443 2444 2445 /** 2446 * Internal dependencies 2447 */ 2448 2449 const avatar_metadata = { 2450 $schema: "https://schemas.wp.org/trunk/block.json", 2451 apiVersion: 3, 2452 name: "core/avatar", 2453 title: "Avatar", 2454 category: "theme", 2455 description: "Add a user\u2019s avatar.", 2456 textdomain: "default", 2457 attributes: { 2458 userId: { 2459 type: "number" 2460 }, 2461 size: { 2462 type: "number", 2463 "default": 96 2464 }, 2465 isLink: { 2466 type: "boolean", 2467 "default": false 2468 }, 2469 linkTarget: { 2470 type: "string", 2471 "default": "_self" 2472 } 2473 }, 2474 usesContext: ["postType", "postId", "commentId"], 2475 supports: { 2476 html: false, 2477 align: true, 2478 alignWide: false, 2479 spacing: { 2480 margin: true, 2481 padding: true, 2482 __experimentalDefaultControls: { 2483 margin: false, 2484 padding: false 2485 } 2486 }, 2487 __experimentalBorder: { 2488 __experimentalSkipSerialization: true, 2489 radius: true, 2490 width: true, 2491 color: true, 2492 style: true, 2493 __experimentalDefaultControls: { 2494 radius: true 2495 } 2496 }, 2497 color: { 2498 text: false, 2499 background: false, 2500 __experimentalDuotone: "img" 2501 }, 2502 interactivity: { 2503 clientNavigation: true 2504 } 2505 }, 2506 selectors: { 2507 border: ".wp-block-avatar img" 2508 }, 2509 editorStyle: "wp-block-avatar-editor", 2510 style: "wp-block-avatar" 2511 }; 2512 2513 const { 2514 name: avatar_name 2515 } = avatar_metadata; 2516 2517 const avatar_settings = { 2518 icon: comment_author_avatar, 2519 edit: Edit 2520 }; 2521 const avatar_init = () => initBlock({ 2522 name: avatar_name, 2523 metadata: avatar_metadata, 2524 settings: avatar_settings 2525 }); 2526 2527 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js 2528 2529 /** 2530 * WordPress dependencies 2531 */ 2532 2533 const audio = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 2534 viewBox: "0 0 24 24", 2535 xmlns: "http://www.w3.org/2000/svg" 2536 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 2537 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" 2538 })); 2539 /* harmony default export */ const library_audio = (audio); 2540 2541 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js 2542 2543 /** 2544 * WordPress dependencies 2545 */ 2546 2547 /* harmony default export */ const deprecated = ([{ 2548 attributes: { 2549 src: { 2550 type: 'string', 2551 source: 'attribute', 2552 selector: 'audio', 2553 attribute: 'src' 2554 }, 2555 caption: { 2556 type: 'string', 2557 source: 'html', 2558 selector: 'figcaption' 2559 }, 2560 id: { 2561 type: 'number' 2562 }, 2563 autoplay: { 2564 type: 'boolean', 2565 source: 'attribute', 2566 selector: 'audio', 2567 attribute: 'autoplay' 2568 }, 2569 loop: { 2570 type: 'boolean', 2571 source: 'attribute', 2572 selector: 'audio', 2573 attribute: 'loop' 2574 }, 2575 preload: { 2576 type: 'string', 2577 source: 'attribute', 2578 selector: 'audio', 2579 attribute: 'preload' 2580 } 2581 }, 2582 supports: { 2583 align: true 2584 }, 2585 save({ 2586 attributes 2587 }) { 2588 const { 2589 autoplay, 2590 caption, 2591 loop, 2592 preload, 2593 src 2594 } = attributes; 2595 return (0,external_React_namespaceObject.createElement)("figure", null, (0,external_React_namespaceObject.createElement)("audio", { 2596 controls: "controls", 2597 src: src, 2598 autoPlay: autoplay, 2599 loop: loop, 2600 preload: preload 2601 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 2602 tagName: "figcaption", 2603 value: caption 2604 })); 2605 } 2606 }]); 2607 2608 ;// CONCATENATED MODULE: external ["wp","blob"] 2609 const external_wp_blob_namespaceObject = window["wp"]["blob"]; 2610 ;// CONCATENATED MODULE: external ["wp","notices"] 2611 const external_wp_notices_namespaceObject = window["wp"]["notices"]; 2612 // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js 2613 var dedupe = __webpack_require__(1668); 2614 var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe); 2615 ;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js 2616 /** 2617 * Memize options object. 2618 * 2619 * @typedef MemizeOptions 2620 * 2621 * @property {number} [maxSize] Maximum size of the cache. 2622 */ 2623 2624 /** 2625 * Internal cache entry. 2626 * 2627 * @typedef MemizeCacheNode 2628 * 2629 * @property {?MemizeCacheNode|undefined} [prev] Previous node. 2630 * @property {?MemizeCacheNode|undefined} [next] Next node. 2631 * @property {Array<*>} args Function arguments for cache 2632 * entry. 2633 * @property {*} val Function result. 2634 */ 2635 2636 /** 2637 * Properties of the enhanced function for controlling cache. 2638 * 2639 * @typedef MemizeMemoizedFunction 2640 * 2641 * @property {()=>void} clear Clear the cache. 2642 */ 2643 2644 /** 2645 * Accepts a function to be memoized, and returns a new memoized function, with 2646 * optional options. 2647 * 2648 * @template {(...args: any[]) => any} F 2649 * 2650 * @param {F} fn Function to memoize. 2651 * @param {MemizeOptions} [options] Options object. 2652 * 2653 * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. 2654 */ 2655 function memize(fn, options) { 2656 var size = 0; 2657 2658 /** @type {?MemizeCacheNode|undefined} */ 2659 var head; 2660 2661 /** @type {?MemizeCacheNode|undefined} */ 2662 var tail; 2663 2664 options = options || {}; 2665 2666 function memoized(/* ...args */) { 2667 var node = head, 2668 len = arguments.length, 2669 args, 2670 i; 2671 2672 searchCache: while (node) { 2673 // Perform a shallow equality test to confirm that whether the node 2674 // under test is a candidate for the arguments passed. Two arrays 2675 // are shallowly equal if their length matches and each entry is 2676 // strictly equal between the two sets. Avoid abstracting to a 2677 // function which could incur an arguments leaking deoptimization. 2678 2679 // Check whether node arguments match arguments length 2680 if (node.args.length !== arguments.length) { 2681 node = node.next; 2682 continue; 2683 } 2684 2685 // Check whether node arguments match arguments values 2686 for (i = 0; i < len; i++) { 2687 if (node.args[i] !== arguments[i]) { 2688 node = node.next; 2689 continue searchCache; 2690 } 2691 } 2692 2693 // At this point we can assume we've found a match 2694 2695 // Surface matched node to head if not already 2696 if (node !== head) { 2697 // As tail, shift to previous. Must only shift if not also 2698 // head, since if both head and tail, there is no previous. 2699 if (node === tail) { 2700 tail = node.prev; 2701 } 2702 2703 // Adjust siblings to point to each other. If node was tail, 2704 // this also handles new tail's empty `next` assignment. 2705 /** @type {MemizeCacheNode} */ (node.prev).next = node.next; 2706 if (node.next) { 2707 node.next.prev = node.prev; 2708 } 2709 2710 node.next = head; 2711 node.prev = null; 2712 /** @type {MemizeCacheNode} */ (head).prev = node; 2713 head = node; 2714 } 2715 2716 // Return immediately 2717 return node.val; 2718 } 2719 2720 // No cached value found. Continue to insertion phase: 2721 2722 // Create a copy of arguments (avoid leaking deoptimization) 2723 args = new Array(len); 2724 for (i = 0; i < len; i++) { 2725 args[i] = arguments[i]; 2726 } 2727 2728 node = { 2729 args: args, 2730 2731 // Generate the result from original function 2732 val: fn.apply(null, args), 2733 }; 2734 2735 // Don't need to check whether node is already head, since it would 2736 // have been returned above already if it was 2737 2738 // Shift existing head down list 2739 if (head) { 2740 head.prev = node; 2741 node.next = head; 2742 } else { 2743 // If no head, follows that there's no tail (at initial or reset) 2744 tail = node; 2745 } 2746 2747 // Trim tail if we're reached max size and are pending cache insertion 2748 if (size === /** @type {MemizeOptions} */ (options).maxSize) { 2749 tail = /** @type {MemizeCacheNode} */ (tail).prev; 2750 /** @type {MemizeCacheNode} */ (tail).next = null; 2751 } else { 2752 size++; 2753 } 2754 2755 head = node; 2756 2757 return node.val; 2758 } 2759 2760 memoized.clear = function () { 2761 head = null; 2762 tail = null; 2763 size = 0; 2764 }; 2765 2766 // Ignore reason: There's not a clear solution to create an intersection of 2767 // the function with additional properties, where the goal is to retain the 2768 // function signature of the incoming argument and add control properties 2769 // on the return value. 2770 2771 // @ts-ignore 2772 return memoized; 2773 } 2774 2775 2776 2777 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js 2778 const ASPECT_RATIOS = [ 2779 // Common video resolutions. 2780 { 2781 ratio: '2.33', 2782 className: 'wp-embed-aspect-21-9' 2783 }, { 2784 ratio: '2.00', 2785 className: 'wp-embed-aspect-18-9' 2786 }, { 2787 ratio: '1.78', 2788 className: 'wp-embed-aspect-16-9' 2789 }, { 2790 ratio: '1.33', 2791 className: 'wp-embed-aspect-4-3' 2792 }, 2793 // Vertical video and instagram square video support. 2794 { 2795 ratio: '1.00', 2796 className: 'wp-embed-aspect-1-1' 2797 }, { 2798 ratio: '0.56', 2799 className: 'wp-embed-aspect-9-16' 2800 }, { 2801 ratio: '0.50', 2802 className: 'wp-embed-aspect-1-2' 2803 }]; 2804 const WP_EMBED_TYPE = 'wp-embed'; 2805 2806 ;// CONCATENATED MODULE: external ["wp","privateApis"] 2807 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 2808 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/lock-unlock.js 2809 /** 2810 * WordPress dependencies 2811 */ 2812 2813 const { 2814 lock, 2815 unlock 2816 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/block-library'); 2817 2818 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js 2819 2820 /** 2821 * External dependencies 2822 */ 2823 2824 2825 2826 /** 2827 * WordPress dependencies 2828 */ 2829 2830 2831 2832 2833 /** 2834 * Internal dependencies 2835 */ 2836 const util_metadata = { 2837 $schema: "https://schemas.wp.org/trunk/block.json", 2838 apiVersion: 3, 2839 name: "core/embed", 2840 title: "Embed", 2841 category: "embed", 2842 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 2843 textdomain: "default", 2844 attributes: { 2845 url: { 2846 type: "string", 2847 __experimentalRole: "content" 2848 }, 2849 caption: { 2850 type: "rich-text", 2851 source: "rich-text", 2852 selector: "figcaption", 2853 __experimentalRole: "content" 2854 }, 2855 type: { 2856 type: "string", 2857 __experimentalRole: "content" 2858 }, 2859 providerNameSlug: { 2860 type: "string", 2861 __experimentalRole: "content" 2862 }, 2863 allowResponsive: { 2864 type: "boolean", 2865 "default": true 2866 }, 2867 responsive: { 2868 type: "boolean", 2869 "default": false, 2870 __experimentalRole: "content" 2871 }, 2872 previewable: { 2873 type: "boolean", 2874 "default": true, 2875 __experimentalRole: "content" 2876 } 2877 }, 2878 supports: { 2879 align: true, 2880 spacing: { 2881 margin: true 2882 }, 2883 interactivity: { 2884 clientNavigation: true 2885 } 2886 }, 2887 editorStyle: "wp-block-embed-editor", 2888 style: "wp-block-embed" 2889 }; 2890 2891 2892 const { 2893 name: DEFAULT_EMBED_BLOCK 2894 } = util_metadata; 2895 2896 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 2897 2898 /** 2899 * Returns the embed block's information by matching the provided service provider 2900 * 2901 * @param {string} provider The embed block's provider 2902 * @return {WPBlockVariation} The embed block's information 2903 */ 2904 const getEmbedInfoByProvider = provider => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2905 name 2906 }) => name === provider); 2907 2908 /** 2909 * Returns true if any of the regular expressions match the URL. 2910 * 2911 * @param {string} url The URL to test. 2912 * @param {Array} patterns The list of regular expressions to test agains. 2913 * @return {boolean} True if any of the regular expressions match the URL. 2914 */ 2915 const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern)); 2916 2917 /** 2918 * Finds the block variation that should be used for the URL, 2919 * based on the provided URL and the variation's patterns. 2920 * 2921 * @param {string} url The URL to test. 2922 * @return {WPBlockVariation} The block variation that should be used for this URL 2923 */ 2924 const findMoreSuitableBlock = url => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2925 patterns 2926 }) => matchesPatterns(url, patterns)); 2927 const isFromWordPress = html => html && html.includes('class="wp-embedded-content"'); 2928 const getPhotoHtml = photo => { 2929 // If full image url not found use thumbnail. 2930 const imageUrl = photo.url || photo.thumbnail_url; 2931 2932 // 100% width for the preview so it fits nicely into the document, some "thumbnails" are 2933 // actually the full size photo. 2934 const photoPreview = (0,external_React_namespaceObject.createElement)("p", null, (0,external_React_namespaceObject.createElement)("img", { 2935 src: imageUrl, 2936 alt: photo.title, 2937 width: "100%" 2938 })); 2939 return (0,external_wp_element_namespaceObject.renderToString)(photoPreview); 2940 }; 2941 2942 /** 2943 * Creates a more suitable embed block based on the passed in props 2944 * and attributes generated from an embed block's preview. 2945 * 2946 * We require `attributesFromPreview` to be generated from the latest attributes 2947 * and preview, and because of the way the react lifecycle operates, we can't 2948 * guarantee that the attributes contained in the block's props are the latest 2949 * versions, so we require that these are generated separately. 2950 * See `getAttributesFromPreview` in the generated embed edit component. 2951 * 2952 * @param {Object} props The block's props. 2953 * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. 2954 * @return {Object|undefined} A more suitable embed block if one exists. 2955 */ 2956 const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { 2957 const { 2958 preview, 2959 attributes = {} 2960 } = props; 2961 const { 2962 url, 2963 providerNameSlug, 2964 type, 2965 ...restAttributes 2966 } = attributes; 2967 if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return; 2968 const matchedBlock = findMoreSuitableBlock(url); 2969 2970 // WordPress blocks can work on multiple sites, and so don't have patterns, 2971 // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. 2972 const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; 2973 // If current block is not WordPress and a more suitable block found 2974 // that is different from the current one, create the new matched block. 2975 const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 2976 if (shouldCreateNewBlock) { 2977 return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { 2978 url, 2979 ...restAttributes, 2980 ...matchedBlock.attributes 2981 }); 2982 } 2983 const wpVariation = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2984 name 2985 }) => name === 'wordpress'); 2986 2987 // We can't match the URL for WordPress embeds, we have to check the HTML instead. 2988 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 2989 return; 2990 } 2991 2992 // This is not the WordPress embed block so transform it into one. 2993 return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { 2994 url, 2995 ...wpVariation.attributes, 2996 // By now we have the preview, but when the new block first renders, it 2997 // won't have had all the attributes set, and so won't get the correct 2998 // type and it won't render correctly. So, we pass through the current attributes 2999 // here so that the initial render works when we switch to the WordPress 3000 // block. This only affects the WordPress block because it can't be 3001 // rendered in the usual Sandbox (it has a sandbox of its own) and it 3002 // relies on the preview to set the correct render type. 3003 ...attributesFromPreview 3004 }); 3005 }; 3006 3007 /** 3008 * Determine if the block already has an aspect ratio class applied. 3009 * 3010 * @param {string} existingClassNames Existing block classes. 3011 * @return {boolean} True or false if the classnames contain an aspect ratio class. 3012 */ 3013 const hasAspectRatioClass = existingClassNames => { 3014 if (!existingClassNames) { 3015 return false; 3016 } 3017 return ASPECT_RATIOS.some(({ 3018 className 3019 }) => existingClassNames.includes(className)); 3020 }; 3021 3022 /** 3023 * Removes all previously set aspect ratio related classes and return the rest 3024 * existing class names. 3025 * 3026 * @param {string} existingClassNames Any existing class names. 3027 * @return {string} The class names without any aspect ratio related class. 3028 */ 3029 const removeAspectRatioClasses = existingClassNames => { 3030 if (!existingClassNames) { 3031 // Avoids extraneous work and also, by returning the same value as 3032 // received, ensures the post is not dirtied by a change of the block 3033 // attribute from `undefined` to an emtpy string. 3034 return existingClassNames; 3035 } 3036 const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, { 3037 className 3038 }) => { 3039 accumulator[className] = false; 3040 return accumulator; 3041 }, { 3042 'wp-has-aspect-ratio': false 3043 }); 3044 return dedupe_default()(existingClassNames, aspectRatioClassNames); 3045 }; 3046 3047 /** 3048 * Returns class names with any relevant responsive aspect ratio names. 3049 * 3050 * @param {string} html The preview HTML that possibly contains an iframe with width and height set. 3051 * @param {string} existingClassNames Any existing class names. 3052 * @param {boolean} allowResponsive If the responsive class names should be added, or removed. 3053 * @return {string} Deduped class names. 3054 */ 3055 function getClassNames(html, existingClassNames, allowResponsive = true) { 3056 if (!allowResponsive) { 3057 return removeAspectRatioClasses(existingClassNames); 3058 } 3059 const previewDocument = document.implementation.createHTMLDocument(''); 3060 previewDocument.body.innerHTML = html; 3061 const iframe = previewDocument.body.querySelector('iframe'); 3062 3063 // If we have a fixed aspect iframe, and it's a responsive embed block. 3064 if (iframe && iframe.height && iframe.width) { 3065 const aspectRatio = (iframe.width / iframe.height).toFixed(2); 3066 // Given the actual aspect ratio, find the widest ratio to support it. 3067 for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 3068 const potentialRatio = ASPECT_RATIOS[ratioIndex]; 3069 if (aspectRatio >= potentialRatio.ratio) { 3070 // Evaluate the difference between actual aspect ratio and closest match. 3071 // If the difference is too big, do not scale the embed according to aspect ratio. 3072 const ratioDiff = aspectRatio - potentialRatio.ratio; 3073 if (ratioDiff > 0.1) { 3074 // No close aspect ratio match found. 3075 return removeAspectRatioClasses(existingClassNames); 3076 } 3077 // Close aspect ratio match found. 3078 return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); 3079 } 3080 } 3081 } 3082 return existingClassNames; 3083 } 3084 3085 /** 3086 * Fallback behaviour for unembeddable URLs. 3087 * Creates a paragraph block containing a link to the URL, and calls `onReplace`. 3088 * 3089 * @param {string} url The URL that could not be embedded. 3090 * @param {Function} onReplace Function to call with the created fallback block. 3091 */ 3092 function fallback(url, onReplace) { 3093 const link = (0,external_React_namespaceObject.createElement)("a", { 3094 href: url 3095 }, url); 3096 onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 3097 content: (0,external_wp_element_namespaceObject.renderToString)(link) 3098 })); 3099 } 3100 3101 /*** 3102 * Gets block attributes based on the preview and responsive state. 3103 * 3104 * @param {Object} preview The preview data. 3105 * @param {string} title The block's title, e.g. Twitter. 3106 * @param {Object} currentClassNames The block's current class names. 3107 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3108 * @param {boolean} allowResponsive Apply responsive classes to fixed size content. 3109 * @return {Object} Attributes and values. 3110 */ 3111 const getAttributesFromPreview = memize((preview, title, currentClassNames, isResponsive, allowResponsive = true) => { 3112 if (!preview) { 3113 return {}; 3114 } 3115 const attributes = {}; 3116 // Some plugins only return HTML with no type info, so default this to 'rich'. 3117 let { 3118 type = 'rich' 3119 } = preview; 3120 // If we got a provider name from the API, use it for the slug, otherwise we use the title, 3121 // because not all embed code gives us a provider name. 3122 const { 3123 html, 3124 provider_name: providerName 3125 } = preview; 3126 const { 3127 kebabCase 3128 } = unlock(external_wp_components_namespaceObject.privateApis); 3129 const providerNameSlug = kebabCase((providerName || title).toLowerCase()); 3130 if (isFromWordPress(html)) { 3131 type = WP_EMBED_TYPE; 3132 } 3133 if (html || 'photo' === type) { 3134 attributes.type = type; 3135 attributes.providerNameSlug = providerNameSlug; 3136 } 3137 3138 // Aspect ratio classes are removed when the embed URL is updated. 3139 // If the embed already has an aspect ratio class, that means the URL has not changed. 3140 // Which also means no need to regenerate it with getClassNames. 3141 if (hasAspectRatioClass(currentClassNames)) { 3142 return attributes; 3143 } 3144 attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); 3145 return attributes; 3146 }); 3147 3148 /** 3149 * Returns the attributes derived from the preview, merged with the current attributes. 3150 * 3151 * @param {Object} currentAttributes The current attributes of the block. 3152 * @param {Object} preview The preview data. 3153 * @param {string} title The block's title, e.g. Twitter. 3154 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3155 * @return {Object} Merged attributes. 3156 */ 3157 const getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { 3158 const { 3159 allowResponsive, 3160 className 3161 } = currentAttributes; 3162 return { 3163 ...currentAttributes, 3164 ...getAttributesFromPreview(preview, title, className, isResponsive, allowResponsive) 3165 }; 3166 }; 3167 3168 ;// CONCATENATED MODULE: external ["wp","compose"] 3169 const external_wp_compose_namespaceObject = window["wp"]["compose"]; 3170 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/caption.js 3171 3172 /** 3173 * WordPress dependencies 3174 */ 3175 3176 const caption = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 3177 viewBox: "0 0 24 24", 3178 xmlns: "http://www.w3.org/2000/svg" 3179 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 3180 fillRule: "evenodd", 3181 clipRule: "evenodd", 3182 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" 3183 })); 3184 /* harmony default export */ const library_caption = (caption); 3185 3186 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/caption.js 3187 3188 /** 3189 * External dependencies 3190 */ 3191 3192 3193 /** 3194 * WordPress dependencies 3195 */ 3196 3197 3198 3199 3200 3201 3202 3203 3204 /** 3205 * Internal dependencies 3206 */ 3207 3208 const { 3209 PrivateRichText: RichText 3210 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 3211 function Caption({ 3212 key = 'caption', 3213 attributes, 3214 setAttributes, 3215 isSelected, 3216 insertBlocksAfter, 3217 placeholder = (0,external_wp_i18n_namespaceObject.__)('Add caption'), 3218 label = (0,external_wp_i18n_namespaceObject.__)('Caption text'), 3219 showToolbarButton = true, 3220 className, 3221 disableEditing 3222 }) { 3223 const caption = attributes[key]; 3224 const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption); 3225 const isCaptionEmpty = RichText.isEmpty(caption); 3226 const isPrevCaptionEmpty = RichText.isEmpty(prevCaption); 3227 const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!isCaptionEmpty); 3228 3229 // We need to show the caption when changes come from 3230 // history navigation(undo/redo). 3231 (0,external_wp_element_namespaceObject.useEffect)(() => { 3232 if (!isCaptionEmpty && isPrevCaptionEmpty) { 3233 setShowCaption(true); 3234 } 3235 }, [isCaptionEmpty, isPrevCaptionEmpty]); 3236 (0,external_wp_element_namespaceObject.useEffect)(() => { 3237 if (!isSelected && isCaptionEmpty) { 3238 setShowCaption(false); 3239 } 3240 }, [isSelected, isCaptionEmpty]); 3241 3242 // Focus the caption when we click to add one. 3243 const ref = (0,external_wp_element_namespaceObject.useCallback)(node => { 3244 if (node && isCaptionEmpty) { 3245 node.focus(); 3246 } 3247 }, [isCaptionEmpty]); 3248 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, showToolbarButton && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 3249 group: "block" 3250 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 3251 onClick: () => { 3252 setShowCaption(!showCaption); 3253 if (showCaption && caption) { 3254 setAttributes({ 3255 caption: undefined 3256 }); 3257 } 3258 }, 3259 icon: library_caption, 3260 isPressed: showCaption, 3261 label: showCaption ? (0,external_wp_i18n_namespaceObject.__)('Remove caption') : (0,external_wp_i18n_namespaceObject.__)('Add caption') 3262 })), showCaption && (!RichText.isEmpty(caption) || isSelected) && (0,external_React_namespaceObject.createElement)(RichText, { 3263 identifier: key, 3264 tagName: "figcaption", 3265 className: classnames_default()(className, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 3266 ref: ref, 3267 "aria-label": label, 3268 placeholder: placeholder, 3269 value: caption, 3270 onChange: value => setAttributes({ 3271 caption: value 3272 }), 3273 inlineToolbar: true, 3274 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 3275 disableEditing: disableEditing 3276 })); 3277 } 3278 3279 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js 3280 3281 /** 3282 * External dependencies 3283 */ 3284 3285 3286 /** 3287 * WordPress dependencies 3288 */ 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 /** 3299 * Internal dependencies 3300 */ 3301 3302 3303 const ALLOWED_MEDIA_TYPES = ['audio']; 3304 function AudioEdit({ 3305 attributes, 3306 className, 3307 setAttributes, 3308 onReplace, 3309 isSelected: isSingleSelected, 3310 insertBlocksAfter 3311 }) { 3312 const { 3313 id, 3314 autoplay, 3315 loop, 3316 preload, 3317 src 3318 } = attributes; 3319 const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src); 3320 const { 3321 getSettings 3322 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 3323 (0,external_wp_element_namespaceObject.useEffect)(() => { 3324 if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) { 3325 const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src); 3326 if (file) { 3327 getSettings().mediaUpload({ 3328 filesList: [file], 3329 onFileChange: ([media]) => onSelectAudio(media), 3330 onError: e => onUploadError(e), 3331 allowedTypes: ALLOWED_MEDIA_TYPES 3332 }); 3333 } 3334 } 3335 }, []); 3336 function toggleAttribute(attribute) { 3337 return newValue => { 3338 setAttributes({ 3339 [attribute]: newValue 3340 }); 3341 }; 3342 } 3343 function onSelectURL(newSrc) { 3344 // Set the block's src from the edit component's state, and switch off 3345 // the editing UI. 3346 if (newSrc !== src) { 3347 // Check if there's an embed block that handles this URL. 3348 const embedBlock = createUpgradedEmbedBlock({ 3349 attributes: { 3350 url: newSrc 3351 } 3352 }); 3353 if (undefined !== embedBlock && onReplace) { 3354 onReplace(embedBlock); 3355 return; 3356 } 3357 setAttributes({ 3358 src: newSrc, 3359 id: undefined 3360 }); 3361 } 3362 } 3363 const { 3364 createErrorNotice 3365 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 3366 function onUploadError(message) { 3367 createErrorNotice(message, { 3368 type: 'snackbar' 3369 }); 3370 } 3371 function getAutoplayHelp(checked) { 3372 return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null; 3373 } 3374 function onSelectAudio(media) { 3375 if (!media || !media.url) { 3376 // In this case there was an error and we should continue in the editing state 3377 // previous attributes should be removed because they may be temporary blob urls. 3378 setAttributes({ 3379 src: undefined, 3380 id: undefined, 3381 caption: undefined 3382 }); 3383 return; 3384 } 3385 // Sets the block's attribute and updates the edit component from the 3386 // selected media, then switches off the editing UI. 3387 setAttributes({ 3388 src: media.url, 3389 id: media.id, 3390 caption: media.caption 3391 }); 3392 } 3393 const classes = classnames_default()(className, { 3394 'is-transient': isTemporaryAudio 3395 }); 3396 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 3397 className: classes 3398 }); 3399 if (!src) { 3400 return (0,external_React_namespaceObject.createElement)("div", { 3401 ...blockProps 3402 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 3403 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 3404 icon: library_audio 3405 }), 3406 onSelect: onSelectAudio, 3407 onSelectURL: onSelectURL, 3408 accept: "audio/*", 3409 allowedTypes: ALLOWED_MEDIA_TYPES, 3410 value: attributes, 3411 onError: onUploadError 3412 })); 3413 } 3414 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isSingleSelected && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 3415 group: "other" 3416 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 3417 mediaId: id, 3418 mediaURL: src, 3419 allowedTypes: ALLOWED_MEDIA_TYPES, 3420 accept: "audio/*", 3421 onSelect: onSelectAudio, 3422 onSelectURL: onSelectURL, 3423 onError: onUploadError 3424 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 3425 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 3426 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 3427 __nextHasNoMarginBottom: true, 3428 label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), 3429 onChange: toggleAttribute('autoplay'), 3430 checked: autoplay, 3431 help: getAutoplayHelp 3432 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 3433 __nextHasNoMarginBottom: true, 3434 label: (0,external_wp_i18n_namespaceObject.__)('Loop'), 3435 onChange: toggleAttribute('loop'), 3436 checked: loop 3437 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 3438 __nextHasNoMarginBottom: true, 3439 label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), 3440 value: preload || '' 3441 // `undefined` is required for the preload attribute to be unset. 3442 , 3443 onChange: value => setAttributes({ 3444 preload: value || undefined 3445 }), 3446 options: [{ 3447 value: '', 3448 label: (0,external_wp_i18n_namespaceObject.__)('Browser default') 3449 }, { 3450 value: 'auto', 3451 label: (0,external_wp_i18n_namespaceObject.__)('Auto') 3452 }, { 3453 value: 'metadata', 3454 label: (0,external_wp_i18n_namespaceObject.__)('Metadata') 3455 }, { 3456 value: 'none', 3457 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') 3458 }] 3459 }))), (0,external_React_namespaceObject.createElement)("figure", { 3460 ...blockProps 3461 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, { 3462 isDisabled: !isSingleSelected 3463 }, (0,external_React_namespaceObject.createElement)("audio", { 3464 controls: "controls", 3465 src: src 3466 })), isTemporaryAudio && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_React_namespaceObject.createElement)(Caption, { 3467 attributes: attributes, 3468 setAttributes: setAttributes, 3469 isSelected: isSingleSelected, 3470 insertBlocksAfter: insertBlocksAfter, 3471 label: (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), 3472 showToolbarButton: isSingleSelected 3473 }))); 3474 } 3475 /* harmony default export */ const edit = (AudioEdit); 3476 3477 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js 3478 3479 /** 3480 * WordPress dependencies 3481 */ 3482 3483 function save({ 3484 attributes 3485 }) { 3486 const { 3487 autoplay, 3488 caption, 3489 loop, 3490 preload, 3491 src 3492 } = attributes; 3493 return src && (0,external_React_namespaceObject.createElement)("figure", { 3494 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 3495 }, (0,external_React_namespaceObject.createElement)("audio", { 3496 controls: "controls", 3497 src: src, 3498 autoPlay: autoplay, 3499 loop: loop, 3500 preload: preload 3501 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 3502 tagName: "figcaption", 3503 value: caption, 3504 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') 3505 })); 3506 } 3507 3508 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js 3509 /** 3510 * WordPress dependencies 3511 */ 3512 3513 3514 const transforms = { 3515 from: [{ 3516 type: 'files', 3517 isMatch(files) { 3518 return files.length === 1 && files[0].type.indexOf('audio/') === 0; 3519 }, 3520 transform(files) { 3521 const file = files[0]; 3522 // We don't need to upload the media directly here 3523 // It's already done as part of the `componentDidMount` 3524 // in the audio block. 3525 const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { 3526 src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 3527 }); 3528 return block; 3529 } 3530 }, { 3531 type: 'shortcode', 3532 tag: 'audio', 3533 attributes: { 3534 src: { 3535 type: 'string', 3536 shortcode: ({ 3537 named: { 3538 src, 3539 mp3, 3540 m4a, 3541 ogg, 3542 wav, 3543 wma 3544 } 3545 }) => { 3546 return src || mp3 || m4a || ogg || wav || wma; 3547 } 3548 }, 3549 loop: { 3550 type: 'string', 3551 shortcode: ({ 3552 named: { 3553 loop 3554 } 3555 }) => { 3556 return loop; 3557 } 3558 }, 3559 autoplay: { 3560 type: 'string', 3561 shortcode: ({ 3562 named: { 3563 autoplay 3564 } 3565 }) => { 3566 return autoplay; 3567 } 3568 }, 3569 preload: { 3570 type: 'string', 3571 shortcode: ({ 3572 named: { 3573 preload 3574 } 3575 }) => { 3576 return preload; 3577 } 3578 } 3579 } 3580 }] 3581 }; 3582 /* harmony default export */ const audio_transforms = (transforms); 3583 3584 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js 3585 /** 3586 * WordPress dependencies 3587 */ 3588 3589 3590 /** 3591 * Internal dependencies 3592 */ 3593 3594 3595 3596 const audio_metadata = { 3597 $schema: "https://schemas.wp.org/trunk/block.json", 3598 apiVersion: 3, 3599 name: "core/audio", 3600 title: "Audio", 3601 category: "media", 3602 description: "Embed a simple audio player.", 3603 keywords: ["music", "sound", "podcast", "recording"], 3604 textdomain: "default", 3605 attributes: { 3606 src: { 3607 type: "string", 3608 source: "attribute", 3609 selector: "audio", 3610 attribute: "src", 3611 __experimentalRole: "content" 3612 }, 3613 caption: { 3614 type: "rich-text", 3615 source: "rich-text", 3616 selector: "figcaption", 3617 __experimentalRole: "content" 3618 }, 3619 id: { 3620 type: "number", 3621 __experimentalRole: "content" 3622 }, 3623 autoplay: { 3624 type: "boolean", 3625 source: "attribute", 3626 selector: "audio", 3627 attribute: "autoplay" 3628 }, 3629 loop: { 3630 type: "boolean", 3631 source: "attribute", 3632 selector: "audio", 3633 attribute: "loop" 3634 }, 3635 preload: { 3636 type: "string", 3637 source: "attribute", 3638 selector: "audio", 3639 attribute: "preload" 3640 } 3641 }, 3642 supports: { 3643 anchor: true, 3644 align: true, 3645 spacing: { 3646 margin: true, 3647 padding: true, 3648 __experimentalDefaultControls: { 3649 margin: false, 3650 padding: false 3651 } 3652 }, 3653 interactivity: { 3654 clientNavigation: true 3655 } 3656 }, 3657 editorStyle: "wp-block-audio-editor", 3658 style: "wp-block-audio" 3659 }; 3660 3661 3662 const { 3663 name: audio_name 3664 } = audio_metadata; 3665 3666 const audio_settings = { 3667 icon: library_audio, 3668 example: { 3669 attributes: { 3670 src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg' 3671 }, 3672 viewportWidth: 350 3673 }, 3674 transforms: audio_transforms, 3675 deprecated: deprecated, 3676 edit: edit, 3677 save: save 3678 }; 3679 const audio_init = () => initBlock({ 3680 name: audio_name, 3681 metadata: audio_metadata, 3682 settings: audio_settings 3683 }); 3684 3685 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js 3686 3687 /** 3688 * WordPress dependencies 3689 */ 3690 3691 const button_button = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 3692 viewBox: "0 0 24 24", 3693 xmlns: "http://www.w3.org/2000/svg" 3694 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 3695 d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" 3696 })); 3697 /* harmony default export */ const library_button = (button_button); 3698 3699 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js 3700 /** 3701 * WordPress dependencies 3702 */ 3703 3704 3705 /** 3706 * Internal dependencies 3707 */ 3708 3709 const { 3710 cleanEmptyObject 3711 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 3712 3713 /** 3714 * Migrates the current style.typography.fontFamily attribute, 3715 * whose value was "var:preset|font-family|helvetica-arial", 3716 * to the style.fontFamily attribute, whose value will be "helvetica-arial". 3717 * 3718 * @param {Object} attributes The current attributes 3719 * @return {Object} The updated attributes. 3720 */ 3721 /* harmony default export */ function migrate_font_family(attributes) { 3722 if (!attributes?.style?.typography?.fontFamily) { 3723 return attributes; 3724 } 3725 const { 3726 fontFamily, 3727 ...typography 3728 } = attributes.style.typography; 3729 return { 3730 ...attributes, 3731 style: cleanEmptyObject({ 3732 ...attributes.style, 3733 typography 3734 }), 3735 fontFamily: fontFamily.split('|').pop() 3736 }; 3737 } 3738 3739 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js 3740 3741 /** 3742 * External dependencies 3743 */ 3744 3745 3746 /** 3747 * WordPress dependencies 3748 */ 3749 3750 3751 3752 /** 3753 * Internal dependencies 3754 */ 3755 3756 const migrateBorderRadius = attributes => { 3757 const { 3758 borderRadius, 3759 ...newAttributes 3760 } = attributes; 3761 // We have to check old property `borderRadius` and if 3762 // `styles.border.radius` is a `number` 3763 const oldBorderRadius = [borderRadius, newAttributes.style?.border?.radius].find(possibleBorderRadius => { 3764 return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0; 3765 }); 3766 if (!oldBorderRadius) { 3767 return newAttributes; 3768 } 3769 return { 3770 ...newAttributes, 3771 style: { 3772 ...newAttributes.style, 3773 border: { 3774 ...newAttributes.style?.border, 3775 radius: `$oldBorderRadius}px` 3776 } 3777 } 3778 }; 3779 }; 3780 function migrateAlign(attributes) { 3781 if (!attributes.align) { 3782 return attributes; 3783 } 3784 const { 3785 align, 3786 ...otherAttributes 3787 } = attributes; 3788 return { 3789 ...otherAttributes, 3790 className: classnames_default()(otherAttributes.className, `align$attributes.align}`) 3791 }; 3792 } 3793 const migrateCustomColorsAndGradients = attributes => { 3794 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) { 3795 return attributes; 3796 } 3797 const style = { 3798 color: {} 3799 }; 3800 if (attributes.customTextColor) { 3801 style.color.text = attributes.customTextColor; 3802 } 3803 if (attributes.customBackgroundColor) { 3804 style.color.background = attributes.customBackgroundColor; 3805 } 3806 if (attributes.customGradient) { 3807 style.color.gradient = attributes.customGradient; 3808 } 3809 const { 3810 customTextColor, 3811 customBackgroundColor, 3812 customGradient, 3813 ...restAttributes 3814 } = attributes; 3815 return { 3816 ...restAttributes, 3817 style 3818 }; 3819 }; 3820 const oldColorsMigration = attributes => { 3821 const { 3822 color, 3823 textColor, 3824 ...restAttributes 3825 } = { 3826 ...attributes, 3827 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 3828 customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined 3829 }; 3830 return migrateCustomColorsAndGradients(restAttributes); 3831 }; 3832 const blockAttributes = { 3833 url: { 3834 type: 'string', 3835 source: 'attribute', 3836 selector: 'a', 3837 attribute: 'href' 3838 }, 3839 title: { 3840 type: 'string', 3841 source: 'attribute', 3842 selector: 'a', 3843 attribute: 'title' 3844 }, 3845 text: { 3846 type: 'string', 3847 source: 'html', 3848 selector: 'a' 3849 } 3850 }; 3851 const v11 = { 3852 attributes: { 3853 url: { 3854 type: 'string', 3855 source: 'attribute', 3856 selector: 'a', 3857 attribute: 'href' 3858 }, 3859 title: { 3860 type: 'string', 3861 source: 'attribute', 3862 selector: 'a', 3863 attribute: 'title' 3864 }, 3865 text: { 3866 type: 'string', 3867 source: 'html', 3868 selector: 'a' 3869 }, 3870 linkTarget: { 3871 type: 'string', 3872 source: 'attribute', 3873 selector: 'a', 3874 attribute: 'target' 3875 }, 3876 rel: { 3877 type: 'string', 3878 source: 'attribute', 3879 selector: 'a', 3880 attribute: 'rel' 3881 }, 3882 placeholder: { 3883 type: 'string' 3884 }, 3885 backgroundColor: { 3886 type: 'string' 3887 }, 3888 textColor: { 3889 type: 'string' 3890 }, 3891 gradient: { 3892 type: 'string' 3893 }, 3894 width: { 3895 type: 'number' 3896 } 3897 }, 3898 supports: { 3899 anchor: true, 3900 align: true, 3901 alignWide: false, 3902 color: { 3903 __experimentalSkipSerialization: true, 3904 gradients: true, 3905 __experimentalDefaultControls: { 3906 background: true, 3907 text: true 3908 } 3909 }, 3910 typography: { 3911 fontSize: true, 3912 __experimentalFontFamily: true, 3913 __experimentalDefaultControls: { 3914 fontSize: true 3915 } 3916 }, 3917 reusable: false, 3918 spacing: { 3919 __experimentalSkipSerialization: true, 3920 padding: ['horizontal', 'vertical'], 3921 __experimentalDefaultControls: { 3922 padding: true 3923 } 3924 }, 3925 __experimentalBorder: { 3926 radius: true, 3927 __experimentalSkipSerialization: true, 3928 __experimentalDefaultControls: { 3929 radius: true 3930 } 3931 }, 3932 __experimentalSelector: '.wp-block-button__link' 3933 }, 3934 save({ 3935 attributes, 3936 className 3937 }) { 3938 const { 3939 fontSize, 3940 linkTarget, 3941 rel, 3942 style, 3943 text, 3944 title, 3945 url, 3946 width 3947 } = attributes; 3948 if (!text) { 3949 return null; 3950 } 3951 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 3952 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 3953 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 3954 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { 3955 // For backwards compatibility add style that isn't provided via 3956 // block support. 3957 'no-border-radius': style?.border?.radius === 0 3958 }); 3959 const buttonStyle = { 3960 ...borderProps.style, 3961 ...colorProps.style, 3962 ...spacingProps.style 3963 }; 3964 3965 // The use of a `title` attribute here is soft-deprecated, but still applied 3966 // if it had already been assigned, for the sake of backward-compatibility. 3967 // A title will no longer be assigned for new or updated button block links. 3968 3969 const wrapperClasses = classnames_default()(className, { 3970 [`has-custom-width wp-block-button__width-$width}`]: width, 3971 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 3972 }); 3973 return (0,external_React_namespaceObject.createElement)("div", { 3974 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 3975 className: wrapperClasses 3976 }) 3977 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 3978 tagName: "a", 3979 className: buttonClasses, 3980 href: url, 3981 title: title, 3982 style: buttonStyle, 3983 value: text, 3984 target: linkTarget, 3985 rel: rel 3986 })); 3987 } 3988 }; 3989 const v10 = { 3990 attributes: { 3991 url: { 3992 type: 'string', 3993 source: 'attribute', 3994 selector: 'a', 3995 attribute: 'href' 3996 }, 3997 title: { 3998 type: 'string', 3999 source: 'attribute', 4000 selector: 'a', 4001 attribute: 'title' 4002 }, 4003 text: { 4004 type: 'string', 4005 source: 'html', 4006 selector: 'a' 4007 }, 4008 linkTarget: { 4009 type: 'string', 4010 source: 'attribute', 4011 selector: 'a', 4012 attribute: 'target' 4013 }, 4014 rel: { 4015 type: 'string', 4016 source: 'attribute', 4017 selector: 'a', 4018 attribute: 'rel' 4019 }, 4020 placeholder: { 4021 type: 'string' 4022 }, 4023 backgroundColor: { 4024 type: 'string' 4025 }, 4026 textColor: { 4027 type: 'string' 4028 }, 4029 gradient: { 4030 type: 'string' 4031 }, 4032 width: { 4033 type: 'number' 4034 } 4035 }, 4036 supports: { 4037 anchor: true, 4038 align: true, 4039 alignWide: false, 4040 color: { 4041 __experimentalSkipSerialization: true, 4042 gradients: true 4043 }, 4044 typography: { 4045 fontSize: true, 4046 __experimentalFontFamily: true 4047 }, 4048 reusable: false, 4049 spacing: { 4050 __experimentalSkipSerialization: true, 4051 padding: ['horizontal', 'vertical'], 4052 __experimentalDefaultControls: { 4053 padding: true 4054 } 4055 }, 4056 __experimentalBorder: { 4057 radius: true, 4058 __experimentalSkipSerialization: true 4059 }, 4060 __experimentalSelector: '.wp-block-button__link' 4061 }, 4062 save({ 4063 attributes, 4064 className 4065 }) { 4066 const { 4067 fontSize, 4068 linkTarget, 4069 rel, 4070 style, 4071 text, 4072 title, 4073 url, 4074 width 4075 } = attributes; 4076 if (!text) { 4077 return null; 4078 } 4079 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 4080 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4081 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 4082 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { 4083 // For backwards compatibility add style that isn't provided via 4084 // block support. 4085 'no-border-radius': style?.border?.radius === 0 4086 }); 4087 const buttonStyle = { 4088 ...borderProps.style, 4089 ...colorProps.style, 4090 ...spacingProps.style 4091 }; 4092 4093 // The use of a `title` attribute here is soft-deprecated, but still applied 4094 // if it had already been assigned, for the sake of backward-compatibility. 4095 // A title will no longer be assigned for new or updated button block links. 4096 4097 const wrapperClasses = classnames_default()(className, { 4098 [`has-custom-width wp-block-button__width-$width}`]: width, 4099 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4100 }); 4101 return (0,external_React_namespaceObject.createElement)("div", { 4102 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4103 className: wrapperClasses 4104 }) 4105 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4106 tagName: "a", 4107 className: buttonClasses, 4108 href: url, 4109 title: title, 4110 style: buttonStyle, 4111 value: text, 4112 target: linkTarget, 4113 rel: rel 4114 })); 4115 }, 4116 migrate: migrate_font_family, 4117 isEligible({ 4118 style 4119 }) { 4120 return style?.typography?.fontFamily; 4121 } 4122 }; 4123 const deprecated_deprecated = [v11, v10, { 4124 supports: { 4125 anchor: true, 4126 align: true, 4127 alignWide: false, 4128 color: { 4129 __experimentalSkipSerialization: true, 4130 gradients: true 4131 }, 4132 typography: { 4133 fontSize: true, 4134 __experimentalFontFamily: true 4135 }, 4136 reusable: false, 4137 __experimentalSelector: '.wp-block-button__link' 4138 }, 4139 attributes: { 4140 ...blockAttributes, 4141 linkTarget: { 4142 type: 'string', 4143 source: 'attribute', 4144 selector: 'a', 4145 attribute: 'target' 4146 }, 4147 rel: { 4148 type: 'string', 4149 source: 'attribute', 4150 selector: 'a', 4151 attribute: 'rel' 4152 }, 4153 placeholder: { 4154 type: 'string' 4155 }, 4156 backgroundColor: { 4157 type: 'string' 4158 }, 4159 textColor: { 4160 type: 'string' 4161 }, 4162 gradient: { 4163 type: 'string' 4164 }, 4165 width: { 4166 type: 'number' 4167 } 4168 }, 4169 isEligible({ 4170 style 4171 }) { 4172 return typeof style?.border?.radius === 'number'; 4173 }, 4174 save({ 4175 attributes, 4176 className 4177 }) { 4178 const { 4179 fontSize, 4180 linkTarget, 4181 rel, 4182 style, 4183 text, 4184 title, 4185 url, 4186 width 4187 } = attributes; 4188 if (!text) { 4189 return null; 4190 } 4191 const borderRadius = style?.border?.radius; 4192 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4193 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 4194 'no-border-radius': style?.border?.radius === 0 4195 }); 4196 const buttonStyle = { 4197 borderRadius: borderRadius ? borderRadius : undefined, 4198 ...colorProps.style 4199 }; 4200 4201 // The use of a `title` attribute here is soft-deprecated, but still applied 4202 // if it had already been assigned, for the sake of backward-compatibility. 4203 // A title will no longer be assigned for new or updated button block links. 4204 4205 const wrapperClasses = classnames_default()(className, { 4206 [`has-custom-width wp-block-button__width-$width}`]: width, 4207 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4208 }); 4209 return (0,external_React_namespaceObject.createElement)("div", { 4210 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4211 className: wrapperClasses 4212 }) 4213 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4214 tagName: "a", 4215 className: buttonClasses, 4216 href: url, 4217 title: title, 4218 style: buttonStyle, 4219 value: text, 4220 target: linkTarget, 4221 rel: rel 4222 })); 4223 }, 4224 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4225 }, { 4226 supports: { 4227 anchor: true, 4228 align: true, 4229 alignWide: false, 4230 color: { 4231 __experimentalSkipSerialization: true 4232 }, 4233 reusable: false, 4234 __experimentalSelector: '.wp-block-button__link' 4235 }, 4236 attributes: { 4237 ...blockAttributes, 4238 linkTarget: { 4239 type: 'string', 4240 source: 'attribute', 4241 selector: 'a', 4242 attribute: 'target' 4243 }, 4244 rel: { 4245 type: 'string', 4246 source: 'attribute', 4247 selector: 'a', 4248 attribute: 'rel' 4249 }, 4250 placeholder: { 4251 type: 'string' 4252 }, 4253 borderRadius: { 4254 type: 'number' 4255 }, 4256 backgroundColor: { 4257 type: 'string' 4258 }, 4259 textColor: { 4260 type: 'string' 4261 }, 4262 gradient: { 4263 type: 'string' 4264 }, 4265 style: { 4266 type: 'object' 4267 }, 4268 width: { 4269 type: 'number' 4270 } 4271 }, 4272 save({ 4273 attributes, 4274 className 4275 }) { 4276 const { 4277 borderRadius, 4278 linkTarget, 4279 rel, 4280 text, 4281 title, 4282 url, 4283 width 4284 } = attributes; 4285 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4286 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 4287 'no-border-radius': borderRadius === 0 4288 }); 4289 const buttonStyle = { 4290 borderRadius: borderRadius ? borderRadius + 'px' : undefined, 4291 ...colorProps.style 4292 }; 4293 4294 // The use of a `title` attribute here is soft-deprecated, but still applied 4295 // if it had already been assigned, for the sake of backward-compatibility. 4296 // A title will no longer be assigned for new or updated button block links. 4297 4298 const wrapperClasses = classnames_default()(className, { 4299 [`has-custom-width wp-block-button__width-$width}`]: width 4300 }); 4301 return (0,external_React_namespaceObject.createElement)("div", { 4302 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4303 className: wrapperClasses 4304 }) 4305 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4306 tagName: "a", 4307 className: buttonClasses, 4308 href: url, 4309 title: title, 4310 style: buttonStyle, 4311 value: text, 4312 target: linkTarget, 4313 rel: rel 4314 })); 4315 }, 4316 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4317 }, { 4318 supports: { 4319 anchor: true, 4320 align: true, 4321 alignWide: false, 4322 color: { 4323 __experimentalSkipSerialization: true 4324 }, 4325 reusable: false, 4326 __experimentalSelector: '.wp-block-button__link' 4327 }, 4328 attributes: { 4329 ...blockAttributes, 4330 linkTarget: { 4331 type: 'string', 4332 source: 'attribute', 4333 selector: 'a', 4334 attribute: 'target' 4335 }, 4336 rel: { 4337 type: 'string', 4338 source: 'attribute', 4339 selector: 'a', 4340 attribute: 'rel' 4341 }, 4342 placeholder: { 4343 type: 'string' 4344 }, 4345 borderRadius: { 4346 type: 'number' 4347 }, 4348 backgroundColor: { 4349 type: 'string' 4350 }, 4351 textColor: { 4352 type: 'string' 4353 }, 4354 gradient: { 4355 type: 'string' 4356 }, 4357 style: { 4358 type: 'object' 4359 }, 4360 width: { 4361 type: 'number' 4362 } 4363 }, 4364 save({ 4365 attributes, 4366 className 4367 }) { 4368 const { 4369 borderRadius, 4370 linkTarget, 4371 rel, 4372 text, 4373 title, 4374 url, 4375 width 4376 } = attributes; 4377 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4378 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, { 4379 'no-border-radius': borderRadius === 0 4380 }); 4381 const buttonStyle = { 4382 borderRadius: borderRadius ? borderRadius + 'px' : undefined, 4383 ...colorProps.style 4384 }; 4385 4386 // The use of a `title` attribute here is soft-deprecated, but still applied 4387 // if it had already been assigned, for the sake of backward-compatibility. 4388 // A title will no longer be assigned for new or updated button block links. 4389 4390 const wrapperClasses = classnames_default()(className, { 4391 [`has-custom-width wp-block-button__width-$width}`]: width 4392 }); 4393 return (0,external_React_namespaceObject.createElement)("div", { 4394 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4395 className: wrapperClasses 4396 }) 4397 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4398 tagName: "a", 4399 className: buttonClasses, 4400 href: url, 4401 title: title, 4402 style: buttonStyle, 4403 value: text, 4404 target: linkTarget, 4405 rel: rel 4406 })); 4407 }, 4408 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4409 }, { 4410 supports: { 4411 align: true, 4412 alignWide: false, 4413 color: { 4414 gradients: true 4415 } 4416 }, 4417 attributes: { 4418 ...blockAttributes, 4419 linkTarget: { 4420 type: 'string', 4421 source: 'attribute', 4422 selector: 'a', 4423 attribute: 'target' 4424 }, 4425 rel: { 4426 type: 'string', 4427 source: 'attribute', 4428 selector: 'a', 4429 attribute: 'rel' 4430 }, 4431 placeholder: { 4432 type: 'string' 4433 }, 4434 borderRadius: { 4435 type: 'number' 4436 }, 4437 backgroundColor: { 4438 type: 'string' 4439 }, 4440 textColor: { 4441 type: 'string' 4442 }, 4443 gradient: { 4444 type: 'string' 4445 }, 4446 style: { 4447 type: 'object' 4448 } 4449 }, 4450 save({ 4451 attributes 4452 }) { 4453 const { 4454 borderRadius, 4455 linkTarget, 4456 rel, 4457 text, 4458 title, 4459 url 4460 } = attributes; 4461 const buttonClasses = classnames_default()('wp-block-button__link', { 4462 'no-border-radius': borderRadius === 0 4463 }); 4464 const buttonStyle = { 4465 borderRadius: borderRadius ? borderRadius + 'px' : undefined 4466 }; 4467 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4468 tagName: "a", 4469 className: buttonClasses, 4470 href: url, 4471 title: title, 4472 style: buttonStyle, 4473 value: text, 4474 target: linkTarget, 4475 rel: rel 4476 }); 4477 }, 4478 migrate: migrateBorderRadius 4479 }, { 4480 supports: { 4481 align: true, 4482 alignWide: false 4483 }, 4484 attributes: { 4485 ...blockAttributes, 4486 linkTarget: { 4487 type: 'string', 4488 source: 'attribute', 4489 selector: 'a', 4490 attribute: 'target' 4491 }, 4492 rel: { 4493 type: 'string', 4494 source: 'attribute', 4495 selector: 'a', 4496 attribute: 'rel' 4497 }, 4498 placeholder: { 4499 type: 'string' 4500 }, 4501 borderRadius: { 4502 type: 'number' 4503 }, 4504 backgroundColor: { 4505 type: 'string' 4506 }, 4507 textColor: { 4508 type: 'string' 4509 }, 4510 customBackgroundColor: { 4511 type: 'string' 4512 }, 4513 customTextColor: { 4514 type: 'string' 4515 }, 4516 customGradient: { 4517 type: 'string' 4518 }, 4519 gradient: { 4520 type: 'string' 4521 } 4522 }, 4523 isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align, 4524 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients, migrateAlign), 4525 save({ 4526 attributes 4527 }) { 4528 const { 4529 backgroundColor, 4530 borderRadius, 4531 customBackgroundColor, 4532 customTextColor, 4533 customGradient, 4534 linkTarget, 4535 gradient, 4536 rel, 4537 text, 4538 textColor, 4539 title, 4540 url 4541 } = attributes; 4542 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4543 const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4544 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 4545 const buttonClasses = classnames_default()('wp-block-button__link', { 4546 'has-text-color': textColor || customTextColor, 4547 [textClass]: textClass, 4548 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient, 4549 [backgroundClass]: backgroundClass, 4550 'no-border-radius': borderRadius === 0, 4551 [gradientClass]: gradientClass 4552 }); 4553 const buttonStyle = { 4554 background: customGradient ? customGradient : undefined, 4555 backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor, 4556 color: textClass ? undefined : customTextColor, 4557 borderRadius: borderRadius ? borderRadius + 'px' : undefined 4558 }; 4559 4560 // The use of a `title` attribute here is soft-deprecated, but still applied 4561 // if it had already been assigned, for the sake of backward-compatibility. 4562 // A title will no longer be assigned for new or updated button block links. 4563 4564 return (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4565 tagName: "a", 4566 className: buttonClasses, 4567 href: url, 4568 title: title, 4569 style: buttonStyle, 4570 value: text, 4571 target: linkTarget, 4572 rel: rel 4573 })); 4574 } 4575 }, { 4576 attributes: { 4577 ...blockAttributes, 4578 align: { 4579 type: 'string', 4580 default: 'none' 4581 }, 4582 backgroundColor: { 4583 type: 'string' 4584 }, 4585 textColor: { 4586 type: 'string' 4587 }, 4588 customBackgroundColor: { 4589 type: 'string' 4590 }, 4591 customTextColor: { 4592 type: 'string' 4593 }, 4594 linkTarget: { 4595 type: 'string', 4596 source: 'attribute', 4597 selector: 'a', 4598 attribute: 'target' 4599 }, 4600 rel: { 4601 type: 'string', 4602 source: 'attribute', 4603 selector: 'a', 4604 attribute: 'rel' 4605 }, 4606 placeholder: { 4607 type: 'string' 4608 } 4609 }, 4610 isEligible(attribute) { 4611 return attribute.className && attribute.className.includes('is-style-squared'); 4612 }, 4613 migrate(attributes) { 4614 let newClassName = attributes.className; 4615 if (newClassName) { 4616 newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim(); 4617 } 4618 return migrateBorderRadius(migrateCustomColorsAndGradients({ 4619 ...attributes, 4620 className: newClassName ? newClassName : undefined, 4621 borderRadius: 0 4622 })); 4623 }, 4624 save({ 4625 attributes 4626 }) { 4627 const { 4628 backgroundColor, 4629 customBackgroundColor, 4630 customTextColor, 4631 linkTarget, 4632 rel, 4633 text, 4634 textColor, 4635 title, 4636 url 4637 } = attributes; 4638 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4639 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4640 const buttonClasses = classnames_default()('wp-block-button__link', { 4641 'has-text-color': textColor || customTextColor, 4642 [textClass]: textClass, 4643 'has-background': backgroundColor || customBackgroundColor, 4644 [backgroundClass]: backgroundClass 4645 }); 4646 const buttonStyle = { 4647 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 4648 color: textClass ? undefined : customTextColor 4649 }; 4650 return (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4651 tagName: "a", 4652 className: buttonClasses, 4653 href: url, 4654 title: title, 4655 style: buttonStyle, 4656 value: text, 4657 target: linkTarget, 4658 rel: rel 4659 })); 4660 } 4661 }, { 4662 attributes: { 4663 ...blockAttributes, 4664 align: { 4665 type: 'string', 4666 default: 'none' 4667 }, 4668 backgroundColor: { 4669 type: 'string' 4670 }, 4671 textColor: { 4672 type: 'string' 4673 }, 4674 customBackgroundColor: { 4675 type: 'string' 4676 }, 4677 customTextColor: { 4678 type: 'string' 4679 } 4680 }, 4681 migrate: oldColorsMigration, 4682 save({ 4683 attributes 4684 }) { 4685 const { 4686 url, 4687 text, 4688 title, 4689 backgroundColor, 4690 textColor, 4691 customBackgroundColor, 4692 customTextColor 4693 } = attributes; 4694 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4695 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4696 const buttonClasses = classnames_default()('wp-block-button__link', { 4697 'has-text-color': textColor || customTextColor, 4698 [textClass]: textClass, 4699 'has-background': backgroundColor || customBackgroundColor, 4700 [backgroundClass]: backgroundClass 4701 }); 4702 const buttonStyle = { 4703 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 4704 color: textClass ? undefined : customTextColor 4705 }; 4706 return (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4707 tagName: "a", 4708 className: buttonClasses, 4709 href: url, 4710 title: title, 4711 style: buttonStyle, 4712 value: text 4713 })); 4714 } 4715 }, { 4716 attributes: { 4717 ...blockAttributes, 4718 color: { 4719 type: 'string' 4720 }, 4721 textColor: { 4722 type: 'string' 4723 }, 4724 align: { 4725 type: 'string', 4726 default: 'none' 4727 } 4728 }, 4729 save({ 4730 attributes 4731 }) { 4732 const { 4733 url, 4734 text, 4735 title, 4736 align, 4737 color, 4738 textColor 4739 } = attributes; 4740 const buttonStyle = { 4741 backgroundColor: color, 4742 color: textColor 4743 }; 4744 const linkClass = 'wp-block-button__link'; 4745 return (0,external_React_namespaceObject.createElement)("div", { 4746 className: `align$align}` 4747 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4748 tagName: "a", 4749 className: linkClass, 4750 href: url, 4751 title: title, 4752 style: buttonStyle, 4753 value: text 4754 })); 4755 }, 4756 migrate: oldColorsMigration 4757 }, { 4758 attributes: { 4759 ...blockAttributes, 4760 color: { 4761 type: 'string' 4762 }, 4763 textColor: { 4764 type: 'string' 4765 }, 4766 align: { 4767 type: 'string', 4768 default: 'none' 4769 } 4770 }, 4771 save({ 4772 attributes 4773 }) { 4774 const { 4775 url, 4776 text, 4777 title, 4778 align, 4779 color, 4780 textColor 4781 } = attributes; 4782 return (0,external_React_namespaceObject.createElement)("div", { 4783 className: `align$align}`, 4784 style: { 4785 backgroundColor: color 4786 } 4787 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4788 tagName: "a", 4789 href: url, 4790 title: title, 4791 style: { 4792 color: textColor 4793 }, 4794 value: text 4795 })); 4796 }, 4797 migrate: oldColorsMigration 4798 }]; 4799 /* harmony default export */ const button_deprecated = (deprecated_deprecated); 4800 4801 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/constants.js 4802 const NEW_TAB_REL = 'noreferrer noopener'; 4803 const NEW_TAB_TARGET = '_blank'; 4804 const NOFOLLOW_REL = 'nofollow'; 4805 4806 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js 4807 /** 4808 * Internal dependencies 4809 */ 4810 4811 4812 /** 4813 * WordPress dependencies 4814 */ 4815 4816 4817 /** 4818 * Updates the link attributes. 4819 * 4820 * @param {Object} attributes The current block attributes. 4821 * @param {string} attributes.rel The current link rel attribute. 4822 * @param {string} attributes.url The current link url. 4823 * @param {boolean} attributes.opensInNewTab Whether the link should open in a new window. 4824 * @param {boolean} attributes.nofollow Whether the link should be marked as nofollow. 4825 */ 4826 function getUpdatedLinkAttributes({ 4827 rel = '', 4828 url = '', 4829 opensInNewTab, 4830 nofollow 4831 }) { 4832 let newLinkTarget; 4833 // Since `rel` is editable attribute, we need to check for existing values and proceed accordingly. 4834 let updatedRel = rel; 4835 if (opensInNewTab) { 4836 newLinkTarget = NEW_TAB_TARGET; 4837 updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` $NEW_TAB_REL}`; 4838 } else { 4839 const relRegex = new RegExp(`\\b$NEW_TAB_REL}\\s*`, 'g'); 4840 updatedRel = updatedRel?.replace(relRegex, '').trim(); 4841 } 4842 if (nofollow) { 4843 updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : updatedRel + ` $NOFOLLOW_REL}`; 4844 } else { 4845 const relRegex = new RegExp(`\\b$NOFOLLOW_REL}\\s*`, 'g'); 4846 updatedRel = updatedRel?.replace(relRegex, '').trim(); 4847 } 4848 return { 4849 url: (0,external_wp_url_namespaceObject.prependHTTP)(url), 4850 linkTarget: newLinkTarget, 4851 rel: updatedRel || undefined 4852 }; 4853 } 4854 4855 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js 4856 /** 4857 * Removes anchor tags from a string. 4858 * 4859 * @param {string} value The value to remove anchor tags from. 4860 * 4861 * @return {string} The value with anchor tags removed. 4862 */ 4863 function removeAnchorTag(value) { 4864 // To do: Refactor this to use rich text's removeFormat instead. 4865 return value.toString().replace(/<\/?a[^>]*>/g, ''); 4866 } 4867 4868 ;// CONCATENATED MODULE: external ["wp","keycodes"] 4869 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; 4870 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js 4871 4872 /** 4873 * WordPress dependencies 4874 */ 4875 4876 const link_link = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 4877 xmlns: "http://www.w3.org/2000/svg", 4878 viewBox: "0 0 24 24" 4879 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 4880 d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" 4881 })); 4882 /* harmony default export */ const library_link = (link_link); 4883 4884 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js 4885 4886 /** 4887 * WordPress dependencies 4888 */ 4889 4890 const linkOff = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 4891 xmlns: "http://www.w3.org/2000/svg", 4892 viewBox: "0 0 24 24" 4893 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 4894 d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" 4895 })); 4896 /* harmony default export */ const link_off = (linkOff); 4897 4898 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js 4899 4900 /** 4901 * External dependencies 4902 */ 4903 4904 4905 /** 4906 * Internal dependencies 4907 */ 4908 4909 4910 4911 4912 4913 /** 4914 * WordPress dependencies 4915 */ 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, { 4926 id: 'nofollow', 4927 title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') 4928 }]; 4929 function useEnter(props) { 4930 const { 4931 replaceBlocks, 4932 selectionChange 4933 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 4934 const { 4935 getBlock, 4936 getBlockRootClientId, 4937 getBlockIndex 4938 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 4939 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 4940 propsRef.current = props; 4941 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 4942 function onKeyDown(event) { 4943 if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 4944 return; 4945 } 4946 const { 4947 content, 4948 clientId 4949 } = propsRef.current; 4950 if (content.length) { 4951 return; 4952 } 4953 event.preventDefault(); 4954 const topParentListBlock = getBlock(getBlockRootClientId(clientId)); 4955 const blockIndex = getBlockIndex(clientId); 4956 const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ 4957 ...topParentListBlock, 4958 innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) 4959 }); 4960 const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); 4961 const after = topParentListBlock.innerBlocks.slice(blockIndex + 1); 4962 const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ 4963 ...topParentListBlock, 4964 innerBlocks: after 4965 })] : []; 4966 replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); 4967 // We manually change the selection here because we are replacing 4968 // a different block than the selected one. 4969 selectionChange(middle.clientId); 4970 } 4971 element.addEventListener('keydown', onKeyDown); 4972 return () => { 4973 element.removeEventListener('keydown', onKeyDown); 4974 }; 4975 }, []); 4976 } 4977 function WidthPanel({ 4978 selectedWidth, 4979 setAttributes 4980 }) { 4981 function handleChange(newWidth) { 4982 // Check if we are toggling the width off 4983 const width = selectedWidth === newWidth ? undefined : newWidth; 4984 4985 // Update attributes. 4986 setAttributes({ 4987 width 4988 }); 4989 } 4990 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 4991 title: (0,external_wp_i18n_namespaceObject.__)('Width settings') 4992 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { 4993 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width') 4994 }, [25, 50, 75, 100].map(widthValue => { 4995 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 4996 key: widthValue, 4997 size: "small", 4998 variant: widthValue === selectedWidth ? 'primary' : undefined, 4999 onClick: () => handleChange(widthValue) 5000 }, widthValue, "%"); 5001 }))); 5002 } 5003 function ButtonEdit(props) { 5004 const { 5005 attributes, 5006 setAttributes, 5007 className, 5008 isSelected, 5009 onReplace, 5010 mergeBlocks, 5011 clientId 5012 } = props; 5013 const { 5014 tagName, 5015 textAlign, 5016 linkTarget, 5017 placeholder, 5018 rel, 5019 style, 5020 text, 5021 url, 5022 width, 5023 metadata 5024 } = attributes; 5025 const TagName = tagName || 'a'; 5026 function onKeyDown(event) { 5027 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { 5028 startEditing(event); 5029 } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) { 5030 unlink(); 5031 richTextRef.current?.focus(); 5032 } 5033 } 5034 5035 // Use internal state instead of a ref to make sure that the component 5036 // re-renders when the popover's anchor updates. 5037 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 5038 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 5039 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 5040 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 5041 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 5042 const ref = (0,external_wp_element_namespaceObject.useRef)(); 5043 const richTextRef = (0,external_wp_element_namespaceObject.useRef)(); 5044 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 5045 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), 5046 onKeyDown 5047 }); 5048 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 5049 const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); 5050 const isURLSet = !!url; 5051 const opensInNewTab = linkTarget === NEW_TAB_TARGET; 5052 const nofollow = !!rel?.includes(NOFOLLOW_REL); 5053 const isLinkTag = 'a' === TagName; 5054 function startEditing(event) { 5055 event.preventDefault(); 5056 setIsEditingURL(true); 5057 } 5058 function unlink() { 5059 setAttributes({ 5060 url: undefined, 5061 linkTarget: undefined, 5062 rel: undefined 5063 }); 5064 setIsEditingURL(false); 5065 } 5066 (0,external_wp_element_namespaceObject.useEffect)(() => { 5067 if (!isSelected) { 5068 setIsEditingURL(false); 5069 } 5070 }, [isSelected]); 5071 5072 // Memoize link value to avoid overriding the LinkControl's internal state. 5073 // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256. 5074 const linkValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 5075 url, 5076 opensInNewTab, 5077 nofollow 5078 }), [url, opensInNewTab, nofollow]); 5079 const useEnterRef = useEnter({ 5080 content: text, 5081 clientId 5082 }); 5083 const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, richTextRef]); 5084 const { 5085 lockUrlControls = false 5086 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 5087 if (!isSelected) { 5088 return {}; 5089 } 5090 const blockBindingsSource = unlock(select(external_wp_blocks_namespaceObject.store)).getBlockBindingsSource(metadata?.bindings?.url?.source); 5091 return { 5092 lockUrlControls: !!metadata?.bindings?.url && (!blockBindingsSource || blockBindingsSource?.lockAttributesEditing) 5093 }; 5094 }, [isSelected]); 5095 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", { 5096 ...blockProps, 5097 className: classnames_default()(blockProps.className, { 5098 [`has-custom-width wp-block-button__width-$width}`]: width, 5099 [`has-custom-font-size`]: blockProps.style.fontSize 5100 }) 5101 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 5102 ref: mergedRef, 5103 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), 5104 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), 5105 value: text, 5106 onChange: value => setAttributes({ 5107 text: removeAnchorTag(value) 5108 }), 5109 withoutInteractiveFormatting: true, 5110 className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, { 5111 [`has-text-align-$textAlign}`]: textAlign, 5112 // For backwards compatibility add style that isn't 5113 // provided via block support. 5114 'no-border-radius': style?.border?.radius === 0 5115 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 5116 style: { 5117 ...borderProps.style, 5118 ...colorProps.style, 5119 ...spacingProps.style, 5120 ...shadowProps.style 5121 }, 5122 onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { 5123 ...attributes, 5124 text: value 5125 }), 5126 onReplace: onReplace, 5127 onMerge: mergeBlocks, 5128 identifier: "text" 5129 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 5130 group: "block" 5131 }, blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 5132 value: textAlign, 5133 onChange: nextAlign => { 5134 setAttributes({ 5135 textAlign: nextAlign 5136 }); 5137 } 5138 }), !isURLSet && isLinkTag && !lockUrlControls && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 5139 name: "link", 5140 icon: library_link, 5141 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 5142 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 5143 onClick: startEditing 5144 }), isURLSet && isLinkTag && !lockUrlControls && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 5145 name: "link", 5146 icon: link_off, 5147 title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), 5148 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), 5149 onClick: unlink, 5150 isActive: true 5151 })), isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { 5152 placement: "bottom", 5153 onClose: () => { 5154 setIsEditingURL(false); 5155 richTextRef.current?.focus(); 5156 }, 5157 anchor: popoverAnchor, 5158 focusOnMount: isEditingURL ? 'firstElement' : false, 5159 __unstableSlotName: '__unstable-block-tools-after', 5160 shift: true 5161 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { 5162 value: linkValue, 5163 onChange: ({ 5164 url: newURL, 5165 opensInNewTab: newOpensInNewTab, 5166 nofollow: newNofollow 5167 }) => setAttributes(getUpdatedLinkAttributes({ 5168 rel, 5169 url: newURL, 5170 opensInNewTab: newOpensInNewTab, 5171 nofollow: newNofollow 5172 })), 5173 onRemove: () => { 5174 unlink(); 5175 richTextRef.current?.focus(); 5176 }, 5177 forceIsEditingLink: isEditingURL, 5178 settings: LINK_SETTINGS 5179 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(WidthPanel, { 5180 selectedWidth: width, 5181 setAttributes: setAttributes 5182 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 5183 group: "advanced" 5184 }, isLinkTag && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 5185 __nextHasNoMarginBottom: true, 5186 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 5187 value: rel || '', 5188 onChange: newRel => setAttributes({ 5189 rel: newRel 5190 }) 5191 }))); 5192 } 5193 /* harmony default export */ const button_edit = (ButtonEdit); 5194 5195 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js 5196 5197 /** 5198 * External dependencies 5199 */ 5200 5201 5202 /** 5203 * WordPress dependencies 5204 */ 5205 5206 function save_save({ 5207 attributes, 5208 className 5209 }) { 5210 const { 5211 tagName, 5212 type, 5213 textAlign, 5214 fontSize, 5215 linkTarget, 5216 rel, 5217 style, 5218 text, 5219 title, 5220 url, 5221 width 5222 } = attributes; 5223 if (external_wp_blockEditor_namespaceObject.RichText.isEmpty(text)) { 5224 return null; 5225 } 5226 const TagName = tagName || 'a'; 5227 const isButtonTag = 'button' === TagName; 5228 const buttonType = type || 'button'; 5229 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 5230 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 5231 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 5232 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 5233 const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, { 5234 [`has-text-align-$textAlign}`]: textAlign, 5235 // For backwards compatibility add style that isn't provided via 5236 // block support. 5237 'no-border-radius': style?.border?.radius === 0 5238 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); 5239 const buttonStyle = { 5240 ...borderProps.style, 5241 ...colorProps.style, 5242 ...spacingProps.style, 5243 ...shadowProps.style 5244 }; 5245 5246 // The use of a `title` attribute here is soft-deprecated, but still applied 5247 // if it had already been assigned, for the sake of backward-compatibility. 5248 // A title will no longer be assigned for new or updated button block links. 5249 5250 const wrapperClasses = classnames_default()(className, { 5251 [`has-custom-width wp-block-button__width-$width}`]: width, 5252 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 5253 }); 5254 return (0,external_React_namespaceObject.createElement)("div", { 5255 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 5256 className: wrapperClasses 5257 }) 5258 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 5259 tagName: TagName, 5260 type: isButtonTag ? buttonType : null, 5261 className: buttonClasses, 5262 href: isButtonTag ? null : url, 5263 title: title, 5264 style: buttonStyle, 5265 value: text, 5266 target: isButtonTag ? null : linkTarget, 5267 rel: isButtonTag ? null : rel 5268 })); 5269 } 5270 5271 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js 5272 /** 5273 * WordPress dependencies 5274 */ 5275 5276 5277 5278 /** 5279 * Internal dependencies 5280 */ 5281 5282 5283 5284 const button_metadata = { 5285 $schema: "https://schemas.wp.org/trunk/block.json", 5286 apiVersion: 3, 5287 name: "core/button", 5288 title: "Button", 5289 category: "design", 5290 parent: ["core/buttons"], 5291 description: "Prompt visitors to take action with a button-style link.", 5292 keywords: ["link"], 5293 textdomain: "default", 5294 attributes: { 5295 tagName: { 5296 type: "string", 5297 "enum": ["a", "button"], 5298 "default": "a" 5299 }, 5300 type: { 5301 type: "string", 5302 "default": "button" 5303 }, 5304 textAlign: { 5305 type: "string" 5306 }, 5307 url: { 5308 type: "string", 5309 source: "attribute", 5310 selector: "a", 5311 attribute: "href", 5312 __experimentalRole: "content" 5313 }, 5314 title: { 5315 type: "string", 5316 source: "attribute", 5317 selector: "a,button", 5318 attribute: "title", 5319 __experimentalRole: "content" 5320 }, 5321 text: { 5322 type: "rich-text", 5323 source: "rich-text", 5324 selector: "a,button", 5325 __experimentalRole: "content" 5326 }, 5327 linkTarget: { 5328 type: "string", 5329 source: "attribute", 5330 selector: "a", 5331 attribute: "target", 5332 __experimentalRole: "content" 5333 }, 5334 rel: { 5335 type: "string", 5336 source: "attribute", 5337 selector: "a", 5338 attribute: "rel", 5339 __experimentalRole: "content" 5340 }, 5341 placeholder: { 5342 type: "string" 5343 }, 5344 backgroundColor: { 5345 type: "string" 5346 }, 5347 textColor: { 5348 type: "string" 5349 }, 5350 gradient: { 5351 type: "string" 5352 }, 5353 width: { 5354 type: "number" 5355 } 5356 }, 5357 supports: { 5358 anchor: true, 5359 align: false, 5360 alignWide: false, 5361 color: { 5362 __experimentalSkipSerialization: true, 5363 gradients: true, 5364 __experimentalDefaultControls: { 5365 background: true, 5366 text: true 5367 } 5368 }, 5369 typography: { 5370 fontSize: true, 5371 lineHeight: true, 5372 __experimentalFontFamily: true, 5373 __experimentalFontWeight: true, 5374 __experimentalFontStyle: true, 5375 __experimentalTextTransform: true, 5376 __experimentalTextDecoration: true, 5377 __experimentalLetterSpacing: true, 5378 __experimentalDefaultControls: { 5379 fontSize: true 5380 } 5381 }, 5382 reusable: false, 5383 shadow: { 5384 __experimentalSkipSerialization: true 5385 }, 5386 spacing: { 5387 __experimentalSkipSerialization: true, 5388 padding: ["horizontal", "vertical"], 5389 __experimentalDefaultControls: { 5390 padding: true 5391 } 5392 }, 5393 __experimentalBorder: { 5394 color: true, 5395 radius: true, 5396 style: true, 5397 width: true, 5398 __experimentalSkipSerialization: true, 5399 __experimentalDefaultControls: { 5400 color: true, 5401 radius: true, 5402 style: true, 5403 width: true 5404 } 5405 }, 5406 __experimentalSelector: ".wp-block-button .wp-block-button__link", 5407 interactivity: { 5408 clientNavigation: true 5409 } 5410 }, 5411 styles: [{ 5412 name: "fill", 5413 label: "Fill", 5414 isDefault: true 5415 }, { 5416 name: "outline", 5417 label: "Outline" 5418 }], 5419 editorStyle: "wp-block-button-editor", 5420 style: "wp-block-button" 5421 }; 5422 5423 const { 5424 name: button_name 5425 } = button_metadata; 5426 5427 const button_settings = { 5428 icon: library_button, 5429 example: { 5430 attributes: { 5431 className: 'is-style-fill', 5432 text: (0,external_wp_i18n_namespaceObject.__)('Call to Action') 5433 } 5434 }, 5435 edit: button_edit, 5436 save: save_save, 5437 deprecated: button_deprecated, 5438 merge: (a, { 5439 text = '' 5440 }) => ({ 5441 ...a, 5442 text: (a.text || '') + text 5443 }) 5444 }; 5445 const button_init = () => initBlock({ 5446 name: button_name, 5447 metadata: button_metadata, 5448 settings: button_settings 5449 }); 5450 5451 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js 5452 5453 /** 5454 * WordPress dependencies 5455 */ 5456 5457 const buttons = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 5458 viewBox: "0 0 24 24", 5459 xmlns: "http://www.w3.org/2000/svg" 5460 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 5461 d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" 5462 })); 5463 /* harmony default export */ const library_buttons = (buttons); 5464 5465 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js 5466 5467 /** 5468 * External dependencies 5469 */ 5470 5471 /** 5472 * WordPress dependencies 5473 */ 5474 5475 5476 /** 5477 * @param {Object} attributes Block's attributes. 5478 */ 5479 const migrateWithLayout = attributes => { 5480 if (!!attributes.layout) { 5481 return attributes; 5482 } 5483 const { 5484 contentJustification, 5485 orientation, 5486 ...updatedAttributes 5487 } = attributes; 5488 if (contentJustification || orientation) { 5489 Object.assign(updatedAttributes, { 5490 layout: { 5491 type: 'flex', 5492 ...(contentJustification && { 5493 justifyContent: contentJustification 5494 }), 5495 ...(orientation && { 5496 orientation 5497 }) 5498 } 5499 }); 5500 } 5501 return updatedAttributes; 5502 }; 5503 const buttons_deprecated_deprecated = [{ 5504 attributes: { 5505 contentJustification: { 5506 type: 'string' 5507 }, 5508 orientation: { 5509 type: 'string', 5510 default: 'horizontal' 5511 } 5512 }, 5513 supports: { 5514 anchor: true, 5515 align: ['wide', 'full'], 5516 __experimentalExposeControlsToChildren: true, 5517 spacing: { 5518 blockGap: true, 5519 margin: ['top', 'bottom'], 5520 __experimentalDefaultControls: { 5521 blockGap: true 5522 } 5523 } 5524 }, 5525 isEligible: ({ 5526 contentJustification, 5527 orientation 5528 }) => !!contentJustification || !!orientation, 5529 migrate: migrateWithLayout, 5530 save({ 5531 attributes: { 5532 contentJustification, 5533 orientation 5534 } 5535 }) { 5536 return (0,external_React_namespaceObject.createElement)("div", { 5537 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 5538 className: classnames_default()({ 5539 [`is-content-justification-$contentJustification}`]: contentJustification, 5540 'is-vertical': orientation === 'vertical' 5541 }) 5542 }) 5543 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 5544 } 5545 }, { 5546 supports: { 5547 align: ['center', 'left', 'right'], 5548 anchor: true 5549 }, 5550 save() { 5551 return (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 5552 }, 5553 isEligible({ 5554 align 5555 }) { 5556 return align && ['center', 'left', 'right'].includes(align); 5557 }, 5558 migrate(attributes) { 5559 return migrateWithLayout({ 5560 ...attributes, 5561 align: undefined, 5562 // Floating Buttons blocks shouldn't have been supported in the 5563 // first place. Most users using them probably expected them to 5564 // act like content justification controls, so these blocks are 5565 // migrated to use content justification. 5566 // As for center-aligned Buttons blocks, the content justification 5567 // equivalent will create an identical end result in most cases. 5568 contentJustification: attributes.align 5569 }); 5570 } 5571 }]; 5572 /* harmony default export */ const buttons_deprecated = (buttons_deprecated_deprecated); 5573 5574 ;// CONCATENATED MODULE: external ["wp","richText"] 5575 const external_wp_richText_namespaceObject = window["wp"]["richText"]; 5576 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js 5577 /** 5578 * WordPress dependencies 5579 */ 5580 5581 5582 /** 5583 * Transform the metadata attribute with only the values and bindings specified by each transform. 5584 * Returns `undefined` if the input metadata is falsy. 5585 * 5586 * @param {Object} metadata Original metadata attribute from the block that is being transformed. 5587 * @param {Object} newBlockName Name of the final block after the transformation. 5588 * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object. 5589 * @return {Object|undefined} New metadata object only with the relevant properties. 5590 */ 5591 function getTransformedMetadata(metadata, newBlockName, bindingsCallback) { 5592 if (!metadata) { 5593 return; 5594 } 5595 const { 5596 supports 5597 } = (0,external_wp_blocks_namespaceObject.getBlockType)(newBlockName); 5598 // Fixed until an opt-in mechanism is implemented. 5599 const BLOCK_BINDINGS_SUPPORTED_BLOCKS = ['core/paragraph', 'core/heading', 'core/image', 'core/button']; 5600 // The metadata properties that should be preserved after the transform. 5601 const transformSupportedProps = []; 5602 // If it support bindings, and there is a transform bindings callback, add the `id` and `bindings` properties. 5603 if (BLOCK_BINDINGS_SUPPORTED_BLOCKS.includes(newBlockName) && bindingsCallback) { 5604 transformSupportedProps.push('id', 'bindings'); 5605 } 5606 // If it support block naming (true by default), add the `name` property. 5607 if (supports.renaming !== false) { 5608 transformSupportedProps.push('name'); 5609 } 5610 5611 // Return early if no supported properties. 5612 if (!transformSupportedProps.length) { 5613 return; 5614 } 5615 const newMetadata = Object.entries(metadata).reduce((obj, [prop, value]) => { 5616 // If prop is not supported, don't add it to the new metadata object. 5617 if (!transformSupportedProps.includes(prop)) { 5618 return obj; 5619 } 5620 obj[prop] = prop === 'bindings' ? bindingsCallback(value) : value; 5621 return obj; 5622 }, {}); 5623 5624 // Return undefined if object is empty. 5625 return Object.keys(newMetadata).length ? newMetadata : undefined; 5626 } 5627 5628 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js 5629 /** 5630 * WordPress dependencies 5631 */ 5632 5633 5634 5635 /** 5636 * Internal dependencies 5637 */ 5638 5639 const transforms_transforms = { 5640 from: [{ 5641 type: 'block', 5642 isMultiBlock: true, 5643 blocks: ['core/button'], 5644 transform: buttons => 5645 // Creates the buttons block. 5646 (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, 5647 // Loop the selected buttons. 5648 buttons.map(attributes => 5649 // Create singular button in the buttons block. 5650 (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes))) 5651 }, { 5652 type: 'block', 5653 isMultiBlock: true, 5654 blocks: ['core/paragraph'], 5655 transform: buttons => 5656 // Creates the buttons block. 5657 (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, 5658 // Loop the selected buttons. 5659 buttons.map(attributes => { 5660 const { 5661 content, 5662 metadata 5663 } = attributes; 5664 const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, content); 5665 // Remove any HTML tags. 5666 const text = element.innerText || ''; 5667 // Get first url. 5668 const link = element.querySelector('a'); 5669 const url = link?.getAttribute('href'); 5670 // Create singular button in the buttons block. 5671 return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { 5672 text, 5673 url, 5674 metadata: getTransformedMetadata(metadata, 'core/button', ({ 5675 content: contentBinding 5676 }) => ({ 5677 text: contentBinding 5678 })) 5679 }); 5680 })), 5681 isMatch: paragraphs => { 5682 return paragraphs.every(attributes => { 5683 const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); 5684 const text = element.innerText || ''; 5685 const links = element.querySelectorAll('a'); 5686 return text.length <= 30 && links.length <= 1; 5687 }); 5688 } 5689 }] 5690 }; 5691 /* harmony default export */ const buttons_transforms = (transforms_transforms); 5692 5693 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js 5694 5695 /** 5696 * External dependencies 5697 */ 5698 5699 5700 /** 5701 * WordPress dependencies 5702 */ 5703 5704 5705 5706 const DEFAULT_BLOCK = { 5707 name: 'core/button', 5708 attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width'] 5709 }; 5710 function ButtonsEdit({ 5711 attributes, 5712 className 5713 }) { 5714 var _layout$orientation; 5715 const { 5716 fontSize, 5717 layout, 5718 style 5719 } = attributes; 5720 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 5721 className: classnames_default()(className, { 5722 'has-custom-font-size': fontSize || style?.typography?.fontSize 5723 }) 5724 }); 5725 const { 5726 preferredStyle, 5727 hasButtonVariations 5728 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 5729 const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations; 5730 const buttonVariations = select(external_wp_blocks_namespaceObject.store).getBlockVariations('core/button', 'inserter'); 5731 return { 5732 preferredStyle: preferredStyleVariations?.value?.['core/button'], 5733 hasButtonVariations: buttonVariations.length > 0 5734 }; 5735 }, []); 5736 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 5737 defaultBlock: DEFAULT_BLOCK, 5738 // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. 5739 directInsert: !hasButtonVariations, 5740 template: [['core/button', { 5741 className: preferredStyle && `is-style-$preferredStyle}` 5742 }]], 5743 templateInsertUpdatesSelection: true, 5744 orientation: (_layout$orientation = layout?.orientation) !== null && _layout$orientation !== void 0 ? _layout$orientation : 'horizontal' 5745 }); 5746 return (0,external_React_namespaceObject.createElement)("div", { 5747 ...innerBlocksProps 5748 }); 5749 } 5750 /* harmony default export */ const buttons_edit = (ButtonsEdit); 5751 5752 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js 5753 5754 /** 5755 * External dependencies 5756 */ 5757 5758 5759 /** 5760 * WordPress dependencies 5761 */ 5762 5763 function buttons_save_save({ 5764 attributes, 5765 className 5766 }) { 5767 const { 5768 fontSize, 5769 style 5770 } = attributes; 5771 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 5772 className: classnames_default()(className, { 5773 'has-custom-font-size': fontSize || style?.typography?.fontSize 5774 }) 5775 }); 5776 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 5777 return (0,external_React_namespaceObject.createElement)("div", { 5778 ...innerBlocksProps 5779 }); 5780 } 5781 5782 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js 5783 /** 5784 * WordPress dependencies 5785 */ 5786 5787 5788 5789 /** 5790 * Internal dependencies 5791 */ 5792 5793 5794 5795 5796 const buttons_metadata = { 5797 $schema: "https://schemas.wp.org/trunk/block.json", 5798 apiVersion: 3, 5799 name: "core/buttons", 5800 title: "Buttons", 5801 category: "design", 5802 allowedBlocks: ["core/button"], 5803 description: "Prompt visitors to take action with a group of button-style links.", 5804 keywords: ["link"], 5805 textdomain: "default", 5806 supports: { 5807 anchor: true, 5808 align: ["wide", "full"], 5809 html: false, 5810 __experimentalExposeControlsToChildren: true, 5811 spacing: { 5812 blockGap: true, 5813 margin: ["top", "bottom"], 5814 __experimentalDefaultControls: { 5815 blockGap: true 5816 } 5817 }, 5818 typography: { 5819 fontSize: true, 5820 lineHeight: true, 5821 __experimentalFontFamily: true, 5822 __experimentalFontWeight: true, 5823 __experimentalFontStyle: true, 5824 __experimentalTextTransform: true, 5825 __experimentalTextDecoration: true, 5826 __experimentalLetterSpacing: true, 5827 __experimentalDefaultControls: { 5828 fontSize: true 5829 } 5830 }, 5831 layout: { 5832 allowSwitching: false, 5833 allowInheriting: false, 5834 "default": { 5835 type: "flex" 5836 } 5837 }, 5838 interactivity: { 5839 clientNavigation: true 5840 } 5841 }, 5842 editorStyle: "wp-block-buttons-editor", 5843 style: "wp-block-buttons" 5844 }; 5845 5846 const { 5847 name: buttons_name 5848 } = buttons_metadata; 5849 5850 const buttons_settings = { 5851 icon: library_buttons, 5852 example: { 5853 innerBlocks: [{ 5854 name: 'core/button', 5855 attributes: { 5856 text: (0,external_wp_i18n_namespaceObject.__)('Find out more') 5857 } 5858 }, { 5859 name: 'core/button', 5860 attributes: { 5861 text: (0,external_wp_i18n_namespaceObject.__)('Contact us') 5862 } 5863 }] 5864 }, 5865 deprecated: buttons_deprecated, 5866 transforms: buttons_transforms, 5867 edit: buttons_edit, 5868 save: buttons_save_save 5869 }; 5870 const buttons_init = () => initBlock({ 5871 name: buttons_name, 5872 metadata: buttons_metadata, 5873 settings: buttons_settings 5874 }); 5875 5876 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js 5877 5878 /** 5879 * WordPress dependencies 5880 */ 5881 5882 const calendar = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 5883 viewBox: "0 0 24 24", 5884 xmlns: "http://www.w3.org/2000/svg" 5885 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 5886 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" 5887 })); 5888 /* harmony default export */ const library_calendar = (calendar); 5889 5890 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js 5891 5892 /** 5893 * External dependencies 5894 */ 5895 5896 5897 /** 5898 * WordPress dependencies 5899 */ 5900 5901 5902 5903 5904 5905 5906 5907 5908 /** 5909 * Returns the year and month of a specified date. 5910 * 5911 * @see `WP_REST_Posts_Controller::prepare_date_response()`. 5912 * 5913 * @param {string} date Date in `ISO8601/RFC3339` format. 5914 * @return {Object} Year and date of the specified date. 5915 */ 5916 const getYearMonth = memize(date => { 5917 if (!date) { 5918 return {}; 5919 } 5920 const dateObj = new Date(date); 5921 return { 5922 year: dateObj.getFullYear(), 5923 month: dateObj.getMonth() + 1 5924 }; 5925 }); 5926 function CalendarEdit({ 5927 attributes 5928 }) { 5929 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 5930 const { 5931 date, 5932 hasPosts, 5933 hasPostsResolved 5934 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 5935 const { 5936 getEntityRecords, 5937 hasFinishedResolution 5938 } = select(external_wp_coreData_namespaceObject.store); 5939 const singlePublishedPostQuery = { 5940 status: 'publish', 5941 per_page: 1 5942 }; 5943 const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery); 5944 const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]); 5945 let _date; 5946 5947 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 5948 // Blocks can be loaded into a *non-post* block editor. 5949 // eslint-disable-next-line @wordpress/data-no-store-string-literals 5950 const editorSelectors = select('core/editor'); 5951 if (editorSelectors) { 5952 const postType = editorSelectors.getEditedPostAttribute('type'); 5953 // Dates are used to overwrite year and month used on the calendar. 5954 // This overwrite should only happen for 'post' post types. 5955 // For other post types the calendar always displays the current month. 5956 if (postType === 'post') { 5957 _date = editorSelectors.getEditedPostAttribute('date'); 5958 } 5959 } 5960 return { 5961 date: _date, 5962 hasPostsResolved: postsResolved, 5963 hasPosts: postsResolved && posts?.length === 1 5964 }; 5965 }, []); 5966 if (!hasPosts) { 5967 return (0,external_React_namespaceObject.createElement)("div", { 5968 ...blockProps 5969 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 5970 icon: library_calendar, 5971 label: (0,external_wp_i18n_namespaceObject.__)('Calendar') 5972 }, !hasPostsResolved ? (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.'))); 5973 } 5974 return (0,external_React_namespaceObject.createElement)("div", { 5975 ...blockProps 5976 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)((external_wp_serverSideRender_default()), { 5977 block: "core/calendar", 5978 attributes: { 5979 ...attributes, 5980 ...getYearMonth(date) 5981 } 5982 }))); 5983 } 5984 5985 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js 5986 /** 5987 * WordPress dependencies 5988 */ 5989 5990 const calendar_transforms_transforms = { 5991 from: [{ 5992 type: 'block', 5993 blocks: ['core/archives'], 5994 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar') 5995 }], 5996 to: [{ 5997 type: 'block', 5998 blocks: ['core/archives'], 5999 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives') 6000 }] 6001 }; 6002 /* harmony default export */ const calendar_transforms = (calendar_transforms_transforms); 6003 6004 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js 6005 /** 6006 * WordPress dependencies 6007 */ 6008 6009 6010 /** 6011 * Internal dependencies 6012 */ 6013 6014 const calendar_metadata = { 6015 $schema: "https://schemas.wp.org/trunk/block.json", 6016 apiVersion: 3, 6017 name: "core/calendar", 6018 title: "Calendar", 6019 category: "widgets", 6020 description: "A calendar of your site\u2019s posts.", 6021 keywords: ["posts", "archive"], 6022 textdomain: "default", 6023 attributes: { 6024 month: { 6025 type: "integer" 6026 }, 6027 year: { 6028 type: "integer" 6029 } 6030 }, 6031 supports: { 6032 align: true, 6033 color: { 6034 link: true, 6035 __experimentalSkipSerialization: ["text", "background"], 6036 __experimentalDefaultControls: { 6037 background: true, 6038 text: true 6039 }, 6040 __experimentalSelector: "table, th" 6041 }, 6042 typography: { 6043 fontSize: true, 6044 lineHeight: true, 6045 __experimentalFontFamily: true, 6046 __experimentalFontWeight: true, 6047 __experimentalFontStyle: true, 6048 __experimentalTextTransform: true, 6049 __experimentalLetterSpacing: true, 6050 __experimentalDefaultControls: { 6051 fontSize: true 6052 } 6053 }, 6054 interactivity: { 6055 clientNavigation: true 6056 } 6057 }, 6058 style: "wp-block-calendar" 6059 }; 6060 6061 6062 const { 6063 name: calendar_name 6064 } = calendar_metadata; 6065 6066 const calendar_settings = { 6067 icon: library_calendar, 6068 example: {}, 6069 edit: CalendarEdit, 6070 transforms: calendar_transforms 6071 }; 6072 const calendar_init = () => initBlock({ 6073 name: calendar_name, 6074 metadata: calendar_metadata, 6075 settings: calendar_settings 6076 }); 6077 6078 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js 6079 6080 /** 6081 * WordPress dependencies 6082 */ 6083 6084 const category = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 6085 viewBox: "0 0 24 24", 6086 xmlns: "http://www.w3.org/2000/svg" 6087 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 6088 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", 6089 fillRule: "evenodd", 6090 clipRule: "evenodd" 6091 })); 6092 /* harmony default export */ const library_category = (category); 6093 6094 ;// CONCATENATED MODULE: external ["wp","htmlEntities"] 6095 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; 6096 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js 6097 6098 /** 6099 * WordPress dependencies 6100 */ 6101 6102 const pin = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 6103 xmlns: "http://www.w3.org/2000/svg", 6104 viewBox: "0 0 24 24" 6105 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 6106 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" 6107 })); 6108 /* harmony default export */ const library_pin = (pin); 6109 6110 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js 6111 6112 /** 6113 * External dependencies 6114 */ 6115 6116 6117 /** 6118 * WordPress dependencies 6119 */ 6120 6121 6122 6123 6124 6125 6126 6127 function CategoriesEdit({ 6128 attributes: { 6129 displayAsDropdown, 6130 showHierarchy, 6131 showPostCounts, 6132 showOnlyTopLevel, 6133 showEmpty 6134 }, 6135 setAttributes, 6136 className 6137 }) { 6138 const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); 6139 const query = { 6140 per_page: -1, 6141 hide_empty: !showEmpty, 6142 context: 'view' 6143 }; 6144 if (showOnlyTopLevel) { 6145 query.parent = 0; 6146 } 6147 const { 6148 records: categories, 6149 isResolving 6150 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', query); 6151 const getCategoriesList = parentId => { 6152 if (!categories?.length) { 6153 return []; 6154 } 6155 if (parentId === null) { 6156 return categories; 6157 } 6158 return categories.filter(({ 6159 parent 6160 }) => parent === parentId); 6161 }; 6162 const toggleAttribute = attributeName => newValue => setAttributes({ 6163 [attributeName]: newValue 6164 }); 6165 const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim(); 6166 const renderCategoryList = () => { 6167 const parentId = showHierarchy ? 0 : null; 6168 const categoriesList = getCategoriesList(parentId); 6169 return categoriesList.map(category => renderCategoryListItem(category)); 6170 }; 6171 const renderCategoryListItem = category => { 6172 const childCategories = getCategoriesList(category.id); 6173 const { 6174 id, 6175 link, 6176 count, 6177 name 6178 } = category; 6179 return (0,external_React_namespaceObject.createElement)("li", { 6180 key: id, 6181 className: `cat-item cat-item-$id}` 6182 }, (0,external_React_namespaceObject.createElement)("a", { 6183 href: link, 6184 target: "_blank", 6185 rel: "noreferrer noopener" 6186 }, renderCategoryName(name)), showPostCounts && ` ($count})`, showHierarchy && !!childCategories.length && (0,external_React_namespaceObject.createElement)("ul", { 6187 className: "children" 6188 }, childCategories.map(childCategory => renderCategoryListItem(childCategory)))); 6189 }; 6190 const renderCategoryDropdown = () => { 6191 const parentId = showHierarchy ? 0 : null; 6192 const categoriesList = getCategoriesList(parentId); 6193 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { 6194 as: "label", 6195 htmlFor: selectId 6196 }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_React_namespaceObject.createElement)("select", { 6197 id: selectId 6198 }, (0,external_React_namespaceObject.createElement)("option", null, (0,external_wp_i18n_namespaceObject.__)('Select Category')), categoriesList.map(category => renderCategoryDropdownItem(category, 0)))); 6199 }; 6200 const renderCategoryDropdownItem = (category, level) => { 6201 const { 6202 id, 6203 count, 6204 name 6205 } = category; 6206 const childCategories = getCategoriesList(id); 6207 return [(0,external_React_namespaceObject.createElement)("option", { 6208 key: id, 6209 className: `level-$level}` 6210 }, Array.from({ 6211 length: level * 3 6212 }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` ($count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; 6213 }; 6214 const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div'; 6215 const classes = classnames_default()(className, { 6216 'wp-block-categories-list': !!categories?.length && !displayAsDropdown && !isResolving, 6217 'wp-block-categories-dropdown': !!categories?.length && displayAsDropdown && !isResolving 6218 }); 6219 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 6220 className: classes 6221 }); 6222 return (0,external_React_namespaceObject.createElement)(TagName, { 6223 ...blockProps 6224 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 6225 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 6226 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 6227 __nextHasNoMarginBottom: true, 6228 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 6229 checked: displayAsDropdown, 6230 onChange: toggleAttribute('displayAsDropdown') 6231 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 6232 __nextHasNoMarginBottom: true, 6233 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 6234 checked: showPostCounts, 6235 onChange: toggleAttribute('showPostCounts') 6236 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 6237 __nextHasNoMarginBottom: true, 6238 label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'), 6239 checked: showOnlyTopLevel, 6240 onChange: toggleAttribute('showOnlyTopLevel') 6241 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 6242 __nextHasNoMarginBottom: true, 6243 label: (0,external_wp_i18n_namespaceObject.__)('Show empty categories'), 6244 checked: showEmpty, 6245 onChange: toggleAttribute('showEmpty') 6246 }), !showOnlyTopLevel && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 6247 __nextHasNoMarginBottom: true, 6248 label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), 6249 checked: showHierarchy, 6250 onChange: toggleAttribute('showHierarchy') 6251 }))), isResolving && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 6252 icon: library_pin, 6253 label: (0,external_wp_i18n_namespaceObject.__)('Categories') 6254 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && categories?.length === 0 && (0,external_React_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?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())); 6255 } 6256 6257 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js 6258 /** 6259 * WordPress dependencies 6260 */ 6261 6262 6263 /** 6264 * Internal dependencies 6265 */ 6266 6267 const categories_metadata = { 6268 $schema: "https://schemas.wp.org/trunk/block.json", 6269 apiVersion: 3, 6270 name: "core/categories", 6271 title: "Categories List", 6272 category: "widgets", 6273 description: "Display a list of all categories.", 6274 textdomain: "default", 6275 attributes: { 6276 displayAsDropdown: { 6277 type: "boolean", 6278 "default": false 6279 }, 6280 showHierarchy: { 6281 type: "boolean", 6282 "default": false 6283 }, 6284 showPostCounts: { 6285 type: "boolean", 6286 "default": false 6287 }, 6288 showOnlyTopLevel: { 6289 type: "boolean", 6290 "default": false 6291 }, 6292 showEmpty: { 6293 type: "boolean", 6294 "default": false 6295 } 6296 }, 6297 supports: { 6298 align: true, 6299 html: false, 6300 spacing: { 6301 margin: true, 6302 padding: true, 6303 __experimentalDefaultControls: { 6304 margin: false, 6305 padding: false 6306 } 6307 }, 6308 typography: { 6309 fontSize: true, 6310 lineHeight: true, 6311 __experimentalFontFamily: true, 6312 __experimentalFontWeight: true, 6313 __experimentalFontStyle: true, 6314 __experimentalTextTransform: true, 6315 __experimentalTextDecoration: true, 6316 __experimentalLetterSpacing: true, 6317 __experimentalDefaultControls: { 6318 fontSize: true 6319 } 6320 }, 6321 interactivity: { 6322 clientNavigation: true 6323 } 6324 }, 6325 editorStyle: "wp-block-categories-editor", 6326 style: "wp-block-categories" 6327 }; 6328 6329 const { 6330 name: categories_name 6331 } = categories_metadata; 6332 6333 const categories_settings = { 6334 icon: library_category, 6335 example: {}, 6336 edit: CategoriesEdit 6337 }; 6338 const categories_init = () => initBlock({ 6339 name: categories_name, 6340 metadata: categories_metadata, 6341 settings: categories_settings 6342 }); 6343 6344 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js 6345 6346 /** 6347 * WordPress dependencies 6348 */ 6349 6350 const classic = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 6351 viewBox: "0 0 24 24", 6352 xmlns: "http://www.w3.org/2000/svg" 6353 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 6354 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" 6355 })); 6356 /* harmony default export */ const library_classic = (classic); 6357 6358 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js 6359 6360 /** 6361 * WordPress dependencies 6362 */ 6363 6364 6365 6366 6367 6368 const ConvertToBlocksButton = ({ 6369 clientId 6370 }) => { 6371 const { 6372 replaceBlocks 6373 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 6374 const block = (0,external_wp_data_namespaceObject.useSelect)(select => { 6375 return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId); 6376 }, [clientId]); 6377 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 6378 onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ 6379 HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) 6380 })) 6381 }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks')); 6382 }; 6383 /* harmony default export */ const convert_to_blocks_button = (ConvertToBlocksButton); 6384 6385 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js 6386 6387 /** 6388 * WordPress dependencies 6389 */ 6390 6391 const fullscreen = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 6392 xmlns: "http://www.w3.org/2000/svg", 6393 viewBox: "0 0 24 24" 6394 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 6395 d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" 6396 })); 6397 /* harmony default export */ const library_fullscreen = (fullscreen); 6398 6399 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/modal.js 6400 6401 /** 6402 * WordPress dependencies 6403 */ 6404 6405 6406 6407 6408 6409 6410 6411 function ModalAuxiliaryActions({ 6412 onClick, 6413 isModalFullScreen 6414 }) { 6415 // 'small' to match the rules in editor.scss. 6416 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); 6417 if (isMobileViewport) { 6418 return null; 6419 } 6420 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 6421 onClick: onClick, 6422 icon: library_fullscreen, 6423 isPressed: isModalFullScreen, 6424 label: isModalFullScreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen') 6425 }); 6426 } 6427 function ClassicEdit(props) { 6428 const styles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles); 6429 (0,external_wp_element_namespaceObject.useEffect)(() => { 6430 const { 6431 baseURL, 6432 suffix, 6433 settings 6434 } = window.wpEditorL10n.tinymce; 6435 window.tinymce.EditorManager.overrideDefaults({ 6436 base_url: baseURL, 6437 suffix 6438 }); 6439 window.wp.oldEditor.initialize(props.id, { 6440 tinymce: { 6441 ...settings, 6442 setup(editor) { 6443 editor.on('init', () => { 6444 const doc = editor.getDoc(); 6445 styles.forEach(({ 6446 css 6447 }) => { 6448 const styleEl = doc.createElement('style'); 6449 styleEl.innerHTML = css; 6450 doc.head.appendChild(styleEl); 6451 }); 6452 }); 6453 } 6454 } 6455 }); 6456 return () => { 6457 window.wp.oldEditor.remove(props.id); 6458 }; 6459 }, []); 6460 return (0,external_React_namespaceObject.createElement)("textarea", { 6461 ...props 6462 }); 6463 } 6464 function ModalEdit(props) { 6465 const { 6466 clientId, 6467 attributes: { 6468 content 6469 }, 6470 setAttributes, 6471 onReplace 6472 } = props; 6473 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 6474 const [isModalFullScreen, setIsModalFullScreen] = (0,external_wp_element_namespaceObject.useState)(false); 6475 const id = `editor-$clientId}`; 6476 const onClose = () => content ? setOpen(false) : onReplace([]); 6477 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 6478 onClick: () => setOpen(true) 6479 }, (0,external_wp_i18n_namespaceObject.__)('Edit')))), content && (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content), (isOpen || !content) && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 6480 title: (0,external_wp_i18n_namespaceObject.__)('Classic Editor'), 6481 onRequestClose: onClose, 6482 shouldCloseOnClickOutside: false, 6483 overlayClassName: "block-editor-freeform-modal", 6484 isFullScreen: isModalFullScreen, 6485 className: "block-editor-freeform-modal__content", 6486 headerActions: (0,external_React_namespaceObject.createElement)(ModalAuxiliaryActions, { 6487 onClick: () => setIsModalFullScreen(!isModalFullScreen), 6488 isModalFullScreen: isModalFullScreen 6489 }) 6490 }, (0,external_React_namespaceObject.createElement)(ClassicEdit, { 6491 id: id, 6492 defaultValue: content 6493 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, { 6494 className: "block-editor-freeform-modal__actions", 6495 justify: "flex-end", 6496 expanded: false 6497 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 6498 variant: "tertiary", 6499 onClick: onClose 6500 }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 6501 variant: "primary", 6502 onClick: () => { 6503 setAttributes({ 6504 content: window.wp.oldEditor.getContent(id) 6505 }); 6506 setOpen(false); 6507 } 6508 }, (0,external_wp_i18n_namespaceObject.__)('Save')))))); 6509 } 6510 6511 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js 6512 6513 /** 6514 * WordPress dependencies 6515 */ 6516 6517 6518 6519 6520 6521 6522 6523 6524 /** 6525 * Internal dependencies 6526 */ 6527 6528 6529 const { 6530 wp 6531 } = window; 6532 function isTmceEmpty(editor) { 6533 // When tinyMce is empty the content seems to be: 6534 // <p><br data-mce-bogus="1"></p> 6535 // avoid expensive checks for large documents 6536 const body = editor.getBody(); 6537 if (body.childNodes.length > 1) { 6538 return false; 6539 } else if (body.childNodes.length === 0) { 6540 return true; 6541 } 6542 if (body.childNodes[0].childNodes.length > 1) { 6543 return false; 6544 } 6545 return /^\n?$/.test(body.innerText || body.textContent); 6546 } 6547 function FreeformEdit(props) { 6548 const { 6549 clientId 6550 } = props; 6551 const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); 6552 const [isIframed, setIsIframed] = (0,external_wp_element_namespaceObject.useState)(false); 6553 const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 6554 setIsIframed(element.ownerDocument !== document); 6555 }, []); 6556 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, canRemove && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(convert_to_blocks_button, { 6557 clientId: clientId 6558 }))), (0,external_React_namespaceObject.createElement)("div", { 6559 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 6560 ref 6561 }) 6562 }, isIframed ? (0,external_React_namespaceObject.createElement)(ModalEdit, { 6563 ...props 6564 }) : (0,external_React_namespaceObject.createElement)(edit_ClassicEdit, { 6565 ...props 6566 }))); 6567 } 6568 function edit_ClassicEdit({ 6569 clientId, 6570 attributes: { 6571 content 6572 }, 6573 setAttributes, 6574 onReplace 6575 }) { 6576 const { 6577 getMultiSelectedBlockClientIds 6578 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 6579 const didMount = (0,external_wp_element_namespaceObject.useRef)(false); 6580 (0,external_wp_element_namespaceObject.useEffect)(() => { 6581 if (!didMount.current) { 6582 return; 6583 } 6584 const editor = window.tinymce.get(`editor-$clientId}`); 6585 const currentContent = editor?.getContent(); 6586 if (currentContent !== content) { 6587 editor.setContent(content || ''); 6588 } 6589 }, [content]); 6590 (0,external_wp_element_namespaceObject.useEffect)(() => { 6591 const { 6592 baseURL, 6593 suffix 6594 } = window.wpEditorL10n.tinymce; 6595 didMount.current = true; 6596 window.tinymce.EditorManager.overrideDefaults({ 6597 base_url: baseURL, 6598 suffix 6599 }); 6600 function onSetup(editor) { 6601 let bookmark; 6602 if (content) { 6603 editor.on('loadContent', () => editor.setContent(content)); 6604 } 6605 editor.on('blur', () => { 6606 bookmark = editor.selection.getBookmark(2, true); 6607 // 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. 6608 // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking 6609 // scroll position until this is fixed in core. 6610 const scrollContainer = document.querySelector('.interface-interface-skeleton__content'); 6611 const scrollPosition = scrollContainer.scrollTop; 6612 6613 // Only update attributes if we aren't multi-selecting blocks. 6614 // Updating during multi-selection can overwrite attributes of other blocks. 6615 if (!getMultiSelectedBlockClientIds()?.length) { 6616 setAttributes({ 6617 content: editor.getContent() 6618 }); 6619 } 6620 editor.once('focus', () => { 6621 if (bookmark) { 6622 editor.selection.moveToBookmark(bookmark); 6623 if (scrollContainer.scrollTop !== scrollPosition) { 6624 scrollContainer.scrollTop = scrollPosition; 6625 } 6626 } 6627 }); 6628 return false; 6629 }); 6630 editor.on('mousedown touchstart', () => { 6631 bookmark = null; 6632 }); 6633 const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => { 6634 const value = editor.getContent(); 6635 if (value !== editor._lastChange) { 6636 editor._lastChange = value; 6637 setAttributes({ 6638 content: value 6639 }); 6640 } 6641 }, 250); 6642 editor.on('Paste Change input Undo Redo', debouncedOnChange); 6643 6644 // We need to cancel the debounce call because when we remove 6645 // the editor (onUnmount) this callback is executed in 6646 // another tick. This results in setting the content to empty. 6647 editor.on('remove', debouncedOnChange.cancel); 6648 editor.on('keydown', event => { 6649 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) { 6650 // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected. 6651 event.stopPropagation(); 6652 } 6653 if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) { 6654 // Delete the block. 6655 onReplace([]); 6656 event.preventDefault(); 6657 event.stopImmediatePropagation(); 6658 } 6659 const { 6660 altKey 6661 } = event; 6662 /* 6663 * Prevent Mousetrap from kicking in: TinyMCE already uses its own 6664 * `alt+f10` shortcut to focus its toolbar. 6665 */ 6666 if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) { 6667 event.stopPropagation(); 6668 } 6669 }); 6670 editor.on('init', () => { 6671 const rootNode = editor.getBody(); 6672 6673 // Create the toolbar by refocussing the editor. 6674 if (rootNode.ownerDocument.activeElement === rootNode) { 6675 rootNode.blur(); 6676 editor.focus(); 6677 } 6678 }); 6679 } 6680 function initialize() { 6681 const { 6682 settings 6683 } = window.wpEditorL10n.tinymce; 6684 wp.oldEditor.initialize(`editor-$clientId}`, { 6685 tinymce: { 6686 ...settings, 6687 inline: true, 6688 content_css: false, 6689 fixed_toolbar_container: `#toolbar-$clientId}`, 6690 setup: onSetup 6691 } 6692 }); 6693 } 6694 function onReadyStateChange() { 6695 if (document.readyState === 'complete') { 6696 initialize(); 6697 } 6698 } 6699 if (document.readyState === 'complete') { 6700 initialize(); 6701 } else { 6702 document.addEventListener('readystatechange', onReadyStateChange); 6703 } 6704 return () => { 6705 document.removeEventListener('readystatechange', onReadyStateChange); 6706 wp.oldEditor.remove(`editor-$clientId}`); 6707 }; 6708 }, []); 6709 function focus() { 6710 const editor = window.tinymce.get(`editor-$clientId}`); 6711 if (editor) { 6712 editor.focus(); 6713 } 6714 } 6715 function onToolbarKeyDown(event) { 6716 // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar. 6717 event.stopPropagation(); 6718 // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar. 6719 event.nativeEvent.stopImmediatePropagation(); 6720 } 6721 6722 // Disable reasons: 6723 // 6724 // jsx-a11y/no-static-element-interactions 6725 // - the toolbar itself is non-interactive, but must capture events 6726 // from the KeyboardShortcuts component to stop their propagation. 6727 6728 /* eslint-disable jsx-a11y/no-static-element-interactions */ 6729 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", { 6730 key: "toolbar", 6731 id: `toolbar-$clientId}`, 6732 className: "block-library-classic__toolbar", 6733 onClick: focus, 6734 "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), 6735 onKeyDown: onToolbarKeyDown 6736 }), (0,external_React_namespaceObject.createElement)("div", { 6737 key: "editor", 6738 id: `editor-$clientId}`, 6739 className: "wp-block-freeform block-library-rich-text__tinymce" 6740 })); 6741 /* eslint-enable jsx-a11y/no-static-element-interactions */ 6742 } 6743 6744 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js 6745 6746 /** 6747 * WordPress dependencies 6748 */ 6749 6750 function freeform_save_save({ 6751 attributes 6752 }) { 6753 const { 6754 content 6755 } = attributes; 6756 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content); 6757 } 6758 6759 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js 6760 /** 6761 * WordPress dependencies 6762 */ 6763 6764 6765 /** 6766 * Internal dependencies 6767 */ 6768 6769 6770 const freeform_metadata = { 6771 $schema: "https://schemas.wp.org/trunk/block.json", 6772 apiVersion: 3, 6773 name: "core/freeform", 6774 title: "Classic", 6775 category: "text", 6776 description: "Use the classic WordPress editor.", 6777 textdomain: "default", 6778 attributes: { 6779 content: { 6780 type: "string", 6781 source: "raw" 6782 } 6783 }, 6784 supports: { 6785 className: false, 6786 customClassName: false, 6787 reusable: false 6788 }, 6789 editorStyle: "wp-block-freeform-editor" 6790 }; 6791 6792 const { 6793 name: freeform_name 6794 } = freeform_metadata; 6795 6796 const freeform_settings = { 6797 icon: library_classic, 6798 edit: FreeformEdit, 6799 save: freeform_save_save 6800 }; 6801 const freeform_init = () => initBlock({ 6802 name: freeform_name, 6803 metadata: freeform_metadata, 6804 settings: freeform_settings 6805 }); 6806 6807 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js 6808 6809 /** 6810 * WordPress dependencies 6811 */ 6812 6813 const code = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 6814 viewBox: "0 0 24 24", 6815 xmlns: "http://www.w3.org/2000/svg" 6816 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 6817 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" 6818 })); 6819 /* harmony default export */ const library_code = (code); 6820 6821 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js 6822 6823 /** 6824 * WordPress dependencies 6825 */ 6826 6827 6828 6829 function CodeEdit({ 6830 attributes, 6831 setAttributes, 6832 onRemove, 6833 insertBlocksAfter, 6834 mergeBlocks 6835 }) { 6836 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 6837 return (0,external_React_namespaceObject.createElement)("pre", { 6838 ...blockProps 6839 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 6840 tagName: "code", 6841 identifier: "content", 6842 value: attributes.content, 6843 onChange: content => setAttributes({ 6844 content 6845 }), 6846 onRemove: onRemove, 6847 onMerge: mergeBlocks, 6848 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), 6849 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), 6850 preserveWhiteSpace: true, 6851 __unstablePastePlainText: true, 6852 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 6853 })); 6854 } 6855 6856 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js 6857 /** 6858 * WordPress dependencies 6859 */ 6860 6861 6862 /** 6863 * Escapes ampersands, shortcodes, and links. 6864 * 6865 * @param {string} content The content of a code block. 6866 * @return {string} The given content with some characters escaped. 6867 */ 6868 function utils_escape(content) { 6869 return (0,external_wp_compose_namespaceObject.pipe)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); 6870 } 6871 6872 /** 6873 * Returns the given content with all opening shortcode characters converted 6874 * into their HTML entity counterpart (i.e. [ => [). For instance, a 6875 * shortcode like [embed] becomes [embed] 6876 * 6877 * This function replicates the escaping of HTML tags, where a tag like 6878 * <strong> becomes <strong>. 6879 * 6880 * @param {string} content The content of a code block. 6881 * @return {string} The given content with its opening shortcode characters 6882 * converted into their HTML entity counterpart 6883 * (i.e. [ => [) 6884 */ 6885 function escapeOpeningSquareBrackets(content) { 6886 return content.replace(/\[/g, '['); 6887 } 6888 6889 /** 6890 * Converts the first two forward slashes of any isolated URL into their HTML 6891 * counterparts (i.e. // => //). For instance, https://youtube.com/watch?x 6892 * becomes https://youtube.com/watch?x. 6893 * 6894 * An isolated URL is a URL that sits in its own line, surrounded only by spacing 6895 * characters. 6896 * 6897 * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403 6898 * 6899 * @param {string} content The content of a code block. 6900 * @return {string} The given content with its ampersands converted into 6901 * their HTML entity counterpart (i.e. & => &) 6902 */ 6903 function escapeProtocolInIsolatedUrls(content) { 6904 return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); 6905 } 6906 6907 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js 6908 6909 /** 6910 * WordPress dependencies 6911 */ 6912 6913 6914 /** 6915 * Internal dependencies 6916 */ 6917 6918 function code_save_save({ 6919 attributes 6920 }) { 6921 return (0,external_React_namespaceObject.createElement)("pre", { 6922 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 6923 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 6924 tagName: "code" 6925 // To do: `escape` encodes characters in shortcodes and URLs to 6926 // prevent embedding in PHP. Ideally checks for the code block, 6927 // or pre/code tags, should be made on the PHP side? 6928 , 6929 value: utils_escape(typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString({ 6930 preserveWhiteSpace: true 6931 })) 6932 })); 6933 } 6934 6935 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js 6936 /** 6937 * WordPress dependencies 6938 */ 6939 6940 6941 6942 /** 6943 * Internal dependencies 6944 */ 6945 6946 const code_transforms_transforms = { 6947 from: [{ 6948 type: 'enter', 6949 regExp: /^```$/, 6950 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code') 6951 }, { 6952 type: 'block', 6953 blocks: ['core/paragraph'], 6954 transform: ({ 6955 content, 6956 metadata 6957 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { 6958 content, 6959 metadata: getTransformedMetadata(metadata, 'core/code') 6960 }) 6961 }, { 6962 type: 'block', 6963 blocks: ['core/html'], 6964 transform: ({ 6965 content: text, 6966 metadata 6967 }) => { 6968 return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { 6969 // The HTML is plain text (with plain line breaks), so 6970 // convert it to rich text. 6971 content: (0,external_wp_richText_namespaceObject.toHTMLString)({ 6972 value: (0,external_wp_richText_namespaceObject.create)({ 6973 text 6974 }) 6975 }), 6976 metadata: getTransformedMetadata(metadata, 'core/code') 6977 }); 6978 } 6979 }, { 6980 type: 'raw', 6981 isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE', 6982 schema: { 6983 pre: { 6984 children: { 6985 code: { 6986 children: { 6987 '#text': {} 6988 } 6989 } 6990 } 6991 } 6992 } 6993 }], 6994 to: [{ 6995 type: 'block', 6996 blocks: ['core/paragraph'], 6997 transform: ({ 6998 content, 6999 metadata 7000 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 7001 content, 7002 metadata: getTransformedMetadata(metadata, 'core/paragraph') 7003 }) 7004 }] 7005 }; 7006 /* harmony default export */ const code_transforms = (code_transforms_transforms); 7007 7008 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js 7009 /** 7010 * WordPress dependencies 7011 */ 7012 7013 7014 7015 /** 7016 * Internal dependencies 7017 */ 7018 7019 7020 const code_metadata = { 7021 $schema: "https://schemas.wp.org/trunk/block.json", 7022 apiVersion: 3, 7023 name: "core/code", 7024 title: "Code", 7025 category: "text", 7026 description: "Display code snippets that respect your spacing and tabs.", 7027 textdomain: "default", 7028 attributes: { 7029 content: { 7030 type: "rich-text", 7031 source: "rich-text", 7032 selector: "code", 7033 __unstablePreserveWhiteSpace: true 7034 } 7035 }, 7036 supports: { 7037 align: ["wide"], 7038 anchor: true, 7039 typography: { 7040 fontSize: true, 7041 lineHeight: true, 7042 __experimentalFontFamily: true, 7043 __experimentalFontWeight: true, 7044 __experimentalFontStyle: true, 7045 __experimentalTextTransform: true, 7046 __experimentalTextDecoration: true, 7047 __experimentalLetterSpacing: true, 7048 __experimentalDefaultControls: { 7049 fontSize: true 7050 } 7051 }, 7052 spacing: { 7053 margin: ["top", "bottom"], 7054 padding: true, 7055 __experimentalDefaultControls: { 7056 margin: false, 7057 padding: false 7058 } 7059 }, 7060 __experimentalBorder: { 7061 radius: true, 7062 color: true, 7063 width: true, 7064 style: true, 7065 __experimentalDefaultControls: { 7066 width: true, 7067 color: true 7068 } 7069 }, 7070 color: { 7071 text: true, 7072 background: true, 7073 gradients: true, 7074 __experimentalDefaultControls: { 7075 background: true, 7076 text: true 7077 } 7078 }, 7079 interactivity: { 7080 clientNavigation: true 7081 } 7082 }, 7083 style: "wp-block-code" 7084 }; 7085 7086 7087 const { 7088 name: code_name 7089 } = code_metadata; 7090 7091 const code_settings = { 7092 icon: library_code, 7093 example: { 7094 attributes: { 7095 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 7096 // translators: Preserve \n markers for line breaks 7097 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 );') 7098 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 7099 } 7100 }, 7101 merge(attributes, attributesToMerge) { 7102 return { 7103 content: attributes.content + '\n\n' + attributesToMerge.content 7104 }; 7105 }, 7106 transforms: code_transforms, 7107 edit: CodeEdit, 7108 save: code_save_save 7109 }; 7110 const code_init = () => initBlock({ 7111 name: code_name, 7112 metadata: code_metadata, 7113 settings: code_settings 7114 }); 7115 7116 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js 7117 7118 /** 7119 * WordPress dependencies 7120 */ 7121 7122 const column = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 7123 xmlns: "http://www.w3.org/2000/svg", 7124 viewBox: "0 0 24 24" 7125 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 7126 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" 7127 })); 7128 /* harmony default export */ const library_column = (column); 7129 7130 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js 7131 7132 /** 7133 * External dependencies 7134 */ 7135 7136 7137 /** 7138 * WordPress dependencies 7139 */ 7140 7141 const column_deprecated_deprecated = [{ 7142 attributes: { 7143 verticalAlignment: { 7144 type: 'string' 7145 }, 7146 width: { 7147 type: 'number', 7148 min: 0, 7149 max: 100 7150 } 7151 }, 7152 isEligible({ 7153 width 7154 }) { 7155 return isFinite(width); 7156 }, 7157 migrate(attributes) { 7158 return { 7159 ...attributes, 7160 width: `$attributes.width}%` 7161 }; 7162 }, 7163 save({ 7164 attributes 7165 }) { 7166 const { 7167 verticalAlignment, 7168 width 7169 } = attributes; 7170 const wrapperClasses = classnames_default()({ 7171 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7172 }); 7173 const style = { 7174 flexBasis: width + '%' 7175 }; 7176 return (0,external_React_namespaceObject.createElement)("div", { 7177 className: wrapperClasses, 7178 style: style 7179 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 7180 } 7181 }]; 7182 /* harmony default export */ const column_deprecated = (column_deprecated_deprecated); 7183 7184 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js 7185 7186 /** 7187 * External dependencies 7188 */ 7189 7190 7191 /** 7192 * WordPress dependencies 7193 */ 7194 7195 7196 7197 7198 function ColumnEdit({ 7199 attributes: { 7200 verticalAlignment, 7201 width, 7202 templateLock, 7203 allowedBlocks 7204 }, 7205 setAttributes, 7206 clientId 7207 }) { 7208 const classes = classnames_default()('block-core-columns', { 7209 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7210 }); 7211 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 7212 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 7213 availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] 7214 }); 7215 const { 7216 columnsIds, 7217 hasChildBlocks, 7218 rootClientId 7219 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 7220 const { 7221 getBlockOrder, 7222 getBlockRootClientId 7223 } = select(external_wp_blockEditor_namespaceObject.store); 7224 const rootId = getBlockRootClientId(clientId); 7225 return { 7226 hasChildBlocks: getBlockOrder(clientId).length > 0, 7227 rootClientId: rootId, 7228 columnsIds: getBlockOrder(rootId) 7229 }; 7230 }, [clientId]); 7231 const { 7232 updateBlockAttributes 7233 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 7234 const updateAlignment = value => { 7235 // Update own alignment. 7236 setAttributes({ 7237 verticalAlignment: value 7238 }); 7239 // Reset parent Columns block. 7240 updateBlockAttributes(rootClientId, { 7241 verticalAlignment: null 7242 }); 7243 }; 7244 const widthWithUnit = Number.isFinite(width) ? width + '%' : width; 7245 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 7246 className: classes, 7247 style: widthWithUnit ? { 7248 flexBasis: widthWithUnit 7249 } : undefined 7250 }); 7251 const columnsCount = columnsIds.length; 7252 const currentColumnPosition = columnsIds.indexOf(clientId) + 1; 7253 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 */ 7254 (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); 7255 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 7256 ...blockProps, 7257 'aria-label': label 7258 }, { 7259 templateLock, 7260 allowedBlocks, 7261 renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 7262 }); 7263 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { 7264 onChange: updateAlignment, 7265 value: verticalAlignment, 7266 controls: ['top', 'center', 'bottom', 'stretch'] 7267 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 7268 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 7269 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 7270 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 7271 labelPosition: "edge", 7272 __unstableInputWidth: "80px", 7273 value: width || '', 7274 onChange: nextWidth => { 7275 nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; 7276 setAttributes({ 7277 width: nextWidth 7278 }); 7279 }, 7280 units: units 7281 }))), (0,external_React_namespaceObject.createElement)("div", { 7282 ...innerBlocksProps 7283 })); 7284 } 7285 /* harmony default export */ const column_edit = (ColumnEdit); 7286 7287 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js 7288 7289 /** 7290 * External dependencies 7291 */ 7292 7293 7294 /** 7295 * WordPress dependencies 7296 */ 7297 7298 function column_save_save({ 7299 attributes 7300 }) { 7301 const { 7302 verticalAlignment, 7303 width 7304 } = attributes; 7305 const wrapperClasses = classnames_default()({ 7306 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7307 }); 7308 let style; 7309 if (width && /\d/.test(width)) { 7310 // Numbers are handled for backward compatibility as they can be still provided with templates. 7311 let flexBasis = Number.isFinite(width) ? width + '%' : width; 7312 // In some cases we need to round the width to a shorter float. 7313 if (!Number.isFinite(width) && width?.endsWith('%')) { 7314 const multiplier = 1000000000000; 7315 // Shrink the number back to a reasonable float. 7316 flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%'; 7317 } 7318 style = { 7319 flexBasis 7320 }; 7321 } 7322 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 7323 className: wrapperClasses, 7324 style 7325 }); 7326 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 7327 return (0,external_React_namespaceObject.createElement)("div", { 7328 ...innerBlocksProps 7329 }); 7330 } 7331 7332 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js 7333 /** 7334 * WordPress dependencies 7335 */ 7336 7337 7338 /** 7339 * Internal dependencies 7340 */ 7341 7342 7343 7344 const column_metadata = { 7345 $schema: "https://schemas.wp.org/trunk/block.json", 7346 apiVersion: 3, 7347 name: "core/column", 7348 title: "Column", 7349 category: "design", 7350 parent: ["core/columns"], 7351 description: "A single column within a columns block.", 7352 textdomain: "default", 7353 attributes: { 7354 verticalAlignment: { 7355 type: "string" 7356 }, 7357 width: { 7358 type: "string" 7359 }, 7360 allowedBlocks: { 7361 type: "array" 7362 }, 7363 templateLock: { 7364 type: ["string", "boolean"], 7365 "enum": ["all", "insert", "contentOnly", false] 7366 } 7367 }, 7368 supports: { 7369 __experimentalOnEnter: true, 7370 anchor: true, 7371 reusable: false, 7372 html: false, 7373 color: { 7374 gradients: true, 7375 heading: true, 7376 button: true, 7377 link: true, 7378 __experimentalDefaultControls: { 7379 background: true, 7380 text: true 7381 } 7382 }, 7383 shadow: true, 7384 spacing: { 7385 blockGap: true, 7386 padding: true, 7387 __experimentalDefaultControls: { 7388 padding: true, 7389 blockGap: true 7390 } 7391 }, 7392 __experimentalBorder: { 7393 color: true, 7394 style: true, 7395 width: true, 7396 __experimentalDefaultControls: { 7397 color: true, 7398 style: true, 7399 width: true 7400 } 7401 }, 7402 typography: { 7403 fontSize: true, 7404 lineHeight: true, 7405 __experimentalFontFamily: true, 7406 __experimentalFontWeight: true, 7407 __experimentalFontStyle: true, 7408 __experimentalTextTransform: true, 7409 __experimentalTextDecoration: true, 7410 __experimentalLetterSpacing: true, 7411 __experimentalDefaultControls: { 7412 fontSize: true 7413 } 7414 }, 7415 layout: true, 7416 interactivity: { 7417 clientNavigation: true 7418 } 7419 } 7420 }; 7421 7422 const { 7423 name: column_name 7424 } = column_metadata; 7425 7426 const column_settings = { 7427 icon: library_column, 7428 edit: column_edit, 7429 save: column_save_save, 7430 deprecated: column_deprecated 7431 }; 7432 const column_init = () => initBlock({ 7433 name: column_name, 7434 metadata: column_metadata, 7435 settings: column_settings 7436 }); 7437 7438 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js 7439 7440 /** 7441 * WordPress dependencies 7442 */ 7443 7444 const columns = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 7445 viewBox: "0 0 24 24", 7446 xmlns: "http://www.w3.org/2000/svg" 7447 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 7448 fillRule: "evenodd", 7449 clipRule: "evenodd", 7450 d: "M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z" 7451 })); 7452 /* harmony default export */ const library_columns = (columns); 7453 7454 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js 7455 7456 /** 7457 * External dependencies 7458 */ 7459 7460 7461 /** 7462 * WordPress dependencies 7463 */ 7464 7465 7466 7467 /** 7468 * Given an HTML string for a deprecated columns inner block, returns the 7469 * column index to which the migrated inner block should be assigned. Returns 7470 * undefined if the inner block was not assigned to a column. 7471 * 7472 * @param {string} originalContent Deprecated Columns inner block HTML. 7473 * 7474 * @return {number | undefined} Column to which inner block is to be assigned. 7475 */ 7476 function getDeprecatedLayoutColumn(originalContent) { 7477 let { 7478 doc 7479 } = getDeprecatedLayoutColumn; 7480 if (!doc) { 7481 doc = document.implementation.createHTMLDocument(''); 7482 getDeprecatedLayoutColumn.doc = doc; 7483 } 7484 let columnMatch; 7485 doc.body.innerHTML = originalContent; 7486 for (const classListItem of doc.body.firstChild.classList) { 7487 if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { 7488 return Number(columnMatch[1]) - 1; 7489 } 7490 } 7491 } 7492 const migrateCustomColors = attributes => { 7493 if (!attributes.customTextColor && !attributes.customBackgroundColor) { 7494 return attributes; 7495 } 7496 const style = { 7497 color: {} 7498 }; 7499 if (attributes.customTextColor) { 7500 style.color.text = attributes.customTextColor; 7501 } 7502 if (attributes.customBackgroundColor) { 7503 style.color.background = attributes.customBackgroundColor; 7504 } 7505 const { 7506 customTextColor, 7507 customBackgroundColor, 7508 ...restAttributes 7509 } = attributes; 7510 return { 7511 ...restAttributes, 7512 style, 7513 isStackedOnMobile: true 7514 }; 7515 }; 7516 /* harmony default export */ const columns_deprecated = ([{ 7517 attributes: { 7518 verticalAlignment: { 7519 type: 'string' 7520 }, 7521 backgroundColor: { 7522 type: 'string' 7523 }, 7524 customBackgroundColor: { 7525 type: 'string' 7526 }, 7527 customTextColor: { 7528 type: 'string' 7529 }, 7530 textColor: { 7531 type: 'string' 7532 } 7533 }, 7534 migrate: migrateCustomColors, 7535 save({ 7536 attributes 7537 }) { 7538 const { 7539 verticalAlignment, 7540 backgroundColor, 7541 customBackgroundColor, 7542 textColor, 7543 customTextColor 7544 } = attributes; 7545 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 7546 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 7547 const className = classnames_default()({ 7548 'has-background': backgroundColor || customBackgroundColor, 7549 'has-text-color': textColor || customTextColor, 7550 [backgroundClass]: backgroundClass, 7551 [textClass]: textClass, 7552 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7553 }); 7554 const style = { 7555 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 7556 color: textClass ? undefined : customTextColor 7557 }; 7558 return (0,external_React_namespaceObject.createElement)("div", { 7559 className: className ? className : undefined, 7560 style: style 7561 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 7562 } 7563 }, { 7564 attributes: { 7565 columns: { 7566 type: 'number', 7567 default: 2 7568 } 7569 }, 7570 isEligible(attributes, innerBlocks) { 7571 // Since isEligible is called on every valid instance of the 7572 // Columns block and a deprecation is the unlikely case due to 7573 // its subsequent migration, optimize for the `false` condition 7574 // by performing a naive, inaccurate pass at inner blocks. 7575 const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent)); 7576 if (!isFastPassEligible) { 7577 return false; 7578 } 7579 7580 // Only if the fast pass is considered eligible is the more 7581 // accurate, durable, slower condition performed. 7582 return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined); 7583 }, 7584 migrate(attributes, innerBlocks) { 7585 const columns = innerBlocks.reduce((accumulator, innerBlock) => { 7586 const { 7587 originalContent 7588 } = innerBlock; 7589 let columnIndex = getDeprecatedLayoutColumn(originalContent); 7590 if (columnIndex === undefined) { 7591 columnIndex = 0; 7592 } 7593 if (!accumulator[columnIndex]) { 7594 accumulator[columnIndex] = []; 7595 } 7596 accumulator[columnIndex].push(innerBlock); 7597 return accumulator; 7598 }, []); 7599 const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks)); 7600 const { 7601 columns: ignoredColumns, 7602 ...restAttributes 7603 } = attributes; 7604 return [{ 7605 ...restAttributes, 7606 isStackedOnMobile: true 7607 }, migratedInnerBlocks]; 7608 }, 7609 save({ 7610 attributes 7611 }) { 7612 const { 7613 columns 7614 } = attributes; 7615 return (0,external_React_namespaceObject.createElement)("div", { 7616 className: `has-$columns}-columns` 7617 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 7618 } 7619 }, { 7620 attributes: { 7621 columns: { 7622 type: 'number', 7623 default: 2 7624 } 7625 }, 7626 migrate(attributes, innerBlocks) { 7627 const { 7628 columns, 7629 ...restAttributes 7630 } = attributes; 7631 attributes = { 7632 ...restAttributes, 7633 isStackedOnMobile: true 7634 }; 7635 return [attributes, innerBlocks]; 7636 }, 7637 save({ 7638 attributes 7639 }) { 7640 const { 7641 verticalAlignment, 7642 columns 7643 } = attributes; 7644 const wrapperClasses = classnames_default()(`has-$columns}-columns`, { 7645 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7646 }); 7647 return (0,external_React_namespaceObject.createElement)("div", { 7648 className: wrapperClasses 7649 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 7650 } 7651 }]); 7652 7653 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js 7654 /** 7655 * Returns a column width attribute value rounded to standard precision. 7656 * Returns `undefined` if the value is not a valid finite number. 7657 * 7658 * @param {?number} value Raw value. 7659 * 7660 * @return {number} Value rounded to standard precision. 7661 */ 7662 const toWidthPrecision = value => { 7663 const unitlessValue = parseFloat(value); 7664 return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined; 7665 }; 7666 /** 7667 * Returns an effective width for a given block. An effective width is equal to 7668 * its attribute value if set, or a computed value assuming equal distribution. 7669 * 7670 * @param {WPBlock} block Block object. 7671 * @param {number} totalBlockCount Total number of blocks in Columns. 7672 * 7673 * @return {number} Effective column width. 7674 */ 7675 function getEffectiveColumnWidth(block, totalBlockCount) { 7676 const { 7677 width = 100 / totalBlockCount 7678 } = block.attributes; 7679 return toWidthPrecision(width); 7680 } 7681 7682 /** 7683 * Returns the total width occupied by the given set of column blocks. 7684 * 7685 * @param {WPBlock[]} blocks Block objects. 7686 * @param {?number} totalBlockCount Total number of blocks in Columns. 7687 * Defaults to number of blocks passed. 7688 * 7689 * @return {number} Total width occupied by blocks. 7690 */ 7691 function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { 7692 return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0); 7693 } 7694 7695 /** 7696 * Returns an object of `clientId` → `width` of effective column widths. 7697 * 7698 * @param {WPBlock[]} blocks Block objects. 7699 * @param {?number} totalBlockCount Total number of blocks in Columns. 7700 * Defaults to number of blocks passed. 7701 * 7702 * @return {Object<string,number>} Column widths. 7703 */ 7704 function getColumnWidths(blocks, totalBlockCount = blocks.length) { 7705 return blocks.reduce((accumulator, block) => { 7706 const width = getEffectiveColumnWidth(block, totalBlockCount); 7707 return Object.assign(accumulator, { 7708 [block.clientId]: width 7709 }); 7710 }, {}); 7711 } 7712 7713 /** 7714 * Returns an object of `clientId` → `width` of column widths as redistributed 7715 * proportional to their current widths, constrained or expanded to fit within 7716 * the given available width. 7717 * 7718 * @param {WPBlock[]} blocks Block objects. 7719 * @param {number} availableWidth Maximum width to fit within. 7720 * @param {?number} totalBlockCount Total number of blocks in Columns. 7721 * Defaults to number of blocks passed. 7722 * 7723 * @return {Object<string,number>} Redistributed column widths. 7724 */ 7725 function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { 7726 const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); 7727 return Object.fromEntries(Object.entries(getColumnWidths(blocks, totalBlockCount)).map(([clientId, width]) => { 7728 const newWidth = availableWidth * width / totalWidth; 7729 return [clientId, toWidthPrecision(newWidth)]; 7730 })); 7731 } 7732 7733 /** 7734 * Returns true if column blocks within the provided set are assigned with 7735 * explicit widths, or false otherwise. 7736 * 7737 * @param {WPBlock[]} blocks Block objects. 7738 * 7739 * @return {boolean} Whether columns have explicit widths. 7740 */ 7741 function hasExplicitPercentColumnWidths(blocks) { 7742 return blocks.every(block => { 7743 const blockWidth = block.attributes.width; 7744 return Number.isFinite(blockWidth?.endsWith?.('%') ? parseFloat(blockWidth) : blockWidth); 7745 }); 7746 } 7747 7748 /** 7749 * Returns a copy of the given set of blocks with new widths assigned from the 7750 * provided object of redistributed column widths. 7751 * 7752 * @param {WPBlock[]} blocks Block objects. 7753 * @param {Object<string,number>} widths Redistributed column widths. 7754 * 7755 * @return {WPBlock[]} blocks Mapped block objects. 7756 */ 7757 function getMappedColumnWidths(blocks, widths) { 7758 return blocks.map(block => ({ 7759 ...block, 7760 attributes: { 7761 ...block.attributes, 7762 width: `$widths[block.clientId]}%` 7763 } 7764 })); 7765 } 7766 7767 /** 7768 * Returns an array with columns widths values, parsed or no depends on `withParsing` flag. 7769 * 7770 * @param {WPBlock[]} blocks Block objects. 7771 * @param {?boolean} withParsing Whether value has to be parsed. 7772 * 7773 * @return {Array<number,string>} Column widths. 7774 */ 7775 function getWidths(blocks, withParsing = true) { 7776 return blocks.map(innerColumn => { 7777 const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length; 7778 return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth; 7779 }); 7780 } 7781 7782 /** 7783 * Returns a column width with unit. 7784 * 7785 * @param {string} width Column width. 7786 * @param {string} unit Column width unit. 7787 * 7788 * @return {string} Column width with unit. 7789 */ 7790 function getWidthWithUnit(width, unit) { 7791 width = 0 > parseFloat(width) ? '0' : width; 7792 if (isPercentageUnit(unit)) { 7793 width = Math.min(width, 100); 7794 } 7795 return `$width}$unit}`; 7796 } 7797 7798 /** 7799 * Returns a boolean whether passed unit is percentage 7800 * 7801 * @param {string} unit Column width unit. 7802 * 7803 * @return {boolean} Whether unit is '%'. 7804 */ 7805 function isPercentageUnit(unit) { 7806 return unit === '%'; 7807 } 7808 7809 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js 7810 7811 /** 7812 * External dependencies 7813 */ 7814 7815 7816 /** 7817 * WordPress dependencies 7818 */ 7819 7820 7821 7822 7823 7824 7825 /** 7826 * Internal dependencies 7827 */ 7828 7829 function ColumnsEditContainer({ 7830 attributes, 7831 setAttributes, 7832 clientId 7833 }) { 7834 const { 7835 isStackedOnMobile, 7836 verticalAlignment, 7837 templateLock 7838 } = attributes; 7839 const { 7840 count, 7841 canInsertColumnBlock, 7842 minCount 7843 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 7844 const { 7845 canInsertBlockType, 7846 canRemoveBlock, 7847 getBlocks, 7848 getBlockCount 7849 } = select(external_wp_blockEditor_namespaceObject.store); 7850 const innerBlocks = getBlocks(clientId); 7851 7852 // Get the indexes of columns for which removal is prevented. 7853 // The highest index will be used to determine the minimum column count. 7854 const preventRemovalBlockIndexes = innerBlocks.reduce((acc, block, index) => { 7855 if (!canRemoveBlock(block.clientId)) { 7856 acc.push(index); 7857 } 7858 return acc; 7859 }, []); 7860 return { 7861 count: getBlockCount(clientId), 7862 canInsertColumnBlock: canInsertBlockType('core/column', clientId), 7863 minCount: Math.max(...preventRemovalBlockIndexes) + 1 7864 }; 7865 }, [clientId]); 7866 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 7867 const { 7868 getBlocks, 7869 getBlockOrder 7870 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 7871 const { 7872 updateBlockAttributes, 7873 replaceInnerBlocks 7874 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 7875 const classes = classnames_default()({ 7876 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 7877 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 7878 }); 7879 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 7880 className: classes 7881 }); 7882 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 7883 orientation: 'horizontal', 7884 renderAppender: false, 7885 templateLock 7886 }); 7887 7888 /** 7889 * Update all child Column blocks with a new vertical alignment setting 7890 * based on whatever alignment is passed in. This allows change to parent 7891 * to overide anything set on a individual column basis. 7892 * 7893 * @param {string} newVerticalAlignment The vertical alignment setting. 7894 */ 7895 function updateAlignment(newVerticalAlignment) { 7896 const innerBlockClientIds = getBlockOrder(clientId); 7897 7898 // Update own and child Column block vertical alignments. 7899 // This is a single action; the batching prevents creating multiple history records. 7900 registry.batch(() => { 7901 setAttributes({ 7902 verticalAlignment: newVerticalAlignment 7903 }); 7904 updateBlockAttributes(innerBlockClientIds, { 7905 verticalAlignment: newVerticalAlignment 7906 }); 7907 }); 7908 } 7909 7910 /** 7911 * Updates the column count, including necessary revisions to child Column 7912 * blocks to grant required or redistribute available space. 7913 * 7914 * @param {number} previousColumns Previous column count. 7915 * @param {number} newColumns New column count. 7916 */ 7917 function updateColumns(previousColumns, newColumns) { 7918 let innerBlocks = getBlocks(clientId); 7919 const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); 7920 7921 // Redistribute available width for existing inner blocks. 7922 const isAddingColumn = newColumns > previousColumns; 7923 if (isAddingColumn && hasExplicitWidths) { 7924 // If adding a new column, assign width to the new column equal to 7925 // as if it were `1 / columns` of the total available space. 7926 const newColumnWidth = toWidthPrecision(100 / newColumns); 7927 7928 // Redistribute in consideration of pending block insertion as 7929 // constraining the available working width. 7930 const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth); 7931 innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({ 7932 length: newColumns - previousColumns 7933 }).map(() => { 7934 return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', { 7935 width: `$newColumnWidth}%` 7936 }); 7937 })]; 7938 } else if (isAddingColumn) { 7939 innerBlocks = [...innerBlocks, ...Array.from({ 7940 length: newColumns - previousColumns 7941 }).map(() => { 7942 return (0,external_wp_blocks_namespaceObject.createBlock)('core/column'); 7943 })]; 7944 } else if (newColumns < previousColumns) { 7945 // The removed column will be the last of the inner blocks. 7946 innerBlocks = innerBlocks.slice(0, -(previousColumns - newColumns)); 7947 if (hasExplicitWidths) { 7948 // Redistribute as if block is already removed. 7949 const widths = getRedistributedColumnWidths(innerBlocks, 100); 7950 innerBlocks = getMappedColumnWidths(innerBlocks, widths); 7951 } 7952 } 7953 replaceInnerBlocks(clientId, innerBlocks); 7954 } 7955 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { 7956 onChange: updateAlignment, 7957 value: verticalAlignment 7958 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 7959 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 7960 }, canInsertColumnBlock && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 7961 __nextHasNoMarginBottom: true, 7962 __next40pxDefaultSize: true, 7963 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 7964 value: count, 7965 onChange: value => updateColumns(count, Math.max(minCount, value)), 7966 min: Math.max(1, minCount), 7967 max: Math.max(6, count) 7968 }), count > 6 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 7969 status: "warning", 7970 isDismissible: false 7971 }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 7972 __nextHasNoMarginBottom: true, 7973 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 7974 checked: isStackedOnMobile, 7975 onChange: () => setAttributes({ 7976 isStackedOnMobile: !isStackedOnMobile 7977 }) 7978 }))), (0,external_React_namespaceObject.createElement)("div", { 7979 ...innerBlocksProps 7980 })); 7981 } 7982 function Placeholder({ 7983 clientId, 7984 name, 7985 setAttributes 7986 }) { 7987 const { 7988 blockType, 7989 defaultVariation, 7990 variations 7991 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 7992 const { 7993 getBlockVariations, 7994 getBlockType, 7995 getDefaultBlockVariation 7996 } = select(external_wp_blocks_namespaceObject.store); 7997 return { 7998 blockType: getBlockType(name), 7999 defaultVariation: getDefaultBlockVariation(name, 'block'), 8000 variations: getBlockVariations(name, 'block') 8001 }; 8002 }, [name]); 8003 const { 8004 replaceInnerBlocks 8005 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 8006 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 8007 return (0,external_React_namespaceObject.createElement)("div", { 8008 ...blockProps 8009 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { 8010 icon: blockType?.icon?.src, 8011 label: blockType?.title, 8012 variations: variations, 8013 onSelect: (nextVariation = defaultVariation) => { 8014 if (nextVariation.attributes) { 8015 setAttributes(nextVariation.attributes); 8016 } 8017 if (nextVariation.innerBlocks) { 8018 replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); 8019 } 8020 }, 8021 allowSkip: true 8022 })); 8023 } 8024 const ColumnsEdit = props => { 8025 const { 8026 clientId 8027 } = props; 8028 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]); 8029 const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder; 8030 return (0,external_React_namespaceObject.createElement)(Component, { 8031 ...props 8032 }); 8033 }; 8034 /* harmony default export */ const columns_edit = (ColumnsEdit); 8035 8036 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js 8037 8038 /** 8039 * External dependencies 8040 */ 8041 8042 8043 /** 8044 * WordPress dependencies 8045 */ 8046 8047 function columns_save_save({ 8048 attributes 8049 }) { 8050 const { 8051 isStackedOnMobile, 8052 verticalAlignment 8053 } = attributes; 8054 const className = classnames_default()({ 8055 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 8056 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 8057 }); 8058 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 8059 className 8060 }); 8061 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 8062 return (0,external_React_namespaceObject.createElement)("div", { 8063 ...innerBlocksProps 8064 }); 8065 } 8066 8067 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js 8068 8069 /** 8070 * WordPress dependencies 8071 */ 8072 8073 8074 8075 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 8076 8077 /** 8078 * Template option choices for predefined columns layouts. 8079 * 8080 * @type {WPBlockVariation[]} 8081 */ 8082 const variations = [{ 8083 name: 'one-column-full', 8084 title: (0,external_wp_i18n_namespaceObject.__)('100'), 8085 description: (0,external_wp_i18n_namespaceObject.__)('One column'), 8086 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8087 width: "48", 8088 height: "48", 8089 viewBox: "0 0 48 48", 8090 xmlns: "http://www.w3.org/2000/svg" 8091 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8092 fillRule: "evenodd", 8093 clipRule: "evenodd", 8094 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" 8095 })), 8096 innerBlocks: [['core/column']], 8097 scope: ['block'] 8098 }, { 8099 name: 'two-columns-equal', 8100 title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'), 8101 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'), 8102 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8103 width: "48", 8104 height: "48", 8105 viewBox: "0 0 48 48", 8106 xmlns: "http://www.w3.org/2000/svg" 8107 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8108 fillRule: "evenodd", 8109 clipRule: "evenodd", 8110 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" 8111 })), 8112 isDefault: true, 8113 innerBlocks: [['core/column'], ['core/column']], 8114 scope: ['block'] 8115 }, { 8116 name: 'two-columns-one-third-two-thirds', 8117 title: (0,external_wp_i18n_namespaceObject.__)('33 / 66'), 8118 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'), 8119 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8120 width: "48", 8121 height: "48", 8122 viewBox: "0 0 48 48", 8123 xmlns: "http://www.w3.org/2000/svg" 8124 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8125 fillRule: "evenodd", 8126 clipRule: "evenodd", 8127 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" 8128 })), 8129 innerBlocks: [['core/column', { 8130 width: '33.33%' 8131 }], ['core/column', { 8132 width: '66.66%' 8133 }]], 8134 scope: ['block'] 8135 }, { 8136 name: 'two-columns-two-thirds-one-third', 8137 title: (0,external_wp_i18n_namespaceObject.__)('66 / 33'), 8138 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'), 8139 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8140 width: "48", 8141 height: "48", 8142 viewBox: "0 0 48 48", 8143 xmlns: "http://www.w3.org/2000/svg" 8144 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8145 fillRule: "evenodd", 8146 clipRule: "evenodd", 8147 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" 8148 })), 8149 innerBlocks: [['core/column', { 8150 width: '66.66%' 8151 }], ['core/column', { 8152 width: '33.33%' 8153 }]], 8154 scope: ['block'] 8155 }, { 8156 name: 'three-columns-equal', 8157 title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'), 8158 description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'), 8159 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8160 width: "48", 8161 height: "48", 8162 viewBox: "0 0 48 48", 8163 xmlns: "http://www.w3.org/2000/svg" 8164 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8165 fillRule: "evenodd", 8166 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" 8167 })), 8168 innerBlocks: [['core/column'], ['core/column'], ['core/column']], 8169 scope: ['block'] 8170 }, { 8171 name: 'three-columns-wider-center', 8172 title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'), 8173 description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'), 8174 icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 8175 width: "48", 8176 height: "48", 8177 viewBox: "0 0 48 48", 8178 xmlns: "http://www.w3.org/2000/svg" 8179 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 8180 fillRule: "evenodd", 8181 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" 8182 })), 8183 innerBlocks: [['core/column', { 8184 width: '25%' 8185 }], ['core/column', { 8186 width: '50%' 8187 }], ['core/column', { 8188 width: '25%' 8189 }]], 8190 scope: ['block'] 8191 }]; 8192 /* harmony default export */ const columns_variations = (variations); 8193 8194 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js 8195 /** 8196 * WordPress dependencies 8197 */ 8198 8199 const MAXIMUM_SELECTED_BLOCKS = 6; 8200 const columns_transforms_transforms = { 8201 from: [{ 8202 type: 'block', 8203 isMultiBlock: true, 8204 blocks: ['*'], 8205 __experimentalConvert: blocks => { 8206 const columnWidth = +(100 / blocks.length).toFixed(2); 8207 const innerBlocksTemplate = blocks.map(({ 8208 name, 8209 attributes, 8210 innerBlocks 8211 }) => ['core/column', { 8212 width: `$columnWidth}%` 8213 }, [[name, { 8214 ...attributes 8215 }, innerBlocks]]]); 8216 return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); 8217 }, 8218 isMatch: ({ 8219 length: selectedBlocksLength 8220 }, blocks) => { 8221 // If a user is trying to transform a single Columns block, skip 8222 // the transformation. Enabling this functiontionality creates 8223 // nested Columns blocks resulting in an unintuitive user experience. 8224 // Multiple Columns blocks can still be transformed. 8225 if (blocks.length === 1 && blocks[0].name === 'core/columns') { 8226 return false; 8227 } 8228 return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; 8229 } 8230 }, { 8231 type: 'block', 8232 blocks: ['core/media-text'], 8233 priority: 1, 8234 transform: (attributes, innerBlocks) => { 8235 const { 8236 align, 8237 backgroundColor, 8238 textColor, 8239 style, 8240 mediaAlt: alt, 8241 mediaId: id, 8242 mediaPosition, 8243 mediaSizeSlug: sizeSlug, 8244 mediaType, 8245 mediaUrl: url, 8246 mediaWidth, 8247 verticalAlignment 8248 } = attributes; 8249 let media; 8250 if (mediaType === 'image' || !mediaType) { 8251 const imageAttrs = { 8252 id, 8253 alt, 8254 url, 8255 sizeSlug 8256 }; 8257 const linkAttrs = { 8258 href: attributes.href, 8259 linkClass: attributes.linkClass, 8260 linkDestination: attributes.linkDestination, 8261 linkTarget: attributes.linkTarget, 8262 rel: attributes.rel 8263 }; 8264 media = ['core/image', { 8265 ...imageAttrs, 8266 ...linkAttrs 8267 }]; 8268 } else { 8269 media = ['core/video', { 8270 id, 8271 src: url 8272 }]; 8273 } 8274 const innerBlocksTemplate = [['core/column', { 8275 width: `$mediaWidth}%` 8276 }, [media]], ['core/column', { 8277 width: `$100 - mediaWidth}%` 8278 }, innerBlocks]]; 8279 if (mediaPosition === 'right') { 8280 innerBlocksTemplate.reverse(); 8281 } 8282 return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { 8283 align, 8284 backgroundColor, 8285 textColor, 8286 style, 8287 verticalAlignment 8288 }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); 8289 } 8290 }], 8291 ungroup: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks) 8292 }; 8293 /* harmony default export */ const columns_transforms = (columns_transforms_transforms); 8294 8295 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js 8296 /** 8297 * WordPress dependencies 8298 */ 8299 8300 8301 8302 /** 8303 * Internal dependencies 8304 */ 8305 8306 8307 8308 const columns_metadata = { 8309 $schema: "https://schemas.wp.org/trunk/block.json", 8310 apiVersion: 3, 8311 name: "core/columns", 8312 title: "Columns", 8313 category: "design", 8314 allowedBlocks: ["core/column"], 8315 description: "Display content in multiple columns, with blocks added to each column.", 8316 textdomain: "default", 8317 attributes: { 8318 verticalAlignment: { 8319 type: "string" 8320 }, 8321 isStackedOnMobile: { 8322 type: "boolean", 8323 "default": true 8324 }, 8325 templateLock: { 8326 type: ["string", "boolean"], 8327 "enum": ["all", "insert", "contentOnly", false] 8328 } 8329 }, 8330 supports: { 8331 anchor: true, 8332 align: ["wide", "full"], 8333 html: false, 8334 color: { 8335 gradients: true, 8336 link: true, 8337 heading: true, 8338 button: true, 8339 __experimentalDefaultControls: { 8340 background: true, 8341 text: true 8342 } 8343 }, 8344 spacing: { 8345 blockGap: { 8346 __experimentalDefault: "2em", 8347 sides: ["horizontal", "vertical"] 8348 }, 8349 margin: ["top", "bottom"], 8350 padding: true, 8351 __experimentalDefaultControls: { 8352 padding: true, 8353 blockGap: true 8354 } 8355 }, 8356 layout: { 8357 allowSwitching: false, 8358 allowInheriting: false, 8359 allowEditing: false, 8360 "default": { 8361 type: "flex", 8362 flexWrap: "nowrap" 8363 } 8364 }, 8365 __experimentalBorder: { 8366 color: true, 8367 radius: true, 8368 style: true, 8369 width: true, 8370 __experimentalDefaultControls: { 8371 color: true, 8372 radius: true, 8373 style: true, 8374 width: true 8375 } 8376 }, 8377 typography: { 8378 fontSize: true, 8379 lineHeight: true, 8380 __experimentalFontFamily: true, 8381 __experimentalFontWeight: true, 8382 __experimentalFontStyle: true, 8383 __experimentalTextTransform: true, 8384 __experimentalTextDecoration: true, 8385 __experimentalLetterSpacing: true, 8386 __experimentalDefaultControls: { 8387 fontSize: true 8388 } 8389 }, 8390 interactivity: { 8391 clientNavigation: true 8392 }, 8393 shadow: true 8394 }, 8395 editorStyle: "wp-block-columns-editor", 8396 style: "wp-block-columns" 8397 }; 8398 8399 8400 8401 const { 8402 name: columns_name 8403 } = columns_metadata; 8404 8405 const columns_settings = { 8406 icon: library_columns, 8407 variations: columns_variations, 8408 example: { 8409 viewportWidth: 600, 8410 // Columns collapse "@media (max-width: 599px)". 8411 innerBlocks: [{ 8412 name: 'core/column', 8413 innerBlocks: [{ 8414 name: 'core/paragraph', 8415 attributes: { 8416 /* translators: example text. */ 8417 content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.') 8418 } 8419 }, { 8420 name: 'core/image', 8421 attributes: { 8422 url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg' 8423 } 8424 }, { 8425 name: 'core/paragraph', 8426 attributes: { 8427 /* translators: example text. */ 8428 content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.') 8429 } 8430 }] 8431 }, { 8432 name: 'core/column', 8433 innerBlocks: [{ 8434 name: 'core/paragraph', 8435 attributes: { 8436 /* translators: example text. */ 8437 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.') 8438 } 8439 }, { 8440 name: 'core/paragraph', 8441 attributes: { 8442 /* translators: example text. */ 8443 content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.') 8444 } 8445 }] 8446 }] 8447 }, 8448 deprecated: columns_deprecated, 8449 edit: columns_edit, 8450 save: columns_save_save, 8451 transforms: columns_transforms 8452 }; 8453 const columns_init = () => initBlock({ 8454 name: columns_name, 8455 metadata: columns_metadata, 8456 settings: columns_settings 8457 }); 8458 8459 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js 8460 8461 /** 8462 * WordPress dependencies 8463 */ 8464 8465 const postComments = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 8466 xmlns: "http://www.w3.org/2000/svg", 8467 viewBox: "0 0 24 24" 8468 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 8469 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" 8470 })); 8471 /* harmony default export */ const post_comments = (postComments); 8472 8473 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js 8474 8475 /** 8476 * WordPress dependencies 8477 */ 8478 8479 8480 // v1: Deprecate the initial version of the block which was called "Comments 8481 // Query Loop" instead of "Comments". 8482 const v1 = { 8483 attributes: { 8484 tagName: { 8485 type: 'string', 8486 default: 'div' 8487 } 8488 }, 8489 apiVersion: 3, 8490 supports: { 8491 align: ['wide', 'full'], 8492 html: false, 8493 color: { 8494 gradients: true, 8495 link: true, 8496 __experimentalDefaultControls: { 8497 background: true, 8498 text: true, 8499 link: true 8500 } 8501 } 8502 }, 8503 save({ 8504 attributes: { 8505 tagName: Tag 8506 } 8507 }) { 8508 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 8509 const { 8510 className 8511 } = blockProps; 8512 const classes = className?.split(' ') || []; 8513 8514 // The ID of the previous version of the block 8515 // didn't have the `wp-block-comments` class, 8516 // so we need to remove it here in order to mimic it. 8517 const newClasses = classes?.filter(cls => cls !== 'wp-block-comments'); 8518 const newBlockProps = { 8519 ...blockProps, 8520 className: newClasses.join(' ') 8521 }; 8522 return (0,external_React_namespaceObject.createElement)(Tag, { 8523 ...newBlockProps 8524 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 8525 } 8526 }; 8527 /* harmony default export */ const comments_deprecated = ([v1]); 8528 8529 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js 8530 8531 /** 8532 * WordPress dependencies 8533 */ 8534 8535 8536 8537 function CommentsInspectorControls({ 8538 attributes: { 8539 tagName 8540 }, 8541 setAttributes 8542 }) { 8543 const htmlElementMessages = { 8544 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."), 8545 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.") 8546 }; 8547 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 8548 group: "advanced" 8549 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 8550 __nextHasNoMarginBottom: true, 8551 __next40pxDefaultSize: true, 8552 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 8553 options: [{ 8554 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 8555 value: 'div' 8556 }, { 8557 label: '<section>', 8558 value: 'section' 8559 }, { 8560 label: '<aside>', 8561 value: 'aside' 8562 }], 8563 value: tagName, 8564 onChange: value => setAttributes({ 8565 tagName: value 8566 }), 8567 help: htmlElementMessages[tagName] 8568 }))); 8569 } 8570 8571 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js 8572 8573 /** 8574 * External dependencies 8575 */ 8576 8577 8578 /** 8579 * WordPress dependencies 8580 */ 8581 8582 8583 8584 8585 8586 8587 const CommentsFormPlaceholder = () => { 8588 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder); 8589 return (0,external_React_namespaceObject.createElement)("div", { 8590 className: "comment-respond" 8591 }, (0,external_React_namespaceObject.createElement)("h3", { 8592 className: "comment-reply-title" 8593 }, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_React_namespaceObject.createElement)("form", { 8594 noValidate: true, 8595 className: "comment-form", 8596 onSubmit: event => event.preventDefault() 8597 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_React_namespaceObject.createElement)("label", { 8598 htmlFor: `comment-$instanceId}` 8599 }, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_React_namespaceObject.createElement)("textarea", { 8600 id: `comment-$instanceId}`, 8601 name: "comment", 8602 cols: "45", 8603 rows: "8", 8604 readOnly: true 8605 })), (0,external_React_namespaceObject.createElement)("p", { 8606 className: "form-submit wp-block-button" 8607 }, (0,external_React_namespaceObject.createElement)("input", { 8608 name: "submit", 8609 type: "submit", 8610 className: classnames_default()('wp-block-button__link', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 8611 label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), 8612 value: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), 8613 "aria-disabled": "true" 8614 })))); 8615 }; 8616 const CommentsForm = ({ 8617 postId, 8618 postType 8619 }) => { 8620 const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId); 8621 const isSiteEditor = postType === undefined || postId === undefined; 8622 const { 8623 defaultCommentStatus 8624 } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); 8625 const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => postType ? !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports.comments : false); 8626 if (!isSiteEditor && 'open' !== commentStatus) { 8627 if ('closed' === commentStatus) { 8628 const actions = [(0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 8629 key: "enableComments", 8630 onClick: () => setCommentStatus('open'), 8631 variant: "primary" 8632 }, (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))]; 8633 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { 8634 actions: actions 8635 }, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.')); 8636 } else if (!postTypeSupportsComments) { 8637 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Post type (i.e. "post", "page") */ 8638 (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType)); 8639 } else if ('open' !== defaultCommentStatus) { 8640 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.')); 8641 } 8642 } 8643 return (0,external_React_namespaceObject.createElement)(CommentsFormPlaceholder, null); 8644 }; 8645 /* harmony default export */ const post_comments_form_form = (CommentsForm); 8646 8647 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js 8648 8649 /** 8650 * WordPress dependencies 8651 */ 8652 8653 8654 8655 8656 8657 8658 /** 8659 * Internal dependencies 8660 */ 8661 8662 function PostCommentsPlaceholder({ 8663 postType, 8664 postId 8665 }) { 8666 let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 8667 postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title'); 8668 const { 8669 avatarURL 8670 } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); 8671 return (0,external_React_namespaceObject.createElement)("div", { 8672 className: "wp-block-comments__legacy-placeholder", 8673 inert: "true" 8674 }, (0,external_React_namespaceObject.createElement)("h3", null, /* translators: %s: Post title. */ 8675 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_React_namespaceObject.createElement)("div", { 8676 className: "navigation" 8677 }, (0,external_React_namespaceObject.createElement)("div", { 8678 className: "alignleft" 8679 }, (0,external_React_namespaceObject.createElement)("a", { 8680 href: "#top" 8681 }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_React_namespaceObject.createElement)("div", { 8682 className: "alignright" 8683 }, (0,external_React_namespaceObject.createElement)("a", { 8684 href: "#top" 8685 }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_React_namespaceObject.createElement)("ol", { 8686 className: "commentlist" 8687 }, (0,external_React_namespaceObject.createElement)("li", { 8688 className: "comment even thread-even depth-1" 8689 }, (0,external_React_namespaceObject.createElement)("article", { 8690 className: "comment-body" 8691 }, (0,external_React_namespaceObject.createElement)("footer", { 8692 className: "comment-meta" 8693 }, (0,external_React_namespaceObject.createElement)("div", { 8694 className: "comment-author vcard" 8695 }, (0,external_React_namespaceObject.createElement)("img", { 8696 alt: (0,external_wp_i18n_namespaceObject.__)('Commenter Avatar'), 8697 src: avatarURL, 8698 className: "avatar avatar-32 photo", 8699 height: "32", 8700 width: "32", 8701 loading: "lazy" 8702 }), (0,external_React_namespaceObject.createElement)("b", { 8703 className: "fn" 8704 }, (0,external_React_namespaceObject.createElement)("a", { 8705 href: "#top", 8706 className: "url" 8707 }, (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), ' ', (0,external_React_namespaceObject.createElement)("span", { 8708 className: "says" 8709 }, (0,external_wp_i18n_namespaceObject.__)('says'), ":")), (0,external_React_namespaceObject.createElement)("div", { 8710 className: "comment-metadata" 8711 }, (0,external_React_namespaceObject.createElement)("a", { 8712 href: "#top" 8713 }, (0,external_React_namespaceObject.createElement)("time", { 8714 dateTime: "2000-01-01T00:00:00+00:00" 8715 }, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am'))), ' ', (0,external_React_namespaceObject.createElement)("span", { 8716 className: "edit-link" 8717 }, (0,external_React_namespaceObject.createElement)("a", { 8718 className: "comment-edit-link", 8719 href: "#top" 8720 }, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_React_namespaceObject.createElement)("div", { 8721 className: "comment-content" 8722 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_React_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_React_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>.'), { 8723 a: 8724 // eslint-disable-next-line jsx-a11y/anchor-has-content 8725 (0,external_React_namespaceObject.createElement)("a", { 8726 href: "https://gravatar.com/" 8727 }) 8728 }))), (0,external_React_namespaceObject.createElement)("div", { 8729 className: "reply" 8730 }, (0,external_React_namespaceObject.createElement)("a", { 8731 className: "comment-reply-link", 8732 href: "#top", 8733 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Reply to A WordPress Commenter') 8734 }, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_React_namespaceObject.createElement)("div", { 8735 className: "navigation" 8736 }, (0,external_React_namespaceObject.createElement)("div", { 8737 className: "alignleft" 8738 }, (0,external_React_namespaceObject.createElement)("a", { 8739 href: "#top" 8740 }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_React_namespaceObject.createElement)("div", { 8741 className: "alignright" 8742 }, (0,external_React_namespaceObject.createElement)("a", { 8743 href: "#top" 8744 }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_React_namespaceObject.createElement)(post_comments_form_form, { 8745 postId: postId, 8746 postType: postType 8747 })); 8748 } 8749 8750 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js 8751 8752 /** 8753 * External dependencies 8754 */ 8755 8756 8757 /** 8758 * WordPress dependencies 8759 */ 8760 8761 8762 8763 8764 /** 8765 * Internal dependencies 8766 */ 8767 8768 function CommentsLegacy({ 8769 attributes, 8770 setAttributes, 8771 context: { 8772 postType, 8773 postId 8774 } 8775 }) { 8776 const { 8777 textAlign 8778 } = attributes; 8779 const actions = [(0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 8780 key: "convert", 8781 onClick: () => void setAttributes({ 8782 legacy: false 8783 }), 8784 variant: "primary" 8785 }, (0,external_wp_i18n_namespaceObject.__)('Switch to editable mode'))]; 8786 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 8787 className: classnames_default()({ 8788 [`has-text-align-$textAlign}`]: textAlign 8789 }) 8790 }); 8791 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 8792 group: "block" 8793 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 8794 value: textAlign, 8795 onChange: nextAlign => { 8796 setAttributes({ 8797 textAlign: nextAlign 8798 }); 8799 } 8800 })), (0,external_React_namespaceObject.createElement)("div", { 8801 ...blockProps 8802 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { 8803 actions: actions 8804 }, (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_React_namespaceObject.createElement)(PostCommentsPlaceholder, { 8805 postId: postId, 8806 postType: postType 8807 }))); 8808 } 8809 8810 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js 8811 const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', { 8812 width: '40px' 8813 }, [['core/avatar', { 8814 size: 40, 8815 style: { 8816 border: { 8817 radius: '20px' 8818 } 8819 } 8820 }]]], ['core/column', {}, [['core/comment-author-name', { 8821 fontSize: 'small' 8822 }], ['core/group', { 8823 layout: { 8824 type: 'flex' 8825 }, 8826 style: { 8827 spacing: { 8828 margin: { 8829 top: '0px', 8830 bottom: '0px' 8831 } 8832 } 8833 } 8834 }, [['core/comment-date', { 8835 fontSize: 'small' 8836 }], ['core/comment-edit-link', { 8837 fontSize: 'small' 8838 }]]], ['core/comment-content'], ['core/comment-reply-link', { 8839 fontSize: 'small' 8840 }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']]; 8841 /* harmony default export */ const template = (TEMPLATE); 8842 8843 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js 8844 8845 /** 8846 * WordPress dependencies 8847 */ 8848 8849 8850 /** 8851 * Internal dependencies 8852 */ 8853 8854 8855 8856 function CommentsEdit(props) { 8857 const { 8858 attributes, 8859 setAttributes 8860 } = props; 8861 const { 8862 tagName: TagName, 8863 legacy 8864 } = attributes; 8865 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 8866 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 8867 template: template 8868 }); 8869 if (legacy) { 8870 return (0,external_React_namespaceObject.createElement)(CommentsLegacy, { 8871 ...props 8872 }); 8873 } 8874 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(CommentsInspectorControls, { 8875 attributes: attributes, 8876 setAttributes: setAttributes 8877 }), (0,external_React_namespaceObject.createElement)(TagName, { 8878 ...innerBlocksProps 8879 })); 8880 } 8881 8882 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/save.js 8883 8884 /** 8885 * WordPress dependencies 8886 */ 8887 8888 function comments_save_save({ 8889 attributes: { 8890 tagName: Tag, 8891 legacy 8892 } 8893 }) { 8894 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 8895 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 8896 8897 // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner 8898 // blocks, so nothing is saved in that case. 8899 return legacy ? null : (0,external_React_namespaceObject.createElement)(Tag, { 8900 ...innerBlocksProps 8901 }); 8902 } 8903 8904 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/index.js 8905 /** 8906 * WordPress dependencies 8907 */ 8908 8909 8910 /** 8911 * Internal dependencies 8912 */ 8913 8914 const comments_metadata = { 8915 $schema: "https://schemas.wp.org/trunk/block.json", 8916 apiVersion: 3, 8917 name: "core/comments", 8918 title: "Comments", 8919 category: "theme", 8920 description: "An advanced block that allows displaying post comments using different visual configurations.", 8921 textdomain: "default", 8922 attributes: { 8923 tagName: { 8924 type: "string", 8925 "default": "div" 8926 }, 8927 legacy: { 8928 type: "boolean", 8929 "default": false 8930 } 8931 }, 8932 supports: { 8933 align: ["wide", "full"], 8934 html: false, 8935 color: { 8936 gradients: true, 8937 heading: true, 8938 link: true, 8939 __experimentalDefaultControls: { 8940 background: true, 8941 text: true, 8942 link: true 8943 } 8944 }, 8945 spacing: { 8946 margin: true, 8947 padding: true 8948 }, 8949 typography: { 8950 fontSize: true, 8951 lineHeight: true, 8952 __experimentalFontFamily: true, 8953 __experimentalFontWeight: true, 8954 __experimentalFontStyle: true, 8955 __experimentalTextTransform: true, 8956 __experimentalTextDecoration: true, 8957 __experimentalLetterSpacing: true, 8958 __experimentalDefaultControls: { 8959 fontSize: true 8960 } 8961 } 8962 }, 8963 editorStyle: "wp-block-comments-editor", 8964 usesContext: ["postId", "postType"] 8965 }; 8966 8967 8968 8969 const { 8970 name: comments_name 8971 } = comments_metadata; 8972 8973 const comments_settings = { 8974 icon: post_comments, 8975 edit: CommentsEdit, 8976 save: comments_save_save, 8977 deprecated: comments_deprecated 8978 }; 8979 const comments_init = () => initBlock({ 8980 name: comments_name, 8981 metadata: comments_metadata, 8982 settings: comments_settings 8983 }); 8984 8985 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js 8986 8987 /** 8988 * WordPress dependencies 8989 */ 8990 8991 8992 8993 8994 8995 function edit_Edit({ 8996 attributes, 8997 context: { 8998 commentId 8999 }, 9000 setAttributes, 9001 isSelected 9002 }) { 9003 const { 9004 height, 9005 width 9006 } = attributes; 9007 const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); 9008 const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); 9009 const avatarUrls = avatars ? Object.values(avatars) : null; 9010 const sizes = avatars ? Object.keys(avatars) : null; 9011 const minSize = sizes ? sizes[0] : 24; 9012 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 9013 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 9014 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 9015 const maxSizeBuffer = Math.floor(maxSize * 2.5); 9016 const { 9017 avatarURL 9018 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 9019 const { 9020 getSettings 9021 } = select(external_wp_blockEditor_namespaceObject.store); 9022 const { 9023 __experimentalDiscussionSettings 9024 } = getSettings(); 9025 return __experimentalDiscussionSettings; 9026 }); 9027 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 9028 title: (0,external_wp_i18n_namespaceObject.__)('Avatar Settings') 9029 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 9030 __nextHasNoMarginBottom: true, 9031 __next40pxDefaultSize: true, 9032 label: (0,external_wp_i18n_namespaceObject.__)('Image size'), 9033 onChange: newWidth => setAttributes({ 9034 width: newWidth, 9035 height: newWidth 9036 }), 9037 min: minSize, 9038 max: maxSizeBuffer, 9039 initialPosition: width, 9040 value: width 9041 }))); 9042 const resizableAvatar = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 9043 size: { 9044 width, 9045 height 9046 }, 9047 showHandle: isSelected, 9048 onResizeStop: (event, direction, elt, delta) => { 9049 setAttributes({ 9050 height: parseInt(height + delta.height, 10), 9051 width: parseInt(width + delta.width, 10) 9052 }); 9053 }, 9054 lockAspectRatio: true, 9055 enable: { 9056 top: false, 9057 right: !(0,external_wp_i18n_namespaceObject.isRTL)(), 9058 bottom: true, 9059 left: (0,external_wp_i18n_namespaceObject.isRTL)() 9060 }, 9061 minWidth: minSize, 9062 maxWidth: maxSizeBuffer 9063 }, (0,external_React_namespaceObject.createElement)("img", { 9064 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL, 9065 alt: `$authorName} ${(0,external_wp_i18n_namespaceObject.__)('Avatar')}`, 9066 ...blockProps 9067 })); 9068 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, inspectorControls, (0,external_React_namespaceObject.createElement)("div", { 9069 ...spacingProps 9070 }, resizableAvatar)); 9071 } 9072 9073 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js 9074 /** 9075 * WordPress dependencies 9076 */ 9077 9078 9079 /** 9080 * Internal dependencies 9081 */ 9082 9083 const comment_author_avatar_metadata = { 9084 $schema: "https://schemas.wp.org/trunk/block.json", 9085 apiVersion: 3, 9086 __experimental: "fse", 9087 name: "core/comment-author-avatar", 9088 title: "Comment Author Avatar (deprecated)", 9089 category: "theme", 9090 ancestor: ["core/comment-template"], 9091 description: "This block is deprecated. Please use the Avatar block instead.", 9092 textdomain: "default", 9093 attributes: { 9094 width: { 9095 type: "number", 9096 "default": 96 9097 }, 9098 height: { 9099 type: "number", 9100 "default": 96 9101 } 9102 }, 9103 usesContext: ["commentId"], 9104 supports: { 9105 html: false, 9106 inserter: false, 9107 __experimentalBorder: { 9108 radius: true, 9109 width: true, 9110 color: true, 9111 style: true 9112 }, 9113 color: { 9114 background: true, 9115 text: false, 9116 __experimentalDefaultControls: { 9117 background: true 9118 } 9119 }, 9120 spacing: { 9121 __experimentalSkipSerialization: true, 9122 margin: true, 9123 padding: true 9124 }, 9125 interactivity: { 9126 clientNavigation: true 9127 } 9128 } 9129 }; 9130 9131 const { 9132 name: comment_author_avatar_name 9133 } = comment_author_avatar_metadata; 9134 9135 const comment_author_avatar_settings = { 9136 icon: comment_author_avatar, 9137 edit: edit_Edit 9138 }; 9139 const comment_author_avatar_init = () => initBlock({ 9140 name: comment_author_avatar_name, 9141 metadata: comment_author_avatar_metadata, 9142 settings: comment_author_avatar_settings 9143 }); 9144 9145 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js 9146 9147 /** 9148 * WordPress dependencies 9149 */ 9150 9151 const commentAuthorName = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 9152 viewBox: "0 0 24 24", 9153 xmlns: "http://www.w3.org/2000/svg" 9154 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9155 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", 9156 fillRule: "evenodd", 9157 clipRule: "evenodd" 9158 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9159 d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15", 9160 fillRule: "evenodd", 9161 clipRule: "evenodd" 9162 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, { 9163 cx: "12", 9164 cy: "9", 9165 r: "2", 9166 fillRule: "evenodd", 9167 clipRule: "evenodd" 9168 })); 9169 /* harmony default export */ const comment_author_name = (commentAuthorName); 9170 9171 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js 9172 9173 /** 9174 * External dependencies 9175 */ 9176 9177 9178 /** 9179 * WordPress dependencies 9180 */ 9181 9182 9183 9184 9185 9186 9187 /** 9188 * Renders the `core/comment-author-name` block on the editor. 9189 * 9190 * @param {Object} props React props. 9191 * @param {Object} props.setAttributes Callback for updating block attributes. 9192 * @param {Object} props.attributes Block attributes. 9193 * @param {string} props.attributes.isLink Whether the author name should be linked. 9194 * @param {string} props.attributes.linkTarget Target of the link. 9195 * @param {string} props.attributes.textAlign Text alignment. 9196 * @param {Object} props.context Inherited context. 9197 * @param {string} props.context.commentId The comment ID. 9198 * 9199 * @return {JSX.Element} React element. 9200 */ 9201 function comment_author_name_edit_Edit({ 9202 attributes: { 9203 isLink, 9204 linkTarget, 9205 textAlign 9206 }, 9207 context: { 9208 commentId 9209 }, 9210 setAttributes 9211 }) { 9212 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9213 className: classnames_default()({ 9214 [`has-text-align-$textAlign}`]: textAlign 9215 }) 9216 }); 9217 let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => { 9218 const { 9219 getEntityRecord 9220 } = select(external_wp_coreData_namespaceObject.store); 9221 const comment = getEntityRecord('root', 'comment', commentId); 9222 const authorName = comment?.author_name; // eslint-disable-line camelcase 9223 9224 if (comment && !authorName) { 9225 var _user$name; 9226 const user = getEntityRecord('root', 'user', comment.author); 9227 return (_user$name = user?.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous'); 9228 } 9229 return authorName !== null && authorName !== void 0 ? authorName : ''; 9230 }, [commentId]); 9231 const blockControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 9232 group: "block" 9233 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9234 value: textAlign, 9235 onChange: newAlign => setAttributes({ 9236 textAlign: newAlign 9237 }) 9238 })); 9239 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 9240 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 9241 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 9242 __nextHasNoMarginBottom: true, 9243 label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'), 9244 onChange: () => setAttributes({ 9245 isLink: !isLink 9246 }), 9247 checked: isLink 9248 }), isLink && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 9249 __nextHasNoMarginBottom: true, 9250 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 9251 onChange: value => setAttributes({ 9252 linkTarget: value ? '_blank' : '_self' 9253 }), 9254 checked: linkTarget === '_blank' 9255 }))); 9256 if (!commentId || !displayName) { 9257 displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title'); 9258 } 9259 const displayAuthor = isLink ? (0,external_React_namespaceObject.createElement)("a", { 9260 href: "#comment-author-pseudo-link", 9261 onClick: event => event.preventDefault() 9262 }, displayName) : displayName; 9263 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_React_namespaceObject.createElement)("div", { 9264 ...blockProps 9265 }, displayAuthor)); 9266 } 9267 9268 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js 9269 /** 9270 * Internal dependencies 9271 */ 9272 9273 const deprecated_v1 = { 9274 attributes: { 9275 isLink: { 9276 type: 'boolean', 9277 default: false 9278 }, 9279 linkTarget: { 9280 type: 'string', 9281 default: '_self' 9282 } 9283 }, 9284 supports: { 9285 html: false, 9286 color: { 9287 gradients: true, 9288 link: true 9289 }, 9290 typography: { 9291 fontSize: true, 9292 lineHeight: true, 9293 __experimentalFontFamily: true, 9294 __experimentalFontWeight: true, 9295 __experimentalFontStyle: true, 9296 __experimentalTextTransform: true, 9297 __experimentalLetterSpacing: true 9298 } 9299 }, 9300 save() { 9301 return null; 9302 }, 9303 migrate: migrate_font_family, 9304 isEligible({ 9305 style 9306 }) { 9307 return style?.typography?.fontFamily; 9308 } 9309 }; 9310 9311 /** 9312 * New deprecations need to be placed first 9313 * for them to have higher priority. 9314 * 9315 * Old deprecations may need to be updated as well. 9316 * 9317 * See block-deprecation.md 9318 */ 9319 /* harmony default export */ const comment_author_name_deprecated = ([deprecated_v1]); 9320 9321 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js 9322 /** 9323 * WordPress dependencies 9324 */ 9325 9326 9327 /** 9328 * Internal dependencies 9329 */ 9330 9331 const comment_author_name_metadata = { 9332 $schema: "https://schemas.wp.org/trunk/block.json", 9333 apiVersion: 3, 9334 name: "core/comment-author-name", 9335 title: "Comment Author Name", 9336 category: "theme", 9337 ancestor: ["core/comment-template"], 9338 description: "Displays the name of the author of the comment.", 9339 textdomain: "default", 9340 attributes: { 9341 isLink: { 9342 type: "boolean", 9343 "default": true 9344 }, 9345 linkTarget: { 9346 type: "string", 9347 "default": "_self" 9348 }, 9349 textAlign: { 9350 type: "string" 9351 } 9352 }, 9353 usesContext: ["commentId"], 9354 supports: { 9355 html: false, 9356 spacing: { 9357 margin: true, 9358 padding: true 9359 }, 9360 color: { 9361 gradients: true, 9362 link: true, 9363 __experimentalDefaultControls: { 9364 background: true, 9365 text: true, 9366 link: true 9367 } 9368 }, 9369 typography: { 9370 fontSize: true, 9371 lineHeight: true, 9372 __experimentalFontFamily: true, 9373 __experimentalFontWeight: true, 9374 __experimentalFontStyle: true, 9375 __experimentalTextTransform: true, 9376 __experimentalTextDecoration: true, 9377 __experimentalLetterSpacing: true, 9378 __experimentalDefaultControls: { 9379 fontSize: true 9380 } 9381 }, 9382 interactivity: { 9383 clientNavigation: true 9384 } 9385 } 9386 }; 9387 9388 9389 const { 9390 name: comment_author_name_name 9391 } = comment_author_name_metadata; 9392 9393 const comment_author_name_settings = { 9394 icon: comment_author_name, 9395 edit: comment_author_name_edit_Edit, 9396 deprecated: comment_author_name_deprecated 9397 }; 9398 const comment_author_name_init = () => initBlock({ 9399 name: comment_author_name_name, 9400 metadata: comment_author_name_metadata, 9401 settings: comment_author_name_settings 9402 }); 9403 9404 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js 9405 9406 /** 9407 * WordPress dependencies 9408 */ 9409 9410 const commentContent = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 9411 viewBox: "0 0 24 24", 9412 xmlns: "http://www.w3.org/2000/svg" 9413 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9414 fillRule: "evenodd", 9415 clipRule: "evenodd", 9416 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" 9417 })); 9418 /* harmony default export */ const comment_content = (commentContent); 9419 9420 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js 9421 9422 /** 9423 * External dependencies 9424 */ 9425 9426 9427 /** 9428 * WordPress dependencies 9429 */ 9430 9431 9432 9433 9434 9435 9436 /** 9437 * Renders the `core/comment-content` block on the editor. 9438 * 9439 * @param {Object} props React props. 9440 * @param {Object} props.setAttributes Callback for updating block attributes. 9441 * @param {Object} props.attributes Block attributes. 9442 * @param {string} props.attributes.textAlign The `textAlign` attribute. 9443 * @param {Object} props.context Inherited context. 9444 * @param {string} props.context.commentId The comment ID. 9445 * 9446 * @return {JSX.Element} React element. 9447 */ 9448 function comment_content_edit_Edit({ 9449 setAttributes, 9450 attributes: { 9451 textAlign 9452 }, 9453 context: { 9454 commentId 9455 } 9456 }) { 9457 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9458 className: classnames_default()({ 9459 [`has-text-align-$textAlign}`]: textAlign 9460 }) 9461 }); 9462 const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId); 9463 const blockControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 9464 group: "block" 9465 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9466 value: textAlign, 9467 onChange: newAlign => setAttributes({ 9468 textAlign: newAlign 9469 }) 9470 })); 9471 if (!commentId || !content) { 9472 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, (0,external_React_namespaceObject.createElement)("div", { 9473 ...blockProps 9474 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title')))); 9475 } 9476 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, (0,external_React_namespaceObject.createElement)("div", { 9477 ...blockProps 9478 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, { 9479 key: "html" 9480 }, content.rendered)))); 9481 } 9482 9483 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js 9484 /** 9485 * WordPress dependencies 9486 */ 9487 9488 9489 /** 9490 * Internal dependencies 9491 */ 9492 9493 const comment_content_metadata = { 9494 $schema: "https://schemas.wp.org/trunk/block.json", 9495 apiVersion: 3, 9496 name: "core/comment-content", 9497 title: "Comment Content", 9498 category: "theme", 9499 ancestor: ["core/comment-template"], 9500 description: "Displays the contents of a comment.", 9501 textdomain: "default", 9502 usesContext: ["commentId"], 9503 attributes: { 9504 textAlign: { 9505 type: "string" 9506 } 9507 }, 9508 supports: { 9509 color: { 9510 gradients: true, 9511 link: true, 9512 __experimentalDefaultControls: { 9513 background: true, 9514 text: true 9515 } 9516 }, 9517 typography: { 9518 fontSize: true, 9519 lineHeight: true, 9520 __experimentalFontFamily: true, 9521 __experimentalFontWeight: true, 9522 __experimentalFontStyle: true, 9523 __experimentalTextTransform: true, 9524 __experimentalTextDecoration: true, 9525 __experimentalLetterSpacing: true, 9526 __experimentalDefaultControls: { 9527 fontSize: true 9528 } 9529 }, 9530 spacing: { 9531 padding: ["horizontal", "vertical"], 9532 __experimentalDefaultControls: { 9533 padding: true 9534 } 9535 }, 9536 html: false 9537 } 9538 }; 9539 9540 const { 9541 name: comment_content_name 9542 } = comment_content_metadata; 9543 9544 const comment_content_settings = { 9545 icon: comment_content, 9546 edit: comment_content_edit_Edit 9547 }; 9548 const comment_content_init = () => initBlock({ 9549 name: comment_content_name, 9550 metadata: comment_content_metadata, 9551 settings: comment_content_settings 9552 }); 9553 9554 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js 9555 9556 /** 9557 * WordPress dependencies 9558 */ 9559 9560 const postDate = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 9561 xmlns: "http://www.w3.org/2000/svg", 9562 viewBox: "0 0 24 24" 9563 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9564 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" 9565 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9566 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" 9567 })); 9568 /* harmony default export */ const post_date = (postDate); 9569 9570 ;// CONCATENATED MODULE: external ["wp","date"] 9571 const external_wp_date_namespaceObject = window["wp"]["date"]; 9572 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js 9573 9574 /** 9575 * WordPress dependencies 9576 */ 9577 9578 9579 9580 9581 9582 9583 /** 9584 * Renders the `core/comment-date` block on the editor. 9585 * 9586 * @param {Object} props React props. 9587 * @param {Object} props.setAttributes Callback for updating block attributes. 9588 * @param {Object} props.attributes Block attributes. 9589 * @param {string} props.attributes.format Format of the date. 9590 * @param {string} props.attributes.isLink Whether the author name should be linked. 9591 * @param {Object} props.context Inherited context. 9592 * @param {string} props.context.commentId The comment ID. 9593 * 9594 * @return {JSX.Element} React element. 9595 */ 9596 function comment_date_edit_Edit({ 9597 attributes: { 9598 format, 9599 isLink 9600 }, 9601 context: { 9602 commentId 9603 }, 9604 setAttributes 9605 }) { 9606 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 9607 let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId); 9608 const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); 9609 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 9610 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 9611 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { 9612 format: format, 9613 defaultFormat: siteFormat, 9614 onChange: nextFormat => setAttributes({ 9615 format: nextFormat 9616 }) 9617 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 9618 __nextHasNoMarginBottom: true, 9619 label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'), 9620 onChange: () => setAttributes({ 9621 isLink: !isLink 9622 }), 9623 checked: isLink 9624 }))); 9625 if (!commentId || !date) { 9626 date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title'); 9627 } 9628 let commentDate = date instanceof Date ? (0,external_React_namespaceObject.createElement)("time", { 9629 dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date) 9630 }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_React_namespaceObject.createElement)("time", null, date); 9631 if (isLink) { 9632 commentDate = (0,external_React_namespaceObject.createElement)("a", { 9633 href: "#comment-date-pseudo-link", 9634 onClick: event => event.preventDefault() 9635 }, commentDate); 9636 } 9637 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, inspectorControls, (0,external_React_namespaceObject.createElement)("div", { 9638 ...blockProps 9639 }, commentDate)); 9640 } 9641 9642 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js 9643 /** 9644 * Internal dependencies 9645 */ 9646 9647 const comment_date_deprecated_v1 = { 9648 attributes: { 9649 format: { 9650 type: 'string' 9651 }, 9652 isLink: { 9653 type: 'boolean', 9654 default: false 9655 } 9656 }, 9657 supports: { 9658 html: false, 9659 color: { 9660 gradients: true, 9661 link: true 9662 }, 9663 typography: { 9664 fontSize: true, 9665 lineHeight: true, 9666 __experimentalFontFamily: true, 9667 __experimentalFontWeight: true, 9668 __experimentalFontStyle: true, 9669 __experimentalTextTransform: true, 9670 __experimentalLetterSpacing: true 9671 } 9672 }, 9673 save() { 9674 return null; 9675 }, 9676 migrate: migrate_font_family, 9677 isEligible({ 9678 style 9679 }) { 9680 return style?.typography?.fontFamily; 9681 } 9682 }; 9683 9684 /** 9685 * New deprecations need to be placed first 9686 * for them to have higher priority. 9687 * 9688 * Old deprecations may need to be updated as well. 9689 * 9690 * See block-deprecation.md 9691 */ 9692 /* harmony default export */ const comment_date_deprecated = ([comment_date_deprecated_v1]); 9693 9694 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js 9695 /** 9696 * WordPress dependencies 9697 */ 9698 9699 9700 /** 9701 * Internal dependencies 9702 */ 9703 9704 const comment_date_metadata = { 9705 $schema: "https://schemas.wp.org/trunk/block.json", 9706 apiVersion: 3, 9707 name: "core/comment-date", 9708 title: "Comment Date", 9709 category: "theme", 9710 ancestor: ["core/comment-template"], 9711 description: "Displays the date on which the comment was posted.", 9712 textdomain: "default", 9713 attributes: { 9714 format: { 9715 type: "string" 9716 }, 9717 isLink: { 9718 type: "boolean", 9719 "default": true 9720 } 9721 }, 9722 usesContext: ["commentId"], 9723 supports: { 9724 html: false, 9725 color: { 9726 gradients: true, 9727 link: true, 9728 __experimentalDefaultControls: { 9729 background: true, 9730 text: true, 9731 link: true 9732 } 9733 }, 9734 spacing: { 9735 margin: true, 9736 padding: true 9737 }, 9738 typography: { 9739 fontSize: true, 9740 lineHeight: true, 9741 __experimentalFontFamily: true, 9742 __experimentalFontWeight: true, 9743 __experimentalFontStyle: true, 9744 __experimentalTextTransform: true, 9745 __experimentalTextDecoration: true, 9746 __experimentalLetterSpacing: true, 9747 __experimentalDefaultControls: { 9748 fontSize: true 9749 } 9750 }, 9751 interactivity: { 9752 clientNavigation: true 9753 } 9754 } 9755 }; 9756 9757 9758 const { 9759 name: comment_date_name 9760 } = comment_date_metadata; 9761 9762 const comment_date_settings = { 9763 icon: post_date, 9764 edit: comment_date_edit_Edit, 9765 deprecated: comment_date_deprecated 9766 }; 9767 const comment_date_init = () => initBlock({ 9768 name: comment_date_name, 9769 metadata: comment_date_metadata, 9770 settings: comment_date_settings 9771 }); 9772 9773 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js 9774 9775 /** 9776 * WordPress dependencies 9777 */ 9778 9779 const commentEditLink = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 9780 width: "24", 9781 height: "24", 9782 viewBox: "0 0 24 24", 9783 xmlns: "http://www.w3.org/2000/svg" 9784 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9785 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" 9786 })); 9787 /* harmony default export */ const comment_edit_link = (commentEditLink); 9788 9789 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js 9790 9791 /** 9792 * External dependencies 9793 */ 9794 9795 9796 /** 9797 * WordPress dependencies 9798 */ 9799 9800 9801 9802 function comment_edit_link_edit_Edit({ 9803 attributes: { 9804 linkTarget, 9805 textAlign 9806 }, 9807 setAttributes 9808 }) { 9809 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9810 className: classnames_default()({ 9811 [`has-text-align-$textAlign}`]: textAlign 9812 }) 9813 }); 9814 const blockControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 9815 group: "block" 9816 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9817 value: textAlign, 9818 onChange: newAlign => setAttributes({ 9819 textAlign: newAlign 9820 }) 9821 })); 9822 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 9823 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 9824 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 9825 __nextHasNoMarginBottom: true, 9826 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 9827 onChange: value => setAttributes({ 9828 linkTarget: value ? '_blank' : '_self' 9829 }), 9830 checked: linkTarget === '_blank' 9831 }))); 9832 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_React_namespaceObject.createElement)("div", { 9833 ...blockProps 9834 }, (0,external_React_namespaceObject.createElement)("a", { 9835 href: "#edit-comment-pseudo-link", 9836 onClick: event => event.preventDefault() 9837 }, (0,external_wp_i18n_namespaceObject.__)('Edit')))); 9838 } 9839 9840 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js 9841 /** 9842 * WordPress dependencies 9843 */ 9844 9845 9846 /** 9847 * Internal dependencies 9848 */ 9849 9850 const comment_edit_link_metadata = { 9851 $schema: "https://schemas.wp.org/trunk/block.json", 9852 apiVersion: 3, 9853 name: "core/comment-edit-link", 9854 title: "Comment Edit Link", 9855 category: "theme", 9856 ancestor: ["core/comment-template"], 9857 description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", 9858 textdomain: "default", 9859 usesContext: ["commentId"], 9860 attributes: { 9861 linkTarget: { 9862 type: "string", 9863 "default": "_self" 9864 }, 9865 textAlign: { 9866 type: "string" 9867 } 9868 }, 9869 supports: { 9870 html: false, 9871 color: { 9872 link: true, 9873 gradients: true, 9874 text: false, 9875 __experimentalDefaultControls: { 9876 background: true, 9877 link: true 9878 } 9879 }, 9880 spacing: { 9881 margin: true, 9882 padding: true 9883 }, 9884 typography: { 9885 fontSize: true, 9886 lineHeight: true, 9887 __experimentalFontFamily: true, 9888 __experimentalFontWeight: true, 9889 __experimentalFontStyle: true, 9890 __experimentalTextTransform: true, 9891 __experimentalTextDecoration: true, 9892 __experimentalLetterSpacing: true, 9893 __experimentalDefaultControls: { 9894 fontSize: true 9895 } 9896 }, 9897 interactivity: { 9898 clientNavigation: true 9899 } 9900 } 9901 }; 9902 9903 const { 9904 name: comment_edit_link_name 9905 } = comment_edit_link_metadata; 9906 9907 const comment_edit_link_settings = { 9908 icon: comment_edit_link, 9909 edit: comment_edit_link_edit_Edit 9910 }; 9911 const comment_edit_link_init = () => initBlock({ 9912 name: comment_edit_link_name, 9913 metadata: comment_edit_link_metadata, 9914 settings: comment_edit_link_settings 9915 }); 9916 9917 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js 9918 9919 /** 9920 * WordPress dependencies 9921 */ 9922 9923 const commentReplyLink = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 9924 width: "24", 9925 height: "24", 9926 viewBox: "0 0 24 24", 9927 xmlns: "http://www.w3.org/2000/svg" 9928 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 9929 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" 9930 })); 9931 /* harmony default export */ const comment_reply_link = (commentReplyLink); 9932 9933 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js 9934 9935 /** 9936 * External dependencies 9937 */ 9938 9939 9940 /** 9941 * WordPress dependencies 9942 */ 9943 9944 9945 9946 /** 9947 * Renders the `core/comment-reply-link` block on the editor. 9948 * 9949 * @param {Object} props React props. 9950 * @param {Object} props.setAttributes Callback for updating block attributes. 9951 * @param {Object} props.attributes Block attributes. 9952 * @param {string} props.attributes.textAlign The `textAlign` attribute. 9953 * 9954 * @return {JSX.Element} React element. 9955 */ 9956 function comment_reply_link_edit_Edit({ 9957 setAttributes, 9958 attributes: { 9959 textAlign 9960 } 9961 }) { 9962 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9963 className: classnames_default()({ 9964 [`has-text-align-$textAlign}`]: textAlign 9965 }) 9966 }); 9967 const blockControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 9968 group: "block" 9969 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9970 value: textAlign, 9971 onChange: newAlign => setAttributes({ 9972 textAlign: newAlign 9973 }) 9974 })); 9975 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, (0,external_React_namespaceObject.createElement)("div", { 9976 ...blockProps 9977 }, (0,external_React_namespaceObject.createElement)("a", { 9978 href: "#comment-reply-pseudo-link", 9979 onClick: event => event.preventDefault() 9980 }, (0,external_wp_i18n_namespaceObject.__)('Reply')))); 9981 } 9982 /* harmony default export */ const comment_reply_link_edit = (comment_reply_link_edit_Edit); 9983 9984 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js 9985 /** 9986 * WordPress dependencies 9987 */ 9988 9989 9990 /** 9991 * Internal dependencies 9992 */ 9993 9994 const comment_reply_link_metadata = { 9995 $schema: "https://schemas.wp.org/trunk/block.json", 9996 apiVersion: 3, 9997 name: "core/comment-reply-link", 9998 title: "Comment Reply Link", 9999 category: "theme", 10000 ancestor: ["core/comment-template"], 10001 description: "Displays a link to reply to a comment.", 10002 textdomain: "default", 10003 usesContext: ["commentId"], 10004 attributes: { 10005 textAlign: { 10006 type: "string" 10007 } 10008 }, 10009 supports: { 10010 color: { 10011 gradients: true, 10012 link: true, 10013 text: false, 10014 __experimentalDefaultControls: { 10015 background: true, 10016 link: true 10017 } 10018 }, 10019 spacing: { 10020 margin: true, 10021 padding: true 10022 }, 10023 typography: { 10024 fontSize: true, 10025 lineHeight: true, 10026 __experimentalFontFamily: true, 10027 __experimentalFontWeight: true, 10028 __experimentalFontStyle: true, 10029 __experimentalTextTransform: true, 10030 __experimentalTextDecoration: true, 10031 __experimentalLetterSpacing: true, 10032 __experimentalDefaultControls: { 10033 fontSize: true 10034 } 10035 }, 10036 html: false 10037 } 10038 }; 10039 10040 const { 10041 name: comment_reply_link_name 10042 } = comment_reply_link_metadata; 10043 10044 const comment_reply_link_settings = { 10045 edit: comment_reply_link_edit, 10046 icon: comment_reply_link 10047 }; 10048 const comment_reply_link_init = () => initBlock({ 10049 name: comment_reply_link_name, 10050 metadata: comment_reply_link_metadata, 10051 settings: comment_reply_link_settings 10052 }); 10053 10054 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js 10055 10056 /** 10057 * WordPress dependencies 10058 */ 10059 10060 const layout = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 10061 xmlns: "http://www.w3.org/2000/svg", 10062 viewBox: "0 0 24 24" 10063 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 10064 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" 10065 })); 10066 /* harmony default export */ const library_layout = (layout); 10067 10068 ;// CONCATENATED MODULE: external ["wp","apiFetch"] 10069 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; 10070 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); 10071 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js 10072 /** 10073 * WordPress dependencies 10074 */ 10075 10076 10077 10078 10079 10080 10081 // This is limited by WP REST API 10082 const MAX_COMMENTS_PER_PAGE = 100; 10083 10084 /** 10085 * Return an object with the query args needed to fetch the default page of 10086 * comments. 10087 * 10088 * @param {Object} props Hook props. 10089 * @param {number} props.postId ID of the post that contains the comments. 10090 * discussion settings. 10091 * 10092 * @return {Object} Query args to retrieve the comments. 10093 */ 10094 const useCommentQueryArgs = ({ 10095 postId 10096 }) => { 10097 // Initialize the query args that are not going to change. 10098 const queryArgs = { 10099 status: 'approve', 10100 order: 'asc', 10101 context: 'embed', 10102 parent: 0, 10103 _embed: 'children' 10104 }; 10105 10106 // Get the Discussion settings that may be needed to query the comments. 10107 const { 10108 pageComments, 10109 commentsPerPage, 10110 defaultCommentsPage: defaultPage 10111 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 10112 const { 10113 getSettings 10114 } = select(external_wp_blockEditor_namespaceObject.store); 10115 const { 10116 __experimentalDiscussionSettings 10117 } = getSettings(); 10118 return __experimentalDiscussionSettings; 10119 }); 10120 10121 // WP REST API doesn't allow fetching more than max items limit set per single page of data. 10122 // As for the editor performance is more important than completeness of data and fetching only the 10123 // max allowed for single page should be enough for the purpose of design and laying out the page. 10124 // Fetching over the limit would return an error here but would work with backend query. 10125 const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; 10126 10127 // Get the number of the default page. 10128 const page = useDefaultPageIndex({ 10129 defaultPage, 10130 postId, 10131 perPage, 10132 queryArgs 10133 }); 10134 10135 // Merge, memoize and return all query arguments, unless the default page's 10136 // number is not known yet. 10137 return (0,external_wp_element_namespaceObject.useMemo)(() => { 10138 return page ? { 10139 ...queryArgs, 10140 post: postId, 10141 per_page: perPage, 10142 page 10143 } : null; 10144 }, [postId, perPage, page]); 10145 }; 10146 10147 /** 10148 * Return the index of the default page, depending on whether `defaultPage` is 10149 * `newest` or `oldest`. In the first case, the only way to know the page's 10150 * index is by using the `X-WP-TotalPages` header, which forces to make an 10151 * additional request. 10152 * 10153 * @param {Object} props Hook props. 10154 * @param {string} props.defaultPage Page shown by default (newest/oldest). 10155 * @param {number} props.postId ID of the post that contains the comments. 10156 * @param {number} props.perPage The number of comments included per page. 10157 * @param {Object} props.queryArgs Other query args. 10158 * 10159 * @return {number} Index of the default comments page. 10160 */ 10161 const useDefaultPageIndex = ({ 10162 defaultPage, 10163 postId, 10164 perPage, 10165 queryArgs 10166 }) => { 10167 // Store the default page indices. 10168 const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({}); 10169 const key = `$postId}_$perPage}`; 10170 const page = defaultPages[key] || 0; 10171 (0,external_wp_element_namespaceObject.useEffect)(() => { 10172 // Do nothing if the page is already known or not the newest page. 10173 if (page || defaultPage !== 'newest') { 10174 return; 10175 } 10176 // We need to fetch comments to know the index. Use HEAD and limit 10177 // fields just to ID, to make this call as light as possible. 10178 external_wp_apiFetch_default()({ 10179 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 10180 ...queryArgs, 10181 post: postId, 10182 per_page: perPage, 10183 _fields: 'id' 10184 }), 10185 method: 'HEAD', 10186 parse: false 10187 }).then(res => { 10188 const pages = parseInt(res.headers.get('X-WP-TotalPages')); 10189 setDefaultPages({ 10190 ...defaultPages, 10191 [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page. 10192 }); 10193 }); 10194 }, [defaultPage, postId, perPage, setDefaultPages]); 10195 10196 // The oldest one is always the first one. 10197 return defaultPage === 'newest' ? page : 1; 10198 }; 10199 10200 /** 10201 * Generate a tree structure of comment IDs from a list of comment entities. The 10202 * children of each comment are obtained from `_embedded`. 10203 * 10204 * @typedef {{ commentId: number, children: CommentNode }} CommentNode 10205 * 10206 * @param {Object[]} topLevelComments List of comment entities. 10207 * @return {{ commentTree: CommentNode[]}} Tree of comment IDs. 10208 */ 10209 const useCommentTree = topLevelComments => { 10210 const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments?.map(({ 10211 id, 10212 _embedded 10213 }) => { 10214 const [children] = _embedded?.children || [[]]; 10215 return { 10216 commentId: id, 10217 children: children.map(child => ({ 10218 commentId: child.id 10219 })) 10220 }; 10221 }), [topLevelComments]); 10222 return commentTree; 10223 }; 10224 10225 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js 10226 10227 /** 10228 * WordPress dependencies 10229 */ 10230 10231 10232 10233 10234 10235 10236 10237 /** 10238 * Internal dependencies 10239 */ 10240 10241 const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; 10242 10243 /** 10244 * Function that returns a comment structure that will be rendered with default placehoders. 10245 * 10246 * Each comment has a `commentId` property that is always a negative number in 10247 * case of the placeholders. This is to ensure that the comment does not 10248 * conflict with the actual (real) comments. 10249 * 10250 * @param {Object} settings Discussion Settings. 10251 * @param {number} [settings.perPage] - Comments per page setting or block attribute. 10252 * @param {boolean} [settings.pageComments] - Enable break comments into pages setting. 10253 * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting. 10254 * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments. 10255 * 10256 * @typedef {{id: null, children: EmptyComment[]}} EmptyComment 10257 * @return {EmptyComment[]} Inner blocks of the Comment Template 10258 */ 10259 const getCommentsPlaceholder = ({ 10260 perPage, 10261 pageComments, 10262 threadComments, 10263 threadCommentsDepth 10264 }) => { 10265 // Limit commentsDepth to 3 10266 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); 10267 const buildChildrenComment = commentsLevel => { 10268 // Render children comments until commentsDepth is reached 10269 if (commentsLevel < commentsDepth) { 10270 const nextLevel = commentsLevel + 1; 10271 return [{ 10272 commentId: -(commentsLevel + 3), 10273 children: buildChildrenComment(nextLevel) 10274 }]; 10275 } 10276 return []; 10277 }; 10278 10279 // Add the first comment and its children 10280 const placeholderComments = [{ 10281 commentId: -1, 10282 children: buildChildrenComment(1) 10283 }]; 10284 10285 // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max 10286 if ((!pageComments || perPage >= 2) && commentsDepth < 3) { 10287 placeholderComments.push({ 10288 commentId: -2, 10289 children: [] 10290 }); 10291 } 10292 10293 // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments 10294 if ((!pageComments || perPage >= 3) && commentsDepth < 2) { 10295 placeholderComments.push({ 10296 commentId: -3, 10297 children: [] 10298 }); 10299 } 10300 10301 // In case that the value is set but larger than 3 we truncate it to 3. 10302 return placeholderComments; 10303 }; 10304 10305 /** 10306 * Component which renders the inner blocks of the Comment Template. 10307 * 10308 * @param {Object} props Component props. 10309 * @param {Array} [props.comment] - A comment object. 10310 * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. 10311 * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. 10312 * @param {Array} [props.firstCommentId] - ID of the first comment in the array. 10313 * @param {Array} [props.blocks] - Array of blocks returned from 10314 * getBlocks() in parent . 10315 * @return {Element} Inner blocks of the Comment Template 10316 */ 10317 function CommentTemplateInnerBlocks({ 10318 comment, 10319 activeCommentId, 10320 setActiveCommentId, 10321 firstCommentId, 10322 blocks 10323 }) { 10324 const { 10325 children, 10326 ...innerBlocksProps 10327 } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, { 10328 template: edit_TEMPLATE 10329 }); 10330 return (0,external_React_namespaceObject.createElement)("li", { 10331 ...innerBlocksProps 10332 }, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_React_namespaceObject.createElement)(MemoizedCommentTemplatePreview, { 10333 blocks: blocks, 10334 commentId: comment.commentId, 10335 setActiveCommentId: setActiveCommentId, 10336 isHidden: comment.commentId === (activeCommentId || firstCommentId) 10337 }), comment?.children?.length > 0 ? (0,external_React_namespaceObject.createElement)(CommentsList, { 10338 comments: comment.children, 10339 activeCommentId: activeCommentId, 10340 setActiveCommentId: setActiveCommentId, 10341 blocks: blocks, 10342 firstCommentId: firstCommentId 10343 }) : null); 10344 } 10345 const CommentTemplatePreview = ({ 10346 blocks, 10347 commentId, 10348 setActiveCommentId, 10349 isHidden 10350 }) => { 10351 const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ 10352 blocks 10353 }); 10354 const handleOnClick = () => { 10355 setActiveCommentId(commentId); 10356 }; 10357 10358 // We have to hide the preview block if the `comment` props points to 10359 // the curently active block! 10360 10361 // Or, to put it differently, every preview block is visible unless it is the 10362 // currently active block - in this case we render its inner blocks. 10363 const style = { 10364 display: isHidden ? 'none' : undefined 10365 }; 10366 return (0,external_React_namespaceObject.createElement)("div", { 10367 ...blockPreviewProps, 10368 tabIndex: 0, 10369 role: "button", 10370 style: style 10371 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role 10372 , 10373 onClick: handleOnClick, 10374 onKeyPress: handleOnClick 10375 }); 10376 }; 10377 const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview); 10378 10379 /** 10380 * Component that renders a list of (nested) comments. It is called recursively. 10381 * 10382 * @param {Object} props Component props. 10383 * @param {Array} [props.comments] - Array of comment objects. 10384 * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`. 10385 * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. 10386 * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. 10387 * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent. 10388 * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of 10389 * comment objects. 10390 * @return {Element} List of comments. 10391 */ 10392 const CommentsList = ({ 10393 comments, 10394 blockProps, 10395 activeCommentId, 10396 setActiveCommentId, 10397 blocks, 10398 firstCommentId 10399 }) => (0,external_React_namespaceObject.createElement)("ol", { 10400 ...blockProps 10401 }, comments && comments.map(({ 10402 commentId, 10403 ...comment 10404 }, index) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 10405 key: comment.commentId || index, 10406 value: { 10407 // If the commentId is negative it means that this comment is a 10408 // "placeholder" and that the block is most likely being used in the 10409 // site editor. In this case, we have to set the commentId to `null` 10410 // because otherwise the (non-existent) comment with a negative ID 10411 // would be reqested from the REST API. 10412 commentId: commentId < 0 ? null : commentId 10413 } 10414 }, (0,external_React_namespaceObject.createElement)(CommentTemplateInnerBlocks, { 10415 comment: { 10416 commentId, 10417 ...comment 10418 }, 10419 activeCommentId: activeCommentId, 10420 setActiveCommentId: setActiveCommentId, 10421 blocks: blocks, 10422 firstCommentId: firstCommentId 10423 })))); 10424 function CommentTemplateEdit({ 10425 clientId, 10426 context: { 10427 postId 10428 } 10429 }) { 10430 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 10431 const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)(); 10432 const { 10433 commentOrder, 10434 threadCommentsDepth, 10435 threadComments, 10436 commentsPerPage, 10437 pageComments 10438 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 10439 const { 10440 getSettings 10441 } = select(external_wp_blockEditor_namespaceObject.store); 10442 return getSettings().__experimentalDiscussionSettings; 10443 }); 10444 const commentQuery = useCommentQueryArgs({ 10445 postId 10446 }); 10447 const { 10448 topLevelComments, 10449 blocks 10450 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 10451 const { 10452 getEntityRecords 10453 } = select(external_wp_coreData_namespaceObject.store); 10454 const { 10455 getBlocks 10456 } = select(external_wp_blockEditor_namespaceObject.store); 10457 return { 10458 // Request only top-level comments. Replies are embedded. 10459 topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null, 10460 blocks: getBlocks(clientId) 10461 }; 10462 }, [clientId, commentQuery]); 10463 10464 // Generate a tree structure of comment IDs. 10465 let commentTree = useCommentTree( 10466 // Reverse the order of top comments if needed. 10467 commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments); 10468 if (!topLevelComments) { 10469 return (0,external_React_namespaceObject.createElement)("p", { 10470 ...blockProps 10471 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); 10472 } 10473 if (!postId) { 10474 commentTree = getCommentsPlaceholder({ 10475 perPage: commentsPerPage, 10476 pageComments, 10477 threadComments, 10478 threadCommentsDepth 10479 }); 10480 } 10481 if (!commentTree.length) { 10482 return (0,external_React_namespaceObject.createElement)("p", { 10483 ...blockProps 10484 }, (0,external_wp_i18n_namespaceObject.__)('No results found.')); 10485 } 10486 return (0,external_React_namespaceObject.createElement)(CommentsList, { 10487 comments: commentTree, 10488 blockProps: blockProps, 10489 blocks: blocks, 10490 activeCommentId: activeCommentId, 10491 setActiveCommentId: setActiveCommentId, 10492 firstCommentId: commentTree[0]?.commentId 10493 }); 10494 } 10495 10496 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js 10497 10498 /** 10499 * WordPress dependencies 10500 */ 10501 10502 function CommentTemplateSave() { 10503 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 10504 } 10505 10506 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js 10507 /** 10508 * WordPress dependencies 10509 */ 10510 10511 10512 /** 10513 * Internal dependencies 10514 */ 10515 10516 const comment_template_metadata = { 10517 $schema: "https://schemas.wp.org/trunk/block.json", 10518 apiVersion: 3, 10519 name: "core/comment-template", 10520 title: "Comment Template", 10521 category: "design", 10522 parent: ["core/comments"], 10523 description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", 10524 textdomain: "default", 10525 usesContext: ["postId"], 10526 supports: { 10527 align: true, 10528 html: false, 10529 reusable: false, 10530 spacing: { 10531 margin: true, 10532 padding: true 10533 }, 10534 typography: { 10535 fontSize: true, 10536 lineHeight: true, 10537 __experimentalFontFamily: true, 10538 __experimentalFontWeight: true, 10539 __experimentalFontStyle: true, 10540 __experimentalTextTransform: true, 10541 __experimentalTextDecoration: true, 10542 __experimentalLetterSpacing: true, 10543 __experimentalDefaultControls: { 10544 fontSize: true 10545 } 10546 }, 10547 interactivity: { 10548 clientNavigation: true 10549 } 10550 }, 10551 style: "wp-block-comment-template" 10552 }; 10553 10554 10555 const { 10556 name: comment_template_name 10557 } = comment_template_metadata; 10558 10559 const comment_template_settings = { 10560 icon: library_layout, 10561 edit: CommentTemplateEdit, 10562 save: CommentTemplateSave 10563 }; 10564 const comment_template_init = () => initBlock({ 10565 name: comment_template_name, 10566 metadata: comment_template_metadata, 10567 settings: comment_template_settings 10568 }); 10569 10570 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js 10571 10572 /** 10573 * WordPress dependencies 10574 */ 10575 10576 const queryPaginationPrevious = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 10577 xmlns: "http://www.w3.org/2000/svg", 10578 viewBox: "0 0 24 24" 10579 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 10580 d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" 10581 })); 10582 /* harmony default export */ const query_pagination_previous = (queryPaginationPrevious); 10583 10584 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js 10585 10586 /** 10587 * WordPress dependencies 10588 */ 10589 10590 10591 const arrowMap = { 10592 none: '', 10593 arrow: '←', 10594 chevron: '«' 10595 }; 10596 function CommentsPaginationPreviousEdit({ 10597 attributes: { 10598 label 10599 }, 10600 setAttributes, 10601 context: { 10602 'comments/paginationArrow': paginationArrow 10603 } 10604 }) { 10605 const displayArrow = arrowMap[paginationArrow]; 10606 return (0,external_React_namespaceObject.createElement)("a", { 10607 href: "#comments-pagination-previous-pseudo-link", 10608 onClick: event => event.preventDefault(), 10609 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 10610 }, displayArrow && (0,external_React_namespaceObject.createElement)("span", { 10611 className: `wp-block-comments-pagination-previous-arrow is-arrow-$paginationArrow}` 10612 }, displayArrow), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 10613 __experimentalVersion: 2, 10614 tagName: "span", 10615 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'), 10616 placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'), 10617 value: label, 10618 onChange: newLabel => setAttributes({ 10619 label: newLabel 10620 }) 10621 })); 10622 } 10623 10624 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js 10625 /** 10626 * WordPress dependencies 10627 */ 10628 10629 10630 /** 10631 * Internal dependencies 10632 */ 10633 10634 const comments_pagination_previous_metadata = { 10635 $schema: "https://schemas.wp.org/trunk/block.json", 10636 apiVersion: 3, 10637 name: "core/comments-pagination-previous", 10638 title: "Comments Previous Page", 10639 category: "theme", 10640 parent: ["core/comments-pagination"], 10641 description: "Displays the previous comment's page link.", 10642 textdomain: "default", 10643 attributes: { 10644 label: { 10645 type: "string" 10646 } 10647 }, 10648 usesContext: ["postId", "comments/paginationArrow"], 10649 supports: { 10650 reusable: false, 10651 html: false, 10652 color: { 10653 gradients: true, 10654 text: false, 10655 __experimentalDefaultControls: { 10656 background: true 10657 } 10658 }, 10659 typography: { 10660 fontSize: true, 10661 lineHeight: true, 10662 __experimentalFontFamily: true, 10663 __experimentalFontWeight: true, 10664 __experimentalFontStyle: true, 10665 __experimentalTextTransform: true, 10666 __experimentalTextDecoration: true, 10667 __experimentalLetterSpacing: true, 10668 __experimentalDefaultControls: { 10669 fontSize: true 10670 } 10671 }, 10672 interactivity: { 10673 clientNavigation: true 10674 } 10675 } 10676 }; 10677 10678 const { 10679 name: comments_pagination_previous_name 10680 } = comments_pagination_previous_metadata; 10681 10682 const comments_pagination_previous_settings = { 10683 icon: query_pagination_previous, 10684 edit: CommentsPaginationPreviousEdit 10685 }; 10686 const comments_pagination_previous_init = () => initBlock({ 10687 name: comments_pagination_previous_name, 10688 metadata: comments_pagination_previous_metadata, 10689 settings: comments_pagination_previous_settings 10690 }); 10691 10692 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js 10693 10694 /** 10695 * WordPress dependencies 10696 */ 10697 10698 const queryPagination = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 10699 xmlns: "http://www.w3.org/2000/svg", 10700 viewBox: "0 0 24 24" 10701 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 10702 d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" 10703 })); 10704 /* harmony default export */ const query_pagination = (queryPagination); 10705 10706 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js 10707 10708 /** 10709 * WordPress dependencies 10710 */ 10711 10712 10713 function CommentsPaginationArrowControls({ 10714 value, 10715 onChange 10716 }) { 10717 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 10718 __nextHasNoMarginBottom: true, 10719 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 10720 value: value, 10721 onChange: onChange, 10722 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'), 10723 isBlock: true 10724 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 10725 value: "none", 10726 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks') 10727 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 10728 value: "arrow", 10729 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks') 10730 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 10731 value: "chevron", 10732 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks') 10733 })); 10734 } 10735 10736 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js 10737 10738 /** 10739 * WordPress dependencies 10740 */ 10741 10742 10743 10744 10745 10746 /** 10747 * Internal dependencies 10748 */ 10749 10750 const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']]; 10751 function QueryPaginationEdit({ 10752 attributes: { 10753 paginationArrow 10754 }, 10755 setAttributes, 10756 clientId 10757 }) { 10758 const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { 10759 const { 10760 getBlocks 10761 } = select(external_wp_blockEditor_namespaceObject.store); 10762 const innerBlocks = getBlocks(clientId); 10763 /** 10764 * Show the `paginationArrow` control only if a 10765 * Comments Pagination Next or Comments Pagination Previous 10766 * block exists. 10767 */ 10768 return innerBlocks?.find(innerBlock => { 10769 return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name); 10770 }); 10771 }, []); 10772 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 10773 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 10774 template: comments_pagination_edit_TEMPLATE 10775 }); 10776 10777 // Get the Discussion settings 10778 const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => { 10779 const { 10780 getSettings 10781 } = select(external_wp_blockEditor_namespaceObject.store); 10782 const { 10783 __experimentalDiscussionSettings 10784 } = getSettings(); 10785 return __experimentalDiscussionSettings?.pageComments; 10786 }, []); 10787 10788 // If paging comments is not enabled in the Discussion Settings then hide the pagination 10789 // controls. We don't want to remove them from the template so that when the user enables 10790 // paging comments, the controls will be visible. 10791 if (!pageComments) { 10792 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings')); 10793 } 10794 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 10795 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 10796 }, (0,external_React_namespaceObject.createElement)(CommentsPaginationArrowControls, { 10797 value: paginationArrow, 10798 onChange: value => { 10799 setAttributes({ 10800 paginationArrow: value 10801 }); 10802 } 10803 }))), (0,external_React_namespaceObject.createElement)("div", { 10804 ...innerBlocksProps 10805 })); 10806 } 10807 10808 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js 10809 10810 /** 10811 * WordPress dependencies 10812 */ 10813 10814 function comments_pagination_save_save() { 10815 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 10816 } 10817 10818 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js 10819 /** 10820 * WordPress dependencies 10821 */ 10822 10823 10824 /** 10825 * Internal dependencies 10826 */ 10827 10828 const comments_pagination_metadata = { 10829 $schema: "https://schemas.wp.org/trunk/block.json", 10830 apiVersion: 3, 10831 name: "core/comments-pagination", 10832 title: "Comments Pagination", 10833 category: "theme", 10834 parent: ["core/comments"], 10835 allowedBlocks: ["core/comments-pagination-previous", "core/comments-pagination-numbers", "core/comments-pagination-next"], 10836 description: "Displays a paginated navigation to next/previous set of comments, when applicable.", 10837 textdomain: "default", 10838 attributes: { 10839 paginationArrow: { 10840 type: "string", 10841 "default": "none" 10842 } 10843 }, 10844 providesContext: { 10845 "comments/paginationArrow": "paginationArrow" 10846 }, 10847 supports: { 10848 align: true, 10849 reusable: false, 10850 html: false, 10851 color: { 10852 gradients: true, 10853 link: true, 10854 __experimentalDefaultControls: { 10855 background: true, 10856 text: true, 10857 link: true 10858 } 10859 }, 10860 layout: { 10861 allowSwitching: false, 10862 allowInheriting: false, 10863 "default": { 10864 type: "flex" 10865 } 10866 }, 10867 typography: { 10868 fontSize: true, 10869 lineHeight: true, 10870 __experimentalFontFamily: true, 10871 __experimentalFontWeight: true, 10872 __experimentalFontStyle: true, 10873 __experimentalTextTransform: true, 10874 __experimentalTextDecoration: true, 10875 __experimentalLetterSpacing: true, 10876 __experimentalDefaultControls: { 10877 fontSize: true 10878 } 10879 }, 10880 interactivity: { 10881 clientNavigation: true 10882 } 10883 }, 10884 editorStyle: "wp-block-comments-pagination-editor", 10885 style: "wp-block-comments-pagination" 10886 }; 10887 10888 10889 const { 10890 name: comments_pagination_name 10891 } = comments_pagination_metadata; 10892 10893 const comments_pagination_settings = { 10894 icon: query_pagination, 10895 edit: QueryPaginationEdit, 10896 save: comments_pagination_save_save 10897 }; 10898 const comments_pagination_init = () => initBlock({ 10899 name: comments_pagination_name, 10900 metadata: comments_pagination_metadata, 10901 settings: comments_pagination_settings 10902 }); 10903 10904 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js 10905 10906 /** 10907 * WordPress dependencies 10908 */ 10909 10910 const queryPaginationNext = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 10911 xmlns: "http://www.w3.org/2000/svg", 10912 viewBox: "0 0 24 24" 10913 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 10914 d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" 10915 })); 10916 /* harmony default export */ const query_pagination_next = (queryPaginationNext); 10917 10918 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js 10919 10920 /** 10921 * WordPress dependencies 10922 */ 10923 10924 10925 const edit_arrowMap = { 10926 none: '', 10927 arrow: '→', 10928 chevron: '»' 10929 }; 10930 function CommentsPaginationNextEdit({ 10931 attributes: { 10932 label 10933 }, 10934 setAttributes, 10935 context: { 10936 'comments/paginationArrow': paginationArrow 10937 } 10938 }) { 10939 const displayArrow = edit_arrowMap[paginationArrow]; 10940 return (0,external_React_namespaceObject.createElement)("a", { 10941 href: "#comments-pagination-next-pseudo-link", 10942 onClick: event => event.preventDefault(), 10943 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 10944 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 10945 __experimentalVersion: 2, 10946 tagName: "span", 10947 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'), 10948 placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), 10949 value: label, 10950 onChange: newLabel => setAttributes({ 10951 label: newLabel 10952 }) 10953 }), displayArrow && (0,external_React_namespaceObject.createElement)("span", { 10954 className: `wp-block-comments-pagination-next-arrow is-arrow-$paginationArrow}` 10955 }, displayArrow)); 10956 } 10957 10958 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js 10959 /** 10960 * WordPress dependencies 10961 */ 10962 10963 10964 /** 10965 * Internal dependencies 10966 */ 10967 10968 const comments_pagination_next_metadata = { 10969 $schema: "https://schemas.wp.org/trunk/block.json", 10970 apiVersion: 3, 10971 name: "core/comments-pagination-next", 10972 title: "Comments Next Page", 10973 category: "theme", 10974 parent: ["core/comments-pagination"], 10975 description: "Displays the next comment's page link.", 10976 textdomain: "default", 10977 attributes: { 10978 label: { 10979 type: "string" 10980 } 10981 }, 10982 usesContext: ["postId", "comments/paginationArrow"], 10983 supports: { 10984 reusable: false, 10985 html: false, 10986 color: { 10987 gradients: true, 10988 text: false, 10989 __experimentalDefaultControls: { 10990 background: true 10991 } 10992 }, 10993 typography: { 10994 fontSize: true, 10995 lineHeight: true, 10996 __experimentalFontFamily: true, 10997 __experimentalFontWeight: true, 10998 __experimentalFontStyle: true, 10999 __experimentalTextTransform: true, 11000 __experimentalTextDecoration: true, 11001 __experimentalLetterSpacing: true, 11002 __experimentalDefaultControls: { 11003 fontSize: true 11004 } 11005 }, 11006 interactivity: { 11007 clientNavigation: true 11008 } 11009 } 11010 }; 11011 11012 const { 11013 name: comments_pagination_next_name 11014 } = comments_pagination_next_metadata; 11015 11016 const comments_pagination_next_settings = { 11017 icon: query_pagination_next, 11018 edit: CommentsPaginationNextEdit 11019 }; 11020 const comments_pagination_next_init = () => initBlock({ 11021 name: comments_pagination_next_name, 11022 metadata: comments_pagination_next_metadata, 11023 settings: comments_pagination_next_settings 11024 }); 11025 11026 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js 11027 11028 /** 11029 * WordPress dependencies 11030 */ 11031 11032 const queryPaginationNumbers = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 11033 xmlns: "http://www.w3.org/2000/svg", 11034 viewBox: "0 0 24 24" 11035 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 11036 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" 11037 })); 11038 /* harmony default export */ const query_pagination_numbers = (queryPaginationNumbers); 11039 11040 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js 11041 11042 /** 11043 * WordPress dependencies 11044 */ 11045 11046 const PaginationItem = ({ 11047 content, 11048 tag: Tag = 'a', 11049 extraClass = '' 11050 }) => Tag === 'a' ? (0,external_React_namespaceObject.createElement)(Tag, { 11051 className: `page-numbers $extraClass}`, 11052 href: "#comments-pagination-numbers-pseudo-link", 11053 onClick: event => event.preventDefault() 11054 }, content) : (0,external_React_namespaceObject.createElement)(Tag, { 11055 className: `page-numbers $extraClass}` 11056 }, content); 11057 function CommentsPaginationNumbersEdit() { 11058 return (0,external_React_namespaceObject.createElement)("div", { 11059 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 11060 }, (0,external_React_namespaceObject.createElement)(PaginationItem, { 11061 content: "1" 11062 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11063 content: "2" 11064 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11065 content: "3", 11066 tag: "span", 11067 extraClass: "current" 11068 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11069 content: "4" 11070 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11071 content: "5" 11072 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11073 content: "...", 11074 tag: "span", 11075 extraClass: "dots" 11076 }), (0,external_React_namespaceObject.createElement)(PaginationItem, { 11077 content: "8" 11078 })); 11079 } 11080 11081 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js 11082 /** 11083 * WordPress dependencies 11084 */ 11085 11086 11087 /** 11088 * Internal dependencies 11089 */ 11090 11091 const comments_pagination_numbers_metadata = { 11092 $schema: "https://schemas.wp.org/trunk/block.json", 11093 apiVersion: 3, 11094 name: "core/comments-pagination-numbers", 11095 title: "Comments Page Numbers", 11096 category: "theme", 11097 parent: ["core/comments-pagination"], 11098 description: "Displays a list of page numbers for comments pagination.", 11099 textdomain: "default", 11100 usesContext: ["postId"], 11101 supports: { 11102 reusable: false, 11103 html: false, 11104 color: { 11105 gradients: true, 11106 text: false, 11107 __experimentalDefaultControls: { 11108 background: true 11109 } 11110 }, 11111 typography: { 11112 fontSize: true, 11113 lineHeight: true, 11114 __experimentalFontFamily: true, 11115 __experimentalFontWeight: true, 11116 __experimentalFontStyle: true, 11117 __experimentalTextTransform: true, 11118 __experimentalTextDecoration: true, 11119 __experimentalLetterSpacing: true, 11120 __experimentalDefaultControls: { 11121 fontSize: true 11122 } 11123 }, 11124 interactivity: { 11125 clientNavigation: true 11126 } 11127 } 11128 }; 11129 11130 const { 11131 name: comments_pagination_numbers_name 11132 } = comments_pagination_numbers_metadata; 11133 11134 const comments_pagination_numbers_settings = { 11135 icon: query_pagination_numbers, 11136 edit: CommentsPaginationNumbersEdit 11137 }; 11138 const comments_pagination_numbers_init = () => initBlock({ 11139 name: comments_pagination_numbers_name, 11140 metadata: comments_pagination_numbers_metadata, 11141 settings: comments_pagination_numbers_settings 11142 }); 11143 11144 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/title.js 11145 11146 /** 11147 * WordPress dependencies 11148 */ 11149 11150 const title = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 11151 xmlns: "http://www.w3.org/2000/svg", 11152 viewBox: "0 0 24 24" 11153 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 11154 d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" 11155 })); 11156 /* harmony default export */ const library_title = (title); 11157 11158 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js 11159 11160 /** 11161 * External dependencies 11162 */ 11163 11164 11165 /** 11166 * WordPress dependencies 11167 */ 11168 11169 11170 11171 11172 11173 11174 11175 11176 function comments_title_edit_Edit({ 11177 attributes: { 11178 textAlign, 11179 showPostTitle, 11180 showCommentsCount, 11181 level 11182 }, 11183 setAttributes, 11184 context: { 11185 postType, 11186 postId 11187 } 11188 }) { 11189 const TagName = 'h' + level; 11190 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 11191 const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 11192 const isSiteEditor = typeof postId === 'undefined'; 11193 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 11194 className: classnames_default()({ 11195 [`has-text-align-$textAlign}`]: textAlign 11196 }) 11197 }); 11198 const { 11199 threadCommentsDepth, 11200 threadComments, 11201 commentsPerPage, 11202 pageComments 11203 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 11204 const { 11205 getSettings 11206 } = select(external_wp_blockEditor_namespaceObject.store); 11207 return getSettings().__experimentalDiscussionSettings; 11208 }); 11209 (0,external_wp_element_namespaceObject.useEffect)(() => { 11210 if (isSiteEditor) { 11211 // Match the number of comments that will be shown in the comment-template/edit.js placeholder 11212 11213 const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; 11214 const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; 11215 const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); 11216 setCommentsCount(Math.min(commentsNumber, 3)); 11217 return; 11218 } 11219 const currentPostId = postId; 11220 external_wp_apiFetch_default()({ 11221 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 11222 post: postId, 11223 _fields: 'id' 11224 }), 11225 method: 'HEAD', 11226 parse: false 11227 }).then(res => { 11228 // Stale requests will have the `currentPostId` of an older closure. 11229 if (currentPostId === postId) { 11230 setCommentsCount(parseInt(res.headers.get('X-WP-Total'))); 11231 } 11232 }).catch(() => { 11233 setCommentsCount(0); 11234 }); 11235 }, [postId]); 11236 const blockControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 11237 group: "block" 11238 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 11239 value: textAlign, 11240 onChange: newAlign => setAttributes({ 11241 textAlign: newAlign 11242 }) 11243 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 11244 value: level, 11245 onChange: newLevel => setAttributes({ 11246 level: newLevel 11247 }) 11248 })); 11249 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 11250 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 11251 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 11252 __nextHasNoMarginBottom: true, 11253 label: (0,external_wp_i18n_namespaceObject.__)('Show post title'), 11254 checked: showPostTitle, 11255 onChange: value => setAttributes({ 11256 showPostTitle: value 11257 }) 11258 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 11259 __nextHasNoMarginBottom: true, 11260 label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'), 11261 checked: showCommentsCount, 11262 onChange: value => setAttributes({ 11263 showCommentsCount: value 11264 }) 11265 }))); 11266 const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('“Post Title”') : `"$rawTitle}"`; 11267 let placeholder; 11268 if (showCommentsCount && commentsCount !== undefined) { 11269 if (showPostTitle) { 11270 if (commentsCount === 1) { 11271 /* translators: %s: Post title. */ 11272 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle); 11273 } else { 11274 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Number of comments, 2: Post title. */ 11275 (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle); 11276 } 11277 } else if (commentsCount === 1) { 11278 placeholder = (0,external_wp_i18n_namespaceObject.__)('One response'); 11279 } else { 11280 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Number of comments. */ 11281 (0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount); 11282 } 11283 } else if (showPostTitle) { 11284 if (commentsCount === 1) { 11285 /* translators: %s: Post title. */ 11286 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle); 11287 } else { 11288 /* translators: %s: Post title. */ 11289 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle); 11290 } 11291 } else if (commentsCount === 1) { 11292 placeholder = (0,external_wp_i18n_namespaceObject.__)('Response'); 11293 } else { 11294 placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses'); 11295 } 11296 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_React_namespaceObject.createElement)(TagName, { 11297 ...blockProps 11298 }, placeholder)); 11299 } 11300 11301 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js 11302 /** 11303 * Internal dependencies 11304 */ 11305 const deprecated_metadata = { 11306 $schema: "https://schemas.wp.org/trunk/block.json", 11307 apiVersion: 3, 11308 name: "core/comments-title", 11309 title: "Comments Title", 11310 category: "theme", 11311 ancestor: ["core/comments"], 11312 description: "Displays a title with the number of comments.", 11313 textdomain: "default", 11314 usesContext: ["postId", "postType"], 11315 attributes: { 11316 textAlign: { 11317 type: "string" 11318 }, 11319 showPostTitle: { 11320 type: "boolean", 11321 "default": true 11322 }, 11323 showCommentsCount: { 11324 type: "boolean", 11325 "default": true 11326 }, 11327 level: { 11328 type: "number", 11329 "default": 2 11330 } 11331 }, 11332 supports: { 11333 anchor: false, 11334 align: true, 11335 html: false, 11336 __experimentalBorder: { 11337 radius: true, 11338 color: true, 11339 width: true, 11340 style: true 11341 }, 11342 color: { 11343 gradients: true, 11344 __experimentalDefaultControls: { 11345 background: true, 11346 text: true 11347 } 11348 }, 11349 spacing: { 11350 margin: true, 11351 padding: true 11352 }, 11353 typography: { 11354 fontSize: true, 11355 lineHeight: true, 11356 __experimentalFontFamily: true, 11357 __experimentalFontWeight: true, 11358 __experimentalFontStyle: true, 11359 __experimentalTextTransform: true, 11360 __experimentalTextDecoration: true, 11361 __experimentalLetterSpacing: true, 11362 __experimentalDefaultControls: { 11363 fontSize: true, 11364 __experimentalFontFamily: true, 11365 __experimentalFontStyle: true, 11366 __experimentalFontWeight: true 11367 } 11368 }, 11369 interactivity: { 11370 clientNavigation: true 11371 } 11372 } 11373 }; 11374 const { 11375 attributes, 11376 supports 11377 } = deprecated_metadata; 11378 /* harmony default export */ const comments_title_deprecated = ([{ 11379 attributes: { 11380 ...attributes, 11381 singleCommentLabel: { 11382 type: 'string' 11383 }, 11384 multipleCommentsLabel: { 11385 type: 'string' 11386 } 11387 }, 11388 supports, 11389 migrate: oldAttributes => { 11390 const { 11391 singleCommentLabel, 11392 multipleCommentsLabel, 11393 ...newAttributes 11394 } = oldAttributes; 11395 return newAttributes; 11396 }, 11397 isEligible: ({ 11398 multipleCommentsLabel, 11399 singleCommentLabel 11400 }) => multipleCommentsLabel || singleCommentLabel, 11401 save: () => null 11402 }]); 11403 11404 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js 11405 /** 11406 * WordPress dependencies 11407 */ 11408 11409 11410 /** 11411 * Internal dependencies 11412 */ 11413 11414 const comments_title_metadata = { 11415 $schema: "https://schemas.wp.org/trunk/block.json", 11416 apiVersion: 3, 11417 name: "core/comments-title", 11418 title: "Comments Title", 11419 category: "theme", 11420 ancestor: ["core/comments"], 11421 description: "Displays a title with the number of comments.", 11422 textdomain: "default", 11423 usesContext: ["postId", "postType"], 11424 attributes: { 11425 textAlign: { 11426 type: "string" 11427 }, 11428 showPostTitle: { 11429 type: "boolean", 11430 "default": true 11431 }, 11432 showCommentsCount: { 11433 type: "boolean", 11434 "default": true 11435 }, 11436 level: { 11437 type: "number", 11438 "default": 2 11439 } 11440 }, 11441 supports: { 11442 anchor: false, 11443 align: true, 11444 html: false, 11445 __experimentalBorder: { 11446 radius: true, 11447 color: true, 11448 width: true, 11449 style: true 11450 }, 11451 color: { 11452 gradients: true, 11453 __experimentalDefaultControls: { 11454 background: true, 11455 text: true 11456 } 11457 }, 11458 spacing: { 11459 margin: true, 11460 padding: true 11461 }, 11462 typography: { 11463 fontSize: true, 11464 lineHeight: true, 11465 __experimentalFontFamily: true, 11466 __experimentalFontWeight: true, 11467 __experimentalFontStyle: true, 11468 __experimentalTextTransform: true, 11469 __experimentalTextDecoration: true, 11470 __experimentalLetterSpacing: true, 11471 __experimentalDefaultControls: { 11472 fontSize: true, 11473 __experimentalFontFamily: true, 11474 __experimentalFontStyle: true, 11475 __experimentalFontWeight: true 11476 } 11477 }, 11478 interactivity: { 11479 clientNavigation: true 11480 } 11481 } 11482 }; 11483 11484 11485 const { 11486 name: comments_title_name 11487 } = comments_title_metadata; 11488 11489 const comments_title_settings = { 11490 icon: library_title, 11491 edit: comments_title_edit_Edit, 11492 deprecated: comments_title_deprecated 11493 }; 11494 const comments_title_init = () => initBlock({ 11495 name: comments_title_name, 11496 metadata: comments_title_metadata, 11497 settings: comments_title_settings 11498 }); 11499 11500 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js 11501 11502 /** 11503 * WordPress dependencies 11504 */ 11505 11506 const cover = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 11507 xmlns: "http://www.w3.org/2000/svg", 11508 viewBox: "0 0 24 24" 11509 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 11510 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" 11511 })); 11512 /* harmony default export */ const library_cover = (cover); 11513 11514 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js 11515 /** 11516 * WordPress dependencies 11517 */ 11518 11519 const POSITION_CLASSNAMES = { 11520 'top left': 'is-position-top-left', 11521 'top center': 'is-position-top-center', 11522 'top right': 'is-position-top-right', 11523 'center left': 'is-position-center-left', 11524 'center center': 'is-position-center-center', 11525 center: 'is-position-center-center', 11526 'center right': 'is-position-center-right', 11527 'bottom left': 'is-position-bottom-left', 11528 'bottom center': 'is-position-bottom-center', 11529 'bottom right': 'is-position-bottom-right' 11530 }; 11531 const IMAGE_BACKGROUND_TYPE = 'image'; 11532 const VIDEO_BACKGROUND_TYPE = 'video'; 11533 const COVER_MIN_HEIGHT = 50; 11534 const COVER_MAX_HEIGHT = 1000; 11535 const COVER_DEFAULT_HEIGHT = 300; 11536 const DEFAULT_FOCAL_POINT = { 11537 x: 0.5, 11538 y: 0.5 11539 }; 11540 const shared_ALLOWED_MEDIA_TYPES = ['image', 'video']; 11541 function mediaPosition({ 11542 x, 11543 y 11544 } = DEFAULT_FOCAL_POINT) { 11545 return `$Math.round(x * 100)}% $Math.round(y * 100)}%`; 11546 } 11547 function dimRatioToClass(ratio) { 11548 return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 11549 } 11550 function attributesFromMedia(media) { 11551 if (!media || !media.url) { 11552 return { 11553 url: undefined, 11554 id: undefined 11555 }; 11556 } 11557 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 11558 media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); 11559 } 11560 let mediaType; 11561 // For media selections originated from a file upload. 11562 if (media.media_type) { 11563 if (media.media_type === IMAGE_BACKGROUND_TYPE) { 11564 mediaType = IMAGE_BACKGROUND_TYPE; 11565 } else { 11566 // only images and videos are accepted so if the media_type is not an image we can assume it is a video. 11567 // Videos contain the media type of 'file' in the object returned from the rest api. 11568 mediaType = VIDEO_BACKGROUND_TYPE; 11569 } 11570 } else { 11571 // For media selections originated from existing files in the media library. 11572 if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) { 11573 return; 11574 } 11575 mediaType = media.type; 11576 } 11577 return { 11578 url: media.url, 11579 id: media.id, 11580 alt: media?.alt, 11581 backgroundType: mediaType, 11582 ...(mediaType === VIDEO_BACKGROUND_TYPE ? { 11583 hasParallax: undefined 11584 } : {}) 11585 }; 11586 } 11587 11588 /** 11589 * Checks of the contentPosition is the center (default) position. 11590 * 11591 * @param {string} contentPosition The current content position. 11592 * @return {boolean} Whether the contentPosition is center. 11593 */ 11594 function isContentPositionCenter(contentPosition) { 11595 return !contentPosition || contentPosition === 'center center' || contentPosition === 'center'; 11596 } 11597 11598 /** 11599 * Retrieves the className for the current contentPosition. 11600 * The default position (center) will not have a className. 11601 * 11602 * @param {string} contentPosition The current content position. 11603 * @return {string} The className assigned to the contentPosition. 11604 */ 11605 function getPositionClassName(contentPosition) { 11606 /* 11607 * Only render a className if the contentPosition is not center (the default). 11608 */ 11609 if (isContentPositionCenter(contentPosition)) return ''; 11610 return POSITION_CLASSNAMES[contentPosition]; 11611 } 11612 11613 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js 11614 11615 /** 11616 * External dependencies 11617 */ 11618 11619 11620 /** 11621 * WordPress dependencies 11622 */ 11623 11624 11625 11626 11627 11628 /** 11629 * Internal dependencies 11630 */ 11631 11632 function backgroundImageStyles(url) { 11633 return url ? { 11634 backgroundImage: `url($url})` 11635 } : {}; 11636 } 11637 11638 /** 11639 * Original function to determine the background opacity classname 11640 * 11641 * Used in deprecations: v1-7. 11642 * 11643 * @param {number} ratio ratio to use for opacity. 11644 * @return {string} background opacity class . 11645 */ 11646 function dimRatioToClassV1(ratio) { 11647 return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 11648 } 11649 function migrateDimRatio(attributes) { 11650 return { 11651 ...attributes, 11652 dimRatio: !attributes.url ? 100 : attributes.dimRatio 11653 }; 11654 } 11655 function migrateTag(attributes) { 11656 if (!attributes.tagName) { 11657 attributes = { 11658 ...attributes, 11659 tagName: 'div' 11660 }; 11661 } 11662 return { 11663 ...attributes 11664 }; 11665 } 11666 const deprecated_blockAttributes = { 11667 url: { 11668 type: 'string' 11669 }, 11670 id: { 11671 type: 'number' 11672 }, 11673 hasParallax: { 11674 type: 'boolean', 11675 default: false 11676 }, 11677 dimRatio: { 11678 type: 'number', 11679 default: 50 11680 }, 11681 overlayColor: { 11682 type: 'string' 11683 }, 11684 customOverlayColor: { 11685 type: 'string' 11686 }, 11687 backgroundType: { 11688 type: 'string', 11689 default: 'image' 11690 }, 11691 focalPoint: { 11692 type: 'object' 11693 } 11694 }; 11695 const v8ToV11BlockAttributes = { 11696 url: { 11697 type: 'string' 11698 }, 11699 id: { 11700 type: 'number' 11701 }, 11702 alt: { 11703 type: 'string', 11704 source: 'attribute', 11705 selector: 'img', 11706 attribute: 'alt', 11707 default: '' 11708 }, 11709 hasParallax: { 11710 type: 'boolean', 11711 default: false 11712 }, 11713 isRepeated: { 11714 type: 'boolean', 11715 default: false 11716 }, 11717 dimRatio: { 11718 type: 'number', 11719 default: 100 11720 }, 11721 overlayColor: { 11722 type: 'string' 11723 }, 11724 customOverlayColor: { 11725 type: 'string' 11726 }, 11727 backgroundType: { 11728 type: 'string', 11729 default: 'image' 11730 }, 11731 focalPoint: { 11732 type: 'object' 11733 }, 11734 minHeight: { 11735 type: 'number' 11736 }, 11737 minHeightUnit: { 11738 type: 'string' 11739 }, 11740 gradient: { 11741 type: 'string' 11742 }, 11743 customGradient: { 11744 type: 'string' 11745 }, 11746 contentPosition: { 11747 type: 'string' 11748 }, 11749 isDark: { 11750 type: 'boolean', 11751 default: true 11752 }, 11753 allowedBlocks: { 11754 type: 'array' 11755 }, 11756 templateLock: { 11757 type: ['string', 'boolean'], 11758 enum: ['all', 'insert', false] 11759 } 11760 }; 11761 const v12BlockAttributes = { 11762 ...v8ToV11BlockAttributes, 11763 useFeaturedImage: { 11764 type: 'boolean', 11765 default: false 11766 }, 11767 tagName: { 11768 type: 'string', 11769 default: 'div' 11770 } 11771 }; 11772 const v7toV11BlockSupports = { 11773 anchor: true, 11774 align: true, 11775 html: false, 11776 spacing: { 11777 padding: true, 11778 __experimentalDefaultControls: { 11779 padding: true 11780 } 11781 }, 11782 color: { 11783 __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', 11784 text: false, 11785 background: false 11786 } 11787 }; 11788 const v12BlockSupports = { 11789 ...v7toV11BlockSupports, 11790 spacing: { 11791 padding: true, 11792 margin: ['top', 'bottom'], 11793 blockGap: true, 11794 __experimentalDefaultControls: { 11795 padding: true, 11796 blockGap: true 11797 } 11798 }, 11799 __experimentalBorder: { 11800 color: true, 11801 radius: true, 11802 style: true, 11803 width: true, 11804 __experimentalDefaultControls: { 11805 color: true, 11806 radius: true, 11807 style: true, 11808 width: true 11809 } 11810 }, 11811 color: { 11812 __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', 11813 heading: true, 11814 text: true, 11815 background: false, 11816 __experimentalSkipSerialization: ['gradients'], 11817 enableContrastChecker: false 11818 }, 11819 typography: { 11820 fontSize: true, 11821 lineHeight: true, 11822 __experimentalFontFamily: true, 11823 __experimentalFontWeight: true, 11824 __experimentalFontStyle: true, 11825 __experimentalTextTransform: true, 11826 __experimentalTextDecoration: true, 11827 __experimentalLetterSpacing: true, 11828 __experimentalDefaultControls: { 11829 fontSize: true 11830 } 11831 }, 11832 layout: { 11833 allowJustification: false 11834 } 11835 }; 11836 11837 // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated. 11838 const v13 = { 11839 attributes: v12BlockAttributes, 11840 supports: v12BlockSupports, 11841 save({ 11842 attributes 11843 }) { 11844 const { 11845 backgroundType, 11846 gradient, 11847 contentPosition, 11848 customGradient, 11849 customOverlayColor, 11850 dimRatio, 11851 focalPoint, 11852 useFeaturedImage, 11853 hasParallax, 11854 isDark, 11855 isRepeated, 11856 overlayColor, 11857 url, 11858 alt, 11859 id, 11860 minHeight: minHeightProp, 11861 minHeightUnit, 11862 tagName: Tag 11863 } = attributes; 11864 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 11865 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 11866 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 11867 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 11868 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 11869 const isImgElement = !(hasParallax || isRepeated); 11870 const style = { 11871 minHeight: minHeight || undefined 11872 }; 11873 const bgStyle = { 11874 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 11875 background: customGradient ? customGradient : undefined 11876 }; 11877 const objectPosition = 11878 // prettier-ignore 11879 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 11880 const backgroundImage = url ? `url($url})` : undefined; 11881 const backgroundPosition = mediaPosition(focalPoint); 11882 const classes = classnames_default()({ 11883 'is-light': !isDark, 11884 'has-parallax': hasParallax, 11885 'is-repeated': isRepeated, 11886 'has-custom-content-position': !isContentPositionCenter(contentPosition) 11887 }, getPositionClassName(contentPosition)); 11888 const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 11889 'has-parallax': hasParallax, 11890 'is-repeated': isRepeated 11891 }); 11892 const gradientValue = gradient || customGradient; 11893 return (0,external_React_namespaceObject.createElement)(Tag, { 11894 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 11895 className: classes, 11896 style 11897 }) 11898 }, (0,external_React_namespaceObject.createElement)("span", { 11899 "aria-hidden": "true", 11900 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 11901 'has-background-dim': dimRatio !== undefined, 11902 // For backwards compatibility. Former versions of the Cover Block applied 11903 // `.wp-block-cover__gradient-background` in the presence of 11904 // media, a gradient and a dim. 11905 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 11906 'has-background-gradient': gradientValue, 11907 [gradientClass]: gradientClass 11908 }), 11909 style: bgStyle 11910 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_React_namespaceObject.createElement)("img", { 11911 className: imgClasses, 11912 alt: alt, 11913 src: url, 11914 style: { 11915 objectPosition 11916 }, 11917 "data-object-fit": "cover", 11918 "data-object-position": objectPosition 11919 }) : (0,external_React_namespaceObject.createElement)("div", { 11920 role: "img", 11921 className: imgClasses, 11922 style: { 11923 backgroundPosition, 11924 backgroundImage 11925 } 11926 })), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 11927 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 11928 autoPlay: true, 11929 muted: true, 11930 loop: true, 11931 playsInline: true, 11932 src: url, 11933 style: { 11934 objectPosition 11935 }, 11936 "data-object-fit": "cover", 11937 "data-object-position": objectPosition 11938 }), (0,external_React_namespaceObject.createElement)("div", { 11939 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 11940 className: 'wp-block-cover__inner-container' 11941 }) 11942 })); 11943 } 11944 }; 11945 11946 // Deprecation for blocks to prevent auto overlay color from overriding previously set values. 11947 const v12 = { 11948 attributes: v12BlockAttributes, 11949 supports: v12BlockSupports, 11950 isEligible(attributes) { 11951 return attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined; 11952 }, 11953 migrate(attributes) { 11954 return { 11955 ...attributes, 11956 isUserOverlayColor: true 11957 }; 11958 }, 11959 save({ 11960 attributes 11961 }) { 11962 const { 11963 backgroundType, 11964 gradient, 11965 contentPosition, 11966 customGradient, 11967 customOverlayColor, 11968 dimRatio, 11969 focalPoint, 11970 useFeaturedImage, 11971 hasParallax, 11972 isDark, 11973 isRepeated, 11974 overlayColor, 11975 url, 11976 alt, 11977 id, 11978 minHeight: minHeightProp, 11979 minHeightUnit, 11980 tagName: Tag 11981 } = attributes; 11982 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 11983 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 11984 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 11985 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 11986 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 11987 const isImgElement = !(hasParallax || isRepeated); 11988 const style = { 11989 minHeight: minHeight || undefined 11990 }; 11991 const bgStyle = { 11992 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 11993 background: customGradient ? customGradient : undefined 11994 }; 11995 const objectPosition = 11996 // prettier-ignore 11997 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 11998 const backgroundImage = url ? `url($url})` : undefined; 11999 const backgroundPosition = mediaPosition(focalPoint); 12000 const classes = classnames_default()({ 12001 'is-light': !isDark, 12002 'has-parallax': hasParallax, 12003 'is-repeated': isRepeated, 12004 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12005 }, getPositionClassName(contentPosition)); 12006 const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 12007 'has-parallax': hasParallax, 12008 'is-repeated': isRepeated 12009 }); 12010 const gradientValue = gradient || customGradient; 12011 return (0,external_React_namespaceObject.createElement)(Tag, { 12012 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12013 className: classes, 12014 style 12015 }) 12016 }, (0,external_React_namespaceObject.createElement)("span", { 12017 "aria-hidden": "true", 12018 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12019 'has-background-dim': dimRatio !== undefined, 12020 // For backwards compatibility. Former versions of the Cover Block applied 12021 // `.wp-block-cover__gradient-background` in the presence of 12022 // media, a gradient and a dim. 12023 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12024 'has-background-gradient': gradientValue, 12025 [gradientClass]: gradientClass 12026 }), 12027 style: bgStyle 12028 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_React_namespaceObject.createElement)("img", { 12029 className: imgClasses, 12030 alt: alt, 12031 src: url, 12032 style: { 12033 objectPosition 12034 }, 12035 "data-object-fit": "cover", 12036 "data-object-position": objectPosition 12037 }) : (0,external_React_namespaceObject.createElement)("div", { 12038 role: "img", 12039 className: imgClasses, 12040 style: { 12041 backgroundPosition, 12042 backgroundImage 12043 } 12044 })), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12045 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12046 autoPlay: true, 12047 muted: true, 12048 loop: true, 12049 playsInline: true, 12050 src: url, 12051 style: { 12052 objectPosition 12053 }, 12054 "data-object-fit": "cover", 12055 "data-object-position": objectPosition 12056 }), (0,external_React_namespaceObject.createElement)("div", { 12057 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12058 className: 'wp-block-cover__inner-container' 12059 }) 12060 })); 12061 } 12062 }; 12063 12064 // Deprecation for blocks that does not have a HTML tag option. 12065 const deprecated_v11 = { 12066 attributes: v8ToV11BlockAttributes, 12067 supports: v7toV11BlockSupports, 12068 save({ 12069 attributes 12070 }) { 12071 const { 12072 backgroundType, 12073 gradient, 12074 contentPosition, 12075 customGradient, 12076 customOverlayColor, 12077 dimRatio, 12078 focalPoint, 12079 useFeaturedImage, 12080 hasParallax, 12081 isDark, 12082 isRepeated, 12083 overlayColor, 12084 url, 12085 alt, 12086 id, 12087 minHeight: minHeightProp, 12088 minHeightUnit 12089 } = attributes; 12090 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12091 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12092 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12093 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12094 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12095 const isImgElement = !(hasParallax || isRepeated); 12096 const style = { 12097 minHeight: minHeight || undefined 12098 }; 12099 const bgStyle = { 12100 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12101 background: customGradient ? customGradient : undefined 12102 }; 12103 const objectPosition = 12104 // prettier-ignore 12105 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 12106 const backgroundImage = url ? `url($url})` : undefined; 12107 const backgroundPosition = mediaPosition(focalPoint); 12108 const classes = classnames_default()({ 12109 'is-light': !isDark, 12110 'has-parallax': hasParallax, 12111 'is-repeated': isRepeated, 12112 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12113 }, getPositionClassName(contentPosition)); 12114 const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 12115 'has-parallax': hasParallax, 12116 'is-repeated': isRepeated 12117 }); 12118 const gradientValue = gradient || customGradient; 12119 return (0,external_React_namespaceObject.createElement)("div", { 12120 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12121 className: classes, 12122 style 12123 }) 12124 }, (0,external_React_namespaceObject.createElement)("span", { 12125 "aria-hidden": "true", 12126 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12127 'has-background-dim': dimRatio !== undefined, 12128 // For backwards compatibility. Former versions of the Cover Block applied 12129 // `.wp-block-cover__gradient-background` in the presence of 12130 // media, a gradient and a dim. 12131 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12132 'has-background-gradient': gradientValue, 12133 [gradientClass]: gradientClass 12134 }), 12135 style: bgStyle 12136 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_React_namespaceObject.createElement)("img", { 12137 className: imgClasses, 12138 alt: alt, 12139 src: url, 12140 style: { 12141 objectPosition 12142 }, 12143 "data-object-fit": "cover", 12144 "data-object-position": objectPosition 12145 }) : (0,external_React_namespaceObject.createElement)("div", { 12146 role: "img", 12147 className: imgClasses, 12148 style: { 12149 backgroundPosition, 12150 backgroundImage 12151 } 12152 })), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12153 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12154 autoPlay: true, 12155 muted: true, 12156 loop: true, 12157 playsInline: true, 12158 src: url, 12159 style: { 12160 objectPosition 12161 }, 12162 "data-object-fit": "cover", 12163 "data-object-position": objectPosition 12164 }), (0,external_React_namespaceObject.createElement)("div", { 12165 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12166 className: 'wp-block-cover__inner-container' 12167 }) 12168 })); 12169 }, 12170 migrate: migrateTag 12171 }; 12172 12173 // Deprecation for blocks that renders fixed background as backgroud from the main block container. 12174 const deprecated_v10 = { 12175 attributes: v8ToV11BlockAttributes, 12176 supports: v7toV11BlockSupports, 12177 save({ 12178 attributes 12179 }) { 12180 const { 12181 backgroundType, 12182 gradient, 12183 contentPosition, 12184 customGradient, 12185 customOverlayColor, 12186 dimRatio, 12187 focalPoint, 12188 useFeaturedImage, 12189 hasParallax, 12190 isDark, 12191 isRepeated, 12192 overlayColor, 12193 url, 12194 alt, 12195 id, 12196 minHeight: minHeightProp, 12197 minHeightUnit 12198 } = attributes; 12199 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12200 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12201 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12202 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12203 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12204 const isImgElement = !(hasParallax || isRepeated); 12205 const style = { 12206 ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}), 12207 minHeight: minHeight || undefined 12208 }; 12209 const bgStyle = { 12210 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12211 background: customGradient ? customGradient : undefined 12212 }; 12213 const objectPosition = 12214 // prettier-ignore 12215 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 12216 const classes = classnames_default()({ 12217 'is-light': !isDark, 12218 'has-parallax': hasParallax, 12219 'is-repeated': isRepeated, 12220 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12221 }, getPositionClassName(contentPosition)); 12222 const gradientValue = gradient || customGradient; 12223 return (0,external_React_namespaceObject.createElement)("div", { 12224 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12225 className: classes, 12226 style 12227 }) 12228 }, (0,external_React_namespaceObject.createElement)("span", { 12229 "aria-hidden": "true", 12230 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12231 'has-background-dim': dimRatio !== undefined, 12232 // For backwards compatibility. Former versions of the Cover Block applied 12233 // `.wp-block-cover__gradient-background` in the presence of 12234 // media, a gradient and a dim. 12235 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12236 'has-background-gradient': gradientValue, 12237 [gradientClass]: gradientClass 12238 }), 12239 style: bgStyle 12240 }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_React_namespaceObject.createElement)("img", { 12241 className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 12242 alt: alt, 12243 src: url, 12244 style: { 12245 objectPosition 12246 }, 12247 "data-object-fit": "cover", 12248 "data-object-position": objectPosition 12249 }), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12250 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12251 autoPlay: true, 12252 muted: true, 12253 loop: true, 12254 playsInline: true, 12255 src: url, 12256 style: { 12257 objectPosition 12258 }, 12259 "data-object-fit": "cover", 12260 "data-object-position": objectPosition 12261 }), (0,external_React_namespaceObject.createElement)("div", { 12262 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12263 className: 'wp-block-cover__inner-container' 12264 }) 12265 })); 12266 }, 12267 migrate: migrateTag 12268 }; 12269 12270 // Deprecation for blocks with `minHeightUnit` set but no `minHeight`. 12271 const v9 = { 12272 attributes: v8ToV11BlockAttributes, 12273 supports: v7toV11BlockSupports, 12274 save({ 12275 attributes 12276 }) { 12277 const { 12278 backgroundType, 12279 gradient, 12280 contentPosition, 12281 customGradient, 12282 customOverlayColor, 12283 dimRatio, 12284 focalPoint, 12285 hasParallax, 12286 isDark, 12287 isRepeated, 12288 overlayColor, 12289 url, 12290 alt, 12291 id, 12292 minHeight: minHeightProp, 12293 minHeightUnit 12294 } = attributes; 12295 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12296 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12297 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12298 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12299 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12300 const isImgElement = !(hasParallax || isRepeated); 12301 const style = { 12302 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 12303 minHeight: minHeight || undefined 12304 }; 12305 const bgStyle = { 12306 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12307 background: customGradient ? customGradient : undefined 12308 }; 12309 const objectPosition = 12310 // prettier-ignore 12311 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 12312 const classes = classnames_default()({ 12313 'is-light': !isDark, 12314 'has-parallax': hasParallax, 12315 'is-repeated': isRepeated, 12316 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12317 }, getPositionClassName(contentPosition)); 12318 const gradientValue = gradient || customGradient; 12319 return (0,external_React_namespaceObject.createElement)("div", { 12320 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12321 className: classes, 12322 style 12323 }) 12324 }, (0,external_React_namespaceObject.createElement)("span", { 12325 "aria-hidden": "true", 12326 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12327 'has-background-dim': dimRatio !== undefined, 12328 // For backwards compatibility. Former versions of the Cover Block applied 12329 // `.wp-block-cover__gradient-background` in the presence of 12330 // media, a gradient and a dim. 12331 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12332 'has-background-gradient': gradientValue, 12333 [gradientClass]: gradientClass 12334 }), 12335 style: bgStyle 12336 }), isImageBackground && isImgElement && url && (0,external_React_namespaceObject.createElement)("img", { 12337 className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 12338 alt: alt, 12339 src: url, 12340 style: { 12341 objectPosition 12342 }, 12343 "data-object-fit": "cover", 12344 "data-object-position": objectPosition 12345 }), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12346 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12347 autoPlay: true, 12348 muted: true, 12349 loop: true, 12350 playsInline: true, 12351 src: url, 12352 style: { 12353 objectPosition 12354 }, 12355 "data-object-fit": "cover", 12356 "data-object-position": objectPosition 12357 }), (0,external_React_namespaceObject.createElement)("div", { 12358 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12359 className: 'wp-block-cover__inner-container' 12360 }) 12361 })); 12362 }, 12363 migrate: migrateTag 12364 }; 12365 12366 // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`. 12367 const v8 = { 12368 attributes: v8ToV11BlockAttributes, 12369 supports: v7toV11BlockSupports, 12370 save({ 12371 attributes 12372 }) { 12373 const { 12374 backgroundType, 12375 gradient, 12376 contentPosition, 12377 customGradient, 12378 customOverlayColor, 12379 dimRatio, 12380 focalPoint, 12381 hasParallax, 12382 isDark, 12383 isRepeated, 12384 overlayColor, 12385 url, 12386 alt, 12387 id, 12388 minHeight: minHeightProp, 12389 minHeightUnit 12390 } = attributes; 12391 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12392 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12393 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12394 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12395 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12396 const isImgElement = !(hasParallax || isRepeated); 12397 const style = { 12398 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 12399 minHeight: minHeight || undefined 12400 }; 12401 const bgStyle = { 12402 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12403 background: customGradient ? customGradient : undefined 12404 }; 12405 const objectPosition = 12406 // prettier-ignore 12407 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 12408 const classes = classnames_default()({ 12409 'is-light': !isDark, 12410 'has-parallax': hasParallax, 12411 'is-repeated': isRepeated, 12412 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12413 }, getPositionClassName(contentPosition)); 12414 return (0,external_React_namespaceObject.createElement)("div", { 12415 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12416 className: classes, 12417 style 12418 }) 12419 }, (0,external_React_namespaceObject.createElement)("span", { 12420 "aria-hidden": "true", 12421 className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, { 12422 'has-background-dim': dimRatio !== undefined, 12423 'has-background-gradient': gradient || customGradient, 12424 [gradientClass]: !url && gradientClass 12425 }), 12426 style: bgStyle 12427 }), isImageBackground && isImgElement && url && (0,external_React_namespaceObject.createElement)("img", { 12428 className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 12429 alt: alt, 12430 src: url, 12431 style: { 12432 objectPosition 12433 }, 12434 "data-object-fit": "cover", 12435 "data-object-position": objectPosition 12436 }), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12437 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12438 autoPlay: true, 12439 muted: true, 12440 loop: true, 12441 playsInline: true, 12442 src: url, 12443 style: { 12444 objectPosition 12445 }, 12446 "data-object-fit": "cover", 12447 "data-object-position": objectPosition 12448 }), (0,external_React_namespaceObject.createElement)("div", { 12449 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12450 className: 'wp-block-cover__inner-container' 12451 }) 12452 })); 12453 }, 12454 migrate: migrateTag 12455 }; 12456 const v7 = { 12457 attributes: { 12458 ...deprecated_blockAttributes, 12459 isRepeated: { 12460 type: 'boolean', 12461 default: false 12462 }, 12463 minHeight: { 12464 type: 'number' 12465 }, 12466 minHeightUnit: { 12467 type: 'string' 12468 }, 12469 gradient: { 12470 type: 'string' 12471 }, 12472 customGradient: { 12473 type: 'string' 12474 }, 12475 contentPosition: { 12476 type: 'string' 12477 }, 12478 alt: { 12479 type: 'string', 12480 source: 'attribute', 12481 selector: 'img', 12482 attribute: 'alt', 12483 default: '' 12484 } 12485 }, 12486 supports: v7toV11BlockSupports, 12487 save({ 12488 attributes 12489 }) { 12490 const { 12491 backgroundType, 12492 gradient, 12493 contentPosition, 12494 customGradient, 12495 customOverlayColor, 12496 dimRatio, 12497 focalPoint, 12498 hasParallax, 12499 isRepeated, 12500 overlayColor, 12501 url, 12502 alt, 12503 id, 12504 minHeight: minHeightProp, 12505 minHeightUnit 12506 } = attributes; 12507 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12508 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12509 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12510 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12511 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12512 const isImgElement = !(hasParallax || isRepeated); 12513 const style = { 12514 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 12515 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12516 background: customGradient && !url ? customGradient : undefined, 12517 minHeight: minHeight || undefined 12518 }; 12519 const objectPosition = 12520 // prettier-ignore 12521 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 12522 const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, { 12523 'has-background-dim': dimRatio !== 0, 12524 'has-parallax': hasParallax, 12525 'is-repeated': isRepeated, 12526 'has-background-gradient': gradient || customGradient, 12527 [gradientClass]: !url && gradientClass, 12528 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12529 }, getPositionClassName(contentPosition)); 12530 return (0,external_React_namespaceObject.createElement)("div", { 12531 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12532 className: classes, 12533 style 12534 }) 12535 }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_React_namespaceObject.createElement)("span", { 12536 "aria-hidden": "true", 12537 className: classnames_default()('wp-block-cover__gradient-background', gradientClass), 12538 style: customGradient ? { 12539 background: customGradient 12540 } : undefined 12541 }), isImageBackground && isImgElement && url && (0,external_React_namespaceObject.createElement)("img", { 12542 className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 12543 alt: alt, 12544 src: url, 12545 style: { 12546 objectPosition 12547 }, 12548 "data-object-fit": "cover", 12549 "data-object-position": objectPosition 12550 }), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12551 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 12552 autoPlay: true, 12553 muted: true, 12554 loop: true, 12555 playsInline: true, 12556 src: url, 12557 style: { 12558 objectPosition 12559 }, 12560 "data-object-fit": "cover", 12561 "data-object-position": objectPosition 12562 }), (0,external_React_namespaceObject.createElement)("div", { 12563 className: "wp-block-cover__inner-container" 12564 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 12565 }, 12566 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 12567 }; 12568 const v6 = { 12569 attributes: { 12570 ...deprecated_blockAttributes, 12571 isRepeated: { 12572 type: 'boolean', 12573 default: false 12574 }, 12575 minHeight: { 12576 type: 'number' 12577 }, 12578 minHeightUnit: { 12579 type: 'string' 12580 }, 12581 gradient: { 12582 type: 'string' 12583 }, 12584 customGradient: { 12585 type: 'string' 12586 }, 12587 contentPosition: { 12588 type: 'string' 12589 } 12590 }, 12591 supports: { 12592 align: true 12593 }, 12594 save({ 12595 attributes 12596 }) { 12597 const { 12598 backgroundType, 12599 gradient, 12600 contentPosition, 12601 customGradient, 12602 customOverlayColor, 12603 dimRatio, 12604 focalPoint, 12605 hasParallax, 12606 isRepeated, 12607 overlayColor, 12608 url, 12609 minHeight: minHeightProp, 12610 minHeightUnit 12611 } = attributes; 12612 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12613 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12614 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12615 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12616 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12617 const style = isImageBackground ? backgroundImageStyles(url) : {}; 12618 const videoStyle = {}; 12619 if (!overlayColorClass) { 12620 style.backgroundColor = customOverlayColor; 12621 } 12622 if (customGradient && !url) { 12623 style.background = customGradient; 12624 } 12625 style.minHeight = minHeight || undefined; 12626 let positionValue; 12627 if (focalPoint) { 12628 positionValue = `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%`; 12629 if (isImageBackground && !hasParallax) { 12630 style.backgroundPosition = positionValue; 12631 } 12632 if (isVideoBackground) { 12633 videoStyle.objectPosition = positionValue; 12634 } 12635 } 12636 const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, { 12637 'has-background-dim': dimRatio !== 0, 12638 'has-parallax': hasParallax, 12639 'is-repeated': isRepeated, 12640 'has-background-gradient': gradient || customGradient, 12641 [gradientClass]: !url && gradientClass, 12642 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12643 }, getPositionClassName(contentPosition)); 12644 return (0,external_React_namespaceObject.createElement)("div", { 12645 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12646 className: classes, 12647 style 12648 }) 12649 }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_React_namespaceObject.createElement)("span", { 12650 "aria-hidden": "true", 12651 className: classnames_default()('wp-block-cover__gradient-background', gradientClass), 12652 style: customGradient ? { 12653 background: customGradient 12654 } : undefined 12655 }), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 12656 className: "wp-block-cover__video-background", 12657 autoPlay: true, 12658 muted: true, 12659 loop: true, 12660 playsInline: true, 12661 src: url, 12662 style: videoStyle 12663 }), (0,external_React_namespaceObject.createElement)("div", { 12664 className: "wp-block-cover__inner-container" 12665 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 12666 }, 12667 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 12668 }; 12669 const v5 = { 12670 attributes: { 12671 ...deprecated_blockAttributes, 12672 minHeight: { 12673 type: 'number' 12674 }, 12675 gradient: { 12676 type: 'string' 12677 }, 12678 customGradient: { 12679 type: 'string' 12680 } 12681 }, 12682 supports: { 12683 align: true 12684 }, 12685 save({ 12686 attributes 12687 }) { 12688 const { 12689 backgroundType, 12690 gradient, 12691 customGradient, 12692 customOverlayColor, 12693 dimRatio, 12694 focalPoint, 12695 hasParallax, 12696 overlayColor, 12697 url, 12698 minHeight 12699 } = attributes; 12700 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12701 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12702 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 12703 if (!overlayColorClass) { 12704 style.backgroundColor = customOverlayColor; 12705 } 12706 if (focalPoint && !hasParallax) { 12707 style.backgroundPosition = `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%`; 12708 } 12709 if (customGradient && !url) { 12710 style.background = customGradient; 12711 } 12712 style.minHeight = minHeight || undefined; 12713 const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, { 12714 'has-background-dim': dimRatio !== 0, 12715 'has-parallax': hasParallax, 12716 'has-background-gradient': customGradient, 12717 [gradientClass]: !url && gradientClass 12718 }); 12719 return (0,external_React_namespaceObject.createElement)("div", { 12720 className: classes, 12721 style: style 12722 }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_React_namespaceObject.createElement)("span", { 12723 "aria-hidden": "true", 12724 className: classnames_default()('wp-block-cover__gradient-background', gradientClass), 12725 style: customGradient ? { 12726 background: customGradient 12727 } : undefined 12728 }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_React_namespaceObject.createElement)("video", { 12729 className: "wp-block-cover__video-background", 12730 autoPlay: true, 12731 muted: true, 12732 loop: true, 12733 src: url 12734 }), (0,external_React_namespaceObject.createElement)("div", { 12735 className: "wp-block-cover__inner-container" 12736 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 12737 }, 12738 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 12739 }; 12740 const v4 = { 12741 attributes: { 12742 ...deprecated_blockAttributes, 12743 minHeight: { 12744 type: 'number' 12745 }, 12746 gradient: { 12747 type: 'string' 12748 }, 12749 customGradient: { 12750 type: 'string' 12751 } 12752 }, 12753 supports: { 12754 align: true 12755 }, 12756 save({ 12757 attributes 12758 }) { 12759 const { 12760 backgroundType, 12761 gradient, 12762 customGradient, 12763 customOverlayColor, 12764 dimRatio, 12765 focalPoint, 12766 hasParallax, 12767 overlayColor, 12768 url, 12769 minHeight 12770 } = attributes; 12771 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12772 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12773 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 12774 if (!overlayColorClass) { 12775 style.backgroundColor = customOverlayColor; 12776 } 12777 if (focalPoint && !hasParallax) { 12778 style.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 12779 } 12780 if (customGradient && !url) { 12781 style.background = customGradient; 12782 } 12783 style.minHeight = minHeight || undefined; 12784 const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, { 12785 'has-background-dim': dimRatio !== 0, 12786 'has-parallax': hasParallax, 12787 'has-background-gradient': customGradient, 12788 [gradientClass]: !url && gradientClass 12789 }); 12790 return (0,external_React_namespaceObject.createElement)("div", { 12791 className: classes, 12792 style: style 12793 }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_React_namespaceObject.createElement)("span", { 12794 "aria-hidden": "true", 12795 className: classnames_default()('wp-block-cover__gradient-background', gradientClass), 12796 style: customGradient ? { 12797 background: customGradient 12798 } : undefined 12799 }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_React_namespaceObject.createElement)("video", { 12800 className: "wp-block-cover__video-background", 12801 autoPlay: true, 12802 muted: true, 12803 loop: true, 12804 src: url 12805 }), (0,external_React_namespaceObject.createElement)("div", { 12806 className: "wp-block-cover__inner-container" 12807 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 12808 }, 12809 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 12810 }; 12811 const v3 = { 12812 attributes: { 12813 ...deprecated_blockAttributes, 12814 title: { 12815 type: 'string', 12816 source: 'html', 12817 selector: 'p' 12818 }, 12819 contentAlign: { 12820 type: 'string', 12821 default: 'center' 12822 } 12823 }, 12824 supports: { 12825 align: true 12826 }, 12827 save({ 12828 attributes 12829 }) { 12830 const { 12831 backgroundType, 12832 contentAlign, 12833 customOverlayColor, 12834 dimRatio, 12835 focalPoint, 12836 hasParallax, 12837 overlayColor, 12838 title, 12839 url 12840 } = attributes; 12841 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12842 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 12843 if (!overlayColorClass) { 12844 style.backgroundColor = customOverlayColor; 12845 } 12846 if (focalPoint && !hasParallax) { 12847 style.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 12848 } 12849 const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, { 12850 'has-background-dim': dimRatio !== 0, 12851 'has-parallax': hasParallax, 12852 [`has-$contentAlign}-content`]: contentAlign !== 'center' 12853 }); 12854 return (0,external_React_namespaceObject.createElement)("div", { 12855 className: classes, 12856 style: style 12857 }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_React_namespaceObject.createElement)("video", { 12858 className: "wp-block-cover__video-background", 12859 autoPlay: true, 12860 muted: true, 12861 loop: true, 12862 src: url 12863 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 12864 tagName: "p", 12865 className: "wp-block-cover-text", 12866 value: title 12867 })); 12868 }, 12869 migrate(attributes) { 12870 const newAttribs = { 12871 ...attributes, 12872 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 12873 tagName: !attributes.tagName ? 'div' : attributes.tagName 12874 }; 12875 const { 12876 title, 12877 contentAlign, 12878 ...restAttributes 12879 } = newAttribs; 12880 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 12881 content: attributes.title, 12882 align: attributes.contentAlign, 12883 fontSize: 'large', 12884 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 12885 })]]; 12886 } 12887 }; 12888 const v2 = { 12889 attributes: { 12890 ...deprecated_blockAttributes, 12891 title: { 12892 type: 'string', 12893 source: 'html', 12894 selector: 'p' 12895 }, 12896 contentAlign: { 12897 type: 'string', 12898 default: 'center' 12899 }, 12900 align: { 12901 type: 'string' 12902 } 12903 }, 12904 supports: { 12905 className: false 12906 }, 12907 save({ 12908 attributes 12909 }) { 12910 const { 12911 url, 12912 title, 12913 hasParallax, 12914 dimRatio, 12915 align, 12916 contentAlign, 12917 overlayColor, 12918 customOverlayColor 12919 } = attributes; 12920 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12921 const style = backgroundImageStyles(url); 12922 if (!overlayColorClass) { 12923 style.backgroundColor = customOverlayColor; 12924 } 12925 const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, { 12926 'has-background-dim': dimRatio !== 0, 12927 'has-parallax': hasParallax, 12928 [`has-$contentAlign}-content`]: contentAlign !== 'center' 12929 }, align ? `align$align}` : null); 12930 return (0,external_React_namespaceObject.createElement)("div", { 12931 className: classes, 12932 style: style 12933 }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 12934 tagName: "p", 12935 className: "wp-block-cover-image-text", 12936 value: title 12937 })); 12938 }, 12939 migrate(attributes) { 12940 const newAttribs = { 12941 ...attributes, 12942 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 12943 tagName: !attributes.tagName ? 'div' : attributes.tagName 12944 }; 12945 const { 12946 title, 12947 contentAlign, 12948 align, 12949 ...restAttributes 12950 } = newAttribs; 12951 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 12952 content: attributes.title, 12953 align: attributes.contentAlign, 12954 fontSize: 'large', 12955 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 12956 })]]; 12957 } 12958 }; 12959 const cover_deprecated_v1 = { 12960 attributes: { 12961 ...deprecated_blockAttributes, 12962 title: { 12963 type: 'string', 12964 source: 'html', 12965 selector: 'h2' 12966 }, 12967 align: { 12968 type: 'string' 12969 }, 12970 contentAlign: { 12971 type: 'string', 12972 default: 'center' 12973 } 12974 }, 12975 supports: { 12976 className: false 12977 }, 12978 save({ 12979 attributes 12980 }) { 12981 const { 12982 url, 12983 title, 12984 hasParallax, 12985 dimRatio, 12986 align 12987 } = attributes; 12988 const style = backgroundImageStyles(url); 12989 const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), { 12990 'has-background-dim': dimRatio !== 0, 12991 'has-parallax': hasParallax 12992 }, align ? `align$align}` : null); 12993 return (0,external_React_namespaceObject.createElement)("section", { 12994 className: classes, 12995 style: style 12996 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 12997 tagName: "h2", 12998 value: title 12999 })); 13000 }, 13001 migrate(attributes) { 13002 const newAttribs = { 13003 ...attributes, 13004 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 13005 tagName: !attributes.tagName ? 'div' : attributes.tagName 13006 }; 13007 const { 13008 title, 13009 contentAlign, 13010 align, 13011 ...restAttributes 13012 } = newAttribs; 13013 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 13014 content: attributes.title, 13015 align: attributes.contentAlign, 13016 fontSize: 'large', 13017 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 13018 })]]; 13019 } 13020 }; 13021 /* harmony default export */ const cover_deprecated = ([v13, v12, deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]); 13022 13023 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js 13024 13025 /** 13026 * WordPress dependencies 13027 */ 13028 13029 13030 13031 13032 13033 13034 /** 13035 * Internal dependencies 13036 */ 13037 13038 13039 const { 13040 cleanEmptyObject: inspector_controls_cleanEmptyObject 13041 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 13042 function CoverHeightInput({ 13043 onChange, 13044 onUnitChange, 13045 unit = 'px', 13046 value = '' 13047 }) { 13048 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); 13049 const inputId = `block-cover-height-input-$instanceId}`; 13050 const isPx = unit === 'px'; 13051 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 13052 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 13053 availableUnits: availableUnits || ['px', 'em', 'rem', 'vw', 'vh'], 13054 defaultValues: { 13055 px: 430, 13056 '%': 20, 13057 em: 20, 13058 rem: 20, 13059 vw: 20, 13060 vh: 50 13061 } 13062 }); 13063 const handleOnChange = unprocessedValue => { 13064 const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined; 13065 if (isNaN(inputValue) && inputValue !== undefined) { 13066 return; 13067 } 13068 onChange(inputValue); 13069 }; 13070 const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => { 13071 const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); 13072 return [parsedQuantity, unit].join(''); 13073 }, [unit, value]); 13074 const min = isPx ? COVER_MIN_HEIGHT : 0; 13075 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 13076 label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'), 13077 id: inputId, 13078 isResetValueOnUnitChange: true, 13079 min: min, 13080 onChange: handleOnChange, 13081 onUnitChange: onUnitChange, 13082 __unstableInputWidth: '80px', 13083 units: units, 13084 value: computedValue 13085 }); 13086 } 13087 function CoverInspectorControls({ 13088 attributes, 13089 setAttributes, 13090 clientId, 13091 setOverlayColor, 13092 coverRef, 13093 currentSettings, 13094 updateDimRatio, 13095 onClearMedia 13096 }) { 13097 const { 13098 useFeaturedImage, 13099 dimRatio, 13100 focalPoint, 13101 hasParallax, 13102 isRepeated, 13103 minHeight, 13104 minHeightUnit, 13105 alt, 13106 tagName 13107 } = attributes; 13108 const { 13109 isVideoBackground, 13110 isImageBackground, 13111 mediaElement, 13112 url, 13113 overlayColor 13114 } = currentSettings; 13115 const { 13116 gradientValue, 13117 setGradient 13118 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 13119 const toggleParallax = () => { 13120 setAttributes({ 13121 hasParallax: !hasParallax, 13122 ...(!hasParallax ? { 13123 focalPoint: undefined 13124 } : {}) 13125 }); 13126 }; 13127 const toggleIsRepeated = () => { 13128 setAttributes({ 13129 isRepeated: !isRepeated 13130 }); 13131 }; 13132 const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); 13133 const imperativeFocalPointPreview = value => { 13134 const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition']; 13135 styleOfRef[property] = mediaPosition(value); 13136 }; 13137 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 13138 const htmlElementMessages = { 13139 header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), 13140 main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), 13141 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."), 13142 article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), 13143 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."), 13144 footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).') 13145 }; 13146 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 13147 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 13148 }, isImageBackground && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 13149 __nextHasNoMarginBottom: true, 13150 label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), 13151 checked: hasParallax, 13152 onChange: toggleParallax 13153 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 13154 __nextHasNoMarginBottom: true, 13155 label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), 13156 checked: isRepeated, 13157 onChange: toggleIsRepeated 13158 })), showFocalPointPicker && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, { 13159 __nextHasNoMarginBottom: true, 13160 __next40pxDefaultSize: true, 13161 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 13162 url: url, 13163 value: focalPoint, 13164 onDragStart: imperativeFocalPointPreview, 13165 onDrag: imperativeFocalPointPreview, 13166 onChange: newFocalPoint => setAttributes({ 13167 focalPoint: newFocalPoint 13168 }) 13169 }), !useFeaturedImage && url && !isVideoBackground && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 13170 __nextHasNoMarginBottom: true, 13171 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 13172 value: alt, 13173 onChange: newAlt => setAttributes({ 13174 alt: newAlt 13175 }), 13176 help: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 13177 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 13178 }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.')), (0,external_React_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')) 13179 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 13180 variant: "secondary", 13181 size: "small", 13182 className: "block-library-cover__reset-button", 13183 onClick: onClearMedia 13184 }, (0,external_wp_i18n_namespaceObject.__)('Clear Media'))))), colorGradientSettings.hasColorsOrGradients && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 13185 group: "color" 13186 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 13187 __experimentalIsRenderedInSidebar: true, 13188 settings: [{ 13189 colorValue: overlayColor.color, 13190 gradientValue, 13191 label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), 13192 onColorChange: setOverlayColor, 13193 onGradientChange: setGradient, 13194 isShownByDefault: true, 13195 resetAllFilter: () => ({ 13196 overlayColor: undefined, 13197 customOverlayColor: undefined, 13198 gradient: undefined, 13199 customGradient: undefined 13200 }) 13201 }], 13202 panelId: clientId, 13203 ...colorGradientSettings 13204 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 13205 hasValue: () => { 13206 // If there's a media background the dimRatio will be 13207 // defaulted to 50 whereas it will be 100 for colors. 13208 return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100); 13209 }, 13210 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 13211 onDeselect: () => updateDimRatio(url ? 50 : 100), 13212 resetAllFilter: () => ({ 13213 dimRatio: url ? 50 : 100 13214 }), 13215 isShownByDefault: true, 13216 panelId: clientId 13217 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 13218 __nextHasNoMarginBottom: true, 13219 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 13220 value: dimRatio, 13221 onChange: newDimRatio => updateDimRatio(newDimRatio), 13222 min: 0, 13223 max: 100, 13224 step: 10, 13225 required: true, 13226 __next40pxDefaultSize: true 13227 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 13228 group: "dimensions" 13229 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 13230 hasValue: () => !!minHeight, 13231 label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), 13232 onDeselect: () => setAttributes({ 13233 minHeight: undefined, 13234 minHeightUnit: undefined 13235 }), 13236 resetAllFilter: () => ({ 13237 minHeight: undefined, 13238 minHeightUnit: undefined 13239 }), 13240 isShownByDefault: true, 13241 panelId: clientId 13242 }, (0,external_React_namespaceObject.createElement)(CoverHeightInput, { 13243 value: attributes?.style?.dimensions?.aspectRatio ? '' : minHeight, 13244 unit: minHeightUnit, 13245 onChange: newMinHeight => setAttributes({ 13246 minHeight: newMinHeight, 13247 style: inspector_controls_cleanEmptyObject({ 13248 ...attributes?.style, 13249 dimensions: { 13250 ...attributes?.style?.dimensions, 13251 aspectRatio: undefined // Reset aspect ratio when minHeight is set. 13252 } 13253 }) 13254 }), 13255 onUnitChange: nextUnit => setAttributes({ 13256 minHeightUnit: nextUnit 13257 }) 13258 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 13259 group: "advanced" 13260 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 13261 __nextHasNoMarginBottom: true, 13262 __next40pxDefaultSize: true, 13263 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 13264 options: [{ 13265 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 13266 value: 'div' 13267 }, { 13268 label: '<header>', 13269 value: 'header' 13270 }, { 13271 label: '<main>', 13272 value: 'main' 13273 }, { 13274 label: '<section>', 13275 value: 'section' 13276 }, { 13277 label: '<article>', 13278 value: 'article' 13279 }, { 13280 label: '<aside>', 13281 value: 'aside' 13282 }, { 13283 label: '<footer>', 13284 value: 'footer' 13285 }], 13286 value: tagName, 13287 onChange: value => setAttributes({ 13288 tagName: value 13289 }), 13290 help: htmlElementMessages[tagName] 13291 }))); 13292 } 13293 13294 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js 13295 13296 /** 13297 * WordPress dependencies 13298 */ 13299 13300 13301 13302 13303 /** 13304 * Internal dependencies 13305 */ 13306 13307 13308 const { 13309 cleanEmptyObject: block_controls_cleanEmptyObject 13310 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 13311 function CoverBlockControls({ 13312 attributes, 13313 setAttributes, 13314 onSelectMedia, 13315 currentSettings, 13316 toggleUseFeaturedImage 13317 }) { 13318 const { 13319 contentPosition, 13320 id, 13321 useFeaturedImage, 13322 minHeight, 13323 minHeightUnit 13324 } = attributes; 13325 const { 13326 hasInnerBlocks, 13327 url 13328 } = currentSettings; 13329 const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight); 13330 const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit); 13331 const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100 && !attributes?.style?.dimensions?.aspectRatio; 13332 const toggleMinFullHeight = () => { 13333 if (isMinFullHeight) { 13334 // If there aren't previous values, take the default ones. 13335 if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) { 13336 return setAttributes({ 13337 minHeight: undefined, 13338 minHeightUnit: undefined 13339 }); 13340 } 13341 13342 // Set the previous values of height. 13343 return setAttributes({ 13344 minHeight: prevMinHeightValue, 13345 minHeightUnit: prevMinHeightUnit 13346 }); 13347 } 13348 setPrevMinHeightValue(minHeight); 13349 setPrevMinHeightUnit(minHeightUnit); 13350 13351 // Set full height, and clear any aspect ratio value. 13352 return setAttributes({ 13353 minHeight: 100, 13354 minHeightUnit: 'vh', 13355 style: block_controls_cleanEmptyObject({ 13356 ...attributes?.style, 13357 dimensions: { 13358 ...attributes?.style?.dimensions, 13359 aspectRatio: undefined // Reset aspect ratio when minHeight is set. 13360 } 13361 }) 13362 }); 13363 }; 13364 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 13365 group: "block" 13366 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, { 13367 label: (0,external_wp_i18n_namespaceObject.__)('Change content position'), 13368 value: contentPosition, 13369 onChange: nextPosition => setAttributes({ 13370 contentPosition: nextPosition 13371 }), 13372 isDisabled: !hasInnerBlocks 13373 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, { 13374 isActive: isMinFullHeight, 13375 onToggle: toggleMinFullHeight, 13376 isDisabled: !hasInnerBlocks 13377 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 13378 group: "other" 13379 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 13380 mediaId: id, 13381 mediaURL: url, 13382 allowedTypes: shared_ALLOWED_MEDIA_TYPES, 13383 accept: "image/*,video/*", 13384 onSelect: onSelectMedia, 13385 onToggleFeaturedImage: toggleUseFeaturedImage, 13386 useFeaturedImage: useFeaturedImage, 13387 name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace') 13388 }))); 13389 } 13390 13391 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js 13392 13393 /** 13394 * WordPress dependencies 13395 */ 13396 13397 13398 13399 13400 /** 13401 * Internal dependencies 13402 */ 13403 13404 function CoverPlaceholder({ 13405 disableMediaButtons = false, 13406 children, 13407 onSelectMedia, 13408 onError, 13409 style, 13410 toggleUseFeaturedImage 13411 }) { 13412 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 13413 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 13414 icon: library_cover 13415 }), 13416 labels: { 13417 title: (0,external_wp_i18n_namespaceObject.__)('Cover'), 13418 instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.') 13419 }, 13420 onSelect: onSelectMedia, 13421 accept: "image/*,video/*", 13422 allowedTypes: shared_ALLOWED_MEDIA_TYPES, 13423 disableMediaButtons: disableMediaButtons, 13424 onToggleFeaturedImage: toggleUseFeaturedImage, 13425 onError: onError, 13426 style: style 13427 }, children); 13428 } 13429 13430 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover-popover.js 13431 13432 /** 13433 * External dependencies 13434 */ 13435 13436 13437 /** 13438 * WordPress dependencies 13439 */ 13440 13441 13442 13443 /** 13444 * Internal dependencies 13445 */ 13446 13447 const RESIZABLE_BOX_ENABLE_OPTION = { 13448 top: false, 13449 right: false, 13450 bottom: true, 13451 left: false, 13452 topRight: false, 13453 bottomRight: false, 13454 bottomLeft: false, 13455 topLeft: false 13456 }; 13457 const { 13458 ResizableBoxPopover 13459 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 13460 function ResizableCoverPopover({ 13461 className, 13462 height, 13463 minHeight, 13464 onResize, 13465 onResizeStart, 13466 onResizeStop, 13467 showHandle, 13468 size, 13469 width, 13470 ...props 13471 }) { 13472 const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); 13473 const dimensions = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 13474 height, 13475 minHeight, 13476 width 13477 }), [minHeight, height, width]); 13478 const resizableBoxProps = { 13479 className: classnames_default()(className, { 13480 'is-resizing': isResizing 13481 }), 13482 enable: RESIZABLE_BOX_ENABLE_OPTION, 13483 onResizeStart: (_event, _direction, elt) => { 13484 onResizeStart(elt.clientHeight); 13485 onResize(elt.clientHeight); 13486 }, 13487 onResize: (_event, _direction, elt) => { 13488 onResize(elt.clientHeight); 13489 if (!isResizing) { 13490 setIsResizing(true); 13491 } 13492 }, 13493 onResizeStop: (_event, _direction, elt) => { 13494 onResizeStop(elt.clientHeight); 13495 setIsResizing(false); 13496 }, 13497 showHandle, 13498 size, 13499 __experimentalShowTooltip: true, 13500 __experimentalTooltipProps: { 13501 axis: 'y', 13502 position: 'bottom', 13503 isVisible: isResizing 13504 } 13505 }; 13506 return (0,external_React_namespaceObject.createElement)(ResizableBoxPopover, { 13507 className: "block-library-cover__resizable-box-popover", 13508 __unstableRefreshSize: dimensions, 13509 resizableBoxProps: resizableBoxProps, 13510 ...props 13511 }); 13512 } 13513 13514 ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs 13515 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()})}; 13516 13517 ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs 13518 /* 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"])} 13519 13520 ;// CONCATENATED MODULE: ./node_modules/fast-average-color/dist/index.esm.js 13521 /*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */ 13522 function toHex(num) { 13523 var str = num.toString(16); 13524 return str.length === 1 ? '0' + str : str; 13525 } 13526 function arrayToHex(arr) { 13527 return '#' + arr.map(toHex).join(''); 13528 } 13529 function isDark(color) { 13530 // http://www.w3.org/TR/AERT#color-contrast 13531 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; 13532 return result < 128; 13533 } 13534 function prepareIgnoredColor(color) { 13535 if (!color) { 13536 return []; 13537 } 13538 return isRGBArray(color) ? color : [color]; 13539 } 13540 function isRGBArray(value) { 13541 return Array.isArray(value[0]); 13542 } 13543 function isIgnoredColor(data, index, ignoredColor) { 13544 for (var i = 0; i < ignoredColor.length; i++) { 13545 if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) { 13546 return true; 13547 } 13548 } 13549 return false; 13550 } 13551 function isIgnoredColorAsNumbers(data, index, ignoredColor) { 13552 switch (ignoredColor.length) { 13553 case 3: 13554 // [red, green, blue] 13555 if (isIgnoredRGBColor(data, index, ignoredColor)) { 13556 return true; 13557 } 13558 break; 13559 case 4: 13560 // [red, green, blue, alpha] 13561 if (isIgnoredRGBAColor(data, index, ignoredColor)) { 13562 return true; 13563 } 13564 break; 13565 case 5: 13566 // [red, green, blue, alpha, threshold] 13567 if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { 13568 return true; 13569 } 13570 break; 13571 default: 13572 return false; 13573 } 13574 } 13575 function isIgnoredRGBColor(data, index, ignoredColor) { 13576 // Ignore if the pixel are transparent. 13577 if (data[index + 3] !== 255) { 13578 return true; 13579 } 13580 if (data[index] === ignoredColor[0] && 13581 data[index + 1] === ignoredColor[1] && 13582 data[index + 2] === ignoredColor[2]) { 13583 return true; 13584 } 13585 return false; 13586 } 13587 function isIgnoredRGBAColor(data, index, ignoredColor) { 13588 if (data[index + 3] && ignoredColor[3]) { 13589 return data[index] === ignoredColor[0] && 13590 data[index + 1] === ignoredColor[1] && 13591 data[index + 2] === ignoredColor[2] && 13592 data[index + 3] === ignoredColor[3]; 13593 } 13594 // Ignore rgb components if the pixel are fully transparent. 13595 return data[index + 3] === ignoredColor[3]; 13596 } 13597 function inRange(colorComponent, ignoredColorComponent, value) { 13598 return colorComponent >= (ignoredColorComponent - value) && 13599 colorComponent <= (ignoredColorComponent + value); 13600 } 13601 function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { 13602 var redIgnored = ignoredColor[0]; 13603 var greenIgnored = ignoredColor[1]; 13604 var blueIgnored = ignoredColor[2]; 13605 var alphaIgnored = ignoredColor[3]; 13606 var threshold = ignoredColor[4]; 13607 var alphaData = data[index + 3]; 13608 var alphaInRange = inRange(alphaData, alphaIgnored, threshold); 13609 if (!alphaIgnored) { 13610 return alphaInRange; 13611 } 13612 if (!alphaData && alphaInRange) { 13613 return true; 13614 } 13615 if (inRange(data[index], redIgnored, threshold) && 13616 inRange(data[index + 1], greenIgnored, threshold) && 13617 inRange(data[index + 2], blueIgnored, threshold) && 13618 alphaInRange) { 13619 return true; 13620 } 13621 return false; 13622 } 13623 13624 function dominantAlgorithm(arr, len, options) { 13625 var colorHash = {}; 13626 var divider = 24; 13627 var ignoredColor = options.ignoredColor; 13628 var step = options.step; 13629 var max = [0, 0, 0, 0, 0]; 13630 for (var i = 0; i < len; i += step) { 13631 var red = arr[i]; 13632 var green = arr[i + 1]; 13633 var blue = arr[i + 2]; 13634 var alpha = arr[i + 3]; 13635 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 13636 continue; 13637 } 13638 var key = Math.round(red / divider) + ',' + 13639 Math.round(green / divider) + ',' + 13640 Math.round(blue / divider); 13641 if (colorHash[key]) { 13642 colorHash[key] = [ 13643 colorHash[key][0] + red * alpha, 13644 colorHash[key][1] + green * alpha, 13645 colorHash[key][2] + blue * alpha, 13646 colorHash[key][3] + alpha, 13647 colorHash[key][4] + 1 13648 ]; 13649 } 13650 else { 13651 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 13652 } 13653 if (max[4] < colorHash[key][4]) { 13654 max = colorHash[key]; 13655 } 13656 } 13657 var redTotal = max[0]; 13658 var greenTotal = max[1]; 13659 var blueTotal = max[2]; 13660 var alphaTotal = max[3]; 13661 var count = max[4]; 13662 return alphaTotal ? [ 13663 Math.round(redTotal / alphaTotal), 13664 Math.round(greenTotal / alphaTotal), 13665 Math.round(blueTotal / alphaTotal), 13666 Math.round(alphaTotal / count) 13667 ] : options.defaultColor; 13668 } 13669 13670 function simpleAlgorithm(arr, len, options) { 13671 var redTotal = 0; 13672 var greenTotal = 0; 13673 var blueTotal = 0; 13674 var alphaTotal = 0; 13675 var count = 0; 13676 var ignoredColor = options.ignoredColor; 13677 var step = options.step; 13678 for (var i = 0; i < len; i += step) { 13679 var alpha = arr[i + 3]; 13680 var red = arr[i] * alpha; 13681 var green = arr[i + 1] * alpha; 13682 var blue = arr[i + 2] * alpha; 13683 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 13684 continue; 13685 } 13686 redTotal += red; 13687 greenTotal += green; 13688 blueTotal += blue; 13689 alphaTotal += alpha; 13690 count++; 13691 } 13692 return alphaTotal ? [ 13693 Math.round(redTotal / alphaTotal), 13694 Math.round(greenTotal / alphaTotal), 13695 Math.round(blueTotal / alphaTotal), 13696 Math.round(alphaTotal / count) 13697 ] : options.defaultColor; 13698 } 13699 13700 function sqrtAlgorithm(arr, len, options) { 13701 var redTotal = 0; 13702 var greenTotal = 0; 13703 var blueTotal = 0; 13704 var alphaTotal = 0; 13705 var count = 0; 13706 var ignoredColor = options.ignoredColor; 13707 var step = options.step; 13708 for (var i = 0; i < len; i += step) { 13709 var red = arr[i]; 13710 var green = arr[i + 1]; 13711 var blue = arr[i + 2]; 13712 var alpha = arr[i + 3]; 13713 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 13714 continue; 13715 } 13716 redTotal += red * red * alpha; 13717 greenTotal += green * green * alpha; 13718 blueTotal += blue * blue * alpha; 13719 alphaTotal += alpha; 13720 count++; 13721 } 13722 return alphaTotal ? [ 13723 Math.round(Math.sqrt(redTotal / alphaTotal)), 13724 Math.round(Math.sqrt(greenTotal / alphaTotal)), 13725 Math.round(Math.sqrt(blueTotal / alphaTotal)), 13726 Math.round(alphaTotal / count) 13727 ] : options.defaultColor; 13728 } 13729 13730 function getDefaultColor(options) { 13731 return getOption(options, 'defaultColor', [0, 0, 0, 0]); 13732 } 13733 function getOption(options, name, defaultValue) { 13734 return (options[name] === undefined ? defaultValue : options[name]); 13735 } 13736 13737 var MIN_SIZE = 10; 13738 var MAX_SIZE = 100; 13739 function isSvg(filename) { 13740 return filename.search(/\.svg(\?|$)/i) !== -1; 13741 } 13742 function getOriginalSize(resource) { 13743 if (isInstanceOfHTMLImageElement(resource)) { 13744 var width = resource.naturalWidth; 13745 var height = resource.naturalHeight; 13746 // For SVG images with only viewBox attribute 13747 if (!resource.naturalWidth && isSvg(resource.src)) { 13748 width = height = MAX_SIZE; 13749 } 13750 return { 13751 width: width, 13752 height: height, 13753 }; 13754 } 13755 if (isInstanceOfHTMLVideoElement(resource)) { 13756 return { 13757 width: resource.videoWidth, 13758 height: resource.videoHeight 13759 }; 13760 } 13761 return { 13762 width: resource.width, 13763 height: resource.height 13764 }; 13765 } 13766 function getSrc(resource) { 13767 if (isInstanceOfHTMLCanvasElement(resource)) { 13768 return 'canvas'; 13769 } 13770 if (isInstanceOfOffscreenCanvas(resource)) { 13771 return 'offscreencanvas'; 13772 } 13773 if (isInstanceOfImageBitmap(resource)) { 13774 return 'imagebitmap'; 13775 } 13776 return resource.src; 13777 } 13778 function isInstanceOfHTMLImageElement(resource) { 13779 return typeof HTMLImageElement !== 'undefined' && resource instanceof HTMLImageElement; 13780 } 13781 var hasOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'; 13782 function isInstanceOfOffscreenCanvas(resource) { 13783 return hasOffscreenCanvas && resource instanceof OffscreenCanvas; 13784 } 13785 function isInstanceOfHTMLVideoElement(resource) { 13786 return typeof HTMLVideoElement !== 'undefined' && resource instanceof HTMLVideoElement; 13787 } 13788 function isInstanceOfHTMLCanvasElement(resource) { 13789 return typeof HTMLCanvasElement !== 'undefined' && resource instanceof HTMLCanvasElement; 13790 } 13791 function isInstanceOfImageBitmap(resource) { 13792 return typeof ImageBitmap !== 'undefined' && resource instanceof ImageBitmap; 13793 } 13794 function prepareSizeAndPosition(originalSize, options) { 13795 var srcLeft = getOption(options, 'left', 0); 13796 var srcTop = getOption(options, 'top', 0); 13797 var srcWidth = getOption(options, 'width', originalSize.width); 13798 var srcHeight = getOption(options, 'height', originalSize.height); 13799 var destWidth = srcWidth; 13800 var destHeight = srcHeight; 13801 if (options.mode === 'precision') { 13802 return { 13803 srcLeft: srcLeft, 13804 srcTop: srcTop, 13805 srcWidth: srcWidth, 13806 srcHeight: srcHeight, 13807 destWidth: destWidth, 13808 destHeight: destHeight 13809 }; 13810 } 13811 var factor; 13812 if (srcWidth > srcHeight) { 13813 factor = srcWidth / srcHeight; 13814 destWidth = MAX_SIZE; 13815 destHeight = Math.round(destWidth / factor); 13816 } 13817 else { 13818 factor = srcHeight / srcWidth; 13819 destHeight = MAX_SIZE; 13820 destWidth = Math.round(destHeight / factor); 13821 } 13822 if (destWidth > srcWidth || destHeight > srcHeight || 13823 destWidth < MIN_SIZE || destHeight < MIN_SIZE) { 13824 destWidth = srcWidth; 13825 destHeight = srcHeight; 13826 } 13827 return { 13828 srcLeft: srcLeft, 13829 srcTop: srcTop, 13830 srcWidth: srcWidth, 13831 srcHeight: srcHeight, 13832 destWidth: destWidth, 13833 destHeight: destHeight 13834 }; 13835 } 13836 var isWebWorkers = typeof window === 'undefined'; 13837 function makeCanvas() { 13838 if (isWebWorkers) { 13839 return hasOffscreenCanvas ? new OffscreenCanvas(1, 1) : null; 13840 } 13841 return document.createElement('canvas'); 13842 } 13843 13844 var ERROR_PREFIX = 'FastAverageColor: '; 13845 function getError(message) { 13846 return Error(ERROR_PREFIX + message); 13847 } 13848 function outputError(error, silent) { 13849 if (!silent) { 13850 console.error(error); 13851 } 13852 } 13853 13854 var FastAverageColor = /** @class */ (function () { 13855 function FastAverageColor() { 13856 this.canvas = null; 13857 this.ctx = null; 13858 } 13859 /** 13860 * Get asynchronously the average color from not loaded image. 13861 */ 13862 FastAverageColor.prototype.getColorAsync = function (resource, options) { 13863 if (!resource) { 13864 return Promise.reject(getError('call .getColorAsync() without resource.')); 13865 } 13866 if (typeof resource === 'string') { 13867 // Web workers 13868 if (typeof Image === 'undefined') { 13869 return Promise.reject(getError('resource as string is not supported in this environment')); 13870 } 13871 var img = new Image(); 13872 img.crossOrigin = options && options.crossOrigin || ''; 13873 img.src = resource; 13874 return this.bindImageEvents(img, options); 13875 } 13876 else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { 13877 return this.bindImageEvents(resource, options); 13878 } 13879 else { 13880 var result = this.getColor(resource, options); 13881 return result.error ? Promise.reject(result.error) : Promise.resolve(result); 13882 } 13883 }; 13884 /** 13885 * Get the average color from images, videos and canvas. 13886 */ 13887 FastAverageColor.prototype.getColor = function (resource, options) { 13888 options = options || {}; 13889 var defaultColor = getDefaultColor(options); 13890 if (!resource) { 13891 var error = getError('call .getColor(null) without resource'); 13892 outputError(error, options.silent); 13893 return this.prepareResult(defaultColor, error); 13894 } 13895 var originalSize = getOriginalSize(resource); 13896 var size = prepareSizeAndPosition(originalSize, options); 13897 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 13898 var error = getError("incorrect sizes for resource \"".concat(getSrc(resource), "\"")); 13899 outputError(error, options.silent); 13900 return this.prepareResult(defaultColor, error); 13901 } 13902 if (!this.canvas) { 13903 this.canvas = makeCanvas(); 13904 if (!this.canvas) { 13905 var error = getError('OffscreenCanvas is not supported in this browser'); 13906 outputError(error, options.silent); 13907 return this.prepareResult(defaultColor, error); 13908 } 13909 } 13910 if (!this.ctx) { 13911 this.ctx = this.canvas.getContext('2d', { willReadFrequently: true }); 13912 if (!this.ctx) { 13913 var error = getError('Canvas Context 2D is not supported in this browser'); 13914 outputError(error, options.silent); 13915 return this.prepareResult(defaultColor); 13916 } 13917 this.ctx.imageSmoothingEnabled = false; 13918 } 13919 this.canvas.width = size.destWidth; 13920 this.canvas.height = size.destHeight; 13921 try { 13922 this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); 13923 this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 13924 var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 13925 return this.prepareResult(this.getColorFromArray4(bitmapData, options)); 13926 } 13927 catch (originalError) { 13928 var error = getError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image")); 13929 outputError(error, options.silent); 13930 !options.silent && console.error(originalError); 13931 return this.prepareResult(defaultColor, error); 13932 } 13933 }; 13934 /** 13935 * Get the average color from a array when 1 pixel is 4 bytes. 13936 */ 13937 FastAverageColor.prototype.getColorFromArray4 = function (arr, options) { 13938 options = options || {}; 13939 var bytesPerPixel = 4; 13940 var arrLength = arr.length; 13941 var defaultColor = getDefaultColor(options); 13942 if (arrLength < bytesPerPixel) { 13943 return defaultColor; 13944 } 13945 var len = arrLength - arrLength % bytesPerPixel; 13946 var step = (options.step || 1) * bytesPerPixel; 13947 var algorithm; 13948 switch (options.algorithm || 'sqrt') { 13949 case 'simple': 13950 algorithm = simpleAlgorithm; 13951 break; 13952 case 'sqrt': 13953 algorithm = sqrtAlgorithm; 13954 break; 13955 case 'dominant': 13956 algorithm = dominantAlgorithm; 13957 break; 13958 default: 13959 throw getError("".concat(options.algorithm, " is unknown algorithm")); 13960 } 13961 return algorithm(arr, len, { 13962 defaultColor: defaultColor, 13963 ignoredColor: prepareIgnoredColor(options.ignoredColor), 13964 step: step 13965 }); 13966 }; 13967 /** 13968 * Get color data from value ([r, g, b, a]). 13969 */ 13970 FastAverageColor.prototype.prepareResult = function (value, error) { 13971 var rgb = value.slice(0, 3); 13972 var rgba = [value[0], value[1], value[2], value[3] / 255]; 13973 var isDarkColor = isDark(value); 13974 return { 13975 value: [value[0], value[1], value[2], value[3]], 13976 rgb: 'rgb(' + rgb.join(',') + ')', 13977 rgba: 'rgba(' + rgba.join(',') + ')', 13978 hex: arrayToHex(rgb), 13979 hexa: arrayToHex(value), 13980 isDark: isDarkColor, 13981 isLight: !isDarkColor, 13982 error: error, 13983 }; 13984 }; 13985 /** 13986 * Destroy the instance. 13987 */ 13988 FastAverageColor.prototype.destroy = function () { 13989 if (this.canvas) { 13990 this.canvas.width = 1; 13991 this.canvas.height = 1; 13992 this.canvas = null; 13993 } 13994 this.ctx = null; 13995 }; 13996 FastAverageColor.prototype.bindImageEvents = function (resource, options) { 13997 var _this = this; 13998 return new Promise(function (resolve, reject) { 13999 var onload = function () { 14000 unbindEvents(); 14001 var result = _this.getColor(resource, options); 14002 if (result.error) { 14003 reject(result.error); 14004 } 14005 else { 14006 resolve(result); 14007 } 14008 }; 14009 var onerror = function () { 14010 unbindEvents(); 14011 reject(getError("Error loading image \"".concat(resource.src, "\"."))); 14012 }; 14013 var onabort = function () { 14014 unbindEvents(); 14015 reject(getError("Image \"".concat(resource.src, "\" loading aborted"))); 14016 }; 14017 var unbindEvents = function () { 14018 resource.removeEventListener('load', onload); 14019 resource.removeEventListener('error', onerror); 14020 resource.removeEventListener('abort', onabort); 14021 }; 14022 resource.addEventListener('load', onload); 14023 resource.addEventListener('error', onerror); 14024 resource.addEventListener('abort', onabort); 14025 }); 14026 }; 14027 return FastAverageColor; 14028 }()); 14029 14030 14031 14032 ;// CONCATENATED MODULE: external ["wp","hooks"] 14033 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 14034 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/color-utils.js 14035 /** 14036 * External dependencies 14037 */ 14038 14039 14040 14041 14042 14043 /** 14044 * WordPress dependencies 14045 */ 14046 14047 14048 /** 14049 * @typedef {import('colord').RgbaColor} RgbaColor 14050 */ 14051 14052 k([names]); 14053 14054 /** 14055 * Fallback color when the average color can't be computed. The image may be 14056 * rendering as transparent, and most sites have a light color background. 14057 */ 14058 const DEFAULT_BACKGROUND_COLOR = '#FFF'; 14059 14060 /** 14061 * Default dim color specified in style.css. 14062 */ 14063 const DEFAULT_OVERLAY_COLOR = '#000'; 14064 14065 /** 14066 * Performs a Porter Duff composite source over operation on two rgba colors. 14067 * 14068 * @see {@link https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_srcover} 14069 * 14070 * @param {RgbaColor} source Source color. 14071 * @param {RgbaColor} dest Destination color. 14072 * 14073 * @return {RgbaColor} Composite color. 14074 */ 14075 function compositeSourceOver(source, dest) { 14076 return { 14077 r: source.r * source.a + dest.r * dest.a * (1 - source.a), 14078 g: source.g * source.a + dest.g * dest.a * (1 - source.a), 14079 b: source.b * source.a + dest.b * dest.a * (1 - source.a), 14080 a: source.a + dest.a * (1 - source.a) 14081 }; 14082 } 14083 14084 /** 14085 * Retrieves the FastAverageColor singleton. 14086 * 14087 * @return {FastAverageColor} The FastAverageColor singleton. 14088 */ 14089 function retrieveFastAverageColor() { 14090 if (!retrieveFastAverageColor.fastAverageColor) { 14091 retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); 14092 } 14093 return retrieveFastAverageColor.fastAverageColor; 14094 } 14095 14096 /** 14097 * Computes the average color of an image. 14098 * 14099 * @param {string} url The url of the image. 14100 * 14101 * @return {Promise<string>} Promise of an average color as a hex string. 14102 */ 14103 const getMediaColor = memize(async url => { 14104 if (!url) { 14105 return DEFAULT_BACKGROUND_COLOR; 14106 } 14107 14108 // making the default color rgb for compat with FAC 14109 const { 14110 r, 14111 g, 14112 b, 14113 a 14114 } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); 14115 try { 14116 const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); 14117 const color = await retrieveFastAverageColor().getColorAsync(url, { 14118 // The default color is white, which is the color 14119 // that is returned if there's an error. 14120 // colord returns alpga 0-1, FAC needs 0-255 14121 defaultColor: [r, g, b, a * 255], 14122 // Errors that come up don't reject the promise, 14123 // so error logging has to be silenced 14124 // with this option. 14125 silent: "production" === 'production', 14126 crossOrigin: imgCrossOrigin 14127 }); 14128 return color.hex; 14129 } catch (error) { 14130 // If there's an error return the fallback color. 14131 return DEFAULT_BACKGROUND_COLOR; 14132 } 14133 }); 14134 14135 /** 14136 * Computes if the color combination of the overlay and background color is dark. 14137 * 14138 * @param {number} dimRatio Opacity of the overlay between 0 and 100. 14139 * @param {string} overlayColor CSS color string for the overlay. 14140 * @param {string} backgroundColor CSS color string for the background. 14141 * 14142 * @return {boolean} true if the color combination composite result is dark. 14143 */ 14144 function compositeIsDark(dimRatio, overlayColor, backgroundColor) { 14145 // Opacity doesn't matter if you're overlaying the same color on top of itself. 14146 // And background doesn't matter when overlay is fully opaque. 14147 if (overlayColor === backgroundColor || dimRatio === 100) { 14148 return w(overlayColor).isDark(); 14149 } 14150 const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); 14151 const background = w(backgroundColor).toRgb(); 14152 const composite = compositeSourceOver(overlay, background); 14153 return w(composite).isDark(); 14154 } 14155 14156 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js 14157 14158 /** 14159 * External dependencies 14160 */ 14161 14162 14163 /** 14164 * WordPress dependencies 14165 */ 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 /** 14177 * Internal dependencies 14178 */ 14179 14180 14181 14182 14183 14184 14185 function getInnerBlocksTemplate(attributes) { 14186 return [['core/paragraph', { 14187 align: 'center', 14188 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'), 14189 ...attributes 14190 }]]; 14191 } 14192 14193 /** 14194 * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while 14195 * the media (image or video) is being uploaded and will not have an id allocated yet. 14196 * 14197 * @param {number} id The id of the media. 14198 * @param {string} url The url of the media. 14199 * 14200 * @return {boolean} Is the URL a Blob URL. 14201 */ 14202 const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); 14203 function CoverEdit({ 14204 attributes, 14205 clientId, 14206 isSelected, 14207 overlayColor, 14208 setAttributes, 14209 setOverlayColor, 14210 toggleSelection, 14211 context: { 14212 postId, 14213 postType 14214 } 14215 }) { 14216 const { 14217 contentPosition, 14218 id, 14219 url: originalUrl, 14220 backgroundType: originalBackgroundType, 14221 useFeaturedImage, 14222 dimRatio, 14223 focalPoint, 14224 hasParallax, 14225 isDark, 14226 isRepeated, 14227 minHeight, 14228 minHeightUnit, 14229 alt, 14230 allowedBlocks, 14231 templateLock, 14232 tagName: TagName = 'div', 14233 isUserOverlayColor 14234 } = attributes; 14235 const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); 14236 const { 14237 __unstableMarkNextChangeAsNotPersistent 14238 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 14239 const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { 14240 context: 'view' 14241 }), [featuredImage]); 14242 const mediaUrl = media?.source_url; 14243 14244 // User can change the featured image outside of the block, but we still 14245 // need to update the block when that happens. This effect should only 14246 // run when the featured image changes in that case. All other cases are 14247 // handled in their respective callbacks. 14248 (0,external_wp_element_namespaceObject.useEffect)(() => { 14249 (async () => { 14250 if (!useFeaturedImage) { 14251 return; 14252 } 14253 const averageBackgroundColor = await getMediaColor(mediaUrl); 14254 let newOverlayColor = overlayColor.color; 14255 if (!isUserOverlayColor) { 14256 newOverlayColor = averageBackgroundColor; 14257 __unstableMarkNextChangeAsNotPersistent(); 14258 setOverlayColor(newOverlayColor); 14259 } 14260 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); 14261 __unstableMarkNextChangeAsNotPersistent(); 14262 setAttributes({ 14263 isDark: newIsDark 14264 }); 14265 })(); 14266 // Disable reason: Update the block only when the featured image changes. 14267 // eslint-disable-next-line react-hooks/exhaustive-deps 14268 }, [mediaUrl]); 14269 14270 // instead of destructuring the attributes 14271 // we define the url and background type 14272 // depending on the value of the useFeaturedImage flag 14273 // to preview in edit the dynamic featured image 14274 const url = useFeaturedImage ? mediaUrl : 14275 // Ensure the url is not malformed due to sanitization through `wp_kses`. 14276 originalUrl?.replaceAll('&', '&'); 14277 const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; 14278 const { 14279 createErrorNotice 14280 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 14281 const { 14282 gradientClass, 14283 gradientValue 14284 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 14285 const onSelectMedia = async newMedia => { 14286 const mediaAttributes = attributesFromMedia(newMedia); 14287 const isImage = [newMedia?.type, newMedia?.media_type].includes(IMAGE_BACKGROUND_TYPE); 14288 const averageBackgroundColor = await getMediaColor(isImage ? newMedia?.url : undefined); 14289 let newOverlayColor = overlayColor.color; 14290 if (!isUserOverlayColor) { 14291 newOverlayColor = averageBackgroundColor; 14292 setOverlayColor(newOverlayColor); 14293 14294 // Make undo revert the next setAttributes and the previous setOverlayColor. 14295 __unstableMarkNextChangeAsNotPersistent(); 14296 } 14297 14298 // Only set a new dimRatio if there was no previous media selected 14299 // to avoid resetting to 50 if it has been explicitly set to 100. 14300 // See issue #52835 for context. 14301 const newDimRatio = originalUrl === undefined && dimRatio === 100 ? 50 : dimRatio; 14302 const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); 14303 setAttributes({ 14304 ...mediaAttributes, 14305 focalPoint: undefined, 14306 useFeaturedImage: undefined, 14307 dimRatio: newDimRatio, 14308 isDark: newIsDark 14309 }); 14310 }; 14311 const onClearMedia = () => { 14312 let newOverlayColor = overlayColor.color; 14313 if (!isUserOverlayColor) { 14314 newOverlayColor = DEFAULT_OVERLAY_COLOR; 14315 setOverlayColor(undefined); 14316 14317 // Make undo revert the next setAttributes and the previous setOverlayColor. 14318 __unstableMarkNextChangeAsNotPersistent(); 14319 } 14320 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, DEFAULT_BACKGROUND_COLOR); 14321 setAttributes({ 14322 url: undefined, 14323 id: undefined, 14324 backgroundType: undefined, 14325 focalPoint: undefined, 14326 hasParallax: undefined, 14327 isRepeated: undefined, 14328 useFeaturedImage: undefined, 14329 isDark: newIsDark 14330 }); 14331 }; 14332 const onSetOverlayColor = async newOverlayColor => { 14333 const averageBackgroundColor = await getMediaColor(url); 14334 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); 14335 setOverlayColor(newOverlayColor); 14336 14337 // Make undo revert the next setAttributes and the previous setOverlayColor. 14338 __unstableMarkNextChangeAsNotPersistent(); 14339 setAttributes({ 14340 isUserOverlayColor: true, 14341 isDark: newIsDark 14342 }); 14343 }; 14344 const onUpdateDimRatio = async newDimRatio => { 14345 const averageBackgroundColor = await getMediaColor(url); 14346 const newIsDark = compositeIsDark(newDimRatio, overlayColor.color, averageBackgroundColor); 14347 setAttributes({ 14348 dimRatio: newDimRatio, 14349 isDark: newIsDark 14350 }); 14351 }; 14352 const onUploadError = message => { 14353 createErrorNotice(message, { 14354 type: 'snackbar' 14355 }); 14356 }; 14357 const isUploadingMedia = isTemporaryMedia(id, url); 14358 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 14359 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 14360 const [resizeListener, { 14361 height, 14362 width 14363 }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 14364 const resizableBoxDimensions = (0,external_wp_element_namespaceObject.useMemo)(() => { 14365 return { 14366 height: minHeightUnit === 'px' ? minHeight : 'auto', 14367 width: 'auto' 14368 }; 14369 }, [minHeight, minHeightUnit]); 14370 const minHeightWithUnit = minHeight && minHeightUnit ? `$minHeight}$minHeightUnit}` : minHeight; 14371 const isImgElement = !(hasParallax || isRepeated); 14372 const style = { 14373 minHeight: minHeightWithUnit || undefined 14374 }; 14375 const backgroundImage = url ? `url($url})` : undefined; 14376 const backgroundPosition = mediaPosition(focalPoint); 14377 const bgStyle = { 14378 backgroundColor: overlayColor.color 14379 }; 14380 const mediaStyle = { 14381 objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined 14382 }; 14383 const hasBackground = !!(url || overlayColor.color || gradientValue); 14384 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]); 14385 const ref = (0,external_wp_element_namespaceObject.useRef)(); 14386 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 14387 ref 14388 }); 14389 14390 // Check for fontSize support before we pass a fontSize attribute to the innerBlocks. 14391 const [fontSizes] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fontSizes'); 14392 const hasFontSizes = fontSizes?.length > 0; 14393 const innerBlocksTemplate = getInnerBlocksTemplate({ 14394 fontSize: hasFontSizes ? 'large' : undefined 14395 }); 14396 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 14397 className: 'wp-block-cover__inner-container' 14398 }, { 14399 // Avoid template sync when the `templateLock` value is `all` or `contentOnly`. 14400 // See: https://github.com/WordPress/gutenberg/pull/45632 14401 template: !hasInnerBlocks ? innerBlocksTemplate : undefined, 14402 templateInsertUpdatesSelection: true, 14403 allowedBlocks, 14404 templateLock, 14405 dropZoneElement: ref.current 14406 }); 14407 const mediaElement = (0,external_wp_element_namespaceObject.useRef)(); 14408 const currentSettings = { 14409 isVideoBackground, 14410 isImageBackground, 14411 mediaElement, 14412 hasInnerBlocks, 14413 url, 14414 isImgElement, 14415 overlayColor 14416 }; 14417 const toggleUseFeaturedImage = async () => { 14418 const newUseFeaturedImage = !useFeaturedImage; 14419 const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; 14420 const newOverlayColor = !isUserOverlayColor ? averageBackgroundColor : overlayColor.color; 14421 if (!isUserOverlayColor) { 14422 if (newUseFeaturedImage) { 14423 setOverlayColor(newOverlayColor); 14424 } else { 14425 setOverlayColor(undefined); 14426 } 14427 14428 // Make undo revert the next setAttributes and the previous setOverlayColor. 14429 __unstableMarkNextChangeAsNotPersistent(); 14430 } 14431 const newDimRatio = dimRatio === 100 ? 50 : dimRatio; 14432 const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); 14433 setAttributes({ 14434 id: undefined, 14435 url: undefined, 14436 useFeaturedImage: newUseFeaturedImage, 14437 dimRatio: newDimRatio, 14438 backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined, 14439 isDark: newIsDark 14440 }); 14441 }; 14442 const blockControls = (0,external_React_namespaceObject.createElement)(CoverBlockControls, { 14443 attributes: attributes, 14444 setAttributes: setAttributes, 14445 onSelectMedia: onSelectMedia, 14446 currentSettings: currentSettings, 14447 toggleUseFeaturedImage: toggleUseFeaturedImage 14448 }); 14449 const inspectorControls = (0,external_React_namespaceObject.createElement)(CoverInspectorControls, { 14450 attributes: attributes, 14451 setAttributes: setAttributes, 14452 clientId: clientId, 14453 setOverlayColor: onSetOverlayColor, 14454 coverRef: ref, 14455 currentSettings: currentSettings, 14456 toggleUseFeaturedImage: toggleUseFeaturedImage, 14457 updateDimRatio: onUpdateDimRatio, 14458 onClearMedia: onClearMedia 14459 }); 14460 const resizableCoverProps = { 14461 className: 'block-library-cover__resize-container', 14462 clientId, 14463 height, 14464 minHeight: minHeightWithUnit, 14465 onResizeStart: () => { 14466 setAttributes({ 14467 minHeightUnit: 'px' 14468 }); 14469 toggleSelection(false); 14470 }, 14471 onResize: value => { 14472 setAttributes({ 14473 minHeight: value 14474 }); 14475 }, 14476 onResizeStop: newMinHeight => { 14477 toggleSelection(true); 14478 setAttributes({ 14479 minHeight: newMinHeight 14480 }); 14481 }, 14482 // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. 14483 showHandle: !attributes.style?.dimensions?.aspectRatio ? true : false, 14484 size: resizableBoxDimensions, 14485 width 14486 }; 14487 if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { 14488 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, inspectorControls, isSelected && (0,external_React_namespaceObject.createElement)(ResizableCoverPopover, { 14489 ...resizableCoverProps 14490 }), (0,external_React_namespaceObject.createElement)(TagName, { 14491 ...blockProps, 14492 className: classnames_default()('is-placeholder', blockProps.className), 14493 style: { 14494 ...blockProps.style, 14495 minHeight: minHeightWithUnit || undefined 14496 } 14497 }, resizeListener, (0,external_React_namespaceObject.createElement)(CoverPlaceholder, { 14498 onSelectMedia: onSelectMedia, 14499 onError: onUploadError, 14500 toggleUseFeaturedImage: toggleUseFeaturedImage 14501 }, (0,external_React_namespaceObject.createElement)("div", { 14502 className: "wp-block-cover__placeholder-background-options" 14503 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, { 14504 disableCustomColors: true, 14505 value: overlayColor.color, 14506 onChange: onSetOverlayColor, 14507 clearable: false 14508 }))))); 14509 } 14510 const classes = classnames_default()({ 14511 'is-dark-theme': isDark, 14512 'is-light': !isDark, 14513 'is-transient': isUploadingMedia, 14514 'has-parallax': hasParallax, 14515 'is-repeated': isRepeated, 14516 'has-custom-content-position': !isContentPositionCenter(contentPosition) 14517 }, getPositionClassName(contentPosition)); 14518 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_React_namespaceObject.createElement)(TagName, { 14519 ...blockProps, 14520 className: classnames_default()(classes, blockProps.className), 14521 style: { 14522 ...style, 14523 ...blockProps.style 14524 }, 14525 "data-url": url 14526 }, resizeListener, (!useFeaturedImage || url) && (0,external_React_namespaceObject.createElement)("span", { 14527 "aria-hidden": "true", 14528 className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), { 14529 [overlayColor.class]: overlayColor.class, 14530 'has-background-dim': dimRatio !== undefined, 14531 // For backwards compatibility. Former versions of the Cover Block applied 14532 // `.wp-block-cover__gradient-background` in the presence of 14533 // media, a gradient and a dim. 14534 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 14535 'has-background-gradient': gradientValue, 14536 [gradientClass]: gradientClass 14537 }), 14538 style: { 14539 backgroundImage: gradientValue, 14540 ...bgStyle 14541 } 14542 }), !url && useFeaturedImage && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 14543 className: "wp-block-cover__image--placeholder-image", 14544 withIllustration: true 14545 }), url && isImageBackground && (isImgElement ? (0,external_React_namespaceObject.createElement)("img", { 14546 ref: mediaElement, 14547 className: "wp-block-cover__image-background", 14548 alt: alt, 14549 src: url, 14550 style: mediaStyle 14551 }) : (0,external_React_namespaceObject.createElement)("div", { 14552 ref: mediaElement, 14553 role: alt ? 'img' : undefined, 14554 "aria-label": alt ? alt : undefined, 14555 className: classnames_default()(classes, 'wp-block-cover__image-background'), 14556 style: { 14557 backgroundImage, 14558 backgroundPosition 14559 } 14560 })), url && isVideoBackground && (0,external_React_namespaceObject.createElement)("video", { 14561 ref: mediaElement, 14562 className: "wp-block-cover__video-background", 14563 autoPlay: true, 14564 muted: true, 14565 loop: true, 14566 src: url, 14567 style: mediaStyle 14568 }), isUploadingMedia && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_React_namespaceObject.createElement)(CoverPlaceholder, { 14569 disableMediaButtons: true, 14570 onSelectMedia: onSelectMedia, 14571 onError: onUploadError, 14572 toggleUseFeaturedImage: toggleUseFeaturedImage 14573 }), (0,external_React_namespaceObject.createElement)("div", { 14574 ...innerBlocksProps 14575 })), isSelected && (0,external_React_namespaceObject.createElement)(ResizableCoverPopover, { 14576 ...resizableCoverProps 14577 })); 14578 } 14579 /* harmony default export */ const cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ 14580 overlayColor: 'background-color' 14581 })])(CoverEdit)); 14582 14583 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js 14584 14585 /** 14586 * External dependencies 14587 */ 14588 14589 14590 /** 14591 * WordPress dependencies 14592 */ 14593 14594 14595 /** 14596 * Internal dependencies 14597 */ 14598 14599 function cover_save_save({ 14600 attributes 14601 }) { 14602 const { 14603 backgroundType, 14604 gradient, 14605 contentPosition, 14606 customGradient, 14607 customOverlayColor, 14608 dimRatio, 14609 focalPoint, 14610 useFeaturedImage, 14611 hasParallax, 14612 isDark, 14613 isRepeated, 14614 overlayColor, 14615 url, 14616 alt, 14617 id, 14618 minHeight: minHeightProp, 14619 minHeightUnit, 14620 tagName: Tag 14621 } = attributes; 14622 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 14623 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 14624 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 14625 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 14626 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 14627 const isImgElement = !(hasParallax || isRepeated); 14628 const style = { 14629 minHeight: minHeight || undefined 14630 }; 14631 const bgStyle = { 14632 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 14633 background: customGradient ? customGradient : undefined 14634 }; 14635 const objectPosition = 14636 // prettier-ignore 14637 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 14638 const backgroundImage = url ? `url($url})` : undefined; 14639 const backgroundPosition = mediaPosition(focalPoint); 14640 const classes = classnames_default()({ 14641 'is-light': !isDark, 14642 'has-parallax': hasParallax, 14643 'is-repeated': isRepeated, 14644 'has-custom-content-position': !isContentPositionCenter(contentPosition) 14645 }, getPositionClassName(contentPosition)); 14646 const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 14647 'has-parallax': hasParallax, 14648 'is-repeated': isRepeated 14649 }); 14650 const gradientValue = gradient || customGradient; 14651 return (0,external_React_namespaceObject.createElement)(Tag, { 14652 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 14653 className: classes, 14654 style 14655 }) 14656 }, (0,external_React_namespaceObject.createElement)("span", { 14657 "aria-hidden": "true", 14658 className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 14659 'has-background-dim': dimRatio !== undefined, 14660 // For backwards compatibility. Former versions of the Cover Block applied 14661 // `.wp-block-cover__gradient-background` in the presence of 14662 // media, a gradient and a dim. 14663 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 14664 'has-background-gradient': gradientValue, 14665 [gradientClass]: gradientClass 14666 }), 14667 style: bgStyle 14668 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_React_namespaceObject.createElement)("img", { 14669 className: imgClasses, 14670 alt: alt, 14671 src: url, 14672 style: { 14673 objectPosition 14674 }, 14675 "data-object-fit": "cover", 14676 "data-object-position": objectPosition 14677 }) : (0,external_React_namespaceObject.createElement)("div", { 14678 role: alt ? 'img' : undefined, 14679 "aria-label": alt ? alt : undefined, 14680 className: imgClasses, 14681 style: { 14682 backgroundPosition, 14683 backgroundImage 14684 } 14685 })), isVideoBackground && url && (0,external_React_namespaceObject.createElement)("video", { 14686 className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'), 14687 autoPlay: true, 14688 muted: true, 14689 loop: true, 14690 playsInline: true, 14691 src: url, 14692 style: { 14693 objectPosition 14694 }, 14695 "data-object-fit": "cover", 14696 "data-object-position": objectPosition 14697 }), (0,external_React_namespaceObject.createElement)("div", { 14698 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 14699 className: 'wp-block-cover__inner-container' 14700 }) 14701 })); 14702 } 14703 14704 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js 14705 /** 14706 * WordPress dependencies 14707 */ 14708 14709 14710 14711 /** 14712 * Internal dependencies 14713 */ 14714 14715 14716 const { 14717 cleanEmptyObject: transforms_cleanEmptyObject 14718 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 14719 const cover_transforms_transforms = { 14720 from: [{ 14721 type: 'block', 14722 blocks: ['core/image'], 14723 transform: ({ 14724 caption, 14725 url, 14726 alt, 14727 align, 14728 id, 14729 anchor, 14730 style 14731 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { 14732 dimRatio: 50, 14733 url, 14734 alt, 14735 align, 14736 id, 14737 anchor, 14738 style: { 14739 color: { 14740 duotone: style?.color?.duotone 14741 } 14742 } 14743 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 14744 content: caption, 14745 fontSize: 'large', 14746 align: 'center' 14747 })]) 14748 }, { 14749 type: 'block', 14750 blocks: ['core/video'], 14751 transform: ({ 14752 caption, 14753 src, 14754 align, 14755 id, 14756 anchor 14757 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { 14758 dimRatio: 50, 14759 url: src, 14760 align, 14761 id, 14762 backgroundType: VIDEO_BACKGROUND_TYPE, 14763 anchor 14764 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 14765 content: caption, 14766 fontSize: 'large', 14767 align: 'center' 14768 })]) 14769 }, { 14770 type: 'block', 14771 blocks: ['core/group'], 14772 transform: (attributes, innerBlocks) => { 14773 const { 14774 align, 14775 anchor, 14776 backgroundColor, 14777 gradient, 14778 style 14779 } = attributes; 14780 14781 // If the Group block being transformed has a Cover block as its 14782 // only child return that Cover block. 14783 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/cover') { 14784 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks); 14785 } 14786 14787 // If no background or gradient color is provided, default to 50% opacity. 14788 // This matches the styling of a Cover block with a background image, 14789 // in the state where a background image has been removed. 14790 const dimRatio = backgroundColor || gradient || style?.color?.background || style?.color?.gradient ? undefined : 50; 14791 14792 // Move the background or gradient color to the parent Cover block. 14793 const parentAttributes = { 14794 align, 14795 anchor, 14796 dimRatio, 14797 overlayColor: backgroundColor, 14798 customOverlayColor: style?.color?.background, 14799 gradient, 14800 customGradient: style?.color?.gradient 14801 }; 14802 const attributesWithoutBackgroundColors = { 14803 ...attributes, 14804 backgroundColor: undefined, 14805 gradient: undefined, 14806 style: transforms_cleanEmptyObject({ 14807 ...attributes?.style, 14808 color: style?.color ? { 14809 ...style?.color, 14810 background: undefined, 14811 gradient: undefined 14812 } : undefined 14813 }) 14814 }; 14815 14816 // Preserve the block by nesting it within the Cover block, 14817 // instead of converting the Group block directly to the Cover block. 14818 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]); 14819 } 14820 }], 14821 to: [{ 14822 type: 'block', 14823 blocks: ['core/image'], 14824 isMatch: ({ 14825 backgroundType, 14826 url, 14827 overlayColor, 14828 customOverlayColor, 14829 gradient, 14830 customGradient 14831 }) => { 14832 if (url) { 14833 // If a url exists the transform could happen if that URL represents an image background. 14834 return backgroundType === IMAGE_BACKGROUND_TYPE; 14835 } 14836 // If a url is not set the transform could happen if the cover has no background color or gradient; 14837 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 14838 }, 14839 transform: ({ 14840 title, 14841 url, 14842 alt, 14843 align, 14844 id, 14845 anchor, 14846 style 14847 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 14848 caption: title, 14849 url, 14850 alt, 14851 align, 14852 id, 14853 anchor, 14854 style: { 14855 color: { 14856 duotone: style?.color?.duotone 14857 } 14858 } 14859 }) 14860 }, { 14861 type: 'block', 14862 blocks: ['core/video'], 14863 isMatch: ({ 14864 backgroundType, 14865 url, 14866 overlayColor, 14867 customOverlayColor, 14868 gradient, 14869 customGradient 14870 }) => { 14871 if (url) { 14872 // If a url exists the transform could happen if that URL represents a video background. 14873 return backgroundType === VIDEO_BACKGROUND_TYPE; 14874 } 14875 // If a url is not set the transform could happen if the cover has no background color or gradient; 14876 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 14877 }, 14878 transform: ({ 14879 title, 14880 url, 14881 align, 14882 id, 14883 anchor 14884 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 14885 caption: title, 14886 src: url, 14887 id, 14888 align, 14889 anchor 14890 }) 14891 }, { 14892 type: 'block', 14893 blocks: ['core/group'], 14894 isMatch: ({ 14895 url, 14896 useFeaturedImage 14897 }) => { 14898 // If the Cover block uses background media, skip this transform, 14899 // and instead use the Group block's default transform. 14900 if (url || useFeaturedImage) { 14901 return false; 14902 } 14903 return true; 14904 }, 14905 transform: (attributes, innerBlocks) => { 14906 // Convert Cover overlay colors to comparable Group background colors. 14907 const transformedColorAttributes = { 14908 backgroundColor: attributes?.overlayColor, 14909 gradient: attributes?.gradient, 14910 style: transforms_cleanEmptyObject({ 14911 ...attributes?.style, 14912 color: attributes?.customOverlayColor || attributes?.customGradient || attributes?.style?.color ? { 14913 background: attributes?.customOverlayColor, 14914 gradient: attributes?.customGradient, 14915 ...attributes?.style?.color 14916 } : undefined 14917 }) 14918 }; 14919 14920 // If the Cover block contains only a single Group block as a direct child, 14921 // then attempt to merge the Cover's background colors with the child Group block, 14922 // and remove the Cover block as the wrapper. 14923 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/group') { 14924 const groupAttributes = transforms_cleanEmptyObject(innerBlocks[0].attributes || {}); 14925 14926 // If the Group block contains any kind of background color or gradient, 14927 // skip merging Cover background colors, and preserve the Group block's colors. 14928 if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { 14929 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, innerBlocks[0]?.innerBlocks); 14930 } 14931 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 14932 ...transformedColorAttributes, 14933 ...groupAttributes, 14934 style: transforms_cleanEmptyObject({ 14935 ...groupAttributes?.style, 14936 color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { 14937 ...transformedColorAttributes?.style?.color, 14938 ...groupAttributes?.style?.color 14939 } : undefined 14940 }) 14941 }, innerBlocks[0]?.innerBlocks); 14942 } 14943 14944 // In all other cases, transform the Cover block directly to a Group block. 14945 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 14946 ...attributes, 14947 ...transformedColorAttributes 14948 }, innerBlocks); 14949 } 14950 }] 14951 }; 14952 /* harmony default export */ const cover_transforms = (cover_transforms_transforms); 14953 14954 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/variations.js 14955 /** 14956 * WordPress dependencies 14957 */ 14958 14959 14960 const variations_variations = [{ 14961 name: 'cover', 14962 title: (0,external_wp_i18n_namespaceObject.__)('Cover'), 14963 description: (0,external_wp_i18n_namespaceObject.__)('Add an image or video with a text overlay.'), 14964 attributes: { 14965 layout: { 14966 type: 'constrained' 14967 } 14968 }, 14969 isDefault: true, 14970 icon: library_cover 14971 }]; 14972 /* harmony default export */ const cover_variations = (variations_variations); 14973 14974 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js 14975 /** 14976 * WordPress dependencies 14977 */ 14978 14979 14980 14981 /** 14982 * Internal dependencies 14983 */ 14984 14985 14986 14987 const cover_metadata = { 14988 $schema: "https://schemas.wp.org/trunk/block.json", 14989 apiVersion: 3, 14990 name: "core/cover", 14991 title: "Cover", 14992 category: "media", 14993 description: "Add an image or video with a text overlay.", 14994 textdomain: "default", 14995 attributes: { 14996 url: { 14997 type: "string" 14998 }, 14999 useFeaturedImage: { 15000 type: "boolean", 15001 "default": false 15002 }, 15003 id: { 15004 type: "number" 15005 }, 15006 alt: { 15007 type: "string", 15008 "default": "" 15009 }, 15010 hasParallax: { 15011 type: "boolean", 15012 "default": false 15013 }, 15014 isRepeated: { 15015 type: "boolean", 15016 "default": false 15017 }, 15018 dimRatio: { 15019 type: "number", 15020 "default": 100 15021 }, 15022 overlayColor: { 15023 type: "string" 15024 }, 15025 customOverlayColor: { 15026 type: "string" 15027 }, 15028 isUserOverlayColor: { 15029 type: "boolean" 15030 }, 15031 backgroundType: { 15032 type: "string", 15033 "default": "image" 15034 }, 15035 focalPoint: { 15036 type: "object" 15037 }, 15038 minHeight: { 15039 type: "number" 15040 }, 15041 minHeightUnit: { 15042 type: "string" 15043 }, 15044 gradient: { 15045 type: "string" 15046 }, 15047 customGradient: { 15048 type: "string" 15049 }, 15050 contentPosition: { 15051 type: "string" 15052 }, 15053 isDark: { 15054 type: "boolean", 15055 "default": true 15056 }, 15057 allowedBlocks: { 15058 type: "array" 15059 }, 15060 templateLock: { 15061 type: ["string", "boolean"], 15062 "enum": ["all", "insert", "contentOnly", false] 15063 }, 15064 tagName: { 15065 type: "string", 15066 "default": "div" 15067 } 15068 }, 15069 usesContext: ["postId", "postType"], 15070 supports: { 15071 anchor: true, 15072 align: true, 15073 html: false, 15074 spacing: { 15075 padding: true, 15076 margin: ["top", "bottom"], 15077 blockGap: true, 15078 __experimentalDefaultControls: { 15079 padding: true, 15080 blockGap: true 15081 } 15082 }, 15083 __experimentalBorder: { 15084 color: true, 15085 radius: true, 15086 style: true, 15087 width: true, 15088 __experimentalDefaultControls: { 15089 color: true, 15090 radius: true, 15091 style: true, 15092 width: true 15093 } 15094 }, 15095 color: { 15096 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 15097 heading: true, 15098 text: true, 15099 background: false, 15100 __experimentalSkipSerialization: ["gradients"], 15101 enableContrastChecker: false 15102 }, 15103 dimensions: { 15104 aspectRatio: true 15105 }, 15106 typography: { 15107 fontSize: true, 15108 lineHeight: true, 15109 __experimentalFontFamily: true, 15110 __experimentalFontWeight: true, 15111 __experimentalFontStyle: true, 15112 __experimentalTextTransform: true, 15113 __experimentalTextDecoration: true, 15114 __experimentalLetterSpacing: true, 15115 __experimentalDefaultControls: { 15116 fontSize: true 15117 } 15118 }, 15119 layout: { 15120 allowJustification: false 15121 }, 15122 interactivity: { 15123 clientNavigation: true 15124 } 15125 }, 15126 editorStyle: "wp-block-cover-editor", 15127 style: "wp-block-cover" 15128 }; 15129 15130 15131 15132 const { 15133 name: cover_name 15134 } = cover_metadata; 15135 15136 const cover_settings = { 15137 icon: library_cover, 15138 example: { 15139 attributes: { 15140 customOverlayColor: '#065174', 15141 dimRatio: 40, 15142 url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg' 15143 }, 15144 innerBlocks: [{ 15145 name: 'core/paragraph', 15146 attributes: { 15147 content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'), 15148 align: 'center', 15149 style: { 15150 typography: { 15151 fontSize: 48 15152 }, 15153 color: { 15154 text: 'white' 15155 } 15156 } 15157 } 15158 }] 15159 }, 15160 transforms: cover_transforms, 15161 save: cover_save_save, 15162 edit: cover_edit, 15163 deprecated: cover_deprecated, 15164 variations: cover_variations 15165 }; 15166 const cover_init = () => initBlock({ 15167 name: cover_name, 15168 metadata: cover_metadata, 15169 settings: cover_settings 15170 }); 15171 15172 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/details.js 15173 15174 /** 15175 * WordPress dependencies 15176 */ 15177 15178 const details = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 15179 viewBox: "0 0 24 24", 15180 xmlns: "http://www.w3.org/2000/svg" 15181 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 15182 d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", 15183 fillRule: "evenodd", 15184 clipRule: "evenodd" 15185 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 15186 d: "m4 5.25 4 2.5-4 2.5v-5Z" 15187 })); 15188 /* harmony default export */ const library_details = (details); 15189 15190 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/edit.js 15191 15192 /** 15193 * WordPress dependencies 15194 */ 15195 15196 15197 15198 15199 const details_edit_TEMPLATE = [['core/paragraph', { 15200 placeholder: (0,external_wp_i18n_namespaceObject.__)('Type / to add a hidden block') 15201 }]]; 15202 function DetailsEdit({ 15203 attributes, 15204 setAttributes, 15205 clientId 15206 }) { 15207 const { 15208 showContent, 15209 summary 15210 } = attributes; 15211 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 15212 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 15213 template: details_edit_TEMPLATE, 15214 __experimentalCaptureToolbars: true 15215 }); 15216 15217 // Check if either the block or the inner blocks are selected. 15218 const hasSelection = (0,external_wp_data_namespaceObject.useSelect)(select => { 15219 const { 15220 isBlockSelected, 15221 hasSelectedInnerBlock 15222 } = select(external_wp_blockEditor_namespaceObject.store); 15223 /* Sets deep to true to also find blocks inside the details content block. */ 15224 return hasSelectedInnerBlock(clientId, true) || isBlockSelected(clientId); 15225 }, [clientId]); 15226 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 15227 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 15228 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 15229 label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), 15230 checked: showContent, 15231 onChange: () => setAttributes({ 15232 showContent: !showContent 15233 }) 15234 }))), (0,external_React_namespaceObject.createElement)("details", { 15235 ...innerBlocksProps, 15236 open: hasSelection || showContent 15237 }, (0,external_React_namespaceObject.createElement)("summary", { 15238 onClick: event => event.preventDefault() 15239 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 15240 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Write summary'), 15241 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write summary…'), 15242 allowedFormats: [], 15243 withoutInteractiveFormatting: true, 15244 value: summary, 15245 onChange: newSummary => setAttributes({ 15246 summary: newSummary 15247 }) 15248 })), innerBlocksProps.children)); 15249 } 15250 /* harmony default export */ const details_edit = (DetailsEdit); 15251 15252 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/save.js 15253 15254 /** 15255 * WordPress dependencies 15256 */ 15257 15258 function details_save_save({ 15259 attributes 15260 }) { 15261 const { 15262 showContent 15263 } = attributes; 15264 const summary = attributes.summary ? attributes.summary : 'Details'; 15265 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 15266 return (0,external_React_namespaceObject.createElement)("details", { 15267 ...blockProps, 15268 open: showContent 15269 }, (0,external_React_namespaceObject.createElement)("summary", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 15270 value: summary 15271 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 15272 } 15273 15274 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/index.js 15275 /** 15276 * WordPress dependencies 15277 */ 15278 15279 15280 15281 /** 15282 * Internal dependencies 15283 */ 15284 15285 const details_metadata = { 15286 $schema: "https://schemas.wp.org/trunk/block.json", 15287 apiVersion: 3, 15288 name: "core/details", 15289 title: "Details", 15290 category: "text", 15291 description: "Hide and show additional content.", 15292 keywords: ["accordion", "summary", "toggle", "disclosure"], 15293 textdomain: "default", 15294 attributes: { 15295 showContent: { 15296 type: "boolean", 15297 "default": false 15298 }, 15299 summary: { 15300 type: "rich-text", 15301 source: "rich-text", 15302 selector: "summary" 15303 } 15304 }, 15305 supports: { 15306 align: ["wide", "full"], 15307 color: { 15308 gradients: true, 15309 link: true, 15310 __experimentalDefaultControls: { 15311 background: true, 15312 text: true 15313 } 15314 }, 15315 __experimentalBorder: { 15316 color: true, 15317 width: true, 15318 style: true 15319 }, 15320 html: false, 15321 spacing: { 15322 margin: true, 15323 padding: true, 15324 blockGap: true, 15325 __experimentalDefaultControls: { 15326 margin: false, 15327 padding: false 15328 } 15329 }, 15330 typography: { 15331 fontSize: true, 15332 lineHeight: true, 15333 __experimentalFontFamily: true, 15334 __experimentalFontWeight: true, 15335 __experimentalFontStyle: true, 15336 __experimentalTextTransform: true, 15337 __experimentalTextDecoration: true, 15338 __experimentalLetterSpacing: true, 15339 __experimentalDefaultControls: { 15340 fontSize: true 15341 } 15342 }, 15343 layout: { 15344 allowEditing: false 15345 }, 15346 interactivity: { 15347 clientNavigation: true 15348 } 15349 }, 15350 editorStyle: "wp-block-details-editor", 15351 style: "wp-block-details" 15352 }; 15353 15354 15355 const { 15356 name: details_name 15357 } = details_metadata; 15358 15359 const details_settings = { 15360 icon: library_details, 15361 example: { 15362 attributes: { 15363 summary: 'La Mancha', 15364 showContent: true 15365 }, 15366 innerBlocks: [{ 15367 name: 'core/paragraph', 15368 attributes: { 15369 content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') 15370 } 15371 }] 15372 }, 15373 save: details_save_save, 15374 edit: details_edit 15375 }; 15376 const details_init = () => initBlock({ 15377 name: details_name, 15378 metadata: details_metadata, 15379 settings: details_settings 15380 }); 15381 15382 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js 15383 15384 /** 15385 * WordPress dependencies 15386 */ 15387 15388 const pencil = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 15389 xmlns: "http://www.w3.org/2000/svg", 15390 viewBox: "0 0 24 24" 15391 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 15392 d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" 15393 })); 15394 /* harmony default export */ const library_pencil = (pencil); 15395 15396 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js 15397 /** 15398 * Internal dependencies 15399 */ 15400 15401 15402 /* harmony default export */ const library_edit = (library_pencil); 15403 15404 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js 15405 15406 /** 15407 * WordPress dependencies 15408 */ 15409 15410 15411 15412 15413 function getResponsiveHelp(checked) { 15414 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.'); 15415 } 15416 const EmbedControls = ({ 15417 blockSupportsResponsive, 15418 showEditButton, 15419 themeSupportsResponsive, 15420 allowResponsive, 15421 toggleResponsive, 15422 switchBackToURLInput 15423 }) => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 15424 className: "components-toolbar__control", 15425 label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'), 15426 icon: library_edit, 15427 onClick: switchBackToURLInput 15428 }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 15429 title: (0,external_wp_i18n_namespaceObject.__)('Media settings'), 15430 className: "blocks-responsive" 15431 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 15432 __nextHasNoMarginBottom: true, 15433 label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'), 15434 checked: allowResponsive, 15435 help: getResponsiveHelp, 15436 onChange: toggleResponsive 15437 })))); 15438 /* harmony default export */ const embed_controls = (EmbedControls); 15439 15440 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js 15441 15442 /** 15443 * WordPress dependencies 15444 */ 15445 15446 const embedContentIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15447 viewBox: "0 0 24 24", 15448 xmlns: "http://www.w3.org/2000/svg" 15449 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15450 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" 15451 })); 15452 const embedAudioIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15453 viewBox: "0 0 24 24", 15454 xmlns: "http://www.w3.org/2000/svg" 15455 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15456 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" 15457 })); 15458 const embedPhotoIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15459 viewBox: "0 0 24 24", 15460 xmlns: "http://www.w3.org/2000/svg" 15461 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15462 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" 15463 })); 15464 const embedVideoIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15465 viewBox: "0 0 24 24", 15466 xmlns: "http://www.w3.org/2000/svg" 15467 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15468 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" 15469 })); 15470 const embedTwitterIcon = { 15471 foreground: '#1da1f2', 15472 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15473 xmlns: "http://www.w3.org/2000/svg", 15474 viewBox: "0 0 24 24" 15475 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15476 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" 15477 }))) 15478 }; 15479 const embedYouTubeIcon = { 15480 foreground: '#ff0000', 15481 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15482 viewBox: "0 0 24 24" 15483 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15484 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" 15485 })) 15486 }; 15487 const embedFacebookIcon = { 15488 foreground: '#3b5998', 15489 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15490 viewBox: "0 0 24 24" 15491 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15492 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" 15493 })) 15494 }; 15495 const embedInstagramIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15496 viewBox: "0 0 24 24" 15497 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15498 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" 15499 }))); 15500 const embedWordPressIcon = { 15501 foreground: '#0073AA', 15502 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15503 viewBox: "0 0 24 24" 15504 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15505 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" 15506 }))) 15507 }; 15508 const embedSpotifyIcon = { 15509 foreground: '#1db954', 15510 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15511 viewBox: "0 0 24 24" 15512 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15513 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" 15514 })) 15515 }; 15516 const embedFlickrIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15517 viewBox: "0 0 24 24" 15518 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15519 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" 15520 })); 15521 const embedVimeoIcon = { 15522 foreground: '#1ab7ea', 15523 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15524 xmlns: "http://www.w3.org/2000/svg", 15525 viewBox: "0 0 24 24" 15526 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15527 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" 15528 }))) 15529 }; 15530 const embedRedditIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15531 viewBox: "0 0 24 24" 15532 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15533 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" 15534 })); 15535 const embedTumblrIcon = { 15536 foreground: '#35465c', 15537 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15538 viewBox: "0 0 24 24" 15539 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15540 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" 15541 })) 15542 }; 15543 const embedAmazonIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15544 viewBox: "0 0 24 24" 15545 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15546 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" 15547 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15548 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" 15549 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15550 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" 15551 })); 15552 const embedAnimotoIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15553 viewBox: "0 0 24 24" 15554 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15555 d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", 15556 fill: "#4bc7ee" 15557 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15558 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", 15559 fill: "#d4cdcb" 15560 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15561 d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", 15562 fill: "#c3d82e" 15563 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15564 d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", 15565 fill: "#e4ecb0" 15566 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15567 d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", 15568 fill: "#209dbd" 15569 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15570 d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", 15571 fill: "#7cb3c9" 15572 })); 15573 const embedDailymotionIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15574 viewBox: "0 0 24 24" 15575 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15576 d: "M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z", 15577 fill: "#333436" 15578 })); 15579 const embedPinterestIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15580 width: "24", 15581 height: "24", 15582 viewBox: "0 0 24 24", 15583 version: "1.1" 15584 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15585 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" 15586 })); 15587 const embedWolframIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15588 viewBox: "0 0 44 44" 15589 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15590 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" 15591 })); 15592 const embedPocketCastsIcon = { 15593 foreground: '#f43e37', 15594 src: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 15595 width: "24", 15596 height: "24", 15597 viewBox: "0 0 24 24", 15598 fill: "none", 15599 xmlns: "http://www.w3.org/2000/svg" 15600 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15601 fillRule: "evenodd", 15602 clipRule: "evenodd", 15603 d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" 15604 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 15605 fillRule: "evenodd", 15606 clipRule: "evenodd", 15607 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", 15608 fill: "#fff" 15609 })) 15610 }; 15611 15612 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js 15613 15614 /** 15615 * WordPress dependencies 15616 */ 15617 15618 const EmbedLoading = () => (0,external_React_namespaceObject.createElement)("div", { 15619 className: "wp-block-embed is-loading" 15620 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); 15621 /* harmony default export */ const embed_loading = (EmbedLoading); 15622 15623 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js 15624 15625 /** 15626 * WordPress dependencies 15627 */ 15628 15629 15630 15631 const EmbedPlaceholder = ({ 15632 icon, 15633 label, 15634 value, 15635 onSubmit, 15636 onChange, 15637 cannotEmbed, 15638 fallback, 15639 tryAgain 15640 }) => { 15641 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 15642 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 15643 icon: icon, 15644 showColors: true 15645 }), 15646 label: label, 15647 className: "wp-block-embed", 15648 instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.') 15649 }, (0,external_React_namespaceObject.createElement)("form", { 15650 onSubmit: onSubmit 15651 }, (0,external_React_namespaceObject.createElement)("input", { 15652 type: "url", 15653 value: value || '', 15654 className: "components-placeholder__input", 15655 "aria-label": label, 15656 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'), 15657 onChange: onChange 15658 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 15659 variant: "primary", 15660 type: "submit" 15661 }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_React_namespaceObject.createElement)("div", { 15662 className: "wp-block-embed__learn-more" 15663 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 15664 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/embeds/') 15665 }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_React_namespaceObject.createElement)("div", { 15666 className: "components-placeholder__error" 15667 }, (0,external_React_namespaceObject.createElement)("div", { 15668 className: "components-placeholder__instructions" 15669 }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 15670 variant: "secondary", 15671 onClick: tryAgain 15672 }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 15673 variant: "secondary", 15674 onClick: fallback 15675 }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label')))); 15676 }; 15677 /* harmony default export */ const embed_placeholder = (EmbedPlaceholder); 15678 15679 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js 15680 15681 /** 15682 * WordPress dependencies 15683 */ 15684 15685 15686 15687 /** @typedef {import('react').SyntheticEvent} SyntheticEvent */ 15688 15689 const attributeMap = { 15690 class: 'className', 15691 frameborder: 'frameBorder', 15692 marginheight: 'marginHeight', 15693 marginwidth: 'marginWidth' 15694 }; 15695 function WpEmbedPreview({ 15696 html 15697 }) { 15698 const ref = (0,external_wp_element_namespaceObject.useRef)(); 15699 const props = (0,external_wp_element_namespaceObject.useMemo)(() => { 15700 const doc = new window.DOMParser().parseFromString(html, 'text/html'); 15701 const iframe = doc.querySelector('iframe'); 15702 const iframeProps = {}; 15703 if (!iframe) return iframeProps; 15704 Array.from(iframe.attributes).forEach(({ 15705 name, 15706 value 15707 }) => { 15708 if (name === 'style') return; 15709 iframeProps[attributeMap[name] || name] = value; 15710 }); 15711 return iframeProps; 15712 }, [html]); 15713 (0,external_wp_element_namespaceObject.useEffect)(() => { 15714 const { 15715 ownerDocument 15716 } = ref.current; 15717 const { 15718 defaultView 15719 } = ownerDocument; 15720 15721 /** 15722 * Checks for WordPress embed events signaling the height change when 15723 * iframe content loads or iframe's window is resized. The event is 15724 * sent from WordPress core via the window.postMessage API. 15725 * 15726 * References: 15727 * window.postMessage: 15728 * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage 15729 * WordPress core embed-template on load: 15730 * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143 15731 * WordPress core embed-template on resize: 15732 * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187 15733 * 15734 * @param {MessageEvent} event Message event. 15735 */ 15736 function resizeWPembeds({ 15737 data: { 15738 secret, 15739 message, 15740 value 15741 } = {} 15742 }) { 15743 if (message !== 'height' || secret !== props['data-secret']) { 15744 return; 15745 } 15746 ref.current.height = value; 15747 } 15748 defaultView.addEventListener('message', resizeWPembeds); 15749 return () => { 15750 defaultView.removeEventListener('message', resizeWPembeds); 15751 }; 15752 }, []); 15753 return (0,external_React_namespaceObject.createElement)("div", { 15754 className: "wp-block-embed__wrapper" 15755 }, (0,external_React_namespaceObject.createElement)("iframe", { 15756 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), 15757 title: props.title, 15758 ...props 15759 })); 15760 } 15761 15762 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js 15763 15764 /** 15765 * Internal dependencies 15766 */ 15767 15768 15769 /** 15770 * External dependencies 15771 */ 15772 15773 15774 /** 15775 * WordPress dependencies 15776 */ 15777 15778 15779 15780 15781 15782 15783 /** 15784 * Internal dependencies 15785 */ 15786 15787 class EmbedPreview extends external_wp_element_namespaceObject.Component { 15788 constructor() { 15789 super(...arguments); 15790 this.hideOverlay = this.hideOverlay.bind(this); 15791 this.state = { 15792 interactive: false 15793 }; 15794 } 15795 static getDerivedStateFromProps(nextProps, state) { 15796 if (!nextProps.isSelected && state.interactive) { 15797 // We only want to change this when the block is not selected, because changing it when 15798 // the block becomes selected makes the overlap disappear too early. Hiding the overlay 15799 // happens on mouseup when the overlay is clicked. 15800 return { 15801 interactive: false 15802 }; 15803 } 15804 return null; 15805 } 15806 hideOverlay() { 15807 // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop 15808 // changing, because that happens on mouse down, and the overlay immediately disappears, 15809 // and the mouse event can end up in the preview content. We can't use onClick on 15810 // the overlay to hide it either, because then the editor misses the mouseup event, and 15811 // thinks we're multi-selecting blocks. 15812 this.setState({ 15813 interactive: true 15814 }); 15815 } 15816 render() { 15817 const { 15818 preview, 15819 previewable, 15820 url, 15821 type, 15822 caption, 15823 onCaptionChange, 15824 isSelected, 15825 className, 15826 icon, 15827 label, 15828 insertBlocksAfter 15829 } = this.props; 15830 const { 15831 scripts 15832 } = preview; 15833 const { 15834 interactive 15835 } = this.state; 15836 const html = 'photo' === type ? getPhotoHtml(preview) : preview.html; 15837 const parsedHost = new URL(url).host.split('.'); 15838 const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.'); 15839 const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( 15840 // translators: %s: host providing embed content e.g: www.youtube.com 15841 (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl); 15842 const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); 15843 15844 // Disabled because the overlay div doesn't actually have a role or functionality 15845 // as far as the user is concerned. We're just catching the first click so that 15846 // the block can be selected without interacting with the embed preview that the overlay covers. 15847 /* eslint-disable jsx-a11y/no-static-element-interactions */ 15848 const embedWrapper = 'wp-embed' === type ? (0,external_React_namespaceObject.createElement)(WpEmbedPreview, { 15849 html: html 15850 }) : (0,external_React_namespaceObject.createElement)("div", { 15851 className: "wp-block-embed__wrapper" 15852 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, { 15853 html: html, 15854 scripts: scripts, 15855 title: iframeTitle, 15856 type: sandboxClassnames, 15857 onFocus: this.hideOverlay 15858 }), !interactive && (0,external_React_namespaceObject.createElement)("div", { 15859 className: "block-library-embed__interactive-overlay", 15860 onMouseUp: this.hideOverlay 15861 })); 15862 /* eslint-enable jsx-a11y/no-static-element-interactions */ 15863 15864 return (0,external_React_namespaceObject.createElement)("figure", { 15865 className: dedupe_default()(className, 'wp-block-embed', { 15866 'is-type-video': 'video' === type 15867 }) 15868 }, previewable ? embedWrapper : (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 15869 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 15870 icon: icon, 15871 showColors: true 15872 }), 15873 label: label 15874 }, (0,external_React_namespaceObject.createElement)("p", { 15875 className: "components-placeholder__error" 15876 }, (0,external_React_namespaceObject.createElement)("a", { 15877 href: url 15878 }, url)), (0,external_React_namespaceObject.createElement)("p", { 15879 className: "components-placeholder__error" 15880 }, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: host providing embed content e.g: www.youtube.com */ 15881 (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_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 15882 identifier: "caption", 15883 tagName: "figcaption", 15884 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 15885 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), 15886 value: caption, 15887 onChange: onCaptionChange, 15888 inlineToolbar: true, 15889 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 15890 })); 15891 } 15892 } 15893 /* harmony default export */ const embed_preview = (EmbedPreview); 15894 15895 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js 15896 15897 /** 15898 * Internal dependencies 15899 */ 15900 15901 15902 15903 15904 15905 15906 15907 /** 15908 * External dependencies 15909 */ 15910 15911 15912 /** 15913 * WordPress dependencies 15914 */ 15915 15916 15917 15918 15919 15920 15921 15922 const EmbedEdit = props => { 15923 const { 15924 attributes: { 15925 providerNameSlug, 15926 previewable, 15927 responsive, 15928 url: attributesUrl 15929 }, 15930 attributes, 15931 isSelected, 15932 onReplace, 15933 setAttributes, 15934 insertBlocksAfter, 15935 onFocus 15936 } = props; 15937 const defaultEmbedInfo = { 15938 title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'), 15939 icon: embedContentIcon 15940 }; 15941 const { 15942 icon, 15943 title 15944 } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; 15945 const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl); 15946 const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); 15947 const { 15948 invalidateResolution 15949 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 15950 const { 15951 preview, 15952 fetching, 15953 themeSupportsResponsive, 15954 cannotEmbed 15955 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 15956 const { 15957 getEmbedPreview, 15958 isPreviewEmbedFallback, 15959 isRequestingEmbedPreview, 15960 getThemeSupports 15961 } = select(external_wp_coreData_namespaceObject.store); 15962 if (!attributesUrl) { 15963 return { 15964 fetching: false, 15965 cannotEmbed: false 15966 }; 15967 } 15968 const embedPreview = getEmbedPreview(attributesUrl); 15969 const previewIsFallback = isPreviewEmbedFallback(attributesUrl); 15970 15971 // The external oEmbed provider does not exist. We got no type info and no html. 15972 const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === undefined; 15973 // Some WordPress URLs that can't be embedded will cause the API to return 15974 // a valid JSON response with no HTML and `data.status` set to 404, rather 15975 // than generating a fallback response as other embeds do. 15976 const wordpressCantEmbed = embedPreview?.data?.status === 404; 15977 const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; 15978 return { 15979 preview: validPreview ? embedPreview : undefined, 15980 fetching: isRequestingEmbedPreview(attributesUrl), 15981 themeSupportsResponsive: getThemeSupports()['responsive-embeds'], 15982 cannotEmbed: !validPreview || previewIsFallback 15983 }; 15984 }, [attributesUrl]); 15985 15986 /** 15987 * Returns the attributes derived from the preview, merged with the current attributes. 15988 * 15989 * @return {Object} Merged attributes. 15990 */ 15991 const getMergedAttributes = () => getMergedAttributesWithPreview(attributes, preview, title, responsive); 15992 const toggleResponsive = () => { 15993 const { 15994 allowResponsive, 15995 className 15996 } = attributes; 15997 const { 15998 html 15999 } = preview; 16000 const newAllowResponsive = !allowResponsive; 16001 setAttributes({ 16002 allowResponsive: newAllowResponsive, 16003 className: getClassNames(html, className, responsive && newAllowResponsive) 16004 }); 16005 }; 16006 (0,external_wp_element_namespaceObject.useEffect)(() => { 16007 if (preview?.html || !cannotEmbed || fetching) { 16008 return; 16009 } 16010 16011 // At this stage, we're not fetching the preview and know it can't be embedded, 16012 // so try removing any trailing slash, and resubmit. 16013 const newURL = attributesUrl.replace(/\/$/, ''); 16014 setURL(newURL); 16015 setIsEditingURL(false); 16016 setAttributes({ 16017 url: newURL 16018 }); 16019 }, [preview?.html, attributesUrl, cannotEmbed, fetching, setAttributes]); 16020 16021 // Try a different provider in case the embed url is not supported. 16022 (0,external_wp_element_namespaceObject.useEffect)(() => { 16023 if (!cannotEmbed || fetching || !url) { 16024 return; 16025 } 16026 16027 // Until X provider is supported in WordPress, as a workaround we use Twitter provider. 16028 if ((0,external_wp_url_namespaceObject.getAuthority)(url) === 'x.com') { 16029 const newURL = new URL(url); 16030 newURL.host = 'twitter.com'; 16031 setAttributes({ 16032 url: newURL.toString() 16033 }); 16034 } 16035 }, [url, cannotEmbed, fetching, setAttributes]); 16036 16037 // Handle incoming preview. 16038 (0,external_wp_element_namespaceObject.useEffect)(() => { 16039 if (preview && !isEditingURL) { 16040 // When obtaining an incoming preview, 16041 // we set the attributes derived from the preview data. 16042 const mergedAttributes = getMergedAttributes(); 16043 setAttributes(mergedAttributes); 16044 if (onReplace) { 16045 const upgradedBlock = createUpgradedEmbedBlock(props, mergedAttributes); 16046 if (upgradedBlock) { 16047 onReplace(upgradedBlock); 16048 } 16049 } 16050 } 16051 }, [preview, isEditingURL]); 16052 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 16053 if (fetching) { 16054 return (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 16055 ...blockProps 16056 }, (0,external_React_namespaceObject.createElement)(embed_loading, null)); 16057 } 16058 16059 // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists 16060 const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); 16061 16062 // No preview, or we can't embed the current URL, or we've clicked the edit button. 16063 const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; 16064 if (showEmbedPlaceholder) { 16065 return (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 16066 ...blockProps 16067 }, (0,external_React_namespaceObject.createElement)(embed_placeholder, { 16068 icon: icon, 16069 label: label, 16070 onFocus: onFocus, 16071 onSubmit: event => { 16072 if (event) { 16073 event.preventDefault(); 16074 } 16075 16076 // If the embed URL was changed, we need to reset the aspect ratio class. 16077 // To do this we have to remove the existing ratio class so it can be recalculated. 16078 const blockClass = removeAspectRatioClasses(attributes.className); 16079 setIsEditingURL(false); 16080 setAttributes({ 16081 url, 16082 className: blockClass 16083 }); 16084 }, 16085 value: url, 16086 cannotEmbed: cannotEmbed, 16087 onChange: event => setURL(event.target.value), 16088 fallback: () => fallback(url, onReplace), 16089 tryAgain: () => { 16090 invalidateResolution('getEmbedPreview', [url]); 16091 } 16092 })); 16093 } 16094 16095 // Even though we set attributes that get derived from the preview, 16096 // we don't access them directly because for the initial render, 16097 // the `setAttributes` call will not have taken effect. If we're 16098 // rendering responsive content, setting the responsive classes 16099 // after the preview has been rendered can result in unwanted 16100 // clipping or scrollbars. The `getAttributesFromPreview` function 16101 // that `getMergedAttributes` uses is memoized so that we're not 16102 // calculating them on every render. 16103 const { 16104 caption, 16105 type, 16106 allowResponsive, 16107 className: classFromPreview 16108 } = getMergedAttributes(); 16109 const className = classnames_default()(classFromPreview, props.className); 16110 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(embed_controls, { 16111 showEditButton: preview && !cannotEmbed, 16112 themeSupportsResponsive: themeSupportsResponsive, 16113 blockSupportsResponsive: responsive, 16114 allowResponsive: allowResponsive, 16115 toggleResponsive: toggleResponsive, 16116 switchBackToURLInput: () => setIsEditingURL(true) 16117 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 16118 ...blockProps 16119 }, (0,external_React_namespaceObject.createElement)(embed_preview, { 16120 preview: preview, 16121 previewable: previewable, 16122 className: className, 16123 url: url, 16124 type: type, 16125 caption: caption, 16126 onCaptionChange: value => setAttributes({ 16127 caption: value 16128 }), 16129 isSelected: isSelected, 16130 icon: icon, 16131 label: label, 16132 insertBlocksAfter: insertBlocksAfter 16133 }))); 16134 }; 16135 /* harmony default export */ const embed_edit = (EmbedEdit); 16136 16137 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js 16138 16139 /** 16140 * External dependencies 16141 */ 16142 16143 16144 /** 16145 * WordPress dependencies 16146 */ 16147 16148 function embed_save_save({ 16149 attributes 16150 }) { 16151 const { 16152 url, 16153 caption, 16154 type, 16155 providerNameSlug 16156 } = attributes; 16157 if (!url) { 16158 return null; 16159 } 16160 const className = dedupe_default()('wp-block-embed', { 16161 [`is-type-$type}`]: type, 16162 [`is-provider-$providerNameSlug}`]: providerNameSlug, 16163 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 16164 }); 16165 return (0,external_React_namespaceObject.createElement)("figure", { 16166 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 16167 className 16168 }) 16169 }, (0,external_React_namespaceObject.createElement)("div", { 16170 className: "wp-block-embed__wrapper" 16171 }, `\n$url}\n` /* URL needs to be on its own line. */), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 16172 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 16173 tagName: "figcaption", 16174 value: caption 16175 })); 16176 } 16177 16178 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js 16179 /** 16180 * WordPress dependencies 16181 */ 16182 16183 16184 /** 16185 * Internal dependencies 16186 */ 16187 const transforms_metadata = { 16188 $schema: "https://schemas.wp.org/trunk/block.json", 16189 apiVersion: 3, 16190 name: "core/embed", 16191 title: "Embed", 16192 category: "embed", 16193 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 16194 textdomain: "default", 16195 attributes: { 16196 url: { 16197 type: "string", 16198 __experimentalRole: "content" 16199 }, 16200 caption: { 16201 type: "rich-text", 16202 source: "rich-text", 16203 selector: "figcaption", 16204 __experimentalRole: "content" 16205 }, 16206 type: { 16207 type: "string", 16208 __experimentalRole: "content" 16209 }, 16210 providerNameSlug: { 16211 type: "string", 16212 __experimentalRole: "content" 16213 }, 16214 allowResponsive: { 16215 type: "boolean", 16216 "default": true 16217 }, 16218 responsive: { 16219 type: "boolean", 16220 "default": false, 16221 __experimentalRole: "content" 16222 }, 16223 previewable: { 16224 type: "boolean", 16225 "default": true, 16226 __experimentalRole: "content" 16227 } 16228 }, 16229 supports: { 16230 align: true, 16231 spacing: { 16232 margin: true 16233 }, 16234 interactivity: { 16235 clientNavigation: true 16236 } 16237 }, 16238 editorStyle: "wp-block-embed-editor", 16239 style: "wp-block-embed" 16240 }; 16241 const { 16242 name: EMBED_BLOCK 16243 } = transforms_metadata; 16244 16245 /** 16246 * Default transforms for generic embeds. 16247 */ 16248 const embed_transforms_transforms = { 16249 from: [{ 16250 type: 'raw', 16251 isMatch: node => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1, 16252 transform: node => { 16253 return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, { 16254 url: node.textContent.trim() 16255 }); 16256 } 16257 }], 16258 to: [{ 16259 type: 'block', 16260 blocks: ['core/paragraph'], 16261 isMatch: ({ 16262 url 16263 }) => !!url, 16264 transform: ({ 16265 url, 16266 caption 16267 }) => { 16268 let value = `<a href="$url}">$url}</a>`; 16269 if (caption?.trim()) { 16270 value += `<br />$caption}`; 16271 } 16272 return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 16273 content: value 16274 }); 16275 } 16276 }] 16277 }; 16278 /* harmony default export */ const embed_transforms = (embed_transforms_transforms); 16279 16280 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js 16281 /** 16282 * WordPress dependencies 16283 */ 16284 16285 16286 /** 16287 * Internal dependencies 16288 */ 16289 16290 16291 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 16292 16293 /** 16294 * The embed provider services. 16295 * 16296 * @type {WPBlockVariation[]} 16297 */ 16298 const embed_variations_variations = [{ 16299 name: 'twitter', 16300 title: 'Twitter', 16301 icon: embedTwitterIcon, 16302 keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')], 16303 description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'), 16304 patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], 16305 attributes: { 16306 providerNameSlug: 'twitter', 16307 responsive: true 16308 } 16309 }, { 16310 name: 'youtube', 16311 title: 'YouTube', 16312 icon: embedYouTubeIcon, 16313 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')], 16314 description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'), 16315 patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i], 16316 attributes: { 16317 providerNameSlug: 'youtube', 16318 responsive: true 16319 } 16320 }, { 16321 // Deprecate Facebook Embed per FB policy 16322 // See: https://developers.facebook.com/docs/plugins/oembed-legacy 16323 name: 'facebook', 16324 title: 'Facebook', 16325 icon: embedFacebookIcon, 16326 keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], 16327 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'), 16328 scope: ['block'], 16329 patterns: [], 16330 attributes: { 16331 providerNameSlug: 'facebook', 16332 previewable: false, 16333 responsive: true 16334 } 16335 }, { 16336 // Deprecate Instagram per FB policy 16337 // See: https://developers.facebook.com/docs/instagram/oembed-legacy 16338 name: 'instagram', 16339 title: 'Instagram', 16340 icon: embedInstagramIcon, 16341 keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')], 16342 description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'), 16343 scope: ['block'], 16344 patterns: [], 16345 attributes: { 16346 providerNameSlug: 'instagram', 16347 responsive: true 16348 } 16349 }, { 16350 name: 'wordpress', 16351 title: 'WordPress', 16352 icon: embedWordPressIcon, 16353 keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')], 16354 description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'), 16355 attributes: { 16356 providerNameSlug: 'wordpress' 16357 } 16358 }, { 16359 name: 'soundcloud', 16360 title: 'SoundCloud', 16361 icon: embedAudioIcon, 16362 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 16363 description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'), 16364 patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], 16365 attributes: { 16366 providerNameSlug: 'soundcloud', 16367 responsive: true 16368 } 16369 }, { 16370 name: 'spotify', 16371 title: 'Spotify', 16372 icon: embedSpotifyIcon, 16373 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 16374 description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'), 16375 patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], 16376 attributes: { 16377 providerNameSlug: 'spotify', 16378 responsive: true 16379 } 16380 }, { 16381 name: 'flickr', 16382 title: 'Flickr', 16383 icon: embedFlickrIcon, 16384 keywords: [(0,external_wp_i18n_namespaceObject.__)('image')], 16385 description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'), 16386 patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i], 16387 attributes: { 16388 providerNameSlug: 'flickr', 16389 responsive: true 16390 } 16391 }, { 16392 name: 'vimeo', 16393 title: 'Vimeo', 16394 icon: embedVimeoIcon, 16395 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 16396 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'), 16397 patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], 16398 attributes: { 16399 providerNameSlug: 'vimeo', 16400 responsive: true 16401 } 16402 }, { 16403 name: 'animoto', 16404 title: 'Animoto', 16405 icon: embedAnimotoIcon, 16406 description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'), 16407 patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], 16408 attributes: { 16409 providerNameSlug: 'animoto', 16410 responsive: true 16411 } 16412 }, { 16413 name: 'cloudup', 16414 title: 'Cloudup', 16415 icon: embedContentIcon, 16416 description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'), 16417 patterns: [/^https?:\/\/cloudup\.com\/.+/i], 16418 attributes: { 16419 providerNameSlug: 'cloudup', 16420 responsive: true 16421 } 16422 }, { 16423 // Deprecated since CollegeHumor content is now powered by YouTube. 16424 name: 'collegehumor', 16425 title: 'CollegeHumor', 16426 icon: embedVideoIcon, 16427 description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'), 16428 scope: ['block'], 16429 patterns: [], 16430 attributes: { 16431 providerNameSlug: 'collegehumor', 16432 responsive: true 16433 } 16434 }, { 16435 name: 'crowdsignal', 16436 title: 'Crowdsignal', 16437 icon: embedContentIcon, 16438 keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')], 16439 description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'), 16440 patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i], 16441 attributes: { 16442 providerNameSlug: 'crowdsignal', 16443 responsive: true 16444 } 16445 }, { 16446 name: 'dailymotion', 16447 title: 'Dailymotion', 16448 icon: embedDailymotionIcon, 16449 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 16450 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'), 16451 patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], 16452 attributes: { 16453 providerNameSlug: 'dailymotion', 16454 responsive: true 16455 } 16456 }, { 16457 name: 'imgur', 16458 title: 'Imgur', 16459 icon: embedPhotoIcon, 16460 description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'), 16461 patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], 16462 attributes: { 16463 providerNameSlug: 'imgur', 16464 responsive: true 16465 } 16466 }, { 16467 name: 'issuu', 16468 title: 'Issuu', 16469 icon: embedContentIcon, 16470 description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'), 16471 patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], 16472 attributes: { 16473 providerNameSlug: 'issuu', 16474 responsive: true 16475 } 16476 }, { 16477 name: 'kickstarter', 16478 title: 'Kickstarter', 16479 icon: embedContentIcon, 16480 description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'), 16481 patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i], 16482 attributes: { 16483 providerNameSlug: 'kickstarter', 16484 responsive: true 16485 } 16486 }, { 16487 name: 'mixcloud', 16488 title: 'Mixcloud', 16489 icon: embedAudioIcon, 16490 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 16491 description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'), 16492 patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], 16493 attributes: { 16494 providerNameSlug: 'mixcloud', 16495 responsive: true 16496 } 16497 }, { 16498 name: 'pocket-casts', 16499 title: 'Pocket Casts', 16500 icon: embedPocketCastsIcon, 16501 keywords: [(0,external_wp_i18n_namespaceObject.__)('podcast'), (0,external_wp_i18n_namespaceObject.__)('audio')], 16502 description: (0,external_wp_i18n_namespaceObject.__)('Embed a podcast player from Pocket Casts.'), 16503 patterns: [/^https:\/\/pca.st\/\w+/i], 16504 attributes: { 16505 providerNameSlug: 'pocket-casts', 16506 responsive: true 16507 } 16508 }, { 16509 name: 'reddit', 16510 title: 'Reddit', 16511 icon: embedRedditIcon, 16512 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'), 16513 patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], 16514 attributes: { 16515 providerNameSlug: 'reddit', 16516 responsive: true 16517 } 16518 }, { 16519 name: 'reverbnation', 16520 title: 'ReverbNation', 16521 icon: embedAudioIcon, 16522 description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'), 16523 patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], 16524 attributes: { 16525 providerNameSlug: 'reverbnation', 16526 responsive: true 16527 } 16528 }, { 16529 name: 'screencast', 16530 title: 'Screencast', 16531 icon: embedVideoIcon, 16532 description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'), 16533 patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i], 16534 attributes: { 16535 providerNameSlug: 'screencast', 16536 responsive: true 16537 } 16538 }, { 16539 name: 'scribd', 16540 title: 'Scribd', 16541 icon: embedContentIcon, 16542 description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'), 16543 patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], 16544 attributes: { 16545 providerNameSlug: 'scribd', 16546 responsive: true 16547 } 16548 }, { 16549 name: 'slideshare', 16550 title: 'Slideshare', 16551 icon: embedContentIcon, 16552 description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'), 16553 patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i], 16554 attributes: { 16555 providerNameSlug: 'slideshare', 16556 responsive: true 16557 } 16558 }, { 16559 name: 'smugmug', 16560 title: 'SmugMug', 16561 icon: embedPhotoIcon, 16562 description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'), 16563 patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], 16564 attributes: { 16565 providerNameSlug: 'smugmug', 16566 previewable: false, 16567 responsive: true 16568 } 16569 }, { 16570 name: 'speaker-deck', 16571 title: 'Speaker Deck', 16572 icon: embedContentIcon, 16573 description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'), 16574 patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], 16575 attributes: { 16576 providerNameSlug: 'speaker-deck', 16577 responsive: true 16578 } 16579 }, { 16580 name: 'tiktok', 16581 title: 'TikTok', 16582 icon: embedVideoIcon, 16583 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 16584 description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'), 16585 patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], 16586 attributes: { 16587 providerNameSlug: 'tiktok', 16588 responsive: true 16589 } 16590 }, { 16591 name: 'ted', 16592 title: 'TED', 16593 icon: embedVideoIcon, 16594 description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'), 16595 patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], 16596 attributes: { 16597 providerNameSlug: 'ted', 16598 responsive: true 16599 } 16600 }, { 16601 name: 'tumblr', 16602 title: 'Tumblr', 16603 icon: embedTumblrIcon, 16604 keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], 16605 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'), 16606 patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], 16607 attributes: { 16608 providerNameSlug: 'tumblr', 16609 responsive: true 16610 } 16611 }, { 16612 name: 'videopress', 16613 title: 'VideoPress', 16614 icon: embedVideoIcon, 16615 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 16616 description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'), 16617 patterns: [/^https?:\/\/videopress\.com\/.+/i], 16618 attributes: { 16619 providerNameSlug: 'videopress', 16620 responsive: true 16621 } 16622 }, { 16623 name: 'wordpress-tv', 16624 title: 'WordPress.tv', 16625 icon: embedVideoIcon, 16626 description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'), 16627 patterns: [/^https?:\/\/wordpress\.tv\/.+/i], 16628 attributes: { 16629 providerNameSlug: 'wordpress-tv', 16630 responsive: true 16631 } 16632 }, { 16633 name: 'amazon-kindle', 16634 title: 'Amazon Kindle', 16635 icon: embedAmazonIcon, 16636 keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')], 16637 description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'), 16638 patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i], 16639 attributes: { 16640 providerNameSlug: 'amazon-kindle' 16641 } 16642 }, { 16643 name: 'pinterest', 16644 title: 'Pinterest', 16645 icon: embedPinterestIcon, 16646 keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')], 16647 description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'), 16648 patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i], 16649 attributes: { 16650 providerNameSlug: 'pinterest' 16651 } 16652 }, { 16653 name: 'wolfram-cloud', 16654 title: 'Wolfram', 16655 icon: embedWolframIcon, 16656 description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'), 16657 patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], 16658 attributes: { 16659 providerNameSlug: 'wolfram-cloud', 16660 responsive: true 16661 } 16662 }]; 16663 16664 /** 16665 * Add `isActive` function to all `embed` variations, if not defined. 16666 * `isActive` function is used to find a variation match from a created 16667 * Block by providing its attributes. 16668 */ 16669 embed_variations_variations.forEach(variation => { 16670 if (variation.isActive) return; 16671 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug; 16672 }); 16673 /* harmony default export */ const embed_variations = (embed_variations_variations); 16674 16675 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js 16676 16677 /** 16678 * External dependencies 16679 */ 16680 16681 16682 /** 16683 * Internal dependencies 16684 */ 16685 const embed_deprecated_metadata = { 16686 $schema: "https://schemas.wp.org/trunk/block.json", 16687 apiVersion: 3, 16688 name: "core/embed", 16689 title: "Embed", 16690 category: "embed", 16691 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 16692 textdomain: "default", 16693 attributes: { 16694 url: { 16695 type: "string", 16696 __experimentalRole: "content" 16697 }, 16698 caption: { 16699 type: "rich-text", 16700 source: "rich-text", 16701 selector: "figcaption", 16702 __experimentalRole: "content" 16703 }, 16704 type: { 16705 type: "string", 16706 __experimentalRole: "content" 16707 }, 16708 providerNameSlug: { 16709 type: "string", 16710 __experimentalRole: "content" 16711 }, 16712 allowResponsive: { 16713 type: "boolean", 16714 "default": true 16715 }, 16716 responsive: { 16717 type: "boolean", 16718 "default": false, 16719 __experimentalRole: "content" 16720 }, 16721 previewable: { 16722 type: "boolean", 16723 "default": true, 16724 __experimentalRole: "content" 16725 } 16726 }, 16727 supports: { 16728 align: true, 16729 spacing: { 16730 margin: true 16731 }, 16732 interactivity: { 16733 clientNavigation: true 16734 } 16735 }, 16736 editorStyle: "wp-block-embed-editor", 16737 style: "wp-block-embed" 16738 }; 16739 /** 16740 * WordPress dependencies 16741 */ 16742 16743 const { 16744 attributes: embed_deprecated_blockAttributes 16745 } = embed_deprecated_metadata; 16746 16747 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 16748 // to the embed figcaption element. 16749 const deprecated_v2 = { 16750 attributes: embed_deprecated_blockAttributes, 16751 save({ 16752 attributes 16753 }) { 16754 const { 16755 url, 16756 caption, 16757 type, 16758 providerNameSlug 16759 } = attributes; 16760 if (!url) { 16761 return null; 16762 } 16763 const className = classnames_default()('wp-block-embed', { 16764 [`is-type-$type}`]: type, 16765 [`is-provider-$providerNameSlug}`]: providerNameSlug, 16766 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 16767 }); 16768 return (0,external_React_namespaceObject.createElement)("figure", { 16769 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 16770 className 16771 }) 16772 }, (0,external_React_namespaceObject.createElement)("div", { 16773 className: "wp-block-embed__wrapper" 16774 }, `\n$url}\n` /* URL needs to be on its own line. */), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 16775 tagName: "figcaption", 16776 value: caption 16777 })); 16778 } 16779 }; 16780 const embed_deprecated_v1 = { 16781 attributes: embed_deprecated_blockAttributes, 16782 save({ 16783 attributes: { 16784 url, 16785 caption, 16786 type, 16787 providerNameSlug 16788 } 16789 }) { 16790 if (!url) { 16791 return null; 16792 } 16793 const embedClassName = classnames_default()('wp-block-embed', { 16794 [`is-type-$type}`]: type, 16795 [`is-provider-$providerNameSlug}`]: providerNameSlug 16796 }); 16797 return (0,external_React_namespaceObject.createElement)("figure", { 16798 className: embedClassName 16799 }, `\n$url}\n` /* URL needs to be on its own line. */, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 16800 tagName: "figcaption", 16801 value: caption 16802 })); 16803 } 16804 }; 16805 const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1]; 16806 /* harmony default export */ const embed_deprecated = (embed_deprecated_deprecated); 16807 16808 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js 16809 /** 16810 * Internal dependencies 16811 */ 16812 16813 16814 16815 const embed_metadata = { 16816 $schema: "https://schemas.wp.org/trunk/block.json", 16817 apiVersion: 3, 16818 name: "core/embed", 16819 title: "Embed", 16820 category: "embed", 16821 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 16822 textdomain: "default", 16823 attributes: { 16824 url: { 16825 type: "string", 16826 __experimentalRole: "content" 16827 }, 16828 caption: { 16829 type: "rich-text", 16830 source: "rich-text", 16831 selector: "figcaption", 16832 __experimentalRole: "content" 16833 }, 16834 type: { 16835 type: "string", 16836 __experimentalRole: "content" 16837 }, 16838 providerNameSlug: { 16839 type: "string", 16840 __experimentalRole: "content" 16841 }, 16842 allowResponsive: { 16843 type: "boolean", 16844 "default": true 16845 }, 16846 responsive: { 16847 type: "boolean", 16848 "default": false, 16849 __experimentalRole: "content" 16850 }, 16851 previewable: { 16852 type: "boolean", 16853 "default": true, 16854 __experimentalRole: "content" 16855 } 16856 }, 16857 supports: { 16858 align: true, 16859 spacing: { 16860 margin: true 16861 }, 16862 interactivity: { 16863 clientNavigation: true 16864 } 16865 }, 16866 editorStyle: "wp-block-embed-editor", 16867 style: "wp-block-embed" 16868 }; 16869 16870 16871 16872 16873 const { 16874 name: embed_name 16875 } = embed_metadata; 16876 16877 const embed_settings = { 16878 icon: embedContentIcon, 16879 edit: embed_edit, 16880 save: embed_save_save, 16881 transforms: embed_transforms, 16882 variations: embed_variations, 16883 deprecated: embed_deprecated 16884 }; 16885 const embed_init = () => initBlock({ 16886 name: embed_name, 16887 metadata: embed_metadata, 16888 settings: embed_settings 16889 }); 16890 16891 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js 16892 16893 /** 16894 * WordPress dependencies 16895 */ 16896 16897 const file = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 16898 viewBox: "0 0 24 24", 16899 xmlns: "http://www.w3.org/2000/svg" 16900 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 16901 fillRule: "evenodd", 16902 clipRule: "evenodd", 16903 d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" 16904 })); 16905 /* harmony default export */ const library_file = (file); 16906 16907 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js 16908 16909 /** 16910 * External dependencies 16911 */ 16912 16913 16914 /** 16915 * WordPress dependencies 16916 */ 16917 16918 16919 16920 // Version of the file block without PR#43050 removing the translated aria-label. 16921 const deprecated_v3 = { 16922 attributes: { 16923 id: { 16924 type: 'number' 16925 }, 16926 href: { 16927 type: 'string' 16928 }, 16929 fileId: { 16930 type: 'string', 16931 source: 'attribute', 16932 selector: 'a:not([download])', 16933 attribute: 'id' 16934 }, 16935 fileName: { 16936 type: 'string', 16937 source: 'html', 16938 selector: 'a:not([download])' 16939 }, 16940 textLinkHref: { 16941 type: 'string', 16942 source: 'attribute', 16943 selector: 'a:not([download])', 16944 attribute: 'href' 16945 }, 16946 textLinkTarget: { 16947 type: 'string', 16948 source: 'attribute', 16949 selector: 'a:not([download])', 16950 attribute: 'target' 16951 }, 16952 showDownloadButton: { 16953 type: 'boolean', 16954 default: true 16955 }, 16956 downloadButtonText: { 16957 type: 'string', 16958 source: 'html', 16959 selector: 'a[download]' 16960 }, 16961 displayPreview: { 16962 type: 'boolean' 16963 }, 16964 previewHeight: { 16965 type: 'number', 16966 default: 600 16967 } 16968 }, 16969 supports: { 16970 anchor: true, 16971 align: true 16972 }, 16973 save({ 16974 attributes 16975 }) { 16976 const { 16977 href, 16978 fileId, 16979 fileName, 16980 textLinkHref, 16981 textLinkTarget, 16982 showDownloadButton, 16983 downloadButtonText, 16984 displayPreview, 16985 previewHeight 16986 } = attributes; 16987 const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ 16988 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 16989 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 16990 16991 // Only output an `aria-describedby` when the element it's referring to is 16992 // actually rendered. 16993 const describedById = hasFilename ? fileId : undefined; 16994 return href && (0,external_React_namespaceObject.createElement)("div", { 16995 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 16996 }, displayPreview && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("object", { 16997 className: "wp-block-file__embed", 16998 data: href, 16999 type: "application/pdf", 17000 style: { 17001 width: '100%', 17002 height: `$previewHeight}px` 17003 }, 17004 "aria-label": pdfEmbedLabel 17005 })), hasFilename && (0,external_React_namespaceObject.createElement)("a", { 17006 id: describedById, 17007 href: textLinkHref, 17008 target: textLinkTarget, 17009 rel: textLinkTarget ? 'noreferrer noopener' : undefined 17010 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17011 value: fileName 17012 })), showDownloadButton && (0,external_React_namespaceObject.createElement)("a", { 17013 href: href, 17014 className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 17015 download: true, 17016 "aria-describedby": describedById 17017 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17018 value: downloadButtonText 17019 }))); 17020 } 17021 }; 17022 17023 // In #41239 the button was made an element button which added a `wp-element-button` classname 17024 // to the download link element. 17025 const file_deprecated_v2 = { 17026 attributes: { 17027 id: { 17028 type: 'number' 17029 }, 17030 href: { 17031 type: 'string' 17032 }, 17033 fileId: { 17034 type: 'string', 17035 source: 'attribute', 17036 selector: 'a:not([download])', 17037 attribute: 'id' 17038 }, 17039 fileName: { 17040 type: 'string', 17041 source: 'html', 17042 selector: 'a:not([download])' 17043 }, 17044 textLinkHref: { 17045 type: 'string', 17046 source: 'attribute', 17047 selector: 'a:not([download])', 17048 attribute: 'href' 17049 }, 17050 textLinkTarget: { 17051 type: 'string', 17052 source: 'attribute', 17053 selector: 'a:not([download])', 17054 attribute: 'target' 17055 }, 17056 showDownloadButton: { 17057 type: 'boolean', 17058 default: true 17059 }, 17060 downloadButtonText: { 17061 type: 'string', 17062 source: 'html', 17063 selector: 'a[download]' 17064 }, 17065 displayPreview: { 17066 type: 'boolean' 17067 }, 17068 previewHeight: { 17069 type: 'number', 17070 default: 600 17071 } 17072 }, 17073 supports: { 17074 anchor: true, 17075 align: true 17076 }, 17077 save({ 17078 attributes 17079 }) { 17080 const { 17081 href, 17082 fileId, 17083 fileName, 17084 textLinkHref, 17085 textLinkTarget, 17086 showDownloadButton, 17087 downloadButtonText, 17088 displayPreview, 17089 previewHeight 17090 } = attributes; 17091 const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ 17092 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 17093 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 17094 17095 // Only output an `aria-describedby` when the element it's referring to is 17096 // actually rendered. 17097 const describedById = hasFilename ? fileId : undefined; 17098 return href && (0,external_React_namespaceObject.createElement)("div", { 17099 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 17100 }, displayPreview && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("object", { 17101 className: "wp-block-file__embed", 17102 data: href, 17103 type: "application/pdf", 17104 style: { 17105 width: '100%', 17106 height: `$previewHeight}px` 17107 }, 17108 "aria-label": pdfEmbedLabel 17109 })), hasFilename && (0,external_React_namespaceObject.createElement)("a", { 17110 id: describedById, 17111 href: textLinkHref, 17112 target: textLinkTarget, 17113 rel: textLinkTarget ? 'noreferrer noopener' : undefined 17114 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17115 value: fileName 17116 })), showDownloadButton && (0,external_React_namespaceObject.createElement)("a", { 17117 href: href, 17118 className: "wp-block-file__button", 17119 download: true, 17120 "aria-describedby": describedById 17121 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17122 value: downloadButtonText 17123 }))); 17124 } 17125 }; 17126 17127 // Version of the file block without PR#28062 accessibility fix. 17128 const file_deprecated_v1 = { 17129 attributes: { 17130 id: { 17131 type: 'number' 17132 }, 17133 href: { 17134 type: 'string' 17135 }, 17136 fileName: { 17137 type: 'string', 17138 source: 'html', 17139 selector: 'a:not([download])' 17140 }, 17141 textLinkHref: { 17142 type: 'string', 17143 source: 'attribute', 17144 selector: 'a:not([download])', 17145 attribute: 'href' 17146 }, 17147 textLinkTarget: { 17148 type: 'string', 17149 source: 'attribute', 17150 selector: 'a:not([download])', 17151 attribute: 'target' 17152 }, 17153 showDownloadButton: { 17154 type: 'boolean', 17155 default: true 17156 }, 17157 downloadButtonText: { 17158 type: 'string', 17159 source: 'html', 17160 selector: 'a[download]' 17161 }, 17162 displayPreview: { 17163 type: 'boolean' 17164 }, 17165 previewHeight: { 17166 type: 'number', 17167 default: 600 17168 } 17169 }, 17170 supports: { 17171 anchor: true, 17172 align: true 17173 }, 17174 save({ 17175 attributes 17176 }) { 17177 const { 17178 href, 17179 fileName, 17180 textLinkHref, 17181 textLinkTarget, 17182 showDownloadButton, 17183 downloadButtonText, 17184 displayPreview, 17185 previewHeight 17186 } = attributes; 17187 const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ 17188 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 17189 return href && (0,external_React_namespaceObject.createElement)("div", { 17190 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 17191 }, displayPreview && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("object", { 17192 className: "wp-block-file__embed", 17193 data: href, 17194 type: "application/pdf", 17195 style: { 17196 width: '100%', 17197 height: `$previewHeight}px` 17198 }, 17199 "aria-label": pdfEmbedLabel 17200 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_React_namespaceObject.createElement)("a", { 17201 href: textLinkHref, 17202 target: textLinkTarget, 17203 rel: textLinkTarget ? 'noreferrer noopener' : undefined 17204 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17205 value: fileName 17206 })), showDownloadButton && (0,external_React_namespaceObject.createElement)("a", { 17207 href: href, 17208 className: "wp-block-file__button", 17209 download: true 17210 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17211 value: downloadButtonText 17212 }))); 17213 } 17214 }; 17215 const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1]; 17216 /* harmony default export */ const file_deprecated = (file_deprecated_deprecated); 17217 17218 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js 17219 17220 /** 17221 * WordPress dependencies 17222 */ 17223 17224 17225 17226 17227 /** 17228 * Internal dependencies 17229 */ 17230 17231 function FileBlockInspector({ 17232 hrefs, 17233 openInNewWindow, 17234 showDownloadButton, 17235 changeLinkDestinationOption, 17236 changeOpenInNewWindow, 17237 changeShowDownloadButton, 17238 displayPreview, 17239 changeDisplayPreview, 17240 previewHeight, 17241 changePreviewHeight 17242 }) { 17243 const { 17244 href, 17245 textLinkHref, 17246 attachmentPage 17247 } = hrefs; 17248 let linkDestinationOptions = [{ 17249 value: href, 17250 label: (0,external_wp_i18n_namespaceObject.__)('URL') 17251 }]; 17252 if (attachmentPage) { 17253 linkDestinationOptions = [{ 17254 value: href, 17255 label: (0,external_wp_i18n_namespaceObject.__)('Media file') 17256 }, { 17257 value: attachmentPage, 17258 label: (0,external_wp_i18n_namespaceObject.__)('Attachment page') 17259 }]; 17260 } 17261 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 17262 title: (0,external_wp_i18n_namespaceObject.__)('PDF settings') 17263 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 17264 __nextHasNoMarginBottom: true, 17265 label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'), 17266 help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, 17267 checked: !!displayPreview, 17268 onChange: changeDisplayPreview 17269 }), displayPreview && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 17270 __nextHasNoMarginBottom: true, 17271 __next40pxDefaultSize: true, 17272 label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'), 17273 min: MIN_PREVIEW_HEIGHT, 17274 max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight), 17275 value: previewHeight, 17276 onChange: changePreviewHeight 17277 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 17278 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 17279 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 17280 __nextHasNoMarginBottom: true, 17281 label: (0,external_wp_i18n_namespaceObject.__)('Link to'), 17282 value: textLinkHref, 17283 options: linkDestinationOptions, 17284 onChange: changeLinkDestinationOption 17285 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 17286 __nextHasNoMarginBottom: true, 17287 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 17288 checked: openInNewWindow, 17289 onChange: changeOpenInNewWindow 17290 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 17291 __nextHasNoMarginBottom: true, 17292 label: (0,external_wp_i18n_namespaceObject.__)('Show download button'), 17293 checked: showDownloadButton, 17294 onChange: changeShowDownloadButton 17295 })))); 17296 } 17297 17298 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js 17299 /** 17300 * Uses a combination of user agent matching and feature detection to determine whether 17301 * the current browser supports rendering PDFs inline. 17302 * 17303 * @return {boolean} Whether or not the browser supports inline PDFs. 17304 */ 17305 const browserSupportsPdfs = () => { 17306 // Most mobile devices include "Mobi" in their UA. 17307 if (window.navigator.userAgent.indexOf('Mobi') > -1) { 17308 return false; 17309 } 17310 17311 // Android tablets are the noteable exception. 17312 if (window.navigator.userAgent.indexOf('Android') > -1) { 17313 return false; 17314 } 17315 17316 // iPad pretends to be a Mac. 17317 if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { 17318 return false; 17319 } 17320 17321 // IE only supports PDFs when there's an ActiveX object available for it. 17322 if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { 17323 return false; 17324 } 17325 return true; 17326 }; 17327 17328 /** 17329 * Helper function for creating ActiveX objects, catching any errors that are thrown 17330 * when it's generated. 17331 * 17332 * @param {string} type The name of the ActiveX object to create. 17333 * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. 17334 */ 17335 const createActiveXObject = type => { 17336 let ax; 17337 try { 17338 ax = new window.ActiveXObject(type); 17339 } catch (e) { 17340 ax = undefined; 17341 } 17342 return ax; 17343 }; 17344 17345 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js 17346 17347 /** 17348 * External dependencies 17349 */ 17350 17351 17352 /** 17353 * WordPress dependencies 17354 */ 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 /** 17367 * Internal dependencies 17368 */ 17369 17370 17371 17372 const MIN_PREVIEW_HEIGHT = 200; 17373 const MAX_PREVIEW_HEIGHT = 2000; 17374 function ClipboardToolbarButton({ 17375 text, 17376 disabled 17377 }) { 17378 const { 17379 createNotice 17380 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 17381 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { 17382 createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { 17383 isDismissible: true, 17384 type: 'snackbar' 17385 }); 17386 }); 17387 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 17388 className: "components-clipboard-toolbar-button", 17389 ref: ref, 17390 disabled: disabled 17391 }, (0,external_wp_i18n_namespaceObject.__)('Copy URL')); 17392 } 17393 function FileEdit({ 17394 attributes, 17395 isSelected, 17396 setAttributes, 17397 clientId 17398 }) { 17399 const { 17400 id, 17401 fileName, 17402 href, 17403 textLinkHref, 17404 textLinkTarget, 17405 showDownloadButton, 17406 downloadButtonText, 17407 displayPreview, 17408 previewHeight 17409 } = attributes; 17410 const { 17411 getSettings 17412 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 17413 const { 17414 media 17415 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ 17416 media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id) 17417 }), [id]); 17418 const { 17419 createErrorNotice 17420 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 17421 const { 17422 toggleSelection 17423 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 17424 (0,external_wp_element_namespaceObject.useEffect)(() => { 17425 // Upload a file drag-and-dropped into the editor. 17426 if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) { 17427 const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href); 17428 getSettings().mediaUpload({ 17429 filesList: [file], 17430 onFileChange: ([newMedia]) => onSelectFile(newMedia), 17431 onError: onUploadError 17432 }); 17433 (0,external_wp_blob_namespaceObject.revokeBlobURL)(href); 17434 } 17435 if (external_wp_blockEditor_namespaceObject.RichText.isEmpty(downloadButtonText)) { 17436 setAttributes({ 17437 downloadButtonText: (0,external_wp_i18n_namespaceObject._x)('Download', 'button label') 17438 }); 17439 } 17440 }, []); 17441 function onSelectFile(newMedia) { 17442 if (!newMedia || !newMedia.url) { 17443 return; 17444 } 17445 const isPdf = newMedia.url.endsWith('.pdf'); 17446 setAttributes({ 17447 href: newMedia.url, 17448 fileName: newMedia.title, 17449 textLinkHref: newMedia.url, 17450 id: newMedia.id, 17451 displayPreview: isPdf ? true : undefined, 17452 previewHeight: isPdf ? 600 : undefined, 17453 fileId: `wp-block-file--media-$clientId}` 17454 }); 17455 } 17456 function onUploadError(message) { 17457 setAttributes({ 17458 href: undefined 17459 }); 17460 createErrorNotice(message, { 17461 type: 'snackbar' 17462 }); 17463 } 17464 function changeLinkDestinationOption(newHref) { 17465 // Choose Media File or Attachment Page (when file is in Media Library). 17466 setAttributes({ 17467 textLinkHref: newHref 17468 }); 17469 } 17470 function changeOpenInNewWindow(newValue) { 17471 setAttributes({ 17472 textLinkTarget: newValue ? '_blank' : false 17473 }); 17474 } 17475 function changeShowDownloadButton(newValue) { 17476 setAttributes({ 17477 showDownloadButton: newValue 17478 }); 17479 } 17480 function changeDisplayPreview(newValue) { 17481 setAttributes({ 17482 displayPreview: newValue 17483 }); 17484 } 17485 function handleOnResizeStop(event, direction, elt, delta) { 17486 toggleSelection(true); 17487 const newHeight = parseInt(previewHeight + delta.height, 10); 17488 setAttributes({ 17489 previewHeight: newHeight 17490 }); 17491 } 17492 function changePreviewHeight(newValue) { 17493 const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT); 17494 setAttributes({ 17495 previewHeight: newHeight 17496 }); 17497 } 17498 const attachmentPage = media && media.link; 17499 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 17500 className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({ 17501 type: 'loading' 17502 }), { 17503 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href) 17504 }) 17505 }); 17506 const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; 17507 if (!href) { 17508 return (0,external_React_namespaceObject.createElement)("div", { 17509 ...blockProps 17510 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 17511 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 17512 icon: library_file 17513 }), 17514 labels: { 17515 title: (0,external_wp_i18n_namespaceObject.__)('File'), 17516 instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.') 17517 }, 17518 onSelect: onSelectFile, 17519 onError: onUploadError, 17520 accept: "*" 17521 })); 17522 } 17523 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(FileBlockInspector, { 17524 hrefs: { 17525 href, 17526 textLinkHref, 17527 attachmentPage 17528 }, 17529 openInNewWindow: !!textLinkTarget, 17530 showDownloadButton, 17531 changeLinkDestinationOption, 17532 changeOpenInNewWindow, 17533 changeShowDownloadButton, 17534 displayPreview, 17535 changeDisplayPreview, 17536 previewHeight, 17537 changePreviewHeight 17538 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 17539 group: "other" 17540 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 17541 mediaId: id, 17542 mediaURL: href, 17543 accept: "*", 17544 onSelect: onSelectFile, 17545 onError: onUploadError 17546 }), (0,external_React_namespaceObject.createElement)(ClipboardToolbarButton, { 17547 text: href, 17548 disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href) 17549 })), (0,external_React_namespaceObject.createElement)("div", { 17550 ...blockProps 17551 }, displayPreviewInEditor && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 17552 size: { 17553 height: previewHeight 17554 }, 17555 minHeight: MIN_PREVIEW_HEIGHT, 17556 maxHeight: MAX_PREVIEW_HEIGHT, 17557 minWidth: "100%", 17558 grid: [10, 10], 17559 enable: { 17560 top: false, 17561 right: false, 17562 bottom: true, 17563 left: false, 17564 topRight: false, 17565 bottomRight: false, 17566 bottomLeft: false, 17567 topLeft: false 17568 }, 17569 onResizeStart: () => toggleSelection(false), 17570 onResizeStop: handleOnResizeStop, 17571 showHandle: isSelected 17572 }, (0,external_React_namespaceObject.createElement)("object", { 17573 className: "wp-block-file__preview", 17574 data: href, 17575 type: "application/pdf", 17576 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.') 17577 }), !isSelected && (0,external_React_namespaceObject.createElement)("div", { 17578 className: "wp-block-file__preview-overlay" 17579 })), (0,external_React_namespaceObject.createElement)("div", { 17580 className: 'wp-block-file__content-wrapper' 17581 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 17582 tagName: "a", 17583 value: fileName, 17584 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'), 17585 withoutInteractiveFormatting: true, 17586 onChange: text => setAttributes({ 17587 fileName: removeAnchorTag(text) 17588 }), 17589 href: textLinkHref 17590 }), showDownloadButton && (0,external_React_namespaceObject.createElement)("div", { 17591 className: 'wp-block-file__button-richtext-wrapper' 17592 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 17593 tagName: "div" // Must be block-level or else cursor disappears. 17594 , 17595 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'), 17596 className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 17597 value: downloadButtonText, 17598 withoutInteractiveFormatting: true, 17599 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'), 17600 onChange: text => setAttributes({ 17601 downloadButtonText: removeAnchorTag(text) 17602 }) 17603 }))))); 17604 } 17605 /* harmony default export */ const file_edit = (FileEdit); 17606 17607 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js 17608 17609 /** 17610 * External dependencies 17611 */ 17612 17613 17614 /** 17615 * WordPress dependencies 17616 */ 17617 17618 function file_save_save({ 17619 attributes 17620 }) { 17621 const { 17622 href, 17623 fileId, 17624 fileName, 17625 textLinkHref, 17626 textLinkTarget, 17627 showDownloadButton, 17628 downloadButtonText, 17629 displayPreview, 17630 previewHeight 17631 } = attributes; 17632 const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF embed' : 17633 // To do: use toPlainText, but we need ensure it's RichTextData. See 17634 // https://github.com/WordPress/gutenberg/pull/56710. 17635 fileName.toString(); 17636 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 17637 17638 // Only output an `aria-describedby` when the element it's referring to is 17639 // actually rendered. 17640 const describedById = hasFilename ? fileId : undefined; 17641 return href && (0,external_React_namespaceObject.createElement)("div", { 17642 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 17643 }, displayPreview && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("object", { 17644 className: "wp-block-file__embed", 17645 data: href, 17646 type: "application/pdf", 17647 style: { 17648 width: '100%', 17649 height: `$previewHeight}px` 17650 }, 17651 "aria-label": pdfEmbedLabel 17652 })), hasFilename && (0,external_React_namespaceObject.createElement)("a", { 17653 id: describedById, 17654 href: textLinkHref, 17655 target: textLinkTarget, 17656 rel: textLinkTarget ? 'noreferrer noopener' : undefined 17657 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17658 value: fileName 17659 })), showDownloadButton && (0,external_React_namespaceObject.createElement)("a", { 17660 href: href, 17661 className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 17662 download: true, 17663 "aria-describedby": describedById 17664 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17665 value: downloadButtonText 17666 }))); 17667 } 17668 17669 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js 17670 /** 17671 * WordPress dependencies 17672 */ 17673 17674 17675 17676 17677 17678 const file_transforms_transforms = { 17679 from: [{ 17680 type: 'files', 17681 isMatch(files) { 17682 return files.length > 0; 17683 }, 17684 // We define a lower priorty (higher number) than the default of 10. This 17685 // ensures that the File block is only created as a fallback. 17686 priority: 15, 17687 transform: files => { 17688 const blocks = []; 17689 files.forEach(file => { 17690 const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); 17691 17692 // File will be uploaded in componentDidMount() 17693 blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 17694 href: blobURL, 17695 fileName: file.name, 17696 textLinkHref: blobURL 17697 })); 17698 }); 17699 return blocks; 17700 } 17701 }, { 17702 type: 'block', 17703 blocks: ['core/audio'], 17704 transform: attributes => { 17705 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 17706 href: attributes.src, 17707 fileName: attributes.caption, 17708 textLinkHref: attributes.src, 17709 id: attributes.id, 17710 anchor: attributes.anchor 17711 }); 17712 } 17713 }, { 17714 type: 'block', 17715 blocks: ['core/video'], 17716 transform: attributes => { 17717 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 17718 href: attributes.src, 17719 fileName: attributes.caption, 17720 textLinkHref: attributes.src, 17721 id: attributes.id, 17722 anchor: attributes.anchor 17723 }); 17724 } 17725 }, { 17726 type: 'block', 17727 blocks: ['core/image'], 17728 transform: attributes => { 17729 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 17730 href: attributes.url, 17731 fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url), 17732 textLinkHref: attributes.url, 17733 id: attributes.id, 17734 anchor: attributes.anchor 17735 }); 17736 } 17737 }], 17738 to: [{ 17739 type: 'block', 17740 blocks: ['core/audio'], 17741 isMatch: ({ 17742 id 17743 }) => { 17744 if (!id) { 17745 return false; 17746 } 17747 const { 17748 getMedia 17749 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 17750 const media = getMedia(id); 17751 return !!media && media.mime_type.includes('audio'); 17752 }, 17753 transform: attributes => { 17754 return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { 17755 src: attributes.href, 17756 caption: attributes.fileName, 17757 id: attributes.id, 17758 anchor: attributes.anchor 17759 }); 17760 } 17761 }, { 17762 type: 'block', 17763 blocks: ['core/video'], 17764 isMatch: ({ 17765 id 17766 }) => { 17767 if (!id) { 17768 return false; 17769 } 17770 const { 17771 getMedia 17772 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 17773 const media = getMedia(id); 17774 return !!media && media.mime_type.includes('video'); 17775 }, 17776 transform: attributes => { 17777 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 17778 src: attributes.href, 17779 caption: attributes.fileName, 17780 id: attributes.id, 17781 anchor: attributes.anchor 17782 }); 17783 } 17784 }, { 17785 type: 'block', 17786 blocks: ['core/image'], 17787 isMatch: ({ 17788 id 17789 }) => { 17790 if (!id) { 17791 return false; 17792 } 17793 const { 17794 getMedia 17795 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 17796 const media = getMedia(id); 17797 return !!media && media.mime_type.includes('image'); 17798 }, 17799 transform: attributes => { 17800 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 17801 url: attributes.href, 17802 caption: attributes.fileName, 17803 id: attributes.id, 17804 anchor: attributes.anchor 17805 }); 17806 } 17807 }] 17808 }; 17809 /* harmony default export */ const file_transforms = (file_transforms_transforms); 17810 17811 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js 17812 /** 17813 * WordPress dependencies 17814 */ 17815 17816 17817 17818 /** 17819 * Internal dependencies 17820 */ 17821 17822 17823 17824 const file_metadata = { 17825 $schema: "https://schemas.wp.org/trunk/block.json", 17826 apiVersion: 3, 17827 name: "core/file", 17828 title: "File", 17829 category: "media", 17830 description: "Add a link to a downloadable file.", 17831 keywords: ["document", "pdf", "download"], 17832 textdomain: "default", 17833 attributes: { 17834 id: { 17835 type: "number" 17836 }, 17837 href: { 17838 type: "string" 17839 }, 17840 fileId: { 17841 type: "string", 17842 source: "attribute", 17843 selector: "a:not([download])", 17844 attribute: "id" 17845 }, 17846 fileName: { 17847 type: "rich-text", 17848 source: "rich-text", 17849 selector: "a:not([download])" 17850 }, 17851 textLinkHref: { 17852 type: "string", 17853 source: "attribute", 17854 selector: "a:not([download])", 17855 attribute: "href" 17856 }, 17857 textLinkTarget: { 17858 type: "string", 17859 source: "attribute", 17860 selector: "a:not([download])", 17861 attribute: "target" 17862 }, 17863 showDownloadButton: { 17864 type: "boolean", 17865 "default": true 17866 }, 17867 downloadButtonText: { 17868 type: "rich-text", 17869 source: "rich-text", 17870 selector: "a[download]" 17871 }, 17872 displayPreview: { 17873 type: "boolean" 17874 }, 17875 previewHeight: { 17876 type: "number", 17877 "default": 600 17878 } 17879 }, 17880 supports: { 17881 anchor: true, 17882 align: true, 17883 spacing: { 17884 margin: true, 17885 padding: true 17886 }, 17887 color: { 17888 gradients: true, 17889 link: true, 17890 text: false, 17891 __experimentalDefaultControls: { 17892 background: true, 17893 link: true 17894 } 17895 }, 17896 interactivity: true 17897 }, 17898 editorStyle: "wp-block-file-editor", 17899 style: "wp-block-file" 17900 }; 17901 17902 17903 const { 17904 name: file_name 17905 } = file_metadata; 17906 17907 const file_settings = { 17908 icon: library_file, 17909 example: { 17910 attributes: { 17911 href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg', 17912 fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file') 17913 } 17914 }, 17915 transforms: file_transforms, 17916 deprecated: file_deprecated, 17917 edit: file_edit, 17918 save: file_save_save 17919 }; 17920 const file_init = () => initBlock({ 17921 name: file_name, 17922 metadata: file_metadata, 17923 settings: file_settings 17924 }); 17925 17926 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/utils.js 17927 /** 17928 * WordPress dependencies 17929 */ 17930 17931 const formSubmissionNotificationSuccess = ['core/form-submission-notification', { 17932 type: 'success' 17933 }, [['core/paragraph', { 17934 content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully') + '</mark>' 17935 }]]]; 17936 const formSubmissionNotificationError = ['core/form-submission-notification', { 17937 type: 'error' 17938 }, [['core/paragraph', { 17939 content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.') + '</mark>' 17940 }]]]; 17941 17942 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/edit.js 17943 17944 /** 17945 * WordPress dependencies 17946 */ 17947 17948 17949 17950 17951 17952 /** 17953 * Internal dependencies 17954 */ 17955 17956 const form_edit_TEMPLATE = [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/form-input', { 17957 type: 'text', 17958 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 17959 required: true 17960 }], ['core/form-input', { 17961 type: 'email', 17962 label: (0,external_wp_i18n_namespaceObject.__)('Email'), 17963 required: true 17964 }], ['core/form-input', { 17965 type: 'textarea', 17966 label: (0,external_wp_i18n_namespaceObject.__)('Comment'), 17967 required: true 17968 }], ['core/form-submit-button', {}]]; 17969 const form_edit_Edit = ({ 17970 attributes, 17971 setAttributes, 17972 clientId 17973 }) => { 17974 const { 17975 action, 17976 method, 17977 email, 17978 submissionMethod 17979 } = attributes; 17980 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 17981 const { 17982 hasInnerBlocks 17983 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 17984 const { 17985 getBlock 17986 } = select(external_wp_blockEditor_namespaceObject.store); 17987 const block = getBlock(clientId); 17988 return { 17989 hasInnerBlocks: !!(block && block.innerBlocks.length) 17990 }; 17991 }, [clientId]); 17992 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 17993 template: form_edit_TEMPLATE, 17994 renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 17995 }); 17996 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 17997 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 17998 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl 17999 // __nextHasNoMarginBottom 18000 // size={ '__unstable-large' } 18001 , { 18002 label: (0,external_wp_i18n_namespaceObject.__)('Submissions method'), 18003 options: [ 18004 // TODO: Allow plugins to add their own submission methods. 18005 { 18006 label: (0,external_wp_i18n_namespaceObject.__)('Send email'), 18007 value: 'email' 18008 }, { 18009 label: (0,external_wp_i18n_namespaceObject.__)('- Custom -'), 18010 value: 'custom' 18011 }], 18012 value: submissionMethod, 18013 onChange: value => setAttributes({ 18014 submissionMethod: value 18015 }), 18016 help: submissionMethod === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') 18017 }), submissionMethod === 'email' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 18018 __nextHasNoMarginBottom: true, 18019 autoComplete: "off", 18020 label: (0,external_wp_i18n_namespaceObject.__)('Email for form submissions'), 18021 value: email, 18022 required: true, 18023 onChange: value => { 18024 setAttributes({ 18025 email: value 18026 }); 18027 setAttributes({ 18028 action: `mailto:$value}` 18029 }); 18030 setAttributes({ 18031 method: 'post' 18032 }); 18033 }, 18034 help: (0,external_wp_i18n_namespaceObject.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.') 18035 }))), submissionMethod !== 'email' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 18036 group: "advanced" 18037 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 18038 __nextHasNoMarginBottom: true, 18039 label: (0,external_wp_i18n_namespaceObject.__)('Method'), 18040 options: [{ 18041 label: 'Get', 18042 value: 'get' 18043 }, { 18044 label: 'Post', 18045 value: 'post' 18046 }], 18047 value: method, 18048 onChange: value => setAttributes({ 18049 method: value 18050 }), 18051 help: (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') 18052 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 18053 __nextHasNoMarginBottom: true, 18054 autoComplete: "off", 18055 label: (0,external_wp_i18n_namespaceObject.__)('Form action'), 18056 value: action, 18057 onChange: newVal => { 18058 setAttributes({ 18059 action: newVal 18060 }); 18061 }, 18062 help: (0,external_wp_i18n_namespaceObject.__)('The URL where the form should be submitted.') 18063 })), (0,external_React_namespaceObject.createElement)("form", { 18064 ...innerBlocksProps, 18065 className: "wp-block-form", 18066 encType: submissionMethod === 'email' ? 'text/plain' : null 18067 })); 18068 }; 18069 /* harmony default export */ const form_edit = (form_edit_Edit); 18070 18071 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/save.js 18072 18073 /** 18074 * WordPress dependencies 18075 */ 18076 18077 const Save = ({ 18078 attributes 18079 }) => { 18080 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 18081 const { 18082 submissionMethod 18083 } = attributes; 18084 return (0,external_React_namespaceObject.createElement)("form", { 18085 ...blockProps, 18086 className: "wp-block-form", 18087 encType: submissionMethod === 'email' ? 'text/plain' : null 18088 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 18089 }; 18090 /* harmony default export */ const form_save = (Save); 18091 18092 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/variations.js 18093 /** 18094 * WordPress dependencies 18095 */ 18096 18097 /** 18098 * Internal dependencies 18099 */ 18100 18101 const form_variations_variations = [{ 18102 name: 'comment-form', 18103 title: (0,external_wp_i18n_namespaceObject.__)('Experimental Comment form'), 18104 description: (0,external_wp_i18n_namespaceObject.__)('A comment form for posts and pages.'), 18105 attributes: { 18106 submissionMethod: 'custom', 18107 action: '{SITE_URL}/wp-comments-post.php', 18108 method: 'post', 18109 anchor: 'comment-form' 18110 }, 18111 isDefault: false, 18112 innerBlocks: [['core/form-input', { 18113 type: 'text', 18114 name: 'author', 18115 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 18116 required: true, 18117 visibilityPermissions: 'logged-out' 18118 }], ['core/form-input', { 18119 type: 'email', 18120 name: 'email', 18121 label: (0,external_wp_i18n_namespaceObject.__)('Email'), 18122 required: true, 18123 visibilityPermissions: 'logged-out' 18124 }], ['core/form-input', { 18125 type: 'textarea', 18126 name: 'comment', 18127 label: (0,external_wp_i18n_namespaceObject.__)('Comment'), 18128 required: true, 18129 visibilityPermissions: 'all' 18130 }], ['core/form-submit-button', {}]], 18131 scope: ['inserter', 'transform'], 18132 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 18133 }, { 18134 name: 'wp-privacy-form', 18135 title: (0,external_wp_i18n_namespaceObject.__)('Experimental privacy request form'), 18136 keywords: ['GDPR'], 18137 description: (0,external_wp_i18n_namespaceObject.__)('A form to request data exports and/or deletion.'), 18138 attributes: { 18139 submissionMethod: 'custom', 18140 action: '', 18141 method: 'post', 18142 anchor: 'gdpr-form' 18143 }, 18144 isDefault: false, 18145 innerBlocks: [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/paragraph', { 18146 content: (0,external_wp_i18n_namespaceObject.__)('To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.') 18147 }], ['core/form-input', { 18148 type: 'email', 18149 name: 'email', 18150 label: (0,external_wp_i18n_namespaceObject.__)('Enter your email address.'), 18151 required: true, 18152 visibilityPermissions: 'all' 18153 }], ['core/form-input', { 18154 type: 'checkbox', 18155 name: 'export_personal_data', 18156 label: (0,external_wp_i18n_namespaceObject.__)('Request data export'), 18157 required: false, 18158 visibilityPermissions: 'all' 18159 }], ['core/form-input', { 18160 type: 'checkbox', 18161 name: 'remove_personal_data', 18162 label: (0,external_wp_i18n_namespaceObject.__)('Request data deletion'), 18163 required: false, 18164 visibilityPermissions: 'all' 18165 }], ['core/form-submit-button', {}], ['core/form-input', { 18166 type: 'hidden', 18167 name: 'wp-action', 18168 value: 'wp_privacy_send_request' 18169 }], ['core/form-input', { 18170 type: 'hidden', 18171 name: 'wp-privacy-request', 18172 value: '1' 18173 }]], 18174 scope: ['inserter', 'transform'], 18175 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 18176 }]; 18177 /* harmony default export */ const form_variations = (form_variations_variations); 18178 18179 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/index.js 18180 /** 18181 * Internal dependencies 18182 */ 18183 18184 18185 const form_metadata = { 18186 $schema: "https://schemas.wp.org/trunk/block.json", 18187 apiVersion: 3, 18188 __experimental: true, 18189 name: "core/form", 18190 title: "Form", 18191 category: "common", 18192 allowedBlocks: ["core/paragraph", "core/heading", "core/form-input", "core/form-submit-button", "core/form-submission-notification", "core/group", "core/columns"], 18193 description: "A form.", 18194 keywords: ["container", "wrapper", "row", "section"], 18195 textdomain: "default", 18196 icon: "feedback", 18197 attributes: { 18198 submissionMethod: { 18199 type: "string", 18200 "default": "email" 18201 }, 18202 method: { 18203 type: "string", 18204 "default": "post" 18205 }, 18206 action: { 18207 type: "string" 18208 }, 18209 email: { 18210 type: "string" 18211 } 18212 }, 18213 supports: { 18214 anchor: true, 18215 className: false, 18216 color: { 18217 gradients: true, 18218 link: true, 18219 __experimentalDefaultControls: { 18220 background: true, 18221 text: true, 18222 link: true 18223 } 18224 }, 18225 spacing: { 18226 margin: true, 18227 padding: true 18228 }, 18229 typography: { 18230 fontSize: true, 18231 lineHeight: true, 18232 __experimentalFontFamily: true, 18233 __experimentalTextDecoration: true, 18234 __experimentalFontStyle: true, 18235 __experimentalFontWeight: true, 18236 __experimentalLetterSpacing: true, 18237 __experimentalTextTransform: true, 18238 __experimentalDefaultControls: { 18239 fontSize: true 18240 } 18241 }, 18242 __experimentalSelector: "form" 18243 }, 18244 viewScript: "file:./view.min.js" 18245 }; 18246 18247 18248 18249 /** 18250 * WordPress dependencies 18251 */ 18252 18253 const { 18254 name: form_name 18255 } = form_metadata; 18256 18257 const form_settings = { 18258 edit: form_edit, 18259 save: form_save, 18260 variations: form_variations 18261 }; 18262 const form_init = () => { 18263 // Prevent adding forms inside forms. 18264 const DISALLOWED_PARENTS = ['core/form']; 18265 (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/preventInsertingFormIntoAnotherForm', (canInsert, blockType, rootClientId, { 18266 getBlock, 18267 getBlockParentsByBlockName 18268 }) => { 18269 if (blockType.name !== 'core/form') { 18270 return canInsert; 18271 } 18272 for (const disallowedParentType of DISALLOWED_PARENTS) { 18273 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; 18274 if (hasDisallowedParent) { 18275 return false; 18276 } 18277 } 18278 return true; 18279 }); 18280 return initBlock({ 18281 name: form_name, 18282 metadata: form_metadata, 18283 settings: form_settings 18284 }); 18285 }; 18286 18287 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js 18288 var remove_accents = __webpack_require__(9681); 18289 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); 18290 ;// CONCATENATED MODULE: external ["wp","dom"] 18291 const external_wp_dom_namespaceObject = window["wp"]["dom"]; 18292 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/deprecated.js 18293 18294 /** 18295 * External dependencies 18296 */ 18297 18298 18299 18300 /** 18301 * WordPress dependencies 18302 */ 18303 18304 18305 const getNameFromLabelV1 = content => { 18306 return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) 18307 // Convert anything that's not a letter or number to a hyphen. 18308 .replace(/[^\p{L}\p{N}]+/gu, '-') 18309 // Convert to lowercase 18310 .toLowerCase() 18311 // Remove any remaining leading or trailing hyphens. 18312 .replace(/(^-+)|(-+$)/g, ''); 18313 }; 18314 18315 // Version without wrapper div in saved markup 18316 // See: https://github.com/WordPress/gutenberg/pull/56507 18317 const form_input_deprecated_v1 = { 18318 attributes: { 18319 type: { 18320 type: 'string', 18321 default: 'text' 18322 }, 18323 name: { 18324 type: 'string' 18325 }, 18326 label: { 18327 type: 'string', 18328 default: 'Label', 18329 selector: '.wp-block-form-input__label-content', 18330 source: 'html', 18331 __experimentalRole: 'content' 18332 }, 18333 inlineLabel: { 18334 type: 'boolean', 18335 default: false 18336 }, 18337 required: { 18338 type: 'boolean', 18339 default: false, 18340 selector: '.wp-block-form-input__input', 18341 source: 'attribute', 18342 attribute: 'required' 18343 }, 18344 placeholder: { 18345 type: 'string', 18346 selector: '.wp-block-form-input__input', 18347 source: 'attribute', 18348 attribute: 'placeholder', 18349 __experimentalRole: 'content' 18350 }, 18351 value: { 18352 type: 'string', 18353 default: '', 18354 selector: 'input', 18355 source: 'attribute', 18356 attribute: 'value' 18357 }, 18358 visibilityPermissions: { 18359 type: 'string', 18360 default: 'all' 18361 } 18362 }, 18363 supports: { 18364 className: false, 18365 anchor: true, 18366 reusable: false, 18367 spacing: { 18368 margin: ['top', 'bottom'] 18369 }, 18370 __experimentalBorder: { 18371 radius: true, 18372 __experimentalSkipSerialization: true, 18373 __experimentalDefaultControls: { 18374 radius: true 18375 } 18376 } 18377 }, 18378 save({ 18379 attributes 18380 }) { 18381 const { 18382 type, 18383 name, 18384 label, 18385 inlineLabel, 18386 required, 18387 placeholder, 18388 value 18389 } = attributes; 18390 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 18391 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 18392 const inputStyle = { 18393 ...borderProps.style, 18394 ...colorProps.style 18395 }; 18396 const inputClasses = classnames_default()('wp-block-form-input__input', colorProps.className, borderProps.className); 18397 const TagName = type === 'textarea' ? 'textarea' : 'input'; 18398 if ('hidden' === type) { 18399 return (0,external_React_namespaceObject.createElement)("input", { 18400 type: type, 18401 name: name, 18402 value: value 18403 }); 18404 } 18405 18406 /* eslint-disable jsx-a11y/label-has-associated-control */ 18407 return (0,external_React_namespaceObject.createElement)("label", { 18408 className: classnames_default()('wp-block-form-input__label', { 18409 'is-label-inline': inlineLabel 18410 }) 18411 }, (0,external_React_namespaceObject.createElement)("span", { 18412 className: "wp-block-form-input__label-content" 18413 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18414 value: label 18415 })), (0,external_React_namespaceObject.createElement)(TagName, { 18416 className: inputClasses, 18417 type: 'textarea' === type ? undefined : type, 18418 name: name || getNameFromLabelV1(label), 18419 required: required, 18420 "aria-required": required, 18421 placeholder: placeholder || undefined, 18422 style: inputStyle 18423 })); 18424 /* eslint-enable jsx-a11y/label-has-associated-control */ 18425 } 18426 }; 18427 const form_input_deprecated_deprecated = [form_input_deprecated_v1]; 18428 /* harmony default export */ const form_input_deprecated = (form_input_deprecated_deprecated); 18429 18430 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/edit.js 18431 18432 /** 18433 * External dependencies 18434 */ 18435 18436 18437 /** 18438 * WordPress dependencies 18439 */ 18440 18441 18442 18443 18444 function InputFieldBlock({ 18445 attributes, 18446 setAttributes, 18447 className 18448 }) { 18449 const { 18450 type, 18451 name, 18452 label, 18453 inlineLabel, 18454 required, 18455 placeholder, 18456 value 18457 } = attributes; 18458 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 18459 const ref = (0,external_wp_element_namespaceObject.useRef)(); 18460 const TagName = type === 'textarea' ? 'textarea' : 'input'; 18461 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 18462 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 18463 if (ref.current) { 18464 ref.current.focus(); 18465 } 18466 const controls = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, 'hidden' !== type && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 18467 title: (0,external_wp_i18n_namespaceObject.__)('Input settings') 18468 }, 'checkbox' !== type && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { 18469 label: (0,external_wp_i18n_namespaceObject.__)('Inline label'), 18470 checked: inlineLabel, 18471 onChange: newVal => { 18472 setAttributes({ 18473 inlineLabel: newVal 18474 }); 18475 } 18476 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, { 18477 label: (0,external_wp_i18n_namespaceObject.__)('Required'), 18478 checked: required, 18479 onChange: newVal => { 18480 setAttributes({ 18481 required: newVal 18482 }); 18483 } 18484 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 18485 group: "advanced" 18486 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 18487 autoComplete: "off", 18488 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 18489 value: name, 18490 onChange: newVal => { 18491 setAttributes({ 18492 name: newVal 18493 }); 18494 }, 18495 help: (0,external_wp_i18n_namespaceObject.__)('Affects the "name" atribute of the input element, and is used as a name for the form submission results.') 18496 }))); 18497 if ('hidden' === type) { 18498 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, controls, (0,external_React_namespaceObject.createElement)("input", { 18499 type: "hidden", 18500 className: classnames_default()(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), 18501 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Value'), 18502 value: value, 18503 onChange: event => setAttributes({ 18504 value: event.target.value 18505 }) 18506 })); 18507 } 18508 return (0,external_React_namespaceObject.createElement)("div", { 18509 ...blockProps 18510 }, controls, (0,external_React_namespaceObject.createElement)("span", { 18511 className: classnames_default()('wp-block-form-input__label', { 18512 'is-label-inline': inlineLabel || 'checkbox' === type 18513 }) 18514 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 18515 tagName: "span", 18516 className: "wp-block-form-input__label-content", 18517 value: label, 18518 onChange: newLabel => setAttributes({ 18519 label: newLabel 18520 }), 18521 "aria-label": label ? (0,external_wp_i18n_namespaceObject.__)('Label') : (0,external_wp_i18n_namespaceObject.__)('Empty label'), 18522 "data-empty": label ? false : true, 18523 placeholder: (0,external_wp_i18n_namespaceObject.__)('Type the label for this input') 18524 }), (0,external_React_namespaceObject.createElement)(TagName, { 18525 type: 'textarea' === type ? undefined : type, 18526 className: classnames_default()(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), 18527 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') 18528 // We hide the placeholder field's placeholder when there is a value. This 18529 // stops screen readers from reading the placeholder field's placeholder 18530 // which is confusing. 18531 , 18532 placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), 18533 value: placeholder, 18534 onChange: event => setAttributes({ 18535 placeholder: event.target.value 18536 }), 18537 "aria-required": required, 18538 style: { 18539 ...borderProps.style, 18540 ...colorProps.style 18541 } 18542 }))); 18543 } 18544 /* harmony default export */ const form_input_edit = (InputFieldBlock); 18545 18546 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/save.js 18547 18548 /** 18549 * External dependencies 18550 */ 18551 18552 18553 18554 /** 18555 * WordPress dependencies 18556 */ 18557 18558 18559 18560 /** 18561 * Get the name attribute from a content string. 18562 * 18563 * @param {string} content The block content. 18564 * 18565 * @return {string} Returns the slug. 18566 */ 18567 const getNameFromLabel = content => { 18568 return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) 18569 // Convert anything that's not a letter or number to a hyphen. 18570 .replace(/[^\p{L}\p{N}]+/gu, '-') 18571 // Convert to lowercase 18572 .toLowerCase() 18573 // Remove any remaining leading or trailing hyphens. 18574 .replace(/(^-+)|(-+$)/g, ''); 18575 }; 18576 function form_input_save_save({ 18577 attributes 18578 }) { 18579 const { 18580 type, 18581 name, 18582 label, 18583 inlineLabel, 18584 required, 18585 placeholder, 18586 value 18587 } = attributes; 18588 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 18589 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 18590 const inputStyle = { 18591 ...borderProps.style, 18592 ...colorProps.style 18593 }; 18594 const inputClasses = classnames_default()('wp-block-form-input__input', colorProps.className, borderProps.className); 18595 const TagName = type === 'textarea' ? 'textarea' : 'input'; 18596 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 18597 if ('hidden' === type) { 18598 return (0,external_React_namespaceObject.createElement)("input", { 18599 type: type, 18600 name: name, 18601 value: value 18602 }); 18603 } 18604 return (0,external_React_namespaceObject.createElement)("div", { 18605 ...blockProps 18606 }, (0,external_React_namespaceObject.createElement)("label", { 18607 className: classnames_default()('wp-block-form-input__label', { 18608 'is-label-inline': inlineLabel 18609 }) 18610 }, (0,external_React_namespaceObject.createElement)("span", { 18611 className: "wp-block-form-input__label-content" 18612 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18613 value: label 18614 })), (0,external_React_namespaceObject.createElement)(TagName, { 18615 className: inputClasses, 18616 type: 'textarea' === type ? undefined : type, 18617 name: name || getNameFromLabel(label), 18618 required: required, 18619 "aria-required": required, 18620 placeholder: placeholder || undefined, 18621 style: inputStyle 18622 }))); 18623 } 18624 18625 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/variations.js 18626 /** 18627 * WordPress dependencies 18628 */ 18629 18630 const form_input_variations_variations = [{ 18631 name: 'text', 18632 title: (0,external_wp_i18n_namespaceObject.__)('Text Input'), 18633 icon: 'edit-page', 18634 description: (0,external_wp_i18n_namespaceObject.__)('A generic text input.'), 18635 attributes: { 18636 type: 'text' 18637 }, 18638 isDefault: true, 18639 scope: ['inserter', 'transform'], 18640 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 18641 }, { 18642 name: 'textarea', 18643 title: (0,external_wp_i18n_namespaceObject.__)('Textarea Input'), 18644 icon: 'testimonial', 18645 description: (0,external_wp_i18n_namespaceObject.__)('A textarea input to allow entering multiple lines of text.'), 18646 attributes: { 18647 type: 'textarea' 18648 }, 18649 isDefault: true, 18650 scope: ['inserter', 'transform'], 18651 isActive: blockAttributes => blockAttributes?.type === 'textarea' 18652 }, { 18653 name: 'checkbox', 18654 title: (0,external_wp_i18n_namespaceObject.__)('Checkbox Input'), 18655 description: (0,external_wp_i18n_namespaceObject.__)('A simple checkbox input.'), 18656 icon: 'forms', 18657 attributes: { 18658 type: 'checkbox', 18659 inlineLabel: true 18660 }, 18661 isDefault: true, 18662 scope: ['inserter', 'transform'], 18663 isActive: blockAttributes => blockAttributes?.type === 'checkbox' 18664 }, { 18665 name: 'email', 18666 title: (0,external_wp_i18n_namespaceObject.__)('Email Input'), 18667 icon: 'email', 18668 description: (0,external_wp_i18n_namespaceObject.__)('Used for email addresses.'), 18669 attributes: { 18670 type: 'email' 18671 }, 18672 isDefault: true, 18673 scope: ['inserter', 'transform'], 18674 isActive: blockAttributes => blockAttributes?.type === 'email' 18675 }, { 18676 name: 'url', 18677 title: (0,external_wp_i18n_namespaceObject.__)('URL Input'), 18678 icon: 'admin-site', 18679 description: (0,external_wp_i18n_namespaceObject.__)('Used for URLs.'), 18680 attributes: { 18681 type: 'url' 18682 }, 18683 isDefault: true, 18684 scope: ['inserter', 'transform'], 18685 isActive: blockAttributes => blockAttributes?.type === 'url' 18686 }, { 18687 name: 'tel', 18688 title: (0,external_wp_i18n_namespaceObject.__)('Telephone Input'), 18689 icon: 'phone', 18690 description: (0,external_wp_i18n_namespaceObject.__)('Used for phone numbers.'), 18691 attributes: { 18692 type: 'tel' 18693 }, 18694 isDefault: true, 18695 scope: ['inserter', 'transform'], 18696 isActive: blockAttributes => blockAttributes?.type === 'tel' 18697 }, { 18698 name: 'number', 18699 title: (0,external_wp_i18n_namespaceObject.__)('Number Input'), 18700 icon: 'edit-page', 18701 description: (0,external_wp_i18n_namespaceObject.__)('A numeric input.'), 18702 attributes: { 18703 type: 'number' 18704 }, 18705 isDefault: true, 18706 scope: ['inserter', 'transform'], 18707 isActive: blockAttributes => blockAttributes?.type === 'number' 18708 }]; 18709 /* harmony default export */ const form_input_variations = (form_input_variations_variations); 18710 18711 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/index.js 18712 /** 18713 * Internal dependencies 18714 */ 18715 18716 18717 18718 const form_input_metadata = { 18719 $schema: "https://schemas.wp.org/trunk/block.json", 18720 apiVersion: 3, 18721 __experimental: true, 18722 name: "core/form-input", 18723 title: "Input Field", 18724 category: "common", 18725 ancestor: ["core/form"], 18726 description: "The basic building block for forms.", 18727 keywords: ["input", "form"], 18728 textdomain: "default", 18729 icon: "forms", 18730 attributes: { 18731 type: { 18732 type: "string", 18733 "default": "text" 18734 }, 18735 name: { 18736 type: "string" 18737 }, 18738 label: { 18739 type: "rich-text", 18740 "default": "Label", 18741 selector: ".wp-block-form-input__label-content", 18742 source: "rich-text", 18743 __experimentalRole: "content" 18744 }, 18745 inlineLabel: { 18746 type: "boolean", 18747 "default": false 18748 }, 18749 required: { 18750 type: "boolean", 18751 "default": false, 18752 selector: ".wp-block-form-input__input", 18753 source: "attribute", 18754 attribute: "required" 18755 }, 18756 placeholder: { 18757 type: "string", 18758 selector: ".wp-block-form-input__input", 18759 source: "attribute", 18760 attribute: "placeholder", 18761 __experimentalRole: "content" 18762 }, 18763 value: { 18764 type: "string", 18765 "default": "", 18766 selector: "input", 18767 source: "attribute", 18768 attribute: "value" 18769 }, 18770 visibilityPermissions: { 18771 type: "string", 18772 "default": "all" 18773 } 18774 }, 18775 supports: { 18776 anchor: true, 18777 reusable: false, 18778 spacing: { 18779 margin: ["top", "bottom"] 18780 }, 18781 __experimentalBorder: { 18782 radius: true, 18783 __experimentalSkipSerialization: true, 18784 __experimentalDefaultControls: { 18785 radius: true 18786 } 18787 } 18788 }, 18789 style: ["wp-block-form-input"] 18790 }; 18791 18792 18793 const { 18794 name: form_input_name 18795 } = form_input_metadata; 18796 18797 const form_input_settings = { 18798 deprecated: form_input_deprecated, 18799 edit: form_input_edit, 18800 save: form_input_save_save, 18801 variations: form_input_variations 18802 }; 18803 const form_input_init = () => initBlock({ 18804 name: form_input_name, 18805 metadata: form_input_metadata, 18806 settings: form_input_settings 18807 }); 18808 18809 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/edit.js 18810 18811 /** 18812 * WordPress dependencies 18813 */ 18814 18815 18816 const form_submit_button_edit_TEMPLATE = [['core/buttons', {}, [['core/button', { 18817 text: (0,external_wp_i18n_namespaceObject.__)('Submit'), 18818 tagName: 'button', 18819 type: 'submit' 18820 }]]]]; 18821 const form_submit_button_edit_Edit = () => { 18822 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 18823 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 18824 template: form_submit_button_edit_TEMPLATE, 18825 templateLock: 'all' 18826 }); 18827 return (0,external_React_namespaceObject.createElement)("div", { 18828 className: "wp-block-form-submit-wrapper", 18829 ...innerBlocksProps 18830 }); 18831 }; 18832 /* harmony default export */ const form_submit_button_edit = (form_submit_button_edit_Edit); 18833 18834 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/save.js 18835 18836 /** 18837 * WordPress dependencies 18838 */ 18839 18840 const save_Save = () => { 18841 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 18842 return (0,external_React_namespaceObject.createElement)("div", { 18843 className: "wp-block-form-submit-wrapper", 18844 ...blockProps 18845 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 18846 }; 18847 /* harmony default export */ const form_submit_button_save = (save_Save); 18848 18849 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js 18850 /** 18851 * Internal dependencies 18852 */ 18853 18854 18855 const form_submit_button_metadata = { 18856 $schema: "https://schemas.wp.org/trunk/block.json", 18857 apiVersion: 3, 18858 __experimental: true, 18859 name: "core/form-submit-button", 18860 title: "Form Submit Button", 18861 category: "common", 18862 icon: "button", 18863 ancestor: ["core/form"], 18864 allowedBlocks: ["core/buttons", "core/button"], 18865 description: "A submission button for forms.", 18866 keywords: ["submit", "button", "form"], 18867 textdomain: "default", 18868 style: ["wp-block-form-submit-button"] 18869 }; 18870 18871 const { 18872 name: form_submit_button_name 18873 } = form_submit_button_metadata; 18874 18875 const form_submit_button_settings = { 18876 edit: form_submit_button_edit, 18877 save: form_submit_button_save 18878 }; 18879 const form_submit_button_init = () => initBlock({ 18880 name: form_submit_button_name, 18881 metadata: form_submit_button_metadata, 18882 settings: form_submit_button_settings 18883 }); 18884 18885 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js 18886 18887 /** 18888 * WordPress dependencies 18889 */ 18890 18891 const group = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 18892 viewBox: "0 0 24 24", 18893 xmlns: "http://www.w3.org/2000/svg" 18894 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 18895 d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" 18896 })); 18897 /* harmony default export */ const library_group = (group); 18898 18899 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/edit.js 18900 18901 /** 18902 * WordPress dependencies 18903 */ 18904 18905 18906 18907 18908 /** 18909 * External dependencies 18910 */ 18911 18912 const form_submission_notification_edit_TEMPLATE = [['core/paragraph', { 18913 content: (0,external_wp_i18n_namespaceObject.__)("Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.") 18914 }]]; 18915 const form_submission_notification_edit_Edit = ({ 18916 attributes, 18917 clientId 18918 }) => { 18919 const { 18920 type 18921 } = attributes; 18922 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 18923 className: classnames_default()('wp-block-form-submission-notification', { 18924 [`form-notification-type-$type}`]: type 18925 }) 18926 }); 18927 const { 18928 hasInnerBlocks 18929 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 18930 const { 18931 getBlock 18932 } = select(external_wp_blockEditor_namespaceObject.store); 18933 const block = getBlock(clientId); 18934 return { 18935 hasInnerBlocks: !!(block && block.innerBlocks.length) 18936 }; 18937 }, [clientId]); 18938 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 18939 template: form_submission_notification_edit_TEMPLATE, 18940 renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 18941 }); 18942 return (0,external_React_namespaceObject.createElement)("div", { 18943 ...innerBlocksProps, 18944 "data-message-success": (0,external_wp_i18n_namespaceObject.__)('Submission success notification'), 18945 "data-message-error": (0,external_wp_i18n_namespaceObject.__)('Submission error notification') 18946 }); 18947 }; 18948 /* harmony default export */ const form_submission_notification_edit = (form_submission_notification_edit_Edit); 18949 18950 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/save.js 18951 18952 /** 18953 * WordPress dependencies 18954 */ 18955 18956 18957 /** 18958 * External dependencies 18959 */ 18960 18961 function form_submission_notification_save_save({ 18962 attributes 18963 }) { 18964 const { 18965 type 18966 } = attributes; 18967 return (0,external_React_namespaceObject.createElement)("div", { 18968 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save({ 18969 className: classnames_default()('wp-block-form-submission-notification', { 18970 [`form-notification-type-$type}`]: type 18971 }) 18972 })) 18973 }); 18974 } 18975 18976 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/variations.js 18977 /** 18978 * WordPress dependencies 18979 */ 18980 18981 const form_submission_notification_variations_variations = [{ 18982 name: 'form-submission-success', 18983 title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Success'), 18984 description: (0,external_wp_i18n_namespaceObject.__)('Success message for form submissions.'), 18985 attributes: { 18986 type: 'success' 18987 }, 18988 isDefault: true, 18989 innerBlocks: [['core/paragraph', { 18990 content: (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully.'), 18991 backgroundColor: '#00D084', 18992 textColor: '#000000', 18993 style: { 18994 elements: { 18995 link: { 18996 color: { 18997 text: '#000000' 18998 } 18999 } 19000 } 19001 } 19002 }]], 19003 scope: ['inserter', 'transform'], 19004 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'success' 19005 }, { 19006 name: 'form-submission-error', 19007 title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Error'), 19008 description: (0,external_wp_i18n_namespaceObject.__)('Error/failure message for form submissions.'), 19009 attributes: { 19010 type: 'error' 19011 }, 19012 isDefault: false, 19013 innerBlocks: [['core/paragraph', { 19014 content: (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.'), 19015 backgroundColor: '#CF2E2E', 19016 textColor: '#FFFFFF', 19017 style: { 19018 elements: { 19019 link: { 19020 color: { 19021 text: '#FFFFFF' 19022 } 19023 } 19024 } 19025 } 19026 }]], 19027 scope: ['inserter', 'transform'], 19028 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'error' 19029 }]; 19030 /* harmony default export */ const form_submission_notification_variations = (form_submission_notification_variations_variations); 19031 19032 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js 19033 /** 19034 * WordPress dependencies 19035 */ 19036 19037 19038 /** 19039 * Internal dependencies 19040 */ 19041 19042 19043 const form_submission_notification_metadata = { 19044 $schema: "https://schemas.wp.org/trunk/block.json", 19045 apiVersion: 3, 19046 __experimental: true, 19047 name: "core/form-submission-notification", 19048 title: "Form Submission Notification", 19049 category: "common", 19050 ancestor: ["core/form"], 19051 description: "Provide a notification message after the form has been submitted.", 19052 keywords: ["form", "feedback", "notification", "message"], 19053 textdomain: "default", 19054 icon: "feedback", 19055 attributes: { 19056 type: { 19057 type: "string", 19058 "default": "success" 19059 } 19060 } 19061 }; 19062 19063 19064 const { 19065 name: form_submission_notification_name 19066 } = form_submission_notification_metadata; 19067 19068 const form_submission_notification_settings = { 19069 icon: library_group, 19070 edit: form_submission_notification_edit, 19071 save: form_submission_notification_save_save, 19072 variations: form_submission_notification_variations 19073 }; 19074 const form_submission_notification_init = () => initBlock({ 19075 name: form_submission_notification_name, 19076 metadata: form_submission_notification_metadata, 19077 settings: form_submission_notification_settings 19078 }); 19079 19080 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js 19081 19082 /** 19083 * WordPress dependencies 19084 */ 19085 19086 const gallery = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 19087 viewBox: "0 0 24 24", 19088 xmlns: "http://www.w3.org/2000/svg" 19089 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 19090 d: "M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z", 19091 fillRule: "evenodd", 19092 clipRule: "evenodd" 19093 })); 19094 /* harmony default export */ const library_gallery = (gallery); 19095 19096 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js 19097 const LINK_DESTINATION_NONE = 'none'; 19098 const LINK_DESTINATION_MEDIA = 'media'; 19099 const LINK_DESTINATION_ATTACHMENT = 'attachment'; 19100 const LINK_DESTINATION_MEDIA_WP_CORE = 'file'; 19101 const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post'; 19102 19103 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js 19104 /** 19105 * WordPress dependencies 19106 */ 19107 19108 function defaultColumnsNumber(imageCount) { 19109 return imageCount ? Math.min(3, imageCount) : 3; 19110 } 19111 const pickRelevantMediaFiles = (image, sizeSlug = 'large') => { 19112 const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link'].includes(key))); 19113 imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; 19114 const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; 19115 if (fullUrl) { 19116 imageProps.fullUrl = fullUrl; 19117 } 19118 return imageProps; 19119 }; 19120 function getGalleryBlockV2Enabled() { 19121 // We want to fail early here, at least during beta testing phase, to ensure 19122 // there aren't instances where undefined values cause false negatives. 19123 if (!window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean') { 19124 throw 'window.wp.galleryBlockV2Enabled is not defined'; 19125 } 19126 return window.wp.galleryBlockV2Enabled; 19127 } 19128 19129 /** 19130 * The new gallery block format is not compatible with the use_BalanceTags option 19131 * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The 19132 * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method 19133 * can be removed when minimum supported WP version >=5.9. 19134 */ 19135 function isGalleryV2Enabled() { 19136 if (external_wp_element_namespaceObject.Platform.isNative) { 19137 return getGalleryBlockV2Enabled(); 19138 } 19139 return true; 19140 } 19141 19142 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js 19143 19144 /** 19145 * External dependencies 19146 */ 19147 19148 19149 /** 19150 * WordPress dependencies 19151 */ 19152 19153 19154 19155 /** 19156 * Internal dependencies 19157 */ 19158 19159 19160 const DEPRECATED_LINK_DESTINATION_MEDIA = 'file'; 19161 const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post'; 19162 19163 /** 19164 * Original function to determine default number of columns from a block's 19165 * attributes. 19166 * 19167 * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks. 19168 * 19169 * @param {Object} attributes Block attributes. 19170 * @return {number} Default number of columns for the gallery. 19171 */ 19172 function defaultColumnsNumberV1(attributes) { 19173 return Math.min(3, attributes?.images?.length); 19174 } 19175 19176 /** 19177 * Original function to determine new href and linkDestination values for an image block from the 19178 * supplied Gallery link destination. 19179 * 19180 * Used in deprecations: v1-6. 19181 * 19182 * @param {Object} image Gallery image. 19183 * @param {string} destination Gallery's selected link destination. 19184 * @return {Object} New attributes to assign to image block. 19185 */ 19186 function getHrefAndDestination(image, destination) { 19187 // Need to determine the URL that the selected destination maps to. 19188 // Gutenberg and WordPress use different constants so the new link 19189 // destination also needs to be tweaked. 19190 switch (destination) { 19191 case DEPRECATED_LINK_DESTINATION_MEDIA: 19192 return { 19193 href: image?.source_url || image?.url, 19194 // eslint-disable-line camelcase 19195 linkDestination: LINK_DESTINATION_MEDIA 19196 }; 19197 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 19198 return { 19199 href: image?.link, 19200 linkDestination: LINK_DESTINATION_ATTACHMENT 19201 }; 19202 case LINK_DESTINATION_MEDIA: 19203 return { 19204 href: image?.source_url || image?.url, 19205 // eslint-disable-line camelcase 19206 linkDestination: LINK_DESTINATION_MEDIA 19207 }; 19208 case LINK_DESTINATION_ATTACHMENT: 19209 return { 19210 href: image?.link, 19211 linkDestination: LINK_DESTINATION_ATTACHMENT 19212 }; 19213 case LINK_DESTINATION_NONE: 19214 return { 19215 href: undefined, 19216 linkDestination: LINK_DESTINATION_NONE 19217 }; 19218 } 19219 return {}; 19220 } 19221 function runV2Migration(attributes) { 19222 let linkTo = attributes.linkTo ? attributes.linkTo : 'none'; 19223 if (linkTo === 'post') { 19224 linkTo = 'attachment'; 19225 } else if (linkTo === 'file') { 19226 linkTo = 'media'; 19227 } 19228 const imageBlocks = attributes.images.map(image => { 19229 return getImageBlock(image, attributes.sizeSlug, linkTo); 19230 }); 19231 const { 19232 images, 19233 ids, 19234 ...restAttributes 19235 } = attributes; 19236 return [{ 19237 ...restAttributes, 19238 linkTo, 19239 allowResize: false 19240 }, imageBlocks]; 19241 } 19242 /** 19243 * Gets an Image block from gallery image data 19244 * 19245 * Used to migrate Galleries to nested Image InnerBlocks. 19246 * 19247 * @param {Object} image Image properties. 19248 * @param {string} sizeSlug Gallery sizeSlug attribute. 19249 * @param {string} linkTo Gallery linkTo attribute. 19250 * @return {Object} Image block. 19251 */ 19252 function getImageBlock(image, sizeSlug, linkTo) { 19253 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 19254 ...(image.id && { 19255 id: parseInt(image.id) 19256 }), 19257 url: image.url, 19258 alt: image.alt, 19259 caption: image.caption, 19260 sizeSlug, 19261 ...getHrefAndDestination(image, linkTo) 19262 }); 19263 } 19264 19265 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 19266 // to the gallery figcaption element. 19267 const deprecated_v7 = { 19268 attributes: { 19269 images: { 19270 type: 'array', 19271 default: [], 19272 source: 'query', 19273 selector: '.blocks-gallery-item', 19274 query: { 19275 url: { 19276 type: 'string', 19277 source: 'attribute', 19278 selector: 'img', 19279 attribute: 'src' 19280 }, 19281 fullUrl: { 19282 type: 'string', 19283 source: 'attribute', 19284 selector: 'img', 19285 attribute: 'data-full-url' 19286 }, 19287 link: { 19288 type: 'string', 19289 source: 'attribute', 19290 selector: 'img', 19291 attribute: 'data-link' 19292 }, 19293 alt: { 19294 type: 'string', 19295 source: 'attribute', 19296 selector: 'img', 19297 attribute: 'alt', 19298 default: '' 19299 }, 19300 id: { 19301 type: 'string', 19302 source: 'attribute', 19303 selector: 'img', 19304 attribute: 'data-id' 19305 }, 19306 caption: { 19307 type: 'string', 19308 source: 'html', 19309 selector: '.blocks-gallery-item__caption' 19310 } 19311 } 19312 }, 19313 ids: { 19314 type: 'array', 19315 items: { 19316 type: 'number' 19317 }, 19318 default: [] 19319 }, 19320 shortCodeTransforms: { 19321 type: 'array', 19322 default: [], 19323 items: { 19324 type: 'object' 19325 } 19326 }, 19327 columns: { 19328 type: 'number', 19329 minimum: 1, 19330 maximum: 8 19331 }, 19332 caption: { 19333 type: 'string', 19334 source: 'html', 19335 selector: '.blocks-gallery-caption' 19336 }, 19337 imageCrop: { 19338 type: 'boolean', 19339 default: true 19340 }, 19341 fixedHeight: { 19342 type: 'boolean', 19343 default: true 19344 }, 19345 linkTarget: { 19346 type: 'string' 19347 }, 19348 linkTo: { 19349 type: 'string' 19350 }, 19351 sizeSlug: { 19352 type: 'string', 19353 default: 'large' 19354 }, 19355 allowResize: { 19356 type: 'boolean', 19357 default: false 19358 } 19359 }, 19360 save({ 19361 attributes 19362 }) { 19363 const { 19364 caption, 19365 columns, 19366 imageCrop 19367 } = attributes; 19368 const className = classnames_default()('has-nested-images', { 19369 [`columns-$columns}`]: columns !== undefined, 19370 [`columns-default`]: columns === undefined, 19371 'is-cropped': imageCrop 19372 }); 19373 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 19374 className 19375 }); 19376 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 19377 return (0,external_React_namespaceObject.createElement)("figure", { 19378 ...innerBlocksProps 19379 }, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19380 tagName: "figcaption", 19381 className: "blocks-gallery-caption", 19382 value: caption 19383 })); 19384 } 19385 }; 19386 const deprecated_v6 = { 19387 attributes: { 19388 images: { 19389 type: 'array', 19390 default: [], 19391 source: 'query', 19392 selector: '.blocks-gallery-item', 19393 query: { 19394 url: { 19395 type: 'string', 19396 source: 'attribute', 19397 selector: 'img', 19398 attribute: 'src' 19399 }, 19400 fullUrl: { 19401 type: 'string', 19402 source: 'attribute', 19403 selector: 'img', 19404 attribute: 'data-full-url' 19405 }, 19406 link: { 19407 type: 'string', 19408 source: 'attribute', 19409 selector: 'img', 19410 attribute: 'data-link' 19411 }, 19412 alt: { 19413 type: 'string', 19414 source: 'attribute', 19415 selector: 'img', 19416 attribute: 'alt', 19417 default: '' 19418 }, 19419 id: { 19420 type: 'string', 19421 source: 'attribute', 19422 selector: 'img', 19423 attribute: 'data-id' 19424 }, 19425 caption: { 19426 type: 'string', 19427 source: 'html', 19428 selector: '.blocks-gallery-item__caption' 19429 } 19430 } 19431 }, 19432 ids: { 19433 type: 'array', 19434 items: { 19435 type: 'number' 19436 }, 19437 default: [] 19438 }, 19439 columns: { 19440 type: 'number', 19441 minimum: 1, 19442 maximum: 8 19443 }, 19444 caption: { 19445 type: 'string', 19446 source: 'html', 19447 selector: '.blocks-gallery-caption' 19448 }, 19449 imageCrop: { 19450 type: 'boolean', 19451 default: true 19452 }, 19453 fixedHeight: { 19454 type: 'boolean', 19455 default: true 19456 }, 19457 linkTo: { 19458 type: 'string' 19459 }, 19460 sizeSlug: { 19461 type: 'string', 19462 default: 'large' 19463 } 19464 }, 19465 supports: { 19466 anchor: true, 19467 align: true 19468 }, 19469 save({ 19470 attributes 19471 }) { 19472 const { 19473 images, 19474 columns = defaultColumnsNumberV1(attributes), 19475 imageCrop, 19476 caption, 19477 linkTo 19478 } = attributes; 19479 const className = `columns-$columns} $imageCrop ? 'is-cropped' : ''}`; 19480 return (0,external_React_namespaceObject.createElement)("figure", { 19481 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 19482 className 19483 }) 19484 }, (0,external_React_namespaceObject.createElement)("ul", { 19485 className: "blocks-gallery-grid" 19486 }, images.map(image => { 19487 let href; 19488 switch (linkTo) { 19489 case DEPRECATED_LINK_DESTINATION_MEDIA: 19490 href = image.fullUrl || image.url; 19491 break; 19492 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 19493 href = image.link; 19494 break; 19495 } 19496 const img = (0,external_React_namespaceObject.createElement)("img", { 19497 src: image.url, 19498 alt: image.alt, 19499 "data-id": image.id, 19500 "data-full-url": image.fullUrl, 19501 "data-link": image.link, 19502 className: image.id ? `wp-image-$image.id}` : null 19503 }); 19504 return (0,external_React_namespaceObject.createElement)("li", { 19505 key: image.id || image.url, 19506 className: "blocks-gallery-item" 19507 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 19508 href: href 19509 }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19510 tagName: "figcaption", 19511 className: "blocks-gallery-item__caption", 19512 value: image.caption 19513 }))); 19514 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19515 tagName: "figcaption", 19516 className: "blocks-gallery-caption", 19517 value: caption 19518 })); 19519 }, 19520 migrate(attributes) { 19521 if (isGalleryV2Enabled()) { 19522 return runV2Migration(attributes); 19523 } 19524 return attributes; 19525 } 19526 }; 19527 const deprecated_v5 = { 19528 attributes: { 19529 images: { 19530 type: 'array', 19531 default: [], 19532 source: 'query', 19533 selector: '.blocks-gallery-item', 19534 query: { 19535 url: { 19536 type: 'string', 19537 source: 'attribute', 19538 selector: 'img', 19539 attribute: 'src' 19540 }, 19541 fullUrl: { 19542 type: 'string', 19543 source: 'attribute', 19544 selector: 'img', 19545 attribute: 'data-full-url' 19546 }, 19547 link: { 19548 type: 'string', 19549 source: 'attribute', 19550 selector: 'img', 19551 attribute: 'data-link' 19552 }, 19553 alt: { 19554 type: 'string', 19555 source: 'attribute', 19556 selector: 'img', 19557 attribute: 'alt', 19558 default: '' 19559 }, 19560 id: { 19561 type: 'string', 19562 source: 'attribute', 19563 selector: 'img', 19564 attribute: 'data-id' 19565 }, 19566 caption: { 19567 type: 'string', 19568 source: 'html', 19569 selector: '.blocks-gallery-item__caption' 19570 } 19571 } 19572 }, 19573 ids: { 19574 type: 'array', 19575 items: { 19576 type: 'number' 19577 }, 19578 default: [] 19579 }, 19580 columns: { 19581 type: 'number', 19582 minimum: 1, 19583 maximum: 8 19584 }, 19585 caption: { 19586 type: 'string', 19587 source: 'html', 19588 selector: '.blocks-gallery-caption' 19589 }, 19590 imageCrop: { 19591 type: 'boolean', 19592 default: true 19593 }, 19594 linkTo: { 19595 type: 'string', 19596 default: 'none' 19597 }, 19598 sizeSlug: { 19599 type: 'string', 19600 default: 'large' 19601 } 19602 }, 19603 supports: { 19604 align: true 19605 }, 19606 isEligible({ 19607 linkTo 19608 }) { 19609 return !linkTo || linkTo === 'attachment' || linkTo === 'media'; 19610 }, 19611 migrate(attributes) { 19612 if (isGalleryV2Enabled()) { 19613 return runV2Migration(attributes); 19614 } 19615 let linkTo = attributes.linkTo; 19616 if (!attributes.linkTo) { 19617 linkTo = 'none'; 19618 } else if (attributes.linkTo === 'attachment') { 19619 linkTo = 'post'; 19620 } else if (attributes.linkTo === 'media') { 19621 linkTo = 'file'; 19622 } 19623 return { 19624 ...attributes, 19625 linkTo 19626 }; 19627 }, 19628 save({ 19629 attributes 19630 }) { 19631 const { 19632 images, 19633 columns = defaultColumnsNumberV1(attributes), 19634 imageCrop, 19635 caption, 19636 linkTo 19637 } = attributes; 19638 return (0,external_React_namespaceObject.createElement)("figure", { 19639 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}` 19640 }, (0,external_React_namespaceObject.createElement)("ul", { 19641 className: "blocks-gallery-grid" 19642 }, images.map(image => { 19643 let href; 19644 switch (linkTo) { 19645 case 'media': 19646 href = image.fullUrl || image.url; 19647 break; 19648 case 'attachment': 19649 href = image.link; 19650 break; 19651 } 19652 const img = (0,external_React_namespaceObject.createElement)("img", { 19653 src: image.url, 19654 alt: image.alt, 19655 "data-id": image.id, 19656 "data-full-url": image.fullUrl, 19657 "data-link": image.link, 19658 className: image.id ? `wp-image-$image.id}` : null 19659 }); 19660 return (0,external_React_namespaceObject.createElement)("li", { 19661 key: image.id || image.url, 19662 className: "blocks-gallery-item" 19663 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 19664 href: href 19665 }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19666 tagName: "figcaption", 19667 className: "blocks-gallery-item__caption", 19668 value: image.caption 19669 }))); 19670 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19671 tagName: "figcaption", 19672 className: "blocks-gallery-caption", 19673 value: caption 19674 })); 19675 } 19676 }; 19677 const deprecated_v4 = { 19678 attributes: { 19679 images: { 19680 type: 'array', 19681 default: [], 19682 source: 'query', 19683 selector: '.blocks-gallery-item', 19684 query: { 19685 url: { 19686 source: 'attribute', 19687 selector: 'img', 19688 attribute: 'src' 19689 }, 19690 fullUrl: { 19691 source: 'attribute', 19692 selector: 'img', 19693 attribute: 'data-full-url' 19694 }, 19695 link: { 19696 source: 'attribute', 19697 selector: 'img', 19698 attribute: 'data-link' 19699 }, 19700 alt: { 19701 source: 'attribute', 19702 selector: 'img', 19703 attribute: 'alt', 19704 default: '' 19705 }, 19706 id: { 19707 source: 'attribute', 19708 selector: 'img', 19709 attribute: 'data-id' 19710 }, 19711 caption: { 19712 type: 'string', 19713 source: 'html', 19714 selector: '.blocks-gallery-item__caption' 19715 } 19716 } 19717 }, 19718 ids: { 19719 type: 'array', 19720 default: [] 19721 }, 19722 columns: { 19723 type: 'number' 19724 }, 19725 caption: { 19726 type: 'string', 19727 source: 'html', 19728 selector: '.blocks-gallery-caption' 19729 }, 19730 imageCrop: { 19731 type: 'boolean', 19732 default: true 19733 }, 19734 linkTo: { 19735 type: 'string', 19736 default: 'none' 19737 } 19738 }, 19739 supports: { 19740 align: true 19741 }, 19742 isEligible({ 19743 ids 19744 }) { 19745 return ids && ids.some(id => typeof id === 'string'); 19746 }, 19747 migrate(attributes) { 19748 var _attributes$ids; 19749 if (isGalleryV2Enabled()) { 19750 return runV2Migration(attributes); 19751 } 19752 return { 19753 ...attributes, 19754 ids: ((_attributes$ids = attributes.ids) !== null && _attributes$ids !== void 0 ? _attributes$ids : []).map(id => { 19755 const parsedId = parseInt(id, 10); 19756 return Number.isInteger(parsedId) ? parsedId : null; 19757 }) 19758 }; 19759 }, 19760 save({ 19761 attributes 19762 }) { 19763 const { 19764 images, 19765 columns = defaultColumnsNumberV1(attributes), 19766 imageCrop, 19767 caption, 19768 linkTo 19769 } = attributes; 19770 return (0,external_React_namespaceObject.createElement)("figure", { 19771 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}` 19772 }, (0,external_React_namespaceObject.createElement)("ul", { 19773 className: "blocks-gallery-grid" 19774 }, images.map(image => { 19775 let href; 19776 switch (linkTo) { 19777 case 'media': 19778 href = image.fullUrl || image.url; 19779 break; 19780 case 'attachment': 19781 href = image.link; 19782 break; 19783 } 19784 const img = (0,external_React_namespaceObject.createElement)("img", { 19785 src: image.url, 19786 alt: image.alt, 19787 "data-id": image.id, 19788 "data-full-url": image.fullUrl, 19789 "data-link": image.link, 19790 className: image.id ? `wp-image-$image.id}` : null 19791 }); 19792 return (0,external_React_namespaceObject.createElement)("li", { 19793 key: image.id || image.url, 19794 className: "blocks-gallery-item" 19795 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 19796 href: href 19797 }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19798 tagName: "figcaption", 19799 className: "blocks-gallery-item__caption", 19800 value: image.caption 19801 }))); 19802 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19803 tagName: "figcaption", 19804 className: "blocks-gallery-caption", 19805 value: caption 19806 })); 19807 } 19808 }; 19809 const gallery_deprecated_v3 = { 19810 attributes: { 19811 images: { 19812 type: 'array', 19813 default: [], 19814 source: 'query', 19815 selector: 'ul.wp-block-gallery .blocks-gallery-item', 19816 query: { 19817 url: { 19818 source: 'attribute', 19819 selector: 'img', 19820 attribute: 'src' 19821 }, 19822 fullUrl: { 19823 source: 'attribute', 19824 selector: 'img', 19825 attribute: 'data-full-url' 19826 }, 19827 alt: { 19828 source: 'attribute', 19829 selector: 'img', 19830 attribute: 'alt', 19831 default: '' 19832 }, 19833 id: { 19834 source: 'attribute', 19835 selector: 'img', 19836 attribute: 'data-id' 19837 }, 19838 link: { 19839 source: 'attribute', 19840 selector: 'img', 19841 attribute: 'data-link' 19842 }, 19843 caption: { 19844 type: 'string', 19845 source: 'html', 19846 selector: 'figcaption' 19847 } 19848 } 19849 }, 19850 ids: { 19851 type: 'array', 19852 default: [] 19853 }, 19854 columns: { 19855 type: 'number' 19856 }, 19857 imageCrop: { 19858 type: 'boolean', 19859 default: true 19860 }, 19861 linkTo: { 19862 type: 'string', 19863 default: 'none' 19864 } 19865 }, 19866 supports: { 19867 align: true 19868 }, 19869 save({ 19870 attributes 19871 }) { 19872 const { 19873 images, 19874 columns = defaultColumnsNumberV1(attributes), 19875 imageCrop, 19876 linkTo 19877 } = attributes; 19878 return (0,external_React_namespaceObject.createElement)("ul", { 19879 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}` 19880 }, images.map(image => { 19881 let href; 19882 switch (linkTo) { 19883 case 'media': 19884 href = image.fullUrl || image.url; 19885 break; 19886 case 'attachment': 19887 href = image.link; 19888 break; 19889 } 19890 const img = (0,external_React_namespaceObject.createElement)("img", { 19891 src: image.url, 19892 alt: image.alt, 19893 "data-id": image.id, 19894 "data-full-url": image.fullUrl, 19895 "data-link": image.link, 19896 className: image.id ? `wp-image-$image.id}` : null 19897 }); 19898 return (0,external_React_namespaceObject.createElement)("li", { 19899 key: image.id || image.url, 19900 className: "blocks-gallery-item" 19901 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 19902 href: href 19903 }, img) : img, image.caption && image.caption.length > 0 && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19904 tagName: "figcaption", 19905 value: image.caption 19906 }))); 19907 })); 19908 }, 19909 migrate(attributes) { 19910 if (isGalleryV2Enabled()) { 19911 return runV2Migration(attributes); 19912 } 19913 return attributes; 19914 } 19915 }; 19916 const gallery_deprecated_v2 = { 19917 attributes: { 19918 images: { 19919 type: 'array', 19920 default: [], 19921 source: 'query', 19922 selector: 'ul.wp-block-gallery .blocks-gallery-item', 19923 query: { 19924 url: { 19925 source: 'attribute', 19926 selector: 'img', 19927 attribute: 'src' 19928 }, 19929 alt: { 19930 source: 'attribute', 19931 selector: 'img', 19932 attribute: 'alt', 19933 default: '' 19934 }, 19935 id: { 19936 source: 'attribute', 19937 selector: 'img', 19938 attribute: 'data-id' 19939 }, 19940 link: { 19941 source: 'attribute', 19942 selector: 'img', 19943 attribute: 'data-link' 19944 }, 19945 caption: { 19946 type: 'string', 19947 source: 'html', 19948 selector: 'figcaption' 19949 } 19950 } 19951 }, 19952 columns: { 19953 type: 'number' 19954 }, 19955 imageCrop: { 19956 type: 'boolean', 19957 default: true 19958 }, 19959 linkTo: { 19960 type: 'string', 19961 default: 'none' 19962 } 19963 }, 19964 isEligible({ 19965 images, 19966 ids 19967 }) { 19968 return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || images.some((id, index) => { 19969 if (!id && ids[index] !== null) { 19970 return true; 19971 } 19972 return parseInt(id, 10) !== ids[index]; 19973 })); 19974 }, 19975 migrate(attributes) { 19976 var _attributes$images; 19977 if (isGalleryV2Enabled()) { 19978 return runV2Migration(attributes); 19979 } 19980 return { 19981 ...attributes, 19982 ids: ((_attributes$images = attributes.images) !== null && _attributes$images !== void 0 ? _attributes$images : []).map(({ 19983 id 19984 }) => { 19985 if (!id) { 19986 return null; 19987 } 19988 return parseInt(id, 10); 19989 }) 19990 }; 19991 }, 19992 supports: { 19993 align: true 19994 }, 19995 save({ 19996 attributes 19997 }) { 19998 const { 19999 images, 20000 columns = defaultColumnsNumberV1(attributes), 20001 imageCrop, 20002 linkTo 20003 } = attributes; 20004 return (0,external_React_namespaceObject.createElement)("ul", { 20005 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}` 20006 }, images.map(image => { 20007 let href; 20008 switch (linkTo) { 20009 case 'media': 20010 href = image.url; 20011 break; 20012 case 'attachment': 20013 href = image.link; 20014 break; 20015 } 20016 const img = (0,external_React_namespaceObject.createElement)("img", { 20017 src: image.url, 20018 alt: image.alt, 20019 "data-id": image.id, 20020 "data-link": image.link, 20021 className: image.id ? `wp-image-$image.id}` : null 20022 }); 20023 return (0,external_React_namespaceObject.createElement)("li", { 20024 key: image.id || image.url, 20025 className: "blocks-gallery-item" 20026 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 20027 href: href 20028 }, img) : img, image.caption && image.caption.length > 0 && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 20029 tagName: "figcaption", 20030 value: image.caption 20031 }))); 20032 })); 20033 } 20034 }; 20035 const gallery_deprecated_v1 = { 20036 attributes: { 20037 images: { 20038 type: 'array', 20039 default: [], 20040 source: 'query', 20041 selector: 'div.wp-block-gallery figure.blocks-gallery-image img', 20042 query: { 20043 url: { 20044 source: 'attribute', 20045 attribute: 'src' 20046 }, 20047 alt: { 20048 source: 'attribute', 20049 attribute: 'alt', 20050 default: '' 20051 }, 20052 id: { 20053 source: 'attribute', 20054 attribute: 'data-id' 20055 } 20056 } 20057 }, 20058 columns: { 20059 type: 'number' 20060 }, 20061 imageCrop: { 20062 type: 'boolean', 20063 default: true 20064 }, 20065 linkTo: { 20066 type: 'string', 20067 default: 'none' 20068 }, 20069 align: { 20070 type: 'string', 20071 default: 'none' 20072 } 20073 }, 20074 supports: { 20075 align: true 20076 }, 20077 save({ 20078 attributes 20079 }) { 20080 const { 20081 images, 20082 columns = defaultColumnsNumberV1(attributes), 20083 align, 20084 imageCrop, 20085 linkTo 20086 } = attributes; 20087 const className = classnames_default()(`columns-$columns}`, { 20088 alignnone: align === 'none', 20089 'is-cropped': imageCrop 20090 }); 20091 return (0,external_React_namespaceObject.createElement)("div", { 20092 className: className 20093 }, images.map(image => { 20094 let href; 20095 switch (linkTo) { 20096 case 'media': 20097 href = image.url; 20098 break; 20099 case 'attachment': 20100 href = image.link; 20101 break; 20102 } 20103 const img = (0,external_React_namespaceObject.createElement)("img", { 20104 src: image.url, 20105 alt: image.alt, 20106 "data-id": image.id 20107 }); 20108 return (0,external_React_namespaceObject.createElement)("figure", { 20109 key: image.id || image.url, 20110 className: "blocks-gallery-image" 20111 }, href ? (0,external_React_namespaceObject.createElement)("a", { 20112 href: href 20113 }, img) : img); 20114 })); 20115 }, 20116 migrate(attributes) { 20117 if (isGalleryV2Enabled()) { 20118 return runV2Migration(attributes); 20119 } 20120 return attributes; 20121 } 20122 }; 20123 /* harmony default export */ const gallery_deprecated = ([deprecated_v7, deprecated_v6, deprecated_v5, deprecated_v4, gallery_deprecated_v3, gallery_deprecated_v2, gallery_deprecated_v1]); 20124 20125 ;// CONCATENATED MODULE: external ["wp","viewport"] 20126 const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; 20127 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js 20128 20129 /** 20130 * WordPress dependencies 20131 */ 20132 20133 20134 const sharedIcon = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 20135 icon: library_gallery 20136 }); 20137 20138 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js 20139 const constants_MIN_SIZE = 20; 20140 const constants_LINK_DESTINATION_NONE = 'none'; 20141 const constants_LINK_DESTINATION_MEDIA = 'media'; 20142 const constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; 20143 const LINK_DESTINATION_CUSTOM = 'custom'; 20144 const constants_NEW_TAB_REL = ['noreferrer', 'noopener']; 20145 const constants_ALLOWED_MEDIA_TYPES = ['image']; 20146 const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0; 20147 20148 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js 20149 /** 20150 * Internal dependencies 20151 */ 20152 20153 20154 20155 /** 20156 * Determines new href and linkDestination values for an Image block from the 20157 * supplied Gallery link destination, or falls back to the Image blocks link. 20158 * 20159 * @param {Object} image Gallery image. 20160 * @param {string} galleryDestination Gallery's selected link destination. 20161 * @param {Object} imageDestination Image blocks attributes. 20162 * @return {Object} New attributes to assign to image block. 20163 */ 20164 function utils_getHrefAndDestination(image, galleryDestination, imageDestination) { 20165 // Gutenberg and WordPress use different constants so if image_default_link_type 20166 // option is set we need to map from the WP Core values. 20167 switch (imageDestination ? imageDestination : galleryDestination) { 20168 case LINK_DESTINATION_MEDIA_WP_CORE: 20169 case LINK_DESTINATION_MEDIA: 20170 return { 20171 href: image?.source_url || image?.url, 20172 // eslint-disable-line camelcase 20173 linkDestination: constants_LINK_DESTINATION_MEDIA 20174 }; 20175 case LINK_DESTINATION_ATTACHMENT_WP_CORE: 20176 case LINK_DESTINATION_ATTACHMENT: 20177 return { 20178 href: image?.link, 20179 linkDestination: constants_LINK_DESTINATION_ATTACHMENT 20180 }; 20181 case LINK_DESTINATION_NONE: 20182 return { 20183 href: undefined, 20184 linkDestination: constants_LINK_DESTINATION_NONE 20185 }; 20186 } 20187 return {}; 20188 } 20189 20190 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js 20191 /** 20192 * Internal dependencies 20193 */ 20194 20195 20196 /** 20197 * Evaluates a CSS aspect-ratio property value as a number. 20198 * 20199 * Degenerate or invalid ratios behave as 'auto'. And 'auto' ratios return NaN. 20200 * 20201 * @see https://drafts.csswg.org/css-sizing-4/#aspect-ratio 20202 * 20203 * @param {string} value CSS aspect-ratio property value. 20204 * @return {number} Numerical aspect ratio or NaN if invalid. 20205 */ 20206 function evalAspectRatio(value) { 20207 const [width, height = 1] = value.split('/').map(Number); 20208 const aspectRatio = width / height; 20209 return aspectRatio === Infinity || aspectRatio === 0 ? NaN : aspectRatio; 20210 } 20211 function removeNewTabRel(currentRel) { 20212 let newRel = currentRel; 20213 if (currentRel !== undefined && newRel) { 20214 constants_NEW_TAB_REL.forEach(relVal => { 20215 const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); 20216 newRel = newRel.replace(regExp, ''); 20217 }); 20218 20219 // Only trim if NEW_TAB_REL values was replaced. 20220 if (newRel !== currentRel) { 20221 newRel = newRel.trim(); 20222 } 20223 if (!newRel) { 20224 newRel = undefined; 20225 } 20226 } 20227 return newRel; 20228 } 20229 20230 /** 20231 * Helper to get the link target settings to be stored. 20232 * 20233 * @param {boolean} value The new link target value. 20234 * @param {Object} attributes Block attributes. 20235 * @param {Object} attributes.rel Image block's rel attribute. 20236 * 20237 * @return {Object} Updated link target settings. 20238 */ 20239 function getUpdatedLinkTargetSettings(value, { 20240 rel 20241 }) { 20242 const linkTarget = value ? '_blank' : undefined; 20243 let updatedRel; 20244 if (!linkTarget && !rel) { 20245 updatedRel = undefined; 20246 } else { 20247 updatedRel = removeNewTabRel(rel); 20248 } 20249 return { 20250 linkTarget, 20251 rel: updatedRel 20252 }; 20253 } 20254 20255 /** 20256 * Determines new Image block attributes size selection. 20257 * 20258 * @param {Object} image Media file object for gallery image. 20259 * @param {string} size Selected size slug to apply. 20260 */ 20261 function getImageSizeAttributes(image, size) { 20262 const url = image?.media_details?.sizes?.[size]?.source_url; 20263 if (url) { 20264 return { 20265 url, 20266 width: undefined, 20267 height: undefined, 20268 sizeSlug: size 20269 }; 20270 } 20271 return {}; 20272 } 20273 20274 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js 20275 20276 /** 20277 * External dependencies 20278 */ 20279 20280 20281 /** 20282 * WordPress dependencies 20283 */ 20284 20285 20286 20287 /** 20288 * Internal dependencies 20289 */ 20290 20291 function Gallery(props) { 20292 const { 20293 attributes, 20294 isSelected, 20295 setAttributes, 20296 mediaPlaceholder, 20297 insertBlocksAfter, 20298 blockProps, 20299 __unstableLayoutClassNames: layoutClassNames, 20300 isContentLocked, 20301 multiGallerySelection 20302 } = props; 20303 const { 20304 align, 20305 columns, 20306 imageCrop 20307 } = attributes; 20308 return (0,external_React_namespaceObject.createElement)("figure", { 20309 ...blockProps, 20310 className: classnames_default()(blockProps.className, layoutClassNames, 'blocks-gallery-grid', { 20311 [`align$align}`]: align, 20312 [`columns-$columns}`]: columns !== undefined, 20313 [`columns-default`]: columns === undefined, 20314 'is-cropped': imageCrop 20315 }) 20316 }, blockProps.children, isSelected && !blockProps.children && (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 20317 className: "blocks-gallery-media-placeholder-wrapper" 20318 }, mediaPlaceholder), (0,external_React_namespaceObject.createElement)(Caption, { 20319 attributes: attributes, 20320 setAttributes: setAttributes, 20321 isSelected: isSelected, 20322 insertBlocksAfter: insertBlocksAfter, 20323 showToolbarButton: !multiGallerySelection && !isContentLocked, 20324 className: "blocks-gallery-caption", 20325 label: (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), 20326 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add gallery caption') 20327 })); 20328 } 20329 20330 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js 20331 /** 20332 * WordPress dependencies 20333 */ 20334 20335 20336 /** 20337 * Calculates the image sizes that are avaible for the current gallery images in order to 20338 * populate the 'Resolution' selector. 20339 * 20340 * @param {Array} images Basic image block data taken from current gallery innerBlock 20341 * @param {boolean} isSelected Is the block currently selected in the editor. 20342 * @param {Function} getSettings Block editor store selector. 20343 * 20344 * @return {Array} An array of image size options. 20345 */ 20346 function useImageSizes(images, isSelected, getSettings) { 20347 return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]); 20348 function getImageSizing() { 20349 if (!images || images.length === 0) { 20350 return; 20351 } 20352 const { 20353 imageSizes 20354 } = getSettings(); 20355 let resizedImages = {}; 20356 if (isSelected) { 20357 resizedImages = images.reduce((currentResizedImages, img) => { 20358 if (!img.id) { 20359 return currentResizedImages; 20360 } 20361 const sizes = imageSizes.reduce((currentSizes, size) => { 20362 const defaultUrl = img.sizes?.[size.slug]?.url; 20363 const mediaDetailsUrl = img.media_details?.sizes?.[size.slug]?.source_url; 20364 return { 20365 ...currentSizes, 20366 [size.slug]: defaultUrl || mediaDetailsUrl 20367 }; 20368 }, {}); 20369 return { 20370 ...currentResizedImages, 20371 [parseInt(img.id, 10)]: sizes 20372 }; 20373 }, {}); 20374 } 20375 const resizedImageSizes = Object.values(resizedImages); 20376 return imageSizes.filter(({ 20377 slug 20378 }) => resizedImageSizes.some(sizes => sizes[slug])).map(({ 20379 name, 20380 slug 20381 }) => ({ 20382 value: slug, 20383 label: name 20384 })); 20385 } 20386 } 20387 20388 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js 20389 /** 20390 * WordPress dependencies 20391 */ 20392 20393 20394 /** 20395 * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This 20396 * is required so default gallery attributes can be applied without overwriting any custom 20397 * attributes applied to existing images. 20398 * 20399 * @param {Array} images Basic image block data taken from current gallery innerBlock 20400 * @param {Array} imageData The related image data for each of the current gallery images. 20401 * 20402 * @return {Array} An array of any new images that have been added to the gallery. 20403 */ 20404 function useGetNewImages(images, imageData) { 20405 const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]); 20406 return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]); 20407 function getNewImages() { 20408 let imagesUpdated = false; 20409 20410 // First lets check if any images have been deleted. 20411 const newCurrentImages = currentImages.filter(currentImg => images.find(img => { 20412 return currentImg.clientId === img.clientId; 20413 })); 20414 if (newCurrentImages.length < currentImages.length) { 20415 imagesUpdated = true; 20416 } 20417 20418 // Now lets see if we have any images hydrated from saved content and if so 20419 // add them to currentImages state. 20420 images.forEach(image => { 20421 if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) { 20422 imagesUpdated = true; 20423 newCurrentImages.push(image); 20424 } 20425 }); 20426 20427 // Now check for any new images that have been added to InnerBlocks and for which 20428 // we have the imageData we need for setting default block attributes. 20429 const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && imageData?.find(img => img.id === image.id) && !image.fromSavedConent); 20430 if (imagesUpdated || newImages?.length > 0) { 20431 setCurrentImages([...newCurrentImages, ...newImages]); 20432 } 20433 return newImages.length > 0 ? newImages : null; 20434 } 20435 } 20436 20437 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js 20438 /** 20439 * WordPress dependencies 20440 */ 20441 20442 20443 const EMPTY_IMAGE_MEDIA = []; 20444 20445 /** 20446 * Retrieves the extended media info for each gallery image from the store. This is used to 20447 * determine which image size options are available for the current gallery. 20448 * 20449 * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery. 20450 * 20451 * @return {Array} An array of media info options for each gallery image. 20452 */ 20453 function useGetMedia(innerBlockImages) { 20454 return (0,external_wp_data_namespaceObject.useSelect)(select => { 20455 var _select$getMediaItems; 20456 const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined); 20457 if (imageIds.length === 0) { 20458 return EMPTY_IMAGE_MEDIA; 20459 } 20460 return (_select$getMediaItems = select(external_wp_coreData_namespaceObject.store).getMediaItems({ 20461 include: imageIds.join(','), 20462 per_page: -1, 20463 orderby: 'include' 20464 })) !== null && _select$getMediaItems !== void 0 ? _select$getMediaItems : EMPTY_IMAGE_MEDIA; 20465 }, [innerBlockImages]); 20466 } 20467 20468 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js 20469 /** 20470 * WordPress dependencies 20471 */ 20472 20473 20474 /** 20475 * Internal dependencies 20476 */ 20477 20478 const { 20479 useStyleOverride 20480 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 20481 function GapStyles({ 20482 blockGap, 20483 clientId 20484 }) { 20485 // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default 20486 // gap on the gallery. 20487 const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`; 20488 let gapValue = fallbackValue; 20489 let column = fallbackValue; 20490 let row; 20491 20492 // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736 20493 if (!!blockGap) { 20494 row = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue; 20495 column = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.left) || fallbackValue; 20496 gapValue = row === column ? row : `$row} $column}`; 20497 } 20498 20499 // The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`. 20500 const gap = `#block-$clientId} { 20501 --wp--style--unstable-gallery-gap: $column === '0' ? '0px' : column}; 20502 gap: $gapValue} 20503 }`; 20504 useStyleOverride({ 20505 css: gap 20506 }); 20507 return null; 20508 } 20509 20510 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js 20511 20512 /** 20513 * External dependencies 20514 */ 20515 20516 20517 /** 20518 * WordPress dependencies 20519 */ 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 /** 20533 * Internal dependencies 20534 */ 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 const MAX_COLUMNS = 8; 20546 const linkOptions = [{ 20547 value: LINK_DESTINATION_ATTACHMENT, 20548 label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page') 20549 }, { 20550 value: LINK_DESTINATION_MEDIA, 20551 label: (0,external_wp_i18n_namespaceObject.__)('Media File') 20552 }, { 20553 value: LINK_DESTINATION_NONE, 20554 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option') 20555 }]; 20556 const edit_ALLOWED_MEDIA_TYPES = ['image']; 20557 const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('Add media') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'); 20558 const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? { 20559 type: 'stepper' 20560 } : {}; 20561 const EMPTY_ARRAY = []; 20562 function GalleryEdit(props) { 20563 const { 20564 setAttributes, 20565 attributes, 20566 className, 20567 clientId, 20568 isSelected, 20569 insertBlocksAfter, 20570 isContentLocked, 20571 onFocus 20572 } = props; 20573 const { 20574 columns, 20575 imageCrop, 20576 randomOrder, 20577 linkTarget, 20578 linkTo, 20579 sizeSlug 20580 } = attributes; 20581 const { 20582 __unstableMarkNextChangeAsNotPersistent, 20583 replaceInnerBlocks, 20584 updateBlockAttributes, 20585 selectBlock 20586 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 20587 const { 20588 createSuccessNotice, 20589 createErrorNotice 20590 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 20591 const { 20592 getBlock, 20593 getSettings, 20594 preferredStyle, 20595 innerBlockImages, 20596 blockWasJustInserted, 20597 multiGallerySelection 20598 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 20599 var _getBlock$innerBlocks; 20600 const { 20601 getBlockName, 20602 getMultiSelectedBlockClientIds, 20603 getSettings: _getSettings, 20604 getBlock: _getBlock, 20605 wasBlockJustInserted 20606 } = select(external_wp_blockEditor_namespaceObject.store); 20607 const preferredStyleVariations = _getSettings().__experimentalPreferredStyleVariations; 20608 const multiSelectedClientIds = getMultiSelectedBlockClientIds(); 20609 return { 20610 getBlock: _getBlock, 20611 getSettings: _getSettings, 20612 preferredStyle: preferredStyleVariations?.value?.['core/image'], 20613 innerBlockImages: (_getBlock$innerBlocks = _getBlock(clientId)?.innerBlocks) !== null && _getBlock$innerBlocks !== void 0 ? _getBlock$innerBlocks : EMPTY_ARRAY, 20614 blockWasJustInserted: wasBlockJustInserted(clientId, 'inserter_menu'), 20615 multiGallerySelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/gallery') 20616 }; 20617 }, [clientId]); 20618 const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages?.map(block => ({ 20619 clientId: block.clientId, 20620 id: block.attributes.id, 20621 url: block.attributes.url, 20622 attributes: block.attributes, 20623 fromSavedContent: Boolean(block.originalContent) 20624 })), [innerBlockImages]); 20625 const imageData = useGetMedia(innerBlockImages); 20626 const newImages = useGetNewImages(images, imageData); 20627 (0,external_wp_element_namespaceObject.useEffect)(() => { 20628 newImages?.forEach(newImage => { 20629 // Update the images data without creating new undo levels. 20630 __unstableMarkNextChangeAsNotPersistent(); 20631 updateBlockAttributes(newImage.clientId, { 20632 ...buildImageAttributes(newImage.attributes), 20633 id: newImage.id, 20634 align: undefined 20635 }); 20636 }); 20637 }, [newImages]); 20638 const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings); 20639 20640 /** 20641 * Determines the image attributes that should be applied to an image block 20642 * after the gallery updates. 20643 * 20644 * The gallery will receive the full collection of images when a new image 20645 * is added. As a result we need to reapply the image's original settings if 20646 * it already existed in the gallery. If the image is in fact new, we need 20647 * to apply the gallery's current settings to the image. 20648 * 20649 * @param {Object} imageAttributes Media object for the actual image. 20650 * @return {Object} Attributes to set on the new image block. 20651 */ 20652 function buildImageAttributes(imageAttributes) { 20653 const image = imageAttributes.id ? imageData.find(({ 20654 id 20655 }) => id === imageAttributes.id) : null; 20656 let newClassName; 20657 if (imageAttributes.className && imageAttributes.className !== '') { 20658 newClassName = imageAttributes.className; 20659 } else { 20660 newClassName = preferredStyle ? `is-style-$preferredStyle}` : undefined; 20661 } 20662 let newLinkTarget; 20663 if (imageAttributes.linkTarget || imageAttributes.rel) { 20664 // When transformed from image blocks, the link destination and rel attributes are inherited. 20665 newLinkTarget = { 20666 linkTarget: imageAttributes.linkTarget, 20667 rel: imageAttributes.rel 20668 }; 20669 } else { 20670 // When an image is added, update the link destination and rel attributes according to the gallery settings 20671 newLinkTarget = getUpdatedLinkTargetSettings(linkTarget, attributes); 20672 } 20673 return { 20674 ...pickRelevantMediaFiles(image, sizeSlug), 20675 ...utils_getHrefAndDestination(image, linkTo, imageAttributes?.linkDestination), 20676 ...newLinkTarget, 20677 className: newClassName, 20678 sizeSlug, 20679 caption: imageAttributes.caption || image.caption?.raw, 20680 alt: imageAttributes.alt || image.alt_text 20681 }; 20682 } 20683 function isValidFileType(file) { 20684 // It's necessary to retrieve the media type from the raw image data for already-uploaded images on native. 20685 const nativeFileData = external_wp_element_namespaceObject.Platform.isNative && file.id ? imageData.find(({ 20686 id 20687 }) => id === file.id) : null; 20688 const mediaTypeSelector = nativeFileData ? nativeFileData?.media_type : file.type; 20689 return edit_ALLOWED_MEDIA_TYPES.some(mediaType => mediaTypeSelector?.indexOf(mediaType) === 0) || file.url?.indexOf('blob:') === 0; 20690 } 20691 function updateImages(selectedImages) { 20692 const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]'; 20693 const imageArray = newFileUploads ? Array.from(selectedImages).map(file => { 20694 if (!file.url) { 20695 return pickRelevantMediaFiles({ 20696 url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 20697 }); 20698 } 20699 return file; 20700 }) : selectedImages; 20701 if (!imageArray.every(isValidFileType)) { 20702 createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { 20703 id: 'gallery-upload-invalid-file', 20704 type: 'snackbar' 20705 }); 20706 } 20707 const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => { 20708 if (!file.url) { 20709 return pickRelevantMediaFiles({ 20710 url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 20711 }); 20712 } 20713 return file; 20714 }); 20715 20716 // Because we are reusing existing innerImage blocks any reordering 20717 // done in the media library will be lost so we need to reapply that ordering 20718 // once the new image blocks are merged in with existing. 20719 const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {}); 20720 const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages; 20721 const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id)); 20722 const newBlocks = newImageList.map(image => { 20723 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 20724 id: image.id, 20725 url: image.url, 20726 caption: image.caption, 20727 alt: image.alt 20728 }); 20729 }); 20730 replaceInnerBlocks(clientId, existingImageBlocks.concat(newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id])); 20731 20732 // Select the first block to scroll into view when new blocks are added. 20733 if (newBlocks?.length > 0) { 20734 selectBlock(newBlocks[0].clientId); 20735 } 20736 } 20737 function onUploadError(message) { 20738 createErrorNotice(message, { 20739 type: 'snackbar' 20740 }); 20741 } 20742 function setLinkTo(value) { 20743 setAttributes({ 20744 linkTo: value 20745 }); 20746 const changedAttributes = {}; 20747 const blocks = []; 20748 getBlock(clientId).innerBlocks.forEach(block => { 20749 blocks.push(block.clientId); 20750 const image = block.attributes.id ? imageData.find(({ 20751 id 20752 }) => id === block.attributes.id) : null; 20753 changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value); 20754 }); 20755 updateBlockAttributes(blocks, changedAttributes, true); 20756 const linkToText = [...linkOptions].find(linkType => linkType.value === value); 20757 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: image size settings */ 20758 (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), { 20759 id: 'gallery-attributes-linkTo', 20760 type: 'snackbar' 20761 }); 20762 } 20763 function setColumnsNumber(value) { 20764 setAttributes({ 20765 columns: value 20766 }); 20767 } 20768 function toggleImageCrop() { 20769 setAttributes({ 20770 imageCrop: !imageCrop 20771 }); 20772 } 20773 function toggleRandomOrder() { 20774 setAttributes({ 20775 randomOrder: !randomOrder 20776 }); 20777 } 20778 function toggleOpenInNewTab(openInNewTab) { 20779 const newLinkTarget = openInNewTab ? '_blank' : undefined; 20780 setAttributes({ 20781 linkTarget: newLinkTarget 20782 }); 20783 const changedAttributes = {}; 20784 const blocks = []; 20785 getBlock(clientId).innerBlocks.forEach(block => { 20786 blocks.push(block.clientId); 20787 changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes); 20788 }); 20789 updateBlockAttributes(blocks, changedAttributes, true); 20790 const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab'); 20791 createSuccessNotice(noticeText, { 20792 id: 'gallery-attributes-openInNewTab', 20793 type: 'snackbar' 20794 }); 20795 } 20796 function updateImagesSize(newSizeSlug) { 20797 setAttributes({ 20798 sizeSlug: newSizeSlug 20799 }); 20800 const changedAttributes = {}; 20801 const blocks = []; 20802 getBlock(clientId).innerBlocks.forEach(block => { 20803 blocks.push(block.clientId); 20804 const image = block.attributes.id ? imageData.find(({ 20805 id 20806 }) => id === block.attributes.id) : null; 20807 changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug); 20808 }); 20809 updateBlockAttributes(blocks, changedAttributes, true); 20810 const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug); 20811 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: image size settings */ 20812 (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), { 20813 id: 'gallery-attributes-sizeSlug', 20814 type: 'snackbar' 20815 }); 20816 } 20817 (0,external_wp_element_namespaceObject.useEffect)(() => { 20818 // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php. 20819 if (!linkTo) { 20820 __unstableMarkNextChangeAsNotPersistent(); 20821 setAttributes({ 20822 linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE 20823 }); 20824 } 20825 }, [linkTo]); 20826 const hasImages = !!images.length; 20827 const hasImageIds = hasImages && images.some(image => !!image.id); 20828 const imagesUploading = images.some(img => !external_wp_element_namespaceObject.Platform.isNative ? !img.id && img.url?.indexOf('blob:') === 0 : img.url?.indexOf('file:') === 0); 20829 20830 // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set. 20831 const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({ 20832 web: { 20833 addToGallery: false, 20834 disableMediaButtons: imagesUploading, 20835 value: {} 20836 }, 20837 native: { 20838 addToGallery: hasImageIds, 20839 isAppender: hasImages, 20840 disableMediaButtons: hasImages && !isSelected || imagesUploading, 20841 value: hasImageIds ? images : {}, 20842 autoOpenMediaUpload: !hasImages && isSelected && blockWasJustInserted, 20843 onFocus 20844 } 20845 }); 20846 const mediaPlaceholder = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 20847 handleUpload: false, 20848 icon: sharedIcon, 20849 labels: { 20850 title: (0,external_wp_i18n_namespaceObject.__)('Gallery'), 20851 instructions: PLACEHOLDER_TEXT 20852 }, 20853 onSelect: updateImages, 20854 accept: "image/*", 20855 allowedTypes: edit_ALLOWED_MEDIA_TYPES, 20856 multiple: true, 20857 onError: onUploadError, 20858 ...mediaPlaceholderProps 20859 }); 20860 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 20861 className: classnames_default()(className, 'has-nested-images') 20862 }); 20863 const nativeInnerBlockProps = external_wp_element_namespaceObject.Platform.isNative && { 20864 marginHorizontal: 0, 20865 marginVertical: 0 20866 }; 20867 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 20868 orientation: 'horizontal', 20869 renderAppender: false, 20870 ...nativeInnerBlockProps 20871 }); 20872 if (!hasImages) { 20873 return (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 20874 ...innerBlocksProps 20875 }, innerBlocksProps.children, mediaPlaceholder); 20876 } 20877 const hasLinkTo = linkTo && linkTo !== 'none'; 20878 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 20879 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 20880 }, images.length > 1 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 20881 __nextHasNoMarginBottom: true, 20882 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 20883 value: columns ? columns : defaultColumnsNumber(images.length), 20884 onChange: setColumnsNumber, 20885 min: 1, 20886 max: Math.min(MAX_COLUMNS, images.length), 20887 ...MOBILE_CONTROL_PROPS_RANGE_CONTROL, 20888 required: true, 20889 __next40pxDefaultSize: true 20890 }), imageSizeOptions?.length > 0 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 20891 __nextHasNoMarginBottom: true, 20892 label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), 20893 help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source images.'), 20894 value: sizeSlug, 20895 options: imageSizeOptions, 20896 onChange: updateImagesSize, 20897 hideCancelButton: true, 20898 size: "__unstable-large" 20899 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 20900 __nextHasNoMarginBottom: true, 20901 label: (0,external_wp_i18n_namespaceObject.__)('Link to'), 20902 value: linkTo, 20903 onChange: setLinkTo, 20904 options: linkOptions, 20905 hideCancelButton: true, 20906 size: "__unstable-large" 20907 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 20908 __nextHasNoMarginBottom: true, 20909 label: (0,external_wp_i18n_namespaceObject.__)('Crop images to fit'), 20910 checked: !!imageCrop, 20911 onChange: toggleImageCrop 20912 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 20913 __nextHasNoMarginBottom: true, 20914 label: (0,external_wp_i18n_namespaceObject.__)('Randomize order'), 20915 checked: !!randomOrder, 20916 onChange: toggleRandomOrder 20917 }), hasLinkTo && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 20918 __nextHasNoMarginBottom: true, 20919 label: (0,external_wp_i18n_namespaceObject.__)('Open images in new tab'), 20920 checked: linkTarget === '_blank', 20921 onChange: toggleOpenInNewTab 20922 }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 20923 className: 'gallery-image-sizes' 20924 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Resolution')), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 20925 className: 'gallery-image-sizes__loading' 20926 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), external_wp_element_namespaceObject.Platform.isWeb && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !multiGallerySelection && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 20927 group: "other" 20928 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 20929 allowedTypes: edit_ALLOWED_MEDIA_TYPES, 20930 accept: "image/*", 20931 handleUpload: false, 20932 onSelect: updateImages, 20933 name: (0,external_wp_i18n_namespaceObject.__)('Add'), 20934 multiple: true, 20935 mediaIds: images.filter(image => image.id).map(image => image.id), 20936 addToGallery: hasImageIds 20937 })), (0,external_React_namespaceObject.createElement)(GapStyles, { 20938 blockGap: attributes.style?.spacing?.blockGap, 20939 clientId: clientId 20940 })), (0,external_React_namespaceObject.createElement)(Gallery, { 20941 ...props, 20942 isContentLocked: isContentLocked, 20943 images: images, 20944 mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined, 20945 blockProps: innerBlocksProps, 20946 insertBlocksAfter: insertBlocksAfter, 20947 multiGallerySelection: multiGallerySelection 20948 })); 20949 } 20950 /* harmony default export */ const gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_viewport_namespaceObject.withViewportMatch)({ 20951 isNarrow: '< small' 20952 })])(GalleryEdit)); 20953 20954 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js 20955 const shared_pickRelevantMediaFiles = (image, sizeSlug = 'large') => { 20956 const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link', 'caption'].includes(key))); 20957 imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url; 20958 const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; 20959 if (fullUrl) { 20960 imageProps.fullUrl = fullUrl; 20961 } 20962 return imageProps; 20963 }; 20964 20965 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js 20966 20967 /** 20968 * WordPress dependencies 20969 */ 20970 20971 const image_image = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 20972 viewBox: "0 0 24 24", 20973 xmlns: "http://www.w3.org/2000/svg" 20974 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 20975 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-2zM5 4.5h14c.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.6V5c-.1-.3.1-.5.4-.5zm14 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" 20976 })); 20977 /* harmony default export */ const library_image = (image_image); 20978 20979 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js 20980 20981 /** 20982 * WordPress dependencies 20983 */ 20984 20985 const chevronLeft = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 20986 xmlns: "http://www.w3.org/2000/svg", 20987 viewBox: "0 0 24 24" 20988 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 20989 d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" 20990 })); 20991 /* harmony default export */ const chevron_left = (chevronLeft); 20992 20993 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js 20994 20995 /** 20996 * WordPress dependencies 20997 */ 20998 20999 const chevronRight = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 21000 xmlns: "http://www.w3.org/2000/svg", 21001 viewBox: "0 0 24 24" 21002 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 21003 d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" 21004 })); 21005 /* harmony default export */ const chevron_right = (chevronRight); 21006 21007 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js 21008 21009 /** 21010 * WordPress dependencies 21011 */ 21012 21013 const closeSmall = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 21014 xmlns: "http://www.w3.org/2000/svg", 21015 viewBox: "0 0 24 24" 21016 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 21017 d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" 21018 })); 21019 /* harmony default export */ const close_small = (closeSmall); 21020 21021 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js 21022 const v1_constants_LINK_DESTINATION_NONE = 'none'; 21023 const v1_constants_LINK_DESTINATION_MEDIA = 'file'; 21024 const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post'; 21025 21026 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js 21027 21028 /** 21029 * External dependencies 21030 */ 21031 21032 21033 /** 21034 * WordPress dependencies 21035 */ 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 /** 21048 * Internal dependencies 21049 */ 21050 21051 21052 const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); 21053 class GalleryImage extends external_wp_element_namespaceObject.Component { 21054 constructor() { 21055 super(...arguments); 21056 this.onSelectImage = this.onSelectImage.bind(this); 21057 this.onRemoveImage = this.onRemoveImage.bind(this); 21058 this.bindContainer = this.bindContainer.bind(this); 21059 this.onEdit = this.onEdit.bind(this); 21060 this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this); 21061 this.onSelectCustomURL = this.onSelectCustomURL.bind(this); 21062 this.state = { 21063 isEditing: false 21064 }; 21065 } 21066 bindContainer(ref) { 21067 this.container = ref; 21068 } 21069 onSelectImage() { 21070 if (!this.props.isSelected) { 21071 this.props.onSelect(); 21072 } 21073 } 21074 onRemoveImage(event) { 21075 if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) { 21076 event.preventDefault(); 21077 this.props.onRemove(); 21078 } 21079 } 21080 onEdit() { 21081 this.setState({ 21082 isEditing: true 21083 }); 21084 } 21085 componentDidUpdate() { 21086 const { 21087 image, 21088 url, 21089 __unstableMarkNextChangeAsNotPersistent 21090 } = this.props; 21091 if (image && !url) { 21092 __unstableMarkNextChangeAsNotPersistent(); 21093 this.props.setAttributes({ 21094 url: image.source_url, 21095 alt: image.alt_text 21096 }); 21097 } 21098 } 21099 deselectOnBlur() { 21100 this.props.onDeselect(); 21101 } 21102 onSelectImageFromLibrary(media) { 21103 const { 21104 setAttributes, 21105 id, 21106 url, 21107 alt, 21108 caption, 21109 sizeSlug 21110 } = this.props; 21111 if (!media || !media.url) { 21112 return; 21113 } 21114 let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); 21115 21116 // If the current image is temporary but an alt text was meanwhile 21117 // written by the user, make sure the text is not overwritten. 21118 if (isTemporaryImage(id, url)) { 21119 if (alt) { 21120 const { 21121 alt: omittedAlt, 21122 ...restMediaAttributes 21123 } = mediaAttributes; 21124 mediaAttributes = restMediaAttributes; 21125 } 21126 } 21127 21128 // If a caption text was meanwhile written by the user, 21129 // make sure the text is not overwritten by empty captions. 21130 if (caption && !mediaAttributes.caption) { 21131 const { 21132 caption: omittedCaption, 21133 ...restMediaAttributes 21134 } = mediaAttributes; 21135 mediaAttributes = restMediaAttributes; 21136 } 21137 setAttributes(mediaAttributes); 21138 this.setState({ 21139 isEditing: false 21140 }); 21141 } 21142 onSelectCustomURL(newURL) { 21143 const { 21144 setAttributes, 21145 url 21146 } = this.props; 21147 if (newURL !== url) { 21148 setAttributes({ 21149 url: newURL, 21150 id: undefined 21151 }); 21152 this.setState({ 21153 isEditing: false 21154 }); 21155 } 21156 } 21157 render() { 21158 const { 21159 url, 21160 alt, 21161 id, 21162 linkTo, 21163 link, 21164 isFirstItem, 21165 isLastItem, 21166 isSelected, 21167 caption, 21168 onRemove, 21169 onMoveForward, 21170 onMoveBackward, 21171 setAttributes, 21172 'aria-label': ariaLabel 21173 } = this.props; 21174 const { 21175 isEditing 21176 } = this.state; 21177 let href; 21178 switch (linkTo) { 21179 case v1_constants_LINK_DESTINATION_MEDIA: 21180 href = url; 21181 break; 21182 case v1_constants_LINK_DESTINATION_ATTACHMENT: 21183 href = link; 21184 break; 21185 } 21186 const img = 21187 // Disable reason: Image itself is not meant to be interactive, but should 21188 // direct image selection and unfocus caption fields. 21189 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ 21190 (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("img", { 21191 src: url, 21192 alt: alt, 21193 "data-id": id, 21194 onKeyDown: this.onRemoveImage, 21195 tabIndex: "0", 21196 "aria-label": ariaLabel, 21197 ref: this.bindContainer 21198 }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)) 21199 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */; 21200 const className = classnames_default()({ 21201 'is-selected': isSelected, 21202 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url) 21203 }); 21204 return ( 21205 // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions 21206 (0,external_React_namespaceObject.createElement)("figure", { 21207 className: className, 21208 onClick: this.onSelectImage, 21209 onFocus: this.onSelectImage 21210 }, !isEditing && (href ? (0,external_React_namespaceObject.createElement)("a", { 21211 href: href 21212 }, img) : img), isEditing && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 21213 labels: { 21214 title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image') 21215 }, 21216 icon: library_image, 21217 onSelect: this.onSelectImageFromLibrary, 21218 onSelectURL: this.onSelectCustomURL, 21219 accept: "image/*", 21220 allowedTypes: ['image'], 21221 value: { 21222 id, 21223 src: url 21224 } 21225 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { 21226 className: "block-library-gallery-item__inline-menu is-left" 21227 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 21228 icon: chevron_left, 21229 onClick: isFirstItem ? undefined : onMoveBackward, 21230 label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'), 21231 "aria-disabled": isFirstItem, 21232 disabled: !isSelected 21233 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 21234 icon: chevron_right, 21235 onClick: isLastItem ? undefined : onMoveForward, 21236 label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'), 21237 "aria-disabled": isLastItem, 21238 disabled: !isSelected 21239 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { 21240 className: "block-library-gallery-item__inline-menu is-right" 21241 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 21242 icon: library_edit, 21243 onClick: this.onEdit, 21244 label: (0,external_wp_i18n_namespaceObject.__)('Replace image'), 21245 disabled: !isSelected 21246 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 21247 icon: close_small, 21248 onClick: onRemove, 21249 label: (0,external_wp_i18n_namespaceObject.__)('Remove image'), 21250 disabled: !isSelected 21251 })), !isEditing && (isSelected || caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 21252 tagName: "figcaption", 21253 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 21254 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'), 21255 placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null, 21256 value: caption, 21257 onChange: newCaption => setAttributes({ 21258 caption: newCaption 21259 }), 21260 inlineToolbar: true 21261 })) 21262 ); 21263 } 21264 } 21265 /* harmony default export */ const gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => { 21266 const { 21267 getMedia 21268 } = select(external_wp_coreData_namespaceObject.store); 21269 const { 21270 id 21271 } = ownProps; 21272 return { 21273 image: id ? getMedia(parseInt(id, 10)) : null 21274 }; 21275 }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { 21276 const { 21277 __unstableMarkNextChangeAsNotPersistent 21278 } = dispatch(external_wp_blockEditor_namespaceObject.store); 21279 return { 21280 __unstableMarkNextChangeAsNotPersistent 21281 }; 21282 })])(GalleryImage)); 21283 21284 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js 21285 21286 /** 21287 * External dependencies 21288 */ 21289 21290 21291 /** 21292 * WordPress dependencies 21293 */ 21294 21295 21296 21297 21298 21299 /** 21300 * Internal dependencies 21301 */ 21302 21303 21304 const gallery_Gallery = props => { 21305 const { 21306 attributes, 21307 isSelected, 21308 setAttributes, 21309 selectedImage, 21310 mediaPlaceholder, 21311 onMoveBackward, 21312 onMoveForward, 21313 onRemoveImage, 21314 onSelectImage, 21315 onDeselectImage, 21316 onSetImageAttributes, 21317 insertBlocksAfter, 21318 blockProps 21319 } = props; 21320 const { 21321 align, 21322 columns = defaultColumnsNumberV1(attributes), 21323 caption, 21324 imageCrop, 21325 images 21326 } = attributes; 21327 return (0,external_React_namespaceObject.createElement)("figure", { 21328 ...blockProps, 21329 className: classnames_default()(blockProps.className, { 21330 [`align$align}`]: align, 21331 [`columns-$columns}`]: columns, 21332 'is-cropped': imageCrop 21333 }) 21334 }, (0,external_React_namespaceObject.createElement)("ul", { 21335 className: "blocks-gallery-grid" 21336 }, images.map((img, index) => { 21337 const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: the order number of the image. 2: the total number of images. */ 21338 (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length); 21339 return (0,external_React_namespaceObject.createElement)("li", { 21340 className: "blocks-gallery-item", 21341 key: img.id ? `$img.id}-$index}` : img.url 21342 }, (0,external_React_namespaceObject.createElement)(gallery_image, { 21343 url: img.url, 21344 alt: img.alt, 21345 id: img.id, 21346 isFirstItem: index === 0, 21347 isLastItem: index + 1 === images.length, 21348 isSelected: isSelected && selectedImage === index, 21349 onMoveBackward: onMoveBackward(index), 21350 onMoveForward: onMoveForward(index), 21351 onRemove: onRemoveImage(index), 21352 onSelect: onSelectImage(index), 21353 onDeselect: onDeselectImage(index), 21354 setAttributes: attrs => onSetImageAttributes(index, attrs), 21355 caption: img.caption, 21356 "aria-label": ariaLabel, 21357 sizeSlug: attributes.sizeSlug 21358 })); 21359 })), mediaPlaceholder, (0,external_React_namespaceObject.createElement)(RichTextVisibilityHelper, { 21360 isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption), 21361 tagName: "figcaption", 21362 className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 21363 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), 21364 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'), 21365 value: caption, 21366 onChange: value => setAttributes({ 21367 caption: value 21368 }), 21369 inlineToolbar: true, 21370 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 21371 })); 21372 }; 21373 function RichTextVisibilityHelper({ 21374 isHidden, 21375 ...richTextProps 21376 }) { 21377 return isHidden ? (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { 21378 as: external_wp_blockEditor_namespaceObject.RichText, 21379 ...richTextProps 21380 }) : (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 21381 ...richTextProps 21382 }); 21383 } 21384 /* harmony default export */ const v1_gallery = (gallery_Gallery); 21385 21386 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js 21387 21388 /** 21389 * WordPress dependencies 21390 */ 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 /** 21403 * Internal dependencies 21404 */ 21405 21406 21407 21408 21409 21410 const edit_MAX_COLUMNS = 8; 21411 const edit_linkOptions = [{ 21412 value: v1_constants_LINK_DESTINATION_ATTACHMENT, 21413 label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page') 21414 }, { 21415 value: v1_constants_LINK_DESTINATION_MEDIA, 21416 label: (0,external_wp_i18n_namespaceObject.__)('Media File') 21417 }, { 21418 value: v1_constants_LINK_DESTINATION_NONE, 21419 label: (0,external_wp_i18n_namespaceObject.__)('None') 21420 }]; 21421 const v1_edit_ALLOWED_MEDIA_TYPES = ['image']; 21422 const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({ 21423 web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'), 21424 native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') 21425 }); 21426 const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({ 21427 web: {}, 21428 native: { 21429 type: 'stepper' 21430 } 21431 }); 21432 function edit_GalleryEdit(props) { 21433 const { 21434 attributes, 21435 clientId, 21436 isSelected, 21437 noticeUI, 21438 noticeOperations, 21439 onFocus 21440 } = props; 21441 const { 21442 columns = defaultColumnsNumberV1(attributes), 21443 imageCrop, 21444 images, 21445 linkTo, 21446 sizeSlug 21447 } = attributes; 21448 const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)(); 21449 const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)(); 21450 const { 21451 __unstableMarkNextChangeAsNotPersistent 21452 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 21453 const { 21454 imageSizes, 21455 mediaUpload, 21456 getMedia, 21457 wasBlockJustInserted 21458 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 21459 const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 21460 return { 21461 imageSizes: settings.imageSizes, 21462 mediaUpload: settings.mediaUpload, 21463 getMedia: select(external_wp_coreData_namespaceObject.store).getMedia, 21464 wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu') 21465 }; 21466 }); 21467 const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => { 21468 if (isSelected) { 21469 var _attributes$ids; 21470 return ((_attributes$ids = attributes.ids) !== null && _attributes$ids !== void 0 ? _attributes$ids : []).reduce((currentResizedImages, id) => { 21471 if (!id) { 21472 return currentResizedImages; 21473 } 21474 const image = getMedia(id); 21475 const sizes = imageSizes.reduce((currentSizes, size) => { 21476 const defaultUrl = image?.sizes?.[size.slug]?.url; 21477 const mediaDetailsUrl = image?.media_details?.sizes?.[size.slug]?.source_url; 21478 return { 21479 ...currentSizes, 21480 [size.slug]: defaultUrl || mediaDetailsUrl 21481 }; 21482 }, {}); 21483 return { 21484 ...currentResizedImages, 21485 [parseInt(id, 10)]: sizes 21486 }; 21487 }, {}); 21488 } 21489 return {}; 21490 }, [isSelected, attributes.ids, imageSizes]); 21491 function onFocusGalleryCaption() { 21492 setSelectedImage(); 21493 } 21494 function setAttributes(newAttrs) { 21495 if (newAttrs.ids) { 21496 throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes'); 21497 } 21498 if (newAttrs.images) { 21499 newAttrs = { 21500 ...newAttrs, 21501 // Unlike images[ n ].id which is a string, always ensure the 21502 // ids array contains numbers as per its attribute type. 21503 ids: newAttrs.images.map(({ 21504 id 21505 }) => parseInt(id, 10)) 21506 }; 21507 } 21508 props.setAttributes(newAttrs); 21509 } 21510 function onSelectImage(index) { 21511 return () => { 21512 setSelectedImage(index); 21513 }; 21514 } 21515 function onDeselectImage() { 21516 return () => { 21517 setSelectedImage(); 21518 }; 21519 } 21520 function onMove(oldIndex, newIndex) { 21521 const newImages = [...images]; 21522 newImages.splice(newIndex, 1, images[oldIndex]); 21523 newImages.splice(oldIndex, 1, images[newIndex]); 21524 setSelectedImage(newIndex); 21525 setAttributes({ 21526 images: newImages 21527 }); 21528 } 21529 function onMoveForward(oldIndex) { 21530 return () => { 21531 if (oldIndex === images.length - 1) { 21532 return; 21533 } 21534 onMove(oldIndex, oldIndex + 1); 21535 }; 21536 } 21537 function onMoveBackward(oldIndex) { 21538 return () => { 21539 if (oldIndex === 0) { 21540 return; 21541 } 21542 onMove(oldIndex, oldIndex - 1); 21543 }; 21544 } 21545 function onRemoveImage(index) { 21546 return () => { 21547 const newImages = images.filter((img, i) => index !== i); 21548 setSelectedImage(); 21549 setAttributes({ 21550 images: newImages, 21551 columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns 21552 }); 21553 }; 21554 } 21555 function selectCaption(newImage) { 21556 // The image id in both the images and attachmentCaptions arrays is a 21557 // string, so ensure comparison works correctly by converting the 21558 // newImage.id to a string. 21559 const newImageId = newImage.id.toString(); 21560 const currentImage = images.find(({ 21561 id 21562 }) => id === newImageId); 21563 const currentImageCaption = currentImage ? currentImage.caption : newImage.caption; 21564 if (!attachmentCaptions) { 21565 return currentImageCaption; 21566 } 21567 const attachment = attachmentCaptions.find(({ 21568 id 21569 }) => id === newImageId); 21570 21571 // If the attachment caption is updated. 21572 if (attachment && attachment.caption !== newImage.caption) { 21573 return newImage.caption; 21574 } 21575 return currentImageCaption; 21576 } 21577 function onSelectImages(newImages) { 21578 setAttachmentCaptions(newImages.map(newImage => ({ 21579 // Store the attachmentCaption id as a string for consistency 21580 // with the type of the id in the images attribute. 21581 id: newImage.id.toString(), 21582 caption: newImage.caption 21583 }))); 21584 setAttributes({ 21585 images: newImages.map(newImage => ({ 21586 ...shared_pickRelevantMediaFiles(newImage, sizeSlug), 21587 caption: selectCaption(newImage, images, attachmentCaptions), 21588 // The id value is stored in a data attribute, so when the 21589 // block is parsed it's converted to a string. Converting 21590 // to a string here ensures it's type is consistent. 21591 id: newImage.id.toString() 21592 })), 21593 columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns 21594 }); 21595 } 21596 function onUploadError(message) { 21597 noticeOperations.removeAllNotices(); 21598 noticeOperations.createErrorNotice(message); 21599 } 21600 function setLinkTo(value) { 21601 setAttributes({ 21602 linkTo: value 21603 }); 21604 } 21605 function setColumnsNumber(value) { 21606 setAttributes({ 21607 columns: value 21608 }); 21609 } 21610 function toggleImageCrop() { 21611 setAttributes({ 21612 imageCrop: !imageCrop 21613 }); 21614 } 21615 function getImageCropHelp(checked) { 21616 return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.'); 21617 } 21618 function setImageAttributes(index, newAttributes) { 21619 if (!images[index]) { 21620 return; 21621 } 21622 setAttributes({ 21623 images: [...images.slice(0, index), { 21624 ...images[index], 21625 ...newAttributes 21626 }, ...images.slice(index + 1)] 21627 }); 21628 } 21629 function getImagesSizeOptions() { 21630 const resizedImageSizes = Object.values(resizedImages); 21631 return imageSizes.filter(({ 21632 slug 21633 }) => resizedImageSizes.some(sizes => sizes[slug])).map(({ 21634 name, 21635 slug 21636 }) => ({ 21637 value: slug, 21638 label: name 21639 })); 21640 } 21641 function updateImagesSize(newSizeSlug) { 21642 const updatedImages = (images !== null && images !== void 0 ? images : []).map(image => { 21643 if (!image.id) { 21644 return image; 21645 } 21646 const url = resizedImages[parseInt(image.id, 10)]?.[newSizeSlug]; 21647 return { 21648 ...image, 21649 ...(url && { 21650 url 21651 }) 21652 }; 21653 }); 21654 setAttributes({ 21655 images: updatedImages, 21656 sizeSlug: newSizeSlug 21657 }); 21658 } 21659 (0,external_wp_element_namespaceObject.useEffect)(() => { 21660 if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && images.every(({ 21661 url 21662 }) => (0,external_wp_blob_namespaceObject.isBlobURL)(url))) { 21663 const filesList = images.map(({ 21664 url 21665 }) => (0,external_wp_blob_namespaceObject.getBlobByURL)(url)); 21666 images.forEach(({ 21667 url 21668 }) => (0,external_wp_blob_namespaceObject.revokeBlobURL)(url)); 21669 mediaUpload({ 21670 filesList, 21671 onFileChange: onSelectImages, 21672 allowedTypes: ['image'] 21673 }); 21674 } 21675 }, []); 21676 (0,external_wp_element_namespaceObject.useEffect)(() => { 21677 // Deselect images when deselecting the block. 21678 if (!isSelected) { 21679 setSelectedImage(); 21680 } 21681 }, [isSelected]); 21682 (0,external_wp_element_namespaceObject.useEffect)(() => { 21683 // linkTo attribute must be saved so blocks don't break when changing 21684 // image_default_link_type in options.php. 21685 if (!linkTo) { 21686 __unstableMarkNextChangeAsNotPersistent(); 21687 setAttributes({ 21688 linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || v1_constants_LINK_DESTINATION_NONE 21689 }); 21690 } 21691 }, [linkTo]); 21692 const hasImages = !!images.length; 21693 const hasImageIds = hasImages && images.some(image => !!image.id); 21694 const mediaPlaceholder = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 21695 addToGallery: hasImageIds, 21696 isAppender: hasImages, 21697 disableMediaButtons: hasImages && !isSelected, 21698 icon: !hasImages && sharedIcon, 21699 labels: { 21700 title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'), 21701 instructions: !hasImages && edit_PLACEHOLDER_TEXT 21702 }, 21703 onSelect: onSelectImages, 21704 accept: "image/*", 21705 allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES, 21706 multiple: true, 21707 value: hasImageIds ? images : {}, 21708 onError: onUploadError, 21709 notices: hasImages ? undefined : noticeUI, 21710 onFocus: onFocus, 21711 autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted 21712 }); 21713 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 21714 if (!hasImages) { 21715 return (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 21716 ...blockProps 21717 }, mediaPlaceholder); 21718 } 21719 const imageSizeOptions = getImagesSizeOptions(); 21720 const shouldShowSizeOptions = hasImages && imageSizeOptions.length > 0; 21721 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 21722 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 21723 }, images.length > 1 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 21724 __nextHasNoMarginBottom: true, 21725 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 21726 value: columns, 21727 onChange: setColumnsNumber, 21728 min: 1, 21729 max: Math.min(edit_MAX_COLUMNS, images.length), 21730 ...edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, 21731 required: true 21732 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 21733 __nextHasNoMarginBottom: true, 21734 label: (0,external_wp_i18n_namespaceObject.__)('Crop images'), 21735 checked: !!imageCrop, 21736 onChange: toggleImageCrop, 21737 help: getImageCropHelp 21738 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 21739 __nextHasNoMarginBottom: true, 21740 label: (0,external_wp_i18n_namespaceObject.__)('Link to'), 21741 value: linkTo, 21742 onChange: setLinkTo, 21743 options: edit_linkOptions, 21744 hideCancelButton: true 21745 }), shouldShowSizeOptions && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 21746 __nextHasNoMarginBottom: true, 21747 label: (0,external_wp_i18n_namespaceObject.__)('Image size'), 21748 value: sizeSlug, 21749 options: imageSizeOptions, 21750 onChange: updateImagesSize, 21751 hideCancelButton: true 21752 }))), noticeUI, (0,external_React_namespaceObject.createElement)(v1_gallery, { 21753 ...props, 21754 selectedImage: selectedImage, 21755 mediaPlaceholder: mediaPlaceholder, 21756 onMoveBackward: onMoveBackward, 21757 onMoveForward: onMoveForward, 21758 onRemoveImage: onRemoveImage, 21759 onSelectImage: onSelectImage, 21760 onDeselectImage: onDeselectImage, 21761 onSetImageAttributes: setImageAttributes, 21762 blockProps: blockProps 21763 // This prop is used by gallery.native.js. 21764 , 21765 onFocusGalleryCaption: onFocusGalleryCaption 21766 })); 21767 } 21768 /* harmony default export */ const v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({ 21769 isNarrow: '< small' 21770 })])(edit_GalleryEdit)); 21771 21772 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js 21773 21774 /** 21775 * WordPress dependencies 21776 */ 21777 21778 21779 21780 /** 21781 * Internal dependencies 21782 */ 21783 21784 21785 21786 21787 /* 21788 * Using a wrapper around the logic to load the edit for v1 of Gallery block 21789 * or the refactored version with InnerBlocks. This is to prevent conditional 21790 * use of hooks lint errors if adding this logic to the top of the edit component. 21791 */ 21792 function GalleryEditWrapper(props) { 21793 if (!isGalleryV2Enabled()) { 21794 return (0,external_React_namespaceObject.createElement)(v1_edit, { 21795 ...props 21796 }); 21797 } 21798 return (0,external_React_namespaceObject.createElement)(gallery_edit, { 21799 ...props 21800 }); 21801 } 21802 /* harmony default export */ const edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper)); 21803 21804 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js 21805 21806 /** 21807 * External dependencies 21808 */ 21809 21810 21811 /** 21812 * WordPress dependencies 21813 */ 21814 21815 21816 /** 21817 * Internal dependencies 21818 */ 21819 21820 21821 function saveV1({ 21822 attributes 21823 }) { 21824 const { 21825 images, 21826 columns = defaultColumnsNumberV1(attributes), 21827 imageCrop, 21828 caption, 21829 linkTo 21830 } = attributes; 21831 const className = `columns-$columns} $imageCrop ? 'is-cropped' : ''}`; 21832 return (0,external_React_namespaceObject.createElement)("figure", { 21833 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 21834 className 21835 }) 21836 }, (0,external_React_namespaceObject.createElement)("ul", { 21837 className: "blocks-gallery-grid" 21838 }, images.map(image => { 21839 let href; 21840 switch (linkTo) { 21841 case v1_constants_LINK_DESTINATION_MEDIA: 21842 href = image.fullUrl || image.url; 21843 break; 21844 case v1_constants_LINK_DESTINATION_ATTACHMENT: 21845 href = image.link; 21846 break; 21847 } 21848 const img = (0,external_React_namespaceObject.createElement)("img", { 21849 src: image.url, 21850 alt: image.alt, 21851 "data-id": image.id, 21852 "data-full-url": image.fullUrl, 21853 "data-link": image.link, 21854 className: image.id ? `wp-image-$image.id}` : null 21855 }); 21856 return (0,external_React_namespaceObject.createElement)("li", { 21857 key: image.id || image.url, 21858 className: "blocks-gallery-item" 21859 }, (0,external_React_namespaceObject.createElement)("figure", null, href ? (0,external_React_namespaceObject.createElement)("a", { 21860 href: href 21861 }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21862 tagName: "figcaption", 21863 className: classnames_default()('blocks-gallery-item__caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 21864 value: image.caption 21865 }))); 21866 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21867 tagName: "figcaption", 21868 className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 21869 value: caption 21870 })); 21871 } 21872 21873 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js 21874 21875 /** 21876 * External dependencies 21877 */ 21878 21879 21880 /** 21881 * WordPress dependencies 21882 */ 21883 21884 21885 /** 21886 * Internal dependencies 21887 */ 21888 21889 21890 function saveWithInnerBlocks({ 21891 attributes 21892 }) { 21893 if (!isGalleryV2Enabled()) { 21894 return saveV1({ 21895 attributes 21896 }); 21897 } 21898 const { 21899 caption, 21900 columns, 21901 imageCrop 21902 } = attributes; 21903 const className = classnames_default()('has-nested-images', { 21904 [`columns-$columns}`]: columns !== undefined, 21905 [`columns-default`]: columns === undefined, 21906 'is-cropped': imageCrop 21907 }); 21908 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 21909 className 21910 }); 21911 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 21912 return (0,external_React_namespaceObject.createElement)("figure", { 21913 ...innerBlocksProps 21914 }, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21915 tagName: "figcaption", 21916 className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 21917 value: caption 21918 })); 21919 } 21920 21921 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js 21922 /** 21923 * WordPress dependencies 21924 */ 21925 21926 21927 21928 21929 /** 21930 * Internal dependencies 21931 */ 21932 21933 21934 const parseShortcodeIds = ids => { 21935 if (!ids) { 21936 return []; 21937 } 21938 return ids.split(',').map(id => parseInt(id, 10)); 21939 }; 21940 21941 /** 21942 * Third party block plugins don't have an easy way to detect if the 21943 * innerBlocks version of the Gallery is running when they run a 21944 * 3rdPartyBlock -> GalleryBlock transform so this tranform filter 21945 * will handle this. Once the innerBlocks version is the default 21946 * in a core release, this could be deprecated and removed after 21947 * plugin authors have been given time to update transforms. 21948 * 21949 * @typedef {Object} Attributes 21950 * @typedef {Object} Block 21951 * @property {Attributes} attributes The attributes of the block. 21952 * @param {Block} block The transformed block. 21953 * @return {Block} The transformed block. 21954 */ 21955 function updateThirdPartyTransformToGallery(block) { 21956 if (isGalleryV2Enabled() && block.name === 'core/gallery' && block.attributes?.images.length > 0) { 21957 const innerBlocks = block.attributes.images.map(({ 21958 url, 21959 id, 21960 alt 21961 }) => { 21962 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 21963 url, 21964 id: id ? parseInt(id, 10) : null, 21965 alt, 21966 sizeSlug: block.attributes.sizeSlug, 21967 linkDestination: block.attributes.linkDestination 21968 }); 21969 }); 21970 delete block.attributes.ids; 21971 delete block.attributes.images; 21972 block.innerBlocks = innerBlocks; 21973 } 21974 return block; 21975 } 21976 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery); 21977 21978 /** 21979 * Third party block plugins don't have an easy way to detect if the 21980 * innerBlocks version of the Gallery is running when they run a 21981 * GalleryBlock -> 3rdPartyBlock transform so this transform filter 21982 * will handle this. Once the innerBlocks version is the default 21983 * in a core release, this could be deprecated and removed after 21984 * plugin authors have been given time to update transforms. 21985 * 21986 * @typedef {Object} Attributes 21987 * @typedef {Object} Block 21988 * @property {Attributes} attributes The attributes of the block. 21989 * @param {Block} toBlock The block to transform to. 21990 * @param {Block[]} fromBlocks The blocks to transform from. 21991 * @return {Block} The transformed block. 21992 */ 21993 function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { 21994 const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks]; 21995 const galleryBlock = from.find(transformedBlock => transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !transformedBlock.attributes.images?.length > 0 && !toBlock.name.includes('core/')); 21996 if (galleryBlock) { 21997 const images = galleryBlock.innerBlocks.map(({ 21998 attributes: { 21999 url, 22000 id, 22001 alt 22002 } 22003 }) => ({ 22004 url, 22005 id: id ? parseInt(id, 10) : null, 22006 alt 22007 })); 22008 const ids = images.map(({ 22009 id 22010 }) => id); 22011 galleryBlock.attributes.images = images; 22012 galleryBlock.attributes.ids = ids; 22013 } 22014 return toBlock; 22015 } 22016 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery); 22017 const gallery_transforms_transforms = { 22018 from: [{ 22019 type: 'block', 22020 isMultiBlock: true, 22021 blocks: ['core/image'], 22022 transform: attributes => { 22023 // Init the align and size from the first item which may be either the placeholder or an image. 22024 let { 22025 align, 22026 sizeSlug 22027 } = attributes[0]; 22028 // Loop through all the images and check if they have the same align and size. 22029 align = attributes.every(attribute => attribute.align === align) ? align : undefined; 22030 sizeSlug = attributes.every(attribute => attribute.sizeSlug === sizeSlug) ? sizeSlug : undefined; 22031 const validImages = attributes.filter(({ 22032 url 22033 }) => url); 22034 if (isGalleryV2Enabled()) { 22035 const innerBlocks = validImages.map(image => { 22036 // Gallery images can't currently be resized so make sure height and width are undefined. 22037 image.width = undefined; 22038 image.height = undefined; 22039 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image); 22040 }); 22041 return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22042 align, 22043 sizeSlug 22044 }, innerBlocks); 22045 } 22046 return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22047 images: validImages.map(({ 22048 id, 22049 url, 22050 alt, 22051 caption 22052 }) => ({ 22053 id: id.toString(), 22054 url, 22055 alt, 22056 caption 22057 })), 22058 ids: validImages.map(({ 22059 id 22060 }) => parseInt(id, 10)), 22061 align, 22062 sizeSlug 22063 }); 22064 } 22065 }, { 22066 type: 'shortcode', 22067 tag: 'gallery', 22068 transform({ 22069 named: { 22070 ids, 22071 columns = 3, 22072 link, 22073 orderby 22074 } 22075 }) { 22076 const imageIds = parseShortcodeIds(ids).map(id => parseInt(id, 10)); 22077 let linkTo = LINK_DESTINATION_NONE; 22078 if (link === 'post') { 22079 linkTo = LINK_DESTINATION_ATTACHMENT; 22080 } else if (link === 'file') { 22081 linkTo = LINK_DESTINATION_MEDIA; 22082 } 22083 const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22084 columns: parseInt(columns, 10), 22085 linkTo, 22086 randomOrder: orderby === 'rand' 22087 }, imageIds.map(imageId => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22088 id: imageId 22089 }))); 22090 return galleryBlock; 22091 }, 22092 isMatch({ 22093 named 22094 }) { 22095 return undefined !== named.ids; 22096 } 22097 }, { 22098 // When created by drag and dropping multiple files on an insertion point. Because multiple 22099 // files must not be transformed to a gallery when dropped within a gallery there is another transform 22100 // within the image block to handle that case. Therefore this transform has to have priority 1 22101 // set so that it overrrides the image block transformation when mulitple images are dropped outside 22102 // of a gallery block. 22103 type: 'files', 22104 priority: 1, 22105 isMatch(files) { 22106 return files.length !== 1 && files.every(file => file.type.indexOf('image/') === 0); 22107 }, 22108 transform(files) { 22109 if (isGalleryV2Enabled()) { 22110 const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22111 url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 22112 })); 22113 return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks); 22114 } 22115 const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22116 images: files.map(file => pickRelevantMediaFiles({ 22117 url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 22118 })) 22119 }); 22120 return block; 22121 } 22122 }], 22123 to: [{ 22124 type: 'block', 22125 blocks: ['core/image'], 22126 transform: ({ 22127 align, 22128 images, 22129 ids, 22130 sizeSlug 22131 }, innerBlocks) => { 22132 if (isGalleryV2Enabled()) { 22133 if (innerBlocks.length > 0) { 22134 return innerBlocks.map(({ 22135 attributes: { 22136 url, 22137 alt, 22138 caption, 22139 title, 22140 href, 22141 rel, 22142 linkClass, 22143 id, 22144 sizeSlug: imageSizeSlug, 22145 linkDestination, 22146 linkTarget, 22147 anchor, 22148 className 22149 } 22150 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22151 align, 22152 url, 22153 alt, 22154 caption, 22155 title, 22156 href, 22157 rel, 22158 linkClass, 22159 id, 22160 sizeSlug: imageSizeSlug, 22161 linkDestination, 22162 linkTarget, 22163 anchor, 22164 className 22165 })); 22166 } 22167 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22168 align 22169 }); 22170 } 22171 if (images.length > 0) { 22172 return images.map(({ 22173 url, 22174 alt, 22175 caption 22176 }, index) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22177 id: ids[index], 22178 url, 22179 alt, 22180 caption, 22181 align, 22182 sizeSlug 22183 })); 22184 } 22185 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22186 align 22187 }); 22188 } 22189 }] 22190 }; 22191 /* harmony default export */ const gallery_transforms = (gallery_transforms_transforms); 22192 22193 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js 22194 /** 22195 * WordPress dependencies 22196 */ 22197 22198 22199 /** 22200 * Internal dependencies 22201 */ 22202 22203 22204 22205 const gallery_metadata = { 22206 $schema: "https://schemas.wp.org/trunk/block.json", 22207 apiVersion: 3, 22208 name: "core/gallery", 22209 title: "Gallery", 22210 category: "media", 22211 allowedBlocks: ["core/image"], 22212 description: "Display multiple images in a rich gallery.", 22213 keywords: ["images", "photos"], 22214 textdomain: "default", 22215 attributes: { 22216 images: { 22217 type: "array", 22218 "default": [], 22219 source: "query", 22220 selector: ".blocks-gallery-item", 22221 query: { 22222 url: { 22223 type: "string", 22224 source: "attribute", 22225 selector: "img", 22226 attribute: "src" 22227 }, 22228 fullUrl: { 22229 type: "string", 22230 source: "attribute", 22231 selector: "img", 22232 attribute: "data-full-url" 22233 }, 22234 link: { 22235 type: "string", 22236 source: "attribute", 22237 selector: "img", 22238 attribute: "data-link" 22239 }, 22240 alt: { 22241 type: "string", 22242 source: "attribute", 22243 selector: "img", 22244 attribute: "alt", 22245 "default": "" 22246 }, 22247 id: { 22248 type: "string", 22249 source: "attribute", 22250 selector: "img", 22251 attribute: "data-id" 22252 }, 22253 caption: { 22254 type: "rich-text", 22255 source: "rich-text", 22256 selector: ".blocks-gallery-item__caption" 22257 } 22258 } 22259 }, 22260 ids: { 22261 type: "array", 22262 items: { 22263 type: "number" 22264 }, 22265 "default": [] 22266 }, 22267 shortCodeTransforms: { 22268 type: "array", 22269 items: { 22270 type: "object" 22271 }, 22272 "default": [] 22273 }, 22274 columns: { 22275 type: "number", 22276 minimum: 1, 22277 maximum: 8 22278 }, 22279 caption: { 22280 type: "rich-text", 22281 source: "rich-text", 22282 selector: ".blocks-gallery-caption" 22283 }, 22284 imageCrop: { 22285 type: "boolean", 22286 "default": true 22287 }, 22288 randomOrder: { 22289 type: "boolean", 22290 "default": false 22291 }, 22292 fixedHeight: { 22293 type: "boolean", 22294 "default": true 22295 }, 22296 linkTarget: { 22297 type: "string" 22298 }, 22299 linkTo: { 22300 type: "string" 22301 }, 22302 sizeSlug: { 22303 type: "string", 22304 "default": "large" 22305 }, 22306 allowResize: { 22307 type: "boolean", 22308 "default": false 22309 } 22310 }, 22311 providesContext: { 22312 allowResize: "allowResize", 22313 imageCrop: "imageCrop", 22314 fixedHeight: "fixedHeight" 22315 }, 22316 supports: { 22317 anchor: true, 22318 align: true, 22319 html: false, 22320 units: ["px", "em", "rem", "vh", "vw"], 22321 spacing: { 22322 margin: true, 22323 padding: true, 22324 blockGap: ["horizontal", "vertical"], 22325 __experimentalSkipSerialization: ["blockGap"], 22326 __experimentalDefaultControls: { 22327 blockGap: true, 22328 margin: false, 22329 padding: false 22330 } 22331 }, 22332 color: { 22333 text: false, 22334 background: true, 22335 gradients: true 22336 }, 22337 layout: { 22338 allowSwitching: false, 22339 allowInheriting: false, 22340 allowEditing: false, 22341 "default": { 22342 type: "flex" 22343 } 22344 }, 22345 interactivity: { 22346 clientNavigation: true 22347 } 22348 }, 22349 editorStyle: "wp-block-gallery-editor", 22350 style: "wp-block-gallery" 22351 }; 22352 22353 22354 const { 22355 name: gallery_name 22356 } = gallery_metadata; 22357 22358 const gallery_settings = { 22359 icon: library_gallery, 22360 example: { 22361 attributes: { 22362 columns: 2 22363 }, 22364 innerBlocks: [{ 22365 name: 'core/image', 22366 attributes: { 22367 url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg' 22368 } 22369 }, { 22370 name: 'core/image', 22371 attributes: { 22372 url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg' 22373 } 22374 }] 22375 }, 22376 transforms: gallery_transforms, 22377 edit: edit_wrapper, 22378 save: saveWithInnerBlocks, 22379 deprecated: gallery_deprecated 22380 }; 22381 const gallery_init = () => initBlock({ 22382 name: gallery_name, 22383 metadata: gallery_metadata, 22384 settings: gallery_settings 22385 }); 22386 22387 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js 22388 22389 /** 22390 * External dependencies 22391 */ 22392 22393 22394 /** 22395 * WordPress dependencies 22396 */ 22397 22398 const migrateAttributes = attributes => { 22399 if (!attributes.tagName) { 22400 attributes = { 22401 ...attributes, 22402 tagName: 'div' 22403 }; 22404 } 22405 if (!attributes.customTextColor && !attributes.customBackgroundColor) { 22406 return attributes; 22407 } 22408 const style = { 22409 color: {} 22410 }; 22411 if (attributes.customTextColor) { 22412 style.color.text = attributes.customTextColor; 22413 } 22414 if (attributes.customBackgroundColor) { 22415 style.color.background = attributes.customBackgroundColor; 22416 } 22417 const { 22418 customTextColor, 22419 customBackgroundColor, 22420 ...restAttributes 22421 } = attributes; 22422 return { 22423 ...restAttributes, 22424 style 22425 }; 22426 }; 22427 const group_deprecated_deprecated = [ 22428 // Version with default layout. 22429 { 22430 attributes: { 22431 tagName: { 22432 type: 'string', 22433 default: 'div' 22434 }, 22435 templateLock: { 22436 type: ['string', 'boolean'], 22437 enum: ['all', 'insert', false] 22438 } 22439 }, 22440 supports: { 22441 __experimentalOnEnter: true, 22442 __experimentalSettings: true, 22443 align: ['wide', 'full'], 22444 anchor: true, 22445 ariaLabel: true, 22446 html: false, 22447 color: { 22448 gradients: true, 22449 link: true, 22450 __experimentalDefaultControls: { 22451 background: true, 22452 text: true 22453 } 22454 }, 22455 spacing: { 22456 margin: ['top', 'bottom'], 22457 padding: true, 22458 blockGap: true, 22459 __experimentalDefaultControls: { 22460 padding: true, 22461 blockGap: true 22462 } 22463 }, 22464 __experimentalBorder: { 22465 color: true, 22466 radius: true, 22467 style: true, 22468 width: true, 22469 __experimentalDefaultControls: { 22470 color: true, 22471 radius: true, 22472 style: true, 22473 width: true 22474 } 22475 }, 22476 typography: { 22477 fontSize: true, 22478 lineHeight: true, 22479 __experimentalFontStyle: true, 22480 __experimentalFontWeight: true, 22481 __experimentalLetterSpacing: true, 22482 __experimentalTextTransform: true, 22483 __experimentalDefaultControls: { 22484 fontSize: true 22485 } 22486 }, 22487 layout: true 22488 }, 22489 save({ 22490 attributes: { 22491 tagName: Tag 22492 } 22493 }) { 22494 return (0,external_React_namespaceObject.createElement)(Tag, { 22495 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) 22496 }); 22497 }, 22498 isEligible: ({ 22499 layout 22500 }) => !layout || layout.inherit || layout.contentSize && layout.type !== 'constrained', 22501 migrate: attributes => { 22502 const { 22503 layout = null 22504 } = attributes; 22505 if (!layout) { 22506 return attributes; 22507 } 22508 if (layout.inherit || layout.contentSize) { 22509 return { 22510 ...attributes, 22511 layout: { 22512 ...layout, 22513 type: 'constrained' 22514 } 22515 }; 22516 } 22517 } 22518 }, 22519 // Version of the block with the double div. 22520 { 22521 attributes: { 22522 tagName: { 22523 type: 'string', 22524 default: 'div' 22525 }, 22526 templateLock: { 22527 type: ['string', 'boolean'], 22528 enum: ['all', 'insert', false] 22529 } 22530 }, 22531 supports: { 22532 align: ['wide', 'full'], 22533 anchor: true, 22534 color: { 22535 gradients: true, 22536 link: true 22537 }, 22538 spacing: { 22539 padding: true 22540 }, 22541 __experimentalBorder: { 22542 radius: true 22543 } 22544 }, 22545 save({ 22546 attributes 22547 }) { 22548 const { 22549 tagName: Tag 22550 } = attributes; 22551 return (0,external_React_namespaceObject.createElement)(Tag, { 22552 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 22553 }, (0,external_React_namespaceObject.createElement)("div", { 22554 className: "wp-block-group__inner-container" 22555 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 22556 } 22557 }, 22558 // Version of the block without global styles support 22559 { 22560 attributes: { 22561 backgroundColor: { 22562 type: 'string' 22563 }, 22564 customBackgroundColor: { 22565 type: 'string' 22566 }, 22567 textColor: { 22568 type: 'string' 22569 }, 22570 customTextColor: { 22571 type: 'string' 22572 } 22573 }, 22574 supports: { 22575 align: ['wide', 'full'], 22576 anchor: true, 22577 html: false 22578 }, 22579 migrate: migrateAttributes, 22580 save({ 22581 attributes 22582 }) { 22583 const { 22584 backgroundColor, 22585 customBackgroundColor, 22586 textColor, 22587 customTextColor 22588 } = attributes; 22589 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 22590 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 22591 const className = classnames_default()(backgroundClass, textClass, { 22592 'has-text-color': textColor || customTextColor, 22593 'has-background': backgroundColor || customBackgroundColor 22594 }); 22595 const styles = { 22596 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 22597 color: textClass ? undefined : customTextColor 22598 }; 22599 return (0,external_React_namespaceObject.createElement)("div", { 22600 className: className, 22601 style: styles 22602 }, (0,external_React_namespaceObject.createElement)("div", { 22603 className: "wp-block-group__inner-container" 22604 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 22605 } 22606 }, 22607 // Version of the group block with a bug that made text color class not applied. 22608 { 22609 attributes: { 22610 backgroundColor: { 22611 type: 'string' 22612 }, 22613 customBackgroundColor: { 22614 type: 'string' 22615 }, 22616 textColor: { 22617 type: 'string' 22618 }, 22619 customTextColor: { 22620 type: 'string' 22621 } 22622 }, 22623 migrate: migrateAttributes, 22624 supports: { 22625 align: ['wide', 'full'], 22626 anchor: true, 22627 html: false 22628 }, 22629 save({ 22630 attributes 22631 }) { 22632 const { 22633 backgroundColor, 22634 customBackgroundColor, 22635 textColor, 22636 customTextColor 22637 } = attributes; 22638 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 22639 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 22640 const className = classnames_default()(backgroundClass, { 22641 'has-text-color': textColor || customTextColor, 22642 'has-background': backgroundColor || customBackgroundColor 22643 }); 22644 const styles = { 22645 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 22646 color: textClass ? undefined : customTextColor 22647 }; 22648 return (0,external_React_namespaceObject.createElement)("div", { 22649 className: className, 22650 style: styles 22651 }, (0,external_React_namespaceObject.createElement)("div", { 22652 className: "wp-block-group__inner-container" 22653 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 22654 } 22655 }, 22656 // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. 22657 { 22658 attributes: { 22659 backgroundColor: { 22660 type: 'string' 22661 }, 22662 customBackgroundColor: { 22663 type: 'string' 22664 } 22665 }, 22666 supports: { 22667 align: ['wide', 'full'], 22668 anchor: true, 22669 html: false 22670 }, 22671 migrate: migrateAttributes, 22672 save({ 22673 attributes 22674 }) { 22675 const { 22676 backgroundColor, 22677 customBackgroundColor 22678 } = attributes; 22679 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 22680 const className = classnames_default()(backgroundClass, { 22681 'has-background': backgroundColor || customBackgroundColor 22682 }); 22683 const styles = { 22684 backgroundColor: backgroundClass ? undefined : customBackgroundColor 22685 }; 22686 return (0,external_React_namespaceObject.createElement)("div", { 22687 className: className, 22688 style: styles 22689 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 22690 } 22691 }]; 22692 /* harmony default export */ const group_deprecated = (group_deprecated_deprecated); 22693 22694 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/placeholder.js 22695 22696 /** 22697 * WordPress dependencies 22698 */ 22699 22700 22701 22702 22703 22704 22705 22706 /** 22707 * Returns a custom variation icon. 22708 * 22709 * @param {string} name The block variation name. 22710 * 22711 * @return {JSX.Element} The SVG element. 22712 */ 22713 const getGroupPlaceholderIcons = (name = 'group') => { 22714 const icons = { 22715 group: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 22716 xmlns: "http://www.w3.org/2000/svg", 22717 width: "44", 22718 height: "32", 22719 viewBox: "0 0 44 32" 22720 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 22721 d: "M42 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2z" 22722 })), 22723 'group-row': (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 22724 xmlns: "http://www.w3.org/2000/svg", 22725 width: "44", 22726 height: "32", 22727 viewBox: "0 0 44 32" 22728 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 22729 d: "M42 0H23.5c-.6 0-1 .4-1 1v30c0 .6.4 1 1 1H42c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zM20.5 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h18.5c.6 0 1-.4 1-1V1c0-.6-.4-1-1-1z" 22730 })), 22731 'group-stack': (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 22732 xmlns: "http://www.w3.org/2000/svg", 22733 width: "44", 22734 height: "32", 22735 viewBox: "0 0 44 32" 22736 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 22737 d: "M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z" 22738 })), 22739 'group-grid': (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 22740 xmlns: "http://www.w3.org/2000/svg", 22741 width: "44", 22742 height: "32", 22743 viewBox: "0 0 44 32" 22744 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 22745 d: "m20.30137,-0.00025l-18.9728,0c-0.86524,0.07234 -1.41711,0.79149 -1.41711,1.89149l0,12.64468c0,0.6 0.73401,0.96383 1.0304,0.96383l19.67469,0.03617c0.29639,0 1.0304,-0.4 1.0304,-1l-0.03576,-12.7532c0,-1.1 -0.76644,-1.78297 -1.30983,-1.78297zm0.52975,16.60851l-19.99654,-0.03617c-0.29639,0 -0.92312,0.36383 -0.92312,0.96383l-0.03576,12.68085c0,1.1 0.8022,1.81915 1.34559,1.81915l19.00857,0c0.54339,0 1.45287,-0.71915 1.45287,-1.81915l0,-12.53617c0,-0.6 -0.5552,-1.07234 -0.8516,-1.07234z" 22746 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 22747 d: "m42.73056,-0.03617l-18.59217,0c-0.84788,0.07234 -1.38868,0.79149 -1.38868,1.89149l0,12.64468c0,0.6 0.71928,0.96383 1.00973,0.96383l19.27997,0.03617c0.29045,0 1.00973,-0.4 1.00973,-1l-0.03504,-12.7532c0,-1.1 -0.75106,-1.78297 -1.28355,-1.78297zm0.51912,16.60851l-19.59537,-0.03617c-0.29045,0 -0.9046,0.36383 -0.9046,0.96383l-0.03504,12.68085c0,1.1 0.78611,1.81915 1.31859,1.81915l18.62721,0c0.53249,0 1.42372,-0.71915 1.42372,-1.81915l0,-12.53617c0,-0.6 -0.54407,-1.07234 -0.83451,-1.07234z" 22748 })) 22749 }; 22750 return icons?.[name]; 22751 }; 22752 22753 /** 22754 * A custom hook to tell the Group block whether to show the variation placeholder. 22755 * 22756 * @param {Object} props Arguments to pass to hook. 22757 * @param {Object} [props.attributes] The block's attributes. 22758 * @param {string} [props.usedLayoutType] The block's current layout type. 22759 * @param {boolean} [props.hasInnerBlocks] Whether the block has inner blocks. 22760 * 22761 * @return {[boolean, Function]} A state value and setter function. 22762 */ 22763 function useShouldShowPlaceHolder({ 22764 attributes = { 22765 style: undefined, 22766 backgroundColor: undefined, 22767 textColor: undefined, 22768 fontSize: undefined 22769 }, 22770 usedLayoutType = '', 22771 hasInnerBlocks = false 22772 }) { 22773 const { 22774 style, 22775 backgroundColor, 22776 textColor, 22777 fontSize 22778 } = attributes; 22779 /* 22780 * Shows the placeholder when no known styles are set, 22781 * or when a non-default layout has been selected. 22782 * Should the Group block support more style presets in the 22783 * future, e.g., attributes.spacingSize, we can add them to the 22784 * condition. 22785 */ 22786 const [showPlaceholder, setShowPlaceholder] = (0,external_wp_element_namespaceObject.useState)(!hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style && usedLayoutType !== 'flex' && usedLayoutType !== 'grid'); 22787 (0,external_wp_element_namespaceObject.useEffect)(() => { 22788 if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style || usedLayoutType === 'flex') { 22789 setShowPlaceholder(false); 22790 } 22791 }, [backgroundColor, fontSize, textColor, style, usedLayoutType, hasInnerBlocks]); 22792 return [showPlaceholder, setShowPlaceholder]; 22793 } 22794 22795 /** 22796 * Display group variations if none is selected. 22797 * 22798 * @param {Object} props Component props. 22799 * @param {string} props.name The block's name. 22800 * @param {Function} props.onSelect Function to set block's attributes. 22801 * 22802 * @return {JSX.Element} The placeholder. 22803 */ 22804 function GroupPlaceHolder({ 22805 name, 22806 onSelect 22807 }) { 22808 const variations = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockVariations(name, 'block'), [name]); 22809 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 22810 className: 'wp-block-group__placeholder' 22811 }); 22812 return (0,external_React_namespaceObject.createElement)("div", { 22813 ...blockProps 22814 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 22815 instructions: (0,external_wp_i18n_namespaceObject.__)('Group blocks together. Select a layout:') 22816 }, (0,external_React_namespaceObject.createElement)("ul", { 22817 role: "list", 22818 className: "wp-block-group-placeholder__variations", 22819 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block variations') 22820 }, variations.map(variation => (0,external_React_namespaceObject.createElement)("li", { 22821 key: variation.name 22822 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 22823 variant: "tertiary", 22824 icon: getGroupPlaceholderIcons(variation.name), 22825 iconSize: 44, 22826 onClick: () => onSelect(variation), 22827 className: "wp-block-group-placeholder__variation-button", 22828 label: `$variation.title}: $variation.description}` 22829 })))))); 22830 } 22831 /* harmony default export */ const placeholder = (GroupPlaceHolder); 22832 22833 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js 22834 22835 /** 22836 * WordPress dependencies 22837 */ 22838 22839 22840 22841 22842 22843 22844 22845 /** 22846 * Internal dependencies 22847 */ 22848 22849 22850 /** 22851 * Render inspector controls for the Group block. 22852 * 22853 * @param {Object} props Component props. 22854 * @param {string} props.tagName The HTML tag name. 22855 * @param {Function} props.onSelectTagName onChange function for the SelectControl. 22856 * 22857 * @return {JSX.Element} The control group. 22858 */ 22859 function GroupEditControls({ 22860 tagName, 22861 onSelectTagName 22862 }) { 22863 const htmlElementMessages = { 22864 header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), 22865 main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '), 22866 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."), 22867 article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), 22868 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."), 22869 footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).') 22870 }; 22871 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 22872 group: "advanced" 22873 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 22874 __nextHasNoMarginBottom: true, 22875 __next40pxDefaultSize: true, 22876 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 22877 options: [{ 22878 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 22879 value: 'div' 22880 }, { 22881 label: '<header>', 22882 value: 'header' 22883 }, { 22884 label: '<main>', 22885 value: 'main' 22886 }, { 22887 label: '<section>', 22888 value: 'section' 22889 }, { 22890 label: '<article>', 22891 value: 'article' 22892 }, { 22893 label: '<aside>', 22894 value: 'aside' 22895 }, { 22896 label: '<footer>', 22897 value: 'footer' 22898 }], 22899 value: tagName, 22900 onChange: onSelectTagName, 22901 help: htmlElementMessages[tagName] 22902 })); 22903 } 22904 function GroupEdit({ 22905 attributes, 22906 name, 22907 setAttributes, 22908 clientId 22909 }) { 22910 const { 22911 hasInnerBlocks, 22912 themeSupportsLayout 22913 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 22914 const { 22915 getBlock, 22916 getSettings 22917 } = select(external_wp_blockEditor_namespaceObject.store); 22918 const block = getBlock(clientId); 22919 return { 22920 hasInnerBlocks: !!(block && block.innerBlocks.length), 22921 themeSupportsLayout: getSettings()?.supportsLayout 22922 }; 22923 }, [clientId]); 22924 const { 22925 tagName: TagName = 'div', 22926 templateLock, 22927 allowedBlocks, 22928 layout = {} 22929 } = attributes; 22930 22931 // Layout settings. 22932 const { 22933 type = 'default' 22934 } = layout; 22935 const layoutSupportEnabled = themeSupportsLayout || type === 'flex' || type === 'grid'; 22936 22937 // Hooks. 22938 const ref = (0,external_wp_element_namespaceObject.useRef)(); 22939 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 22940 ref 22941 }); 22942 const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({ 22943 attributes, 22944 usedLayoutType: type, 22945 hasInnerBlocks 22946 }); 22947 22948 // Default to the regular appender being rendered. 22949 let renderAppender; 22950 if (showPlaceholder) { 22951 // In the placeholder state, ensure the appender is not rendered. 22952 // This is needed because `...innerBlocksProps` is used in the placeholder 22953 // state so that blocks can dragged onto the placeholder area 22954 // from both the list view and in the editor canvas. 22955 renderAppender = false; 22956 } else if (!hasInnerBlocks) { 22957 // When there is no placeholder, but the block is also empty, 22958 // use the larger button appender. 22959 renderAppender = external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; 22960 } 22961 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : { 22962 className: 'wp-block-group__inner-container' 22963 }, { 22964 dropZoneElement: ref.current, 22965 templateLock, 22966 allowedBlocks, 22967 renderAppender 22968 }); 22969 const { 22970 selectBlock 22971 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 22972 const selectVariation = nextVariation => { 22973 setAttributes(nextVariation.attributes); 22974 selectBlock(clientId, -1); 22975 setShowPlaceholder(false); 22976 }; 22977 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(GroupEditControls, { 22978 tagName: TagName, 22979 onSelectTagName: value => setAttributes({ 22980 tagName: value 22981 }) 22982 }), showPlaceholder && (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, null, innerBlocksProps.children, (0,external_React_namespaceObject.createElement)(placeholder, { 22983 name: name, 22984 onSelect: selectVariation 22985 })), layoutSupportEnabled && !showPlaceholder && (0,external_React_namespaceObject.createElement)(TagName, { 22986 ...innerBlocksProps 22987 }), !layoutSupportEnabled && !showPlaceholder && (0,external_React_namespaceObject.createElement)(TagName, { 22988 ...blockProps 22989 }, (0,external_React_namespaceObject.createElement)("div", { 22990 ...innerBlocksProps 22991 }))); 22992 } 22993 /* harmony default export */ const group_edit = (GroupEdit); 22994 22995 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js 22996 22997 /** 22998 * WordPress dependencies 22999 */ 23000 23001 function group_save_save({ 23002 attributes: { 23003 tagName: Tag 23004 } 23005 }) { 23006 return (0,external_React_namespaceObject.createElement)(Tag, { 23007 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) 23008 }); 23009 } 23010 23011 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/transforms.js 23012 /** 23013 * WordPress dependencies 23014 */ 23015 23016 const group_transforms_transforms = { 23017 from: [{ 23018 type: 'block', 23019 isMultiBlock: true, 23020 blocks: ['*'], 23021 __experimentalConvert(blocks) { 23022 const alignments = ['wide', 'full']; 23023 23024 // Determine the widest setting of all the blocks to be grouped 23025 const widestAlignment = blocks.reduce((accumulator, block) => { 23026 const { 23027 align 23028 } = block.attributes; 23029 return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator; 23030 }, undefined); 23031 23032 // Clone the Blocks to be Grouped 23033 // Failing to create new block references causes the original blocks 23034 // to be replaced in the switchToBlockType call thereby meaning they 23035 // are removed both from their original location and within the 23036 // new group block. 23037 const groupInnerBlocks = blocks.map(block => { 23038 return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks); 23039 }); 23040 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 23041 align: widestAlignment, 23042 layout: { 23043 type: 'constrained' 23044 } 23045 }, groupInnerBlocks); 23046 } 23047 }] 23048 }; 23049 /* harmony default export */ const group_transforms = (group_transforms_transforms); 23050 23051 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/row.js 23052 23053 /** 23054 * WordPress dependencies 23055 */ 23056 23057 const row = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 23058 xmlns: "http://www.w3.org/2000/svg", 23059 viewBox: "0 0 24 24" 23060 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 23061 d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" 23062 })); 23063 /* harmony default export */ const library_row = (row); 23064 23065 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js 23066 23067 /** 23068 * WordPress dependencies 23069 */ 23070 23071 const stack = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 23072 xmlns: "http://www.w3.org/2000/svg", 23073 viewBox: "0 0 24 24" 23074 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 23075 d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" 23076 })); 23077 /* harmony default export */ const library_stack = (stack); 23078 23079 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js 23080 23081 /** 23082 * WordPress dependencies 23083 */ 23084 23085 const grid = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 23086 xmlns: "http://www.w3.org/2000/svg", 23087 viewBox: "0 0 24 24" 23088 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 23089 d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z", 23090 fillRule: "evenodd", 23091 clipRule: "evenodd" 23092 })); 23093 /* harmony default export */ const library_grid = (grid); 23094 23095 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js 23096 /** 23097 * WordPress dependencies 23098 */ 23099 23100 23101 const group_variations_variations = [{ 23102 name: 'group', 23103 title: (0,external_wp_i18n_namespaceObject.__)('Group'), 23104 description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a container.'), 23105 attributes: { 23106 layout: { 23107 type: 'constrained' 23108 } 23109 }, 23110 isDefault: true, 23111 scope: ['block', 'inserter', 'transform'], 23112 isActive: blockAttributes => !blockAttributes.layout || !blockAttributes.layout?.type || blockAttributes.layout?.type === 'default' || blockAttributes.layout?.type === 'constrained', 23113 icon: library_group 23114 }, { 23115 name: 'group-row', 23116 title: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'), 23117 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'), 23118 attributes: { 23119 layout: { 23120 type: 'flex', 23121 flexWrap: 'nowrap' 23122 } 23123 }, 23124 scope: ['block', 'inserter', 'transform'], 23125 isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && (!blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal'), 23126 icon: library_row 23127 }, { 23128 name: 'group-stack', 23129 title: (0,external_wp_i18n_namespaceObject.__)('Stack'), 23130 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'), 23131 attributes: { 23132 layout: { 23133 type: 'flex', 23134 orientation: 'vertical' 23135 } 23136 }, 23137 scope: ['block', 'inserter', 'transform'], 23138 isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical', 23139 icon: library_stack 23140 }]; 23141 if (window?.__experimentalEnableGroupGridVariation) { 23142 group_variations_variations.push({ 23143 name: 'group-grid', 23144 title: (0,external_wp_i18n_namespaceObject.__)('Grid'), 23145 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks in a grid.'), 23146 attributes: { 23147 layout: { 23148 type: 'grid' 23149 } 23150 }, 23151 scope: ['block', 'inserter', 'transform'], 23152 isActive: blockAttributes => blockAttributes.layout?.type === 'grid', 23153 icon: library_grid 23154 }); 23155 } 23156 /* harmony default export */ const group_variations = (group_variations_variations); 23157 23158 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js 23159 /** 23160 * WordPress dependencies 23161 */ 23162 23163 23164 23165 /** 23166 * Internal dependencies 23167 */ 23168 23169 23170 23171 const group_metadata = { 23172 $schema: "https://schemas.wp.org/trunk/block.json", 23173 apiVersion: 3, 23174 name: "core/group", 23175 title: "Group", 23176 category: "design", 23177 description: "Gather blocks in a layout container.", 23178 keywords: ["container", "wrapper", "row", "section"], 23179 textdomain: "default", 23180 attributes: { 23181 tagName: { 23182 type: "string", 23183 "default": "div" 23184 }, 23185 templateLock: { 23186 type: ["string", "boolean"], 23187 "enum": ["all", "insert", "contentOnly", false] 23188 }, 23189 allowedBlocks: { 23190 type: "array" 23191 } 23192 }, 23193 supports: { 23194 __experimentalOnEnter: true, 23195 __experimentalOnMerge: true, 23196 __experimentalSettings: true, 23197 align: ["wide", "full"], 23198 anchor: true, 23199 ariaLabel: true, 23200 html: false, 23201 background: { 23202 backgroundImage: true, 23203 backgroundSize: true, 23204 __experimentalDefaultControls: { 23205 backgroundImage: true 23206 } 23207 }, 23208 color: { 23209 gradients: true, 23210 heading: true, 23211 button: true, 23212 link: true, 23213 __experimentalDefaultControls: { 23214 background: true, 23215 text: true 23216 } 23217 }, 23218 spacing: { 23219 margin: ["top", "bottom"], 23220 padding: true, 23221 blockGap: true, 23222 __experimentalDefaultControls: { 23223 padding: true, 23224 blockGap: true 23225 } 23226 }, 23227 dimensions: { 23228 minHeight: true 23229 }, 23230 __experimentalBorder: { 23231 color: true, 23232 radius: true, 23233 style: true, 23234 width: true, 23235 __experimentalDefaultControls: { 23236 color: true, 23237 radius: true, 23238 style: true, 23239 width: true 23240 } 23241 }, 23242 position: { 23243 sticky: true 23244 }, 23245 typography: { 23246 fontSize: true, 23247 lineHeight: true, 23248 __experimentalFontFamily: true, 23249 __experimentalFontWeight: true, 23250 __experimentalFontStyle: true, 23251 __experimentalTextTransform: true, 23252 __experimentalTextDecoration: true, 23253 __experimentalLetterSpacing: true, 23254 __experimentalDefaultControls: { 23255 fontSize: true 23256 } 23257 }, 23258 layout: { 23259 allowSizingOnChildren: true 23260 }, 23261 interactivity: { 23262 clientNavigation: true 23263 } 23264 }, 23265 editorStyle: "wp-block-group-editor", 23266 style: "wp-block-group" 23267 }; 23268 23269 23270 23271 const { 23272 name: group_name 23273 } = group_metadata; 23274 23275 const group_settings = { 23276 icon: library_group, 23277 example: { 23278 attributes: { 23279 style: { 23280 color: { 23281 text: '#000000', 23282 background: '#ffffff' 23283 } 23284 } 23285 }, 23286 innerBlocks: [{ 23287 name: 'core/paragraph', 23288 attributes: { 23289 customTextColor: '#cf2e2e', 23290 fontSize: 'large', 23291 content: (0,external_wp_i18n_namespaceObject.__)('One.') 23292 } 23293 }, { 23294 name: 'core/paragraph', 23295 attributes: { 23296 customTextColor: '#ff6900', 23297 fontSize: 'large', 23298 content: (0,external_wp_i18n_namespaceObject.__)('Two.') 23299 } 23300 }, { 23301 name: 'core/paragraph', 23302 attributes: { 23303 customTextColor: '#fcb900', 23304 fontSize: 'large', 23305 content: (0,external_wp_i18n_namespaceObject.__)('Three.') 23306 } 23307 }, { 23308 name: 'core/paragraph', 23309 attributes: { 23310 customTextColor: '#00d084', 23311 fontSize: 'large', 23312 content: (0,external_wp_i18n_namespaceObject.__)('Four.') 23313 } 23314 }, { 23315 name: 'core/paragraph', 23316 attributes: { 23317 customTextColor: '#0693e3', 23318 fontSize: 'large', 23319 content: (0,external_wp_i18n_namespaceObject.__)('Five.') 23320 } 23321 }, { 23322 name: 'core/paragraph', 23323 attributes: { 23324 customTextColor: '#9b51e0', 23325 fontSize: 'large', 23326 content: (0,external_wp_i18n_namespaceObject.__)('Six.') 23327 } 23328 }] 23329 }, 23330 transforms: group_transforms, 23331 edit: group_edit, 23332 save: group_save_save, 23333 deprecated: group_deprecated, 23334 variations: group_variations 23335 }; 23336 const group_init = () => initBlock({ 23337 name: group_name, 23338 metadata: group_metadata, 23339 settings: group_settings 23340 }); 23341 23342 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js 23343 23344 /** 23345 * WordPress dependencies 23346 */ 23347 23348 const heading = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 23349 xmlns: "http://www.w3.org/2000/svg", 23350 viewBox: "0 0 24 24" 23351 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 23352 d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z" 23353 })); 23354 /* harmony default export */ const library_heading = (heading); 23355 23356 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js 23357 23358 /** 23359 * External dependencies 23360 */ 23361 23362 23363 /** 23364 * WordPress dependencies 23365 */ 23366 23367 const blockSupports = { 23368 className: false, 23369 anchor: true 23370 }; 23371 const heading_deprecated_blockAttributes = { 23372 align: { 23373 type: 'string' 23374 }, 23375 content: { 23376 type: 'string', 23377 source: 'html', 23378 selector: 'h1,h2,h3,h4,h5,h6', 23379 default: '' 23380 }, 23381 level: { 23382 type: 'number', 23383 default: 2 23384 }, 23385 placeholder: { 23386 type: 'string' 23387 } 23388 }; 23389 const deprecated_migrateCustomColors = attributes => { 23390 if (!attributes.customTextColor) { 23391 return attributes; 23392 } 23393 const style = { 23394 color: { 23395 text: attributes.customTextColor 23396 } 23397 }; 23398 const { 23399 customTextColor, 23400 ...restAttributes 23401 } = attributes; 23402 return { 23403 ...restAttributes, 23404 style 23405 }; 23406 }; 23407 const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; 23408 const migrateTextAlign = attributes => { 23409 const { 23410 align, 23411 ...rest 23412 } = attributes; 23413 return TEXT_ALIGN_OPTIONS.includes(align) ? { 23414 ...rest, 23415 textAlign: align 23416 } : attributes; 23417 }; 23418 const heading_deprecated_v1 = { 23419 supports: blockSupports, 23420 attributes: { 23421 ...heading_deprecated_blockAttributes, 23422 customTextColor: { 23423 type: 'string' 23424 }, 23425 textColor: { 23426 type: 'string' 23427 } 23428 }, 23429 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 23430 save({ 23431 attributes 23432 }) { 23433 const { 23434 align, 23435 level, 23436 content, 23437 textColor, 23438 customTextColor 23439 } = attributes; 23440 const tagName = 'h' + level; 23441 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 23442 const className = classnames_default()({ 23443 [textClass]: textClass 23444 }); 23445 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23446 className: className ? className : undefined, 23447 tagName: tagName, 23448 style: { 23449 textAlign: align, 23450 color: textClass ? undefined : customTextColor 23451 }, 23452 value: content 23453 }); 23454 } 23455 }; 23456 const heading_deprecated_v2 = { 23457 attributes: { 23458 ...heading_deprecated_blockAttributes, 23459 customTextColor: { 23460 type: 'string' 23461 }, 23462 textColor: { 23463 type: 'string' 23464 } 23465 }, 23466 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 23467 save({ 23468 attributes 23469 }) { 23470 const { 23471 align, 23472 content, 23473 customTextColor, 23474 level, 23475 textColor 23476 } = attributes; 23477 const tagName = 'h' + level; 23478 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 23479 const className = classnames_default()({ 23480 [textClass]: textClass, 23481 [`has-text-align-$align}`]: align 23482 }); 23483 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23484 className: className ? className : undefined, 23485 tagName: tagName, 23486 style: { 23487 color: textClass ? undefined : customTextColor 23488 }, 23489 value: content 23490 }); 23491 }, 23492 supports: blockSupports 23493 }; 23494 const heading_deprecated_v3 = { 23495 supports: blockSupports, 23496 attributes: { 23497 ...heading_deprecated_blockAttributes, 23498 customTextColor: { 23499 type: 'string' 23500 }, 23501 textColor: { 23502 type: 'string' 23503 } 23504 }, 23505 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 23506 save({ 23507 attributes 23508 }) { 23509 const { 23510 align, 23511 content, 23512 customTextColor, 23513 level, 23514 textColor 23515 } = attributes; 23516 const tagName = 'h' + level; 23517 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 23518 const className = classnames_default()({ 23519 [textClass]: textClass, 23520 'has-text-color': textColor || customTextColor, 23521 [`has-text-align-$align}`]: align 23522 }); 23523 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23524 className: className ? className : undefined, 23525 tagName: tagName, 23526 style: { 23527 color: textClass ? undefined : customTextColor 23528 }, 23529 value: content 23530 }); 23531 } 23532 }; 23533 const heading_deprecated_v4 = { 23534 supports: { 23535 align: ['wide', 'full'], 23536 anchor: true, 23537 className: false, 23538 color: { 23539 link: true 23540 }, 23541 fontSize: true, 23542 lineHeight: true, 23543 __experimentalSelector: { 23544 'core/heading/h1': 'h1', 23545 'core/heading/h2': 'h2', 23546 'core/heading/h3': 'h3', 23547 'core/heading/h4': 'h4', 23548 'core/heading/h5': 'h5', 23549 'core/heading/h6': 'h6' 23550 }, 23551 __unstablePasteTextInline: true 23552 }, 23553 attributes: heading_deprecated_blockAttributes, 23554 isEligible: ({ 23555 align 23556 }) => TEXT_ALIGN_OPTIONS.includes(align), 23557 migrate: migrateTextAlign, 23558 save({ 23559 attributes 23560 }) { 23561 const { 23562 align, 23563 content, 23564 level 23565 } = attributes; 23566 const TagName = 'h' + level; 23567 const className = classnames_default()({ 23568 [`has-text-align-$align}`]: align 23569 }); 23570 return (0,external_React_namespaceObject.createElement)(TagName, { 23571 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 23572 className 23573 }) 23574 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23575 value: content 23576 })); 23577 } 23578 }; 23579 23580 // This deprecation covers the serialization of the `wp-block-heading` class 23581 // into the block's markup after className support was enabled. 23582 const heading_deprecated_v5 = { 23583 supports: { 23584 align: ['wide', 'full'], 23585 anchor: true, 23586 className: false, 23587 color: { 23588 gradients: true, 23589 link: true, 23590 __experimentalDefaultControls: { 23591 background: true, 23592 text: true 23593 } 23594 }, 23595 spacing: { 23596 margin: true, 23597 padding: true 23598 }, 23599 typography: { 23600 fontSize: true, 23601 lineHeight: true, 23602 __experimentalFontFamily: true, 23603 __experimentalFontStyle: true, 23604 __experimentalFontWeight: true, 23605 __experimentalLetterSpacing: true, 23606 __experimentalTextTransform: true, 23607 __experimentalTextDecoration: true, 23608 __experimentalDefaultControls: { 23609 fontSize: true, 23610 fontAppearance: true, 23611 textTransform: true 23612 } 23613 }, 23614 __experimentalSelector: 'h1,h2,h3,h4,h5,h6', 23615 __unstablePasteTextInline: true, 23616 __experimentalSlashInserter: true 23617 }, 23618 attributes: { 23619 textAlign: { 23620 type: 'string' 23621 }, 23622 content: { 23623 type: 'string', 23624 source: 'html', 23625 selector: 'h1,h2,h3,h4,h5,h6', 23626 default: '', 23627 __experimentalRole: 'content' 23628 }, 23629 level: { 23630 type: 'number', 23631 default: 2 23632 }, 23633 placeholder: { 23634 type: 'string' 23635 } 23636 }, 23637 save({ 23638 attributes 23639 }) { 23640 const { 23641 textAlign, 23642 content, 23643 level 23644 } = attributes; 23645 const TagName = 'h' + level; 23646 const className = classnames_default()({ 23647 [`has-text-align-$textAlign}`]: textAlign 23648 }); 23649 return (0,external_React_namespaceObject.createElement)(TagName, { 23650 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 23651 className 23652 }) 23653 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23654 value: content 23655 })); 23656 } 23657 }; 23658 const heading_deprecated_deprecated = [heading_deprecated_v5, heading_deprecated_v4, heading_deprecated_v3, heading_deprecated_v2, heading_deprecated_v1]; 23659 /* harmony default export */ const heading_deprecated = (heading_deprecated_deprecated); 23660 23661 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js 23662 /** 23663 * External dependencies 23664 */ 23665 23666 23667 /** 23668 * Object map tracking anchors. 23669 * 23670 * @type {Record<string, string | null>} 23671 */ 23672 const autogenerate_anchors_anchors = {}; 23673 23674 /** 23675 * Returns the text without markup. 23676 * 23677 * @param {string} text The text. 23678 * 23679 * @return {string} The text without markup. 23680 */ 23681 const getTextWithoutMarkup = text => { 23682 const dummyElement = document.createElement('div'); 23683 dummyElement.innerHTML = text; 23684 return dummyElement.innerText; 23685 }; 23686 23687 /** 23688 * Get the slug from the content. 23689 * 23690 * @param {string} content The block content. 23691 * 23692 * @return {string} Returns the slug. 23693 */ 23694 const getSlug = content => { 23695 // Get the slug. 23696 return remove_accents_default()(getTextWithoutMarkup(content)) 23697 // Convert anything that's not a letter or number to a hyphen. 23698 .replace(/[^\p{L}\p{N}]+/gu, '-') 23699 // Convert to lowercase 23700 .toLowerCase() 23701 // Remove any remaining leading or trailing hyphens. 23702 .replace(/(^-+)|(-+$)/g, ''); 23703 }; 23704 23705 /** 23706 * Generate the anchor for a heading. 23707 * 23708 * @param {string} clientId The block ID. 23709 * @param {string} content The block content. 23710 * 23711 * @return {string|null} Return the heading anchor. 23712 */ 23713 const generateAnchor = (clientId, content) => { 23714 const slug = getSlug(content); 23715 // If slug is empty, then return null. 23716 // Returning null instead of an empty string allows us to check again when the content changes. 23717 if ('' === slug) { 23718 return null; 23719 } 23720 delete autogenerate_anchors_anchors[clientId]; 23721 let anchor = slug; 23722 let i = 0; 23723 23724 // If the anchor already exists in another heading, append -i. 23725 while (Object.values(autogenerate_anchors_anchors).includes(anchor)) { 23726 i += 1; 23727 anchor = slug + '-' + i; 23728 } 23729 return anchor; 23730 }; 23731 23732 /** 23733 * Set the anchor for a heading. 23734 * 23735 * @param {string} clientId The block ID. 23736 * @param {string|null} anchor The block anchor. 23737 */ 23738 const setAnchor = (clientId, anchor) => { 23739 autogenerate_anchors_anchors[clientId] = anchor; 23740 }; 23741 23742 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js 23743 23744 /** 23745 * External dependencies 23746 */ 23747 23748 23749 /** 23750 * WordPress dependencies 23751 */ 23752 23753 23754 23755 23756 23757 23758 /** 23759 * Internal dependencies 23760 */ 23761 23762 function HeadingEdit({ 23763 attributes, 23764 setAttributes, 23765 mergeBlocks, 23766 onReplace, 23767 style, 23768 clientId 23769 }) { 23770 const { 23771 textAlign, 23772 content, 23773 level, 23774 placeholder, 23775 anchor 23776 } = attributes; 23777 const tagName = 'h' + level; 23778 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 23779 className: classnames_default()({ 23780 [`has-text-align-$textAlign}`]: textAlign 23781 }), 23782 style 23783 }); 23784 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 23785 const { 23786 canGenerateAnchors 23787 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 23788 const { 23789 getGlobalBlockCount, 23790 getSettings 23791 } = select(external_wp_blockEditor_namespaceObject.store); 23792 const settings = getSettings(); 23793 return { 23794 canGenerateAnchors: !!settings.generateAnchors || getGlobalBlockCount('core/table-of-contents') > 0 23795 }; 23796 }, []); 23797 const { 23798 __unstableMarkNextChangeAsNotPersistent 23799 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 23800 23801 // Initially set anchor for headings that have content but no anchor set. 23802 // This is used when transforming a block to heading, or for legacy anchors. 23803 (0,external_wp_element_namespaceObject.useEffect)(() => { 23804 if (!canGenerateAnchors) { 23805 return; 23806 } 23807 if (!anchor && content) { 23808 // This side-effect should not create an undo level. 23809 __unstableMarkNextChangeAsNotPersistent(); 23810 setAttributes({ 23811 anchor: generateAnchor(clientId, content) 23812 }); 23813 } 23814 setAnchor(clientId, anchor); 23815 23816 // Remove anchor map when block unmounts. 23817 return () => setAnchor(clientId, null); 23818 }, [anchor, content, clientId, canGenerateAnchors]); 23819 const onContentChange = value => { 23820 const newAttrs = { 23821 content: value 23822 }; 23823 if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) { 23824 newAttrs.anchor = generateAnchor(clientId, value); 23825 } 23826 setAttributes(newAttrs); 23827 }; 23828 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 23829 group: "block" 23830 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 23831 value: level, 23832 onChange: newLevel => setAttributes({ 23833 level: newLevel 23834 }) 23835 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 23836 value: textAlign, 23837 onChange: nextAlign => { 23838 setAttributes({ 23839 textAlign: nextAlign 23840 }); 23841 } 23842 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 23843 identifier: "content", 23844 tagName: tagName, 23845 value: content, 23846 onChange: onContentChange, 23847 onMerge: mergeBlocks, 23848 onSplit: (value, isOriginal) => { 23849 let block; 23850 if (isOriginal || value) { 23851 block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 23852 ...attributes, 23853 content: value 23854 }); 23855 } else { 23856 var _getDefaultBlockName; 23857 block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading'); 23858 } 23859 if (isOriginal) { 23860 block.clientId = clientId; 23861 } 23862 return block; 23863 }, 23864 onReplace: onReplace, 23865 onRemove: () => onReplace([]), 23866 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'), 23867 textAlign: textAlign, 23868 ...(external_wp_element_namespaceObject.Platform.isNative && { 23869 deleteEnter: true 23870 }), 23871 ...blockProps 23872 })); 23873 } 23874 /* harmony default export */ const heading_edit = (HeadingEdit); 23875 23876 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js 23877 23878 /** 23879 * External dependencies 23880 */ 23881 23882 23883 /** 23884 * WordPress dependencies 23885 */ 23886 23887 function heading_save_save({ 23888 attributes 23889 }) { 23890 const { 23891 textAlign, 23892 content, 23893 level 23894 } = attributes; 23895 const TagName = 'h' + level; 23896 const className = classnames_default()({ 23897 [`has-text-align-$textAlign}`]: textAlign 23898 }); 23899 return (0,external_React_namespaceObject.createElement)(TagName, { 23900 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 23901 className 23902 }) 23903 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 23904 value: content 23905 })); 23906 } 23907 23908 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js 23909 /** 23910 * Given a node name string for a heading node, returns its numeric level. 23911 * 23912 * @param {string} nodeName Heading node name. 23913 * 23914 * @return {number} Heading level. 23915 */ 23916 function getLevelFromHeadingNodeName(nodeName) { 23917 return Number(nodeName.substr(1)); 23918 } 23919 23920 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js 23921 /** 23922 * WordPress dependencies 23923 */ 23924 23925 23926 /** 23927 * Internal dependencies 23928 */ 23929 23930 23931 const heading_transforms_transforms = { 23932 from: [{ 23933 type: 'block', 23934 isMultiBlock: true, 23935 blocks: ['core/paragraph'], 23936 transform: attributes => attributes.map(({ 23937 content, 23938 anchor, 23939 align: textAlign, 23940 metadata 23941 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 23942 content, 23943 anchor, 23944 textAlign, 23945 metadata: getTransformedMetadata(metadata, 'core/heading', ({ 23946 content: contentBinding 23947 }) => ({ 23948 content: contentBinding 23949 })) 23950 })) 23951 }, { 23952 type: 'raw', 23953 selector: 'h1,h2,h3,h4,h5,h6', 23954 schema: ({ 23955 phrasingContentSchema, 23956 isPaste 23957 }) => { 23958 const schema = { 23959 children: phrasingContentSchema, 23960 attributes: isPaste ? [] : ['style', 'id'] 23961 }; 23962 return { 23963 h1: schema, 23964 h2: schema, 23965 h3: schema, 23966 h4: schema, 23967 h5: schema, 23968 h6: schema 23969 }; 23970 }, 23971 transform(node) { 23972 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/heading', node.outerHTML); 23973 const { 23974 textAlign 23975 } = node.style || {}; 23976 attributes.level = getLevelFromHeadingNodeName(node.nodeName); 23977 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 23978 attributes.align = textAlign; 23979 } 23980 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', attributes); 23981 } 23982 }, ...[1, 2, 3, 4, 5, 6].map(level => ({ 23983 type: 'prefix', 23984 prefix: Array(level + 1).join('#'), 23985 transform(content) { 23986 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 23987 level, 23988 content 23989 }); 23990 } 23991 })), ...[1, 2, 3, 4, 5, 6].map(level => ({ 23992 type: 'enter', 23993 regExp: new RegExp(`^/(h|H)$level}$`), 23994 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 23995 level 23996 }) 23997 }))], 23998 to: [{ 23999 type: 'block', 24000 isMultiBlock: true, 24001 blocks: ['core/paragraph'], 24002 transform: attributes => attributes.map(({ 24003 content, 24004 textAlign: align, 24005 metadata 24006 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 24007 content, 24008 align, 24009 metadata: getTransformedMetadata(metadata, 'core/paragraph', ({ 24010 content: contentBinding 24011 }) => ({ 24012 content: contentBinding 24013 })) 24014 })) 24015 }] 24016 }; 24017 /* harmony default export */ const heading_transforms = (heading_transforms_transforms); 24018 24019 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js 24020 /** 24021 * WordPress dependencies 24022 */ 24023 24024 24025 24026 /** 24027 * Internal dependencies 24028 */ 24029 24030 24031 24032 const heading_metadata = { 24033 $schema: "https://schemas.wp.org/trunk/block.json", 24034 apiVersion: 3, 24035 name: "core/heading", 24036 title: "Heading", 24037 category: "text", 24038 description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", 24039 keywords: ["title", "subtitle"], 24040 textdomain: "default", 24041 attributes: { 24042 textAlign: { 24043 type: "string" 24044 }, 24045 content: { 24046 type: "rich-text", 24047 source: "rich-text", 24048 selector: "h1,h2,h3,h4,h5,h6", 24049 __experimentalRole: "content" 24050 }, 24051 level: { 24052 type: "number", 24053 "default": 2 24054 }, 24055 placeholder: { 24056 type: "string" 24057 } 24058 }, 24059 supports: { 24060 align: ["wide", "full"], 24061 anchor: true, 24062 className: true, 24063 color: { 24064 gradients: true, 24065 link: true, 24066 __experimentalDefaultControls: { 24067 background: true, 24068 text: true 24069 } 24070 }, 24071 spacing: { 24072 margin: true, 24073 padding: true, 24074 __experimentalDefaultControls: { 24075 margin: false, 24076 padding: false 24077 } 24078 }, 24079 typography: { 24080 fontSize: true, 24081 lineHeight: true, 24082 __experimentalFontFamily: true, 24083 __experimentalFontStyle: true, 24084 __experimentalFontWeight: true, 24085 __experimentalLetterSpacing: true, 24086 __experimentalTextTransform: true, 24087 __experimentalTextDecoration: true, 24088 __experimentalWritingMode: true, 24089 __experimentalDefaultControls: { 24090 fontSize: true 24091 } 24092 }, 24093 __unstablePasteTextInline: true, 24094 __experimentalSlashInserter: true, 24095 interactivity: { 24096 clientNavigation: true 24097 } 24098 }, 24099 editorStyle: "wp-block-heading-editor", 24100 style: "wp-block-heading" 24101 }; 24102 24103 24104 const { 24105 name: heading_name 24106 } = heading_metadata; 24107 24108 const heading_settings = { 24109 icon: library_heading, 24110 example: { 24111 attributes: { 24112 content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'), 24113 level: 2 24114 } 24115 }, 24116 __experimentalLabel(attributes, { 24117 context 24118 }) { 24119 const { 24120 content, 24121 level 24122 } = attributes; 24123 const customName = attributes?.metadata?.name; 24124 const hasContent = content?.length > 0; 24125 24126 // In the list view, use the block's content as the label. 24127 // If the content is empty, fall back to the default label. 24128 if (context === 'list-view' && (customName || hasContent)) { 24129 return customName || content; 24130 } 24131 if (context === 'accessibility') { 24132 return !hasContent ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: accessibility text. %s: heading level. */ 24133 (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: accessibility text. 1: heading level. 2: heading content. */ 24134 (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content); 24135 } 24136 }, 24137 transforms: heading_transforms, 24138 deprecated: heading_deprecated, 24139 merge(attributes, attributesToMerge) { 24140 return { 24141 content: (attributes.content || '') + (attributesToMerge.content || '') 24142 }; 24143 }, 24144 edit: heading_edit, 24145 save: heading_save_save 24146 }; 24147 const heading_init = () => initBlock({ 24148 name: heading_name, 24149 metadata: heading_metadata, 24150 settings: heading_settings 24151 }); 24152 24153 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js 24154 24155 /** 24156 * WordPress dependencies 24157 */ 24158 24159 const home = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 24160 xmlns: "http://www.w3.org/2000/svg", 24161 viewBox: "0 0 24 24" 24162 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 24163 d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" 24164 })); 24165 /* harmony default export */ const library_home = (home); 24166 24167 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/edit.js 24168 24169 /** 24170 * External dependencies 24171 */ 24172 24173 24174 /** 24175 * WordPress dependencies 24176 */ 24177 24178 24179 24180 24181 24182 const preventDefault = event => event.preventDefault(); 24183 function HomeEdit({ 24184 attributes, 24185 setAttributes, 24186 context 24187 }) { 24188 const { 24189 homeUrl 24190 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 24191 const { 24192 getUnstableBase // Site index. 24193 } = select(external_wp_coreData_namespaceObject.store); 24194 return { 24195 homeUrl: getUnstableBase()?.home 24196 }; 24197 }, []); 24198 const { 24199 __unstableMarkNextChangeAsNotPersistent 24200 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 24201 const { 24202 textColor, 24203 backgroundColor, 24204 style 24205 } = context; 24206 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 24207 className: classnames_default()('wp-block-navigation-item', { 24208 'has-text-color': !!textColor || !!style?.color?.text, 24209 [`has-$textColor}-color`]: !!textColor, 24210 'has-background': !!backgroundColor || !!style?.color?.background, 24211 [`has-$backgroundColor}-background-color`]: !!backgroundColor 24212 }), 24213 style: { 24214 color: style?.color?.text, 24215 backgroundColor: style?.color?.background 24216 } 24217 }); 24218 const { 24219 label 24220 } = attributes; 24221 (0,external_wp_element_namespaceObject.useEffect)(() => { 24222 if (label === undefined) { 24223 __unstableMarkNextChangeAsNotPersistent(); 24224 setAttributes({ 24225 label: (0,external_wp_i18n_namespaceObject.__)('Home') 24226 }); 24227 } 24228 }, [label]); 24229 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", { 24230 ...blockProps 24231 }, (0,external_React_namespaceObject.createElement)("a", { 24232 className: "wp-block-home-link__content wp-block-navigation-item__content", 24233 href: homeUrl, 24234 onClick: preventDefault 24235 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 24236 identifier: "label", 24237 className: "wp-block-home-link__label", 24238 value: label, 24239 onChange: labelValue => { 24240 setAttributes({ 24241 label: labelValue 24242 }); 24243 }, 24244 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'), 24245 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'), 24246 withoutInteractiveFormatting: true, 24247 allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'] 24248 })))); 24249 } 24250 24251 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/save.js 24252 24253 /** 24254 * WordPress dependencies 24255 */ 24256 24257 function home_link_save_save() { 24258 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 24259 } 24260 24261 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/index.js 24262 /** 24263 * WordPress dependencies 24264 */ 24265 24266 24267 24268 /** 24269 * Internal dependencies 24270 */ 24271 24272 const home_link_metadata = { 24273 $schema: "https://schemas.wp.org/trunk/block.json", 24274 apiVersion: 3, 24275 name: "core/home-link", 24276 category: "design", 24277 parent: ["core/navigation"], 24278 title: "Home Link", 24279 description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.", 24280 textdomain: "default", 24281 attributes: { 24282 label: { 24283 type: "string" 24284 } 24285 }, 24286 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"], 24287 supports: { 24288 reusable: false, 24289 html: false, 24290 typography: { 24291 fontSize: true, 24292 lineHeight: true, 24293 __experimentalFontFamily: true, 24294 __experimentalFontWeight: true, 24295 __experimentalFontStyle: true, 24296 __experimentalTextTransform: true, 24297 __experimentalTextDecoration: true, 24298 __experimentalLetterSpacing: true, 24299 __experimentalDefaultControls: { 24300 fontSize: true 24301 } 24302 }, 24303 interactivity: { 24304 clientNavigation: true 24305 } 24306 }, 24307 editorStyle: "wp-block-home-link-editor", 24308 style: "wp-block-home-link" 24309 }; 24310 24311 24312 const { 24313 name: home_link_name 24314 } = home_link_metadata; 24315 24316 const home_link_settings = { 24317 icon: library_home, 24318 edit: HomeEdit, 24319 save: home_link_save_save, 24320 example: { 24321 attributes: { 24322 label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example') 24323 } 24324 } 24325 }; 24326 const home_link_init = () => initBlock({ 24327 name: home_link_name, 24328 metadata: home_link_metadata, 24329 settings: home_link_settings 24330 }); 24331 24332 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js 24333 24334 /** 24335 * WordPress dependencies 24336 */ 24337 24338 const html = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 24339 viewBox: "0 0 24 24", 24340 xmlns: "http://www.w3.org/2000/svg" 24341 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 24342 d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z" 24343 })); 24344 /* harmony default export */ const library_html = (html); 24345 24346 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/preview.js 24347 24348 /** 24349 * WordPress dependencies 24350 */ 24351 24352 24353 24354 24355 24356 24357 // Default styles used to unset some of the styles 24358 // that might be inherited from the editor style. 24359 const DEFAULT_STYLES = ` 24360 html,body,:root { 24361 margin: 0 !important; 24362 padding: 0 !important; 24363 overflow: visible !important; 24364 min-height: auto !important; 24365 } 24366 `; 24367 function HTMLEditPreview({ 24368 content, 24369 isSelected 24370 }) { 24371 const settingStyles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles); 24372 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [DEFAULT_STYLES, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(settingStyles.filter(style => style.css))], [settingStyles]); 24373 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, { 24374 html: content, 24375 styles: styles, 24376 title: (0,external_wp_i18n_namespaceObject.__)('Custom HTML Preview'), 24377 tabIndex: -1 24378 }), !isSelected && (0,external_React_namespaceObject.createElement)("div", { 24379 className: "block-library-html__preview-overlay" 24380 })); 24381 } 24382 24383 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js 24384 24385 /** 24386 * WordPress dependencies 24387 */ 24388 24389 24390 24391 24392 24393 24394 /** 24395 * Internal dependencies 24396 */ 24397 24398 function HTMLEdit({ 24399 attributes, 24400 setAttributes, 24401 isSelected 24402 }) { 24403 const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)(); 24404 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 24405 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(HTMLEdit, 'html-edit-desc'); 24406 function switchToPreview() { 24407 setIsPreview(true); 24408 } 24409 function switchToHTML() { 24410 setIsPreview(false); 24411 } 24412 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 24413 className: 'block-library-html__edit', 24414 'aria-describedby': isPreview ? instanceId : undefined 24415 }); 24416 return (0,external_React_namespaceObject.createElement)("div", { 24417 ...blockProps 24418 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 24419 className: "components-tab-button", 24420 isPressed: !isPreview, 24421 onClick: switchToHTML 24422 }, "HTML"), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 24423 className: "components-tab-button", 24424 isPressed: isPreview, 24425 onClick: switchToPreview 24426 }, (0,external_wp_i18n_namespaceObject.__)('Preview')))), isPreview || isDisabled ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(HTMLEditPreview, { 24427 content: attributes.content, 24428 isSelected: isSelected 24429 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { 24430 id: instanceId 24431 }, (0,external_wp_i18n_namespaceObject.__)('HTML preview is not yet fully accessible. Please switch screen reader to virtualized mode to navigate the below iFrame.'))) : (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 24432 value: attributes.content, 24433 onChange: content => setAttributes({ 24434 content 24435 }), 24436 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'), 24437 "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML') 24438 })); 24439 } 24440 24441 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js 24442 24443 /** 24444 * WordPress dependencies 24445 */ 24446 24447 function html_save_save({ 24448 attributes 24449 }) { 24450 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content); 24451 } 24452 24453 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js 24454 /** 24455 * WordPress dependencies 24456 */ 24457 24458 24459 const html_transforms_transforms = { 24460 from: [{ 24461 type: 'block', 24462 blocks: ['core/code'], 24463 transform: ({ 24464 content: html 24465 }) => { 24466 return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { 24467 // The code block may output HTML formatting, so convert it 24468 // to plain text. 24469 content: (0,external_wp_richText_namespaceObject.create)({ 24470 html 24471 }).text 24472 }); 24473 } 24474 }] 24475 }; 24476 /* harmony default export */ const html_transforms = (html_transforms_transforms); 24477 24478 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js 24479 /** 24480 * WordPress dependencies 24481 */ 24482 24483 24484 24485 /** 24486 * Internal dependencies 24487 */ 24488 24489 24490 const html_metadata = { 24491 $schema: "https://schemas.wp.org/trunk/block.json", 24492 apiVersion: 3, 24493 name: "core/html", 24494 title: "Custom HTML", 24495 category: "widgets", 24496 description: "Add custom HTML code and preview it as you edit.", 24497 keywords: ["embed"], 24498 textdomain: "default", 24499 attributes: { 24500 content: { 24501 type: "string", 24502 source: "raw" 24503 } 24504 }, 24505 supports: { 24506 customClassName: false, 24507 className: false, 24508 html: false, 24509 interactivity: { 24510 clientNavigation: true 24511 } 24512 }, 24513 editorStyle: "wp-block-html-editor" 24514 }; 24515 24516 24517 const { 24518 name: html_name 24519 } = html_metadata; 24520 24521 const html_settings = { 24522 icon: library_html, 24523 example: { 24524 attributes: { 24525 content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>' 24526 } 24527 }, 24528 edit: HTMLEdit, 24529 save: html_save_save, 24530 transforms: html_transforms 24531 }; 24532 const html_init = () => initBlock({ 24533 name: html_name, 24534 metadata: html_metadata, 24535 settings: html_settings 24536 }); 24537 24538 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js 24539 24540 /** 24541 * External dependencies 24542 */ 24543 24544 24545 /** 24546 * WordPress dependencies 24547 */ 24548 24549 24550 /** 24551 * Deprecation for adding the `wp-image-${id}` class to the image block for 24552 * responsive images. 24553 * 24554 * @see https://github.com/WordPress/gutenberg/pull/4898 24555 */ 24556 const image_deprecated_v1 = { 24557 attributes: { 24558 url: { 24559 type: 'string', 24560 source: 'attribute', 24561 selector: 'img', 24562 attribute: 'src' 24563 }, 24564 alt: { 24565 type: 'string', 24566 source: 'attribute', 24567 selector: 'img', 24568 attribute: 'alt', 24569 default: '' 24570 }, 24571 caption: { 24572 type: 'array', 24573 source: 'children', 24574 selector: 'figcaption' 24575 }, 24576 href: { 24577 type: 'string', 24578 source: 'attribute', 24579 selector: 'a', 24580 attribute: 'href' 24581 }, 24582 id: { 24583 type: 'number' 24584 }, 24585 align: { 24586 type: 'string' 24587 }, 24588 width: { 24589 type: 'number' 24590 }, 24591 height: { 24592 type: 'number' 24593 } 24594 }, 24595 save({ 24596 attributes 24597 }) { 24598 const { 24599 url, 24600 alt, 24601 caption, 24602 align, 24603 href, 24604 width, 24605 height 24606 } = attributes; 24607 const extraImageProps = width || height ? { 24608 width, 24609 height 24610 } : {}; 24611 const image = (0,external_React_namespaceObject.createElement)("img", { 24612 src: url, 24613 alt: alt, 24614 ...extraImageProps 24615 }); 24616 let figureStyle = {}; 24617 if (width) { 24618 figureStyle = { 24619 width 24620 }; 24621 } else if (align === 'left' || align === 'right') { 24622 figureStyle = { 24623 maxWidth: '50%' 24624 }; 24625 } 24626 return (0,external_React_namespaceObject.createElement)("figure", { 24627 className: align ? `align$align}` : null, 24628 style: figureStyle 24629 }, href ? (0,external_React_namespaceObject.createElement)("a", { 24630 href: href 24631 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24632 tagName: "figcaption", 24633 value: caption 24634 })); 24635 } 24636 }; 24637 24638 /** 24639 * Deprecation for adding the `is-resized` class to the image block to fix 24640 * captions on resized images. 24641 * 24642 * @see https://github.com/WordPress/gutenberg/pull/6496 24643 */ 24644 const image_deprecated_v2 = { 24645 attributes: { 24646 url: { 24647 type: 'string', 24648 source: 'attribute', 24649 selector: 'img', 24650 attribute: 'src' 24651 }, 24652 alt: { 24653 type: 'string', 24654 source: 'attribute', 24655 selector: 'img', 24656 attribute: 'alt', 24657 default: '' 24658 }, 24659 caption: { 24660 type: 'array', 24661 source: 'children', 24662 selector: 'figcaption' 24663 }, 24664 href: { 24665 type: 'string', 24666 source: 'attribute', 24667 selector: 'a', 24668 attribute: 'href' 24669 }, 24670 id: { 24671 type: 'number' 24672 }, 24673 align: { 24674 type: 'string' 24675 }, 24676 width: { 24677 type: 'number' 24678 }, 24679 height: { 24680 type: 'number' 24681 } 24682 }, 24683 save({ 24684 attributes 24685 }) { 24686 const { 24687 url, 24688 alt, 24689 caption, 24690 align, 24691 href, 24692 width, 24693 height, 24694 id 24695 } = attributes; 24696 const image = (0,external_React_namespaceObject.createElement)("img", { 24697 src: url, 24698 alt: alt, 24699 className: id ? `wp-image-$id}` : null, 24700 width: width, 24701 height: height 24702 }); 24703 return (0,external_React_namespaceObject.createElement)("figure", { 24704 className: align ? `align$align}` : null 24705 }, href ? (0,external_React_namespaceObject.createElement)("a", { 24706 href: href 24707 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24708 tagName: "figcaption", 24709 value: caption 24710 })); 24711 } 24712 }; 24713 24714 /** 24715 * Deprecation for image floats including a wrapping div. 24716 * 24717 * @see https://github.com/WordPress/gutenberg/pull/7721 24718 */ 24719 const image_deprecated_v3 = { 24720 attributes: { 24721 url: { 24722 type: 'string', 24723 source: 'attribute', 24724 selector: 'img', 24725 attribute: 'src' 24726 }, 24727 alt: { 24728 type: 'string', 24729 source: 'attribute', 24730 selector: 'img', 24731 attribute: 'alt', 24732 default: '' 24733 }, 24734 caption: { 24735 type: 'array', 24736 source: 'children', 24737 selector: 'figcaption' 24738 }, 24739 href: { 24740 type: 'string', 24741 source: 'attribute', 24742 selector: 'figure > a', 24743 attribute: 'href' 24744 }, 24745 id: { 24746 type: 'number' 24747 }, 24748 align: { 24749 type: 'string' 24750 }, 24751 width: { 24752 type: 'number' 24753 }, 24754 height: { 24755 type: 'number' 24756 }, 24757 linkDestination: { 24758 type: 'string', 24759 default: 'none' 24760 } 24761 }, 24762 save({ 24763 attributes 24764 }) { 24765 const { 24766 url, 24767 alt, 24768 caption, 24769 align, 24770 href, 24771 width, 24772 height, 24773 id 24774 } = attributes; 24775 const classes = classnames_default()({ 24776 [`align$align}`]: align, 24777 'is-resized': width || height 24778 }); 24779 const image = (0,external_React_namespaceObject.createElement)("img", { 24780 src: url, 24781 alt: alt, 24782 className: id ? `wp-image-$id}` : null, 24783 width: width, 24784 height: height 24785 }); 24786 return (0,external_React_namespaceObject.createElement)("figure", { 24787 className: classes 24788 }, href ? (0,external_React_namespaceObject.createElement)("a", { 24789 href: href 24790 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24791 tagName: "figcaption", 24792 value: caption 24793 })); 24794 } 24795 }; 24796 24797 /** 24798 * Deprecation for removing the outer div wrapper around aligned images. 24799 * 24800 * @see https://github.com/WordPress/gutenberg/pull/38657 24801 */ 24802 const image_deprecated_v4 = { 24803 attributes: { 24804 align: { 24805 type: 'string' 24806 }, 24807 url: { 24808 type: 'string', 24809 source: 'attribute', 24810 selector: 'img', 24811 attribute: 'src' 24812 }, 24813 alt: { 24814 type: 'string', 24815 source: 'attribute', 24816 selector: 'img', 24817 attribute: 'alt', 24818 default: '' 24819 }, 24820 caption: { 24821 type: 'string', 24822 source: 'html', 24823 selector: 'figcaption' 24824 }, 24825 title: { 24826 type: 'string', 24827 source: 'attribute', 24828 selector: 'img', 24829 attribute: 'title' 24830 }, 24831 href: { 24832 type: 'string', 24833 source: 'attribute', 24834 selector: 'figure > a', 24835 attribute: 'href' 24836 }, 24837 rel: { 24838 type: 'string', 24839 source: 'attribute', 24840 selector: 'figure > a', 24841 attribute: 'rel' 24842 }, 24843 linkClass: { 24844 type: 'string', 24845 source: 'attribute', 24846 selector: 'figure > a', 24847 attribute: 'class' 24848 }, 24849 id: { 24850 type: 'number' 24851 }, 24852 width: { 24853 type: 'number' 24854 }, 24855 height: { 24856 type: 'number' 24857 }, 24858 sizeSlug: { 24859 type: 'string' 24860 }, 24861 linkDestination: { 24862 type: 'string' 24863 }, 24864 linkTarget: { 24865 type: 'string', 24866 source: 'attribute', 24867 selector: 'figure > a', 24868 attribute: 'target' 24869 } 24870 }, 24871 supports: { 24872 anchor: true 24873 }, 24874 save({ 24875 attributes 24876 }) { 24877 const { 24878 url, 24879 alt, 24880 caption, 24881 align, 24882 href, 24883 rel, 24884 linkClass, 24885 width, 24886 height, 24887 id, 24888 linkTarget, 24889 sizeSlug, 24890 title 24891 } = attributes; 24892 const newRel = !rel ? undefined : rel; 24893 const classes = classnames_default()({ 24894 [`align$align}`]: align, 24895 [`size-$sizeSlug}`]: sizeSlug, 24896 'is-resized': width || height 24897 }); 24898 const image = (0,external_React_namespaceObject.createElement)("img", { 24899 src: url, 24900 alt: alt, 24901 className: id ? `wp-image-$id}` : null, 24902 width: width, 24903 height: height, 24904 title: title 24905 }); 24906 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 24907 className: linkClass, 24908 href: href, 24909 target: linkTarget, 24910 rel: newRel 24911 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24912 tagName: "figcaption", 24913 value: caption 24914 })); 24915 if ('left' === align || 'right' === align || 'center' === align) { 24916 return (0,external_React_namespaceObject.createElement)("div", { 24917 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 24918 }, (0,external_React_namespaceObject.createElement)("figure", { 24919 className: classes 24920 }, figure)); 24921 } 24922 return (0,external_React_namespaceObject.createElement)("figure", { 24923 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 24924 className: classes 24925 }) 24926 }, figure); 24927 } 24928 }; 24929 24930 /** 24931 * Deprecation for moving existing border radius styles onto the inner img 24932 * element where new border block support styles must be applied. 24933 * It will also add a new `.has-custom-border` class for existing blocks 24934 * with border radii set. This class is required to improve caption position 24935 * and styling when an image within a gallery has a custom border or 24936 * rounded corners. 24937 * 24938 * @see https://github.com/WordPress/gutenberg/pull/31366 24939 */ 24940 const image_deprecated_v5 = { 24941 attributes: { 24942 align: { 24943 type: 'string' 24944 }, 24945 url: { 24946 type: 'string', 24947 source: 'attribute', 24948 selector: 'img', 24949 attribute: 'src' 24950 }, 24951 alt: { 24952 type: 'string', 24953 source: 'attribute', 24954 selector: 'img', 24955 attribute: 'alt', 24956 default: '' 24957 }, 24958 caption: { 24959 type: 'string', 24960 source: 'html', 24961 selector: 'figcaption' 24962 }, 24963 title: { 24964 type: 'string', 24965 source: 'attribute', 24966 selector: 'img', 24967 attribute: 'title' 24968 }, 24969 href: { 24970 type: 'string', 24971 source: 'attribute', 24972 selector: 'figure > a', 24973 attribute: 'href' 24974 }, 24975 rel: { 24976 type: 'string', 24977 source: 'attribute', 24978 selector: 'figure > a', 24979 attribute: 'rel' 24980 }, 24981 linkClass: { 24982 type: 'string', 24983 source: 'attribute', 24984 selector: 'figure > a', 24985 attribute: 'class' 24986 }, 24987 id: { 24988 type: 'number' 24989 }, 24990 width: { 24991 type: 'number' 24992 }, 24993 height: { 24994 type: 'number' 24995 }, 24996 sizeSlug: { 24997 type: 'string' 24998 }, 24999 linkDestination: { 25000 type: 'string' 25001 }, 25002 linkTarget: { 25003 type: 'string', 25004 source: 'attribute', 25005 selector: 'figure > a', 25006 attribute: 'target' 25007 } 25008 }, 25009 supports: { 25010 anchor: true, 25011 color: { 25012 __experimentalDuotone: 'img', 25013 text: false, 25014 background: false 25015 }, 25016 __experimentalBorder: { 25017 radius: true, 25018 __experimentalDefaultControls: { 25019 radius: true 25020 } 25021 }, 25022 __experimentalStyle: { 25023 spacing: { 25024 margin: '0 0 1em 0' 25025 } 25026 } 25027 }, 25028 save({ 25029 attributes 25030 }) { 25031 const { 25032 url, 25033 alt, 25034 caption, 25035 align, 25036 href, 25037 rel, 25038 linkClass, 25039 width, 25040 height, 25041 id, 25042 linkTarget, 25043 sizeSlug, 25044 title 25045 } = attributes; 25046 const newRel = !rel ? undefined : rel; 25047 const classes = classnames_default()({ 25048 [`align$align}`]: align, 25049 [`size-$sizeSlug}`]: sizeSlug, 25050 'is-resized': width || height 25051 }); 25052 const image = (0,external_React_namespaceObject.createElement)("img", { 25053 src: url, 25054 alt: alt, 25055 className: id ? `wp-image-$id}` : null, 25056 width: width, 25057 height: height, 25058 title: title 25059 }); 25060 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 25061 className: linkClass, 25062 href: href, 25063 target: linkTarget, 25064 rel: newRel 25065 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25066 tagName: "figcaption", 25067 value: caption 25068 })); 25069 return (0,external_React_namespaceObject.createElement)("figure", { 25070 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25071 className: classes 25072 }) 25073 }, figure); 25074 } 25075 }; 25076 25077 /** 25078 * Deprecation for adding width and height as style rules on the inner img. 25079 * 25080 * @see https://github.com/WordPress/gutenberg/pull/31366 25081 */ 25082 const image_deprecated_v6 = { 25083 attributes: { 25084 align: { 25085 type: 'string' 25086 }, 25087 url: { 25088 type: 'string', 25089 source: 'attribute', 25090 selector: 'img', 25091 attribute: 'src', 25092 __experimentalRole: 'content' 25093 }, 25094 alt: { 25095 type: 'string', 25096 source: 'attribute', 25097 selector: 'img', 25098 attribute: 'alt', 25099 default: '', 25100 __experimentalRole: 'content' 25101 }, 25102 caption: { 25103 type: 'string', 25104 source: 'html', 25105 selector: 'figcaption', 25106 __experimentalRole: 'content' 25107 }, 25108 title: { 25109 type: 'string', 25110 source: 'attribute', 25111 selector: 'img', 25112 attribute: 'title', 25113 __experimentalRole: 'content' 25114 }, 25115 href: { 25116 type: 'string', 25117 source: 'attribute', 25118 selector: 'figure > a', 25119 attribute: 'href', 25120 __experimentalRole: 'content' 25121 }, 25122 rel: { 25123 type: 'string', 25124 source: 'attribute', 25125 selector: 'figure > a', 25126 attribute: 'rel' 25127 }, 25128 linkClass: { 25129 type: 'string', 25130 source: 'attribute', 25131 selector: 'figure > a', 25132 attribute: 'class' 25133 }, 25134 id: { 25135 type: 'number', 25136 __experimentalRole: 'content' 25137 }, 25138 width: { 25139 type: 'number' 25140 }, 25141 height: { 25142 type: 'number' 25143 }, 25144 aspectRatio: { 25145 type: 'string' 25146 }, 25147 scale: { 25148 type: 'string' 25149 }, 25150 sizeSlug: { 25151 type: 'string' 25152 }, 25153 linkDestination: { 25154 type: 'string' 25155 }, 25156 linkTarget: { 25157 type: 'string', 25158 source: 'attribute', 25159 selector: 'figure > a', 25160 attribute: 'target' 25161 } 25162 }, 25163 supports: { 25164 anchor: true, 25165 color: { 25166 text: false, 25167 background: false 25168 }, 25169 filter: { 25170 duotone: true 25171 }, 25172 __experimentalBorder: { 25173 color: true, 25174 radius: true, 25175 width: true, 25176 __experimentalSkipSerialization: true, 25177 __experimentalDefaultControls: { 25178 color: true, 25179 radius: true, 25180 width: true 25181 } 25182 } 25183 }, 25184 migrate(attributes) { 25185 const { 25186 height, 25187 width 25188 } = attributes; 25189 return { 25190 ...attributes, 25191 width: typeof width === 'number' ? `$width}px` : width, 25192 height: typeof height === 'number' ? `$height}px` : height 25193 }; 25194 }, 25195 save({ 25196 attributes 25197 }) { 25198 const { 25199 url, 25200 alt, 25201 caption, 25202 align, 25203 href, 25204 rel, 25205 linkClass, 25206 width, 25207 height, 25208 aspectRatio, 25209 scale, 25210 id, 25211 linkTarget, 25212 sizeSlug, 25213 title 25214 } = attributes; 25215 const newRel = !rel ? undefined : rel; 25216 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 25217 const classes = classnames_default()({ 25218 [`align$align}`]: align, 25219 [`size-$sizeSlug}`]: sizeSlug, 25220 'is-resized': width || height, 25221 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 25222 }); 25223 const imageClasses = classnames_default()(borderProps.className, { 25224 [`wp-image-$id}`]: !!id 25225 }); 25226 const image = (0,external_React_namespaceObject.createElement)("img", { 25227 src: url, 25228 alt: alt, 25229 className: imageClasses || undefined, 25230 style: { 25231 ...borderProps.style, 25232 aspectRatio, 25233 objectFit: scale 25234 }, 25235 width: width, 25236 height: height, 25237 title: title 25238 }); 25239 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 25240 className: linkClass, 25241 href: href, 25242 target: linkTarget, 25243 rel: newRel 25244 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25245 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 25246 tagName: "figcaption", 25247 value: caption 25248 })); 25249 return (0,external_React_namespaceObject.createElement)("figure", { 25250 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25251 className: classes 25252 }) 25253 }, figure); 25254 } 25255 }; 25256 25257 /** 25258 * Deprecation for converting to string width and height block attributes and 25259 * removing the width and height img element attributes which are not needed 25260 * as they get added by the TODO hook. 25261 * 25262 * @see https://github.com/WordPress/gutenberg/pull/53274 25263 */ 25264 const image_deprecated_v7 = { 25265 attributes: { 25266 align: { 25267 type: 'string' 25268 }, 25269 url: { 25270 type: 'string', 25271 source: 'attribute', 25272 selector: 'img', 25273 attribute: 'src', 25274 __experimentalRole: 'content' 25275 }, 25276 alt: { 25277 type: 'string', 25278 source: 'attribute', 25279 selector: 'img', 25280 attribute: 'alt', 25281 default: '', 25282 __experimentalRole: 'content' 25283 }, 25284 caption: { 25285 type: 'string', 25286 source: 'html', 25287 selector: 'figcaption', 25288 __experimentalRole: 'content' 25289 }, 25290 title: { 25291 type: 'string', 25292 source: 'attribute', 25293 selector: 'img', 25294 attribute: 'title', 25295 __experimentalRole: 'content' 25296 }, 25297 href: { 25298 type: 'string', 25299 source: 'attribute', 25300 selector: 'figure > a', 25301 attribute: 'href', 25302 __experimentalRole: 'content' 25303 }, 25304 rel: { 25305 type: 'string', 25306 source: 'attribute', 25307 selector: 'figure > a', 25308 attribute: 'rel' 25309 }, 25310 linkClass: { 25311 type: 'string', 25312 source: 'attribute', 25313 selector: 'figure > a', 25314 attribute: 'class' 25315 }, 25316 id: { 25317 type: 'number', 25318 __experimentalRole: 'content' 25319 }, 25320 width: { 25321 type: 'number' 25322 }, 25323 height: { 25324 type: 'number' 25325 }, 25326 aspectRatio: { 25327 type: 'string' 25328 }, 25329 scale: { 25330 type: 'string' 25331 }, 25332 sizeSlug: { 25333 type: 'string' 25334 }, 25335 linkDestination: { 25336 type: 'string' 25337 }, 25338 linkTarget: { 25339 type: 'string', 25340 source: 'attribute', 25341 selector: 'figure > a', 25342 attribute: 'target' 25343 } 25344 }, 25345 supports: { 25346 anchor: true, 25347 color: { 25348 text: false, 25349 background: false 25350 }, 25351 filter: { 25352 duotone: true 25353 }, 25354 __experimentalBorder: { 25355 color: true, 25356 radius: true, 25357 width: true, 25358 __experimentalSkipSerialization: true, 25359 __experimentalDefaultControls: { 25360 color: true, 25361 radius: true, 25362 width: true 25363 } 25364 } 25365 }, 25366 migrate({ 25367 width, 25368 height, 25369 ...attributes 25370 }) { 25371 return { 25372 ...attributes, 25373 width: `$width}px`, 25374 height: `$height}px` 25375 }; 25376 }, 25377 save({ 25378 attributes 25379 }) { 25380 const { 25381 url, 25382 alt, 25383 caption, 25384 align, 25385 href, 25386 rel, 25387 linkClass, 25388 width, 25389 height, 25390 aspectRatio, 25391 scale, 25392 id, 25393 linkTarget, 25394 sizeSlug, 25395 title 25396 } = attributes; 25397 const newRel = !rel ? undefined : rel; 25398 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 25399 const classes = classnames_default()({ 25400 [`align$align}`]: align, 25401 [`size-$sizeSlug}`]: sizeSlug, 25402 'is-resized': width || height, 25403 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 25404 }); 25405 const imageClasses = classnames_default()(borderProps.className, { 25406 [`wp-image-$id}`]: !!id 25407 }); 25408 const image = (0,external_React_namespaceObject.createElement)("img", { 25409 src: url, 25410 alt: alt, 25411 className: imageClasses || undefined, 25412 style: { 25413 ...borderProps.style, 25414 aspectRatio, 25415 objectFit: scale, 25416 width, 25417 height 25418 }, 25419 width: width, 25420 height: height, 25421 title: title 25422 }); 25423 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 25424 className: linkClass, 25425 href: href, 25426 target: linkTarget, 25427 rel: newRel 25428 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25429 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 25430 tagName: "figcaption", 25431 value: caption 25432 })); 25433 return (0,external_React_namespaceObject.createElement)("figure", { 25434 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25435 className: classes 25436 }) 25437 }, figure); 25438 } 25439 }; 25440 const deprecated_v8 = { 25441 attributes: { 25442 align: { 25443 type: 'string' 25444 }, 25445 behaviors: { 25446 type: 'object' 25447 }, 25448 url: { 25449 type: 'string', 25450 source: 'attribute', 25451 selector: 'img', 25452 attribute: 'src', 25453 __experimentalRole: 'content' 25454 }, 25455 alt: { 25456 type: 'string', 25457 source: 'attribute', 25458 selector: 'img', 25459 attribute: 'alt', 25460 default: '', 25461 __experimentalRole: 'content' 25462 }, 25463 caption: { 25464 type: 'string', 25465 source: 'html', 25466 selector: 'figcaption', 25467 __experimentalRole: 'content' 25468 }, 25469 title: { 25470 type: 'string', 25471 source: 'attribute', 25472 selector: 'img', 25473 attribute: 'title', 25474 __experimentalRole: 'content' 25475 }, 25476 href: { 25477 type: 'string', 25478 source: 'attribute', 25479 selector: 'figure > a', 25480 attribute: 'href', 25481 __experimentalRole: 'content' 25482 }, 25483 rel: { 25484 type: 'string', 25485 source: 'attribute', 25486 selector: 'figure > a', 25487 attribute: 'rel' 25488 }, 25489 linkClass: { 25490 type: 'string', 25491 source: 'attribute', 25492 selector: 'figure > a', 25493 attribute: 'class' 25494 }, 25495 id: { 25496 type: 'number', 25497 __experimentalRole: 'content' 25498 }, 25499 width: { 25500 type: 'string' 25501 }, 25502 height: { 25503 type: 'string' 25504 }, 25505 aspectRatio: { 25506 type: 'string' 25507 }, 25508 scale: { 25509 type: 'string' 25510 }, 25511 sizeSlug: { 25512 type: 'string' 25513 }, 25514 linkDestination: { 25515 type: 'string' 25516 }, 25517 linkTarget: { 25518 type: 'string', 25519 source: 'attribute', 25520 selector: 'figure > a', 25521 attribute: 'target' 25522 } 25523 }, 25524 supports: { 25525 anchor: true, 25526 color: { 25527 text: false, 25528 background: false 25529 }, 25530 filter: { 25531 duotone: true 25532 }, 25533 __experimentalBorder: { 25534 color: true, 25535 radius: true, 25536 width: true, 25537 __experimentalSkipSerialization: true, 25538 __experimentalDefaultControls: { 25539 color: true, 25540 radius: true, 25541 width: true 25542 } 25543 } 25544 }, 25545 migrate({ 25546 width, 25547 height, 25548 ...attributes 25549 }) { 25550 // We need to perform a check here because in cases 25551 // where attributes are added dynamically to blocks, 25552 // block invalidation overrides the isEligible() method 25553 // and forces the migration to run, so it's not guaranteed 25554 // that `behaviors` or `behaviors.lightbox` will be defined. 25555 if (!attributes.behaviors?.lightbox) { 25556 return attributes; 25557 } 25558 const { 25559 behaviors: { 25560 lightbox: { 25561 enabled 25562 } 25563 } 25564 } = attributes; 25565 const newAttributes = { 25566 ...attributes, 25567 lightbox: { 25568 enabled 25569 } 25570 }; 25571 delete newAttributes.behaviors; 25572 return newAttributes; 25573 }, 25574 isEligible(attributes) { 25575 return !!attributes.behaviors; 25576 }, 25577 save({ 25578 attributes 25579 }) { 25580 const { 25581 url, 25582 alt, 25583 caption, 25584 align, 25585 href, 25586 rel, 25587 linkClass, 25588 width, 25589 height, 25590 aspectRatio, 25591 scale, 25592 id, 25593 linkTarget, 25594 sizeSlug, 25595 title 25596 } = attributes; 25597 const newRel = !rel ? undefined : rel; 25598 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 25599 const classes = classnames_default()({ 25600 [`align$align}`]: align, 25601 [`size-$sizeSlug}`]: sizeSlug, 25602 'is-resized': width || height, 25603 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 25604 }); 25605 const imageClasses = classnames_default()(borderProps.className, { 25606 [`wp-image-$id}`]: !!id 25607 }); 25608 const image = (0,external_React_namespaceObject.createElement)("img", { 25609 src: url, 25610 alt: alt, 25611 className: imageClasses || undefined, 25612 style: { 25613 ...borderProps.style, 25614 aspectRatio, 25615 objectFit: scale, 25616 width, 25617 height 25618 }, 25619 title: title 25620 }); 25621 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 25622 className: linkClass, 25623 href: href, 25624 target: linkTarget, 25625 rel: newRel 25626 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25627 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 25628 tagName: "figcaption", 25629 value: caption 25630 })); 25631 return (0,external_React_namespaceObject.createElement)("figure", { 25632 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25633 className: classes 25634 }) 25635 }, figure); 25636 } 25637 }; 25638 /* harmony default export */ const image_deprecated = ([deprecated_v8, image_deprecated_v7, image_deprecated_v6, image_deprecated_v5, image_deprecated_v4, image_deprecated_v3, image_deprecated_v2, image_deprecated_v1]); 25639 25640 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js 25641 25642 /** 25643 * WordPress dependencies 25644 */ 25645 25646 const plugins = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 25647 xmlns: "http://www.w3.org/2000/svg", 25648 viewBox: "0 0 24 24" 25649 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 25650 d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" 25651 })); 25652 /* harmony default export */ const library_plugins = (plugins); 25653 25654 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js 25655 25656 /** 25657 * WordPress dependencies 25658 */ 25659 25660 const crop = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 25661 xmlns: "http://www.w3.org/2000/svg", 25662 viewBox: "0 0 24 24" 25663 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 25664 d: "M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z" 25665 })); 25666 /* harmony default export */ const library_crop = (crop); 25667 25668 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.js 25669 25670 /** 25671 * WordPress dependencies 25672 */ 25673 25674 const overlayText = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 25675 xmlns: "http://www.w3.org/2000/svg", 25676 viewBox: "0 0 24 24" 25677 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 25678 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z" 25679 })); 25680 /* harmony default export */ const overlay_text = (overlayText); 25681 25682 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js 25683 25684 /** 25685 * WordPress dependencies 25686 */ 25687 25688 const upload = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 25689 xmlns: "http://www.w3.org/2000/svg", 25690 viewBox: "0 0 24 24" 25691 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 25692 d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" 25693 })); 25694 /* harmony default export */ const library_upload = (upload); 25695 25696 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js 25697 /** 25698 * WordPress dependencies 25699 */ 25700 25701 function useClientWidth(ref, dependencies) { 25702 const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)(); 25703 function calculateClientWidth() { 25704 setClientWidth(ref.current?.clientWidth); 25705 } 25706 (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies); 25707 (0,external_wp_element_namespaceObject.useEffect)(() => { 25708 const { 25709 defaultView 25710 } = ref.current.ownerDocument; 25711 defaultView.addEventListener('resize', calculateClientWidth); 25712 return () => { 25713 defaultView.removeEventListener('resize', calculateClientWidth); 25714 }; 25715 }, []); 25716 return clientWidth; 25717 } 25718 25719 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/constants.js 25720 // The following dropdown menu props aim to provide a consistent offset and 25721 // placement for ToolsPanel menus for block controls to match color popovers. 25722 const TOOLSPANEL_DROPDOWNMENU_PROPS = { 25723 popoverProps: { 25724 placement: 'left-start', 25725 offset: 259 // Inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) 25726 } 25727 }; 25728 25729 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js 25730 25731 /** 25732 * WordPress dependencies 25733 */ 25734 25735 25736 25737 25738 25739 25740 25741 25742 25743 25744 25745 25746 25747 25748 /** 25749 * Internal dependencies 25750 */ 25751 25752 25753 25754 25755 25756 25757 /** 25758 * Module constants 25759 */ 25760 25761 25762 25763 const { 25764 DimensionsTool, 25765 ResolutionTool 25766 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 25767 const scaleOptions = [{ 25768 value: 'cover', 25769 label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for dimensions control'), 25770 help: (0,external_wp_i18n_namespaceObject.__)('Image covers the space evenly.') 25771 }, { 25772 value: 'contain', 25773 label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'), 25774 help: (0,external_wp_i18n_namespaceObject.__)('Image is contained without distortion.') 25775 }]; 25776 25777 // If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles. 25778 const ImageWrapper = ({ 25779 href, 25780 children 25781 }) => { 25782 if (!href) { 25783 return children; 25784 } 25785 return (0,external_React_namespaceObject.createElement)("a", { 25786 href: href, 25787 onClick: event => event.preventDefault(), 25788 "aria-disabled": true, 25789 style: { 25790 // When the Image block is linked, 25791 // it's wrapped with a disabled <a /> tag. 25792 // Restore cursor style so it doesn't appear 'clickable' 25793 // and remove pointer events. Safari needs the display property. 25794 pointerEvents: 'none', 25795 cursor: 'default', 25796 display: 'inline' 25797 } 25798 }, children); 25799 }; 25800 function image_Image({ 25801 temporaryURL, 25802 attributes, 25803 setAttributes, 25804 isSingleSelected, 25805 insertBlocksAfter, 25806 onReplace, 25807 onSelectImage, 25808 onSelectURL, 25809 onUploadError, 25810 containerRef, 25811 context, 25812 clientId, 25813 blockEditingMode 25814 }) { 25815 const { 25816 url = '', 25817 alt, 25818 align, 25819 id, 25820 href, 25821 rel, 25822 linkClass, 25823 linkDestination, 25824 title, 25825 width, 25826 height, 25827 aspectRatio, 25828 scale, 25829 linkTarget, 25830 sizeSlug, 25831 lightbox, 25832 metadata 25833 } = attributes; 25834 25835 // The only supported unit is px, so we can parseInt to strip the px here. 25836 const numericWidth = width ? parseInt(width, 10) : undefined; 25837 const numericHeight = height ? parseInt(height, 10) : undefined; 25838 const imageRef = (0,external_wp_element_namespaceObject.useRef)(); 25839 const { 25840 allowResize = true 25841 } = context; 25842 const { 25843 getBlock, 25844 getSettings 25845 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 25846 const image = (0,external_wp_data_namespaceObject.useSelect)(select => id && isSingleSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(id, { 25847 context: 'view' 25848 }) : null, [id, isSingleSelected]); 25849 const { 25850 canInsertCover, 25851 imageEditing, 25852 imageSizes, 25853 maxWidth 25854 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 25855 const { 25856 getBlockRootClientId, 25857 canInsertBlockType 25858 } = select(external_wp_blockEditor_namespaceObject.store); 25859 const rootClientId = getBlockRootClientId(clientId); 25860 const settings = getSettings(); 25861 return { 25862 imageEditing: settings.imageEditing, 25863 imageSizes: settings.imageSizes, 25864 maxWidth: settings.maxWidth, 25865 canInsertCover: canInsertBlockType('core/cover', rootClientId) 25866 }; 25867 }, [clientId]); 25868 const { 25869 replaceBlocks, 25870 toggleSelection 25871 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 25872 const { 25873 createErrorNotice, 25874 createSuccessNotice 25875 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 25876 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); 25877 const isWideAligned = ['wide', 'full'].includes(align); 25878 const [{ 25879 loadedNaturalWidth, 25880 loadedNaturalHeight 25881 }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); 25882 const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); 25883 const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)(); 25884 const clientWidth = useClientWidth(containerRef, [align]); 25885 const hasNonContentControls = blockEditingMode === 'default'; 25886 const isContentOnlyMode = blockEditingMode === 'contentOnly'; 25887 const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport; 25888 const imageSizeOptions = imageSizes.filter(({ 25889 slug 25890 }) => image?.media_details?.sizes?.[slug]?.source_url).map(({ 25891 name, 25892 slug 25893 }) => ({ 25894 value: slug, 25895 label: name 25896 })); 25897 25898 // If an image is externally hosted, try to fetch the image data. This may 25899 // fail if the image host doesn't allow CORS with the domain. If it works, 25900 // we can enable a button in the toolbar to upload the image. 25901 (0,external_wp_element_namespaceObject.useEffect)(() => { 25902 if (!isExternalImage(id, url) || !isSingleSelected || !getSettings().mediaUpload) { 25903 setExternalBlob(); 25904 return; 25905 } 25906 if (externalBlob) return; 25907 window 25908 // Avoid cache, which seems to help avoid CORS problems. 25909 .fetch(url.includes('?') ? url : url + '?').then(response => response.blob()).then(blob => setExternalBlob(blob)) 25910 // Do nothing, cannot upload. 25911 .catch(() => {}); 25912 }, [id, url, isSingleSelected, externalBlob]); 25913 25914 // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural 25915 // width and height. This resolves an issue in Safari where the loaded natural 25916 // width and height is otherwise lost when switching between alignments. 25917 // See: https://github.com/WordPress/gutenberg/pull/37210. 25918 const { 25919 naturalWidth, 25920 naturalHeight 25921 } = (0,external_wp_element_namespaceObject.useMemo)(() => { 25922 return { 25923 naturalWidth: imageRef.current?.naturalWidth || loadedNaturalWidth || undefined, 25924 naturalHeight: imageRef.current?.naturalHeight || loadedNaturalHeight || undefined 25925 }; 25926 }, [loadedNaturalWidth, loadedNaturalHeight, imageRef.current?.complete]); 25927 function onResizeStart() { 25928 toggleSelection(false); 25929 } 25930 function onResizeStop() { 25931 toggleSelection(true); 25932 } 25933 function onImageError() { 25934 // Check if there's an embed block that handles this URL, e.g., instagram URL. 25935 // See: https://github.com/WordPress/gutenberg/pull/11472 25936 const embedBlock = createUpgradedEmbedBlock({ 25937 attributes: { 25938 url 25939 } 25940 }); 25941 if (undefined !== embedBlock) { 25942 onReplace(embedBlock); 25943 } 25944 } 25945 function onSetHref(props) { 25946 setAttributes(props); 25947 } 25948 function onSetLightbox(enable) { 25949 if (enable && !lightboxSetting?.enabled) { 25950 setAttributes({ 25951 lightbox: { 25952 enabled: true 25953 } 25954 }); 25955 } else if (!enable && lightboxSetting?.enabled) { 25956 setAttributes({ 25957 lightbox: { 25958 enabled: false 25959 } 25960 }); 25961 } else { 25962 setAttributes({ 25963 lightbox: undefined 25964 }); 25965 } 25966 } 25967 function resetLightbox() { 25968 // When deleting a link from an image while lightbox settings 25969 // are enabled by default, we should disable the lightbox, 25970 // otherwise the resulting UX looks like a mistake. 25971 // See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123. 25972 if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) { 25973 setAttributes({ 25974 lightbox: { 25975 enabled: false 25976 } 25977 }); 25978 } else { 25979 setAttributes({ 25980 lightbox: undefined 25981 }); 25982 } 25983 } 25984 function onSetTitle(value) { 25985 // This is the HTML title attribute, separate from the media object 25986 // title. 25987 setAttributes({ 25988 title: value 25989 }); 25990 } 25991 function updateAlt(newAlt) { 25992 setAttributes({ 25993 alt: newAlt 25994 }); 25995 } 25996 function updateImage(newSizeSlug) { 25997 const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url; 25998 if (!newUrl) { 25999 return null; 26000 } 26001 setAttributes({ 26002 url: newUrl, 26003 sizeSlug: newSizeSlug 26004 }); 26005 } 26006 function uploadExternal() { 26007 const { 26008 mediaUpload 26009 } = getSettings(); 26010 if (!mediaUpload) { 26011 return; 26012 } 26013 mediaUpload({ 26014 filesList: [externalBlob], 26015 onFileChange([img]) { 26016 onSelectImage(img); 26017 if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) { 26018 return; 26019 } 26020 setExternalBlob(); 26021 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), { 26022 type: 'snackbar' 26023 }); 26024 }, 26025 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 26026 onError(message) { 26027 createErrorNotice(message, { 26028 type: 'snackbar' 26029 }); 26030 } 26031 }); 26032 } 26033 (0,external_wp_element_namespaceObject.useEffect)(() => { 26034 if (!isSingleSelected) { 26035 setIsEditingImage(false); 26036 } 26037 }, [isSingleSelected]); 26038 const canEditImage = id && naturalWidth && naturalHeight && imageEditing; 26039 const allowCrop = isSingleSelected && canEditImage && !isEditingImage; 26040 function switchToCover() { 26041 replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover')); 26042 } 26043 26044 // TODO: Can allow more units after figuring out how they should interact 26045 // with the ResizableBox and ImageEditor components. Calculations later on 26046 // for those components are currently assuming px units. 26047 const dimensionsUnitsOptions = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 26048 availableUnits: ['px'] 26049 }); 26050 const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('lightbox'); 26051 const showLightboxSetting = 26052 // If a block-level override is set, we should give users the option to 26053 // remove that override, even if the lightbox UI is disabled in the settings. 26054 !!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing; 26055 const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled; 26056 const dimensionsControl = (0,external_React_namespaceObject.createElement)(DimensionsTool, { 26057 value: { 26058 width, 26059 height, 26060 scale, 26061 aspectRatio 26062 }, 26063 onChange: ({ 26064 width: newWidth, 26065 height: newHeight, 26066 scale: newScale, 26067 aspectRatio: newAspectRatio 26068 }) => { 26069 // Rebuilding the object forces setting `undefined` 26070 // for values that are removed since setAttributes 26071 // doesn't do anything with keys that aren't set. 26072 setAttributes({ 26073 // CSS includes `height: auto`, but we need 26074 // `width: auto` to fix the aspect ratio when 26075 // only height is set due to the width and 26076 // height attributes set via the server. 26077 width: !newWidth && newHeight ? 'auto' : newWidth, 26078 height: newHeight, 26079 scale: newScale, 26080 aspectRatio: newAspectRatio 26081 }); 26082 }, 26083 defaultScale: "cover", 26084 defaultAspectRatio: "auto", 26085 scaleOptions: scaleOptions, 26086 unitsOptions: dimensionsUnitsOptions 26087 }); 26088 const resetAll = () => { 26089 setAttributes({ 26090 alt: undefined, 26091 width: undefined, 26092 height: undefined, 26093 scale: undefined, 26094 aspectRatio: undefined, 26095 lightbox: undefined 26096 }); 26097 }; 26098 const sizeControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 26099 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 26100 resetAll: resetAll, 26101 dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS 26102 }, isResizable && dimensionsControl)); 26103 const { 26104 lockUrlControls = false, 26105 lockHrefControls = false, 26106 lockAltControls = false, 26107 lockAltControlsMessage, 26108 lockTitleControls = false, 26109 lockTitleControlsMessage, 26110 lockCaption = false 26111 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 26112 if (!isSingleSelected) { 26113 return {}; 26114 } 26115 const { 26116 getBlockBindingsSource 26117 } = unlock(select(external_wp_blocks_namespaceObject.store)); 26118 const { 26119 getBlockParentsByBlockName 26120 } = unlock(select(external_wp_blockEditor_namespaceObject.store)); 26121 const { 26122 url: urlBinding, 26123 alt: altBinding, 26124 title: titleBinding 26125 } = metadata?.bindings || {}; 26126 const hasParentPattern = getBlockParentsByBlockName(clientId, 'core/block').length > 0; 26127 const urlBindingSource = getBlockBindingsSource(urlBinding?.source); 26128 const altBindingSource = getBlockBindingsSource(altBinding?.source); 26129 const titleBindingSource = getBlockBindingsSource(titleBinding?.source); 26130 return { 26131 lockUrlControls: !!urlBinding && (!urlBindingSource || urlBindingSource?.lockAttributesEditing), 26132 lockHrefControls: 26133 // Disable editing the link of the URL if the image is inside a pattern instance. 26134 // This is a temporary solution until we support overriding the link on the frontend. 26135 hasParentPattern, 26136 lockCaption: 26137 // Disable editing the caption if the image is inside a pattern instance. 26138 // This is a temporary solution until we support overriding the caption on the frontend. 26139 hasParentPattern, 26140 lockAltControls: !!altBinding && (!altBindingSource || altBindingSource?.lockAttributesEditing), 26141 lockAltControlsMessage: altBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Label of the bindings source. */ 26142 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), altBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data'), 26143 lockTitleControls: !!titleBinding && (!titleBindingSource || titleBindingSource?.lockAttributesEditing), 26144 lockTitleControlsMessage: titleBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Label of the bindings source. */ 26145 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), titleBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') 26146 }; 26147 }, [clientId, isSingleSelected, metadata?.bindings]); 26148 const controls = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 26149 group: "block" 26150 }, isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { 26151 url: href || '', 26152 onChangeUrl: onSetHref, 26153 linkDestination: linkDestination, 26154 mediaUrl: image && image.source_url || url, 26155 mediaLink: image && image.link, 26156 linkTarget: linkTarget, 26157 linkClass: linkClass, 26158 rel: rel, 26159 showLightboxSetting: showLightboxSetting, 26160 lightboxEnabled: lightboxChecked, 26161 onSetLightbox: onSetLightbox, 26162 resetLightbox: resetLightbox 26163 }), allowCrop && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 26164 onClick: () => setIsEditingImage(true), 26165 icon: library_crop, 26166 label: (0,external_wp_i18n_namespaceObject.__)('Crop') 26167 }), isSingleSelected && canInsertCover && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 26168 icon: overlay_text, 26169 label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'), 26170 onClick: switchToCover 26171 })), isSingleSelected && !isEditingImage && !lockUrlControls && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 26172 group: "other" 26173 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 26174 mediaId: id, 26175 mediaURL: url, 26176 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 26177 accept: "image/*", 26178 onSelect: onSelectImage, 26179 onSelectURL: onSelectURL, 26180 onError: onUploadError 26181 })), isSingleSelected && externalBlob && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 26182 onClick: uploadExternal, 26183 icon: library_upload, 26184 label: (0,external_wp_i18n_namespaceObject.__)('Upload to Media Library') 26185 }))), isContentOnlyMode && 26186 // Add some extra controls for content attributes when content only mode is active. 26187 // With content only mode active, the inspector is hidden, so users need another way 26188 // to edit these attributes. 26189 (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 26190 group: "other" 26191 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { 26192 popoverProps: { 26193 position: 'bottom right' 26194 }, 26195 renderToggle: ({ 26196 isOpen, 26197 onToggle 26198 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 26199 onClick: onToggle, 26200 "aria-haspopup": "true", 26201 "aria-expanded": isOpen, 26202 onKeyDown: event => { 26203 if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { 26204 event.preventDefault(); 26205 onToggle(); 26206 } 26207 } 26208 }, (0,external_wp_i18n_namespaceObject._x)('Alt', 'Alternative text for an image. Block toolbar label, a low character count is preferred.')), 26209 renderContent: () => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 26210 className: "wp-block-image__toolbar_content_textarea", 26211 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 26212 value: alt || '', 26213 onChange: updateAlt, 26214 disabled: lockAltControls, 26215 help: lockAltControls ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, lockAltControlsMessage) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 26216 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 26217 }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.')), (0,external_React_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')), 26218 __nextHasNoMarginBottom: true 26219 }) 26220 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { 26221 popoverProps: { 26222 position: 'bottom right' 26223 }, 26224 renderToggle: ({ 26225 isOpen, 26226 onToggle 26227 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 26228 onClick: onToggle, 26229 "aria-haspopup": "true", 26230 "aria-expanded": isOpen, 26231 onKeyDown: event => { 26232 if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { 26233 event.preventDefault(); 26234 onToggle(); 26235 } 26236 } 26237 }, (0,external_wp_i18n_namespaceObject.__)('Title')), 26238 renderContent: () => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 26239 className: "wp-block-image__toolbar_content_textarea", 26240 __nextHasNoMarginBottom: true, 26241 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 26242 value: title || '', 26243 onChange: onSetTitle, 26244 disabled: lockTitleControls, 26245 help: lockTitleControls ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, lockTitleControlsMessage) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 26246 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" 26247 }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)'))) 26248 }) 26249 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 26250 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 26251 resetAll: resetAll, 26252 dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS 26253 }, isSingleSelected && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 26254 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 26255 isShownByDefault: true, 26256 hasValue: () => !!alt, 26257 onDeselect: () => setAttributes({ 26258 alt: undefined 26259 }) 26260 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 26261 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 26262 value: alt || '', 26263 onChange: updateAlt, 26264 readOnly: lockAltControls, 26265 help: lockAltControls ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, lockAltControlsMessage) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 26266 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 26267 }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.')), (0,external_React_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')), 26268 __nextHasNoMarginBottom: true 26269 })), isResizable && dimensionsControl, !!imageSizeOptions.length && (0,external_React_namespaceObject.createElement)(ResolutionTool, { 26270 value: sizeSlug, 26271 onChange: updateImage, 26272 options: imageSizeOptions 26273 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 26274 group: "advanced" 26275 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 26276 __nextHasNoMarginBottom: true, 26277 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 26278 value: title || '', 26279 onChange: onSetTitle, 26280 readOnly: lockTitleControls, 26281 help: lockTitleControls ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, lockTitleControlsMessage) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 26282 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" 26283 }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)'))) 26284 }))); 26285 const filename = (0,external_wp_url_namespaceObject.getFilename)(url); 26286 let defaultedAlt; 26287 if (alt) { 26288 defaultedAlt = alt; 26289 } else if (filename) { 26290 defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: file name */ 26291 (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename); 26292 } else { 26293 defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute'); 26294 } 26295 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 26296 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 26297 const isRounded = attributes.className?.includes('is-style-rounded'); 26298 let img = 26299 // Disable reason: Image itself is not meant to be interactive, but 26300 // should direct focus to block. 26301 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 26302 (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("img", { 26303 src: temporaryURL || url, 26304 alt: defaultedAlt, 26305 onError: () => onImageError(), 26306 onLoad: event => { 26307 setLoadedNaturalSize({ 26308 loadedNaturalWidth: event.target?.naturalWidth, 26309 loadedNaturalHeight: event.target?.naturalHeight 26310 }); 26311 }, 26312 ref: imageRef, 26313 className: borderProps.className, 26314 style: { 26315 width: width && height || aspectRatio ? '100%' : undefined, 26316 height: width && height || aspectRatio ? '100%' : undefined, 26317 objectFit: scale, 26318 ...borderProps.style, 26319 ...shadowProps.style 26320 } 26321 }), temporaryURL && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)) 26322 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; 26323 26324 // clientWidth needs to be a number for the image Cropper to work, but sometimes it's 0 26325 // So we try using the imageRef width first and fallback to clientWidth. 26326 const fallbackClientWidth = imageRef.current?.width || clientWidth; 26327 if (canEditImage && isEditingImage) { 26328 img = (0,external_React_namespaceObject.createElement)(ImageWrapper, { 26329 href: href 26330 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { 26331 id: id, 26332 url: url, 26333 width: numericWidth, 26334 height: numericHeight, 26335 clientWidth: fallbackClientWidth, 26336 naturalHeight: naturalHeight, 26337 naturalWidth: naturalWidth, 26338 onSaveImage: imageAttributes => setAttributes(imageAttributes), 26339 onFinishEditing: () => { 26340 setIsEditingImage(false); 26341 }, 26342 borderProps: isRounded ? undefined : borderProps 26343 })); 26344 } else if (!isResizable) { 26345 img = (0,external_React_namespaceObject.createElement)("div", { 26346 style: { 26347 width, 26348 height, 26349 aspectRatio 26350 } 26351 }, (0,external_React_namespaceObject.createElement)(ImageWrapper, { 26352 href: href 26353 }, img)); 26354 } else { 26355 const numericRatio = aspectRatio && evalAspectRatio(aspectRatio); 26356 const customRatio = numericWidth / numericHeight; 26357 const naturalRatio = naturalWidth / naturalHeight; 26358 const ratio = numericRatio || customRatio || naturalRatio || 1; 26359 const currentWidth = !numericWidth && numericHeight ? numericHeight * ratio : numericWidth; 26360 const currentHeight = !numericHeight && numericWidth ? numericWidth / ratio : numericHeight; 26361 const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : constants_MIN_SIZE * ratio; 26362 const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : constants_MIN_SIZE / ratio; 26363 26364 // With the current implementation of ResizableBox, an image needs an 26365 // explicit pixel value for the max-width. In absence of being able to 26366 // set the content-width, this max-width is currently dictated by the 26367 // vanilla editor style. The following variable adds a buffer to this 26368 // vanilla style, so 3rd party themes have some wiggleroom. This does, 26369 // in most cases, allow you to scale the image beyond the width of the 26370 // main column, though not infinitely. 26371 // @todo It would be good to revisit this once a content-width variable 26372 // becomes available. 26373 const maxWidthBuffer = maxWidth * 2.5; 26374 let showRightHandle = false; 26375 let showLeftHandle = false; 26376 26377 /* eslint-disable no-lonely-if */ 26378 // See https://github.com/WordPress/gutenberg/issues/7584. 26379 if (align === 'center') { 26380 // When the image is centered, show both handles. 26381 showRightHandle = true; 26382 showLeftHandle = true; 26383 } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { 26384 // In RTL mode the image is on the right by default. 26385 // Show the right handle and hide the left handle only when it is 26386 // aligned left. Otherwise always show the left handle. 26387 if (align === 'left') { 26388 showRightHandle = true; 26389 } else { 26390 showLeftHandle = true; 26391 } 26392 } else { 26393 // Show the left handle and hide the right handle only when the 26394 // image is aligned right. Otherwise always show the right handle. 26395 if (align === 'right') { 26396 showLeftHandle = true; 26397 } else { 26398 showRightHandle = true; 26399 } 26400 } 26401 /* eslint-enable no-lonely-if */ 26402 img = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 26403 style: { 26404 display: 'block', 26405 objectFit: scale, 26406 aspectRatio: !width && !height && aspectRatio ? aspectRatio : undefined 26407 }, 26408 size: { 26409 width: currentWidth !== null && currentWidth !== void 0 ? currentWidth : 'auto', 26410 height: currentHeight !== null && currentHeight !== void 0 ? currentHeight : 'auto' 26411 }, 26412 showHandle: isSingleSelected, 26413 minWidth: minWidth, 26414 maxWidth: maxWidthBuffer, 26415 minHeight: minHeight, 26416 maxHeight: maxWidthBuffer / ratio, 26417 lockAspectRatio: ratio, 26418 enable: { 26419 top: false, 26420 right: showRightHandle, 26421 bottom: true, 26422 left: showLeftHandle 26423 }, 26424 onResizeStart: onResizeStart, 26425 onResizeStop: (event, direction, elt) => { 26426 onResizeStop(); 26427 // Since the aspect ratio is locked when resizing, we can 26428 // use the width of the resized element to calculate the 26429 // height in CSS to prevent stretching when the max-width 26430 // is reached. 26431 setAttributes({ 26432 width: `$elt.offsetWidth}px`, 26433 height: 'auto', 26434 aspectRatio: ratio === naturalRatio ? undefined : String(ratio) 26435 }); 26436 }, 26437 resizeRatio: align === 'center' ? 2 : 1 26438 }, (0,external_React_namespaceObject.createElement)(ImageWrapper, { 26439 href: href 26440 }, img)); 26441 } 26442 if (!url && !temporaryURL) { 26443 // Add all controls if the image attributes are connected. 26444 return metadata?.bindings ? controls : sizeControls; 26445 } 26446 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !temporaryURL && controls, img, (0,external_React_namespaceObject.createElement)(Caption, { 26447 attributes: attributes, 26448 setAttributes: setAttributes, 26449 isSelected: isSingleSelected, 26450 insertBlocksAfter: insertBlocksAfter, 26451 label: (0,external_wp_i18n_namespaceObject.__)('Image caption text'), 26452 showToolbarButton: isSingleSelected && hasNonContentControls, 26453 disableEditing: lockCaption 26454 })); 26455 } 26456 26457 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js 26458 26459 /** 26460 * External dependencies 26461 */ 26462 26463 26464 /** 26465 * WordPress dependencies 26466 */ 26467 26468 26469 26470 26471 26472 26473 26474 26475 26476 26477 /** 26478 * Internal dependencies 26479 */ 26480 26481 26482 26483 /** 26484 * Module constants 26485 */ 26486 26487 const edit_pickRelevantMediaFiles = (image, size) => { 26488 const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link', 'caption'].includes(key))); 26489 imageProps.url = image?.sizes?.[size]?.url || image?.media_details?.sizes?.[size]?.source_url || image.url; 26490 return imageProps; 26491 }; 26492 26493 /** 26494 * Is the URL a temporary blob URL? A blob URL is one that is used temporarily 26495 * while the image is being uploaded and will not have an id yet allocated. 26496 * 26497 * @param {number=} id The id of the image. 26498 * @param {string=} url The url of the image. 26499 * 26500 * @return {boolean} Is the URL a Blob URL 26501 */ 26502 const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); 26503 26504 /** 26505 * Is the url for the image hosted externally. An externally hosted image has no 26506 * id and is not a blob url. 26507 * 26508 * @param {number=} id The id of the image. 26509 * @param {string=} url The url of the image. 26510 * 26511 * @return {boolean} Is the url an externally hosted url? 26512 */ 26513 const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url); 26514 26515 /** 26516 * Checks if WP generated the specified image size. Size generation is skipped 26517 * when the image is smaller than the said size. 26518 * 26519 * @param {Object} image 26520 * @param {string} size 26521 * 26522 * @return {boolean} Whether or not it has default image size. 26523 */ 26524 function hasSize(image, size) { 26525 var _image$sizes$size, _image$media_details$; 26526 return 'url' in ((_image$sizes$size = image?.sizes?.[size]) !== null && _image$sizes$size !== void 0 ? _image$sizes$size : {}) || 'source_url' in ((_image$media_details$ = image?.media_details?.sizes?.[size]) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : {}); 26527 } 26528 function ImageEdit({ 26529 attributes, 26530 setAttributes, 26531 isSelected: isSingleSelected, 26532 className, 26533 insertBlocksAfter, 26534 onReplace, 26535 context, 26536 clientId 26537 }) { 26538 const { 26539 url = '', 26540 alt, 26541 caption, 26542 id, 26543 width, 26544 height, 26545 sizeSlug, 26546 aspectRatio, 26547 scale, 26548 align, 26549 metadata 26550 } = attributes; 26551 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(); 26552 const altRef = (0,external_wp_element_namespaceObject.useRef)(); 26553 (0,external_wp_element_namespaceObject.useEffect)(() => { 26554 altRef.current = alt; 26555 }, [alt]); 26556 const captionRef = (0,external_wp_element_namespaceObject.useRef)(); 26557 (0,external_wp_element_namespaceObject.useEffect)(() => { 26558 captionRef.current = caption; 26559 }, [caption]); 26560 const { 26561 __unstableMarkNextChangeAsNotPersistent 26562 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 26563 (0,external_wp_element_namespaceObject.useEffect)(() => { 26564 if (['wide', 'full'].includes(align)) { 26565 __unstableMarkNextChangeAsNotPersistent(); 26566 setAttributes({ 26567 width: undefined, 26568 height: undefined, 26569 aspectRatio: undefined, 26570 scale: undefined 26571 }); 26572 } 26573 }, [align]); 26574 const ref = (0,external_wp_element_namespaceObject.useRef)(); 26575 const { 26576 getSettings 26577 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 26578 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 26579 const { 26580 createErrorNotice 26581 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 26582 function onUploadError(message) { 26583 createErrorNotice(message, { 26584 type: 'snackbar' 26585 }); 26586 setAttributes({ 26587 src: undefined, 26588 id: undefined, 26589 url: undefined 26590 }); 26591 setTemporaryURL(undefined); 26592 } 26593 function onSelectImage(media) { 26594 if (!media || !media.url) { 26595 setAttributes({ 26596 url: undefined, 26597 alt: undefined, 26598 id: undefined, 26599 title: undefined, 26600 caption: undefined 26601 }); 26602 return; 26603 } 26604 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 26605 setTemporaryURL(media.url); 26606 return; 26607 } 26608 setTemporaryURL(); 26609 const { 26610 imageDefaultSize 26611 } = getSettings(); 26612 26613 // Try to use the previous selected image size if its available 26614 // otherwise try the default image size or fallback to "full" 26615 let newSize = 'full'; 26616 if (sizeSlug && hasSize(media, sizeSlug)) { 26617 newSize = sizeSlug; 26618 } else if (hasSize(media, imageDefaultSize)) { 26619 newSize = imageDefaultSize; 26620 } 26621 let mediaAttributes = edit_pickRelevantMediaFiles(media, newSize); 26622 26623 // If a caption text was meanwhile written by the user, 26624 // make sure the text is not overwritten by empty captions. 26625 if (captionRef.current && !mediaAttributes.caption) { 26626 const { 26627 caption: omittedCaption, 26628 ...restMediaAttributes 26629 } = mediaAttributes; 26630 mediaAttributes = restMediaAttributes; 26631 } 26632 let additionalAttributes; 26633 // Reset the dimension attributes if changing to a different image. 26634 if (!media.id || media.id !== id) { 26635 additionalAttributes = { 26636 sizeSlug: newSize 26637 }; 26638 } else { 26639 // Keep the same url when selecting the same file, so "Resolution" 26640 // option is not changed. 26641 additionalAttributes = { 26642 url 26643 }; 26644 } 26645 26646 // Check if default link setting should be used. 26647 let linkDestination = attributes.linkDestination; 26648 if (!linkDestination) { 26649 // Use the WordPress option to determine the proper default. 26650 // The constants used in Gutenberg do not match WP options so a little more complicated than ideal. 26651 // TODO: fix this in a follow up PR, requires updating media-text and ui component. 26652 switch (window?.wp?.media?.view?.settings?.defaultProps?.link || constants_LINK_DESTINATION_NONE) { 26653 case 'file': 26654 case constants_LINK_DESTINATION_MEDIA: 26655 linkDestination = constants_LINK_DESTINATION_MEDIA; 26656 break; 26657 case 'post': 26658 case constants_LINK_DESTINATION_ATTACHMENT: 26659 linkDestination = constants_LINK_DESTINATION_ATTACHMENT; 26660 break; 26661 case LINK_DESTINATION_CUSTOM: 26662 linkDestination = LINK_DESTINATION_CUSTOM; 26663 break; 26664 case constants_LINK_DESTINATION_NONE: 26665 linkDestination = constants_LINK_DESTINATION_NONE; 26666 break; 26667 } 26668 } 26669 26670 // Check if the image is linked to it's media. 26671 let href; 26672 switch (linkDestination) { 26673 case constants_LINK_DESTINATION_MEDIA: 26674 href = media.url; 26675 break; 26676 case constants_LINK_DESTINATION_ATTACHMENT: 26677 href = media.link; 26678 break; 26679 } 26680 mediaAttributes.href = href; 26681 setAttributes({ 26682 ...mediaAttributes, 26683 ...additionalAttributes, 26684 linkDestination 26685 }); 26686 } 26687 function onSelectURL(newURL) { 26688 if (newURL !== url) { 26689 setAttributes({ 26690 url: newURL, 26691 id: undefined, 26692 sizeSlug: getSettings().imageDefaultSize 26693 }); 26694 } 26695 } 26696 let isTemp = edit_isTemporaryImage(id, url); 26697 26698 // Upload a temporary image on mount. 26699 (0,external_wp_element_namespaceObject.useEffect)(() => { 26700 if (!isTemp) { 26701 return; 26702 } 26703 const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url); 26704 if (file) { 26705 const { 26706 mediaUpload 26707 } = getSettings(); 26708 if (!mediaUpload) { 26709 return; 26710 } 26711 mediaUpload({ 26712 filesList: [file], 26713 onFileChange: ([img]) => { 26714 onSelectImage(img); 26715 }, 26716 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 26717 onError: message => { 26718 isTemp = false; 26719 onUploadError(message); 26720 } 26721 }); 26722 } 26723 }, []); 26724 26725 // If an image is temporary, revoke the Blob url when it is uploaded (and is 26726 // no longer temporary). 26727 (0,external_wp_element_namespaceObject.useEffect)(() => { 26728 if (isTemp) { 26729 setTemporaryURL(url); 26730 return; 26731 } 26732 (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL); 26733 }, [isTemp, url]); 26734 const isExternal = isExternalImage(id, url); 26735 const src = isExternal ? url : undefined; 26736 const mediaPreview = !!url && (0,external_React_namespaceObject.createElement)("img", { 26737 alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'), 26738 title: (0,external_wp_i18n_namespaceObject.__)('Edit image'), 26739 className: 'edit-image-preview', 26740 src: url 26741 }); 26742 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 26743 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 26744 const classes = classnames_default()(className, { 26745 'is-transient': temporaryURL, 26746 'is-resized': !!width || !!height, 26747 [`size-$sizeSlug}`]: sizeSlug, 26748 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26749 }); 26750 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 26751 ref, 26752 className: classes 26753 }); 26754 26755 // Much of this description is duplicated from MediaPlaceholder. 26756 const { 26757 lockUrlControls = false, 26758 lockUrlControlsMessage 26759 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 26760 if (!isSingleSelected) { 26761 return {}; 26762 } 26763 const blockBindingsSource = unlock(select(external_wp_blocks_namespaceObject.store)).getBlockBindingsSource(metadata?.bindings?.url?.source); 26764 return { 26765 lockUrlControls: !!metadata?.bindings?.url && (!blockBindingsSource || blockBindingsSource?.lockAttributesEditing), 26766 lockUrlControlsMessage: blockBindingsSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Label of the bindings source. */ 26767 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), blockBindingsSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') 26768 }; 26769 }, [isSingleSelected]); 26770 const placeholder = content => { 26771 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 26772 className: classnames_default()('block-editor-media-placeholder', { 26773 [borderProps.className]: !!borderProps.className && !isSingleSelected 26774 }), 26775 withIllustration: true, 26776 icon: lockUrlControls ? library_plugins : library_image, 26777 label: (0,external_wp_i18n_namespaceObject.__)('Image'), 26778 instructions: !lockUrlControls && (0,external_wp_i18n_namespaceObject.__)('Upload an image file, pick one from your media library, or add one with a URL.'), 26779 style: { 26780 aspectRatio: !(width && height) && aspectRatio ? aspectRatio : undefined, 26781 width: height && aspectRatio ? '100%' : width, 26782 height: width && aspectRatio ? '100%' : height, 26783 objectFit: scale, 26784 ...borderProps.style, 26785 ...shadowProps.style 26786 } 26787 }, lockUrlControls ? (0,external_React_namespaceObject.createElement)("span", { 26788 className: 'block-bindings-media-placeholder-message' 26789 }, lockUrlControlsMessage) : content); 26790 }; 26791 return (0,external_React_namespaceObject.createElement)("figure", { 26792 ...blockProps 26793 }, (0,external_React_namespaceObject.createElement)(image_Image, { 26794 temporaryURL: temporaryURL, 26795 attributes: attributes, 26796 setAttributes: setAttributes, 26797 isSingleSelected: isSingleSelected, 26798 insertBlocksAfter: insertBlocksAfter, 26799 onReplace: onReplace, 26800 onSelectImage: onSelectImage, 26801 onSelectURL: onSelectURL, 26802 onUploadError: onUploadError, 26803 containerRef: ref, 26804 context: context, 26805 clientId: clientId, 26806 blockEditingMode: blockEditingMode 26807 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 26808 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 26809 icon: library_image 26810 }), 26811 onSelect: onSelectImage, 26812 onSelectURL: onSelectURL, 26813 onError: onUploadError, 26814 placeholder: placeholder, 26815 accept: "image/*", 26816 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 26817 value: { 26818 id, 26819 src 26820 }, 26821 mediaPreview: mediaPreview, 26822 disableMediaButtons: temporaryURL || url 26823 })); 26824 } 26825 /* harmony default export */ const image_edit = (ImageEdit); 26826 26827 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js 26828 26829 /** 26830 * External dependencies 26831 */ 26832 26833 26834 /** 26835 * WordPress dependencies 26836 */ 26837 26838 function image_save_save({ 26839 attributes 26840 }) { 26841 const { 26842 url, 26843 alt, 26844 caption, 26845 align, 26846 href, 26847 rel, 26848 linkClass, 26849 width, 26850 height, 26851 aspectRatio, 26852 scale, 26853 id, 26854 linkTarget, 26855 sizeSlug, 26856 title 26857 } = attributes; 26858 const newRel = !rel ? undefined : rel; 26859 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 26860 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 26861 const classes = classnames_default()({ 26862 // All other align classes are handled by block supports. 26863 // `{ align: 'none' }` is unique to transforms for the image block. 26864 alignnone: 'none' === align, 26865 [`size-$sizeSlug}`]: sizeSlug, 26866 'is-resized': width || height, 26867 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26868 }); 26869 const imageClasses = classnames_default()(borderProps.className, { 26870 [`wp-image-$id}`]: !!id 26871 }); 26872 const image = (0,external_React_namespaceObject.createElement)("img", { 26873 src: url, 26874 alt: alt, 26875 className: imageClasses || undefined, 26876 style: { 26877 ...borderProps.style, 26878 ...shadowProps.style, 26879 aspectRatio, 26880 objectFit: scale, 26881 width, 26882 height 26883 }, 26884 title: title 26885 }); 26886 const figure = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, href ? (0,external_React_namespaceObject.createElement)("a", { 26887 className: linkClass, 26888 href: href, 26889 target: linkTarget, 26890 rel: newRel 26891 }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 26892 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 26893 tagName: "figcaption", 26894 value: caption 26895 })); 26896 return (0,external_React_namespaceObject.createElement)("figure", { 26897 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 26898 className: classes 26899 }) 26900 }, figure); 26901 } 26902 26903 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js 26904 /** 26905 * WordPress dependencies 26906 */ 26907 26908 26909 26910 26911 26912 function stripFirstImage(attributes, { 26913 shortcode 26914 }) { 26915 const { 26916 body 26917 } = document.implementation.createHTMLDocument(''); 26918 body.innerHTML = shortcode.content; 26919 let nodeToRemove = body.querySelector('img'); 26920 26921 // If an image has parents, find the topmost node to remove. 26922 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 26923 nodeToRemove = nodeToRemove.parentNode; 26924 } 26925 if (nodeToRemove) { 26926 nodeToRemove.parentNode.removeChild(nodeToRemove); 26927 } 26928 return body.innerHTML.trim(); 26929 } 26930 function getFirstAnchorAttributeFormHTML(html, attributeName) { 26931 const { 26932 body 26933 } = document.implementation.createHTMLDocument(''); 26934 body.innerHTML = html; 26935 const { 26936 firstElementChild 26937 } = body; 26938 if (firstElementChild && firstElementChild.nodeName === 'A') { 26939 return firstElementChild.getAttribute(attributeName) || undefined; 26940 } 26941 } 26942 const imageSchema = { 26943 img: { 26944 attributes: ['src', 'alt', 'title'], 26945 classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/] 26946 } 26947 }; 26948 const schema = ({ 26949 phrasingContentSchema 26950 }) => ({ 26951 figure: { 26952 require: ['img'], 26953 children: { 26954 ...imageSchema, 26955 a: { 26956 attributes: ['href', 'rel', 'target'], 26957 children: imageSchema 26958 }, 26959 figcaption: { 26960 children: phrasingContentSchema 26961 } 26962 } 26963 } 26964 }); 26965 const image_transforms_transforms = { 26966 from: [{ 26967 type: 'raw', 26968 isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'), 26969 schema, 26970 transform: node => { 26971 // Search both figure and image classes. Alignment could be 26972 // set on either. ID is set on the image. 26973 const className = node.className + ' ' + node.querySelector('img').className; 26974 const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className); 26975 const anchor = node.id === '' ? undefined : node.id; 26976 const align = alignMatches ? alignMatches[1] : undefined; 26977 const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className); 26978 const id = idMatches ? Number(idMatches[1]) : undefined; 26979 const anchorElement = node.querySelector('a'); 26980 const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined; 26981 const href = anchorElement && anchorElement.href ? anchorElement.href : undefined; 26982 const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined; 26983 const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined; 26984 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, { 26985 align, 26986 id, 26987 linkDestination, 26988 href, 26989 rel, 26990 linkClass, 26991 anchor 26992 }); 26993 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes); 26994 } 26995 }, { 26996 // Note: when dragging and dropping multiple files onto a gallery this overrides the 26997 // gallery transform in order to add new images to the gallery instead of 26998 // creating a new gallery. 26999 type: 'files', 27000 isMatch(files) { 27001 // The following check is intended to catch non-image files when dropped together with images. 27002 if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) { 27003 const { 27004 createErrorNotice 27005 } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store); 27006 createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { 27007 id: 'gallery-transform-invalid-file', 27008 type: 'snackbar' 27009 }); 27010 } 27011 return files.every(file => file.type.indexOf('image/') === 0); 27012 }, 27013 transform(files) { 27014 const blocks = files.map(file => { 27015 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 27016 url: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 27017 }); 27018 }); 27019 return blocks; 27020 } 27021 }, { 27022 type: 'shortcode', 27023 tag: 'caption', 27024 attributes: { 27025 url: { 27026 type: 'string', 27027 source: 'attribute', 27028 attribute: 'src', 27029 selector: 'img' 27030 }, 27031 alt: { 27032 type: 'string', 27033 source: 'attribute', 27034 attribute: 'alt', 27035 selector: 'img' 27036 }, 27037 caption: { 27038 shortcode: stripFirstImage 27039 }, 27040 href: { 27041 shortcode: (attributes, { 27042 shortcode 27043 }) => { 27044 return getFirstAnchorAttributeFormHTML(shortcode.content, 'href'); 27045 } 27046 }, 27047 rel: { 27048 shortcode: (attributes, { 27049 shortcode 27050 }) => { 27051 return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel'); 27052 } 27053 }, 27054 linkClass: { 27055 shortcode: (attributes, { 27056 shortcode 27057 }) => { 27058 return getFirstAnchorAttributeFormHTML(shortcode.content, 'class'); 27059 } 27060 }, 27061 id: { 27062 type: 'number', 27063 shortcode: ({ 27064 named: { 27065 id 27066 } 27067 }) => { 27068 if (!id) { 27069 return; 27070 } 27071 return parseInt(id.replace('attachment_', ''), 10); 27072 } 27073 }, 27074 align: { 27075 type: 'string', 27076 shortcode: ({ 27077 named: { 27078 align = 'alignnone' 27079 } 27080 }) => { 27081 return align.replace('align', ''); 27082 } 27083 } 27084 } 27085 }] 27086 }; 27087 /* harmony default export */ const image_transforms = (image_transforms_transforms); 27088 27089 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js 27090 /** 27091 * WordPress dependencies 27092 */ 27093 27094 27095 27096 /** 27097 * Internal dependencies 27098 */ 27099 27100 27101 27102 const image_metadata = { 27103 $schema: "https://schemas.wp.org/trunk/block.json", 27104 apiVersion: 3, 27105 name: "core/image", 27106 title: "Image", 27107 category: "media", 27108 usesContext: ["allowResize", "imageCrop", "fixedHeight"], 27109 description: "Insert an image to make a visual statement.", 27110 keywords: ["img", "photo", "picture"], 27111 textdomain: "default", 27112 attributes: { 27113 url: { 27114 type: "string", 27115 source: "attribute", 27116 selector: "img", 27117 attribute: "src", 27118 __experimentalRole: "content" 27119 }, 27120 alt: { 27121 type: "string", 27122 source: "attribute", 27123 selector: "img", 27124 attribute: "alt", 27125 "default": "", 27126 __experimentalRole: "content" 27127 }, 27128 caption: { 27129 type: "rich-text", 27130 source: "rich-text", 27131 selector: "figcaption", 27132 __experimentalRole: "content" 27133 }, 27134 lightbox: { 27135 type: "object", 27136 enabled: { 27137 type: "boolean" 27138 } 27139 }, 27140 title: { 27141 type: "string", 27142 source: "attribute", 27143 selector: "img", 27144 attribute: "title", 27145 __experimentalRole: "content" 27146 }, 27147 href: { 27148 type: "string", 27149 source: "attribute", 27150 selector: "figure > a", 27151 attribute: "href", 27152 __experimentalRole: "content" 27153 }, 27154 rel: { 27155 type: "string", 27156 source: "attribute", 27157 selector: "figure > a", 27158 attribute: "rel" 27159 }, 27160 linkClass: { 27161 type: "string", 27162 source: "attribute", 27163 selector: "figure > a", 27164 attribute: "class" 27165 }, 27166 id: { 27167 type: "number", 27168 __experimentalRole: "content" 27169 }, 27170 width: { 27171 type: "string" 27172 }, 27173 height: { 27174 type: "string" 27175 }, 27176 aspectRatio: { 27177 type: "string" 27178 }, 27179 scale: { 27180 type: "string" 27181 }, 27182 sizeSlug: { 27183 type: "string" 27184 }, 27185 linkDestination: { 27186 type: "string" 27187 }, 27188 linkTarget: { 27189 type: "string", 27190 source: "attribute", 27191 selector: "figure > a", 27192 attribute: "target" 27193 } 27194 }, 27195 supports: { 27196 interactivity: true, 27197 align: ["left", "center", "right", "wide", "full"], 27198 anchor: true, 27199 color: { 27200 text: false, 27201 background: false 27202 }, 27203 filter: { 27204 duotone: true 27205 }, 27206 __experimentalBorder: { 27207 color: true, 27208 radius: true, 27209 width: true, 27210 __experimentalSkipSerialization: true, 27211 __experimentalDefaultControls: { 27212 color: true, 27213 radius: true, 27214 width: true 27215 } 27216 }, 27217 shadow: { 27218 __experimentalSkipSerialization: true 27219 } 27220 }, 27221 selectors: { 27222 border: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 27223 shadow: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 27224 filter: { 27225 duotone: ".wp-block-image img, .wp-block-image .components-placeholder" 27226 } 27227 }, 27228 styles: [{ 27229 name: "default", 27230 label: "Default", 27231 isDefault: true 27232 }, { 27233 name: "rounded", 27234 label: "Rounded" 27235 }], 27236 editorStyle: "wp-block-image-editor", 27237 style: "wp-block-image" 27238 }; 27239 27240 27241 const { 27242 name: image_name 27243 } = image_metadata; 27244 27245 const image_settings = { 27246 icon: library_image, 27247 example: { 27248 attributes: { 27249 sizeSlug: 'large', 27250 url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg', 27251 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 27252 caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.') 27253 } 27254 }, 27255 __experimentalLabel(attributes, { 27256 context 27257 }) { 27258 const customName = attributes?.metadata?.name; 27259 if (context === 'list-view' && customName) { 27260 return customName; 27261 } 27262 if (context === 'accessibility') { 27263 const { 27264 caption, 27265 alt, 27266 url 27267 } = attributes; 27268 if (!url) { 27269 return (0,external_wp_i18n_namespaceObject.__)('Empty'); 27270 } 27271 if (!alt) { 27272 return caption || ''; 27273 } 27274 27275 // This is intended to be read by a screen reader. 27276 // A period simply means a pause, no need to translate it. 27277 return alt + (caption ? '. ' + caption : ''); 27278 } 27279 }, 27280 getEditWrapperProps(attributes) { 27281 return { 27282 'data-align': attributes.align 27283 }; 27284 }, 27285 transforms: image_transforms, 27286 edit: image_edit, 27287 save: image_save_save, 27288 deprecated: image_deprecated 27289 }; 27290 const image_init = () => initBlock({ 27291 name: image_name, 27292 metadata: image_metadata, 27293 settings: image_settings 27294 }); 27295 27296 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js 27297 27298 /** 27299 * WordPress dependencies 27300 */ 27301 27302 const comment = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 27303 viewBox: "0 0 24 24", 27304 xmlns: "http://www.w3.org/2000/svg" 27305 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 27306 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" 27307 })); 27308 /* harmony default export */ const library_comment = (comment); 27309 27310 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js 27311 27312 /** 27313 * WordPress dependencies 27314 */ 27315 27316 27317 27318 27319 27320 /** 27321 * Minimum number of comments a user can show using this block. 27322 * 27323 * @type {number} 27324 */ 27325 const MIN_COMMENTS = 1; 27326 /** 27327 * Maximum number of comments a user can show using this block. 27328 * 27329 * @type {number} 27330 */ 27331 const MAX_COMMENTS = 100; 27332 function LatestComments({ 27333 attributes, 27334 setAttributes 27335 }) { 27336 const { 27337 commentsToShow, 27338 displayAvatar, 27339 displayDate, 27340 displayExcerpt 27341 } = attributes; 27342 const serverSideAttributes = { 27343 ...attributes, 27344 style: { 27345 ...attributes?.style, 27346 spacing: undefined 27347 } 27348 }; 27349 return (0,external_React_namespaceObject.createElement)("div", { 27350 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 27351 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 27352 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 27353 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27354 __nextHasNoMarginBottom: true, 27355 label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'), 27356 checked: displayAvatar, 27357 onChange: () => setAttributes({ 27358 displayAvatar: !displayAvatar 27359 }) 27360 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27361 __nextHasNoMarginBottom: true, 27362 label: (0,external_wp_i18n_namespaceObject.__)('Display date'), 27363 checked: displayDate, 27364 onChange: () => setAttributes({ 27365 displayDate: !displayDate 27366 }) 27367 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27368 __nextHasNoMarginBottom: true, 27369 label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), 27370 checked: displayExcerpt, 27371 onChange: () => setAttributes({ 27372 displayExcerpt: !displayExcerpt 27373 }) 27374 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 27375 __nextHasNoMarginBottom: true, 27376 __next40pxDefaultSize: true, 27377 label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'), 27378 value: commentsToShow, 27379 onChange: value => setAttributes({ 27380 commentsToShow: value 27381 }), 27382 min: MIN_COMMENTS, 27383 max: MAX_COMMENTS, 27384 required: true 27385 }))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)((external_wp_serverSideRender_default()), { 27386 block: "core/latest-comments", 27387 attributes: serverSideAttributes 27388 // The preview uses the site's locale to make it more true to how 27389 // the block appears on the frontend. Setting the locale 27390 // explicitly prevents any middleware from setting it to 'user'. 27391 , 27392 urlQueryArgs: { 27393 _locale: 'site' 27394 } 27395 }))); 27396 } 27397 27398 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 27399 /** 27400 * WordPress dependencies 27401 */ 27402 27403 27404 /** 27405 * Internal dependencies 27406 */ 27407 27408 const latest_comments_metadata = { 27409 $schema: "https://schemas.wp.org/trunk/block.json", 27410 apiVersion: 3, 27411 name: "core/latest-comments", 27412 title: "Latest Comments", 27413 category: "widgets", 27414 description: "Display a list of your most recent comments.", 27415 keywords: ["recent comments"], 27416 textdomain: "default", 27417 attributes: { 27418 commentsToShow: { 27419 type: "number", 27420 "default": 5, 27421 minimum: 1, 27422 maximum: 100 27423 }, 27424 displayAvatar: { 27425 type: "boolean", 27426 "default": true 27427 }, 27428 displayDate: { 27429 type: "boolean", 27430 "default": true 27431 }, 27432 displayExcerpt: { 27433 type: "boolean", 27434 "default": true 27435 } 27436 }, 27437 supports: { 27438 align: true, 27439 html: false, 27440 spacing: { 27441 margin: true, 27442 padding: true 27443 }, 27444 typography: { 27445 fontSize: true, 27446 lineHeight: true, 27447 __experimentalFontFamily: true, 27448 __experimentalFontWeight: true, 27449 __experimentalFontStyle: true, 27450 __experimentalTextTransform: true, 27451 __experimentalTextDecoration: true, 27452 __experimentalLetterSpacing: true, 27453 __experimentalDefaultControls: { 27454 fontSize: true 27455 } 27456 }, 27457 interactivity: { 27458 clientNavigation: true 27459 } 27460 }, 27461 editorStyle: "wp-block-latest-comments-editor", 27462 style: "wp-block-latest-comments" 27463 }; 27464 27465 const { 27466 name: latest_comments_name 27467 } = latest_comments_metadata; 27468 27469 const latest_comments_settings = { 27470 icon: library_comment, 27471 example: {}, 27472 edit: LatestComments 27473 }; 27474 const latest_comments_init = () => initBlock({ 27475 name: latest_comments_name, 27476 metadata: latest_comments_metadata, 27477 settings: latest_comments_settings 27478 }); 27479 27480 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js 27481 27482 /** 27483 * WordPress dependencies 27484 */ 27485 27486 const postList = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 27487 viewBox: "0 0 24 24", 27488 xmlns: "http://www.w3.org/2000/svg" 27489 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 27490 d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" 27491 })); 27492 /* harmony default export */ const post_list = (postList); 27493 27494 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js 27495 /** 27496 * Internal dependencies 27497 */ 27498 const latest_posts_deprecated_metadata = { 27499 $schema: "https://schemas.wp.org/trunk/block.json", 27500 apiVersion: 3, 27501 name: "core/latest-posts", 27502 title: "Latest Posts", 27503 category: "widgets", 27504 description: "Display a list of your most recent posts.", 27505 keywords: ["recent posts"], 27506 textdomain: "default", 27507 attributes: { 27508 categories: { 27509 type: "array", 27510 items: { 27511 type: "object" 27512 } 27513 }, 27514 selectedAuthor: { 27515 type: "number" 27516 }, 27517 postsToShow: { 27518 type: "number", 27519 "default": 5 27520 }, 27521 displayPostContent: { 27522 type: "boolean", 27523 "default": false 27524 }, 27525 displayPostContentRadio: { 27526 type: "string", 27527 "default": "excerpt" 27528 }, 27529 excerptLength: { 27530 type: "number", 27531 "default": 55 27532 }, 27533 displayAuthor: { 27534 type: "boolean", 27535 "default": false 27536 }, 27537 displayPostDate: { 27538 type: "boolean", 27539 "default": false 27540 }, 27541 postLayout: { 27542 type: "string", 27543 "default": "list" 27544 }, 27545 columns: { 27546 type: "number", 27547 "default": 3 27548 }, 27549 order: { 27550 type: "string", 27551 "default": "desc" 27552 }, 27553 orderBy: { 27554 type: "string", 27555 "default": "date" 27556 }, 27557 displayFeaturedImage: { 27558 type: "boolean", 27559 "default": false 27560 }, 27561 featuredImageAlign: { 27562 type: "string", 27563 "enum": ["left", "center", "right"] 27564 }, 27565 featuredImageSizeSlug: { 27566 type: "string", 27567 "default": "thumbnail" 27568 }, 27569 featuredImageSizeWidth: { 27570 type: "number", 27571 "default": null 27572 }, 27573 featuredImageSizeHeight: { 27574 type: "number", 27575 "default": null 27576 }, 27577 addLinkToFeaturedImage: { 27578 type: "boolean", 27579 "default": false 27580 } 27581 }, 27582 supports: { 27583 align: true, 27584 html: false, 27585 color: { 27586 gradients: true, 27587 link: true, 27588 __experimentalDefaultControls: { 27589 background: true, 27590 text: true, 27591 link: true 27592 } 27593 }, 27594 spacing: { 27595 margin: true, 27596 padding: true 27597 }, 27598 typography: { 27599 fontSize: true, 27600 lineHeight: true, 27601 __experimentalFontFamily: true, 27602 __experimentalFontWeight: true, 27603 __experimentalFontStyle: true, 27604 __experimentalTextTransform: true, 27605 __experimentalTextDecoration: true, 27606 __experimentalLetterSpacing: true, 27607 __experimentalDefaultControls: { 27608 fontSize: true 27609 } 27610 }, 27611 interactivity: { 27612 clientNavigation: true 27613 } 27614 }, 27615 editorStyle: "wp-block-latest-posts-editor", 27616 style: "wp-block-latest-posts" 27617 }; 27618 const { 27619 attributes: deprecated_attributes 27620 } = latest_posts_deprecated_metadata; 27621 /* harmony default export */ const latest_posts_deprecated = ([{ 27622 attributes: { 27623 ...deprecated_attributes, 27624 categories: { 27625 type: 'string' 27626 } 27627 }, 27628 supports: { 27629 align: true, 27630 html: false 27631 }, 27632 migrate: oldAttributes => { 27633 // This needs the full category object, not just the ID. 27634 return { 27635 ...oldAttributes, 27636 categories: [{ 27637 id: Number(oldAttributes.categories) 27638 }] 27639 }; 27640 }, 27641 isEligible: ({ 27642 categories 27643 }) => categories && 'string' === typeof categories, 27644 save: () => null 27645 }]); 27646 27647 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js 27648 27649 /** 27650 * WordPress dependencies 27651 */ 27652 27653 const list = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 27654 viewBox: "0 0 24 24", 27655 xmlns: "http://www.w3.org/2000/svg" 27656 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 27657 d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" 27658 })); 27659 /* harmony default export */ const library_list = (list); 27660 27661 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js 27662 const MIN_EXCERPT_LENGTH = 10; 27663 const MAX_EXCERPT_LENGTH = 100; 27664 const MAX_POSTS_COLUMNS = 6; 27665 27666 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js 27667 27668 /** 27669 * External dependencies 27670 */ 27671 27672 27673 /** 27674 * WordPress dependencies 27675 */ 27676 27677 27678 27679 27680 27681 27682 27683 27684 27685 27686 27687 /** 27688 * Internal dependencies 27689 */ 27690 27691 27692 /** 27693 * Module Constants 27694 */ 27695 const CATEGORIES_LIST_QUERY = { 27696 per_page: -1, 27697 context: 'view' 27698 }; 27699 const USERS_LIST_QUERY = { 27700 per_page: -1, 27701 has_published_posts: ['post'], 27702 context: 'view' 27703 }; 27704 function getFeaturedImageDetails(post, size) { 27705 var _image$media_details$; 27706 const image = post._embedded?.['wp:featuredmedia']?.['0']; 27707 return { 27708 url: (_image$media_details$ = image?.media_details?.sizes?.[size]?.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image?.source_url, 27709 alt: image?.alt_text 27710 }; 27711 } 27712 function LatestPostsEdit({ 27713 attributes, 27714 setAttributes 27715 }) { 27716 var _categoriesList$reduc; 27717 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit); 27718 const { 27719 postsToShow, 27720 order, 27721 orderBy, 27722 categories, 27723 selectedAuthor, 27724 displayFeaturedImage, 27725 displayPostContentRadio, 27726 displayPostContent, 27727 displayPostDate, 27728 displayAuthor, 27729 postLayout, 27730 columns, 27731 excerptLength, 27732 featuredImageAlign, 27733 featuredImageSizeSlug, 27734 featuredImageSizeWidth, 27735 featuredImageSizeHeight, 27736 addLinkToFeaturedImage 27737 } = attributes; 27738 const { 27739 imageSizes, 27740 latestPosts, 27741 defaultImageWidth, 27742 defaultImageHeight, 27743 categoriesList, 27744 authorList 27745 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 27746 var _settings$imageDimens, _settings$imageDimens2; 27747 const { 27748 getEntityRecords, 27749 getUsers 27750 } = select(external_wp_coreData_namespaceObject.store); 27751 const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 27752 const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : []; 27753 const latestPostsQuery = Object.fromEntries(Object.entries({ 27754 categories: catIds, 27755 author: selectedAuthor, 27756 order, 27757 orderby: orderBy, 27758 per_page: postsToShow, 27759 _embed: 'wp:featuredmedia' 27760 }).filter(([, value]) => typeof value !== 'undefined')); 27761 return { 27762 defaultImageWidth: (_settings$imageDimens = settings.imageDimensions?.[featuredImageSizeSlug]?.width) !== null && _settings$imageDimens !== void 0 ? _settings$imageDimens : 0, 27763 defaultImageHeight: (_settings$imageDimens2 = settings.imageDimensions?.[featuredImageSizeSlug]?.height) !== null && _settings$imageDimens2 !== void 0 ? _settings$imageDimens2 : 0, 27764 imageSizes: settings.imageSizes, 27765 latestPosts: getEntityRecords('postType', 'post', latestPostsQuery), 27766 categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY), 27767 authorList: getUsers(USERS_LIST_QUERY) 27768 }; 27769 }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); 27770 27771 // If a user clicks to a link prevent redirection and show a warning. 27772 const { 27773 createWarningNotice, 27774 removeNotice 27775 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 27776 let noticeId; 27777 const showRedirectionPreventedNotice = event => { 27778 event.preventDefault(); 27779 // Remove previous warning if any, to show one at a time per block. 27780 removeNotice(noticeId); 27781 noticeId = `block-library/core/latest-posts/redirection-prevented/$instanceId}`; 27782 createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { 27783 id: noticeId, 27784 type: 'snackbar' 27785 }); 27786 }; 27787 const imageSizeOptions = imageSizes.filter(({ 27788 slug 27789 }) => slug !== 'full').map(({ 27790 name, 27791 slug 27792 }) => ({ 27793 value: slug, 27794 label: name 27795 })); 27796 const categorySuggestions = (_categoriesList$reduc = categoriesList?.reduce((accumulator, category) => ({ 27797 ...accumulator, 27798 [category.name]: category 27799 }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {}; 27800 const selectCategories = tokens => { 27801 const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]); 27802 if (hasNoSuggestion) { 27803 return; 27804 } 27805 // Categories that are already will be objects, while new additions will be strings (the name). 27806 // allCategories nomalizes the array so that they are all objects. 27807 const allCategories = tokens.map(token => { 27808 return typeof token === 'string' ? categorySuggestions[token] : token; 27809 }); 27810 // We do nothing if the category is not selected 27811 // from suggestions. 27812 if (allCategories.includes(null)) { 27813 return false; 27814 } 27815 setAttributes({ 27816 categories: allCategories 27817 }); 27818 }; 27819 const hasPosts = !!latestPosts?.length; 27820 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 27821 title: (0,external_wp_i18n_namespaceObject.__)('Post content') 27822 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27823 label: (0,external_wp_i18n_namespaceObject.__)('Post content'), 27824 checked: displayPostContent, 27825 onChange: value => setAttributes({ 27826 displayPostContent: value 27827 }) 27828 }), displayPostContent && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, { 27829 label: (0,external_wp_i18n_namespaceObject.__)('Show:'), 27830 selected: displayPostContentRadio, 27831 options: [{ 27832 label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'), 27833 value: 'excerpt' 27834 }, { 27835 label: (0,external_wp_i18n_namespaceObject.__)('Full post'), 27836 value: 'full_post' 27837 }], 27838 onChange: value => setAttributes({ 27839 displayPostContentRadio: value 27840 }) 27841 }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 27842 __nextHasNoMarginBottom: true, 27843 __next40pxDefaultSize: true, 27844 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 27845 value: excerptLength, 27846 onChange: value => setAttributes({ 27847 excerptLength: value 27848 }), 27849 min: MIN_EXCERPT_LENGTH, 27850 max: MAX_EXCERPT_LENGTH 27851 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 27852 title: (0,external_wp_i18n_namespaceObject.__)('Post meta') 27853 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27854 __nextHasNoMarginBottom: true, 27855 label: (0,external_wp_i18n_namespaceObject.__)('Display author name'), 27856 checked: displayAuthor, 27857 onChange: value => setAttributes({ 27858 displayAuthor: value 27859 }) 27860 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27861 __nextHasNoMarginBottom: true, 27862 label: (0,external_wp_i18n_namespaceObject.__)('Display post date'), 27863 checked: displayPostDate, 27864 onChange: value => setAttributes({ 27865 displayPostDate: value 27866 }) 27867 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 27868 title: (0,external_wp_i18n_namespaceObject.__)('Featured image') 27869 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27870 __nextHasNoMarginBottom: true, 27871 label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'), 27872 checked: displayFeaturedImage, 27873 onChange: value => setAttributes({ 27874 displayFeaturedImage: value 27875 }) 27876 }), displayFeaturedImage && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, { 27877 onChange: value => { 27878 const newAttrs = {}; 27879 if (value.hasOwnProperty('width')) { 27880 newAttrs.featuredImageSizeWidth = value.width; 27881 } 27882 if (value.hasOwnProperty('height')) { 27883 newAttrs.featuredImageSizeHeight = value.height; 27884 } 27885 setAttributes(newAttrs); 27886 }, 27887 slug: featuredImageSizeSlug, 27888 width: featuredImageSizeWidth, 27889 height: featuredImageSizeHeight, 27890 imageWidth: defaultImageWidth, 27891 imageHeight: defaultImageHeight, 27892 imageSizeOptions: imageSizeOptions, 27893 imageSizeHelp: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.'), 27894 onChangeImage: value => setAttributes({ 27895 featuredImageSizeSlug: value, 27896 featuredImageSizeWidth: undefined, 27897 featuredImageSizeHeight: undefined 27898 }) 27899 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 27900 className: "editor-latest-posts-image-alignment-control" 27901 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, { 27902 value: featuredImageAlign, 27903 onChange: value => setAttributes({ 27904 featuredImageAlign: value 27905 }), 27906 controls: ['left', 'center', 'right'], 27907 isCollapsed: false 27908 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 27909 __nextHasNoMarginBottom: true, 27910 label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'), 27911 checked: addLinkToFeaturedImage, 27912 onChange: value => setAttributes({ 27913 addLinkToFeaturedImage: value 27914 }) 27915 }))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 27916 title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering') 27917 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, { 27918 order, 27919 orderBy, 27920 numberOfItems: postsToShow, 27921 onOrderChange: value => setAttributes({ 27922 order: value 27923 }), 27924 onOrderByChange: value => setAttributes({ 27925 orderBy: value 27926 }), 27927 onNumberOfItemsChange: value => setAttributes({ 27928 postsToShow: value 27929 }), 27930 categorySuggestions: categorySuggestions, 27931 onCategoryChange: selectCategories, 27932 selectedCategories: categories, 27933 onAuthorChange: value => setAttributes({ 27934 selectedAuthor: '' !== value ? Number(value) : undefined 27935 }), 27936 authorList: authorList !== null && authorList !== void 0 ? authorList : [], 27937 selectedAuthorId: selectedAuthor 27938 }), postLayout === 'grid' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 27939 __nextHasNoMarginBottom: true, 27940 __next40pxDefaultSize: true, 27941 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 27942 value: columns, 27943 onChange: value => setAttributes({ 27944 columns: value 27945 }), 27946 min: 2, 27947 max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length), 27948 required: true 27949 }))); 27950 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 27951 className: classnames_default()({ 27952 'wp-block-latest-posts__list': true, 27953 'is-grid': postLayout === 'grid', 27954 'has-dates': displayPostDate, 27955 'has-author': displayAuthor, 27956 [`columns-$columns}`]: postLayout === 'grid' 27957 }) 27958 }); 27959 if (!hasPosts) { 27960 return (0,external_React_namespaceObject.createElement)("div", { 27961 ...blockProps 27962 }, inspectorControls, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 27963 icon: library_pin, 27964 label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts') 27965 }, !Array.isArray(latestPosts) ? (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.'))); 27966 } 27967 27968 // Removing posts from display should be instant. 27969 const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts; 27970 const layoutControls = [{ 27971 icon: library_list, 27972 title: (0,external_wp_i18n_namespaceObject.__)('List view'), 27973 onClick: () => setAttributes({ 27974 postLayout: 'list' 27975 }), 27976 isActive: postLayout === 'list' 27977 }, { 27978 icon: library_grid, 27979 title: (0,external_wp_i18n_namespaceObject.__)('Grid view'), 27980 onClick: () => setAttributes({ 27981 postLayout: 'grid' 27982 }), 27983 isActive: postLayout === 'grid' 27984 }]; 27985 const dateFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date; 27986 return (0,external_React_namespaceObject.createElement)("div", null, inspectorControls, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { 27987 controls: layoutControls 27988 })), (0,external_React_namespaceObject.createElement)("ul", { 27989 ...blockProps 27990 }, displayPosts.map(post => { 27991 const titleTrimmed = post.title.rendered.trim(); 27992 let excerpt = post.excerpt.rendered; 27993 const currentAuthor = authorList?.find(author => author.id === post.author); 27994 const excerptElement = document.createElement('div'); 27995 excerptElement.innerHTML = excerpt; 27996 excerpt = excerptElement.textContent || excerptElement.innerText || ''; 27997 const { 27998 url: imageSourceUrl, 27999 alt: featuredImageAlt 28000 } = getFeaturedImageDetails(post, featuredImageSizeSlug); 28001 const imageClasses = classnames_default()({ 28002 'wp-block-latest-posts__featured-image': true, 28003 [`align$featuredImageAlign}`]: !!featuredImageAlign 28004 }); 28005 const renderFeaturedImage = displayFeaturedImage && imageSourceUrl; 28006 const featuredImage = renderFeaturedImage && (0,external_React_namespaceObject.createElement)("img", { 28007 src: imageSourceUrl, 28008 alt: featuredImageAlt, 28009 style: { 28010 maxWidth: featuredImageSizeWidth, 28011 maxHeight: featuredImageSizeHeight 28012 } 28013 }); 28014 const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === ''; 28015 const postExcerpt = needsReadMore ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Hidden accessibility text: Post title */ 28016 (0,external_wp_i18n_namespaceObject.__)('… <a>Read more<span>: %1$s</span></a>'), titleTrimmed || (0,external_wp_i18n_namespaceObject.__)('(no title)')), { 28017 a: 28018 // eslint-disable-next-line jsx-a11y/anchor-has-content 28019 (0,external_React_namespaceObject.createElement)("a", { 28020 className: "wp-block-latest-posts__read-more", 28021 href: post.link, 28022 rel: "noopener noreferrer", 28023 onClick: showRedirectionPreventedNotice 28024 }), 28025 span: (0,external_React_namespaceObject.createElement)("span", { 28026 className: "screen-reader-text" 28027 }) 28028 })) : excerpt; 28029 return (0,external_React_namespaceObject.createElement)("li", { 28030 key: post.id 28031 }, renderFeaturedImage && (0,external_React_namespaceObject.createElement)("div", { 28032 className: imageClasses 28033 }, addLinkToFeaturedImage ? (0,external_React_namespaceObject.createElement)("a", { 28034 className: "wp-block-latest-posts__post-title", 28035 href: post.link, 28036 rel: "noreferrer noopener", 28037 onClick: showRedirectionPreventedNotice 28038 }, featuredImage) : featuredImage), (0,external_React_namespaceObject.createElement)("a", { 28039 href: post.link, 28040 rel: "noreferrer noopener", 28041 dangerouslySetInnerHTML: !!titleTrimmed ? { 28042 __html: titleTrimmed 28043 } : undefined, 28044 onClick: showRedirectionPreventedNotice 28045 }, !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null), displayAuthor && currentAuthor && (0,external_React_namespaceObject.createElement)("div", { 28046 className: "wp-block-latest-posts__post-author" 28047 }, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: byline. %s: current author. */ 28048 (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_React_namespaceObject.createElement)("time", { 28049 dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt), 28050 className: "wp-block-latest-posts__post-date" 28051 }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_React_namespaceObject.createElement)("div", { 28052 className: "wp-block-latest-posts__post-excerpt" 28053 }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_React_namespaceObject.createElement)("div", { 28054 className: "wp-block-latest-posts__post-full-content", 28055 dangerouslySetInnerHTML: { 28056 __html: post.content.raw.trim() 28057 } 28058 })); 28059 }))); 28060 } 28061 28062 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 28063 /** 28064 * WordPress dependencies 28065 */ 28066 28067 28068 /** 28069 * Internal dependencies 28070 */ 28071 28072 28073 28074 const latest_posts_metadata = { 28075 $schema: "https://schemas.wp.org/trunk/block.json", 28076 apiVersion: 3, 28077 name: "core/latest-posts", 28078 title: "Latest Posts", 28079 category: "widgets", 28080 description: "Display a list of your most recent posts.", 28081 keywords: ["recent posts"], 28082 textdomain: "default", 28083 attributes: { 28084 categories: { 28085 type: "array", 28086 items: { 28087 type: "object" 28088 } 28089 }, 28090 selectedAuthor: { 28091 type: "number" 28092 }, 28093 postsToShow: { 28094 type: "number", 28095 "default": 5 28096 }, 28097 displayPostContent: { 28098 type: "boolean", 28099 "default": false 28100 }, 28101 displayPostContentRadio: { 28102 type: "string", 28103 "default": "excerpt" 28104 }, 28105 excerptLength: { 28106 type: "number", 28107 "default": 55 28108 }, 28109 displayAuthor: { 28110 type: "boolean", 28111 "default": false 28112 }, 28113 displayPostDate: { 28114 type: "boolean", 28115 "default": false 28116 }, 28117 postLayout: { 28118 type: "string", 28119 "default": "list" 28120 }, 28121 columns: { 28122 type: "number", 28123 "default": 3 28124 }, 28125 order: { 28126 type: "string", 28127 "default": "desc" 28128 }, 28129 orderBy: { 28130 type: "string", 28131 "default": "date" 28132 }, 28133 displayFeaturedImage: { 28134 type: "boolean", 28135 "default": false 28136 }, 28137 featuredImageAlign: { 28138 type: "string", 28139 "enum": ["left", "center", "right"] 28140 }, 28141 featuredImageSizeSlug: { 28142 type: "string", 28143 "default": "thumbnail" 28144 }, 28145 featuredImageSizeWidth: { 28146 type: "number", 28147 "default": null 28148 }, 28149 featuredImageSizeHeight: { 28150 type: "number", 28151 "default": null 28152 }, 28153 addLinkToFeaturedImage: { 28154 type: "boolean", 28155 "default": false 28156 } 28157 }, 28158 supports: { 28159 align: true, 28160 html: false, 28161 color: { 28162 gradients: true, 28163 link: true, 28164 __experimentalDefaultControls: { 28165 background: true, 28166 text: true, 28167 link: true 28168 } 28169 }, 28170 spacing: { 28171 margin: true, 28172 padding: true 28173 }, 28174 typography: { 28175 fontSize: true, 28176 lineHeight: true, 28177 __experimentalFontFamily: true, 28178 __experimentalFontWeight: true, 28179 __experimentalFontStyle: true, 28180 __experimentalTextTransform: true, 28181 __experimentalTextDecoration: true, 28182 __experimentalLetterSpacing: true, 28183 __experimentalDefaultControls: { 28184 fontSize: true 28185 } 28186 }, 28187 interactivity: { 28188 clientNavigation: true 28189 } 28190 }, 28191 editorStyle: "wp-block-latest-posts-editor", 28192 style: "wp-block-latest-posts" 28193 }; 28194 const { 28195 name: latest_posts_name 28196 } = latest_posts_metadata; 28197 28198 const latest_posts_settings = { 28199 icon: post_list, 28200 example: {}, 28201 edit: LatestPostsEdit, 28202 deprecated: latest_posts_deprecated 28203 }; 28204 const latest_posts_init = () => initBlock({ 28205 name: latest_posts_name, 28206 metadata: latest_posts_metadata, 28207 settings: latest_posts_settings 28208 }); 28209 28210 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/utils.js 28211 /** 28212 * WordPress dependencies 28213 */ 28214 28215 const LIST_STYLES = { 28216 A: 'upper-alpha', 28217 a: 'lower-alpha', 28218 I: 'upper-roman', 28219 i: 'lower-roman' 28220 }; 28221 function createListBlockFromDOMElement(listElement) { 28222 const type = listElement.getAttribute('type'); 28223 const listAttributes = { 28224 ordered: 'OL' === listElement.tagName, 28225 anchor: listElement.id === '' ? undefined : listElement.id, 28226 start: listElement.getAttribute('start') ? parseInt(listElement.getAttribute('start'), 10) : undefined, 28227 reversed: listElement.hasAttribute('reversed') ? true : undefined, 28228 type: type && LIST_STYLES[type] ? LIST_STYLES[type] : undefined 28229 }; 28230 const innerBlocks = Array.from(listElement.children).map(listItem => { 28231 const children = Array.from(listItem.childNodes).filter(node => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0); 28232 children.reverse(); 28233 const [nestedList, ...nodes] = children; 28234 const hasNestedList = nestedList?.tagName === 'UL' || nestedList?.tagName === 'OL'; 28235 if (!hasNestedList) { 28236 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 28237 content: listItem.innerHTML 28238 }); 28239 } 28240 const htmlNodes = nodes.map(node => { 28241 if (node.nodeType === node.TEXT_NODE) { 28242 return node.textContent; 28243 } 28244 return node.outerHTML; 28245 }); 28246 htmlNodes.reverse(); 28247 const childAttributes = { 28248 content: htmlNodes.join('').trim() 28249 }; 28250 const childInnerBlocks = [createListBlockFromDOMElement(nestedList)]; 28251 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', childAttributes, childInnerBlocks); 28252 }); 28253 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', listAttributes, innerBlocks); 28254 } 28255 function migrateToListV2(attributes) { 28256 const { 28257 values, 28258 start, 28259 reversed, 28260 ordered, 28261 type, 28262 ...otherAttributes 28263 } = attributes; 28264 const list = document.createElement(ordered ? 'ol' : 'ul'); 28265 list.innerHTML = values; 28266 if (start) { 28267 list.setAttribute('start', start); 28268 } 28269 if (reversed) { 28270 list.setAttribute('reversed', true); 28271 } 28272 if (type) { 28273 list.setAttribute('type', type); 28274 } 28275 const [listBlock] = (0,external_wp_blocks_namespaceObject.rawHandler)({ 28276 HTML: list.outerHTML 28277 }); 28278 return [{ 28279 ...otherAttributes, 28280 ...listBlock.attributes 28281 }, listBlock.innerBlocks]; 28282 } 28283 function migrateTypeToInlineStyle(attributes) { 28284 const { 28285 type 28286 } = attributes; 28287 if (type && LIST_STYLES[type]) { 28288 return { 28289 ...attributes, 28290 type: LIST_STYLES[type] 28291 }; 28292 } 28293 return attributes; 28294 } 28295 28296 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js 28297 28298 /** 28299 * WordPress dependencies 28300 */ 28301 28302 28303 /** 28304 * Internal dependencies 28305 */ 28306 28307 28308 const v0 = { 28309 attributes: { 28310 ordered: { 28311 type: 'boolean', 28312 default: false, 28313 __experimentalRole: 'content' 28314 }, 28315 values: { 28316 type: 'string', 28317 source: 'html', 28318 selector: 'ol,ul', 28319 multiline: 'li', 28320 __unstableMultilineWrapperTags: ['ol', 'ul'], 28321 default: '', 28322 __experimentalRole: 'content' 28323 }, 28324 type: { 28325 type: 'string' 28326 }, 28327 start: { 28328 type: 'number' 28329 }, 28330 reversed: { 28331 type: 'boolean' 28332 }, 28333 placeholder: { 28334 type: 'string' 28335 } 28336 }, 28337 supports: { 28338 anchor: true, 28339 className: false, 28340 typography: { 28341 fontSize: true, 28342 __experimentalFontFamily: true 28343 }, 28344 color: { 28345 gradients: true, 28346 link: true 28347 }, 28348 __unstablePasteTextInline: true, 28349 __experimentalSelector: 'ol,ul', 28350 __experimentalSlashInserter: true 28351 }, 28352 save({ 28353 attributes 28354 }) { 28355 const { 28356 ordered, 28357 values, 28358 type, 28359 reversed, 28360 start 28361 } = attributes; 28362 const TagName = ordered ? 'ol' : 'ul'; 28363 return (0,external_React_namespaceObject.createElement)(TagName, { 28364 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 28365 type, 28366 reversed, 28367 start 28368 }) 28369 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 28370 value: values, 28371 multiline: "li" 28372 })); 28373 }, 28374 migrate: migrate_font_family, 28375 isEligible({ 28376 style 28377 }) { 28378 return style?.typography?.fontFamily; 28379 } 28380 }; 28381 const list_deprecated_v1 = { 28382 attributes: { 28383 ordered: { 28384 type: 'boolean', 28385 default: false, 28386 __experimentalRole: 'content' 28387 }, 28388 values: { 28389 type: 'string', 28390 source: 'html', 28391 selector: 'ol,ul', 28392 multiline: 'li', 28393 __unstableMultilineWrapperTags: ['ol', 'ul'], 28394 default: '', 28395 __experimentalRole: 'content' 28396 }, 28397 type: { 28398 type: 'string' 28399 }, 28400 start: { 28401 type: 'number' 28402 }, 28403 reversed: { 28404 type: 'boolean' 28405 }, 28406 placeholder: { 28407 type: 'string' 28408 } 28409 }, 28410 supports: { 28411 anchor: true, 28412 className: false, 28413 typography: { 28414 fontSize: true, 28415 __experimentalFontFamily: true, 28416 lineHeight: true, 28417 __experimentalFontStyle: true, 28418 __experimentalFontWeight: true, 28419 __experimentalLetterSpacing: true, 28420 __experimentalTextTransform: true, 28421 __experimentalDefaultControls: { 28422 fontSize: true 28423 } 28424 }, 28425 color: { 28426 gradients: true, 28427 link: true, 28428 __experimentalDefaultControls: { 28429 background: true, 28430 text: true 28431 } 28432 }, 28433 __unstablePasteTextInline: true, 28434 __experimentalSelector: 'ol,ul', 28435 __experimentalSlashInserter: true 28436 }, 28437 save({ 28438 attributes 28439 }) { 28440 const { 28441 ordered, 28442 values, 28443 type, 28444 reversed, 28445 start 28446 } = attributes; 28447 const TagName = ordered ? 'ol' : 'ul'; 28448 return (0,external_React_namespaceObject.createElement)(TagName, { 28449 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 28450 type, 28451 reversed, 28452 start 28453 }) 28454 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 28455 value: values, 28456 multiline: "li" 28457 })); 28458 }, 28459 migrate: migrateToListV2 28460 }; 28461 28462 // In #53301 changed to use the inline style instead of type attribute. 28463 const list_deprecated_v2 = { 28464 attributes: { 28465 ordered: { 28466 type: 'boolean', 28467 default: false, 28468 __experimentalRole: 'content' 28469 }, 28470 values: { 28471 type: 'string', 28472 source: 'html', 28473 selector: 'ol,ul', 28474 multiline: 'li', 28475 __unstableMultilineWrapperTags: ['ol', 'ul'], 28476 default: '', 28477 __experimentalRole: 'content' 28478 }, 28479 type: { 28480 type: 'string' 28481 }, 28482 start: { 28483 type: 'number' 28484 }, 28485 reversed: { 28486 type: 'boolean' 28487 }, 28488 placeholder: { 28489 type: 'string' 28490 } 28491 }, 28492 supports: { 28493 anchor: true, 28494 className: false, 28495 typography: { 28496 fontSize: true, 28497 lineHeight: true, 28498 __experimentalFontFamily: true, 28499 __experimentalFontWeight: true, 28500 __experimentalFontStyle: true, 28501 __experimentalTextTransform: true, 28502 __experimentalTextDecoration: true, 28503 __experimentalLetterSpacing: true, 28504 __experimentalDefaultControls: { 28505 fontSize: true 28506 } 28507 }, 28508 color: { 28509 gradients: true, 28510 link: true, 28511 __experimentalDefaultControls: { 28512 background: true, 28513 text: true 28514 } 28515 }, 28516 spacing: { 28517 margin: true, 28518 padding: true, 28519 __experimentalDefaultControls: { 28520 margin: false, 28521 padding: false 28522 } 28523 }, 28524 __unstablePasteTextInline: true, 28525 __experimentalSelector: 'ol,ul', 28526 __experimentalSlashInserter: true 28527 }, 28528 isEligible({ 28529 type 28530 }) { 28531 return !!type; 28532 }, 28533 save({ 28534 attributes 28535 }) { 28536 const { 28537 ordered, 28538 type, 28539 reversed, 28540 start 28541 } = attributes; 28542 const TagName = ordered ? 'ol' : 'ul'; 28543 return (0,external_React_namespaceObject.createElement)(TagName, { 28544 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 28545 type, 28546 reversed, 28547 start 28548 }) 28549 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 28550 }, 28551 migrate: migrateTypeToInlineStyle 28552 }; 28553 28554 /** 28555 * New deprecations need to be placed first 28556 * for them to have higher priority. 28557 * 28558 * Old deprecations may need to be updated as well. 28559 * 28560 * See block-deprecation.md 28561 */ 28562 /* harmony default export */ const list_deprecated = ([list_deprecated_v2, list_deprecated_v1, v0]); 28563 28564 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js 28565 28566 /** 28567 * WordPress dependencies 28568 */ 28569 28570 const formatOutdentRTL = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28571 xmlns: "http://www.w3.org/2000/svg", 28572 viewBox: "0 0 24 24" 28573 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28574 d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z" 28575 })); 28576 /* harmony default export */ const format_outdent_rtl = (formatOutdentRTL); 28577 28578 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js 28579 28580 /** 28581 * WordPress dependencies 28582 */ 28583 28584 const formatOutdent = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28585 xmlns: "http://www.w3.org/2000/svg", 28586 viewBox: "0 0 24 24" 28587 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28588 d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z" 28589 })); 28590 /* harmony default export */ const format_outdent = (formatOutdent); 28591 28592 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js 28593 28594 /** 28595 * WordPress dependencies 28596 */ 28597 28598 const formatListBulletsRTL = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28599 xmlns: "http://www.w3.org/2000/svg", 28600 viewBox: "0 0 24 24" 28601 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28602 d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" 28603 })); 28604 /* harmony default export */ const format_list_bullets_rtl = (formatListBulletsRTL); 28605 28606 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js 28607 28608 /** 28609 * WordPress dependencies 28610 */ 28611 28612 const formatListBullets = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28613 xmlns: "http://www.w3.org/2000/svg", 28614 viewBox: "0 0 24 24" 28615 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28616 d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" 28617 })); 28618 /* harmony default export */ const format_list_bullets = (formatListBullets); 28619 28620 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js 28621 28622 /** 28623 * WordPress dependencies 28624 */ 28625 28626 const formatListNumberedRTL = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28627 xmlns: "http://www.w3.org/2000/svg", 28628 viewBox: "0 0 24 24" 28629 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28630 d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.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.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z" 28631 })); 28632 /* harmony default export */ const format_list_numbered_rtl = (formatListNumberedRTL); 28633 28634 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js 28635 28636 /** 28637 * WordPress dependencies 28638 */ 28639 28640 const formatListNumbered = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 28641 xmlns: "http://www.w3.org/2000/svg", 28642 viewBox: "0 0 24 24" 28643 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 28644 d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.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-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z" 28645 })); 28646 /* harmony default export */ const format_list_numbered = (formatListNumbered); 28647 28648 ;// CONCATENATED MODULE: external ["wp","deprecated"] 28649 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 28650 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 28651 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js 28652 28653 /** 28654 * WordPress dependencies 28655 */ 28656 28657 28658 28659 const OrderedListSettings = ({ 28660 setAttributes, 28661 reversed, 28662 start, 28663 type 28664 }) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 28665 title: (0,external_wp_i18n_namespaceObject.__)('Ordered list settings') 28666 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 28667 __nextHasNoMarginBottom: true, 28668 label: (0,external_wp_i18n_namespaceObject.__)('Start value'), 28669 type: "number", 28670 onChange: value => { 28671 const int = parseInt(value, 10); 28672 setAttributes({ 28673 // It should be possible to unset the value, 28674 // e.g. with an empty string. 28675 start: isNaN(int) ? undefined : int 28676 }); 28677 }, 28678 value: Number.isInteger(start) ? start.toString(10) : '', 28679 step: "1" 28680 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 28681 __nextHasNoMarginBottom: true, 28682 label: (0,external_wp_i18n_namespaceObject.__)('Numbering style'), 28683 options: [{ 28684 label: (0,external_wp_i18n_namespaceObject.__)('Numbers'), 28685 value: 'decimal' 28686 }, { 28687 label: (0,external_wp_i18n_namespaceObject.__)('Uppercase letters'), 28688 value: 'upper-alpha' 28689 }, { 28690 label: (0,external_wp_i18n_namespaceObject.__)('Lowercase letters'), 28691 value: 'lower-alpha' 28692 }, { 28693 label: (0,external_wp_i18n_namespaceObject.__)('Uppercase Roman numerals'), 28694 value: 'upper-roman' 28695 }, { 28696 label: (0,external_wp_i18n_namespaceObject.__)('Lowercase Roman numerals'), 28697 value: 'lower-roman' 28698 }], 28699 value: type, 28700 onChange: newValue => setAttributes({ 28701 type: newValue 28702 }) 28703 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 28704 __nextHasNoMarginBottom: true, 28705 label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'), 28706 checked: reversed || false, 28707 onChange: value => { 28708 setAttributes({ 28709 // Unset the attribute if not reversed. 28710 reversed: value || undefined 28711 }); 28712 } 28713 }))); 28714 /* harmony default export */ const ordered_list_settings = (OrderedListSettings); 28715 28716 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/tag-name.js 28717 28718 /** 28719 * WordPress dependencies 28720 */ 28721 28722 function TagName(props, ref) { 28723 const { 28724 ordered, 28725 ...extraProps 28726 } = props; 28727 const Tag = ordered ? 'ol' : 'ul'; 28728 return (0,external_React_namespaceObject.createElement)(Tag, { 28729 ref: ref, 28730 ...extraProps 28731 }); 28732 } 28733 /* harmony default export */ const tag_name = ((0,external_wp_element_namespaceObject.forwardRef)(TagName)); 28734 28735 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js 28736 28737 /** 28738 * WordPress dependencies 28739 */ 28740 28741 28742 28743 28744 28745 28746 28747 28748 28749 /** 28750 * Internal dependencies 28751 */ 28752 28753 28754 28755 const list_edit_TEMPLATE = [['core/list-item']]; 28756 const NATIVE_MARGIN_SPACING = 8; 28757 28758 /** 28759 * At the moment, deprecations don't handle create blocks from attributes 28760 * (like when using CPT templates). For this reason, this hook is necessary 28761 * to avoid breaking templates using the old list block format. 28762 * 28763 * @param {Object} attributes Block attributes. 28764 * @param {string} clientId Block client ID. 28765 */ 28766 function useMigrateOnLoad(attributes, clientId) { 28767 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 28768 const { 28769 updateBlockAttributes, 28770 replaceInnerBlocks 28771 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 28772 (0,external_wp_element_namespaceObject.useEffect)(() => { 28773 // As soon as the block is loaded, migrate it to the new version. 28774 28775 if (!attributes.values) { 28776 return; 28777 } 28778 const [newAttributes, newInnerBlocks] = migrateToListV2(attributes); 28779 external_wp_deprecated_default()('Value attribute on the list block', { 28780 since: '6.0', 28781 version: '6.5', 28782 alternative: 'inner blocks' 28783 }); 28784 registry.batch(() => { 28785 updateBlockAttributes(clientId, newAttributes); 28786 replaceInnerBlocks(clientId, newInnerBlocks); 28787 }); 28788 }, [attributes.values]); 28789 } 28790 function useOutdentList(clientId) { 28791 const { 28792 replaceBlocks, 28793 selectionChange 28794 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 28795 const { 28796 getBlockRootClientId, 28797 getBlockAttributes, 28798 getBlock 28799 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 28800 return (0,external_wp_element_namespaceObject.useCallback)(() => { 28801 const parentBlockId = getBlockRootClientId(clientId); 28802 const parentBlockAttributes = getBlockAttributes(parentBlockId); 28803 // Create a new parent block without the inner blocks. 28804 const newParentBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', parentBlockAttributes); 28805 const { 28806 innerBlocks 28807 } = getBlock(clientId); 28808 // Replace the parent block with a new parent block without inner blocks, 28809 // and make the inner blocks siblings of the parent. 28810 replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); 28811 // Select the last child of the list being outdent. 28812 selectionChange(innerBlocks[innerBlocks.length - 1].clientId); 28813 }, [clientId]); 28814 } 28815 function IndentUI({ 28816 clientId 28817 }) { 28818 const outdentList = useOutdentList(clientId); 28819 const canOutdent = (0,external_wp_data_namespaceObject.useSelect)(select => { 28820 const { 28821 getBlockRootClientId, 28822 getBlockName 28823 } = select(external_wp_blockEditor_namespaceObject.store); 28824 return getBlockName(getBlockRootClientId(clientId)) === 'core/list-item'; 28825 }, [clientId]); 28826 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 28827 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, 28828 title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), 28829 describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), 28830 disabled: !canOutdent, 28831 onClick: outdentList 28832 })); 28833 } 28834 function list_edit_Edit({ 28835 attributes, 28836 setAttributes, 28837 clientId, 28838 style 28839 }) { 28840 const { 28841 ordered, 28842 type, 28843 reversed, 28844 start 28845 } = attributes; 28846 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 28847 style: { 28848 ...(external_wp_element_namespaceObject.Platform.isNative && style), 28849 listStyleType: ordered && type !== 'decimal' ? type : undefined 28850 } 28851 }); 28852 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 28853 template: list_edit_TEMPLATE, 28854 templateLock: false, 28855 templateInsertUpdatesSelection: true, 28856 ...(external_wp_element_namespaceObject.Platform.isNative && { 28857 marginVertical: NATIVE_MARGIN_SPACING, 28858 marginHorizontal: NATIVE_MARGIN_SPACING, 28859 renderAppender: false 28860 }), 28861 __experimentalCaptureToolbars: true 28862 }); 28863 useMigrateOnLoad(attributes, clientId); 28864 const controls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 28865 group: "block" 28866 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 28867 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets, 28868 title: (0,external_wp_i18n_namespaceObject.__)('Unordered'), 28869 describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'), 28870 isActive: ordered === false, 28871 onClick: () => { 28872 setAttributes({ 28873 ordered: false 28874 }); 28875 } 28876 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 28877 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered, 28878 title: (0,external_wp_i18n_namespaceObject.__)('Ordered'), 28879 describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'), 28880 isActive: ordered === true, 28881 onClick: () => { 28882 setAttributes({ 28883 ordered: true 28884 }); 28885 } 28886 }), (0,external_React_namespaceObject.createElement)(IndentUI, { 28887 clientId: clientId 28888 })); 28889 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(tag_name, { 28890 ordered: ordered, 28891 reversed: reversed, 28892 start: start, 28893 ...innerBlocksProps 28894 }), controls, ordered && (0,external_React_namespaceObject.createElement)(ordered_list_settings, { 28895 setAttributes, 28896 reversed, 28897 start, 28898 type 28899 })); 28900 } 28901 28902 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js 28903 28904 /** 28905 * WordPress dependencies 28906 */ 28907 28908 function list_save_save({ 28909 attributes 28910 }) { 28911 const { 28912 ordered, 28913 type, 28914 reversed, 28915 start 28916 } = attributes; 28917 const TagName = ordered ? 'ol' : 'ul'; 28918 return (0,external_React_namespaceObject.createElement)(TagName, { 28919 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 28920 reversed, 28921 start, 28922 style: { 28923 listStyleType: ordered && type !== 'decimal' ? type : undefined 28924 } 28925 }) 28926 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 28927 } 28928 28929 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js 28930 /** 28931 * WordPress dependencies 28932 */ 28933 28934 28935 28936 /** 28937 * Internal dependencies 28938 */ 28939 28940 function getListContentSchema({ 28941 phrasingContentSchema 28942 }) { 28943 const listContentSchema = { 28944 ...phrasingContentSchema, 28945 ul: {}, 28946 ol: { 28947 attributes: ['type', 'start', 'reversed'] 28948 } 28949 }; 28950 28951 // Recursion is needed. 28952 // Possible: ul > li > ul. 28953 // Impossible: ul > ul. 28954 ['ul', 'ol'].forEach(tag => { 28955 listContentSchema[tag].children = { 28956 li: { 28957 children: listContentSchema 28958 } 28959 }; 28960 }); 28961 return listContentSchema; 28962 } 28963 function getListContentFlat(blocks) { 28964 return blocks.flatMap(({ 28965 name, 28966 attributes, 28967 innerBlocks = [] 28968 }) => { 28969 if (name === 'core/list-item') { 28970 return [attributes.content, ...getListContentFlat(innerBlocks)]; 28971 } 28972 return getListContentFlat(innerBlocks); 28973 }); 28974 } 28975 const list_transforms_transforms = { 28976 from: [{ 28977 type: 'block', 28978 isMultiBlock: true, 28979 blocks: ['core/paragraph', 'core/heading'], 28980 transform: blockAttributes => { 28981 let childBlocks = []; 28982 if (blockAttributes.length > 1) { 28983 childBlocks = blockAttributes.map(({ 28984 content 28985 }) => { 28986 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 28987 content 28988 }); 28989 }); 28990 } else if (blockAttributes.length === 1) { 28991 const value = (0,external_wp_richText_namespaceObject.create)({ 28992 html: blockAttributes[0].content 28993 }); 28994 childBlocks = (0,external_wp_richText_namespaceObject.split)(value, '\n').map(result => { 28995 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 28996 content: (0,external_wp_richText_namespaceObject.toHTMLString)({ 28997 value: result 28998 }) 28999 }); 29000 }); 29001 } 29002 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 29003 anchor: blockAttributes.anchor 29004 }, childBlocks); 29005 } 29006 }, { 29007 type: 'raw', 29008 selector: 'ol,ul', 29009 schema: args => ({ 29010 ol: getListContentSchema(args).ol, 29011 ul: getListContentSchema(args).ul 29012 }), 29013 transform: createListBlockFromDOMElement 29014 }, ...['*', '-'].map(prefix => ({ 29015 type: 'prefix', 29016 prefix, 29017 transform(content) { 29018 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 29019 content 29020 })]); 29021 } 29022 })), ...['1.', '1)'].map(prefix => ({ 29023 type: 'prefix', 29024 prefix, 29025 transform(content) { 29026 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 29027 ordered: true 29028 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 29029 content 29030 })]); 29031 } 29032 }))], 29033 to: [...['core/paragraph', 'core/heading'].map(block => ({ 29034 type: 'block', 29035 blocks: [block], 29036 transform: (_attributes, childBlocks) => { 29037 return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)(block, { 29038 content 29039 })); 29040 } 29041 }))] 29042 }; 29043 /* harmony default export */ const list_transforms = (list_transforms_transforms); 29044 29045 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js 29046 /** 29047 * WordPress dependencies 29048 */ 29049 29050 29051 29052 /** 29053 * Internal dependencies 29054 */ 29055 29056 29057 29058 const list_metadata = { 29059 $schema: "https://schemas.wp.org/trunk/block.json", 29060 apiVersion: 3, 29061 name: "core/list", 29062 title: "List", 29063 category: "text", 29064 allowedBlocks: ["core/list-item"], 29065 description: "Create a bulleted or numbered list.", 29066 keywords: ["bullet list", "ordered list", "numbered list"], 29067 textdomain: "default", 29068 attributes: { 29069 ordered: { 29070 type: "boolean", 29071 "default": false, 29072 __experimentalRole: "content" 29073 }, 29074 values: { 29075 type: "string", 29076 source: "html", 29077 selector: "ol,ul", 29078 multiline: "li", 29079 __unstableMultilineWrapperTags: ["ol", "ul"], 29080 "default": "", 29081 __experimentalRole: "content" 29082 }, 29083 type: { 29084 type: "string" 29085 }, 29086 start: { 29087 type: "number" 29088 }, 29089 reversed: { 29090 type: "boolean" 29091 }, 29092 placeholder: { 29093 type: "string" 29094 } 29095 }, 29096 supports: { 29097 anchor: true, 29098 className: false, 29099 typography: { 29100 fontSize: true, 29101 lineHeight: true, 29102 __experimentalFontFamily: true, 29103 __experimentalFontWeight: true, 29104 __experimentalFontStyle: true, 29105 __experimentalTextTransform: true, 29106 __experimentalTextDecoration: true, 29107 __experimentalLetterSpacing: true, 29108 __experimentalDefaultControls: { 29109 fontSize: true 29110 } 29111 }, 29112 color: { 29113 gradients: true, 29114 link: true, 29115 __experimentalDefaultControls: { 29116 background: true, 29117 text: true 29118 } 29119 }, 29120 spacing: { 29121 margin: true, 29122 padding: true, 29123 __experimentalDefaultControls: { 29124 margin: false, 29125 padding: false 29126 } 29127 }, 29128 __unstablePasteTextInline: true, 29129 __experimentalSelector: "ol,ul", 29130 __experimentalOnMerge: true, 29131 __experimentalSlashInserter: true, 29132 interactivity: { 29133 clientNavigation: true 29134 } 29135 }, 29136 editorStyle: "wp-block-list-editor", 29137 style: "wp-block-list" 29138 }; 29139 29140 29141 const { 29142 name: list_name 29143 } = list_metadata; 29144 29145 const list_settings = { 29146 icon: library_list, 29147 example: { 29148 innerBlocks: [{ 29149 name: 'core/list-item', 29150 attributes: { 29151 content: (0,external_wp_i18n_namespaceObject.__)('Alice.') 29152 } 29153 }, { 29154 name: 'core/list-item', 29155 attributes: { 29156 content: (0,external_wp_i18n_namespaceObject.__)('The White Rabbit.') 29157 } 29158 }, { 29159 name: 'core/list-item', 29160 attributes: { 29161 content: (0,external_wp_i18n_namespaceObject.__)('The Cheshire Cat.') 29162 } 29163 }, { 29164 name: 'core/list-item', 29165 attributes: { 29166 content: (0,external_wp_i18n_namespaceObject.__)('The Mad Hatter.') 29167 } 29168 }, { 29169 name: 'core/list-item', 29170 attributes: { 29171 content: (0,external_wp_i18n_namespaceObject.__)('The Queen of Hearts.') 29172 } 29173 }] 29174 }, 29175 transforms: list_transforms, 29176 edit: list_edit_Edit, 29177 save: list_save_save, 29178 deprecated: list_deprecated 29179 }; 29180 29181 const list_init = () => initBlock({ 29182 name: list_name, 29183 metadata: list_metadata, 29184 settings: list_settings 29185 }); 29186 29187 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-item.js 29188 29189 /** 29190 * WordPress dependencies 29191 */ 29192 29193 const listItem = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 29194 xmlns: "http://www.w3.org/2000/svg", 29195 viewBox: "0 0 24 24" 29196 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 29197 d: "M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" 29198 })); 29199 /* harmony default export */ const list_item = (listItem); 29200 29201 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js 29202 29203 /** 29204 * WordPress dependencies 29205 */ 29206 29207 const formatIndentRTL = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 29208 xmlns: "http://www.w3.org/2000/svg", 29209 viewBox: "0 0 24 24" 29210 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 29211 d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z" 29212 })); 29213 /* harmony default export */ const format_indent_rtl = (formatIndentRTL); 29214 29215 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js 29216 29217 /** 29218 * WordPress dependencies 29219 */ 29220 29221 const formatIndent = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 29222 xmlns: "http://www.w3.org/2000/svg", 29223 viewBox: "0 0 24 24" 29224 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 29225 d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z" 29226 })); 29227 /* harmony default export */ const format_indent = (formatIndent); 29228 29229 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-indent-list-item.js 29230 /** 29231 * WordPress dependencies 29232 */ 29233 29234 29235 29236 29237 function useIndentListItem(clientId) { 29238 const { 29239 replaceBlocks, 29240 selectionChange, 29241 multiSelect 29242 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 29243 const { 29244 getBlock, 29245 getPreviousBlockClientId, 29246 getSelectionStart, 29247 getSelectionEnd, 29248 hasMultiSelection, 29249 getMultiSelectedBlockClientIds 29250 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29251 return (0,external_wp_element_namespaceObject.useCallback)(() => { 29252 const _hasMultiSelection = hasMultiSelection(); 29253 const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId]; 29254 const clonedBlocks = clientIds.map(_clientId => (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(_clientId))); 29255 const previousSiblingId = getPreviousBlockClientId(clientId); 29256 const newListItem = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(previousSiblingId)); 29257 // If the sibling has no innerBlocks, create a new `list` block. 29258 if (!newListItem.innerBlocks?.length) { 29259 newListItem.innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/list')]; 29260 } 29261 // A list item usually has one `list`, but it's possible to have 29262 // more. So we need to preserve the previous `list` blocks and 29263 // merge the new blocks to the last `list`. 29264 newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks); 29265 29266 // We get the selection start/end here, because when 29267 // we replace blocks, the selection is updated too. 29268 const selectionStart = getSelectionStart(); 29269 const selectionEnd = getSelectionEnd(); 29270 // Replace the previous sibling of the block being indented and the indented blocks, 29271 // with a new block whose attributes are equal to the ones of the previous sibling and 29272 // whose descendants are the children of the previous sibling, followed by the indented blocks. 29273 replaceBlocks([previousSiblingId, ...clientIds], [newListItem]); 29274 if (!_hasMultiSelection) { 29275 selectionChange(clonedBlocks[0].clientId, selectionEnd.attributeKey, selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, selectionEnd.offset); 29276 } else { 29277 multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId); 29278 } 29279 }, [clientId]); 29280 } 29281 29282 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-outdent-list-item.js 29283 /** 29284 * WordPress dependencies 29285 */ 29286 29287 29288 29289 29290 function useOutdentListItem() { 29291 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 29292 const { 29293 moveBlocksToPosition, 29294 removeBlock, 29295 insertBlock, 29296 updateBlockListSettings 29297 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 29298 const { 29299 getBlockRootClientId, 29300 getBlockName, 29301 getBlockOrder, 29302 getBlockIndex, 29303 getSelectedBlockClientIds, 29304 getBlock, 29305 getBlockListSettings 29306 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29307 function getParentListItemId(id) { 29308 const listId = getBlockRootClientId(id); 29309 const parentListItemId = getBlockRootClientId(listId); 29310 if (!parentListItemId) return; 29311 if (getBlockName(parentListItemId) !== 'core/list-item') return; 29312 return parentListItemId; 29313 } 29314 return (0,external_wp_element_namespaceObject.useCallback)((clientIds = getSelectedBlockClientIds()) => { 29315 if (!Array.isArray(clientIds)) { 29316 clientIds = [clientIds]; 29317 } 29318 if (!clientIds.length) return; 29319 const firstClientId = clientIds[0]; 29320 29321 // Can't outdent if it's not a list item. 29322 if (getBlockName(firstClientId) !== 'core/list-item') return; 29323 const parentListItemId = getParentListItemId(firstClientId); 29324 29325 // Can't outdent if it's at the top level. 29326 if (!parentListItemId) return; 29327 const parentListId = getBlockRootClientId(firstClientId); 29328 const lastClientId = clientIds[clientIds.length - 1]; 29329 const order = getBlockOrder(parentListId); 29330 const followingListItems = order.slice(getBlockIndex(lastClientId) + 1); 29331 registry.batch(() => { 29332 if (followingListItems.length) { 29333 let nestedListId = getBlockOrder(firstClientId)[0]; 29334 if (!nestedListId) { 29335 const nestedListBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(parentListId), {}, []); 29336 nestedListId = nestedListBlock.clientId; 29337 insertBlock(nestedListBlock, 0, firstClientId, false); 29338 // Immediately update the block list settings, otherwise 29339 // blocks can't be moved here due to canInsert checks. 29340 updateBlockListSettings(nestedListId, getBlockListSettings(parentListId)); 29341 } 29342 moveBlocksToPosition(followingListItems, parentListId, nestedListId); 29343 } 29344 moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1); 29345 if (!getBlockOrder(parentListId).length) { 29346 const shouldSelectParent = false; 29347 removeBlock(parentListId, shouldSelectParent); 29348 } 29349 }); 29350 }, []); 29351 } 29352 29353 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-enter.js 29354 /** 29355 * WordPress dependencies 29356 */ 29357 29358 29359 29360 29361 29362 29363 29364 /** 29365 * Internal dependencies 29366 */ 29367 29368 function use_enter_useEnter(props) { 29369 const { 29370 replaceBlocks, 29371 selectionChange 29372 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 29373 const { 29374 getBlock, 29375 getBlockRootClientId, 29376 getBlockIndex, 29377 getBlockName 29378 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29379 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 29380 propsRef.current = props; 29381 const outdentListItem = useOutdentListItem(); 29382 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 29383 function onKeyDown(event) { 29384 if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 29385 return; 29386 } 29387 const { 29388 content, 29389 clientId 29390 } = propsRef.current; 29391 if (content.length) { 29392 return; 29393 } 29394 event.preventDefault(); 29395 const canOutdent = getBlockName(getBlockRootClientId(getBlockRootClientId(propsRef.current.clientId))) === 'core/list-item'; 29396 if (canOutdent) { 29397 outdentListItem(); 29398 return; 29399 } 29400 // Here we are in top level list so we need to split. 29401 const topParentListBlock = getBlock(getBlockRootClientId(clientId)); 29402 const blockIndex = getBlockIndex(clientId); 29403 const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ 29404 ...topParentListBlock, 29405 innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) 29406 }); 29407 const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); 29408 // Last list item might contain a `list` block innerBlock 29409 // In that case append remaining innerBlocks blocks. 29410 const after = [...(topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]?.innerBlocks || []), ...topParentListBlock.innerBlocks.slice(blockIndex + 1)]; 29411 const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ 29412 ...topParentListBlock, 29413 innerBlocks: after 29414 })] : []; 29415 replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); 29416 // We manually change the selection here because we are replacing 29417 // a different block than the selected one. 29418 selectionChange(middle.clientId); 29419 } 29420 element.addEventListener('keydown', onKeyDown); 29421 return () => { 29422 element.removeEventListener('keydown', onKeyDown); 29423 }; 29424 }, []); 29425 } 29426 29427 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-space.js 29428 /** 29429 * WordPress dependencies 29430 */ 29431 29432 29433 29434 29435 29436 /** 29437 * Internal dependencies 29438 */ 29439 29440 function useSpace(clientId) { 29441 const { 29442 getSelectionStart, 29443 getSelectionEnd, 29444 getBlockIndex 29445 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29446 const indentListItem = useIndentListItem(clientId); 29447 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 29448 function onKeyDown(event) { 29449 const { 29450 keyCode, 29451 shiftKey, 29452 altKey, 29453 metaKey, 29454 ctrlKey 29455 } = event; 29456 if (event.defaultPrevented || keyCode !== external_wp_keycodes_namespaceObject.SPACE || 29457 // Only override when no modifiers are pressed. 29458 shiftKey || altKey || metaKey || ctrlKey) { 29459 return; 29460 } 29461 if (getBlockIndex(clientId) === 0) { 29462 return; 29463 } 29464 const selectionStart = getSelectionStart(); 29465 const selectionEnd = getSelectionEnd(); 29466 if (selectionStart.offset === 0 && selectionEnd.offset === 0) { 29467 event.preventDefault(); 29468 indentListItem(); 29469 } 29470 } 29471 element.addEventListener('keydown', onKeyDown); 29472 return () => { 29473 element.removeEventListener('keydown', onKeyDown); 29474 }; 29475 }, [clientId, indentListItem]); 29476 } 29477 29478 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-split.js 29479 /** 29480 * WordPress dependencies 29481 */ 29482 29483 29484 29485 29486 function useSplit(clientId) { 29487 // We can not rely on the isAfterOriginal parameter of the callback, 29488 // because if the value after the split is empty isAfterOriginal is false 29489 // while the value is in fact after the original. So to avoid that issue we use 29490 // a flag where the first execution of the callback is false (it is the before value) 29491 // and the second execution is true, it is the after value. 29492 const isAfter = (0,external_wp_element_namespaceObject.useRef)(false); 29493 const { 29494 getBlock 29495 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29496 return (0,external_wp_element_namespaceObject.useCallback)(value => { 29497 const block = getBlock(clientId); 29498 if (isAfter.current) { 29499 return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, { 29500 content: value 29501 }); 29502 } 29503 isAfter.current = true; 29504 return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, { 29505 ...block.attributes, 29506 content: value 29507 }); 29508 }, [clientId, getBlock]); 29509 } 29510 29511 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-merge.js 29512 /** 29513 * WordPress dependencies 29514 */ 29515 29516 29517 29518 /** 29519 * Internal dependencies 29520 */ 29521 29522 function useMerge(clientId, onMerge) { 29523 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 29524 const { 29525 getPreviousBlockClientId, 29526 getNextBlockClientId, 29527 getBlockOrder, 29528 getBlockRootClientId, 29529 getBlockName 29530 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 29531 const { 29532 mergeBlocks, 29533 moveBlocksToPosition 29534 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 29535 const outdentListItem = useOutdentListItem(); 29536 function getTrailingId(id) { 29537 const order = getBlockOrder(id); 29538 if (!order.length) { 29539 return id; 29540 } 29541 return getTrailingId(order[order.length - 1]); 29542 } 29543 function getParentListItemId(id) { 29544 const listId = getBlockRootClientId(id); 29545 const parentListItemId = getBlockRootClientId(listId); 29546 if (!parentListItemId) return; 29547 if (getBlockName(parentListItemId) !== 'core/list-item') return; 29548 return parentListItemId; 29549 } 29550 29551 /** 29552 * Return the next list item with respect to the given list item. If none, 29553 * return the next list item of the parent list item if it exists. 29554 * 29555 * @param {string} id A list item client ID. 29556 * @return {string?} The client ID of the next list item. 29557 */ 29558 function _getNextId(id) { 29559 const next = getNextBlockClientId(id); 29560 if (next) return next; 29561 const parentListItemId = getParentListItemId(id); 29562 if (!parentListItemId) return; 29563 return _getNextId(parentListItemId); 29564 } 29565 29566 /** 29567 * Given a client ID, return the client ID of the list item on the next 29568 * line, regardless of indentation level. 29569 * 29570 * @param {string} id The client ID of the current list item. 29571 * @return {string?} The client ID of the next list item. 29572 */ 29573 function getNextId(id) { 29574 const order = getBlockOrder(id); 29575 29576 // If the list item does not have a nested list, return the next list 29577 // item. 29578 if (!order.length) { 29579 return _getNextId(id); 29580 } 29581 29582 // Get the first list item in the nested list. 29583 return getBlockOrder(order[0])[0]; 29584 } 29585 return forward => { 29586 function mergeWithNested(clientIdA, clientIdB) { 29587 registry.batch(() => { 29588 // When merging a sub list item with a higher next list item, we 29589 // also need to move any nested list items. Check if there's a 29590 // listed list, and append its nested list items to the current 29591 // list. 29592 const [nestedListClientId] = getBlockOrder(clientIdB); 29593 if (nestedListClientId) { 29594 moveBlocksToPosition(getBlockOrder(nestedListClientId), nestedListClientId, getBlockRootClientId(clientIdA)); 29595 } 29596 mergeBlocks(clientIdA, clientIdB); 29597 }); 29598 } 29599 if (forward) { 29600 const nextBlockClientId = getNextId(clientId); 29601 if (!nextBlockClientId) { 29602 onMerge(forward); 29603 return; 29604 } 29605 if (getParentListItemId(nextBlockClientId)) { 29606 outdentListItem(nextBlockClientId); 29607 } else { 29608 mergeWithNested(clientId, nextBlockClientId); 29609 } 29610 } else { 29611 // Merging is only done from the top level. For lowel levels, the 29612 // list item is outdented instead. 29613 const previousBlockClientId = getPreviousBlockClientId(clientId); 29614 if (getParentListItemId(clientId)) { 29615 outdentListItem(clientId); 29616 } else if (previousBlockClientId) { 29617 const trailingId = getTrailingId(previousBlockClientId); 29618 mergeWithNested(trailingId, clientId); 29619 } else { 29620 onMerge(forward); 29621 } 29622 } 29623 }; 29624 } 29625 29626 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/utils.js 29627 /** 29628 * WordPress dependencies 29629 */ 29630 29631 function convertBlockToList(block) { 29632 const list = (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, 'core/list'); 29633 if (list) { 29634 return list; 29635 } 29636 const paragraph = (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, 'core/paragraph'); 29637 if (!paragraph) { 29638 return null; 29639 } 29640 return (0,external_wp_blocks_namespaceObject.switchToBlockType)(paragraph, 'core/list'); 29641 } 29642 function convertToListItems(blocks) { 29643 const listItems = []; 29644 for (let block of blocks) { 29645 if (block.name === 'core/list-item') { 29646 listItems.push(block); 29647 } else if (block.name === 'core/list') { 29648 listItems.push(...block.innerBlocks); 29649 } else if (block = convertBlockToList(block)) { 29650 for (const { 29651 innerBlocks 29652 } of block) { 29653 listItems.push(...innerBlocks); 29654 } 29655 } 29656 } 29657 return listItems; 29658 } 29659 29660 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/edit.js 29661 29662 /** 29663 * WordPress dependencies 29664 */ 29665 29666 29667 29668 29669 29670 29671 29672 /** 29673 * Internal dependencies 29674 */ 29675 29676 29677 function edit_IndentUI({ 29678 clientId 29679 }) { 29680 const indentListItem = useIndentListItem(clientId); 29681 const outdentListItem = useOutdentListItem(); 29682 const { 29683 canIndent, 29684 canOutdent 29685 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 29686 const { 29687 getBlockIndex, 29688 getBlockRootClientId, 29689 getBlockName 29690 } = select(external_wp_blockEditor_namespaceObject.store); 29691 return { 29692 canIndent: getBlockIndex(clientId) > 0, 29693 canOutdent: getBlockName(getBlockRootClientId(getBlockRootClientId(clientId))) === 'core/list-item' 29694 }; 29695 }, [clientId]); 29696 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 29697 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, 29698 title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), 29699 describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), 29700 disabled: !canOutdent, 29701 onClick: () => outdentListItem() 29702 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 29703 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent, 29704 title: (0,external_wp_i18n_namespaceObject.__)('Indent'), 29705 describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'), 29706 isDisabled: !canIndent, 29707 onClick: () => indentListItem() 29708 })); 29709 } 29710 function ListItemEdit({ 29711 attributes, 29712 setAttributes, 29713 onReplace, 29714 clientId, 29715 mergeBlocks 29716 }) { 29717 const { 29718 placeholder, 29719 content 29720 } = attributes; 29721 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 29722 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 29723 renderAppender: false, 29724 __unstableDisableDropZone: true 29725 }); 29726 const useEnterRef = use_enter_useEnter({ 29727 content, 29728 clientId 29729 }); 29730 const useSpaceRef = useSpace(clientId); 29731 const onSplit = useSplit(clientId); 29732 const onMerge = useMerge(clientId, mergeBlocks); 29733 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("li", { 29734 ...innerBlocksProps 29735 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 29736 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]), 29737 identifier: "content", 29738 tagName: "div", 29739 onChange: nextContent => setAttributes({ 29740 content: nextContent 29741 }), 29742 value: content, 29743 "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'), 29744 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'), 29745 onSplit: onSplit, 29746 onMerge: onMerge, 29747 onReplace: onReplace ? (blocks, ...args) => { 29748 onReplace(convertToListItems(blocks), ...args); 29749 } : undefined 29750 }), innerBlocksProps.children), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 29751 group: "block" 29752 }, (0,external_React_namespaceObject.createElement)(edit_IndentUI, { 29753 clientId: clientId 29754 }))); 29755 } 29756 29757 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/save.js 29758 29759 /** 29760 * WordPress dependencies 29761 */ 29762 29763 function list_item_save_save({ 29764 attributes 29765 }) { 29766 return (0,external_React_namespaceObject.createElement)("li", { 29767 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 29768 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 29769 value: attributes.content 29770 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 29771 } 29772 29773 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/transforms.js 29774 /** 29775 * WordPress dependencies 29776 */ 29777 29778 const list_item_transforms_transforms = { 29779 to: [{ 29780 type: 'block', 29781 blocks: ['core/paragraph'], 29782 transform: (attributes, innerBlocks = []) => [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes), ...innerBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))] 29783 }] 29784 }; 29785 /* harmony default export */ const list_item_transforms = (list_item_transforms_transforms); 29786 29787 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/index.js 29788 /** 29789 * WordPress dependencies 29790 */ 29791 29792 29793 29794 /** 29795 * Internal dependencies 29796 */ 29797 29798 const list_item_metadata = { 29799 $schema: "https://schemas.wp.org/trunk/block.json", 29800 apiVersion: 3, 29801 name: "core/list-item", 29802 title: "List item", 29803 category: "text", 29804 parent: ["core/list"], 29805 allowedBlocks: ["core/list"], 29806 description: "Create a list item.", 29807 textdomain: "default", 29808 attributes: { 29809 placeholder: { 29810 type: "string" 29811 }, 29812 content: { 29813 type: "rich-text", 29814 source: "rich-text", 29815 selector: "li", 29816 __experimentalRole: "content" 29817 } 29818 }, 29819 supports: { 29820 className: false, 29821 __experimentalSelector: "li", 29822 spacing: { 29823 margin: true, 29824 padding: true, 29825 __experimentalDefaultControls: { 29826 margin: false, 29827 padding: false 29828 } 29829 }, 29830 typography: { 29831 fontSize: true, 29832 lineHeight: true, 29833 __experimentalFontFamily: true, 29834 __experimentalFontWeight: true, 29835 __experimentalFontStyle: true, 29836 __experimentalTextTransform: true, 29837 __experimentalTextDecoration: true, 29838 __experimentalLetterSpacing: true, 29839 __experimentalDefaultControls: { 29840 fontSize: true 29841 } 29842 }, 29843 interactivity: { 29844 clientNavigation: true 29845 } 29846 } 29847 }; 29848 29849 29850 29851 29852 const { 29853 name: list_item_name 29854 } = list_item_metadata; 29855 29856 const list_item_settings = { 29857 icon: list_item, 29858 edit: ListItemEdit, 29859 save: list_item_save_save, 29860 merge(attributes, attributesToMerge) { 29861 return { 29862 ...attributes, 29863 content: attributes.content + attributesToMerge.content 29864 }; 29865 }, 29866 transforms: list_item_transforms, 29867 [unlock(external_wp_blockEditor_namespaceObject.privateApis).requiresWrapperOnCopy]: true 29868 }; 29869 const list_item_init = () => initBlock({ 29870 name: list_item_name, 29871 metadata: list_item_metadata, 29872 settings: list_item_settings 29873 }); 29874 29875 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js 29876 29877 /** 29878 * WordPress dependencies 29879 */ 29880 29881 const login = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 29882 xmlns: "http://www.w3.org/2000/svg", 29883 viewBox: "0 0 24 24" 29884 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 29885 d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z" 29886 })); 29887 /* harmony default export */ const library_login = (login); 29888 29889 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js 29890 29891 /** 29892 * WordPress dependencies 29893 */ 29894 29895 29896 29897 function LoginOutEdit({ 29898 attributes, 29899 setAttributes 29900 }) { 29901 const { 29902 displayLoginAsForm, 29903 redirectToCurrent 29904 } = attributes; 29905 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 29906 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 29907 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 29908 __nextHasNoMarginBottom: true, 29909 label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'), 29910 checked: displayLoginAsForm, 29911 onChange: () => setAttributes({ 29912 displayLoginAsForm: !displayLoginAsForm 29913 }) 29914 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 29915 __nextHasNoMarginBottom: true, 29916 label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'), 29917 checked: redirectToCurrent, 29918 onChange: () => setAttributes({ 29919 redirectToCurrent: !redirectToCurrent 29920 }) 29921 }))), (0,external_React_namespaceObject.createElement)("div", { 29922 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 29923 className: 'logged-in' 29924 }) 29925 }, (0,external_React_namespaceObject.createElement)("a", { 29926 href: "#login-pseudo-link" 29927 }, (0,external_wp_i18n_namespaceObject.__)('Log out')))); 29928 } 29929 29930 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js 29931 /** 29932 * WordPress dependencies 29933 */ 29934 29935 29936 /** 29937 * Internal dependencies 29938 */ 29939 29940 29941 const loginout_metadata = { 29942 $schema: "https://schemas.wp.org/trunk/block.json", 29943 apiVersion: 3, 29944 name: "core/loginout", 29945 title: "Login/out", 29946 category: "theme", 29947 description: "Show login & logout links.", 29948 keywords: ["login", "logout", "form"], 29949 textdomain: "default", 29950 attributes: { 29951 displayLoginAsForm: { 29952 type: "boolean", 29953 "default": false 29954 }, 29955 redirectToCurrent: { 29956 type: "boolean", 29957 "default": true 29958 } 29959 }, 29960 supports: { 29961 className: true, 29962 spacing: { 29963 margin: true, 29964 padding: true, 29965 __experimentalDefaultControls: { 29966 margin: false, 29967 padding: false 29968 } 29969 }, 29970 typography: { 29971 fontSize: true, 29972 lineHeight: true, 29973 __experimentalFontFamily: true, 29974 __experimentalFontWeight: true, 29975 __experimentalFontStyle: true, 29976 __experimentalTextTransform: true, 29977 __experimentalTextDecoration: true, 29978 __experimentalLetterSpacing: true, 29979 __experimentalDefaultControls: { 29980 fontSize: true 29981 } 29982 }, 29983 interactivity: { 29984 clientNavigation: true 29985 } 29986 } 29987 }; 29988 const { 29989 name: loginout_name 29990 } = loginout_metadata; 29991 29992 const loginout_settings = { 29993 icon: library_login, 29994 edit: LoginOutEdit 29995 }; 29996 const loginout_init = () => initBlock({ 29997 name: loginout_name, 29998 metadata: loginout_metadata, 29999 settings: loginout_settings 30000 }); 30001 30002 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js 30003 30004 /** 30005 * WordPress dependencies 30006 */ 30007 30008 const mediaAndText = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 30009 xmlns: "http://www.w3.org/2000/svg", 30010 viewBox: "0 0 24 24" 30011 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 30012 d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z" 30013 })); 30014 /* harmony default export */ const media_and_text = (mediaAndText); 30015 30016 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js 30017 /** 30018 * WordPress dependencies 30019 */ 30020 30021 const DEFAULT_MEDIA_SIZE_SLUG = 'full'; 30022 const WIDTH_CONSTRAINT_PERCENTAGE = 15; 30023 const media_text_constants_LINK_DESTINATION_MEDIA = 'media'; 30024 const media_text_constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; 30025 const constants_TEMPLATE = [['core/paragraph', { 30026 placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder') 30027 }]]; 30028 30029 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js 30030 30031 /** 30032 * External dependencies 30033 */ 30034 30035 30036 /** 30037 * WordPress dependencies 30038 */ 30039 30040 30041 30042 /** 30043 * Internal dependencies 30044 */ 30045 30046 const v1ToV5ImageFillStyles = (url, focalPoint) => { 30047 return url ? { 30048 backgroundImage: `url($url})`, 30049 backgroundPosition: focalPoint ? `$focalPoint.x * 100}% $focalPoint.y * 100}%` : `50% 50%` 30050 } : {}; 30051 }; 30052 const v6ImageFillStyles = (url, focalPoint) => { 30053 return url ? { 30054 backgroundImage: `url($url})`, 30055 backgroundPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : `50% 50%` 30056 } : {}; 30057 }; 30058 const DEFAULT_MEDIA_WIDTH = 50; 30059 const noop = () => {}; 30060 const media_text_deprecated_migrateCustomColors = attributes => { 30061 if (!attributes.customBackgroundColor) { 30062 return attributes; 30063 } 30064 const style = { 30065 color: { 30066 background: attributes.customBackgroundColor 30067 } 30068 }; 30069 const { 30070 customBackgroundColor, 30071 ...restAttributes 30072 } = attributes; 30073 return { 30074 ...restAttributes, 30075 style 30076 }; 30077 }; 30078 30079 // After align attribute's default was updated this function explicitly sets 30080 // the align value for deprecated blocks to the `wide` value which was default 30081 // for their versions of this block. 30082 const migrateDefaultAlign = attributes => { 30083 if (attributes.align) { 30084 return attributes; 30085 } 30086 return { 30087 ...attributes, 30088 align: 'wide' 30089 }; 30090 }; 30091 const v0Attributes = { 30092 align: { 30093 type: 'string', 30094 default: 'wide' 30095 }, 30096 mediaAlt: { 30097 type: 'string', 30098 source: 'attribute', 30099 selector: 'figure img', 30100 attribute: 'alt', 30101 default: '' 30102 }, 30103 mediaPosition: { 30104 type: 'string', 30105 default: 'left' 30106 }, 30107 mediaId: { 30108 type: 'number' 30109 }, 30110 mediaType: { 30111 type: 'string' 30112 }, 30113 mediaWidth: { 30114 type: 'number', 30115 default: 50 30116 }, 30117 isStackedOnMobile: { 30118 type: 'boolean', 30119 default: false 30120 } 30121 }; 30122 const v4ToV5BlockAttributes = { 30123 ...v0Attributes, 30124 isStackedOnMobile: { 30125 type: 'boolean', 30126 default: true 30127 }, 30128 mediaUrl: { 30129 type: 'string', 30130 source: 'attribute', 30131 selector: 'figure video,figure img', 30132 attribute: 'src' 30133 }, 30134 mediaLink: { 30135 type: 'string' 30136 }, 30137 linkDestination: { 30138 type: 'string' 30139 }, 30140 linkTarget: { 30141 type: 'string', 30142 source: 'attribute', 30143 selector: 'figure a', 30144 attribute: 'target' 30145 }, 30146 href: { 30147 type: 'string', 30148 source: 'attribute', 30149 selector: 'figure a', 30150 attribute: 'href' 30151 }, 30152 rel: { 30153 type: 'string', 30154 source: 'attribute', 30155 selector: 'figure a', 30156 attribute: 'rel' 30157 }, 30158 linkClass: { 30159 type: 'string', 30160 source: 'attribute', 30161 selector: 'figure a', 30162 attribute: 'class' 30163 }, 30164 mediaSizeSlug: { 30165 type: 'string' 30166 }, 30167 verticalAlignment: { 30168 type: 'string' 30169 }, 30170 imageFill: { 30171 type: 'boolean' 30172 }, 30173 focalPoint: { 30174 type: 'object' 30175 } 30176 }; 30177 const v6Attributes = { 30178 ...v4ToV5BlockAttributes, 30179 mediaAlt: { 30180 type: 'string', 30181 source: 'attribute', 30182 selector: 'figure img', 30183 attribute: 'alt', 30184 default: '', 30185 __experimentalRole: 'content' 30186 }, 30187 mediaId: { 30188 type: 'number', 30189 __experimentalRole: 'content' 30190 }, 30191 mediaUrl: { 30192 type: 'string', 30193 source: 'attribute', 30194 selector: 'figure video,figure img', 30195 attribute: 'src', 30196 __experimentalRole: 'content' 30197 }, 30198 href: { 30199 type: 'string', 30200 source: 'attribute', 30201 selector: 'figure a', 30202 attribute: 'href', 30203 __experimentalRole: 'content' 30204 }, 30205 mediaType: { 30206 type: 'string', 30207 __experimentalRole: 'content' 30208 } 30209 }; 30210 const v4ToV5Supports = { 30211 anchor: true, 30212 align: ['wide', 'full'], 30213 html: false, 30214 color: { 30215 gradients: true, 30216 link: true 30217 } 30218 }; 30219 const v6Supports = { 30220 ...v4ToV5Supports, 30221 color: { 30222 gradients: true, 30223 link: true, 30224 __experimentalDefaultControls: { 30225 background: true, 30226 text: true 30227 } 30228 }, 30229 spacing: { 30230 margin: true, 30231 padding: true 30232 }, 30233 typography: { 30234 fontSize: true, 30235 lineHeight: true, 30236 __experimentalFontFamily: true, 30237 __experimentalFontWeight: true, 30238 __experimentalFontStyle: true, 30239 __experimentalTextTransform: true, 30240 __experimentalTextDecoration: true, 30241 __experimentalLetterSpacing: true, 30242 __experimentalDefaultControls: { 30243 fontSize: true 30244 } 30245 } 30246 }; 30247 30248 // Version with wide as the default alignment. 30249 // See: https://github.com/WordPress/gutenberg/pull/48404 30250 const media_text_deprecated_v6 = { 30251 attributes: v6Attributes, 30252 supports: v6Supports, 30253 save({ 30254 attributes 30255 }) { 30256 const { 30257 isStackedOnMobile, 30258 mediaAlt, 30259 mediaPosition, 30260 mediaType, 30261 mediaUrl, 30262 mediaWidth, 30263 mediaId, 30264 verticalAlignment, 30265 imageFill, 30266 focalPoint, 30267 linkClass, 30268 href, 30269 linkTarget, 30270 rel 30271 } = attributes; 30272 const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 30273 const newRel = !rel ? undefined : rel; 30274 const imageClasses = classnames_default()({ 30275 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 30276 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 30277 }); 30278 let image = (0,external_React_namespaceObject.createElement)("img", { 30279 src: mediaUrl, 30280 alt: mediaAlt, 30281 className: imageClasses || null 30282 }); 30283 if (href) { 30284 image = (0,external_React_namespaceObject.createElement)("a", { 30285 className: linkClass, 30286 href: href, 30287 target: linkTarget, 30288 rel: newRel 30289 }, image); 30290 } 30291 const mediaTypeRenders = { 30292 image: () => image, 30293 video: () => (0,external_React_namespaceObject.createElement)("video", { 30294 controls: true, 30295 src: mediaUrl 30296 }) 30297 }; 30298 const className = classnames_default()({ 30299 'has-media-on-the-right': 'right' === mediaPosition, 30300 'is-stacked-on-mobile': isStackedOnMobile, 30301 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 30302 'is-image-fill': imageFill 30303 }); 30304 const backgroundStyles = imageFill ? v6ImageFillStyles(mediaUrl, focalPoint) : {}; 30305 let gridTemplateColumns; 30306 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30307 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30308 } 30309 const style = { 30310 gridTemplateColumns 30311 }; 30312 if ('right' === mediaPosition) { 30313 return (0,external_React_namespaceObject.createElement)("div", { 30314 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30315 className, 30316 style 30317 }) 30318 }, (0,external_React_namespaceObject.createElement)("div", { 30319 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 30320 className: 'wp-block-media-text__content' 30321 }) 30322 }), (0,external_React_namespaceObject.createElement)("figure", { 30323 className: "wp-block-media-text__media", 30324 style: backgroundStyles 30325 }, (mediaTypeRenders[mediaType] || noop)())); 30326 } 30327 return (0,external_React_namespaceObject.createElement)("div", { 30328 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30329 className, 30330 style 30331 }) 30332 }, (0,external_React_namespaceObject.createElement)("figure", { 30333 className: "wp-block-media-text__media", 30334 style: backgroundStyles 30335 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30336 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 30337 className: 'wp-block-media-text__content' 30338 }) 30339 })); 30340 }, 30341 migrate: migrateDefaultAlign, 30342 isEligible(attributes, innerBlocks, { 30343 block 30344 }) { 30345 const { 30346 attributes: finalizedAttributes 30347 } = block; 30348 // When the align attribute defaults to none, valid block markup should 30349 // not contain any alignment CSS class. Unfortunately, this 30350 // deprecation's version of the block won't be invalidated due to the 30351 // alignwide class still being in the markup. That is because the custom 30352 // CSS classname support picks it up and adds it to the className 30353 // attribute. At the time of parsing, the className attribute won't 30354 // contain the alignwide class, hence the need to check the finalized 30355 // block attributes. 30356 return attributes.align === undefined && !!finalizedAttributes.className?.includes('alignwide'); 30357 } 30358 }; 30359 30360 // Version with non-rounded background position attribute for focal point. 30361 // See: https://github.com/WordPress/gutenberg/pull/33915 30362 const media_text_deprecated_v5 = { 30363 attributes: v4ToV5BlockAttributes, 30364 supports: v4ToV5Supports, 30365 save({ 30366 attributes 30367 }) { 30368 const { 30369 isStackedOnMobile, 30370 mediaAlt, 30371 mediaPosition, 30372 mediaType, 30373 mediaUrl, 30374 mediaWidth, 30375 mediaId, 30376 verticalAlignment, 30377 imageFill, 30378 focalPoint, 30379 linkClass, 30380 href, 30381 linkTarget, 30382 rel 30383 } = attributes; 30384 const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 30385 const newRel = !rel ? undefined : rel; 30386 const imageClasses = classnames_default()({ 30387 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 30388 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 30389 }); 30390 let image = (0,external_React_namespaceObject.createElement)("img", { 30391 src: mediaUrl, 30392 alt: mediaAlt, 30393 className: imageClasses || null 30394 }); 30395 if (href) { 30396 image = (0,external_React_namespaceObject.createElement)("a", { 30397 className: linkClass, 30398 href: href, 30399 target: linkTarget, 30400 rel: newRel 30401 }, image); 30402 } 30403 const mediaTypeRenders = { 30404 image: () => image, 30405 video: () => (0,external_React_namespaceObject.createElement)("video", { 30406 controls: true, 30407 src: mediaUrl 30408 }) 30409 }; 30410 const className = classnames_default()({ 30411 'has-media-on-the-right': 'right' === mediaPosition, 30412 'is-stacked-on-mobile': isStackedOnMobile, 30413 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 30414 'is-image-fill': imageFill 30415 }); 30416 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 30417 let gridTemplateColumns; 30418 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30419 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30420 } 30421 const style = { 30422 gridTemplateColumns 30423 }; 30424 if ('right' === mediaPosition) { 30425 return (0,external_React_namespaceObject.createElement)("div", { 30426 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30427 className, 30428 style 30429 }) 30430 }, (0,external_React_namespaceObject.createElement)("div", { 30431 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 30432 className: 'wp-block-media-text__content' 30433 }) 30434 }), (0,external_React_namespaceObject.createElement)("figure", { 30435 className: "wp-block-media-text__media", 30436 style: backgroundStyles 30437 }, (mediaTypeRenders[mediaType] || noop)())); 30438 } 30439 return (0,external_React_namespaceObject.createElement)("div", { 30440 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30441 className, 30442 style 30443 }) 30444 }, (0,external_React_namespaceObject.createElement)("figure", { 30445 className: "wp-block-media-text__media", 30446 style: backgroundStyles 30447 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30448 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 30449 className: 'wp-block-media-text__content' 30450 }) 30451 })); 30452 }, 30453 migrate: migrateDefaultAlign 30454 }; 30455 30456 // Version with CSS grid 30457 // See: https://github.com/WordPress/gutenberg/pull/40806 30458 const media_text_deprecated_v4 = { 30459 attributes: v4ToV5BlockAttributes, 30460 supports: v4ToV5Supports, 30461 save({ 30462 attributes 30463 }) { 30464 const { 30465 isStackedOnMobile, 30466 mediaAlt, 30467 mediaPosition, 30468 mediaType, 30469 mediaUrl, 30470 mediaWidth, 30471 mediaId, 30472 verticalAlignment, 30473 imageFill, 30474 focalPoint, 30475 linkClass, 30476 href, 30477 linkTarget, 30478 rel 30479 } = attributes; 30480 const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 30481 const newRel = !rel ? undefined : rel; 30482 const imageClasses = classnames_default()({ 30483 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 30484 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 30485 }); 30486 let image = (0,external_React_namespaceObject.createElement)("img", { 30487 src: mediaUrl, 30488 alt: mediaAlt, 30489 className: imageClasses || null 30490 }); 30491 if (href) { 30492 image = (0,external_React_namespaceObject.createElement)("a", { 30493 className: linkClass, 30494 href: href, 30495 target: linkTarget, 30496 rel: newRel 30497 }, image); 30498 } 30499 const mediaTypeRenders = { 30500 image: () => image, 30501 video: () => (0,external_React_namespaceObject.createElement)("video", { 30502 controls: true, 30503 src: mediaUrl 30504 }) 30505 }; 30506 const className = classnames_default()({ 30507 'has-media-on-the-right': 'right' === mediaPosition, 30508 'is-stacked-on-mobile': isStackedOnMobile, 30509 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 30510 'is-image-fill': imageFill 30511 }); 30512 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 30513 let gridTemplateColumns; 30514 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30515 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30516 } 30517 const style = { 30518 gridTemplateColumns 30519 }; 30520 return (0,external_React_namespaceObject.createElement)("div", { 30521 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30522 className, 30523 style 30524 }) 30525 }, (0,external_React_namespaceObject.createElement)("figure", { 30526 className: "wp-block-media-text__media", 30527 style: backgroundStyles 30528 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30529 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 30530 className: 'wp-block-media-text__content' 30531 }) 30532 })); 30533 }, 30534 migrate: migrateDefaultAlign 30535 }; 30536 30537 // Version with ad-hoc color attributes 30538 // See: https://github.com/WordPress/gutenberg/pull/21169 30539 const media_text_deprecated_v3 = { 30540 attributes: { 30541 ...v0Attributes, 30542 isStackedOnMobile: { 30543 type: 'boolean', 30544 default: true 30545 }, 30546 backgroundColor: { 30547 type: 'string' 30548 }, 30549 customBackgroundColor: { 30550 type: 'string' 30551 }, 30552 mediaLink: { 30553 type: 'string' 30554 }, 30555 linkDestination: { 30556 type: 'string' 30557 }, 30558 linkTarget: { 30559 type: 'string', 30560 source: 'attribute', 30561 selector: 'figure a', 30562 attribute: 'target' 30563 }, 30564 href: { 30565 type: 'string', 30566 source: 'attribute', 30567 selector: 'figure a', 30568 attribute: 'href' 30569 }, 30570 rel: { 30571 type: 'string', 30572 source: 'attribute', 30573 selector: 'figure a', 30574 attribute: 'rel' 30575 }, 30576 linkClass: { 30577 type: 'string', 30578 source: 'attribute', 30579 selector: 'figure a', 30580 attribute: 'class' 30581 }, 30582 verticalAlignment: { 30583 type: 'string' 30584 }, 30585 imageFill: { 30586 type: 'boolean' 30587 }, 30588 focalPoint: { 30589 type: 'object' 30590 } 30591 }, 30592 migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), 30593 save({ 30594 attributes 30595 }) { 30596 const { 30597 backgroundColor, 30598 customBackgroundColor, 30599 isStackedOnMobile, 30600 mediaAlt, 30601 mediaPosition, 30602 mediaType, 30603 mediaUrl, 30604 mediaWidth, 30605 mediaId, 30606 verticalAlignment, 30607 imageFill, 30608 focalPoint, 30609 linkClass, 30610 href, 30611 linkTarget, 30612 rel 30613 } = attributes; 30614 const newRel = !rel ? undefined : rel; 30615 let image = (0,external_React_namespaceObject.createElement)("img", { 30616 src: mediaUrl, 30617 alt: mediaAlt, 30618 className: mediaId && mediaType === 'image' ? `wp-image-$mediaId}` : null 30619 }); 30620 if (href) { 30621 image = (0,external_React_namespaceObject.createElement)("a", { 30622 className: linkClass, 30623 href: href, 30624 target: linkTarget, 30625 rel: newRel 30626 }, image); 30627 } 30628 const mediaTypeRenders = { 30629 image: () => image, 30630 video: () => (0,external_React_namespaceObject.createElement)("video", { 30631 controls: true, 30632 src: mediaUrl 30633 }) 30634 }; 30635 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 30636 const className = classnames_default()({ 30637 'has-media-on-the-right': 'right' === mediaPosition, 30638 'has-background': backgroundClass || customBackgroundColor, 30639 [backgroundClass]: backgroundClass, 30640 'is-stacked-on-mobile': isStackedOnMobile, 30641 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 30642 'is-image-fill': imageFill 30643 }); 30644 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 30645 let gridTemplateColumns; 30646 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30647 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30648 } 30649 const style = { 30650 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 30651 gridTemplateColumns 30652 }; 30653 return (0,external_React_namespaceObject.createElement)("div", { 30654 className: className, 30655 style: style 30656 }, (0,external_React_namespaceObject.createElement)("figure", { 30657 className: "wp-block-media-text__media", 30658 style: backgroundStyles 30659 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30660 className: "wp-block-media-text__content" 30661 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 30662 } 30663 }; 30664 30665 // Version with stack on mobile off by default 30666 // See: https://github.com/WordPress/gutenberg/pull/14364 30667 const media_text_deprecated_v2 = { 30668 attributes: { 30669 ...v0Attributes, 30670 backgroundColor: { 30671 type: 'string' 30672 }, 30673 customBackgroundColor: { 30674 type: 'string' 30675 }, 30676 mediaUrl: { 30677 type: 'string', 30678 source: 'attribute', 30679 selector: 'figure video,figure img', 30680 attribute: 'src' 30681 }, 30682 verticalAlignment: { 30683 type: 'string' 30684 }, 30685 imageFill: { 30686 type: 'boolean' 30687 }, 30688 focalPoint: { 30689 type: 'object' 30690 } 30691 }, 30692 migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), 30693 save({ 30694 attributes 30695 }) { 30696 const { 30697 backgroundColor, 30698 customBackgroundColor, 30699 isStackedOnMobile, 30700 mediaAlt, 30701 mediaPosition, 30702 mediaType, 30703 mediaUrl, 30704 mediaWidth, 30705 mediaId, 30706 verticalAlignment, 30707 imageFill, 30708 focalPoint 30709 } = attributes; 30710 const mediaTypeRenders = { 30711 image: () => (0,external_React_namespaceObject.createElement)("img", { 30712 src: mediaUrl, 30713 alt: mediaAlt, 30714 className: mediaId && mediaType === 'image' ? `wp-image-$mediaId}` : null 30715 }), 30716 video: () => (0,external_React_namespaceObject.createElement)("video", { 30717 controls: true, 30718 src: mediaUrl 30719 }) 30720 }; 30721 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 30722 const className = classnames_default()({ 30723 'has-media-on-the-right': 'right' === mediaPosition, 30724 [backgroundClass]: backgroundClass, 30725 'is-stacked-on-mobile': isStackedOnMobile, 30726 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 30727 'is-image-fill': imageFill 30728 }); 30729 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 30730 let gridTemplateColumns; 30731 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30732 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30733 } 30734 const style = { 30735 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 30736 gridTemplateColumns 30737 }; 30738 return (0,external_React_namespaceObject.createElement)("div", { 30739 className: className, 30740 style: style 30741 }, (0,external_React_namespaceObject.createElement)("figure", { 30742 className: "wp-block-media-text__media", 30743 style: backgroundStyles 30744 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30745 className: "wp-block-media-text__content" 30746 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 30747 } 30748 }; 30749 30750 // Version without the wp-image-#### class on image 30751 // See: https://github.com/WordPress/gutenberg/pull/11922 30752 const media_text_deprecated_v1 = { 30753 attributes: { 30754 ...v0Attributes, 30755 backgroundColor: { 30756 type: 'string' 30757 }, 30758 customBackgroundColor: { 30759 type: 'string' 30760 }, 30761 mediaUrl: { 30762 type: 'string', 30763 source: 'attribute', 30764 selector: 'figure video,figure img', 30765 attribute: 'src' 30766 } 30767 }, 30768 migrate: migrateDefaultAlign, 30769 save({ 30770 attributes 30771 }) { 30772 const { 30773 backgroundColor, 30774 customBackgroundColor, 30775 isStackedOnMobile, 30776 mediaAlt, 30777 mediaPosition, 30778 mediaType, 30779 mediaUrl, 30780 mediaWidth 30781 } = attributes; 30782 const mediaTypeRenders = { 30783 image: () => (0,external_React_namespaceObject.createElement)("img", { 30784 src: mediaUrl, 30785 alt: mediaAlt 30786 }), 30787 video: () => (0,external_React_namespaceObject.createElement)("video", { 30788 controls: true, 30789 src: mediaUrl 30790 }) 30791 }; 30792 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 30793 const className = classnames_default()({ 30794 'has-media-on-the-right': 'right' === mediaPosition, 30795 [backgroundClass]: backgroundClass, 30796 'is-stacked-on-mobile': isStackedOnMobile 30797 }); 30798 let gridTemplateColumns; 30799 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 30800 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 30801 } 30802 const style = { 30803 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 30804 gridTemplateColumns 30805 }; 30806 return (0,external_React_namespaceObject.createElement)("div", { 30807 className: className, 30808 style: style 30809 }, (0,external_React_namespaceObject.createElement)("figure", { 30810 className: "wp-block-media-text__media" 30811 }, (mediaTypeRenders[mediaType] || noop)()), (0,external_React_namespaceObject.createElement)("div", { 30812 className: "wp-block-media-text__content" 30813 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null))); 30814 } 30815 }; 30816 /* harmony default export */ const media_text_deprecated = ([media_text_deprecated_v6, media_text_deprecated_v5, media_text_deprecated_v4, media_text_deprecated_v3, media_text_deprecated_v2, media_text_deprecated_v1]); 30817 30818 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js 30819 30820 /** 30821 * WordPress dependencies 30822 */ 30823 30824 const pullLeft = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 30825 xmlns: "http://www.w3.org/2000/svg", 30826 viewBox: "0 0 24 24" 30827 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 30828 d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z" 30829 })); 30830 /* harmony default export */ const pull_left = (pullLeft); 30831 30832 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js 30833 30834 /** 30835 * WordPress dependencies 30836 */ 30837 30838 const pullRight = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 30839 xmlns: "http://www.w3.org/2000/svg", 30840 viewBox: "0 0 24 24" 30841 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 30842 d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z" 30843 })); 30844 /* harmony default export */ const pull_right = (pullRight); 30845 30846 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js 30847 30848 /** 30849 * WordPress dependencies 30850 */ 30851 30852 const media = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 30853 xmlns: "http://www.w3.org/2000/svg", 30854 viewBox: "0 0 24 24" 30855 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 30856 d: "m7 6.5 4 2.5-4 2.5z" 30857 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 30858 fillRule: "evenodd", 30859 clipRule: "evenodd", 30860 d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" 30861 })); 30862 /* harmony default export */ const library_media = (media); 30863 30864 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js 30865 30866 /** 30867 * External dependencies 30868 */ 30869 30870 30871 /** 30872 * WordPress dependencies 30873 */ 30874 30875 30876 30877 30878 30879 30880 30881 30882 30883 30884 /** 30885 * Constants 30886 */ 30887 const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video']; 30888 const media_container_noop = () => {}; 30889 function imageFillStyles(url, focalPoint) { 30890 return url ? { 30891 backgroundImage: `url($url})`, 30892 backgroundPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : `50% 50%` 30893 } : {}; 30894 } 30895 const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)(({ 30896 isSelected, 30897 isStackedOnMobile, 30898 ...props 30899 }, ref) => { 30900 const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); 30901 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 30902 ref: ref, 30903 showHandle: isSelected && (!isMobile || !isStackedOnMobile), 30904 ...props 30905 }); 30906 }); 30907 function ToolbarEditButton({ 30908 mediaId, 30909 mediaUrl, 30910 onSelectMedia 30911 }) { 30912 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 30913 group: "other" 30914 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 30915 mediaId: mediaId, 30916 mediaURL: mediaUrl, 30917 allowedTypes: media_container_ALLOWED_MEDIA_TYPES, 30918 accept: "image/*,video/*", 30919 onSelect: onSelectMedia 30920 })); 30921 } 30922 function PlaceholderContainer({ 30923 className, 30924 mediaUrl, 30925 onSelectMedia 30926 }) { 30927 const { 30928 createErrorNotice 30929 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 30930 const onUploadError = message => { 30931 createErrorNotice(message, { 30932 type: 'snackbar' 30933 }); 30934 }; 30935 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 30936 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 30937 icon: library_media 30938 }), 30939 labels: { 30940 title: (0,external_wp_i18n_namespaceObject.__)('Media area') 30941 }, 30942 className: className, 30943 onSelect: onSelectMedia, 30944 accept: "image/*,video/*", 30945 allowedTypes: media_container_ALLOWED_MEDIA_TYPES, 30946 onError: onUploadError, 30947 disableMediaButtons: mediaUrl 30948 }); 30949 } 30950 function MediaContainer(props, ref) { 30951 const { 30952 className, 30953 commitWidthChange, 30954 focalPoint, 30955 imageFill, 30956 isSelected, 30957 isStackedOnMobile, 30958 mediaAlt, 30959 mediaId, 30960 mediaPosition, 30961 mediaType, 30962 mediaUrl, 30963 mediaWidth, 30964 onSelectMedia, 30965 onWidthChange, 30966 enableResize 30967 } = props; 30968 const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl); 30969 const { 30970 toggleSelection 30971 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30972 if (mediaUrl) { 30973 const onResizeStart = () => { 30974 toggleSelection(false); 30975 }; 30976 const onResize = (event, direction, elt) => { 30977 onWidthChange(parseInt(elt.style.width)); 30978 }; 30979 const onResizeStop = (event, direction, elt) => { 30980 toggleSelection(true); 30981 commitWidthChange(parseInt(elt.style.width)); 30982 }; 30983 const enablePositions = { 30984 right: enableResize && mediaPosition === 'left', 30985 left: enableResize && mediaPosition === 'right' 30986 }; 30987 const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; 30988 const mediaTypeRenderers = { 30989 image: () => (0,external_React_namespaceObject.createElement)("img", { 30990 src: mediaUrl, 30991 alt: mediaAlt 30992 }), 30993 video: () => (0,external_React_namespaceObject.createElement)("video", { 30994 controls: true, 30995 src: mediaUrl 30996 }) 30997 }; 30998 return (0,external_React_namespaceObject.createElement)(ResizableBoxContainer, { 30999 as: "figure", 31000 className: classnames_default()(className, 'editor-media-container__resizer', { 31001 'is-transient': isTemporaryMedia 31002 }), 31003 style: backgroundStyles, 31004 size: { 31005 width: mediaWidth + '%' 31006 }, 31007 minWidth: "10%", 31008 maxWidth: "100%", 31009 enable: enablePositions, 31010 onResizeStart: onResizeStart, 31011 onResize: onResize, 31012 onResizeStop: onResizeStop, 31013 axis: "x", 31014 isSelected: isSelected, 31015 isStackedOnMobile: isStackedOnMobile, 31016 ref: ref 31017 }, (0,external_React_namespaceObject.createElement)(ToolbarEditButton, { 31018 onSelectMedia: onSelectMedia, 31019 mediaUrl: mediaUrl, 31020 mediaId: mediaId 31021 }), (mediaTypeRenderers[mediaType] || media_container_noop)(), isTemporaryMedia && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_React_namespaceObject.createElement)(PlaceholderContainer, { 31022 ...props 31023 })); 31024 } 31025 return (0,external_React_namespaceObject.createElement)(PlaceholderContainer, { 31026 ...props 31027 }); 31028 } 31029 /* harmony default export */ const media_container = ((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)); 31030 31031 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js 31032 31033 /** 31034 * External dependencies 31035 */ 31036 31037 31038 /** 31039 * WordPress dependencies 31040 */ 31041 31042 31043 31044 31045 31046 31047 31048 31049 31050 /** 31051 * Internal dependencies 31052 */ 31053 31054 31055 31056 // this limits the resize to a safe zone to avoid making broken layouts 31057 const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE)); 31058 function getImageSourceUrlBySizeSlug(image, slug) { 31059 // eslint-disable-next-line camelcase 31060 return image?.media_details?.sizes?.[slug]?.source_url; 31061 } 31062 function edit_attributesFromMedia({ 31063 attributes: { 31064 linkDestination, 31065 href 31066 }, 31067 setAttributes 31068 }) { 31069 return media => { 31070 if (!media || !media.url) { 31071 setAttributes({ 31072 mediaAlt: undefined, 31073 mediaId: undefined, 31074 mediaType: undefined, 31075 mediaUrl: undefined, 31076 mediaLink: undefined, 31077 href: undefined, 31078 focalPoint: undefined 31079 }); 31080 return; 31081 } 31082 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 31083 media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); 31084 } 31085 let mediaType; 31086 let src; 31087 // For media selections originated from a file upload. 31088 if (media.media_type) { 31089 if (media.media_type === 'image') { 31090 mediaType = 'image'; 31091 } else { 31092 // only images and videos are accepted so if the media_type is not an image we can assume it is a video. 31093 // video contain the media type of 'file' in the object returned from the rest api. 31094 mediaType = 'video'; 31095 } 31096 } else { 31097 // For media selections originated from existing files in the media library. 31098 mediaType = media.type; 31099 } 31100 if (mediaType === 'image') { 31101 // Try the "large" size URL, falling back to the "full" size URL below. 31102 src = media.sizes?.large?.url || 31103 // eslint-disable-next-line camelcase 31104 media.media_details?.sizes?.large?.source_url; 31105 } 31106 let newHref = href; 31107 if (linkDestination === media_text_constants_LINK_DESTINATION_MEDIA) { 31108 // Update the media link. 31109 newHref = media.url; 31110 } 31111 31112 // Check if the image is linked to the attachment page. 31113 if (linkDestination === media_text_constants_LINK_DESTINATION_ATTACHMENT) { 31114 // Update the media link. 31115 newHref = media.link; 31116 } 31117 setAttributes({ 31118 mediaAlt: media.alt, 31119 mediaId: media.id, 31120 mediaType, 31121 mediaUrl: src || media.url, 31122 mediaLink: media.link || undefined, 31123 href: newHref, 31124 focalPoint: undefined 31125 }); 31126 }; 31127 } 31128 function MediaTextEdit({ 31129 attributes, 31130 isSelected, 31131 setAttributes 31132 }) { 31133 const { 31134 focalPoint, 31135 href, 31136 imageFill, 31137 isStackedOnMobile, 31138 linkClass, 31139 linkDestination, 31140 linkTarget, 31141 mediaAlt, 31142 mediaId, 31143 mediaPosition, 31144 mediaType, 31145 mediaUrl, 31146 mediaWidth, 31147 rel, 31148 verticalAlignment, 31149 allowedBlocks 31150 } = attributes; 31151 const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 31152 const { 31153 imageSizes, 31154 image 31155 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 31156 const { 31157 getSettings 31158 } = select(external_wp_blockEditor_namespaceObject.store); 31159 return { 31160 image: mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, { 31161 context: 'view' 31162 }) : null, 31163 imageSizes: getSettings()?.imageSizes 31164 }; 31165 }, [isSelected, mediaId]); 31166 const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)(); 31167 const imperativeFocalPointPreview = value => { 31168 const { 31169 style 31170 } = refMediaContainer.current.resizable; 31171 const { 31172 x, 31173 y 31174 } = value; 31175 style.backgroundPosition = `$x * 100}% $y * 100}%`; 31176 }; 31177 const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null); 31178 const onSelectMedia = edit_attributesFromMedia({ 31179 attributes, 31180 setAttributes 31181 }); 31182 const onSetHref = props => { 31183 setAttributes(props); 31184 }; 31185 const onWidthChange = width => { 31186 setTemporaryMediaWidth(applyWidthConstraints(width)); 31187 }; 31188 const commitWidthChange = width => { 31189 setAttributes({ 31190 mediaWidth: applyWidthConstraints(width) 31191 }); 31192 setTemporaryMediaWidth(null); 31193 }; 31194 const classNames = classnames_default()({ 31195 'has-media-on-the-right': 'right' === mediaPosition, 31196 'is-selected': isSelected, 31197 'is-stacked-on-mobile': isStackedOnMobile, 31198 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31199 'is-image-fill': imageFill 31200 }); 31201 const widthString = `$temporaryMediaWidth || mediaWidth}%`; 31202 const gridTemplateColumns = 'right' === mediaPosition ? `1fr $widthString}` : `$widthString} 1fr`; 31203 const style = { 31204 gridTemplateColumns, 31205 msGridColumns: gridTemplateColumns 31206 }; 31207 const onMediaAltChange = newMediaAlt => { 31208 setAttributes({ 31209 mediaAlt: newMediaAlt 31210 }); 31211 }; 31212 const onVerticalAlignmentChange = alignment => { 31213 setAttributes({ 31214 verticalAlignment: alignment 31215 }); 31216 }; 31217 const imageSizeOptions = imageSizes.filter(({ 31218 slug 31219 }) => getImageSourceUrlBySizeSlug(image, slug)).map(({ 31220 name, 31221 slug 31222 }) => ({ 31223 value: slug, 31224 label: name 31225 })); 31226 const updateImage = newMediaSizeSlug => { 31227 const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug); 31228 if (!newUrl) { 31229 return null; 31230 } 31231 setAttributes({ 31232 mediaUrl: newUrl, 31233 mediaSizeSlug: newMediaSizeSlug 31234 }); 31235 }; 31236 const mediaTextGeneralSettings = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 31237 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 31238 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 31239 __nextHasNoMarginBottom: true, 31240 __next40pxDefaultSize: true, 31241 label: (0,external_wp_i18n_namespaceObject.__)('Media width'), 31242 value: temporaryMediaWidth || mediaWidth, 31243 onChange: commitWidthChange, 31244 min: WIDTH_CONSTRAINT_PERCENTAGE, 31245 max: 100 - WIDTH_CONSTRAINT_PERCENTAGE 31246 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 31247 __nextHasNoMarginBottom: true, 31248 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 31249 checked: isStackedOnMobile, 31250 onChange: () => setAttributes({ 31251 isStackedOnMobile: !isStackedOnMobile 31252 }) 31253 }), mediaType === 'image' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 31254 __nextHasNoMarginBottom: true, 31255 label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill'), 31256 checked: !!imageFill, 31257 onChange: () => setAttributes({ 31258 imageFill: !imageFill 31259 }) 31260 }), imageFill && mediaUrl && mediaType === 'image' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, { 31261 __nextHasNoMarginBottom: true, 31262 __next40pxDefaultSize: true, 31263 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 31264 url: mediaUrl, 31265 value: focalPoint, 31266 onChange: value => setAttributes({ 31267 focalPoint: value 31268 }), 31269 onDragStart: imperativeFocalPointPreview, 31270 onDrag: imperativeFocalPointPreview 31271 }), mediaType === 'image' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 31272 __nextHasNoMarginBottom: true, 31273 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 31274 value: mediaAlt, 31275 onChange: onMediaAltChange, 31276 help: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { 31277 href: "https://www.w3.org/WAI/tutorials/images/decision-tree" 31278 }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.')), (0,external_React_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')) 31279 }), mediaType === 'image' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, { 31280 onChangeImage: updateImage, 31281 slug: mediaSizeSlug, 31282 imageSizeOptions: imageSizeOptions, 31283 isResizable: false, 31284 imageSizeHelp: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.') 31285 })); 31286 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 31287 className: classNames, 31288 style 31289 }); 31290 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 31291 className: 'wp-block-media-text__content' 31292 }, { 31293 template: constants_TEMPLATE, 31294 allowedBlocks 31295 }); 31296 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 31297 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 31298 group: "block" 31299 }, blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, { 31300 onChange: onVerticalAlignmentChange, 31301 value: verticalAlignment 31302 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 31303 icon: pull_left, 31304 title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'), 31305 isActive: mediaPosition === 'left', 31306 onClick: () => setAttributes({ 31307 mediaPosition: 'left' 31308 }) 31309 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 31310 icon: pull_right, 31311 title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'), 31312 isActive: mediaPosition === 'right', 31313 onClick: () => setAttributes({ 31314 mediaPosition: 'right' 31315 }) 31316 })), mediaType === 'image' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { 31317 url: href || '', 31318 onChangeUrl: onSetHref, 31319 linkDestination: linkDestination, 31320 mediaType: mediaType, 31321 mediaUrl: image && image.source_url, 31322 mediaLink: image && image.link, 31323 linkTarget: linkTarget, 31324 linkClass: linkClass, 31325 rel: rel 31326 })), (0,external_React_namespaceObject.createElement)("div", { 31327 ...blockProps 31328 }, mediaPosition === 'right' && (0,external_React_namespaceObject.createElement)("div", { 31329 ...innerBlocksProps 31330 }), (0,external_React_namespaceObject.createElement)(media_container, { 31331 className: "wp-block-media-text__media", 31332 onSelectMedia: onSelectMedia, 31333 onWidthChange: onWidthChange, 31334 commitWidthChange: commitWidthChange, 31335 ref: refMediaContainer, 31336 enableResize: blockEditingMode === 'default', 31337 focalPoint, 31338 imageFill, 31339 isSelected, 31340 isStackedOnMobile, 31341 mediaAlt, 31342 mediaId, 31343 mediaPosition, 31344 mediaType, 31345 mediaUrl, 31346 mediaWidth 31347 }), mediaPosition !== 'right' && (0,external_React_namespaceObject.createElement)("div", { 31348 ...innerBlocksProps 31349 }))); 31350 } 31351 /* harmony default export */ const media_text_edit = (MediaTextEdit); 31352 31353 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js 31354 31355 /** 31356 * External dependencies 31357 */ 31358 31359 31360 /** 31361 * WordPress dependencies 31362 */ 31363 31364 31365 /** 31366 * Internal dependencies 31367 */ 31368 31369 31370 const save_DEFAULT_MEDIA_WIDTH = 50; 31371 const save_noop = () => {}; 31372 function media_text_save_save({ 31373 attributes 31374 }) { 31375 const { 31376 isStackedOnMobile, 31377 mediaAlt, 31378 mediaPosition, 31379 mediaType, 31380 mediaUrl, 31381 mediaWidth, 31382 mediaId, 31383 verticalAlignment, 31384 imageFill, 31385 focalPoint, 31386 linkClass, 31387 href, 31388 linkTarget, 31389 rel 31390 } = attributes; 31391 const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 31392 const newRel = !rel ? undefined : rel; 31393 const imageClasses = classnames_default()({ 31394 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 31395 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 31396 }); 31397 let image = (0,external_React_namespaceObject.createElement)("img", { 31398 src: mediaUrl, 31399 alt: mediaAlt, 31400 className: imageClasses || null 31401 }); 31402 if (href) { 31403 image = (0,external_React_namespaceObject.createElement)("a", { 31404 className: linkClass, 31405 href: href, 31406 target: linkTarget, 31407 rel: newRel 31408 }, image); 31409 } 31410 const mediaTypeRenders = { 31411 image: () => image, 31412 video: () => (0,external_React_namespaceObject.createElement)("video", { 31413 controls: true, 31414 src: mediaUrl 31415 }) 31416 }; 31417 const className = classnames_default()({ 31418 'has-media-on-the-right': 'right' === mediaPosition, 31419 'is-stacked-on-mobile': isStackedOnMobile, 31420 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31421 'is-image-fill': imageFill 31422 }); 31423 const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; 31424 let gridTemplateColumns; 31425 if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) { 31426 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31427 } 31428 const style = { 31429 gridTemplateColumns 31430 }; 31431 if ('right' === mediaPosition) { 31432 return (0,external_React_namespaceObject.createElement)("div", { 31433 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31434 className, 31435 style 31436 }) 31437 }, (0,external_React_namespaceObject.createElement)("div", { 31438 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31439 className: 'wp-block-media-text__content' 31440 }) 31441 }), (0,external_React_namespaceObject.createElement)("figure", { 31442 className: "wp-block-media-text__media", 31443 style: backgroundStyles 31444 }, (mediaTypeRenders[mediaType] || save_noop)())); 31445 } 31446 return (0,external_React_namespaceObject.createElement)("div", { 31447 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31448 className, 31449 style 31450 }) 31451 }, (0,external_React_namespaceObject.createElement)("figure", { 31452 className: "wp-block-media-text__media", 31453 style: backgroundStyles 31454 }, (mediaTypeRenders[mediaType] || save_noop)()), (0,external_React_namespaceObject.createElement)("div", { 31455 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31456 className: 'wp-block-media-text__content' 31457 }) 31458 })); 31459 } 31460 31461 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js 31462 /** 31463 * WordPress dependencies 31464 */ 31465 31466 const media_text_transforms_transforms = { 31467 from: [{ 31468 type: 'block', 31469 blocks: ['core/image'], 31470 transform: ({ 31471 alt, 31472 url, 31473 id, 31474 anchor 31475 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 31476 mediaAlt: alt, 31477 mediaId: id, 31478 mediaUrl: url, 31479 mediaType: 'image', 31480 anchor 31481 }) 31482 }, { 31483 type: 'block', 31484 blocks: ['core/video'], 31485 transform: ({ 31486 src, 31487 id, 31488 anchor 31489 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 31490 mediaId: id, 31491 mediaUrl: src, 31492 mediaType: 'video', 31493 anchor 31494 }) 31495 }, { 31496 type: 'block', 31497 blocks: ['core/cover'], 31498 transform: ({ 31499 align, 31500 alt, 31501 anchor, 31502 backgroundType, 31503 customGradient, 31504 customOverlayColor, 31505 gradient, 31506 id, 31507 overlayColor, 31508 style, 31509 textColor, 31510 url 31511 }, innerBlocks) => { 31512 let additionalAttributes = {}; 31513 if (customGradient) { 31514 additionalAttributes = { 31515 style: { 31516 color: { 31517 gradient: customGradient 31518 } 31519 } 31520 }; 31521 } else if (customOverlayColor) { 31522 additionalAttributes = { 31523 style: { 31524 color: { 31525 background: customOverlayColor 31526 } 31527 } 31528 }; 31529 } 31530 31531 // Maintain custom text color block support value. 31532 if (style?.color?.text) { 31533 additionalAttributes.style = { 31534 color: { 31535 ...additionalAttributes.style?.color, 31536 text: style.color.text 31537 } 31538 }; 31539 } 31540 return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 31541 align, 31542 anchor, 31543 backgroundColor: overlayColor, 31544 gradient, 31545 mediaAlt: alt, 31546 mediaId: id, 31547 mediaType: backgroundType, 31548 mediaUrl: url, 31549 textColor, 31550 ...additionalAttributes 31551 }, innerBlocks); 31552 } 31553 }], 31554 to: [{ 31555 type: 'block', 31556 blocks: ['core/image'], 31557 isMatch: ({ 31558 mediaType, 31559 mediaUrl 31560 }) => { 31561 return !mediaUrl || mediaType === 'image'; 31562 }, 31563 transform: ({ 31564 mediaAlt, 31565 mediaId, 31566 mediaUrl, 31567 anchor 31568 }) => { 31569 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 31570 alt: mediaAlt, 31571 id: mediaId, 31572 url: mediaUrl, 31573 anchor 31574 }); 31575 } 31576 }, { 31577 type: 'block', 31578 blocks: ['core/video'], 31579 isMatch: ({ 31580 mediaType, 31581 mediaUrl 31582 }) => { 31583 return !mediaUrl || mediaType === 'video'; 31584 }, 31585 transform: ({ 31586 mediaId, 31587 mediaUrl, 31588 anchor 31589 }) => { 31590 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 31591 id: mediaId, 31592 src: mediaUrl, 31593 anchor 31594 }); 31595 } 31596 }, { 31597 type: 'block', 31598 blocks: ['core/cover'], 31599 transform: ({ 31600 align, 31601 anchor, 31602 backgroundColor, 31603 focalPoint, 31604 gradient, 31605 mediaAlt, 31606 mediaId, 31607 mediaType, 31608 mediaUrl, 31609 style, 31610 textColor 31611 }, innerBlocks) => { 31612 const additionalAttributes = {}; 31613 31614 // Migrate the background styles or gradient to Cover's custom 31615 // gradient and overlay properties. 31616 if (style?.color?.gradient) { 31617 additionalAttributes.customGradient = style.color.gradient; 31618 } else if (style?.color?.background) { 31619 additionalAttributes.customOverlayColor = style.color.background; 31620 } 31621 31622 // Maintain custom text color support style. 31623 if (style?.color?.text) { 31624 additionalAttributes.style = { 31625 color: { 31626 text: style.color.text 31627 } 31628 }; 31629 } 31630 const coverAttributes = { 31631 align, 31632 alt: mediaAlt, 31633 anchor, 31634 backgroundType: mediaType, 31635 dimRatio: !!mediaUrl ? 50 : 100, 31636 focalPoint, 31637 gradient, 31638 id: mediaId, 31639 overlayColor: backgroundColor, 31640 textColor, 31641 url: mediaUrl, 31642 ...additionalAttributes 31643 }; 31644 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, innerBlocks); 31645 } 31646 }] 31647 }; 31648 /* harmony default export */ const media_text_transforms = (media_text_transforms_transforms); 31649 31650 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js 31651 /** 31652 * WordPress dependencies 31653 */ 31654 31655 31656 31657 /** 31658 * Internal dependencies 31659 */ 31660 31661 31662 31663 const media_text_metadata = { 31664 $schema: "https://schemas.wp.org/trunk/block.json", 31665 apiVersion: 3, 31666 name: "core/media-text", 31667 title: "Media & Text", 31668 category: "media", 31669 description: "Set media and words side-by-side for a richer layout.", 31670 keywords: ["image", "video"], 31671 textdomain: "default", 31672 attributes: { 31673 align: { 31674 type: "string", 31675 "default": "none" 31676 }, 31677 mediaAlt: { 31678 type: "string", 31679 source: "attribute", 31680 selector: "figure img", 31681 attribute: "alt", 31682 "default": "", 31683 __experimentalRole: "content" 31684 }, 31685 mediaPosition: { 31686 type: "string", 31687 "default": "left" 31688 }, 31689 mediaId: { 31690 type: "number", 31691 __experimentalRole: "content" 31692 }, 31693 mediaUrl: { 31694 type: "string", 31695 source: "attribute", 31696 selector: "figure video,figure img", 31697 attribute: "src", 31698 __experimentalRole: "content" 31699 }, 31700 mediaLink: { 31701 type: "string" 31702 }, 31703 linkDestination: { 31704 type: "string" 31705 }, 31706 linkTarget: { 31707 type: "string", 31708 source: "attribute", 31709 selector: "figure a", 31710 attribute: "target" 31711 }, 31712 href: { 31713 type: "string", 31714 source: "attribute", 31715 selector: "figure a", 31716 attribute: "href", 31717 __experimentalRole: "content" 31718 }, 31719 rel: { 31720 type: "string", 31721 source: "attribute", 31722 selector: "figure a", 31723 attribute: "rel" 31724 }, 31725 linkClass: { 31726 type: "string", 31727 source: "attribute", 31728 selector: "figure a", 31729 attribute: "class" 31730 }, 31731 mediaType: { 31732 type: "string", 31733 __experimentalRole: "content" 31734 }, 31735 mediaWidth: { 31736 type: "number", 31737 "default": 50 31738 }, 31739 mediaSizeSlug: { 31740 type: "string" 31741 }, 31742 isStackedOnMobile: { 31743 type: "boolean", 31744 "default": true 31745 }, 31746 verticalAlignment: { 31747 type: "string" 31748 }, 31749 imageFill: { 31750 type: "boolean" 31751 }, 31752 focalPoint: { 31753 type: "object" 31754 }, 31755 allowedBlocks: { 31756 type: "array" 31757 } 31758 }, 31759 supports: { 31760 anchor: true, 31761 align: ["wide", "full"], 31762 html: false, 31763 color: { 31764 gradients: true, 31765 heading: true, 31766 link: true, 31767 __experimentalDefaultControls: { 31768 background: true, 31769 text: true 31770 } 31771 }, 31772 spacing: { 31773 margin: true, 31774 padding: true 31775 }, 31776 typography: { 31777 fontSize: true, 31778 lineHeight: true, 31779 __experimentalFontFamily: true, 31780 __experimentalFontWeight: true, 31781 __experimentalFontStyle: true, 31782 __experimentalTextTransform: true, 31783 __experimentalTextDecoration: true, 31784 __experimentalLetterSpacing: true, 31785 __experimentalDefaultControls: { 31786 fontSize: true 31787 } 31788 }, 31789 interactivity: { 31790 clientNavigation: true 31791 } 31792 }, 31793 editorStyle: "wp-block-media-text-editor", 31794 style: "wp-block-media-text" 31795 }; 31796 31797 31798 const { 31799 name: media_text_name 31800 } = media_text_metadata; 31801 31802 const media_text_settings = { 31803 icon: media_and_text, 31804 example: { 31805 viewportWidth: 601, 31806 // Columns collapse "@media (max-width: 600px)". 31807 attributes: { 31808 mediaType: 'image', 31809 mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg' 31810 }, 31811 innerBlocks: [{ 31812 name: 'core/paragraph', 31813 attributes: { 31814 content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.') 31815 } 31816 }, { 31817 name: 'core/paragraph', 31818 attributes: { 31819 content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)') 31820 } 31821 }] 31822 }, 31823 transforms: media_text_transforms, 31824 edit: media_text_edit, 31825 save: media_text_save_save, 31826 deprecated: media_text_deprecated 31827 }; 31828 const media_text_init = () => initBlock({ 31829 name: media_text_name, 31830 metadata: media_text_metadata, 31831 settings: media_text_settings 31832 }); 31833 31834 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js 31835 31836 /** 31837 * WordPress dependencies 31838 */ 31839 31840 31841 31842 31843 31844 31845 31846 function MissingBlockWarning({ 31847 attributes, 31848 convertToHTML, 31849 clientId 31850 }) { 31851 const { 31852 originalName, 31853 originalUndelimitedContent 31854 } = attributes; 31855 const hasContent = !!originalUndelimitedContent; 31856 const { 31857 hasFreeformBlock, 31858 hasHTMLBlock 31859 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 31860 const { 31861 canInsertBlockType, 31862 getBlockRootClientId 31863 } = select(external_wp_blockEditor_namespaceObject.store); 31864 return { 31865 hasFreeformBlock: canInsertBlockType('core/freeform', getBlockRootClientId(clientId)), 31866 hasHTMLBlock: canInsertBlockType('core/html', getBlockRootClientId(clientId)) 31867 }; 31868 }, [clientId]); 31869 const actions = []; 31870 let messageHTML; 31871 const convertToHtmlButton = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 31872 key: "convert", 31873 onClick: convertToHTML, 31874 variant: "primary" 31875 }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')); 31876 if (hasContent && !hasFreeformBlock && !originalName) { 31877 if (hasHTMLBlock) { 31878 messageHTML = (0,external_wp_i18n_namespaceObject.__)('It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can refresh the page to use the Classic block.'); 31879 actions.push(convertToHtmlButton); 31880 } else { 31881 messageHTML = (0,external_wp_i18n_namespaceObject.__)('It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can refresh the page to use the Classic block.'); 31882 } 31883 } else if (hasContent && hasHTMLBlock) { 31884 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ 31885 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName); 31886 actions.push(convertToHtmlButton); 31887 } else { 31888 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ 31889 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName); 31890 } 31891 return (0,external_React_namespaceObject.createElement)("div", { 31892 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 31893 className: 'has-warning' 31894 }) 31895 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { 31896 actions: actions 31897 }, messageHTML), (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent))); 31898 } 31899 const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { 31900 clientId, 31901 attributes 31902 }) => { 31903 const { 31904 replaceBlock 31905 } = dispatch(external_wp_blockEditor_namespaceObject.store); 31906 return { 31907 convertToHTML() { 31908 replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { 31909 content: attributes.originalUndelimitedContent 31910 })); 31911 } 31912 }; 31913 })(MissingBlockWarning); 31914 /* harmony default export */ const missing_edit = (MissingEdit); 31915 31916 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js 31917 31918 /** 31919 * WordPress dependencies 31920 */ 31921 31922 function missing_save_save({ 31923 attributes 31924 }) { 31925 // Preserve the missing block's content. 31926 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent); 31927 } 31928 31929 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js 31930 /** 31931 * WordPress dependencies 31932 */ 31933 31934 31935 /** 31936 * Internal dependencies 31937 */ 31938 31939 31940 const missing_metadata = { 31941 $schema: "https://schemas.wp.org/trunk/block.json", 31942 apiVersion: 3, 31943 name: "core/missing", 31944 title: "Unsupported", 31945 category: "text", 31946 description: "Your site doesn\u2019t include support for this block.", 31947 textdomain: "default", 31948 attributes: { 31949 originalName: { 31950 type: "string" 31951 }, 31952 originalUndelimitedContent: { 31953 type: "string" 31954 }, 31955 originalContent: { 31956 type: "string", 31957 source: "raw" 31958 } 31959 }, 31960 supports: { 31961 className: false, 31962 customClassName: false, 31963 inserter: false, 31964 html: false, 31965 reusable: false, 31966 interactivity: { 31967 clientNavigation: true 31968 } 31969 } 31970 }; 31971 31972 const { 31973 name: missing_name 31974 } = missing_metadata; 31975 31976 const missing_settings = { 31977 name: missing_name, 31978 __experimentalLabel(attributes, { 31979 context 31980 }) { 31981 if (context === 'accessibility') { 31982 const { 31983 originalName 31984 } = attributes; 31985 const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined; 31986 if (originalBlockType) { 31987 return originalBlockType.settings.title || originalName; 31988 } 31989 return ''; 31990 } 31991 }, 31992 edit: missing_edit, 31993 save: missing_save_save 31994 }; 31995 const missing_init = () => initBlock({ 31996 name: missing_name, 31997 metadata: missing_metadata, 31998 settings: missing_settings 31999 }); 32000 32001 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js 32002 32003 /** 32004 * WordPress dependencies 32005 */ 32006 32007 const more = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32008 viewBox: "0 0 24 24", 32009 xmlns: "http://www.w3.org/2000/svg" 32010 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 32011 d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z" 32012 })); 32013 /* harmony default export */ const library_more = (more); 32014 32015 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js 32016 32017 /** 32018 * WordPress dependencies 32019 */ 32020 32021 32022 32023 32024 32025 const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more'); 32026 function MoreEdit({ 32027 attributes: { 32028 customText, 32029 noTeaser 32030 }, 32031 insertBlocksAfter, 32032 setAttributes 32033 }) { 32034 const onChangeInput = event => { 32035 setAttributes({ 32036 customText: event.target.value !== '' ? event.target.value : undefined 32037 }); 32038 }; 32039 const onKeyDown = ({ 32040 keyCode 32041 }) => { 32042 if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { 32043 insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]); 32044 } 32045 }; 32046 const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.'); 32047 const toggleHideExcerpt = () => setAttributes({ 32048 noTeaser: !noTeaser 32049 }); 32050 const style = { 32051 width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em` 32052 }; 32053 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 32054 __nextHasNoMarginBottom: true, 32055 label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'), 32056 checked: !!noTeaser, 32057 onChange: toggleHideExcerpt, 32058 help: getHideExcerptHelp 32059 }))), (0,external_React_namespaceObject.createElement)("div", { 32060 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 32061 }, (0,external_React_namespaceObject.createElement)("input", { 32062 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 32063 type: "text", 32064 value: customText, 32065 placeholder: DEFAULT_TEXT, 32066 onChange: onChangeInput, 32067 onKeyDown: onKeyDown, 32068 style: style 32069 }))); 32070 } 32071 32072 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js 32073 32074 /** 32075 * WordPress dependencies 32076 */ 32077 32078 function more_save_save({ 32079 attributes: { 32080 customText, 32081 noTeaser 32082 } 32083 }) { 32084 const moreTag = customText ? `<!--more $customText}-->` : '<!--more-->'; 32085 const noTeaserTag = noTeaser ? '<!--noteaser-->' : ''; 32086 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, [moreTag, noTeaserTag].filter(Boolean).join('\n')); 32087 } 32088 32089 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js 32090 /** 32091 * WordPress dependencies 32092 */ 32093 32094 const more_transforms_transforms = { 32095 from: [{ 32096 type: 'raw', 32097 schema: { 32098 'wp-block': { 32099 attributes: ['data-block'] 32100 } 32101 }, 32102 isMatch: node => node.dataset && node.dataset.block === 'core/more', 32103 transform(node) { 32104 const { 32105 customText, 32106 noTeaser 32107 } = node.dataset; 32108 const attrs = {}; 32109 // Don't copy unless defined and not an empty string. 32110 if (customText) { 32111 attrs.customText = customText; 32112 } 32113 // Special handling for boolean. 32114 if (noTeaser === '') { 32115 attrs.noTeaser = true; 32116 } 32117 return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs); 32118 } 32119 }] 32120 }; 32121 /* harmony default export */ const more_transforms = (more_transforms_transforms); 32122 32123 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js 32124 /** 32125 * WordPress dependencies 32126 */ 32127 32128 32129 /** 32130 * Internal dependencies 32131 */ 32132 32133 32134 const more_metadata = { 32135 $schema: "https://schemas.wp.org/trunk/block.json", 32136 apiVersion: 3, 32137 name: "core/more", 32138 title: "More", 32139 category: "design", 32140 description: "Content before this block will be shown in the excerpt on your archives page.", 32141 keywords: ["read more"], 32142 textdomain: "default", 32143 attributes: { 32144 customText: { 32145 type: "string" 32146 }, 32147 noTeaser: { 32148 type: "boolean", 32149 "default": false 32150 } 32151 }, 32152 supports: { 32153 customClassName: false, 32154 className: false, 32155 html: false, 32156 multiple: false, 32157 interactivity: { 32158 clientNavigation: true 32159 } 32160 }, 32161 editorStyle: "wp-block-more-editor" 32162 }; 32163 32164 32165 const { 32166 name: more_name 32167 } = more_metadata; 32168 32169 const more_settings = { 32170 icon: library_more, 32171 example: {}, 32172 __experimentalLabel(attributes, { 32173 context 32174 }) { 32175 const customName = attributes?.metadata?.name; 32176 if (context === 'list-view' && customName) { 32177 return customName; 32178 } 32179 if (context === 'accessibility') { 32180 return attributes.customText; 32181 } 32182 }, 32183 transforms: more_transforms, 32184 edit: MoreEdit, 32185 save: more_save_save 32186 }; 32187 const more_init = () => initBlock({ 32188 name: more_name, 32189 metadata: more_metadata, 32190 settings: more_settings 32191 }); 32192 32193 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js 32194 32195 /** 32196 * WordPress dependencies 32197 */ 32198 32199 const navigation = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32200 viewBox: "0 0 24 24", 32201 xmlns: "http://www.w3.org/2000/svg" 32202 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 32203 d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" 32204 })); 32205 /* harmony default export */ const library_navigation = (navigation); 32206 32207 ;// CONCATENATED MODULE: external ["wp","a11y"] 32208 const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; 32209 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js 32210 /** 32211 * WordPress dependencies 32212 */ 32213 32214 32215 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 32216 32217 /** 32218 * Return an SVG icon. 32219 * 32220 * @param {IconProps} props icon is the SVG component to render 32221 * size is a number specifiying the icon size in pixels 32222 * Other props will be passed to wrapped SVG component 32223 * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. 32224 * 32225 * @return {JSX.Element} Icon component 32226 */ 32227 function Icon({ 32228 icon, 32229 size = 24, 32230 ...props 32231 }, ref) { 32232 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { 32233 width: size, 32234 height: size, 32235 ...props, 32236 ref 32237 }); 32238 } 32239 /* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); 32240 32241 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 32242 32243 /** 32244 * WordPress dependencies 32245 */ 32246 32247 const close_close = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32248 xmlns: "http://www.w3.org/2000/svg", 32249 viewBox: "0 0 24 24" 32250 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 32251 d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" 32252 })); 32253 /* harmony default export */ const library_close = (close_close); 32254 32255 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/constants.js 32256 const constants_DEFAULT_BLOCK = { 32257 name: 'core/navigation-link' 32258 }; 32259 const PRIORITIZED_INSERTER_BLOCKS = ['core/navigation-link/page', 'core/navigation-link']; 32260 32261 // These parameters must be kept aligned with those in 32262 // lib/compat/wordpress-6.3/navigation-block-preloading.php 32263 // and 32264 // edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js 32265 const PRELOADED_NAVIGATION_MENUS_QUERY = { 32266 per_page: 100, 32267 status: ['publish', 'draft'], 32268 order: 'desc', 32269 orderby: 'date' 32270 }; 32271 const SELECT_NAVIGATION_MENUS_ARGS = ['postType', 'wp_navigation', PRELOADED_NAVIGATION_MENUS_QUERY]; 32272 32273 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js 32274 /** 32275 * WordPress dependencies 32276 */ 32277 32278 32279 32280 /** 32281 * Internal dependencies 32282 */ 32283 32284 function useNavigationMenu(ref) { 32285 const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('navigation', ref); 32286 const { 32287 navigationMenu, 32288 isNavigationMenuResolved, 32289 isNavigationMenuMissing 32290 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32291 return selectExistingMenu(select, ref); 32292 }, [ref]); 32293 const { 32294 canCreate, 32295 canUpdate, 32296 canDelete, 32297 isResolving, 32298 hasResolved 32299 } = permissions; 32300 const { 32301 records: navigationMenus, 32302 isResolving: isResolvingNavigationMenus, 32303 hasResolved: hasResolvedNavigationMenus 32304 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY); 32305 const canSwitchNavigationMenu = ref ? navigationMenus?.length > 1 : navigationMenus?.length > 0; 32306 return { 32307 navigationMenu, 32308 isNavigationMenuResolved, 32309 isNavigationMenuMissing, 32310 navigationMenus, 32311 isResolvingNavigationMenus, 32312 hasResolvedNavigationMenus, 32313 canSwitchNavigationMenu, 32314 canUserCreateNavigationMenu: canCreate, 32315 isResolvingCanUserCreateNavigationMenu: isResolving, 32316 hasResolvedCanUserCreateNavigationMenu: hasResolved, 32317 canUserUpdateNavigationMenu: canUpdate, 32318 hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolved : undefined, 32319 canUserDeleteNavigationMenu: canDelete, 32320 hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolved : undefined 32321 }; 32322 } 32323 function selectExistingMenu(select, ref) { 32324 if (!ref) { 32325 return { 32326 isNavigationMenuResolved: false, 32327 isNavigationMenuMissing: true 32328 }; 32329 } 32330 const { 32331 getEntityRecord, 32332 getEditedEntityRecord, 32333 hasFinishedResolution 32334 } = select(external_wp_coreData_namespaceObject.store); 32335 const args = ['postType', 'wp_navigation', ref]; 32336 const navigationMenu = getEntityRecord(...args); 32337 const editedNavigationMenu = getEditedEntityRecord(...args); 32338 const hasResolvedNavigationMenu = hasFinishedResolution('getEditedEntityRecord', args); 32339 32340 // Only published Navigation posts are considered valid. 32341 // Draft Navigation posts are valid only on the editor, 32342 // requiring a post update to publish to show in frontend. 32343 // To achieve that, index.php must reflect this validation only for published. 32344 const isNavigationMenuPublishedOrDraft = editedNavigationMenu.status === 'publish' || editedNavigationMenu.status === 'draft'; 32345 return { 32346 isNavigationMenuResolved: hasResolvedNavigationMenu, 32347 isNavigationMenuMissing: hasResolvedNavigationMenu && (!navigationMenu || !isNavigationMenuPublishedOrDraft), 32348 // getEditedEntityRecord will return the post regardless of status. 32349 // Therefore if the found post is not published then we should ignore it. 32350 navigationMenu: isNavigationMenuPublishedOrDraft ? editedNavigationMenu : null 32351 }; 32352 } 32353 32354 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js 32355 /** 32356 * WordPress dependencies 32357 */ 32358 32359 32360 /** 32361 * @typedef {Object} NavigationEntitiesData 32362 * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page". 32363 * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving. 32364 * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving. 32365 * @property {Array|undefined} menus - a collection of Menu entity objects. 32366 * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving. 32367 * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving. 32368 * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId. 32369 * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving. 32370 * @property {boolean} hasPages - indicates whether there is currently any data for pages. 32371 * @property {boolean} hasMenus - indicates whether there is currently any data for menus. 32372 */ 32373 32374 /** 32375 * Manages fetching and resolution state for all entities required 32376 * for the Navigation block. 32377 * 32378 * @param {number} menuId the menu for which to retrieve menuItem data. 32379 * @return { NavigationEntitiesData } the entity data. 32380 */ 32381 function useNavigationEntities(menuId) { 32382 const { 32383 records: menus, 32384 isResolving: isResolvingMenus, 32385 hasResolved: hasResolvedMenus 32386 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menu', { 32387 per_page: -1, 32388 context: 'view' 32389 }); 32390 const { 32391 records: pages, 32392 isResolving: isResolvingPages, 32393 hasResolved: hasResolvedPages 32394 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { 32395 parent: 0, 32396 order: 'asc', 32397 orderby: 'id', 32398 per_page: -1, 32399 context: 'view' 32400 }); 32401 const { 32402 records: menuItems, 32403 hasResolved: hasResolvedMenuItems 32404 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menuItem', { 32405 menus: menuId, 32406 per_page: -1, 32407 context: 'view' 32408 }, { 32409 enabled: !!menuId 32410 }); 32411 return { 32412 pages, 32413 isResolvingPages, 32414 hasResolvedPages, 32415 hasPages: !!(hasResolvedPages && pages?.length), 32416 menus, 32417 isResolvingMenus, 32418 hasResolvedMenus, 32419 hasMenus: !!(hasResolvedMenus && menus?.length), 32420 menuItems, 32421 hasResolvedMenuItems 32422 }; 32423 } 32424 32425 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js 32426 32427 /** 32428 * WordPress dependencies 32429 */ 32430 32431 32432 const PlaceholderPreview = ({ 32433 isVisible = true 32434 }) => { 32435 return (0,external_React_namespaceObject.createElement)("div", { 32436 "aria-hidden": !isVisible ? true : undefined, 32437 className: "wp-block-navigation-placeholder__preview" 32438 }, (0,external_React_namespaceObject.createElement)("div", { 32439 className: "wp-block-navigation-placeholder__actions__indicator" 32440 }, (0,external_React_namespaceObject.createElement)(build_module_icon, { 32441 icon: library_navigation 32442 }), (0,external_wp_i18n_namespaceObject.__)('Navigation'))); 32443 }; 32444 /* harmony default export */ const placeholder_preview = (PlaceholderPreview); 32445 32446 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js 32447 32448 /** 32449 * WordPress dependencies 32450 */ 32451 32452 const moreVertical = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32453 xmlns: "http://www.w3.org/2000/svg", 32454 viewBox: "0 0 24 24" 32455 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 32456 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" 32457 })); 32458 /* harmony default export */ const more_vertical = (moreVertical); 32459 32460 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js 32461 32462 /** 32463 * WordPress dependencies 32464 */ 32465 32466 32467 32468 32469 32470 32471 32472 /** 32473 * Internal dependencies 32474 */ 32475 32476 32477 function buildMenuLabel(title, id, status) { 32478 if (!title) { 32479 /* translators: %s is the index of the menu in the list of menus. */ 32480 return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); 32481 } 32482 if (status === 'publish') { 32483 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); 32484 } 32485 return (0,external_wp_i18n_namespaceObject.sprintf)( 32486 // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.). 32487 (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); 32488 } 32489 function NavigationMenuSelector({ 32490 currentMenuId, 32491 onSelectNavigationMenu, 32492 onSelectClassicMenu, 32493 onCreateNew, 32494 actionLabel, 32495 createNavigationMenuIsSuccess, 32496 createNavigationMenuIsError 32497 }) { 32498 /* translators: %s: The name of a menu. */ 32499 const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'"); 32500 const [isUpdatingMenuRef, setIsUpdatingMenuRef] = (0,external_wp_element_namespaceObject.useState)(false); 32501 actionLabel = actionLabel || createActionLabel; 32502 const { 32503 menus: classicMenus 32504 } = useNavigationEntities(); 32505 const { 32506 navigationMenus, 32507 isResolvingNavigationMenus, 32508 hasResolvedNavigationMenus, 32509 canUserCreateNavigationMenu, 32510 canSwitchNavigationMenu 32511 } = useNavigationMenu(); 32512 const [currentTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 32513 const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => { 32514 return navigationMenus?.map(({ 32515 id, 32516 title, 32517 status 32518 }, index) => { 32519 const label = buildMenuLabel(title?.rendered, index + 1, status); 32520 return { 32521 value: id, 32522 label, 32523 ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label), 32524 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus 32525 }; 32526 }) || []; 32527 }, [navigationMenus, actionLabel, isResolvingNavigationMenus, hasResolvedNavigationMenus, isUpdatingMenuRef]); 32528 const hasNavigationMenus = !!navigationMenus?.length; 32529 const hasClassicMenus = !!classicMenus?.length; 32530 const showNavigationMenus = !!canSwitchNavigationMenu; 32531 const showClassicMenus = !!canUserCreateNavigationMenu; 32532 const noMenuSelected = hasNavigationMenus && !currentMenuId; 32533 const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus; 32534 const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null; 32535 let selectorLabel = ''; 32536 if (isResolvingNavigationMenus) { 32537 selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Loading…'); 32538 } else if (noMenuSelected || noBlockMenus || menuUnavailable) { 32539 // Note: classic Menus may be available. 32540 selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Choose or create a Navigation menu'); 32541 } else { 32542 // Current Menu's title. 32543 selectorLabel = currentTitle; 32544 } 32545 (0,external_wp_element_namespaceObject.useEffect)(() => { 32546 if (isUpdatingMenuRef && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) { 32547 setIsUpdatingMenuRef(false); 32548 } 32549 }, [hasResolvedNavigationMenus, createNavigationMenuIsSuccess, canUserCreateNavigationMenu, createNavigationMenuIsError, isUpdatingMenuRef, menuUnavailable, noBlockMenus, noMenuSelected]); 32550 const NavigationMenuSelectorDropdown = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { 32551 label: selectorLabel, 32552 icon: more_vertical, 32553 toggleProps: { 32554 isSmall: true 32555 } 32556 }, ({ 32557 onClose 32558 }) => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { 32559 label: (0,external_wp_i18n_namespaceObject.__)('Menus') 32560 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, { 32561 value: currentMenuId, 32562 onSelect: menuId => { 32563 onSelectNavigationMenu(menuId); 32564 onClose(); 32565 }, 32566 choices: menuChoices 32567 })), showClassicMenus && hasClassicMenus && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { 32568 label: (0,external_wp_i18n_namespaceObject.__)('Import Classic Menus') 32569 }, classicMenus?.map(menu => { 32570 const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name); 32571 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 32572 onClick: async () => { 32573 setIsUpdatingMenuRef(true); 32574 await onSelectClassicMenu(menu); 32575 setIsUpdatingMenuRef(false); 32576 onClose(); 32577 }, 32578 key: menu.id, 32579 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label), 32580 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus 32581 }, label); 32582 })), canUserCreateNavigationMenu && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { 32583 label: (0,external_wp_i18n_namespaceObject.__)('Tools') 32584 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 32585 onClick: async () => { 32586 setIsUpdatingMenuRef(true); 32587 await onCreateNew(); 32588 setIsUpdatingMenuRef(false); 32589 onClose(); 32590 }, 32591 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus 32592 }, (0,external_wp_i18n_namespaceObject.__)('Create new menu'))))); 32593 return NavigationMenuSelectorDropdown; 32594 } 32595 /* harmony default export */ const navigation_menu_selector = (NavigationMenuSelector); 32596 32597 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js 32598 32599 /** 32600 * WordPress dependencies 32601 */ 32602 32603 32604 32605 32606 32607 32608 /** 32609 * Internal dependencies 32610 */ 32611 32612 32613 32614 function NavigationPlaceholder({ 32615 isSelected, 32616 currentMenuId, 32617 clientId, 32618 canUserCreateNavigationMenu = false, 32619 isResolvingCanUserCreateNavigationMenu, 32620 onSelectNavigationMenu, 32621 onSelectClassicMenu, 32622 onCreateEmpty 32623 }) { 32624 const { 32625 isResolvingMenus, 32626 hasResolvedMenus 32627 } = useNavigationEntities(); 32628 (0,external_wp_element_namespaceObject.useEffect)(() => { 32629 if (!isSelected) { 32630 return; 32631 } 32632 if (isResolvingMenus) { 32633 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading navigation block setup options…')); 32634 } 32635 if (hasResolvedMenus) { 32636 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.')); 32637 } 32638 }, [hasResolvedMenus, isResolvingMenus, isSelected]); 32639 const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu; 32640 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 32641 className: "wp-block-navigation-placeholder" 32642 }, (0,external_React_namespaceObject.createElement)(placeholder_preview, { 32643 isVisible: !isSelected 32644 }), (0,external_React_namespaceObject.createElement)("div", { 32645 "aria-hidden": !isSelected ? true : undefined, 32646 className: "wp-block-navigation-placeholder__controls" 32647 }, (0,external_React_namespaceObject.createElement)("div", { 32648 className: "wp-block-navigation-placeholder__actions" 32649 }, (0,external_React_namespaceObject.createElement)("div", { 32650 className: "wp-block-navigation-placeholder__actions__indicator" 32651 }, (0,external_React_namespaceObject.createElement)(build_module_icon, { 32652 icon: library_navigation 32653 }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_React_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_React_namespaceObject.createElement)(navigation_menu_selector, { 32654 currentMenuId: currentMenuId, 32655 clientId: clientId, 32656 onSelectNavigationMenu: onSelectNavigationMenu, 32657 onSelectClassicMenu: onSelectClassicMenu 32658 }), (0,external_React_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 32659 variant: "tertiary", 32660 onClick: onCreateEmpty 32661 }, (0,external_wp_i18n_namespaceObject.__)('Start empty')))))); 32662 } 32663 32664 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/menu.js 32665 32666 /** 32667 * WordPress dependencies 32668 */ 32669 32670 const menu = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32671 xmlns: "http://www.w3.org/2000/svg", 32672 viewBox: "0 0 24 24" 32673 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 32674 d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" 32675 })); 32676 /* harmony default export */ const library_menu = (menu); 32677 32678 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js 32679 32680 /** 32681 * WordPress dependencies 32682 */ 32683 32684 32685 function OverlayMenuIcon({ 32686 icon 32687 }) { 32688 if (icon === 'menu') { 32689 return (0,external_React_namespaceObject.createElement)(build_module_icon, { 32690 icon: library_menu 32691 }); 32692 } 32693 return (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 32694 xmlns: "http://www.w3.org/2000/svg", 32695 viewBox: "0 0 24 24", 32696 width: "24", 32697 height: "24", 32698 "aria-hidden": "true", 32699 focusable: "false" 32700 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, { 32701 x: "4", 32702 y: "7.5", 32703 width: "16", 32704 height: "1.5" 32705 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, { 32706 x: "4", 32707 y: "15", 32708 width: "16", 32709 height: "1.5" 32710 })); 32711 } 32712 32713 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js 32714 32715 /** 32716 * External dependencies 32717 */ 32718 32719 32720 /** 32721 * WordPress dependencies 32722 */ 32723 32724 32725 32726 32727 32728 /** 32729 * Internal dependencies 32730 */ 32731 32732 function ResponsiveWrapper({ 32733 children, 32734 id, 32735 isOpen, 32736 isResponsive, 32737 onToggle, 32738 isHiddenByDefault, 32739 overlayBackgroundColor, 32740 overlayTextColor, 32741 hasIcon, 32742 icon 32743 }) { 32744 if (!isResponsive) { 32745 return children; 32746 } 32747 const responsiveContainerClasses = classnames_default()('wp-block-navigation__responsive-container', { 32748 'has-text-color': !!overlayTextColor.color || !!overlayTextColor?.class, 32749 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor?.slug)]: !!overlayTextColor?.slug, 32750 'has-background': !!overlayBackgroundColor.color || overlayBackgroundColor?.class, 32751 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor?.slug)]: !!overlayBackgroundColor?.slug, 32752 'is-menu-open': isOpen, 32753 'hidden-by-default': isHiddenByDefault 32754 }); 32755 const styles = { 32756 color: !overlayTextColor?.slug && overlayTextColor?.color, 32757 backgroundColor: !overlayBackgroundColor?.slug && overlayBackgroundColor?.color && overlayBackgroundColor.color 32758 }; 32759 const openButtonClasses = classnames_default()('wp-block-navigation__responsive-container-open', { 32760 'always-shown': isHiddenByDefault 32761 }); 32762 const modalId = `$id}-modal`; 32763 const dialogProps = { 32764 className: 'wp-block-navigation__responsive-dialog', 32765 ...(isOpen && { 32766 role: 'dialog', 32767 'aria-modal': true, 32768 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu') 32769 }) 32770 }; 32771 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !isOpen && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 32772 "aria-haspopup": "true", 32773 "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Open menu'), 32774 className: openButtonClasses, 32775 onClick: () => onToggle(true) 32776 }, hasIcon && (0,external_React_namespaceObject.createElement)(OverlayMenuIcon, { 32777 icon: icon 32778 }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Menu')), (0,external_React_namespaceObject.createElement)("div", { 32779 className: responsiveContainerClasses, 32780 style: styles, 32781 id: modalId 32782 }, (0,external_React_namespaceObject.createElement)("div", { 32783 className: "wp-block-navigation__responsive-close", 32784 tabIndex: "-1" 32785 }, (0,external_React_namespaceObject.createElement)("div", { 32786 ...dialogProps 32787 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 32788 className: "wp-block-navigation__responsive-container-close", 32789 "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close menu'), 32790 onClick: () => onToggle(false) 32791 }, hasIcon && (0,external_React_namespaceObject.createElement)(build_module_icon, { 32792 icon: library_close 32793 }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_React_namespaceObject.createElement)("div", { 32794 className: "wp-block-navigation__responsive-container-content", 32795 id: `$modalId}-content` 32796 }, children))))); 32797 } 32798 32799 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js 32800 32801 /** 32802 * WordPress dependencies 32803 */ 32804 32805 32806 32807 32808 32809 /** 32810 * Internal dependencies 32811 */ 32812 32813 32814 function NavigationInnerBlocks({ 32815 clientId, 32816 hasCustomPlaceholder, 32817 orientation, 32818 templateLock 32819 }) { 32820 const { 32821 isImmediateParentOfSelectedBlock, 32822 selectedBlockHasChildren, 32823 isSelected 32824 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32825 const { 32826 getBlockCount, 32827 hasSelectedInnerBlock, 32828 getSelectedBlockClientId 32829 } = select(external_wp_blockEditor_namespaceObject.store); 32830 const selectedBlockId = getSelectedBlockClientId(); 32831 return { 32832 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), 32833 selectedBlockHasChildren: !!getBlockCount(selectedBlockId), 32834 // This prop is already available but computing it here ensures it's 32835 // fresh compared to isImmediateParentOfSelectedBlock. 32836 isSelected: selectedBlockId === clientId 32837 }; 32838 }, [clientId]); 32839 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation'); 32840 32841 // When the block is selected itself or has a top level item selected that 32842 // doesn't itself have children, show the standard appender. Else show no 32843 // appender. 32844 const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren; 32845 const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_React_namespaceObject.createElement)(placeholder_preview, null), []); 32846 const hasMenuItems = !!blocks?.length; 32847 32848 // If there is a `ref` attribute pointing to a `wp_navigation` but 32849 // that menu has no **items** (i.e. empty) then show a placeholder. 32850 // The block must also be selected else the placeholder will display 32851 // alongside the appender. 32852 const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected; 32853 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 32854 className: 'wp-block-navigation__container' 32855 }, { 32856 value: blocks, 32857 onInput, 32858 onChange, 32859 prioritizedInserterBlocks: PRIORITIZED_INSERTER_BLOCKS, 32860 defaultBlock: constants_DEFAULT_BLOCK, 32861 directInsert: true, 32862 orientation, 32863 templateLock, 32864 // As an exception to other blocks which feature nesting, show 32865 // the block appender even when a child block is selected. 32866 // This should be a temporary fix, to be replaced by improvements to 32867 // the sibling inserter. 32868 // See https://github.com/WordPress/gutenberg/issues/37572. 32869 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || 32870 // Show the appender while dragging to allow inserting element between item and the appender. 32871 parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false, 32872 placeholder: showPlaceholder ? placeholder : undefined, 32873 __experimentalCaptureToolbars: true, 32874 __unstableDisableLayoutClassNames: true 32875 }); 32876 return (0,external_React_namespaceObject.createElement)("div", { 32877 ...innerBlocksProps 32878 }); 32879 } 32880 32881 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js 32882 32883 /** 32884 * WordPress dependencies 32885 */ 32886 32887 32888 32889 function NavigationMenuNameControl() { 32890 const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 32891 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 32892 __nextHasNoMarginBottom: true, 32893 label: (0,external_wp_i18n_namespaceObject.__)('Menu name'), 32894 value: title, 32895 onChange: updateTitle 32896 }); 32897 } 32898 32899 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/are-blocks-dirty.js 32900 function areBlocksDirty(originalBlocks, blocks) { 32901 return !isDeepEqual(originalBlocks, blocks, (prop, x) => { 32902 // Skip inner blocks of page list during comparison as they 32903 // are **always** controlled and may be updated async due to 32904 // syncing with entity records. Left unchecked this would 32905 // inadvertently trigger the dirty state. 32906 if (x?.name === 'core/page-list' && prop === 'innerBlocks') { 32907 return true; 32908 } 32909 }); 32910 } 32911 32912 /** 32913 * Conditionally compares two candidates for deep equality. 32914 * Provides an option to skip a given property of an object during comparison. 32915 * 32916 * @param {*} x 1st candidate for comparison 32917 * @param {*} y 2nd candidate for comparison 32918 * @param {Function|undefined} shouldSkip a function which can be used to skip a given property of an object. 32919 * @return {boolean} whether the two candidates are deeply equal. 32920 */ 32921 const isDeepEqual = (x, y, shouldSkip) => { 32922 if (x === y) { 32923 return true; 32924 } else if (typeof x === 'object' && x !== null && x !== undefined && typeof y === 'object' && y !== null && y !== undefined) { 32925 if (Object.keys(x).length !== Object.keys(y).length) return false; 32926 for (const prop in x) { 32927 if (y.hasOwnProperty(prop)) { 32928 // Afford skipping a given property of an object. 32929 if (shouldSkip && shouldSkip(prop, x)) { 32930 return true; 32931 } 32932 if (!isDeepEqual(x[prop], y[prop], shouldSkip)) return false; 32933 } else return false; 32934 } 32935 return true; 32936 } 32937 return false; 32938 }; 32939 32940 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js 32941 32942 /** 32943 * WordPress dependencies 32944 */ 32945 32946 32947 32948 32949 32950 32951 /** 32952 * Internal dependencies 32953 */ 32954 32955 32956 const EMPTY_OBJECT = {}; 32957 function UnsavedInnerBlocks({ 32958 blocks, 32959 createNavigationMenu, 32960 hasSelection 32961 }) { 32962 const originalBlocks = (0,external_wp_element_namespaceObject.useRef)(); 32963 (0,external_wp_element_namespaceObject.useEffect)(() => { 32964 // Initially store the uncontrolled inner blocks for 32965 // dirty state comparison. 32966 if (!originalBlocks?.current) { 32967 originalBlocks.current = blocks; 32968 } 32969 }, [blocks]); 32970 32971 // If the current inner blocks are different from the original inner blocks 32972 // from the post content then the user has made changes to the inner blocks. 32973 // At this point the inner blocks can be considered "dirty". 32974 // Note: referential equality is not sufficient for comparison as the inner blocks 32975 // of the page list are controlled and may be updated async due to syncing with 32976 // entity records. As a result we need to perform a deep equality check skipping 32977 // the page list's inner blocks. 32978 const innerBlocksAreDirty = areBlocksDirty(originalBlocks?.current, blocks); 32979 32980 // The block will be disabled in a block preview, use this as a way of 32981 // avoiding the side-effects of this component for block previews. 32982 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 32983 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 32984 className: 'wp-block-navigation__container' 32985 }, { 32986 renderAppender: hasSelection ? undefined : false, 32987 defaultBlock: constants_DEFAULT_BLOCK, 32988 directInsert: true 32989 }); 32990 const { 32991 isSaving, 32992 hasResolvedAllNavigationMenus 32993 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32994 if (isDisabled) { 32995 return EMPTY_OBJECT; 32996 } 32997 const { 32998 hasFinishedResolution, 32999 isSavingEntityRecord 33000 } = select(external_wp_coreData_namespaceObject.store); 33001 return { 33002 isSaving: isSavingEntityRecord('postType', 'wp_navigation'), 33003 hasResolvedAllNavigationMenus: hasFinishedResolution('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS) 33004 }; 33005 }, [isDisabled]); 33006 33007 // Automatically save the uncontrolled blocks. 33008 (0,external_wp_element_namespaceObject.useEffect)(() => { 33009 // The block will be disabled when used in a BlockPreview. 33010 // In this case avoid automatic creation of a wp_navigation post. 33011 // Otherwise the user will be spammed with lots of menus! 33012 // 33013 // Also ensure other navigation menus have loaded so an 33014 // accurate name can be created. 33015 // 33016 // Don't try saving when another save is already 33017 // in progress. 33018 // 33019 // And finally only create the menu when the block is selected, 33020 // which is an indication they want to start editing. 33021 if (isDisabled || isSaving || !hasResolvedAllNavigationMenus || !hasSelection || !innerBlocksAreDirty) { 33022 return; 33023 } 33024 createNavigationMenu(null, blocks); 33025 }, [blocks, createNavigationMenu, isDisabled, isSaving, hasResolvedAllNavigationMenus, innerBlocksAreDirty, hasSelection]); 33026 const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div'; 33027 return (0,external_React_namespaceObject.createElement)(Wrapper, { 33028 ...innerBlocksProps 33029 }); 33030 } 33031 33032 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js 33033 33034 /** 33035 * WordPress dependencies 33036 */ 33037 33038 33039 33040 33041 33042 function NavigationMenuDeleteControl({ 33043 onDelete 33044 }) { 33045 const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); 33046 const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation'); 33047 const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 33048 const { 33049 deleteEntityRecord 33050 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 33051 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 33052 className: "wp-block-navigation-delete-menu-button", 33053 variant: "secondary", 33054 isDestructive: true, 33055 onClick: () => { 33056 setIsConfirmModalVisible(true); 33057 } 33058 }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 33059 title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the name of a menu to delete */ 33060 (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title), 33061 onRequestClose: () => setIsConfirmModalVisible(false) 33062 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 33063 justify: "right" 33064 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 33065 variant: "tertiary", 33066 onClick: () => { 33067 setIsConfirmModalVisible(false); 33068 } 33069 }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 33070 variant: "primary", 33071 onClick: () => { 33072 deleteEntityRecord('postType', 'wp_navigation', id, { 33073 force: true 33074 }); 33075 onDelete(title); 33076 } 33077 }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))); 33078 } 33079 33080 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js 33081 /** 33082 * WordPress dependencies 33083 */ 33084 33085 33086 33087 function useNavigationNotice({ 33088 name, 33089 message = '' 33090 } = {}) { 33091 const noticeRef = (0,external_wp_element_namespaceObject.useRef)(); 33092 const { 33093 createWarningNotice, 33094 removeNotice 33095 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 33096 const showNotice = (0,external_wp_element_namespaceObject.useCallback)(customMsg => { 33097 if (noticeRef.current) { 33098 return; 33099 } 33100 noticeRef.current = name; 33101 createWarningNotice(customMsg || message, { 33102 id: noticeRef.current, 33103 type: 'snackbar' 33104 }); 33105 }, [noticeRef, createWarningNotice, message, name]); 33106 const hideNotice = (0,external_wp_element_namespaceObject.useCallback)(() => { 33107 if (!noticeRef.current) { 33108 return; 33109 } 33110 removeNotice(noticeRef.current); 33111 noticeRef.current = null; 33112 }, [noticeRef, removeNotice]); 33113 return [showNotice, hideNotice]; 33114 } 33115 /* harmony default export */ const use_navigation_notice = (useNavigationNotice); 33116 33117 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-preview.js 33118 33119 /** 33120 * WordPress dependencies 33121 */ 33122 33123 33124 33125 /** 33126 * Internal dependencies 33127 */ 33128 33129 function OverlayMenuPreview({ 33130 setAttributes, 33131 hasIcon, 33132 icon 33133 }) { 33134 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 33135 __nextHasNoMarginBottom: true, 33136 label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'), 33137 help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button that toggles the overlay menu.'), 33138 onChange: value => setAttributes({ 33139 hasIcon: value 33140 }), 33141 checked: hasIcon 33142 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 33143 __nextHasNoMarginBottom: true, 33144 label: (0,external_wp_i18n_namespaceObject.__)('Icon'), 33145 value: icon, 33146 onChange: value => setAttributes({ 33147 icon: value 33148 }), 33149 isBlock: true 33150 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 33151 value: "handle", 33152 "aria-label": (0,external_wp_i18n_namespaceObject.__)('handle'), 33153 label: (0,external_React_namespaceObject.createElement)(OverlayMenuIcon, { 33154 icon: "handle" 33155 }) 33156 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 33157 value: "menu", 33158 "aria-label": (0,external_wp_i18n_namespaceObject.__)('menu'), 33159 label: (0,external_React_namespaceObject.createElement)(OverlayMenuIcon, { 33160 icon: "menu" 33161 }) 33162 }))); 33163 } 33164 33165 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js 33166 /** 33167 * WordPress dependencies 33168 */ 33169 33170 33171 33172 /** 33173 * Convert a flat menu item structure to a nested blocks structure. 33174 * 33175 * @param {Object[]} menuItems An array of menu items. 33176 * 33177 * @return {WPBlock[]} An array of blocks. 33178 */ 33179 function menuItemsToBlocks(menuItems) { 33180 if (!menuItems) { 33181 return null; 33182 } 33183 const menuTree = createDataTree(menuItems); 33184 const blocks = mapMenuItemsToBlocks(menuTree); 33185 return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems); 33186 } 33187 33188 /** 33189 * A recursive function that maps menu item nodes to blocks. 33190 * 33191 * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items. 33192 * @param {number} level An integer representing the nesting level. 33193 * @return {Object} Object containing innerBlocks and mapping. 33194 */ 33195 function mapMenuItemsToBlocks(menuItems, level = 0) { 33196 let mapping = {}; 33197 33198 // The menuItem should be in menu_order sort order. 33199 const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order); 33200 const innerBlocks = sortedItems.map(menuItem => { 33201 if (menuItem.type === 'block') { 33202 const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw); 33203 if (!block) { 33204 return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', { 33205 content: menuItem.content 33206 }); 33207 } 33208 return block; 33209 } 33210 const blockType = menuItem.children?.length ? 'core/navigation-submenu' : 'core/navigation-link'; 33211 const attributes = menuItemToBlockAttributes(menuItem, blockType, level); 33212 33213 // If there are children recurse to build those nested blocks. 33214 const { 33215 innerBlocks: nestedBlocks = [], 33216 // alias to avoid shadowing 33217 mapping: nestedMapping = {} // alias to avoid shadowing 33218 } = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; 33219 33220 // Update parent mapping with nested mapping. 33221 mapping = { 33222 ...mapping, 33223 ...nestedMapping 33224 }; 33225 33226 // Create block with nested "innerBlocks". 33227 const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); 33228 33229 // Create mapping for menuItem -> block. 33230 mapping[menuItem.id] = block.clientId; 33231 return block; 33232 }); 33233 return { 33234 innerBlocks, 33235 mapping 33236 }; 33237 } 33238 33239 /** 33240 * A WP nav_menu_item object. 33241 * For more documentation on the individual fields present on a menu item please see: 33242 * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789 33243 * 33244 * @typedef WPNavMenuItem 33245 * 33246 * @property {Object} title stores the raw and rendered versions of the title/label for this menu item. 33247 * @property {Array} xfn the XFN relationships expressed in the link of this menu item. 33248 * @property {Array} classes the HTML class attributes for this menu item. 33249 * @property {string} attr_title the HTML title attribute for this menu item. 33250 * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'. 33251 * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories. 33252 * @property {string} description The description of this menu item. 33253 * @property {string} url The URL to which this menu item points. 33254 * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'. 33255 * @property {string} target The target attribute of the link element for this menu item. 33256 */ 33257 33258 /** 33259 * Convert block attributes to menu item. 33260 * 33261 * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes. 33262 * @param {string} blockType The block type. 33263 * @param {number} level An integer representing the nesting level. 33264 * @return {Object} the block attributes converted from the WPNavMenuItem item. 33265 */ 33266 function menuItemToBlockAttributes({ 33267 title: menuItemTitleField, 33268 xfn, 33269 classes, 33270 // eslint-disable-next-line camelcase 33271 attr_title, 33272 object, 33273 // eslint-disable-next-line camelcase 33274 object_id, 33275 description, 33276 url, 33277 type: menuItemTypeField, 33278 target 33279 }, blockType, level) { 33280 // For historical reasons, the `core/navigation-link` variation type is `tag` 33281 // whereas WP Core expects `post_tag` as the `object` type. 33282 // To avoid writing a block migration we perform a conversion here. 33283 // See also inverse equivalent in `blockAttributesToMenuItem`. 33284 if (object && object === 'post_tag') { 33285 object = 'tag'; 33286 } 33287 return { 33288 label: menuItemTitleField?.rendered || '', 33289 ...(object?.length && { 33290 type: object 33291 }), 33292 kind: menuItemTypeField?.replace('_', '-') || 'custom', 33293 url: url || '', 33294 ...(xfn?.length && xfn.join(' ').trim() && { 33295 rel: xfn.join(' ').trim() 33296 }), 33297 ...(classes?.length && classes.join(' ').trim() && { 33298 className: classes.join(' ').trim() 33299 }), 33300 /* eslint-disable camelcase */ 33301 ...(attr_title?.length && { 33302 title: attr_title 33303 }), 33304 ...(object_id && 'custom' !== object && { 33305 id: object_id 33306 }), 33307 /* eslint-enable camelcase */ 33308 ...(description?.length && { 33309 description 33310 }), 33311 ...(target === '_blank' && { 33312 opensInNewTab: true 33313 }), 33314 ...(blockType === 'core/navigation-submenu' && { 33315 isTopLevelItem: level === 0 33316 }), 33317 ...(blockType === 'core/navigation-link' && { 33318 isTopLevelLink: level === 0 33319 }) 33320 }; 33321 } 33322 33323 /** 33324 * Creates a nested, hierarchical tree representation from unstructured data that 33325 * has an inherent relationship defined between individual items. 33326 * 33327 * For example, by default, each element in the dataset should have an `id` and 33328 * `parent` property where the `parent` property indicates a relationship between 33329 * the current item and another item with a matching `id` properties. 33330 * 33331 * This is useful for building linked lists of data from flat data structures. 33332 * 33333 * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields. 33334 * @param {string} id the property which uniquely identifies each entry within the array. 33335 * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all). 33336 * @return {Array} a nested array of parent/child relationships 33337 */ 33338 function createDataTree(dataset, id = 'id', relation = 'parent') { 33339 const hashTable = Object.create(null); 33340 const dataTree = []; 33341 for (const data of dataset) { 33342 hashTable[data[id]] = { 33343 ...data, 33344 children: [] 33345 }; 33346 if (data[relation]) { 33347 hashTable[data[relation]] = hashTable[data[relation]] || {}; 33348 hashTable[data[relation]].children = hashTable[data[relation]].children || []; 33349 hashTable[data[relation]].children.push(hashTable[data[id]]); 33350 } else { 33351 dataTree.push(hashTable[data[id]]); 33352 } 33353 } 33354 return dataTree; 33355 } 33356 33357 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js 33358 /** 33359 * WordPress dependencies 33360 */ 33361 33362 33363 33364 33365 33366 /** 33367 * Internal dependencies 33368 */ 33369 33370 const CLASSIC_MENU_CONVERSION_SUCCESS = 'success'; 33371 const CLASSIC_MENU_CONVERSION_ERROR = 'error'; 33372 const CLASSIC_MENU_CONVERSION_PENDING = 'pending'; 33373 const CLASSIC_MENU_CONVERSION_IDLE = 'idle'; 33374 33375 // This is needed to ensure that multiple components using this hook 33376 // do not import the same classic menu twice. 33377 let classicMenuBeingConvertedId = null; 33378 function useConvertClassicToBlockMenu(createNavigationMenu, { 33379 throwOnError = false 33380 } = {}) { 33381 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 33382 const { 33383 editEntityRecord 33384 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 33385 const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE); 33386 const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); 33387 const convertClassicMenuToBlockMenu = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => { 33388 let navigationMenu; 33389 let classicMenuItems; 33390 33391 // 1. Fetch the classic Menu items. 33392 try { 33393 classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({ 33394 menus: menuId, 33395 per_page: -1, 33396 context: 'view' 33397 }); 33398 } catch (err) { 33399 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 33400 // translators: %s: the name of a menu (e.g. Header navigation). 33401 (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), { 33402 cause: err 33403 }); 33404 } 33405 33406 // Handle offline response which resolves to `null`. 33407 if (classicMenuItems === null) { 33408 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 33409 // translators: %s: the name of a menu (e.g. Header navigation). 33410 (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName)); 33411 } 33412 33413 // 2. Convert the classic items into blocks. 33414 const { 33415 innerBlocks 33416 } = menuItemsToBlocks(classicMenuItems); 33417 33418 // 3. Create the `wp_navigation` Post with the blocks. 33419 try { 33420 navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus); 33421 33422 /** 33423 * Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'. 33424 * This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty". 33425 * The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_, 33426 * without user interaction. 33427 * If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft. 33428 */ 33429 await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, { 33430 status: 'publish' 33431 }, { 33432 throwOnError: true 33433 }); 33434 } catch (err) { 33435 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 33436 // translators: %s: the name of a menu (e.g. Header navigation). 33437 (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { 33438 cause: err 33439 }); 33440 } 33441 return navigationMenu; 33442 }, [createNavigationMenu, editEntityRecord, registry]); 33443 const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus) => { 33444 // Check whether this classic menu is being imported already. 33445 if (classicMenuBeingConvertedId === menuId) { 33446 return; 33447 } 33448 33449 // Set the ID for the currently importing classic menu. 33450 classicMenuBeingConvertedId = menuId; 33451 if (!menuId || !menuName) { 33452 setError('Unable to convert menu. Missing menu details.'); 33453 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 33454 return; 33455 } 33456 setStatus(CLASSIC_MENU_CONVERSION_PENDING); 33457 setError(null); 33458 return await convertClassicMenuToBlockMenu(menuId, menuName, postStatus).then(navigationMenu => { 33459 setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); 33460 // Reset the ID for the currently importing classic menu. 33461 classicMenuBeingConvertedId = null; 33462 return navigationMenu; 33463 }).catch(err => { 33464 setError(err?.message); 33465 // Reset the ID for the currently importing classic menu. 33466 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 33467 33468 // Reset the ID for the currently importing classic menu. 33469 classicMenuBeingConvertedId = null; 33470 33471 // Rethrow error for debugging. 33472 if (throwOnError) { 33473 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 33474 // translators: %s: the name of a menu (e.g. Header navigation). 33475 (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { 33476 cause: err 33477 }); 33478 } 33479 }); 33480 }, [convertClassicMenuToBlockMenu, throwOnError]); 33481 return { 33482 convert, 33483 status, 33484 error 33485 }; 33486 } 33487 /* harmony default export */ const use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu); 33488 33489 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js 33490 /** 33491 * Generates a template part Id based on slug and theme inputs. 33492 * 33493 * @param {string} theme the template part's theme. 33494 * @param {string} slug the template part's slug 33495 * @return {string|null} the template part's Id. 33496 */ 33497 function createTemplatePartId(theme, slug) { 33498 return theme && slug ? theme + '//' + slug : null; 33499 } 33500 33501 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js 33502 /** 33503 * WordPress dependencies 33504 */ 33505 33506 33507 33508 33509 /** 33510 * Internal dependencies 33511 */ 33512 33513 // TODO: this util should perhaps be refactored somewhere like core-data. 33514 33515 function useTemplatePartAreaLabel(clientId) { 33516 return (0,external_wp_data_namespaceObject.useSelect)(select => { 33517 // Use the lack of a clientId as an opportunity to bypass the rest 33518 // of this hook. 33519 if (!clientId) { 33520 return; 33521 } 33522 const { 33523 getBlock, 33524 getBlockParentsByBlockName 33525 } = select(external_wp_blockEditor_namespaceObject.store); 33526 const withAscendingResults = true; 33527 const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults); 33528 if (!parentTemplatePartClientIds?.length) { 33529 return; 33530 } 33531 33532 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 33533 // Blocks can be loaded into a *non-post* block editor. 33534 // This code is lifted from this file: 33535 // packages/block-library/src/template-part/edit/advanced-controls.js 33536 /* eslint-disable @wordpress/data-no-store-string-literals */ 33537 const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas(); 33538 /* eslint-enable @wordpress/data-no-store-string-literals */ 33539 const { 33540 getCurrentTheme, 33541 getEditedEntityRecord 33542 } = select(external_wp_coreData_namespaceObject.store); 33543 for (const templatePartClientId of parentTemplatePartClientIds) { 33544 const templatePartBlock = getBlock(templatePartClientId); 33545 33546 // The 'area' usually isn't stored on the block, but instead 33547 // on the entity. 33548 const { 33549 theme = getCurrentTheme()?.stylesheet, 33550 slug 33551 } = templatePartBlock.attributes; 33552 const templatePartEntityId = createTemplatePartId(theme, slug); 33553 const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); 33554 33555 // Look up the `label` for the area in the defined areas so 33556 // that an internationalized label can be used. 33557 if (templatePartEntity?.area) { 33558 return definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)?.label; 33559 } 33560 } 33561 }, [clientId]); 33562 } 33563 33564 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js 33565 /** 33566 * WordPress dependencies 33567 */ 33568 33569 33570 33571 33572 33573 33574 /** 33575 * Internal dependencies 33576 */ 33577 33578 const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', { 33579 status: 'draft', 33580 per_page: -1 33581 }]; 33582 const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', { 33583 per_page: -1, 33584 status: 'publish' 33585 }]; 33586 function useGenerateDefaultNavigationTitle(clientId) { 33587 // The block will be disabled in a block preview, use this as a way of 33588 // avoiding the side-effects of this component for block previews. 33589 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 33590 33591 // Because we can't conditionally call hooks, pass an undefined client id 33592 // arg to bypass the expensive `useTemplateArea` code. The hook will return 33593 // early. 33594 const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId); 33595 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 33596 return (0,external_wp_element_namespaceObject.useCallback)(async () => { 33597 // Ensure other navigation menus have loaded so an 33598 // accurate name can be created. 33599 if (isDisabled) { 33600 return ''; 33601 } 33602 const { 33603 getEntityRecords 33604 } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); 33605 const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]); 33606 const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( 33607 // translators: %s: the name of a menu (e.g. Header navigation). 33608 (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : 33609 // translators: 'navigation' as in website navigation. 33610 (0,external_wp_i18n_namespaceObject.__)('Navigation'); 33611 33612 // Determine how many menus start with the automatic title. 33613 const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => menu?.title?.raw?.startsWith(title) ? count + 1 : count, 0); 33614 33615 // Append a number to the end of the title if a menu with 33616 // the same name exists. 33617 const titleWithCount = matchingMenuTitleCount > 0 ? `$title} $matchingMenuTitleCount + 1}` : title; 33618 return titleWithCount || ''; 33619 }, [isDisabled, area, registry]); 33620 } 33621 33622 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js 33623 /** 33624 * WordPress dependencies 33625 */ 33626 33627 33628 33629 33630 33631 /** 33632 * Internal dependencies 33633 */ 33634 33635 const CREATE_NAVIGATION_MENU_SUCCESS = 'success'; 33636 const CREATE_NAVIGATION_MENU_ERROR = 'error'; 33637 const CREATE_NAVIGATION_MENU_PENDING = 'pending'; 33638 const CREATE_NAVIGATION_MENU_IDLE = 'idle'; 33639 function useCreateNavigationMenu(clientId) { 33640 const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE); 33641 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null); 33642 const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); 33643 const { 33644 saveEntityRecord, 33645 editEntityRecord 33646 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 33647 const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); 33648 33649 // This callback uses data from the two placeholder steps and only creates 33650 // a new navigation menu when the user completes the final step. 33651 const create = (0,external_wp_element_namespaceObject.useCallback)(async (title = null, blocks = [], postStatus) => { 33652 // Guard against creating Navigations without a title. 33653 // Note you can pass no title, but if one is passed it must be 33654 // a string otherwise the title may end up being empty. 33655 if (title && typeof title !== 'string') { 33656 setError('Invalid title supplied when creating Navigation Menu.'); 33657 setStatus(CREATE_NAVIGATION_MENU_ERROR); 33658 throw new Error(`Value of supplied title argument was not a string.`); 33659 } 33660 setStatus(CREATE_NAVIGATION_MENU_PENDING); 33661 setValue(null); 33662 setError(null); 33663 if (!title) { 33664 title = await generateDefaultTitle().catch(err => { 33665 setError(err?.message); 33666 setStatus(CREATE_NAVIGATION_MENU_ERROR); 33667 throw new Error('Failed to create title when saving new Navigation Menu.', { 33668 cause: err 33669 }); 33670 }); 33671 } 33672 const record = { 33673 title, 33674 content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), 33675 status: postStatus 33676 }; 33677 33678 // Return affords ability to await on this function directly 33679 return saveEntityRecord('postType', 'wp_navigation', record).then(response => { 33680 setValue(response); 33681 setStatus(CREATE_NAVIGATION_MENU_SUCCESS); 33682 33683 // Set the status to publish so that the Navigation block 33684 // shows up in the multi entity save flow. 33685 if (postStatus !== 'publish') { 33686 editEntityRecord('postType', 'wp_navigation', response.id, { 33687 status: 'publish' 33688 }); 33689 } 33690 return response; 33691 }).catch(err => { 33692 setError(err?.message); 33693 setStatus(CREATE_NAVIGATION_MENU_ERROR); 33694 throw new Error('Unable to save new Navigation Menu', { 33695 cause: err 33696 }); 33697 }); 33698 }, [saveEntityRecord, editEntityRecord, generateDefaultTitle]); 33699 return { 33700 create, 33701 status, 33702 value, 33703 error, 33704 isIdle: status === CREATE_NAVIGATION_MENU_IDLE, 33705 isPending: status === CREATE_NAVIGATION_MENU_PENDING, 33706 isSuccess: status === CREATE_NAVIGATION_MENU_SUCCESS, 33707 isError: status === CREATE_NAVIGATION_MENU_ERROR 33708 }; 33709 } 33710 33711 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js 33712 /** 33713 * WordPress dependencies 33714 */ 33715 33716 33717 const use_inner_blocks_EMPTY_ARRAY = []; 33718 function useInnerBlocks(clientId) { 33719 return (0,external_wp_data_namespaceObject.useSelect)(select => { 33720 const { 33721 getBlock, 33722 getBlocks, 33723 hasSelectedInnerBlock 33724 } = select(external_wp_blockEditor_namespaceObject.store); 33725 33726 // This relies on the fact that `getBlock` won't return controlled 33727 // inner blocks, while `getBlocks` does. It might be more stable to 33728 // introduce a selector like `getUncontrolledInnerBlocks`, just in 33729 // case `getBlock` is fixed. 33730 const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks; 33731 const _hasUncontrolledInnerBlocks = !!_uncontrolledInnerBlocks?.length; 33732 const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? use_inner_blocks_EMPTY_ARRAY : getBlocks(clientId); 33733 return { 33734 innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks, 33735 hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks, 33736 uncontrolledInnerBlocks: _uncontrolledInnerBlocks, 33737 controlledInnerBlocks: _controlledInnerBlocks, 33738 isInnerBlockSelected: hasSelectedInnerBlock(clientId, true) 33739 }; 33740 }, [clientId]); 33741 } 33742 33743 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/utils.js 33744 /** 33745 * External dependencies 33746 */ 33747 33748 function getComputedStyle(node) { 33749 return node.ownerDocument.defaultView.getComputedStyle(node); 33750 } 33751 function detectColors(colorsDetectionElement, setColor, setBackground) { 33752 if (!colorsDetectionElement) { 33753 return; 33754 } 33755 setColor(getComputedStyle(colorsDetectionElement).color); 33756 let backgroundColorNode = colorsDetectionElement; 33757 let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 33758 while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { 33759 backgroundColorNode = backgroundColorNode.parentNode; 33760 backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 33761 } 33762 setBackground(backgroundColor); 33763 } 33764 33765 /** 33766 * Determine the colors for a menu. 33767 * 33768 * Order of priority is: 33769 * 1: Overlay custom colors (if submenu) 33770 * 2: Overlay theme colors (if submenu) 33771 * 3: Custom colors 33772 * 4: Theme colors 33773 * 5: Global styles 33774 * 33775 * @param {Object} context 33776 * @param {boolean} isSubMenu 33777 */ 33778 function getColors(context, isSubMenu) { 33779 const { 33780 textColor, 33781 customTextColor, 33782 backgroundColor, 33783 customBackgroundColor, 33784 overlayTextColor, 33785 customOverlayTextColor, 33786 overlayBackgroundColor, 33787 customOverlayBackgroundColor, 33788 style 33789 } = context; 33790 const colors = {}; 33791 if (isSubMenu && !!customOverlayTextColor) { 33792 colors.customTextColor = customOverlayTextColor; 33793 } else if (isSubMenu && !!overlayTextColor) { 33794 colors.textColor = overlayTextColor; 33795 } else if (!!customTextColor) { 33796 colors.customTextColor = customTextColor; 33797 } else if (!!textColor) { 33798 colors.textColor = textColor; 33799 } else if (!!style?.color?.text) { 33800 colors.customTextColor = style.color.text; 33801 } 33802 if (isSubMenu && !!customOverlayBackgroundColor) { 33803 colors.customBackgroundColor = customOverlayBackgroundColor; 33804 } else if (isSubMenu && !!overlayBackgroundColor) { 33805 colors.backgroundColor = overlayBackgroundColor; 33806 } else if (!!customBackgroundColor) { 33807 colors.customBackgroundColor = customBackgroundColor; 33808 } else if (!!backgroundColor) { 33809 colors.backgroundColor = backgroundColor; 33810 } else if (!!style?.color?.background) { 33811 colors.customTextColor = style.color.background; 33812 } 33813 return colors; 33814 } 33815 function getNavigationChildBlockProps(innerBlocksColors) { 33816 return { 33817 className: classnames_default()('wp-block-navigation__submenu-container', { 33818 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor), 33819 [`has-$innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor, 33820 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor), 33821 [`has-$innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor 33822 }), 33823 style: { 33824 color: innerBlocksColors.customTextColor, 33825 backgroundColor: innerBlocksColors.customBackgroundColor 33826 } 33827 }; 33828 } 33829 33830 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/manage-menus-button.js 33831 33832 /** 33833 * WordPress dependencies 33834 */ 33835 33836 33837 33838 const ManageMenusButton = ({ 33839 className = '', 33840 disabled, 33841 isMenuItem = false 33842 }) => { 33843 let ComponentName = external_wp_components_namespaceObject.Button; 33844 if (isMenuItem) { 33845 ComponentName = external_wp_components_namespaceObject.MenuItem; 33846 } 33847 return (0,external_React_namespaceObject.createElement)(ComponentName, { 33848 variant: "link", 33849 disabled: disabled, 33850 className: className, 33851 href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { 33852 post_type: 'wp_navigation' 33853 }) 33854 }, (0,external_wp_i18n_namespaceObject.__)('Manage menus')); 33855 }; 33856 /* harmony default export */ const manage_menus_button = (ManageMenusButton); 33857 33858 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/deleted-navigation-warning.js 33859 33860 /** 33861 * WordPress dependencies 33862 */ 33863 33864 33865 33866 33867 function DeletedNavigationWarning({ 33868 onCreateNew 33869 }) { 33870 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. <button>Create a new menu?</button>'), { 33871 button: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 33872 onClick: onCreateNew, 33873 variant: "link" 33874 }) 33875 })); 33876 } 33877 /* harmony default export */ const deleted_navigation_warning = (DeletedNavigationWarning); 33878 33879 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js 33880 33881 /** 33882 * WordPress dependencies 33883 */ 33884 33885 const addSubmenu = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 33886 xmlns: "http://www.w3.org/2000/svg", 33887 viewBox: "0 0 24 24" 33888 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 33889 d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z" 33890 })); 33891 /* harmony default export */ const add_submenu = (addSubmenu); 33892 33893 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js 33894 33895 /** 33896 * WordPress dependencies 33897 */ 33898 33899 const chevronUp = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 33900 viewBox: "0 0 24 24", 33901 xmlns: "http://www.w3.org/2000/svg" 33902 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 33903 d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" 33904 })); 33905 /* harmony default export */ const chevron_up = (chevronUp); 33906 33907 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js 33908 33909 /** 33910 * WordPress dependencies 33911 */ 33912 33913 const chevronDown = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 33914 viewBox: "0 0 24 24", 33915 xmlns: "http://www.w3.org/2000/svg" 33916 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 33917 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" 33918 })); 33919 /* harmony default export */ const chevron_down = (chevronDown); 33920 33921 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/leaf-more-menu.js 33922 33923 /** 33924 * WordPress dependencies 33925 */ 33926 33927 33928 33929 33930 33931 33932 const POPOVER_PROPS = { 33933 className: 'block-editor-block-settings-menu__popover', 33934 placement: 'bottom-start' 33935 }; 33936 const BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU = ['core/navigation-link', 'core/navigation-submenu']; 33937 function AddSubmenuItem({ 33938 block, 33939 onClose, 33940 expandedState, 33941 expand, 33942 setInsertedBlock 33943 }) { 33944 const { 33945 insertBlock, 33946 replaceBlock, 33947 replaceInnerBlocks 33948 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 33949 const clientId = block.clientId; 33950 const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes(block.name); 33951 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 33952 icon: add_submenu, 33953 disabled: isDisabled, 33954 onClick: () => { 33955 const updateSelectionOnInsert = false; 33956 const newLink = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 33957 if (block.name === 'core/navigation-submenu') { 33958 insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert); 33959 } else { 33960 // Convert to a submenu if the block currently isn't one. 33961 const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); 33962 33963 // The following must happen as two independent actions. 33964 // Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds 33965 // selector to determine which block is "active". As the UX needs the newLink to be 33966 // the "active" block it must be the last block to be inserted. 33967 // Therefore the Submenu is first created and **then** the newLink is inserted 33968 // thus ensuring it is the last inserted block. 33969 replaceBlock(clientId, newSubmenu); 33970 replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert); 33971 } 33972 33973 // This call sets the local List View state for the "last inserted block". 33974 // This is required for the Nav Block to determine whether or not to display 33975 // the Link UI for this new block. 33976 setInsertedBlock(newLink); 33977 if (!expandedState[block.clientId]) { 33978 expand(block.clientId); 33979 } 33980 onClose(); 33981 } 33982 }, (0,external_wp_i18n_namespaceObject.__)('Add submenu link')); 33983 } 33984 function LeafMoreMenu(props) { 33985 const { 33986 block 33987 } = props; 33988 const { 33989 clientId 33990 } = block; 33991 const { 33992 moveBlocksDown, 33993 moveBlocksUp, 33994 removeBlocks 33995 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 33996 const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ 33997 (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ 33998 clientId, 33999 maximumLength: 25 34000 })); 34001 const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { 34002 const { 34003 getBlockRootClientId 34004 } = select(external_wp_blockEditor_namespaceObject.store); 34005 return getBlockRootClientId(clientId); 34006 }, [clientId]); 34007 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { 34008 icon: more_vertical, 34009 label: (0,external_wp_i18n_namespaceObject.__)('Options'), 34010 className: "block-editor-block-settings-menu", 34011 popoverProps: POPOVER_PROPS, 34012 noIcons: true, 34013 ...props 34014 }, ({ 34015 onClose 34016 }) => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 34017 icon: chevron_up, 34018 onClick: () => { 34019 moveBlocksUp([clientId], rootClientId); 34020 onClose(); 34021 } 34022 }, (0,external_wp_i18n_namespaceObject.__)('Move up')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 34023 icon: chevron_down, 34024 onClick: () => { 34025 moveBlocksDown([clientId], rootClientId); 34026 onClose(); 34027 } 34028 }, (0,external_wp_i18n_namespaceObject.__)('Move down')), (0,external_React_namespaceObject.createElement)(AddSubmenuItem, { 34029 block: block, 34030 onClose: onClose, 34031 expanded: true, 34032 expandedState: props.expandedState, 34033 expand: props.expand, 34034 setInsertedBlock: props.setInsertedBlock 34035 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 34036 onClick: () => { 34037 removeBlocks([clientId], false); 34038 onClose(); 34039 } 34040 }, removeLabel)))); 34041 } 34042 34043 ;// CONCATENATED MODULE: external ["wp","escapeHtml"] 34044 const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; 34045 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/update-attributes.js 34046 /** 34047 * WordPress dependencies 34048 */ 34049 34050 34051 34052 /** 34053 * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind 34054 */ 34055 /** 34056 * Navigation Link Block Attributes 34057 * 34058 * @typedef {Object} WPNavigationLinkBlockAttributes 34059 * 34060 * @property {string} [label] Link text. 34061 * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. 34062 * @property {string} [type] The type such as post, page, tag, category and other custom types. 34063 * @property {string} [rel] The relationship of the linked URL. 34064 * @property {number} [id] A post or term id. 34065 * @property {boolean} [opensInNewTab] Sets link target to _blank when true. 34066 * @property {string} [url] Link href. 34067 * @property {string} [title] Link title attribute. 34068 */ 34069 /** 34070 * Link Control onChange handler that updates block attributes when a setting is changed. 34071 * 34072 * @param {Object} updatedValue New block attributes to update. 34073 * @param {Function} setAttributes Block attribute update function. 34074 * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes. 34075 */ 34076 34077 const updateAttributes = (updatedValue = {}, setAttributes, blockAttributes = {}) => { 34078 const { 34079 label: originalLabel = '', 34080 kind: originalKind = '', 34081 type: originalType = '' 34082 } = blockAttributes; 34083 const { 34084 title: newLabel = '', 34085 // the title of any provided Post. 34086 url: newUrl = '', 34087 opensInNewTab, 34088 id, 34089 kind: newKind = originalKind, 34090 type: newType = originalType 34091 } = updatedValue; 34092 const newLabelWithoutHttp = newLabel.replace(/http(s?):\/\//gi, ''); 34093 const newUrlWithoutHttp = newUrl.replace(/http(s?):\/\//gi, ''); 34094 const useNewLabel = newLabel && newLabel !== originalLabel && 34095 // LinkControl without the title field relies 34096 // on the check below. Specifically, it assumes that 34097 // the URL is the same as a title. 34098 // This logic a) looks suspicious and b) should really 34099 // live in the LinkControl and not here. It's a great 34100 // candidate for future refactoring. 34101 newLabelWithoutHttp !== newUrlWithoutHttp; 34102 34103 // Unfortunately this causes the escaping model to be inverted. 34104 // The escaped content is stored in the block attributes (and ultimately in the database), 34105 // and then the raw data is "recovered" when outputting into the DOM. 34106 // It would be preferable to store the **raw** data in the block attributes and escape it in JS. 34107 // Why? Because there isn't one way to escape data. Depending on the context, you need to do 34108 // different transforms. It doesn't make sense to me to choose one of them for the purposes of storage. 34109 // See also: 34110 // - https://github.com/WordPress/gutenberg/pull/41063 34111 // - https://github.com/WordPress/gutenberg/pull/18617. 34112 const label = useNewLabel ? (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newLabel) : originalLabel || (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newUrlWithoutHttp); 34113 34114 // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag" 34115 const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_'); 34116 const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1; 34117 const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom'; 34118 const kind = isCustomLink ? 'custom' : newKind; 34119 setAttributes({ 34120 // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string. 34121 ...(newUrl && { 34122 url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(newUrl)) 34123 }), 34124 ...(label && { 34125 label 34126 }), 34127 ...(undefined !== opensInNewTab && { 34128 opensInNewTab 34129 }), 34130 ...(id && Number.isInteger(id) && { 34131 id 34132 }), 34133 ...(kind && { 34134 kind 34135 }), 34136 ...(type && type !== 'URL' && { 34137 type 34138 }) 34139 }); 34140 }; 34141 34142 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js 34143 34144 /** 34145 * WordPress dependencies 34146 */ 34147 34148 const chevronLeftSmall = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 34149 xmlns: "http://www.w3.org/2000/svg", 34150 viewBox: "0 0 24 24" 34151 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 34152 d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" 34153 })); 34154 /* harmony default export */ const chevron_left_small = (chevronLeftSmall); 34155 34156 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js 34157 34158 /** 34159 * WordPress dependencies 34160 */ 34161 34162 const plus = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 34163 xmlns: "http://www.w3.org/2000/svg", 34164 viewBox: "0 0 24 24" 34165 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 34166 d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" 34167 })); 34168 /* harmony default export */ const library_plus = (plus); 34169 34170 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/link-ui.js 34171 34172 /** 34173 * WordPress dependencies 34174 */ 34175 34176 34177 34178 34179 34180 34181 34182 34183 34184 34185 34186 /** 34187 * Internal dependencies 34188 */ 34189 34190 const { 34191 PrivateQuickInserter: QuickInserter 34192 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 34193 34194 /** 34195 * Given the Link block's type attribute, return the query params to give to 34196 * /wp/v2/search. 34197 * 34198 * @param {string} type Link block's type attribute. 34199 * @param {string} kind Link block's entity of kind (post-type|taxonomy) 34200 * @return {{ type?: string, subtype?: string }} Search query params. 34201 */ 34202 function getSuggestionsQuery(type, kind) { 34203 switch (type) { 34204 case 'post': 34205 case 'page': 34206 return { 34207 type: 'post', 34208 subtype: type 34209 }; 34210 case 'category': 34211 return { 34212 type: 'term', 34213 subtype: 'category' 34214 }; 34215 case 'tag': 34216 return { 34217 type: 'term', 34218 subtype: 'post_tag' 34219 }; 34220 case 'post_format': 34221 return { 34222 type: 'post-format' 34223 }; 34224 default: 34225 if (kind === 'taxonomy') { 34226 return { 34227 type: 'term', 34228 subtype: type 34229 }; 34230 } 34231 if (kind === 'post-type') { 34232 return { 34233 type: 'post', 34234 subtype: type 34235 }; 34236 } 34237 return { 34238 // for custom link which has no type 34239 // always show pages as initial suggestions 34240 initialSuggestionsSearchOptions: { 34241 type: 'post', 34242 subtype: 'page', 34243 perPage: 20 34244 } 34245 }; 34246 } 34247 } 34248 function LinkUIBlockInserter({ 34249 clientId, 34250 onBack, 34251 onSelectBlock 34252 }) { 34253 const { 34254 rootBlockClientId 34255 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 34256 const { 34257 getBlockRootClientId 34258 } = select(external_wp_blockEditor_namespaceObject.store); 34259 return { 34260 rootBlockClientId: getBlockRootClientId(clientId) 34261 }; 34262 }, [clientId]); 34263 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); 34264 const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, `link-ui-block-inserter__title`); 34265 const dialogDescritionId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, `link-ui-block-inserter__description`); 34266 if (!clientId) { 34267 return null; 34268 } 34269 return (0,external_React_namespaceObject.createElement)("div", { 34270 className: "link-ui-block-inserter", 34271 role: "dialog", 34272 "aria-labelledby": dialogTitleId, 34273 "aria-describedby": dialogDescritionId, 34274 ref: focusOnMountRef 34275 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_React_namespaceObject.createElement)("h2", { 34276 id: dialogTitleId 34277 }, (0,external_wp_i18n_namespaceObject.__)('Add block')), (0,external_React_namespaceObject.createElement)("p", { 34278 id: dialogDescritionId 34279 }, (0,external_wp_i18n_namespaceObject.__)('Choose a block to add to your Navigation.'))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 34280 className: "link-ui-block-inserter__back", 34281 icon: chevron_left_small, 34282 onClick: e => { 34283 e.preventDefault(); 34284 onBack(); 34285 }, 34286 size: "small" 34287 }, (0,external_wp_i18n_namespaceObject.__)('Back')), (0,external_React_namespaceObject.createElement)(QuickInserter, { 34288 rootClientId: rootBlockClientId, 34289 clientId: clientId, 34290 isAppender: false, 34291 prioritizePatterns: false, 34292 selectBlockOnInsert: true, 34293 hasSearch: false, 34294 onSelect: onSelectBlock 34295 })); 34296 } 34297 function LinkUI(props) { 34298 const [addingBlock, setAddingBlock] = (0,external_wp_element_namespaceObject.useState)(false); 34299 const [focusAddBlockButton, setFocusAddBlockButton] = (0,external_wp_element_namespaceObject.useState)(false); 34300 const [showBackdrop, setShowBackdrop] = (0,external_wp_element_namespaceObject.useState)(true); 34301 const { 34302 saveEntityRecord 34303 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 34304 const pagesPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('pages'); 34305 const postsPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('posts'); 34306 async function handleCreate(pageTitle) { 34307 const postType = props.link.type || 'page'; 34308 const page = await saveEntityRecord('postType', postType, { 34309 title: pageTitle, 34310 status: 'draft' 34311 }); 34312 return { 34313 id: page.id, 34314 type: postType, 34315 // Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities) 34316 // is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code. 34317 // Ideally in the future we will update both APIs to utilise the "raw" form of the title which is better suited to edit contexts. 34318 // e.g. 34319 // - title.raw = "Yes & No" 34320 // - title.rendered = "Yes & No" 34321 // - decodeEntities( title.rendered ) = "Yes & No" 34322 // See: 34323 // - https://github.com/WordPress/gutenberg/pull/41063 34324 // - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218 34325 title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered), 34326 url: page.link, 34327 kind: 'post-type' 34328 }; 34329 } 34330 const { 34331 label, 34332 url, 34333 opensInNewTab, 34334 type, 34335 kind 34336 } = props.link; 34337 let userCanCreate = false; 34338 if (!type || type === 'page') { 34339 userCanCreate = pagesPermissions.canCreate; 34340 } else if (type === 'post') { 34341 userCanCreate = postsPermissions.canCreate; 34342 } 34343 34344 // Memoize link value to avoid overriding the LinkControl's internal state. 34345 // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407. 34346 const link = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 34347 url, 34348 opensInNewTab, 34349 title: label && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) 34350 }), [label, opensInNewTab, url]); 34351 const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__title`); 34352 const dialogDescritionId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__description`); 34353 34354 // Selecting a block should close the popover and also remove the (previously) automatically inserted 34355 // link block so that the newly selected block can be inserted in its place. 34356 const { 34357 onClose: onSelectBlock 34358 } = props; 34359 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, showBackdrop && (0,external_React_namespaceObject.createElement)("div", { 34360 className: "components-popover-pointer-events-trap", 34361 "aria-hidden": "true", 34362 onClick: () => setShowBackdrop(false) 34363 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { 34364 placement: "bottom", 34365 onClose: props.onClose, 34366 anchor: props.anchor, 34367 shift: true 34368 }, !addingBlock && (0,external_React_namespaceObject.createElement)("div", { 34369 role: "dialog", 34370 "aria-labelledby": dialogTitleId, 34371 "aria-describedby": dialogDescritionId 34372 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_React_namespaceObject.createElement)("h2", { 34373 id: dialogTitleId 34374 }, (0,external_wp_i18n_namespaceObject.__)('Add link')), (0,external_React_namespaceObject.createElement)("p", { 34375 id: dialogDescritionId 34376 }, (0,external_wp_i18n_namespaceObject.__)('Search for and add a link to your Navigation.'))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { 34377 hasTextControl: true, 34378 hasRichPreviews: true, 34379 value: link, 34380 showInitialSuggestions: true, 34381 withCreateSuggestion: userCanCreate, 34382 createSuggestion: handleCreate, 34383 createSuggestionButtonText: searchTerm => { 34384 let format; 34385 if (type === 'post') { 34386 /* translators: %s: search term. */ 34387 format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>'); 34388 } else { 34389 /* translators: %s: search term. */ 34390 format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>'); 34391 } 34392 return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), { 34393 mark: (0,external_React_namespaceObject.createElement)("mark", null) 34394 }); 34395 }, 34396 noDirectEntry: !!type, 34397 noURLSuggestion: !!type, 34398 suggestionsQuery: getSuggestionsQuery(type, kind), 34399 onChange: props.onChange, 34400 onRemove: props.onRemove, 34401 onCancel: props.onCancel, 34402 renderControlBottom: () => !link?.url?.length && (0,external_React_namespaceObject.createElement)(LinkUITools, { 34403 focusAddBlockButton: focusAddBlockButton, 34404 setAddingBlock: () => { 34405 setAddingBlock(true); 34406 setFocusAddBlockButton(false); 34407 } 34408 }) 34409 })), addingBlock && (0,external_React_namespaceObject.createElement)(LinkUIBlockInserter, { 34410 clientId: props.clientId, 34411 onBack: () => { 34412 setAddingBlock(false); 34413 setFocusAddBlockButton(true); 34414 }, 34415 onSelectBlock: onSelectBlock 34416 }))); 34417 } 34418 const LinkUITools = ({ 34419 setAddingBlock, 34420 focusAddBlockButton 34421 }) => { 34422 const blockInserterAriaRole = 'listbox'; 34423 const addBlockButtonRef = (0,external_wp_element_namespaceObject.useRef)(); 34424 34425 // Focus the add block button when the popover is opened. 34426 (0,external_wp_element_namespaceObject.useEffect)(() => { 34427 if (focusAddBlockButton) { 34428 addBlockButtonRef.current?.focus(); 34429 } 34430 }, [focusAddBlockButton]); 34431 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { 34432 className: "link-ui-tools" 34433 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 34434 ref: addBlockButtonRef, 34435 icon: library_plus, 34436 onClick: e => { 34437 e.preventDefault(); 34438 setAddingBlock(true); 34439 }, 34440 "aria-haspopup": blockInserterAriaRole 34441 }, (0,external_wp_i18n_namespaceObject.__)('Add block'))); 34442 }; 34443 /* harmony default export */ const link_ui = ((/* unused pure expression or super */ null && (LinkUITools))); 34444 34445 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/menu-inspector-controls.js 34446 34447 /** 34448 * WordPress dependencies 34449 */ 34450 34451 34452 34453 34454 34455 /** 34456 * Internal dependencies 34457 */ 34458 34459 34460 34461 34462 34463 34464 34465 34466 /* translators: %s: The name of a menu. */ 34467 const actionLabel = (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"); 34468 const BLOCKS_WITH_LINK_UI_SUPPORT = ['core/navigation-link', 'core/navigation-submenu']; 34469 const { 34470 PrivateListView 34471 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 34472 function AdditionalBlockContent({ 34473 block, 34474 insertedBlock, 34475 setInsertedBlock 34476 }) { 34477 const { 34478 updateBlockAttributes 34479 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 34480 const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(insertedBlock?.name); 34481 const blockWasJustInserted = insertedBlock?.clientId === block.clientId; 34482 const showLinkControls = supportsLinkControls && blockWasJustInserted; 34483 if (!showLinkControls) { 34484 return null; 34485 } 34486 const setInsertedBlockAttributes = _insertedBlockClientId => _updatedAttributes => { 34487 if (!_insertedBlockClientId) return; 34488 updateBlockAttributes(_insertedBlockClientId, _updatedAttributes); 34489 }; 34490 return (0,external_React_namespaceObject.createElement)(LinkUI, { 34491 clientId: insertedBlock?.clientId, 34492 link: insertedBlock?.attributes, 34493 onClose: () => { 34494 setInsertedBlock(null); 34495 }, 34496 onChange: updatedValue => { 34497 updateAttributes(updatedValue, setInsertedBlockAttributes(insertedBlock?.clientId), insertedBlock?.attributes); 34498 setInsertedBlock(null); 34499 }, 34500 onCancel: () => { 34501 setInsertedBlock(null); 34502 } 34503 }); 34504 } 34505 const MainContent = ({ 34506 clientId, 34507 currentMenuId, 34508 isLoading, 34509 isNavigationMenuMissing, 34510 onCreateNew 34511 }) => { 34512 const hasChildren = (0,external_wp_data_namespaceObject.useSelect)(select => { 34513 return !!select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId); 34514 }, [clientId]); 34515 const { 34516 navigationMenu 34517 } = useNavigationMenu(currentMenuId); 34518 if (currentMenuId && isNavigationMenuMissing) { 34519 return (0,external_React_namespaceObject.createElement)(deleted_navigation_warning, { 34520 onCreateNew: onCreateNew 34521 }); 34522 } 34523 if (isLoading) { 34524 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null); 34525 } 34526 const description = navigationMenu ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of a menu. */ 34527 (0,external_wp_i18n_namespaceObject.__)('Structure for navigation menu: %s'), navigationMenu?.title || (0,external_wp_i18n_namespaceObject.__)('Untitled menu')) : (0,external_wp_i18n_namespaceObject.__)('You have not yet created any menus. Displaying a list of your Pages'); 34528 return (0,external_React_namespaceObject.createElement)("div", { 34529 className: "wp-block-navigation__menu-inspector-controls" 34530 }, !hasChildren && (0,external_React_namespaceObject.createElement)("p", { 34531 className: "wp-block-navigation__menu-inspector-controls__empty-message" 34532 }, (0,external_wp_i18n_namespaceObject.__)('This navigation menu is empty.')), (0,external_React_namespaceObject.createElement)(PrivateListView, { 34533 rootClientId: clientId, 34534 isExpanded: true, 34535 description: description, 34536 showAppender: true, 34537 blockSettingsMenu: LeafMoreMenu, 34538 additionalBlockContent: AdditionalBlockContent 34539 })); 34540 }; 34541 const MenuInspectorControls = props => { 34542 const { 34543 createNavigationMenuIsSuccess, 34544 createNavigationMenuIsError, 34545 currentMenuId = null, 34546 onCreateNew, 34547 onSelectClassicMenu, 34548 onSelectNavigationMenu, 34549 isManageMenusButtonDisabled, 34550 blockEditingMode 34551 } = props; 34552 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 34553 group: "list" 34554 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 34555 title: null 34556 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 34557 className: "wp-block-navigation-off-canvas-editor__header" 34558 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { 34559 className: "wp-block-navigation-off-canvas-editor__title", 34560 level: 2 34561 }, (0,external_wp_i18n_namespaceObject.__)('Menu')), blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(navigation_menu_selector, { 34562 currentMenuId: currentMenuId, 34563 onSelectClassicMenu: onSelectClassicMenu, 34564 onSelectNavigationMenu: onSelectNavigationMenu, 34565 onCreateNew: onCreateNew, 34566 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 34567 createNavigationMenuIsError: createNavigationMenuIsError, 34568 actionLabel: actionLabel, 34569 isManageMenusButtonDisabled: isManageMenusButtonDisabled 34570 })), (0,external_React_namespaceObject.createElement)(MainContent, { 34571 ...props 34572 }))); 34573 }; 34574 /* harmony default export */ const menu_inspector_controls = (MenuInspectorControls); 34575 34576 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-description.js 34577 34578 /** 34579 * WordPress dependencies 34580 */ 34581 34582 function AccessibleDescription({ 34583 id, 34584 children 34585 }) { 34586 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_React_namespaceObject.createElement)("div", { 34587 id: id, 34588 className: "wp-block-navigation__description" 34589 }, children)); 34590 } 34591 34592 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-menu-description.js 34593 34594 /** 34595 * WordPress dependencies 34596 */ 34597 34598 34599 34600 /** 34601 * Internal dependencies 34602 */ 34603 34604 function AccessibleMenuDescription({ 34605 id 34606 }) { 34607 const [menuTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 34608 /* translators: %s: Title of a Navigation Menu post. */ 34609 const description = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)(`Navigation menu: "%s"`), menuTitle); 34610 return (0,external_React_namespaceObject.createElement)(AccessibleDescription, { 34611 id: id 34612 }, description); 34613 } 34614 34615 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js 34616 34617 /** 34618 * External dependencies 34619 */ 34620 34621 34622 /** 34623 * WordPress dependencies 34624 */ 34625 34626 34627 34628 34629 34630 34631 34632 34633 34634 34635 /** 34636 * Internal dependencies 34637 */ 34638 34639 34640 34641 34642 34643 34644 34645 34646 34647 34648 34649 34650 34651 34652 34653 34654 34655 34656 34657 34658 34659 function Navigation({ 34660 attributes, 34661 setAttributes, 34662 clientId, 34663 isSelected, 34664 className, 34665 backgroundColor, 34666 setBackgroundColor, 34667 textColor, 34668 setTextColor, 34669 overlayBackgroundColor, 34670 setOverlayBackgroundColor, 34671 overlayTextColor, 34672 setOverlayTextColor, 34673 // These props are used by the navigation editor to override specific 34674 // navigation block settings. 34675 hasSubmenuIndicatorSetting = true, 34676 customPlaceholder: CustomPlaceholder = null, 34677 __unstableLayoutClassNames: layoutClassNames 34678 }) { 34679 const { 34680 openSubmenusOnClick, 34681 overlayMenu, 34682 showSubmenuIcon, 34683 templateLock, 34684 layout: { 34685 justifyContent, 34686 orientation = 'horizontal', 34687 flexWrap = 'wrap' 34688 } = {}, 34689 hasIcon, 34690 icon = 'handle' 34691 } = attributes; 34692 const ref = attributes.ref; 34693 const setRef = (0,external_wp_element_namespaceObject.useCallback)(postId => { 34694 setAttributes({ 34695 ref: postId 34696 }); 34697 }, [setAttributes]); 34698 const recursionId = `navigationMenu/$ref}`; 34699 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(recursionId); 34700 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 34701 34702 // Preload classic menus, so that they don't suddenly pop-in when viewing 34703 // the Select Menu dropdown. 34704 const { 34705 menus: classicMenus 34706 } = useNavigationEntities(); 34707 const [showNavigationMenuStatusNotice, hideNavigationMenuStatusNotice] = use_navigation_notice({ 34708 name: 'block-library/core/navigation/status' 34709 }); 34710 const [showClassicMenuConversionNotice, hideClassicMenuConversionNotice] = use_navigation_notice({ 34711 name: 'block-library/core/navigation/classic-menu-conversion' 34712 }); 34713 const [showNavigationMenuPermissionsNotice, hideNavigationMenuPermissionsNotice] = use_navigation_notice({ 34714 name: 'block-library/core/navigation/permissions/update' 34715 }); 34716 const { 34717 create: createNavigationMenu, 34718 status: createNavigationMenuStatus, 34719 error: createNavigationMenuError, 34720 value: createNavigationMenuPost, 34721 isPending: isCreatingNavigationMenu, 34722 isSuccess: createNavigationMenuIsSuccess, 34723 isError: createNavigationMenuIsError 34724 } = useCreateNavigationMenu(clientId); 34725 const createUntitledEmptyNavigationMenu = async () => { 34726 await createNavigationMenu(''); 34727 }; 34728 const { 34729 hasUncontrolledInnerBlocks, 34730 uncontrolledInnerBlocks, 34731 isInnerBlockSelected, 34732 innerBlocks 34733 } = useInnerBlocks(clientId); 34734 const hasSubmenus = !!innerBlocks.find(block => block.name === 'core/navigation-submenu'); 34735 const { 34736 replaceInnerBlocks, 34737 selectBlock, 34738 __unstableMarkNextChangeAsNotPersistent 34739 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 34740 const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false); 34741 const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false); 34742 const { 34743 hasResolvedNavigationMenus, 34744 isNavigationMenuResolved, 34745 isNavigationMenuMissing, 34746 canUserUpdateNavigationMenu, 34747 hasResolvedCanUserUpdateNavigationMenu, 34748 canUserDeleteNavigationMenu, 34749 hasResolvedCanUserDeleteNavigationMenu, 34750 canUserCreateNavigationMenu, 34751 isResolvingCanUserCreateNavigationMenu, 34752 hasResolvedCanUserCreateNavigationMenu 34753 } = useNavigationMenu(ref); 34754 const navMenuResolvedButMissing = hasResolvedNavigationMenus && isNavigationMenuMissing; 34755 const { 34756 convert: convertClassicMenu, 34757 status: classicMenuConversionStatus, 34758 error: classicMenuConversionError 34759 } = use_convert_classic_menu_to_block_menu(createNavigationMenu); 34760 const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; 34761 const handleUpdateMenu = (0,external_wp_element_namespaceObject.useCallback)((menuId, options = { 34762 focusNavigationBlock: false 34763 }) => { 34764 const { 34765 focusNavigationBlock 34766 } = options; 34767 setRef(menuId); 34768 if (focusNavigationBlock) { 34769 selectBlock(clientId); 34770 } 34771 }, [selectBlock, clientId, setRef]); 34772 const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; 34773 34774 // If the block has inner blocks, but no menu id, then these blocks are either: 34775 // - inserted via a pattern. 34776 // - inserted directly via Code View (or otherwise). 34777 // - from an older version of navigation block added before the block used a wp_navigation entity. 34778 // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks, 34779 // that automatically saves the menu as an entity when changes are made to the inner blocks. 34780 const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable; 34781 const { 34782 getNavigationFallbackId 34783 } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); 34784 const navigationFallbackId = !(ref || hasUnsavedBlocks) ? getNavigationFallbackId() : null; 34785 (0,external_wp_element_namespaceObject.useEffect)(() => { 34786 // If: 34787 // - there is an existing menu, OR 34788 // - there are existing (uncontrolled) inner blocks 34789 // ...then don't request a fallback menu. 34790 if (ref || hasUnsavedBlocks || !navigationFallbackId) { 34791 return; 34792 } 34793 34794 /** 34795 * This fallback displays (both in editor and on front) 34796 * The fallback should not request a save (entity dirty state) 34797 * nor to be undoable, hence why it is marked as non persistent 34798 */ 34799 34800 __unstableMarkNextChangeAsNotPersistent(); 34801 setRef(navigationFallbackId); 34802 }, [ref, setRef, hasUnsavedBlocks, navigationFallbackId, __unstableMarkNextChangeAsNotPersistent]); 34803 const navRef = (0,external_wp_element_namespaceObject.useRef)(); 34804 34805 // The standard HTML5 tag for the block wrapper. 34806 const TagName = 'nav'; 34807 34808 // "placeholder" shown if: 34809 // - there is no ref attribute pointing to a Navigation Post. 34810 // - there is no classic menu conversion process in progress. 34811 // - there is no menu creation process in progress. 34812 // - there are no uncontrolled blocks. 34813 const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && classicMenus?.length === 0 && !hasUncontrolledInnerBlocks; 34814 34815 // "loading" state: 34816 // - there is a menu creation process in progress. 34817 // - there is a classic menu conversion process in progress. 34818 // OR: 34819 // - there is a ref attribute pointing to a Navigation Post 34820 // - the Navigation Post isn't available (hasn't resolved) yet. 34821 const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu); 34822 const textDecoration = attributes.style?.typography?.textDecoration; 34823 const hasBlockOverlay = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__unstableHasActiveBlockOverlayActive(clientId), [clientId]); 34824 const isResponsive = 'never' !== overlayMenu; 34825 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 34826 ref: navRef, 34827 className: classnames_default()(className, { 34828 'items-justified-right': justifyContent === 'right', 34829 'items-justified-space-between': justifyContent === 'space-between', 34830 'items-justified-left': justifyContent === 'left', 34831 'items-justified-center': justifyContent === 'center', 34832 'is-vertical': orientation === 'vertical', 34833 'no-wrap': flexWrap === 'nowrap', 34834 'is-responsive': isResponsive, 34835 'has-text-color': !!textColor.color || !!textColor?.class, 34836 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor?.slug)]: !!textColor?.slug, 34837 'has-background': !!backgroundColor.color || backgroundColor.class, 34838 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor?.slug)]: !!backgroundColor?.slug, 34839 [`has-text-decoration-$textDecoration}`]: textDecoration, 34840 'block-editor-block-content-overlay': hasBlockOverlay 34841 }, layoutClassNames), 34842 style: { 34843 color: !textColor?.slug && textColor?.color, 34844 backgroundColor: !backgroundColor?.slug && backgroundColor?.color 34845 } 34846 }); 34847 34848 // Turn on contrast checker for web only since it's not supported on mobile yet. 34849 const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web'; 34850 const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); 34851 const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)(); 34852 const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); 34853 const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)(); 34854 const onSelectClassicMenu = async classicMenu => { 34855 return convertClassicMenu(classicMenu.id, classicMenu.name, 'draft'); 34856 }; 34857 const onSelectNavigationMenu = menuId => { 34858 handleUpdateMenu(menuId); 34859 }; 34860 (0,external_wp_element_namespaceObject.useEffect)(() => { 34861 hideNavigationMenuStatusNotice(); 34862 if (isCreatingNavigationMenu) { 34863 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`)); 34864 } 34865 if (createNavigationMenuIsSuccess) { 34866 handleUpdateMenu(createNavigationMenuPost?.id, { 34867 focusNavigationBlock: true 34868 }); 34869 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`)); 34870 } 34871 if (createNavigationMenuIsError) { 34872 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.')); 34873 } 34874 }, [createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost?.id, createNavigationMenuIsError, createNavigationMenuIsSuccess, isCreatingNavigationMenu, handleUpdateMenu, hideNavigationMenuStatusNotice, showNavigationMenuStatusNotice]); 34875 (0,external_wp_element_namespaceObject.useEffect)(() => { 34876 hideClassicMenuConversionNotice(); 34877 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) { 34878 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.')); 34879 } 34880 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) { 34881 showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.')); 34882 handleUpdateMenu(createNavigationMenuPost?.id, { 34883 focusNavigationBlock: true 34884 }); 34885 } 34886 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) { 34887 showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.')); 34888 } 34889 }, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice, createNavigationMenuPost?.id, handleUpdateMenu]); 34890 (0,external_wp_element_namespaceObject.useEffect)(() => { 34891 if (!enableContrastChecking) { 34892 return; 34893 } 34894 detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor); 34895 const subMenuElement = navRef.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]'); 34896 if (!subMenuElement) { 34897 return; 34898 } 34899 34900 // Only detect submenu overlay colors if they have previously been explicitly set. 34901 // This avoids the contrast checker from reporting on inherited submenu colors and 34902 // showing the contrast warning twice. 34903 if (overlayTextColor.color || overlayBackgroundColor.color) { 34904 detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor); 34905 } 34906 }, [enableContrastChecking, overlayTextColor.color, overlayBackgroundColor.color]); 34907 (0,external_wp_element_namespaceObject.useEffect)(() => { 34908 if (!isSelected && !isInnerBlockSelected) { 34909 hideNavigationMenuPermissionsNotice(); 34910 } 34911 if (isSelected || isInnerBlockSelected) { 34912 if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) { 34913 showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')); 34914 } 34915 if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) { 34916 showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')); 34917 } 34918 } 34919 }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref, hideNavigationMenuPermissionsNotice, showNavigationMenuPermissionsNotice, navMenuResolvedButMissing]); 34920 const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu; 34921 const overlayMenuPreviewClasses = classnames_default()('wp-block-navigation__overlay-menu-preview', { 34922 open: overlayMenuPreview 34923 }); 34924 const submenuAccessibilityNotice = !showSubmenuIcon && !openSubmenusOnClick ? (0,external_wp_i18n_namespaceObject.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.') : ''; 34925 const isFirstRender = (0,external_wp_element_namespaceObject.useRef)(true); // Don't speak on first render. 34926 (0,external_wp_element_namespaceObject.useEffect)(() => { 34927 if (!isFirstRender.current && submenuAccessibilityNotice) { 34928 (0,external_wp_a11y_namespaceObject.speak)(submenuAccessibilityNotice); 34929 } 34930 isFirstRender.current = false; 34931 }, [submenuAccessibilityNotice]); 34932 const overlayMenuPreviewId = (0,external_wp_compose_namespaceObject.useInstanceId)(OverlayMenuPreview, `overlay-menu-preview`); 34933 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 34934 const stylingInspectorControls = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 34935 title: (0,external_wp_i18n_namespaceObject.__)('Display') 34936 }, isResponsive && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 34937 className: overlayMenuPreviewClasses, 34938 onClick: () => { 34939 setOverlayMenuPreview(!overlayMenuPreview); 34940 }, 34941 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Overlay menu controls'), 34942 "aria-controls": overlayMenuPreviewId, 34943 "aria-expanded": overlayMenuPreview 34944 }, hasIcon && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(OverlayMenuIcon, { 34945 icon: icon 34946 }), (0,external_React_namespaceObject.createElement)(build_module_icon, { 34947 icon: library_close 34948 })), !hasIcon && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Menu')), (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Close')))), (0,external_React_namespaceObject.createElement)("div", { 34949 id: overlayMenuPreviewId 34950 }, overlayMenuPreview && (0,external_React_namespaceObject.createElement)(OverlayMenuPreview, { 34951 setAttributes: setAttributes, 34952 hasIcon: hasIcon, 34953 icon: icon, 34954 hidden: !overlayMenuPreview 34955 }))), (0,external_React_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 34956 __nextHasNoMarginBottom: true, 34957 label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'), 34958 value: overlayMenu, 34959 help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'), 34960 onChange: value => setAttributes({ 34961 overlayMenu: value 34962 }), 34963 isBlock: true, 34964 hideLabelFromVision: true 34965 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 34966 value: "never", 34967 label: (0,external_wp_i18n_namespaceObject.__)('Off') 34968 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 34969 value: "mobile", 34970 label: (0,external_wp_i18n_namespaceObject.__)('Mobile') 34971 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 34972 value: "always", 34973 label: (0,external_wp_i18n_namespaceObject.__)('Always') 34974 })), hasSubmenus && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 34975 __nextHasNoMarginBottom: true, 34976 checked: openSubmenusOnClick, 34977 onChange: value => { 34978 setAttributes({ 34979 openSubmenusOnClick: value, 34980 ...(value && { 34981 showSubmenuIcon: true 34982 }) // Make sure arrows are shown when we toggle this on. 34983 }); 34984 }, 34985 label: (0,external_wp_i18n_namespaceObject.__)('Open on click') 34986 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 34987 __nextHasNoMarginBottom: true, 34988 checked: showSubmenuIcon, 34989 onChange: value => { 34990 setAttributes({ 34991 showSubmenuIcon: value 34992 }); 34993 }, 34994 disabled: attributes.openSubmenusOnClick, 34995 label: (0,external_wp_i18n_namespaceObject.__)('Show arrow') 34996 }), submenuAccessibilityNotice && (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 34997 spokenMessage: null, 34998 status: "warning", 34999 isDismissible: false 35000 }, submenuAccessibilityNotice))))), colorGradientSettings.hasColorsOrGradients && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 35001 group: "color" 35002 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 35003 __experimentalIsRenderedInSidebar: true, 35004 settings: [{ 35005 colorValue: textColor.color, 35006 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 35007 onColorChange: setTextColor, 35008 resetAllFilter: () => setTextColor() 35009 }, { 35010 colorValue: backgroundColor.color, 35011 label: (0,external_wp_i18n_namespaceObject.__)('Background'), 35012 onColorChange: setBackgroundColor, 35013 resetAllFilter: () => setBackgroundColor() 35014 }, { 35015 colorValue: overlayTextColor.color, 35016 label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text'), 35017 onColorChange: setOverlayTextColor, 35018 resetAllFilter: () => setOverlayTextColor() 35019 }, { 35020 colorValue: overlayBackgroundColor.color, 35021 label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background'), 35022 onColorChange: setOverlayBackgroundColor, 35023 resetAllFilter: () => setOverlayBackgroundColor() 35024 }], 35025 panelId: clientId, 35026 ...colorGradientSettings, 35027 gradients: [], 35028 disableCustomGradients: true 35029 }), enableContrastChecking && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 35030 backgroundColor: detectedBackgroundColor, 35031 textColor: detectedColor 35032 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 35033 backgroundColor: detectedOverlayBackgroundColor, 35034 textColor: detectedOverlayColor 35035 })))); 35036 const accessibleDescriptionId = `$clientId}-desc`; 35037 const isManageMenusButtonDisabled = !hasManagePermissions || !hasResolvedNavigationMenus; 35038 if (hasUnsavedBlocks && !isCreatingNavigationMenu) { 35039 return (0,external_React_namespaceObject.createElement)(TagName, { 35040 ...blockProps, 35041 "aria-describedby": !isPlaceholder ? accessibleDescriptionId : undefined 35042 }, (0,external_React_namespaceObject.createElement)(AccessibleDescription, { 35043 id: accessibleDescriptionId 35044 }, (0,external_wp_i18n_namespaceObject.__)('Unsaved Navigation Menu.')), (0,external_React_namespaceObject.createElement)(menu_inspector_controls, { 35045 clientId: clientId, 35046 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 35047 createNavigationMenuIsError: createNavigationMenuIsError, 35048 currentMenuId: ref, 35049 isNavigationMenuMissing: isNavigationMenuMissing, 35050 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 35051 onCreateNew: createUntitledEmptyNavigationMenu, 35052 onSelectClassicMenu: onSelectClassicMenu, 35053 onSelectNavigationMenu: onSelectNavigationMenu, 35054 isLoading: isLoading, 35055 blockEditingMode: blockEditingMode 35056 }), blockEditingMode === 'default' && stylingInspectorControls, (0,external_React_namespaceObject.createElement)(ResponsiveWrapper, { 35057 id: clientId, 35058 onToggle: setResponsiveMenuVisibility, 35059 isOpen: isResponsiveMenuOpen, 35060 hasIcon: hasIcon, 35061 icon: icon, 35062 isResponsive: isResponsive, 35063 isHiddenByDefault: 'always' === overlayMenu, 35064 overlayBackgroundColor: overlayBackgroundColor, 35065 overlayTextColor: overlayTextColor 35066 }, (0,external_React_namespaceObject.createElement)(UnsavedInnerBlocks, { 35067 createNavigationMenu: createNavigationMenu, 35068 blocks: uncontrolledInnerBlocks, 35069 hasSelection: isSelected || isInnerBlockSelected 35070 }))); 35071 } 35072 35073 // Show a warning if the selected menu is no longer available. 35074 // TODO - the user should be able to select a new one? 35075 if (ref && isNavigationMenuMissing) { 35076 return (0,external_React_namespaceObject.createElement)(TagName, { 35077 ...blockProps 35078 }, (0,external_React_namespaceObject.createElement)(menu_inspector_controls, { 35079 clientId: clientId, 35080 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 35081 createNavigationMenuIsError: createNavigationMenuIsError, 35082 currentMenuId: ref, 35083 isNavigationMenuMissing: isNavigationMenuMissing, 35084 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 35085 onCreateNew: createUntitledEmptyNavigationMenu, 35086 onSelectClassicMenu: onSelectClassicMenu, 35087 onSelectNavigationMenu: onSelectNavigationMenu, 35088 isLoading: isLoading, 35089 blockEditingMode: blockEditingMode 35090 }), (0,external_React_namespaceObject.createElement)(deleted_navigation_warning, { 35091 onCreateNew: createUntitledEmptyNavigationMenu 35092 })); 35093 } 35094 if (isEntityAvailable && hasAlreadyRendered) { 35095 return (0,external_React_namespaceObject.createElement)("div", { 35096 ...blockProps 35097 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.'))); 35098 } 35099 const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder; 35100 35101 /** 35102 * Historically the navigation block has supported custom placeholders. 35103 * Even though the current UX tries as hard as possible not to 35104 * end up in a placeholder state, the block continues to support 35105 * this extensibility point, via a CustomPlaceholder. 35106 * When CustomPlaceholder is present it becomes the default fallback 35107 * for an empty navigation block, instead of the default fallbacks. 35108 * 35109 */ 35110 35111 if (isPlaceholder && CustomPlaceholder) { 35112 return (0,external_React_namespaceObject.createElement)(TagName, { 35113 ...blockProps 35114 }, (0,external_React_namespaceObject.createElement)(PlaceholderComponent, { 35115 isSelected: isSelected, 35116 currentMenuId: ref, 35117 clientId: clientId, 35118 canUserCreateNavigationMenu: canUserCreateNavigationMenu, 35119 isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu, 35120 onSelectNavigationMenu: onSelectNavigationMenu, 35121 onSelectClassicMenu: onSelectClassicMenu, 35122 onCreateEmpty: createUntitledEmptyNavigationMenu 35123 })); 35124 } 35125 return (0,external_React_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, { 35126 kind: "postType", 35127 type: "wp_navigation", 35128 id: ref 35129 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 35130 uniqueId: recursionId 35131 }, (0,external_React_namespaceObject.createElement)(menu_inspector_controls, { 35132 clientId: clientId, 35133 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 35134 createNavigationMenuIsError: createNavigationMenuIsError, 35135 currentMenuId: ref, 35136 isNavigationMenuMissing: isNavigationMenuMissing, 35137 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 35138 onCreateNew: createUntitledEmptyNavigationMenu, 35139 onSelectClassicMenu: onSelectClassicMenu, 35140 onSelectNavigationMenu: onSelectNavigationMenu, 35141 isLoading: isLoading, 35142 blockEditingMode: blockEditingMode 35143 }), blockEditingMode === 'default' && stylingInspectorControls, blockEditingMode === 'default' && isEntityAvailable && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 35144 group: "advanced" 35145 }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_React_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_React_namespaceObject.createElement)(NavigationMenuDeleteControl, { 35146 onDelete: (deletedMenuTitle = '') => { 35147 replaceInnerBlocks(clientId, []); 35148 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.sprintf)( 35149 // translators: %s: the name of a menu (e.g. Header navigation). 35150 (0,external_wp_i18n_namespaceObject.__)('Navigation menu %s successfully deleted.'), deletedMenuTitle)); 35151 } 35152 }), (0,external_React_namespaceObject.createElement)(manage_menus_button, { 35153 disabled: isManageMenusButtonDisabled, 35154 className: "wp-block-navigation-manage-menus-button" 35155 })), (0,external_React_namespaceObject.createElement)(TagName, { 35156 ...blockProps, 35157 "aria-describedby": !isPlaceholder && !isLoading ? accessibleDescriptionId : undefined 35158 }, isLoading && (0,external_React_namespaceObject.createElement)("div", { 35159 className: "wp-block-navigation__loading-indicator-container" 35160 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, { 35161 className: "wp-block-navigation__loading-indicator" 35162 })), !isLoading && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(AccessibleMenuDescription, { 35163 id: accessibleDescriptionId 35164 }), (0,external_React_namespaceObject.createElement)(ResponsiveWrapper, { 35165 id: clientId, 35166 onToggle: setResponsiveMenuVisibility, 35167 hasIcon: hasIcon, 35168 icon: icon, 35169 isOpen: isResponsiveMenuOpen, 35170 isResponsive: isResponsive, 35171 isHiddenByDefault: 'always' === overlayMenu, 35172 overlayBackgroundColor: overlayBackgroundColor, 35173 overlayTextColor: overlayTextColor 35174 }, isEntityAvailable && (0,external_React_namespaceObject.createElement)(NavigationInnerBlocks, { 35175 clientId: clientId, 35176 hasCustomPlaceholder: !!CustomPlaceholder, 35177 templateLock: templateLock, 35178 orientation: orientation 35179 })))))); 35180 } 35181 /* harmony default export */ const navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({ 35182 textColor: 'color' 35183 }, { 35184 backgroundColor: 'color' 35185 }, { 35186 overlayBackgroundColor: 'color' 35187 }, { 35188 overlayTextColor: 'color' 35189 })(Navigation)); 35190 35191 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js 35192 35193 /** 35194 * WordPress dependencies 35195 */ 35196 35197 function navigation_save_save({ 35198 attributes 35199 }) { 35200 if (attributes.ref) { 35201 // Avoid rendering inner blocks when a ref is defined. 35202 // When this id is defined the inner blocks are loaded from the 35203 // `wp_navigation` entity rather than the hard-coded block html. 35204 return; 35205 } 35206 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35207 } 35208 35209 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js 35210 35211 /** 35212 * WordPress dependencies 35213 */ 35214 35215 35216 35217 /** 35218 * Internal dependencies 35219 */ 35220 35221 const TYPOGRAPHY_PRESET_DEPRECATION_MAP = { 35222 fontStyle: 'var:preset|font-style|', 35223 fontWeight: 'var:preset|font-weight|', 35224 textDecoration: 'var:preset|text-decoration|', 35225 textTransform: 'var:preset|text-transform|' 35226 }; 35227 const migrateIdToRef = ({ 35228 navigationMenuId, 35229 ...attributes 35230 }) => { 35231 return { 35232 ...attributes, 35233 ref: navigationMenuId 35234 }; 35235 }; 35236 const deprecated_migrateWithLayout = attributes => { 35237 if (!!attributes.layout) { 35238 return attributes; 35239 } 35240 const { 35241 itemsJustification, 35242 orientation, 35243 ...updatedAttributes 35244 } = attributes; 35245 if (itemsJustification || orientation) { 35246 Object.assign(updatedAttributes, { 35247 layout: { 35248 type: 'flex', 35249 ...(itemsJustification && { 35250 justifyContent: itemsJustification 35251 }), 35252 ...(orientation && { 35253 orientation 35254 }) 35255 } 35256 }); 35257 } 35258 return updatedAttributes; 35259 }; 35260 const navigation_deprecated_v6 = { 35261 attributes: { 35262 navigationMenuId: { 35263 type: 'number' 35264 }, 35265 textColor: { 35266 type: 'string' 35267 }, 35268 customTextColor: { 35269 type: 'string' 35270 }, 35271 rgbTextColor: { 35272 type: 'string' 35273 }, 35274 backgroundColor: { 35275 type: 'string' 35276 }, 35277 customBackgroundColor: { 35278 type: 'string' 35279 }, 35280 rgbBackgroundColor: { 35281 type: 'string' 35282 }, 35283 showSubmenuIcon: { 35284 type: 'boolean', 35285 default: true 35286 }, 35287 openSubmenusOnClick: { 35288 type: 'boolean', 35289 default: false 35290 }, 35291 overlayMenu: { 35292 type: 'string', 35293 default: 'mobile' 35294 }, 35295 __unstableLocation: { 35296 type: 'string' 35297 }, 35298 overlayBackgroundColor: { 35299 type: 'string' 35300 }, 35301 customOverlayBackgroundColor: { 35302 type: 'string' 35303 }, 35304 overlayTextColor: { 35305 type: 'string' 35306 }, 35307 customOverlayTextColor: { 35308 type: 'string' 35309 } 35310 }, 35311 supports: { 35312 align: ['wide', 'full'], 35313 anchor: true, 35314 html: false, 35315 inserter: true, 35316 typography: { 35317 fontSize: true, 35318 lineHeight: true, 35319 __experimentalFontStyle: true, 35320 __experimentalFontWeight: true, 35321 __experimentalTextTransform: true, 35322 __experimentalFontFamily: true, 35323 __experimentalTextDecoration: true, 35324 __experimentalDefaultControls: { 35325 fontSize: true 35326 } 35327 }, 35328 spacing: { 35329 blockGap: true, 35330 units: ['px', 'em', 'rem', 'vh', 'vw'], 35331 __experimentalDefaultControls: { 35332 blockGap: true 35333 } 35334 }, 35335 layout: { 35336 allowSwitching: false, 35337 allowInheriting: false, 35338 default: { 35339 type: 'flex' 35340 } 35341 } 35342 }, 35343 save() { 35344 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35345 }, 35346 isEligible: ({ 35347 navigationMenuId 35348 }) => !!navigationMenuId, 35349 migrate: migrateIdToRef 35350 }; 35351 const navigation_deprecated_v5 = { 35352 attributes: { 35353 navigationMenuId: { 35354 type: 'number' 35355 }, 35356 orientation: { 35357 type: 'string', 35358 default: 'horizontal' 35359 }, 35360 textColor: { 35361 type: 'string' 35362 }, 35363 customTextColor: { 35364 type: 'string' 35365 }, 35366 rgbTextColor: { 35367 type: 'string' 35368 }, 35369 backgroundColor: { 35370 type: 'string' 35371 }, 35372 customBackgroundColor: { 35373 type: 'string' 35374 }, 35375 rgbBackgroundColor: { 35376 type: 'string' 35377 }, 35378 itemsJustification: { 35379 type: 'string' 35380 }, 35381 showSubmenuIcon: { 35382 type: 'boolean', 35383 default: true 35384 }, 35385 openSubmenusOnClick: { 35386 type: 'boolean', 35387 default: false 35388 }, 35389 overlayMenu: { 35390 type: 'string', 35391 default: 'never' 35392 }, 35393 __unstableLocation: { 35394 type: 'string' 35395 }, 35396 overlayBackgroundColor: { 35397 type: 'string' 35398 }, 35399 customOverlayBackgroundColor: { 35400 type: 'string' 35401 }, 35402 overlayTextColor: { 35403 type: 'string' 35404 }, 35405 customOverlayTextColor: { 35406 type: 'string' 35407 } 35408 }, 35409 supports: { 35410 align: ['wide', 'full'], 35411 anchor: true, 35412 html: false, 35413 inserter: true, 35414 typography: { 35415 fontSize: true, 35416 lineHeight: true, 35417 __experimentalFontStyle: true, 35418 __experimentalFontWeight: true, 35419 __experimentalTextTransform: true, 35420 __experimentalFontFamily: true, 35421 __experimentalTextDecoration: true, 35422 __experimentalDefaultControls: { 35423 fontSize: true 35424 } 35425 }, 35426 spacing: { 35427 blockGap: true, 35428 units: ['px', 'em', 'rem', 'vh', 'vw'], 35429 __experimentalDefaultControls: { 35430 blockGap: true 35431 } 35432 } 35433 }, 35434 save() { 35435 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35436 }, 35437 isEligible: ({ 35438 itemsJustification, 35439 orientation 35440 }) => !!itemsJustification || !!orientation, 35441 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout) 35442 }; 35443 const navigation_deprecated_v4 = { 35444 attributes: { 35445 orientation: { 35446 type: 'string', 35447 default: 'horizontal' 35448 }, 35449 textColor: { 35450 type: 'string' 35451 }, 35452 customTextColor: { 35453 type: 'string' 35454 }, 35455 rgbTextColor: { 35456 type: 'string' 35457 }, 35458 backgroundColor: { 35459 type: 'string' 35460 }, 35461 customBackgroundColor: { 35462 type: 'string' 35463 }, 35464 rgbBackgroundColor: { 35465 type: 'string' 35466 }, 35467 itemsJustification: { 35468 type: 'string' 35469 }, 35470 showSubmenuIcon: { 35471 type: 'boolean', 35472 default: true 35473 }, 35474 openSubmenusOnClick: { 35475 type: 'boolean', 35476 default: false 35477 }, 35478 overlayMenu: { 35479 type: 'string', 35480 default: 'never' 35481 }, 35482 __unstableLocation: { 35483 type: 'string' 35484 }, 35485 overlayBackgroundColor: { 35486 type: 'string' 35487 }, 35488 customOverlayBackgroundColor: { 35489 type: 'string' 35490 }, 35491 overlayTextColor: { 35492 type: 'string' 35493 }, 35494 customOverlayTextColor: { 35495 type: 'string' 35496 } 35497 }, 35498 supports: { 35499 align: ['wide', 'full'], 35500 anchor: true, 35501 html: false, 35502 inserter: true, 35503 typography: { 35504 fontSize: true, 35505 lineHeight: true, 35506 __experimentalFontStyle: true, 35507 __experimentalFontWeight: true, 35508 __experimentalTextTransform: true, 35509 __experimentalFontFamily: true, 35510 __experimentalTextDecoration: true 35511 }, 35512 spacing: { 35513 blockGap: true, 35514 units: ['px', 'em', 'rem', 'vh', 'vw'], 35515 __experimentalDefaultControls: { 35516 blockGap: true 35517 } 35518 } 35519 }, 35520 save() { 35521 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35522 }, 35523 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family), 35524 isEligible({ 35525 style 35526 }) { 35527 return style?.typography?.fontFamily; 35528 } 35529 }; 35530 const migrateIsResponsive = function (attributes) { 35531 delete attributes.isResponsive; 35532 return { 35533 ...attributes, 35534 overlayMenu: 'mobile' 35535 }; 35536 }; 35537 const migrateTypographyPresets = function (attributes) { 35538 var _attributes$style$typ; 35539 return { 35540 ...attributes, 35541 style: { 35542 ...attributes.style, 35543 typography: Object.fromEntries(Object.entries((_attributes$style$typ = attributes.style.typography) !== null && _attributes$style$typ !== void 0 ? _attributes$style$typ : {}).map(([key, value]) => { 35544 const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key]; 35545 if (prefix && value.startsWith(prefix)) { 35546 const newValue = value.slice(prefix.length); 35547 if ('textDecoration' === key && 'strikethrough' === newValue) { 35548 return [key, 'line-through']; 35549 } 35550 return [key, newValue]; 35551 } 35552 return [key, value]; 35553 })) 35554 } 35555 }; 35556 }; 35557 const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, 35558 // Remove `isResponsive` attribute. 35559 { 35560 attributes: { 35561 orientation: { 35562 type: 'string', 35563 default: 'horizontal' 35564 }, 35565 textColor: { 35566 type: 'string' 35567 }, 35568 customTextColor: { 35569 type: 'string' 35570 }, 35571 rgbTextColor: { 35572 type: 'string' 35573 }, 35574 backgroundColor: { 35575 type: 'string' 35576 }, 35577 customBackgroundColor: { 35578 type: 'string' 35579 }, 35580 rgbBackgroundColor: { 35581 type: 'string' 35582 }, 35583 itemsJustification: { 35584 type: 'string' 35585 }, 35586 showSubmenuIcon: { 35587 type: 'boolean', 35588 default: true 35589 }, 35590 openSubmenusOnClick: { 35591 type: 'boolean', 35592 default: false 35593 }, 35594 isResponsive: { 35595 type: 'boolean', 35596 default: 'false' 35597 }, 35598 __unstableLocation: { 35599 type: 'string' 35600 }, 35601 overlayBackgroundColor: { 35602 type: 'string' 35603 }, 35604 customOverlayBackgroundColor: { 35605 type: 'string' 35606 }, 35607 overlayTextColor: { 35608 type: 'string' 35609 }, 35610 customOverlayTextColor: { 35611 type: 'string' 35612 } 35613 }, 35614 supports: { 35615 align: ['wide', 'full'], 35616 anchor: true, 35617 html: false, 35618 inserter: true, 35619 typography: { 35620 fontSize: true, 35621 lineHeight: true, 35622 __experimentalFontStyle: true, 35623 __experimentalFontWeight: true, 35624 __experimentalTextTransform: true, 35625 __experimentalFontFamily: true, 35626 __experimentalTextDecoration: true 35627 } 35628 }, 35629 isEligible(attributes) { 35630 return attributes.isResponsive; 35631 }, 35632 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive), 35633 save() { 35634 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35635 } 35636 }, { 35637 attributes: { 35638 orientation: { 35639 type: 'string' 35640 }, 35641 textColor: { 35642 type: 'string' 35643 }, 35644 customTextColor: { 35645 type: 'string' 35646 }, 35647 rgbTextColor: { 35648 type: 'string' 35649 }, 35650 backgroundColor: { 35651 type: 'string' 35652 }, 35653 customBackgroundColor: { 35654 type: 'string' 35655 }, 35656 rgbBackgroundColor: { 35657 type: 'string' 35658 }, 35659 itemsJustification: { 35660 type: 'string' 35661 }, 35662 showSubmenuIcon: { 35663 type: 'boolean', 35664 default: true 35665 } 35666 }, 35667 supports: { 35668 align: ['wide', 'full'], 35669 anchor: true, 35670 html: false, 35671 inserter: true, 35672 fontSize: true, 35673 __experimentalFontStyle: true, 35674 __experimentalFontWeight: true, 35675 __experimentalTextTransform: true, 35676 color: true, 35677 __experimentalFontFamily: true, 35678 __experimentalTextDecoration: true 35679 }, 35680 save() { 35681 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35682 }, 35683 isEligible(attributes) { 35684 if (!attributes.style || !attributes.style.typography) { 35685 return false; 35686 } 35687 for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) { 35688 const attributeValue = attributes.style.typography[styleAttribute]; 35689 if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) { 35690 return true; 35691 } 35692 } 35693 return false; 35694 }, 35695 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets) 35696 }, { 35697 attributes: { 35698 className: { 35699 type: 'string' 35700 }, 35701 textColor: { 35702 type: 'string' 35703 }, 35704 rgbTextColor: { 35705 type: 'string' 35706 }, 35707 backgroundColor: { 35708 type: 'string' 35709 }, 35710 rgbBackgroundColor: { 35711 type: 'string' 35712 }, 35713 fontSize: { 35714 type: 'string' 35715 }, 35716 customFontSize: { 35717 type: 'number' 35718 }, 35719 itemsJustification: { 35720 type: 'string' 35721 }, 35722 showSubmenuIcon: { 35723 type: 'boolean' 35724 } 35725 }, 35726 isEligible(attribute) { 35727 return attribute.rgbTextColor || attribute.rgbBackgroundColor; 35728 }, 35729 supports: { 35730 align: ['wide', 'full'], 35731 anchor: true, 35732 html: false, 35733 inserter: true 35734 }, 35735 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => { 35736 const { 35737 rgbTextColor, 35738 rgbBackgroundColor, 35739 ...restAttributes 35740 } = attributes; 35741 return { 35742 ...restAttributes, 35743 customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor, 35744 customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor 35745 }; 35746 }), 35747 save() { 35748 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 35749 } 35750 }]; 35751 /* harmony default export */ const navigation_deprecated = (navigation_deprecated_deprecated); 35752 35753 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js 35754 /** 35755 * WordPress dependencies 35756 */ 35757 35758 35759 35760 /** 35761 * Internal dependencies 35762 */ 35763 35764 const navigation_metadata = { 35765 $schema: "https://schemas.wp.org/trunk/block.json", 35766 apiVersion: 3, 35767 name: "core/navigation", 35768 title: "Navigation", 35769 category: "theme", 35770 allowedBlocks: ["core/navigation-link", "core/search", "core/social-links", "core/page-list", "core/spacer", "core/home-link", "core/site-title", "core/site-logo", "core/navigation-submenu", "core/loginout", "core/buttons"], 35771 description: "A collection of blocks that allow visitors to get around your site.", 35772 keywords: ["menu", "navigation", "links"], 35773 textdomain: "default", 35774 attributes: { 35775 ref: { 35776 type: "number" 35777 }, 35778 textColor: { 35779 type: "string" 35780 }, 35781 customTextColor: { 35782 type: "string" 35783 }, 35784 rgbTextColor: { 35785 type: "string" 35786 }, 35787 backgroundColor: { 35788 type: "string" 35789 }, 35790 customBackgroundColor: { 35791 type: "string" 35792 }, 35793 rgbBackgroundColor: { 35794 type: "string" 35795 }, 35796 showSubmenuIcon: { 35797 type: "boolean", 35798 "default": true 35799 }, 35800 openSubmenusOnClick: { 35801 type: "boolean", 35802 "default": false 35803 }, 35804 overlayMenu: { 35805 type: "string", 35806 "default": "mobile" 35807 }, 35808 icon: { 35809 type: "string", 35810 "default": "handle" 35811 }, 35812 hasIcon: { 35813 type: "boolean", 35814 "default": true 35815 }, 35816 __unstableLocation: { 35817 type: "string" 35818 }, 35819 overlayBackgroundColor: { 35820 type: "string" 35821 }, 35822 customOverlayBackgroundColor: { 35823 type: "string" 35824 }, 35825 overlayTextColor: { 35826 type: "string" 35827 }, 35828 customOverlayTextColor: { 35829 type: "string" 35830 }, 35831 maxNestingLevel: { 35832 type: "number", 35833 "default": 5 35834 }, 35835 templateLock: { 35836 type: ["string", "boolean"], 35837 "enum": ["all", "insert", "contentOnly", false] 35838 } 35839 }, 35840 providesContext: { 35841 textColor: "textColor", 35842 customTextColor: "customTextColor", 35843 backgroundColor: "backgroundColor", 35844 customBackgroundColor: "customBackgroundColor", 35845 overlayTextColor: "overlayTextColor", 35846 customOverlayTextColor: "customOverlayTextColor", 35847 overlayBackgroundColor: "overlayBackgroundColor", 35848 customOverlayBackgroundColor: "customOverlayBackgroundColor", 35849 fontSize: "fontSize", 35850 customFontSize: "customFontSize", 35851 showSubmenuIcon: "showSubmenuIcon", 35852 openSubmenusOnClick: "openSubmenusOnClick", 35853 style: "style", 35854 maxNestingLevel: "maxNestingLevel" 35855 }, 35856 supports: { 35857 align: ["wide", "full"], 35858 ariaLabel: true, 35859 html: false, 35860 inserter: true, 35861 typography: { 35862 fontSize: true, 35863 lineHeight: true, 35864 __experimentalFontStyle: true, 35865 __experimentalFontWeight: true, 35866 __experimentalTextTransform: true, 35867 __experimentalFontFamily: true, 35868 __experimentalLetterSpacing: true, 35869 __experimentalTextDecoration: true, 35870 __experimentalSkipSerialization: ["textDecoration"], 35871 __experimentalDefaultControls: { 35872 fontSize: true 35873 } 35874 }, 35875 spacing: { 35876 blockGap: true, 35877 units: ["px", "em", "rem", "vh", "vw"], 35878 __experimentalDefaultControls: { 35879 blockGap: true 35880 } 35881 }, 35882 layout: { 35883 allowSwitching: false, 35884 allowInheriting: false, 35885 allowVerticalAlignment: false, 35886 allowSizingOnChildren: true, 35887 "default": { 35888 type: "flex" 35889 } 35890 }, 35891 __experimentalStyle: { 35892 elements: { 35893 link: { 35894 color: { 35895 text: "inherit" 35896 } 35897 } 35898 } 35899 }, 35900 interactivity: true, 35901 renaming: false 35902 }, 35903 editorStyle: "wp-block-navigation-editor", 35904 style: "wp-block-navigation" 35905 }; 35906 35907 35908 35909 const { 35910 name: navigation_name 35911 } = navigation_metadata; 35912 35913 const navigation_settings = { 35914 icon: library_navigation, 35915 example: { 35916 attributes: { 35917 overlayMenu: 'never' 35918 }, 35919 innerBlocks: [{ 35920 name: 'core/navigation-link', 35921 attributes: { 35922 // translators: 'Home' as in a website's home page. 35923 label: (0,external_wp_i18n_namespaceObject.__)('Home'), 35924 url: 'https://make.wordpress.org/' 35925 } 35926 }, { 35927 name: 'core/navigation-link', 35928 attributes: { 35929 // translators: 'About' as in a website's about page. 35930 label: (0,external_wp_i18n_namespaceObject.__)('About'), 35931 url: 'https://make.wordpress.org/' 35932 } 35933 }, { 35934 name: 'core/navigation-link', 35935 attributes: { 35936 // translators: 'Contact' as in a website's contact page. 35937 label: (0,external_wp_i18n_namespaceObject.__)('Contact'), 35938 url: 'https://make.wordpress.org/' 35939 } 35940 }] 35941 }, 35942 edit: navigation_edit, 35943 save: navigation_save_save, 35944 deprecated: navigation_deprecated 35945 }; 35946 const navigation_init = () => initBlock({ 35947 name: navigation_name, 35948 metadata: navigation_metadata, 35949 settings: navigation_settings 35950 }); 35951 35952 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js 35953 35954 /** 35955 * WordPress dependencies 35956 */ 35957 35958 const customLink = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 35959 xmlns: "http://www.w3.org/2000/svg", 35960 viewBox: "0 0 24 24" 35961 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 35962 d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z" 35963 })); 35964 /* harmony default export */ const custom_link = (customLink); 35965 35966 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js 35967 35968 /** 35969 * External dependencies 35970 */ 35971 35972 35973 /** 35974 * WordPress dependencies 35975 */ 35976 35977 35978 35979 35980 35981 35982 35983 35984 35985 35986 35987 35988 35989 35990 /** 35991 * Internal dependencies 35992 */ 35993 35994 35995 35996 const edit_DEFAULT_BLOCK = { 35997 name: 'core/navigation-link' 35998 }; 35999 36000 /** 36001 * A React hook to determine if it's dragging within the target element. 36002 * 36003 * @typedef {import('@wordpress/element').RefObject} RefObject 36004 * 36005 * @param {RefObject<HTMLElement>} elementRef The target elementRef object. 36006 * 36007 * @return {boolean} Is dragging within the target element. 36008 */ 36009 const useIsDraggingWithin = elementRef => { 36010 const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); 36011 (0,external_wp_element_namespaceObject.useEffect)(() => { 36012 const { 36013 ownerDocument 36014 } = elementRef.current; 36015 function handleDragStart(event) { 36016 // Check the first time when the dragging starts. 36017 handleDragEnter(event); 36018 } 36019 36020 // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. 36021 function handleDragEnd() { 36022 setIsDraggingWithin(false); 36023 } 36024 function handleDragEnter(event) { 36025 // Check if the current target is inside the item element. 36026 if (elementRef.current.contains(event.target)) { 36027 setIsDraggingWithin(true); 36028 } else { 36029 setIsDraggingWithin(false); 36030 } 36031 } 36032 36033 // Bind these events to the document to catch all drag events. 36034 // Ideally, we can also use `event.relatedTarget`, but sadly that 36035 // doesn't work in Safari. 36036 ownerDocument.addEventListener('dragstart', handleDragStart); 36037 ownerDocument.addEventListener('dragend', handleDragEnd); 36038 ownerDocument.addEventListener('dragenter', handleDragEnter); 36039 return () => { 36040 ownerDocument.removeEventListener('dragstart', handleDragStart); 36041 ownerDocument.removeEventListener('dragend', handleDragEnd); 36042 ownerDocument.removeEventListener('dragenter', handleDragEnter); 36043 }; 36044 }, []); 36045 return isDraggingWithin; 36046 }; 36047 const useIsInvalidLink = (kind, type, id) => { 36048 const isPostType = kind === 'post-type' || type === 'post' || type === 'page'; 36049 const hasId = Number.isInteger(id); 36050 const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => { 36051 if (!isPostType) { 36052 return null; 36053 } 36054 const { 36055 getEntityRecord 36056 } = select(external_wp_coreData_namespaceObject.store); 36057 return getEntityRecord('postType', type, id)?.status; 36058 }, [isPostType, type, id]); 36059 36060 // Check Navigation Link validity if: 36061 // 1. Link is 'post-type'. 36062 // 2. It has an id. 36063 // 3. It's neither null, nor undefined, as valid items might be either of those while loading. 36064 // If those conditions are met, check if 36065 // 1. The post status is published. 36066 // 2. The Navigation Link item has no label. 36067 // If either of those is true, invalidate. 36068 const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus; 36069 const isDraft = 'draft' === postStatus; 36070 return [isInvalid, isDraft]; 36071 }; 36072 function getMissingText(type) { 36073 let missingText = ''; 36074 switch (type) { 36075 case 'post': 36076 /* translators: label for missing post in navigation link block */ 36077 missingText = (0,external_wp_i18n_namespaceObject.__)('Select post'); 36078 break; 36079 case 'page': 36080 /* translators: label for missing page in navigation link block */ 36081 missingText = (0,external_wp_i18n_namespaceObject.__)('Select page'); 36082 break; 36083 case 'category': 36084 /* translators: label for missing category in navigation link block */ 36085 missingText = (0,external_wp_i18n_namespaceObject.__)('Select category'); 36086 break; 36087 case 'tag': 36088 /* translators: label for missing tag in navigation link block */ 36089 missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag'); 36090 break; 36091 default: 36092 /* translators: label for missing values in navigation link block */ 36093 missingText = (0,external_wp_i18n_namespaceObject.__)('Add link'); 36094 } 36095 return missingText; 36096 } 36097 function NavigationLinkEdit({ 36098 attributes, 36099 isSelected, 36100 setAttributes, 36101 insertBlocksAfter, 36102 mergeBlocks, 36103 onReplace, 36104 context, 36105 clientId 36106 }) { 36107 const { 36108 id, 36109 label, 36110 type, 36111 url, 36112 description, 36113 rel, 36114 title, 36115 kind 36116 } = attributes; 36117 const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id); 36118 const { 36119 maxNestingLevel 36120 } = context; 36121 const { 36122 replaceBlock, 36123 __unstableMarkNextChangeAsNotPersistent 36124 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 36125 const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); 36126 // Use internal state instead of a ref to make sure that the component 36127 // re-renders when the popover's anchor updates. 36128 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 36129 const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); 36130 const isDraggingWithin = useIsDraggingWithin(listItemRef); 36131 const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add label…'); 36132 const ref = (0,external_wp_element_namespaceObject.useRef)(); 36133 36134 // Change the label using inspector causes rich text to change focus on firefox. 36135 // This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text. 36136 const [isLabelFieldFocused, setIsLabelFieldFocused] = (0,external_wp_element_namespaceObject.useState)(false); 36137 const { 36138 innerBlocks, 36139 isAtMaxNesting, 36140 isTopLevelLink, 36141 isParentOfSelectedBlock, 36142 hasChildren 36143 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 36144 const { 36145 getBlocks, 36146 getBlockCount, 36147 getBlockName, 36148 getBlockRootClientId, 36149 hasSelectedInnerBlock, 36150 getBlockParentsByBlockName 36151 } = select(external_wp_blockEditor_namespaceObject.store); 36152 return { 36153 innerBlocks: getBlocks(clientId), 36154 isAtMaxNesting: getBlockParentsByBlockName(clientId, ['core/navigation-link', 'core/navigation-submenu']).length >= maxNestingLevel, 36155 isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation', 36156 isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), 36157 hasChildren: !!getBlockCount(clientId) 36158 }; 36159 }, [clientId]); 36160 36161 /** 36162 * Transform to submenu block. 36163 */ 36164 function transformToSubmenu() { 36165 const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks.length > 0 ? innerBlocks : [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')]); 36166 replaceBlock(clientId, newSubmenu); 36167 } 36168 (0,external_wp_element_namespaceObject.useEffect)(() => { 36169 // Show the LinkControl on mount if the URL is empty 36170 // ( When adding a new menu item) 36171 // This can't be done in the useState call because it conflicts 36172 // with the autofocus behavior of the BlockListBlock component. 36173 if (!url) { 36174 setIsLinkOpen(true); 36175 } 36176 }, [url]); 36177 (0,external_wp_element_namespaceObject.useEffect)(() => { 36178 // If block has inner blocks, transform to Submenu. 36179 if (hasChildren) { 36180 // This side-effect should not create an undo level as those should 36181 // only be created via user interactions. 36182 __unstableMarkNextChangeAsNotPersistent(); 36183 transformToSubmenu(); 36184 } 36185 }, [hasChildren]); 36186 36187 /** 36188 * The hook shouldn't be necessary but due to a focus loss happening 36189 * when selecting a suggestion in the link popover, we force close on block unselection. 36190 */ 36191 (0,external_wp_element_namespaceObject.useEffect)(() => { 36192 if (!isSelected) { 36193 setIsLinkOpen(false); 36194 } 36195 }, [isSelected]); 36196 36197 // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. 36198 (0,external_wp_element_namespaceObject.useEffect)(() => { 36199 if (isLinkOpen && url) { 36200 // Does this look like a URL and have something TLD-ish? 36201 if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 36202 // Focus and select the label text. 36203 selectLabelText(); 36204 } else { 36205 // Focus it (but do not select). 36206 (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true); 36207 } 36208 } 36209 }, [url]); 36210 36211 /** 36212 * Focus the Link label text and select it. 36213 */ 36214 function selectLabelText() { 36215 ref.current.focus(); 36216 const { 36217 ownerDocument 36218 } = ref.current; 36219 const { 36220 defaultView 36221 } = ownerDocument; 36222 const selection = defaultView.getSelection(); 36223 const range = ownerDocument.createRange(); 36224 // Get the range of the current ref contents so we can add this range to the selection. 36225 range.selectNodeContents(ref.current); 36226 selection.removeAllRanges(); 36227 selection.addRange(range); 36228 } 36229 36230 /** 36231 * Removes the current link if set. 36232 */ 36233 function removeLink() { 36234 // Reset all attributes that comprise the link. 36235 // It is critical that all attributes are reset 36236 // to their default values otherwise this may 36237 // in advertently trigger side effects because 36238 // the values will have "changed". 36239 setAttributes({ 36240 url: undefined, 36241 label: undefined, 36242 id: undefined, 36243 kind: undefined, 36244 type: undefined, 36245 opensInNewTab: false 36246 }); 36247 36248 // Close the link editing UI. 36249 setIsLinkOpen(false); 36250 } 36251 const { 36252 textColor, 36253 customTextColor, 36254 backgroundColor, 36255 customBackgroundColor 36256 } = getColors(context, !isTopLevelLink); 36257 function onKeyDown(event) { 36258 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || (!url || isDraft || isInvalid) && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { 36259 event.preventDefault(); 36260 setIsLinkOpen(true); 36261 } 36262 } 36263 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 36264 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), 36265 className: classnames_default()('wp-block-navigation-item', { 36266 'is-editing': isSelected || isParentOfSelectedBlock, 36267 'is-dragging-within': isDraggingWithin, 36268 'has-link': !!url, 36269 'has-child': hasChildren, 36270 'has-text-color': !!textColor || !!customTextColor, 36271 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 36272 'has-background': !!backgroundColor || customBackgroundColor, 36273 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor 36274 }), 36275 style: { 36276 color: !textColor && customTextColor, 36277 backgroundColor: !backgroundColor && customBackgroundColor 36278 }, 36279 onKeyDown 36280 }); 36281 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 36282 ...blockProps, 36283 className: 'remove-outline' // Remove the outline from the inner blocks container. 36284 }, { 36285 defaultBlock: edit_DEFAULT_BLOCK, 36286 directInsert: true, 36287 renderAppender: false 36288 }); 36289 if (!url || isInvalid || isDraft) { 36290 blockProps.onClick = () => setIsLinkOpen(true); 36291 } 36292 const classes = classnames_default()('wp-block-navigation-item__content', { 36293 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft 36294 }); 36295 const missingText = getMissingText(type); 36296 /* translators: Whether the navigation link is Invalid or a Draft. */ 36297 const placeholderText = `($isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`; 36298 const tooltipText = isInvalid || isDraft ? (0,external_wp_i18n_namespaceObject.__)('This item has been deleted, or is a draft') : (0,external_wp_i18n_namespaceObject.__)('This item is missing a link'); 36299 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 36300 name: "link", 36301 icon: library_link, 36302 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 36303 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 36304 onClick: () => setIsLinkOpen(true) 36305 }), !isAtMaxNesting && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 36306 name: "submenu", 36307 icon: add_submenu, 36308 title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'), 36309 onClick: transformToSubmenu 36310 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 36311 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 36312 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 36313 __nextHasNoMarginBottom: true, 36314 value: label ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) : '', 36315 onChange: labelValue => { 36316 setAttributes({ 36317 label: labelValue 36318 }); 36319 }, 36320 label: (0,external_wp_i18n_namespaceObject.__)('Label'), 36321 autoComplete: "off", 36322 onFocus: () => setIsLabelFieldFocused(true), 36323 onBlur: () => setIsLabelFieldFocused(false) 36324 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 36325 __nextHasNoMarginBottom: true, 36326 value: url ? (0,external_wp_url_namespaceObject.safeDecodeURI)(url) : '', 36327 onChange: urlValue => { 36328 updateAttributes({ 36329 url: urlValue 36330 }, setAttributes, attributes); 36331 }, 36332 label: (0,external_wp_i18n_namespaceObject.__)('URL'), 36333 autoComplete: "off" 36334 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 36335 __nextHasNoMarginBottom: true, 36336 value: description || '', 36337 onChange: descriptionValue => { 36338 setAttributes({ 36339 description: descriptionValue 36340 }); 36341 }, 36342 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 36343 help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') 36344 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 36345 __nextHasNoMarginBottom: true, 36346 value: title || '', 36347 onChange: titleValue => { 36348 setAttributes({ 36349 title: titleValue 36350 }); 36351 }, 36352 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 36353 autoComplete: "off", 36354 help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') 36355 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 36356 __nextHasNoMarginBottom: true, 36357 value: rel || '', 36358 onChange: relValue => { 36359 setAttributes({ 36360 rel: relValue 36361 }); 36362 }, 36363 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 36364 autoComplete: "off", 36365 help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') 36366 }))), (0,external_React_namespaceObject.createElement)("div", { 36367 ...blockProps 36368 }, (0,external_React_namespaceObject.createElement)("a", { 36369 className: classes 36370 }, !url ? (0,external_React_namespaceObject.createElement)("div", { 36371 className: "wp-block-navigation-link__placeholder-text" 36372 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, { 36373 text: tooltipText 36374 }, (0,external_React_namespaceObject.createElement)("span", null, missingText))) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !isInvalid && !isDraft && !isLabelFieldFocused && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 36375 ref: ref, 36376 identifier: "label", 36377 className: "wp-block-navigation-item__label", 36378 value: label, 36379 onChange: labelValue => setAttributes({ 36380 label: labelValue 36381 }), 36382 onMerge: mergeBlocks, 36383 onReplace: onReplace, 36384 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')), 36385 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), 36386 placeholder: itemLabelPlaceholder, 36387 withoutInteractiveFormatting: true, 36388 allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'], 36389 onClick: () => { 36390 if (!url) { 36391 setIsLinkOpen(true); 36392 } 36393 } 36394 }), description && (0,external_React_namespaceObject.createElement)("span", { 36395 className: "wp-block-navigation-item__description" 36396 }, description)), (isInvalid || isDraft || isLabelFieldFocused) && (0,external_React_namespaceObject.createElement)("div", { 36397 className: "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label" 36398 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, { 36399 text: tooltipText 36400 }, (0,external_React_namespaceObject.createElement)("span", { 36401 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text') 36402 }, 36403 // Some attributes are stored in an escaped form. It's a legacy issue. 36404 // Ideally they would be stored in a raw, unescaped form. 36405 // Unescape is used here to "recover" the escaped characters 36406 // so they display without encoding. 36407 // See `updateAttributes` for more details. 36408 `${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label)} $isInvalid || isDraft ? placeholderText : ''}`.trim())))), isLinkOpen && (0,external_React_namespaceObject.createElement)(LinkUI, { 36409 clientId: clientId, 36410 link: attributes, 36411 onClose: () => { 36412 // If there is no link then remove the auto-inserted block. 36413 // This avoids empty blocks which can provided a poor UX. 36414 if (!url) { 36415 // Need to handle refocusing the Nav block or the inserter? 36416 onReplace([]); 36417 } 36418 }, 36419 anchor: popoverAnchor, 36420 onRemove: removeLink, 36421 onChange: updatedValue => { 36422 updateAttributes(updatedValue, setAttributes, attributes); 36423 } 36424 })), (0,external_React_namespaceObject.createElement)("div", { 36425 ...innerBlocksProps 36426 }))); 36427 } 36428 36429 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js 36430 36431 /** 36432 * WordPress dependencies 36433 */ 36434 36435 function navigation_link_save_save() { 36436 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 36437 } 36438 36439 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js 36440 36441 /** 36442 * WordPress dependencies 36443 */ 36444 36445 const page = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 36446 xmlns: "http://www.w3.org/2000/svg", 36447 viewBox: "0 0 24 24" 36448 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 36449 d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" 36450 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 36451 d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" 36452 })); 36453 /* harmony default export */ const library_page = (page); 36454 36455 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js 36456 36457 /** 36458 * WordPress dependencies 36459 */ 36460 36461 const tag = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 36462 xmlns: "http://www.w3.org/2000/svg", 36463 viewBox: "0 0 24 24" 36464 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 36465 d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" 36466 })); 36467 /* harmony default export */ const library_tag = (tag); 36468 36469 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js 36470 36471 /** 36472 * WordPress dependencies 36473 */ 36474 36475 const customPostType = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 36476 xmlns: "http://www.w3.org/2000/svg", 36477 viewBox: "0 0 24 24" 36478 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 36479 d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z" 36480 })); 36481 /* harmony default export */ const custom_post_type = (customPostType); 36482 36483 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js 36484 /** 36485 * WordPress dependencies 36486 */ 36487 36488 function getIcon(variationName) { 36489 switch (variationName) { 36490 case 'post': 36491 return post_list; 36492 case 'page': 36493 return library_page; 36494 case 'tag': 36495 return library_tag; 36496 case 'category': 36497 return library_category; 36498 default: 36499 return custom_post_type; 36500 } 36501 } 36502 function enhanceNavigationLinkVariations(settings, name) { 36503 if (name !== 'core/navigation-link') { 36504 return settings; 36505 } 36506 36507 // Otherwise decorate server passed variations with an icon and isActive function. 36508 if (settings.variations) { 36509 const isActive = (blockAttributes, variationAttributes) => { 36510 return blockAttributes.type === variationAttributes.type; 36511 }; 36512 const variations = settings.variations.map(variation => { 36513 return { 36514 ...variation, 36515 ...(!variation.icon && { 36516 icon: getIcon(variation.name) 36517 }), 36518 ...(!variation.isActive && { 36519 isActive 36520 }) 36521 }; 36522 }); 36523 return { 36524 ...settings, 36525 variations 36526 }; 36527 } 36528 return settings; 36529 } 36530 36531 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js 36532 /** 36533 * WordPress dependencies 36534 */ 36535 36536 const navigation_link_transforms_transforms = { 36537 from: [{ 36538 type: 'block', 36539 blocks: ['core/site-logo'], 36540 transform: () => { 36541 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36542 } 36543 }, { 36544 type: 'block', 36545 blocks: ['core/spacer'], 36546 transform: () => { 36547 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36548 } 36549 }, { 36550 type: 'block', 36551 blocks: ['core/home-link'], 36552 transform: () => { 36553 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36554 } 36555 }, { 36556 type: 'block', 36557 blocks: ['core/social-links'], 36558 transform: () => { 36559 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36560 } 36561 }, { 36562 type: 'block', 36563 blocks: ['core/search'], 36564 transform: () => { 36565 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36566 } 36567 }, { 36568 type: 'block', 36569 blocks: ['core/page-list'], 36570 transform: () => { 36571 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36572 } 36573 }, { 36574 type: 'block', 36575 blocks: ['core/buttons'], 36576 transform: () => { 36577 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 36578 } 36579 }], 36580 to: [{ 36581 type: 'block', 36582 blocks: ['core/navigation-submenu'], 36583 transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks) 36584 }, { 36585 type: 'block', 36586 blocks: ['core/spacer'], 36587 transform: () => { 36588 return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); 36589 } 36590 }, { 36591 type: 'block', 36592 blocks: ['core/site-logo'], 36593 transform: () => { 36594 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); 36595 } 36596 }, { 36597 type: 'block', 36598 blocks: ['core/home-link'], 36599 transform: () => { 36600 return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); 36601 } 36602 }, { 36603 type: 'block', 36604 blocks: ['core/social-links'], 36605 transform: () => { 36606 return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); 36607 } 36608 }, { 36609 type: 'block', 36610 blocks: ['core/search'], 36611 transform: () => { 36612 return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', { 36613 showLabel: false, 36614 buttonUseIcon: true, 36615 buttonPosition: 'button-inside' 36616 }); 36617 } 36618 }, { 36619 type: 'block', 36620 blocks: ['core/page-list'], 36621 transform: () => { 36622 return (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list'); 36623 } 36624 }, { 36625 type: 'block', 36626 blocks: ['core/buttons'], 36627 transform: ({ 36628 label, 36629 url, 36630 rel, 36631 title, 36632 opensInNewTab 36633 }) => { 36634 return (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/button', { 36635 text: label, 36636 url, 36637 rel, 36638 title, 36639 linkTarget: opensInNewTab ? '_blank' : undefined 36640 })]); 36641 } 36642 }] 36643 }; 36644 /* harmony default export */ const navigation_link_transforms = (navigation_link_transforms_transforms); 36645 36646 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js 36647 36648 /** 36649 * WordPress dependencies 36650 */ 36651 36652 36653 36654 36655 36656 /** 36657 * Internal dependencies 36658 */ 36659 36660 const navigation_link_metadata = { 36661 $schema: "https://schemas.wp.org/trunk/block.json", 36662 apiVersion: 3, 36663 name: "core/navigation-link", 36664 title: "Custom Link", 36665 category: "design", 36666 parent: ["core/navigation"], 36667 allowedBlocks: ["core/navigation-link", "core/navigation-submenu", "core/page-list"], 36668 description: "Add a page, link, or another item to your navigation.", 36669 textdomain: "default", 36670 attributes: { 36671 label: { 36672 type: "string" 36673 }, 36674 type: { 36675 type: "string" 36676 }, 36677 description: { 36678 type: "string" 36679 }, 36680 rel: { 36681 type: "string" 36682 }, 36683 id: { 36684 type: "number" 36685 }, 36686 opensInNewTab: { 36687 type: "boolean", 36688 "default": false 36689 }, 36690 url: { 36691 type: "string" 36692 }, 36693 title: { 36694 type: "string" 36695 }, 36696 kind: { 36697 type: "string" 36698 }, 36699 isTopLevelLink: { 36700 type: "boolean" 36701 } 36702 }, 36703 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"], 36704 supports: { 36705 reusable: false, 36706 html: false, 36707 __experimentalSlashInserter: true, 36708 typography: { 36709 fontSize: true, 36710 lineHeight: true, 36711 __experimentalFontFamily: true, 36712 __experimentalFontWeight: true, 36713 __experimentalFontStyle: true, 36714 __experimentalTextTransform: true, 36715 __experimentalTextDecoration: true, 36716 __experimentalLetterSpacing: true, 36717 __experimentalDefaultControls: { 36718 fontSize: true 36719 } 36720 }, 36721 renaming: false, 36722 interactivity: { 36723 clientNavigation: true 36724 } 36725 }, 36726 editorStyle: "wp-block-navigation-link-editor", 36727 style: "wp-block-navigation-link" 36728 }; 36729 36730 36731 36732 36733 const { 36734 name: navigation_link_name 36735 } = navigation_link_metadata; 36736 36737 const navigation_link_settings = { 36738 icon: custom_link, 36739 __experimentalLabel: ({ 36740 label 36741 }) => label, 36742 merge(leftAttributes, { 36743 label: rightLabel = '' 36744 }) { 36745 return { 36746 ...leftAttributes, 36747 label: leftAttributes.label + rightLabel 36748 }; 36749 }, 36750 edit: NavigationLinkEdit, 36751 save: navigation_link_save_save, 36752 example: { 36753 attributes: { 36754 label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'), 36755 url: 'https://example.com' 36756 } 36757 }, 36758 deprecated: [{ 36759 isEligible(attributes) { 36760 return attributes.nofollow; 36761 }, 36762 attributes: { 36763 label: { 36764 type: 'string' 36765 }, 36766 type: { 36767 type: 'string' 36768 }, 36769 nofollow: { 36770 type: 'boolean' 36771 }, 36772 description: { 36773 type: 'string' 36774 }, 36775 id: { 36776 type: 'number' 36777 }, 36778 opensInNewTab: { 36779 type: 'boolean', 36780 default: false 36781 }, 36782 url: { 36783 type: 'string' 36784 } 36785 }, 36786 migrate({ 36787 nofollow, 36788 ...rest 36789 }) { 36790 return { 36791 rel: nofollow ? 'nofollow' : '', 36792 ...rest 36793 }; 36794 }, 36795 save() { 36796 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 36797 } 36798 }], 36799 transforms: navigation_link_transforms 36800 }; 36801 const navigation_link_init = () => { 36802 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations); 36803 return initBlock({ 36804 name: navigation_link_name, 36805 metadata: navigation_link_metadata, 36806 settings: navigation_link_settings 36807 }); 36808 }; 36809 36810 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js 36811 36812 /** 36813 * WordPress dependencies 36814 */ 36815 36816 const removeSubmenu = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 36817 xmlns: "http://www.w3.org/2000/svg", 36818 viewBox: "0 0 24 24" 36819 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 36820 fillRule: "evenodd", 36821 clipRule: "evenodd", 36822 d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z" 36823 })); 36824 /* harmony default export */ const remove_submenu = (removeSubmenu); 36825 36826 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js 36827 36828 /** 36829 * WordPress dependencies 36830 */ 36831 36832 const ItemSubmenuIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 36833 xmlns: "http://www.w3.org/2000/svg", 36834 width: "12", 36835 height: "12", 36836 viewBox: "0 0 12 12", 36837 fill: "none" 36838 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 36839 d: "M1.50002 4L6.00002 8L10.5 4", 36840 strokeWidth: "1.5" 36841 })); 36842 36843 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js 36844 36845 /** 36846 * External dependencies 36847 */ 36848 36849 36850 /** 36851 * WordPress dependencies 36852 */ 36853 36854 36855 36856 36857 36858 36859 36860 36861 36862 36863 36864 36865 36866 36867 /** 36868 * Internal dependencies 36869 */ 36870 36871 36872 36873 36874 const ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list']; 36875 const navigation_submenu_edit_DEFAULT_BLOCK = { 36876 name: 'core/navigation-link' 36877 }; 36878 36879 /** 36880 * A React hook to determine if it's dragging within the target element. 36881 * 36882 * @typedef {import('@wordpress/element').RefObject} RefObject 36883 * 36884 * @param {RefObject<HTMLElement>} elementRef The target elementRef object. 36885 * 36886 * @return {boolean} Is dragging within the target element. 36887 */ 36888 const edit_useIsDraggingWithin = elementRef => { 36889 const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); 36890 (0,external_wp_element_namespaceObject.useEffect)(() => { 36891 const { 36892 ownerDocument 36893 } = elementRef.current; 36894 function handleDragStart(event) { 36895 // Check the first time when the dragging starts. 36896 handleDragEnter(event); 36897 } 36898 36899 // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. 36900 function handleDragEnd() { 36901 setIsDraggingWithin(false); 36902 } 36903 function handleDragEnter(event) { 36904 // Check if the current target is inside the item element. 36905 if (elementRef.current.contains(event.target)) { 36906 setIsDraggingWithin(true); 36907 } else { 36908 setIsDraggingWithin(false); 36909 } 36910 } 36911 36912 // Bind these events to the document to catch all drag events. 36913 // Ideally, we can also use `event.relatedTarget`, but sadly that 36914 // doesn't work in Safari. 36915 ownerDocument.addEventListener('dragstart', handleDragStart); 36916 ownerDocument.addEventListener('dragend', handleDragEnd); 36917 ownerDocument.addEventListener('dragenter', handleDragEnter); 36918 return () => { 36919 ownerDocument.removeEventListener('dragstart', handleDragStart); 36920 ownerDocument.removeEventListener('dragend', handleDragEnd); 36921 ownerDocument.removeEventListener('dragenter', handleDragEnter); 36922 }; 36923 }, []); 36924 return isDraggingWithin; 36925 }; 36926 36927 /** 36928 * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind 36929 */ 36930 36931 /** 36932 * Navigation Link Block Attributes 36933 * 36934 * @typedef {Object} WPNavigationLinkBlockAttributes 36935 * 36936 * @property {string} [label] Link text. 36937 * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. 36938 * @property {string} [type] The type such as post, page, tag, category and other custom types. 36939 * @property {string} [rel] The relationship of the linked URL. 36940 * @property {number} [id] A post or term id. 36941 * @property {boolean} [opensInNewTab] Sets link target to _blank when true. 36942 * @property {string} [url] Link href. 36943 * @property {string} [title] Link title attribute. 36944 */ 36945 36946 function NavigationSubmenuEdit({ 36947 attributes, 36948 isSelected, 36949 setAttributes, 36950 mergeBlocks, 36951 onReplace, 36952 context, 36953 clientId 36954 }) { 36955 const { 36956 label, 36957 type, 36958 url, 36959 description, 36960 rel, 36961 title 36962 } = attributes; 36963 const { 36964 showSubmenuIcon, 36965 maxNestingLevel, 36966 openSubmenusOnClick 36967 } = context; 36968 const { 36969 __unstableMarkNextChangeAsNotPersistent, 36970 replaceBlock 36971 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 36972 const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); 36973 // Use internal state instead of a ref to make sure that the component 36974 // re-renders when the popover's anchor updates. 36975 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 36976 const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); 36977 const isDraggingWithin = edit_useIsDraggingWithin(listItemRef); 36978 const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…'); 36979 const ref = (0,external_wp_element_namespaceObject.useRef)(); 36980 const pagesPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('pages'); 36981 const postsPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('posts'); 36982 const { 36983 parentCount, 36984 isParentOfSelectedBlock, 36985 isImmediateParentOfSelectedBlock, 36986 hasChildren, 36987 selectedBlockHasChildren, 36988 onlyDescendantIsEmptyLink 36989 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 36990 const { 36991 hasSelectedInnerBlock, 36992 getSelectedBlockClientId, 36993 getBlockParentsByBlockName, 36994 getBlock, 36995 getBlockCount, 36996 getBlockOrder 36997 } = select(external_wp_blockEditor_namespaceObject.store); 36998 let _onlyDescendantIsEmptyLink; 36999 const selectedBlockId = getSelectedBlockClientId(); 37000 const selectedBlockChildren = getBlockOrder(selectedBlockId); 37001 37002 // Check for a single descendant in the submenu. If that block 37003 // is a link block in a "placeholder" state with no label then 37004 // we can consider as an "empty" link. 37005 if (selectedBlockChildren?.length === 1) { 37006 const singleBlock = getBlock(selectedBlockChildren[0]); 37007 _onlyDescendantIsEmptyLink = singleBlock?.name === 'core/navigation-link' && !singleBlock?.attributes?.label; 37008 } 37009 return { 37010 parentCount: getBlockParentsByBlockName(clientId, 'core/navigation-submenu').length, 37011 isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), 37012 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), 37013 hasChildren: !!getBlockCount(clientId), 37014 selectedBlockHasChildren: !!selectedBlockChildren?.length, 37015 onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink 37016 }; 37017 }, [clientId]); 37018 const prevHasChildren = (0,external_wp_compose_namespaceObject.usePrevious)(hasChildren); 37019 37020 // Show the LinkControl on mount if the URL is empty 37021 // ( When adding a new menu item) 37022 // This can't be done in the useState call because it conflicts 37023 // with the autofocus behavior of the BlockListBlock component. 37024 (0,external_wp_element_namespaceObject.useEffect)(() => { 37025 if (!openSubmenusOnClick && !url) { 37026 setIsLinkOpen(true); 37027 } 37028 }, []); 37029 37030 /** 37031 * The hook shouldn't be necessary but due to a focus loss happening 37032 * when selecting a suggestion in the link popover, we force close on block unselection. 37033 */ 37034 (0,external_wp_element_namespaceObject.useEffect)(() => { 37035 if (!isSelected) { 37036 setIsLinkOpen(false); 37037 } 37038 }, [isSelected]); 37039 37040 // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. 37041 (0,external_wp_element_namespaceObject.useEffect)(() => { 37042 if (isLinkOpen && url) { 37043 // Does this look like a URL and have something TLD-ish? 37044 if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 37045 // Focus and select the label text. 37046 selectLabelText(); 37047 } else { 37048 // Focus it (but do not select). 37049 (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true); 37050 } 37051 } 37052 }, [url]); 37053 37054 /** 37055 * Focus the Link label text and select it. 37056 */ 37057 function selectLabelText() { 37058 ref.current.focus(); 37059 const { 37060 ownerDocument 37061 } = ref.current; 37062 const { 37063 defaultView 37064 } = ownerDocument; 37065 const selection = defaultView.getSelection(); 37066 const range = ownerDocument.createRange(); 37067 // Get the range of the current ref contents so we can add this range to the selection. 37068 range.selectNodeContents(ref.current); 37069 selection.removeAllRanges(); 37070 selection.addRange(range); 37071 } 37072 let userCanCreate = false; 37073 if (!type || type === 'page') { 37074 userCanCreate = pagesPermissions.canCreate; 37075 } else if (type === 'post') { 37076 userCanCreate = postsPermissions.canCreate; 37077 } 37078 const { 37079 textColor, 37080 customTextColor, 37081 backgroundColor, 37082 customBackgroundColor 37083 } = getColors(context, parentCount > 0); 37084 function onKeyDown(event) { 37085 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { 37086 event.preventDefault(); 37087 setIsLinkOpen(true); 37088 } 37089 } 37090 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 37091 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), 37092 className: classnames_default()('wp-block-navigation-item', { 37093 'is-editing': isSelected || isParentOfSelectedBlock, 37094 'is-dragging-within': isDraggingWithin, 37095 'has-link': !!url, 37096 'has-child': hasChildren, 37097 'has-text-color': !!textColor || !!customTextColor, 37098 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 37099 'has-background': !!backgroundColor || customBackgroundColor, 37100 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor, 37101 'open-on-click': openSubmenusOnClick 37102 }), 37103 style: { 37104 color: !textColor && customTextColor, 37105 backgroundColor: !backgroundColor && customBackgroundColor 37106 }, 37107 onKeyDown 37108 }); 37109 37110 // Always use overlay colors for submenus. 37111 const innerBlocksColors = getColors(context, true); 37112 const allowedBlocks = parentCount >= maxNestingLevel ? ALLOWED_BLOCKS.filter(blockName => blockName !== 'core/navigation-submenu') : ALLOWED_BLOCKS; 37113 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 37114 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(navigationChildBlockProps, { 37115 allowedBlocks, 37116 defaultBlock: navigation_submenu_edit_DEFAULT_BLOCK, 37117 directInsert: true, 37118 // Ensure block toolbar is not too far removed from item 37119 // being edited. 37120 // see: https://github.com/WordPress/gutenberg/pull/34615. 37121 __experimentalCaptureToolbars: true, 37122 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || 37123 // Show the appender while dragging to allow inserting element between item and the appender. 37124 hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false 37125 }); 37126 const ParentElement = openSubmenusOnClick ? 'button' : 'a'; 37127 function transformToLink() { 37128 const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes); 37129 replaceBlock(clientId, newLinkBlock); 37130 } 37131 (0,external_wp_element_namespaceObject.useEffect)(() => { 37132 // If block becomes empty, transform to Navigation Link. 37133 if (!hasChildren && prevHasChildren) { 37134 // This side-effect should not create an undo level as those should 37135 // only be created via user interactions. 37136 __unstableMarkNextChangeAsNotPersistent(); 37137 transformToLink(); 37138 } 37139 }, [hasChildren, prevHasChildren]); 37140 const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink; 37141 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 37142 name: "link", 37143 icon: library_link, 37144 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 37145 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 37146 onClick: () => setIsLinkOpen(true) 37147 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 37148 name: "revert", 37149 icon: remove_submenu, 37150 title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'), 37151 onClick: transformToLink, 37152 className: "wp-block-navigation__submenu__revert", 37153 isDisabled: !canConvertToLink 37154 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 37155 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 37156 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 37157 __nextHasNoMarginBottom: true, 37158 value: label || '', 37159 onChange: labelValue => { 37160 setAttributes({ 37161 label: labelValue 37162 }); 37163 }, 37164 label: (0,external_wp_i18n_namespaceObject.__)('Label'), 37165 autoComplete: "off" 37166 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 37167 __nextHasNoMarginBottom: true, 37168 value: url || '', 37169 onChange: urlValue => { 37170 setAttributes({ 37171 url: urlValue 37172 }); 37173 }, 37174 label: (0,external_wp_i18n_namespaceObject.__)('URL'), 37175 autoComplete: "off" 37176 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, { 37177 __nextHasNoMarginBottom: true, 37178 value: description || '', 37179 onChange: descriptionValue => { 37180 setAttributes({ 37181 description: descriptionValue 37182 }); 37183 }, 37184 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 37185 help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') 37186 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 37187 __nextHasNoMarginBottom: true, 37188 value: title || '', 37189 onChange: titleValue => { 37190 setAttributes({ 37191 title: titleValue 37192 }); 37193 }, 37194 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 37195 autoComplete: "off", 37196 help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') 37197 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 37198 __nextHasNoMarginBottom: true, 37199 value: rel || '', 37200 onChange: relValue => { 37201 setAttributes({ 37202 rel: relValue 37203 }); 37204 }, 37205 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 37206 autoComplete: "off", 37207 help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') 37208 }))), (0,external_React_namespaceObject.createElement)("div", { 37209 ...blockProps 37210 }, (0,external_React_namespaceObject.createElement)(ParentElement, { 37211 className: "wp-block-navigation-item__content" 37212 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 37213 ref: ref, 37214 identifier: "label", 37215 className: "wp-block-navigation-item__label", 37216 value: label, 37217 onChange: labelValue => setAttributes({ 37218 label: labelValue 37219 }), 37220 onMerge: mergeBlocks, 37221 onReplace: onReplace, 37222 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), 37223 placeholder: itemLabelPlaceholder, 37224 withoutInteractiveFormatting: true, 37225 allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'], 37226 onClick: () => { 37227 if (!openSubmenusOnClick && !url) { 37228 setIsLinkOpen(true); 37229 } 37230 } 37231 }), !openSubmenusOnClick && isLinkOpen && (0,external_React_namespaceObject.createElement)(LinkUI, { 37232 clientId: clientId, 37233 link: attributes, 37234 onClose: () => setIsLinkOpen(false), 37235 anchor: popoverAnchor, 37236 hasCreateSuggestion: userCanCreate, 37237 onRemove: () => { 37238 setAttributes({ 37239 url: '' 37240 }); 37241 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); 37242 }, 37243 onChange: updatedValue => { 37244 updateAttributes(updatedValue, setAttributes, attributes); 37245 } 37246 })), (showSubmenuIcon || openSubmenusOnClick) && (0,external_React_namespaceObject.createElement)("span", { 37247 className: "wp-block-navigation__submenu-icon" 37248 }, (0,external_React_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_React_namespaceObject.createElement)("div", { 37249 ...innerBlocksProps 37250 }))); 37251 } 37252 37253 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js 37254 37255 /** 37256 * WordPress dependencies 37257 */ 37258 37259 function navigation_submenu_save_save() { 37260 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 37261 } 37262 37263 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js 37264 /** 37265 * WordPress dependencies 37266 */ 37267 37268 const navigation_submenu_transforms_transforms = { 37269 to: [{ 37270 type: 'block', 37271 blocks: ['core/navigation-link'], 37272 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37273 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes) 37274 }, { 37275 type: 'block', 37276 blocks: ['core/spacer'], 37277 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37278 transform: () => { 37279 return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); 37280 } 37281 }, { 37282 type: 'block', 37283 blocks: ['core/site-logo'], 37284 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37285 transform: () => { 37286 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); 37287 } 37288 }, { 37289 type: 'block', 37290 blocks: ['core/home-link'], 37291 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37292 transform: () => { 37293 return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); 37294 } 37295 }, { 37296 type: 'block', 37297 blocks: ['core/social-links'], 37298 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37299 transform: () => { 37300 return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); 37301 } 37302 }, { 37303 type: 'block', 37304 blocks: ['core/search'], 37305 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 37306 transform: () => { 37307 return (0,external_wp_blocks_namespaceObject.createBlock)('core/search'); 37308 } 37309 }] 37310 }; 37311 /* harmony default export */ const navigation_submenu_transforms = (navigation_submenu_transforms_transforms); 37312 37313 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js 37314 /** 37315 * WordPress dependencies 37316 */ 37317 37318 37319 /** 37320 * Internal dependencies 37321 */ 37322 37323 const navigation_submenu_metadata = { 37324 $schema: "https://schemas.wp.org/trunk/block.json", 37325 apiVersion: 3, 37326 name: "core/navigation-submenu", 37327 title: "Submenu", 37328 category: "design", 37329 parent: ["core/navigation"], 37330 description: "Add a submenu to your navigation.", 37331 textdomain: "default", 37332 attributes: { 37333 label: { 37334 type: "string" 37335 }, 37336 type: { 37337 type: "string" 37338 }, 37339 description: { 37340 type: "string" 37341 }, 37342 rel: { 37343 type: "string" 37344 }, 37345 id: { 37346 type: "number" 37347 }, 37348 opensInNewTab: { 37349 type: "boolean", 37350 "default": false 37351 }, 37352 url: { 37353 type: "string" 37354 }, 37355 title: { 37356 type: "string" 37357 }, 37358 kind: { 37359 type: "string" 37360 }, 37361 isTopLevelItem: { 37362 type: "boolean" 37363 } 37364 }, 37365 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"], 37366 supports: { 37367 reusable: false, 37368 html: false, 37369 interactivity: { 37370 clientNavigation: true 37371 } 37372 }, 37373 editorStyle: "wp-block-navigation-submenu-editor", 37374 style: "wp-block-navigation-submenu" 37375 }; 37376 37377 37378 37379 const { 37380 name: navigation_submenu_name 37381 } = navigation_submenu_metadata; 37382 37383 const navigation_submenu_settings = { 37384 icon: ({ 37385 context 37386 }) => { 37387 if (context === 'list-view') { 37388 return library_page; 37389 } 37390 return add_submenu; 37391 }, 37392 __experimentalLabel(attributes, { 37393 context 37394 }) { 37395 const { 37396 label 37397 } = attributes; 37398 const customName = attributes?.metadata?.name; 37399 37400 // In the list view, use the block's menu label as the label. 37401 // If the menu label is empty, fall back to the default label. 37402 if (context === 'list-view' && (customName || label)) { 37403 return attributes?.metadata?.name || label; 37404 } 37405 return label; 37406 }, 37407 edit: NavigationSubmenuEdit, 37408 save: navigation_submenu_save_save, 37409 transforms: navigation_submenu_transforms 37410 }; 37411 const navigation_submenu_init = () => initBlock({ 37412 name: navigation_submenu_name, 37413 metadata: navigation_submenu_metadata, 37414 settings: navigation_submenu_settings 37415 }); 37416 37417 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js 37418 37419 /** 37420 * WordPress dependencies 37421 */ 37422 37423 const pageBreak = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 37424 xmlns: "http://www.w3.org/2000/svg", 37425 viewBox: "0 0 24 24" 37426 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 37427 d: "M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z" 37428 })); 37429 /* harmony default export */ const page_break = (pageBreak); 37430 37431 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js 37432 37433 /** 37434 * WordPress dependencies 37435 */ 37436 37437 37438 function NextPageEdit() { 37439 return (0,external_React_namespaceObject.createElement)("div", { 37440 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 37441 }, (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break'))); 37442 } 37443 37444 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js 37445 37446 /** 37447 * WordPress dependencies 37448 */ 37449 37450 function nextpage_save_save() { 37451 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->'); 37452 } 37453 37454 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js 37455 /** 37456 * WordPress dependencies 37457 */ 37458 37459 const nextpage_transforms_transforms = { 37460 from: [{ 37461 type: 'raw', 37462 schema: { 37463 'wp-block': { 37464 attributes: ['data-block'] 37465 } 37466 }, 37467 isMatch: node => node.dataset && node.dataset.block === 'core/nextpage', 37468 transform() { 37469 return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {}); 37470 } 37471 }] 37472 }; 37473 /* harmony default export */ const nextpage_transforms = (nextpage_transforms_transforms); 37474 37475 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 37476 /** 37477 * WordPress dependencies 37478 */ 37479 37480 37481 /** 37482 * Internal dependencies 37483 */ 37484 37485 37486 const nextpage_metadata = { 37487 $schema: "https://schemas.wp.org/trunk/block.json", 37488 apiVersion: 3, 37489 name: "core/nextpage", 37490 title: "Page Break", 37491 category: "design", 37492 description: "Separate your content into a multi-page experience.", 37493 keywords: ["next page", "pagination"], 37494 parent: ["core/post-content"], 37495 textdomain: "default", 37496 supports: { 37497 customClassName: false, 37498 className: false, 37499 html: false, 37500 interactivity: { 37501 clientNavigation: true 37502 } 37503 }, 37504 editorStyle: "wp-block-nextpage-editor" 37505 }; 37506 37507 37508 const { 37509 name: nextpage_name 37510 } = nextpage_metadata; 37511 37512 const nextpage_settings = { 37513 icon: page_break, 37514 example: {}, 37515 transforms: nextpage_transforms, 37516 edit: NextPageEdit, 37517 save: nextpage_save_save 37518 }; 37519 const nextpage_init = () => initBlock({ 37520 name: nextpage_name, 37521 metadata: nextpage_metadata, 37522 settings: nextpage_settings 37523 }); 37524 37525 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/recursion-detector.js 37526 /** 37527 * THIS MODULE IS INTENTIONALLY KEPT WITHIN THE PATTERN BLOCK'S SOURCE. 37528 * 37529 * This is because this approach for preventing infinite loops due to 37530 * recursively rendering blocks is specific to the way that the `core/pattern` 37531 * block behaves in the editor. Any other block types that deal with recursion 37532 * SHOULD USE THE STANDARD METHOD for avoiding loops: 37533 * 37534 * @see https://github.com/WordPress/gutenberg/pull/31455 37535 * @see packages/block-editor/src/components/recursion-provider/README.md 37536 */ 37537 37538 /** 37539 * WordPress dependencies 37540 */ 37541 37542 37543 /** 37544 * Naming is hard. 37545 * 37546 * @see useParsePatternDependencies 37547 * 37548 * @type {WeakMap<Object, Function>} 37549 */ 37550 const cachedParsers = new WeakMap(); 37551 37552 /** 37553 * Hook used by PatternEdit to parse block patterns. It returns a function that 37554 * takes a pattern and returns nothing but throws an error if the pattern is 37555 * recursive. 37556 * 37557 * @example 37558 * ```js 37559 * const parsePatternDependencies = useParsePatternDependencies(); 37560 * parsePatternDependencies( selectedPattern ); 37561 * ``` 37562 * 37563 * @see parsePatternDependencies 37564 * 37565 * @return {Function} A function to parse block patterns. 37566 */ 37567 function useParsePatternDependencies() { 37568 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 37569 37570 // Instead of caching maps, go straight to the point and cache bound 37571 // functions. Each of those functions is bound to a different Map that will 37572 // keep track of patterns in the context of the given registry. 37573 if (!cachedParsers.has(registry)) { 37574 const deps = new Map(); 37575 cachedParsers.set(registry, parsePatternDependencies.bind(null, deps)); 37576 } 37577 return cachedParsers.get(registry); 37578 } 37579 37580 /** 37581 * Parse a given pattern and traverse its contents to detect any subsequent 37582 * patterns on which it may depend. Such occurrences will be added to an 37583 * internal dependency graph. If a circular dependency is detected, an 37584 * error will be thrown. 37585 * 37586 * EXPORTED FOR TESTING PURPOSES ONLY. 37587 * 37588 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 37589 * @param {Object} pattern Pattern. 37590 * @param {string} pattern.name Pattern name. 37591 * @param {Array} pattern.blocks Pattern's block list. 37592 * 37593 * @throws {Error} If a circular dependency is detected. 37594 */ 37595 function parsePatternDependencies(deps, { 37596 name, 37597 blocks 37598 }) { 37599 const queue = [...blocks]; 37600 while (queue.length) { 37601 const block = queue.shift(); 37602 for (const innerBlock of (_block$innerBlocks = block.innerBlocks) !== null && _block$innerBlocks !== void 0 ? _block$innerBlocks : []) { 37603 var _block$innerBlocks; 37604 queue.unshift(innerBlock); 37605 } 37606 if (block.name === 'core/pattern') { 37607 registerDependency(deps, name, block.attributes.slug); 37608 } 37609 } 37610 } 37611 37612 /** 37613 * Declare that pattern `a` depends on pattern `b`. If a circular 37614 * dependency is detected, an error will be thrown. 37615 * 37616 * EXPORTED FOR TESTING PURPOSES ONLY. 37617 * 37618 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 37619 * @param {string} a Slug for pattern A. 37620 * @param {string} b Slug for pattern B. 37621 * 37622 * @throws {Error} If a circular dependency is detected. 37623 */ 37624 function registerDependency(deps, a, b) { 37625 if (!deps.has(a)) { 37626 deps.set(a, new Set()); 37627 } 37628 deps.get(a).add(b); 37629 if (hasCycle(deps, a)) { 37630 throw new TypeError(`Pattern $a} has a circular dependency and cannot be rendered.`); 37631 } 37632 } 37633 37634 /** 37635 * Determine if a given pattern has circular dependencies on other patterns. 37636 * This will be determined by running a depth-first search on the current state 37637 * of the graph represented by `patternDependencies`. 37638 * 37639 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 37640 * @param {string} slug Pattern slug. 37641 * @param {Set<string>} [visitedNodes] Set to track visited nodes in the graph. 37642 * @param {Set<string>} [currentPath] Set to track and backtrack graph paths. 37643 * @return {boolean} Whether any cycle was found. 37644 */ 37645 function hasCycle(deps, slug, visitedNodes = new Set(), currentPath = new Set()) { 37646 var _deps$get; 37647 visitedNodes.add(slug); 37648 currentPath.add(slug); 37649 const dependencies = (_deps$get = deps.get(slug)) !== null && _deps$get !== void 0 ? _deps$get : new Set(); 37650 for (const dependency of dependencies) { 37651 if (!visitedNodes.has(dependency)) { 37652 if (hasCycle(deps, dependency, visitedNodes, currentPath)) { 37653 return true; 37654 } 37655 } else if (currentPath.has(dependency)) { 37656 return true; 37657 } 37658 } 37659 37660 // Remove the current node from the current path when backtracking 37661 currentPath.delete(slug); 37662 return false; 37663 } 37664 37665 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js 37666 37667 /** 37668 * WordPress dependencies 37669 */ 37670 37671 37672 37673 37674 37675 37676 37677 /** 37678 * Internal dependencies 37679 */ 37680 37681 const PatternEdit = ({ 37682 attributes, 37683 clientId 37684 }) => { 37685 const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]); 37686 const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); 37687 const { 37688 replaceBlocks, 37689 setBlockEditingMode, 37690 __unstableMarkNextChangeAsNotPersistent 37691 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 37692 const { 37693 getBlockRootClientId, 37694 getBlockEditingMode 37695 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 37696 const [hasRecursionError, setHasRecursionError] = (0,external_wp_element_namespaceObject.useState)(false); 37697 const parsePatternDependencies = useParsePatternDependencies(); 37698 37699 // Duplicated in packages/edit-site/src/components/start-template-options/index.js. 37700 function injectThemeAttributeInBlockTemplateContent(block) { 37701 if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { 37702 block.innerBlocks = block.innerBlocks.map(innerBlock => { 37703 if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { 37704 innerBlock.attributes.theme = currentThemeStylesheet; 37705 } 37706 return innerBlock; 37707 }); 37708 } 37709 if (block.name === 'core/template-part' && block.attributes.theme === undefined) { 37710 block.attributes.theme = currentThemeStylesheet; 37711 } 37712 return block; 37713 } 37714 37715 // Run this effect when the component loads. 37716 // This adds the Pattern's contents to the post. 37717 // This change won't be saved. 37718 // It will continue to pull from the pattern file unless changes are made to its respective template part. 37719 (0,external_wp_element_namespaceObject.useEffect)(() => { 37720 if (!hasRecursionError && selectedPattern?.blocks) { 37721 try { 37722 parsePatternDependencies(selectedPattern); 37723 } catch (error) { 37724 setHasRecursionError(true); 37725 return; 37726 } 37727 37728 // We batch updates to block list settings to avoid triggering cascading renders 37729 // for each container block included in a tree and optimize initial render. 37730 // Since the above uses microtasks, we need to use a microtask here as well, 37731 // because nested pattern blocks cannot be inserted if the parent block supports 37732 // inner blocks but doesn't have blockSettings in the state. 37733 window.queueMicrotask(() => { 37734 const rootClientId = getBlockRootClientId(clientId); 37735 // Clone blocks from the pattern before insertion to ensure they receive 37736 // distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628. 37737 const clonedBlocks = selectedPattern.blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(injectThemeAttributeInBlockTemplateContent(block))); 37738 const rootEditingMode = getBlockEditingMode(rootClientId); 37739 // Temporarily set the root block to default mode to allow replacing the pattern. 37740 // This could happen when the page is disabling edits of non-content blocks. 37741 __unstableMarkNextChangeAsNotPersistent(); 37742 setBlockEditingMode(rootClientId, 'default'); 37743 __unstableMarkNextChangeAsNotPersistent(); 37744 replaceBlocks(clientId, clonedBlocks); 37745 // Restore the root block's original mode. 37746 __unstableMarkNextChangeAsNotPersistent(); 37747 setBlockEditingMode(rootClientId, rootEditingMode); 37748 }); 37749 } 37750 }, [clientId, hasRecursionError, selectedPattern, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]); 37751 const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 37752 if (hasRecursionError) { 37753 return (0,external_React_namespaceObject.createElement)("div", { 37754 ...props 37755 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)( 37756 // translators: A warning in which %s is the name of a pattern. 37757 (0,external_wp_i18n_namespaceObject.__)('Pattern "%s" cannot be rendered inside itself.'), selectedPattern?.name))); 37758 } 37759 return (0,external_React_namespaceObject.createElement)("div", { 37760 ...props 37761 }); 37762 }; 37763 /* harmony default export */ const pattern_edit = (PatternEdit); 37764 37765 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js 37766 /** 37767 * Internal dependencies 37768 */ 37769 37770 const pattern_metadata = { 37771 $schema: "https://schemas.wp.org/trunk/block.json", 37772 apiVersion: 3, 37773 name: "core/pattern", 37774 title: "Pattern placeholder", 37775 category: "theme", 37776 description: "Show a block pattern.", 37777 supports: { 37778 html: false, 37779 inserter: false, 37780 renaming: false, 37781 interactivity: { 37782 clientNavigation: true 37783 } 37784 }, 37785 textdomain: "default", 37786 attributes: { 37787 slug: { 37788 type: "string" 37789 } 37790 } 37791 }; 37792 37793 const { 37794 name: pattern_name 37795 } = pattern_metadata; 37796 37797 const pattern_settings = { 37798 edit: pattern_edit 37799 }; 37800 const pattern_init = () => initBlock({ 37801 name: pattern_name, 37802 metadata: pattern_metadata, 37803 settings: pattern_settings 37804 }); 37805 37806 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js 37807 37808 /** 37809 * WordPress dependencies 37810 */ 37811 37812 const pages = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 37813 xmlns: "http://www.w3.org/2000/svg", 37814 viewBox: "0 0 24 24" 37815 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 37816 d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" 37817 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 37818 d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" 37819 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 37820 d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" 37821 })); 37822 /* harmony default export */ const library_pages = (pages); 37823 37824 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/use-convert-to-navigation-links.js 37825 /** 37826 * WordPress dependencies 37827 */ 37828 37829 37830 37831 37832 /** 37833 * Converts an array of pages into a nested array of navigation link blocks. 37834 * 37835 * @param {Array} pages An array of pages. 37836 * 37837 * @return {Array} A nested array of navigation link blocks. 37838 */ 37839 function createNavigationLinks(pages = []) { 37840 const linkMap = {}; 37841 const navigationLinks = []; 37842 pages.forEach(({ 37843 id, 37844 title, 37845 link: url, 37846 type, 37847 parent 37848 }) => { 37849 var _linkMap$id$innerBloc; 37850 // See if a placeholder exists. This is created if children appear before parents in list. 37851 const innerBlocks = (_linkMap$id$innerBloc = linkMap[id]?.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : []; 37852 linkMap[id] = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', { 37853 id, 37854 label: title.rendered, 37855 url, 37856 type, 37857 kind: 'post-type' 37858 }, innerBlocks); 37859 if (!parent) { 37860 navigationLinks.push(linkMap[id]); 37861 } else { 37862 if (!linkMap[parent]) { 37863 // Use a placeholder if the child appears before parent in list. 37864 linkMap[parent] = { 37865 innerBlocks: [] 37866 }; 37867 } 37868 // Although these variables are not referenced, they are needed to store the innerBlocks in memory. 37869 const parentLinkInnerBlocks = linkMap[parent].innerBlocks; 37870 parentLinkInnerBlocks.push(linkMap[id]); 37871 } 37872 }); 37873 return navigationLinks; 37874 } 37875 37876 /** 37877 * Finds a navigation link block by id, recursively. 37878 * It might be possible to make this a more generic helper function. 37879 * 37880 * @param {Array} navigationLinks An array of navigation link blocks. 37881 * @param {number} id The id of the navigation link to find. 37882 * 37883 * @return {Object|null} The navigation link block with the given id. 37884 */ 37885 function findNavigationLinkById(navigationLinks, id) { 37886 for (const navigationLink of navigationLinks) { 37887 // Is this the link we're looking for? 37888 if (navigationLink.attributes.id === id) { 37889 return navigationLink; 37890 } 37891 37892 // If not does it have innerBlocks? 37893 if (navigationLink.innerBlocks && navigationLink.innerBlocks.length) { 37894 const foundNavigationLink = findNavigationLinkById(navigationLink.innerBlocks, id); 37895 if (foundNavigationLink) { 37896 return foundNavigationLink; 37897 } 37898 } 37899 } 37900 return null; 37901 } 37902 function convertToNavigationLinks(pages = [], parentPageID = null) { 37903 let navigationLinks = createNavigationLinks(pages); 37904 37905 // If a parent page ID is provided, only return the children of that page. 37906 if (parentPageID) { 37907 const parentPage = findNavigationLinkById(navigationLinks, parentPageID); 37908 if (parentPage && parentPage.innerBlocks) { 37909 navigationLinks = parentPage.innerBlocks; 37910 } 37911 } 37912 37913 // Transform all links with innerBlocks into Submenus. This can't be done 37914 // sooner because page objects have no information on their children. 37915 const transformSubmenus = listOfLinks => { 37916 listOfLinks.forEach((block, index, listOfLinksArray) => { 37917 const { 37918 attributes, 37919 innerBlocks 37920 } = block; 37921 if (innerBlocks.length !== 0) { 37922 transformSubmenus(innerBlocks); 37923 const transformedBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks); 37924 listOfLinksArray[index] = transformedBlock; 37925 } 37926 }); 37927 }; 37928 transformSubmenus(navigationLinks); 37929 return navigationLinks; 37930 } 37931 function useConvertToNavigationLinks({ 37932 clientId, 37933 pages, 37934 parentClientId, 37935 parentPageID 37936 }) { 37937 const { 37938 replaceBlock, 37939 selectBlock 37940 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 37941 return () => { 37942 const navigationLinks = convertToNavigationLinks(pages, parentPageID); 37943 37944 // Replace the Page List block with the Navigation Links. 37945 replaceBlock(clientId, navigationLinks); 37946 37947 // Select the Navigation block to reveal the changes. 37948 selectBlock(parentClientId); 37949 }; 37950 } 37951 37952 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js 37953 37954 /** 37955 * WordPress dependencies 37956 */ 37957 37958 37959 const convertDescription = (0,external_wp_i18n_namespaceObject.__)("This navigation menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically."); 37960 function ConvertToLinksModal({ 37961 onClick, 37962 onClose, 37963 disabled 37964 }) { 37965 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 37966 onRequestClose: onClose, 37967 title: (0,external_wp_i18n_namespaceObject.__)('Edit Page List'), 37968 className: 'wp-block-page-list-modal', 37969 aria: { 37970 describedby: 'wp-block-page-list-modal__description' 37971 } 37972 }, (0,external_React_namespaceObject.createElement)("p", { 37973 id: 'wp-block-page-list-modal__description' 37974 }, convertDescription), (0,external_React_namespaceObject.createElement)("div", { 37975 className: "wp-block-page-list-modal-buttons" 37976 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 37977 variant: "tertiary", 37978 onClick: onClose 37979 }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 37980 variant: "primary", 37981 disabled: disabled, 37982 onClick: onClick 37983 }, (0,external_wp_i18n_namespaceObject.__)('Edit')))); 37984 } 37985 37986 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js 37987 37988 /** 37989 * External dependencies 37990 */ 37991 37992 37993 /** 37994 * WordPress dependencies 37995 */ 37996 37997 37998 37999 38000 38001 38002 38003 38004 /** 38005 * Internal dependencies 38006 */ 38007 38008 38009 38010 // We only show the edit option when page count is <= MAX_PAGE_COUNT 38011 // Performance of Navigation Links is not good past this value. 38012 const MAX_PAGE_COUNT = 100; 38013 const NOOP = () => {}; 38014 function BlockContent({ 38015 blockProps, 38016 innerBlocksProps, 38017 hasResolvedPages, 38018 blockList, 38019 pages, 38020 parentPageID 38021 }) { 38022 if (!hasResolvedPages) { 38023 return (0,external_React_namespaceObject.createElement)("div", { 38024 ...blockProps 38025 }, (0,external_React_namespaceObject.createElement)("div", { 38026 className: "wp-block-page-list__loading-indicator-container" 38027 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, { 38028 className: "wp-block-page-list__loading-indicator" 38029 }))); 38030 } 38031 if (pages === null) { 38032 return (0,external_React_namespaceObject.createElement)("div", { 38033 ...blockProps 38034 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 38035 status: 'warning', 38036 isDismissible: false 38037 }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))); 38038 } 38039 if (pages.length === 0) { 38040 return (0,external_React_namespaceObject.createElement)("div", { 38041 ...blockProps 38042 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 38043 status: 'info', 38044 isDismissible: false 38045 }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))); 38046 } 38047 if (blockList.length === 0) { 38048 const parentPageDetails = pages.find(page => page.id === parentPageID); 38049 if (parentPageDetails?.title?.rendered) { 38050 return (0,external_React_namespaceObject.createElement)("div", { 38051 ...blockProps 38052 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)( 38053 // translators: %s: Page title. 38054 (0,external_wp_i18n_namespaceObject.__)('Page List: "%s" page has no children.'), parentPageDetails.title.rendered))); 38055 } 38056 return (0,external_React_namespaceObject.createElement)("div", { 38057 ...blockProps 38058 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 38059 status: 'warning', 38060 isDismissible: false 38061 }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))); 38062 } 38063 if (pages.length > 0) { 38064 return (0,external_React_namespaceObject.createElement)("ul", { 38065 ...innerBlocksProps 38066 }); 38067 } 38068 } 38069 function PageListEdit({ 38070 context, 38071 clientId, 38072 attributes, 38073 setAttributes 38074 }) { 38075 const { 38076 parentPageID 38077 } = attributes; 38078 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 38079 const openModal = (0,external_wp_element_namespaceObject.useCallback)(() => setOpen(true), []); 38080 const closeModal = () => setOpen(false); 38081 const { 38082 records: pages, 38083 hasResolved: hasResolvedPages 38084 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { 38085 per_page: MAX_PAGE_COUNT, 38086 _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], 38087 // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby 38088 // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent 38089 // sort. 38090 orderby: 'menu_order', 38091 order: 'asc' 38092 }); 38093 const allowConvertToLinks = 'showSubmenuIcon' in context && pages?.length > 0 && pages?.length <= MAX_PAGE_COUNT; 38094 const pagesByParentId = (0,external_wp_element_namespaceObject.useMemo)(() => { 38095 if (pages === null) { 38096 return new Map(); 38097 } 38098 38099 // TODO: Once the REST API supports passing multiple values to 38100 // 'orderby', this can be removed. 38101 // https://core.trac.wordpress.org/ticket/39037 38102 const sortedPages = pages.sort((a, b) => { 38103 if (a.menu_order === b.menu_order) { 38104 return a.title.rendered.localeCompare(b.title.rendered); 38105 } 38106 return a.menu_order - b.menu_order; 38107 }); 38108 return sortedPages.reduce((accumulator, page) => { 38109 const { 38110 parent 38111 } = page; 38112 if (accumulator.has(parent)) { 38113 accumulator.get(parent).push(page); 38114 } else { 38115 accumulator.set(parent, [page]); 38116 } 38117 return accumulator; 38118 }, new Map()); 38119 }, [pages]); 38120 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 38121 className: classnames_default()('wp-block-page-list', { 38122 'has-text-color': !!context.textColor, 38123 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor, 38124 'has-background': !!context.backgroundColor, 38125 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor 38126 }), 38127 style: { 38128 ...context.style?.color 38129 } 38130 }); 38131 const pagesTree = (0,external_wp_element_namespaceObject.useMemo)(function makePagesTree(parentId = 0, level = 0) { 38132 const childPages = pagesByParentId.get(parentId); 38133 if (!childPages?.length) { 38134 return []; 38135 } 38136 return childPages.reduce((tree, page) => { 38137 const hasChildren = pagesByParentId.has(page.id); 38138 const item = { 38139 value: page.id, 38140 label: '— '.repeat(level) + page.title.rendered, 38141 rawName: page.title.rendered 38142 }; 38143 tree.push(item); 38144 if (hasChildren) { 38145 tree.push(...makePagesTree(page.id, level + 1)); 38146 } 38147 return tree; 38148 }, []); 38149 }, [pagesByParentId]); 38150 const blockList = (0,external_wp_element_namespaceObject.useMemo)(function getBlockList(parentId = parentPageID) { 38151 const childPages = pagesByParentId.get(parentId); 38152 if (!childPages?.length) { 38153 return []; 38154 } 38155 return childPages.reduce((template, page) => { 38156 const hasChildren = pagesByParentId.has(page.id); 38157 const pageProps = { 38158 id: page.id, 38159 label: 38160 // translators: displayed when a page has an empty title. 38161 page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'), 38162 title: page.title?.rendered, 38163 link: page.url, 38164 hasChildren 38165 }; 38166 let item = null; 38167 const children = getBlockList(page.id); 38168 item = (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list-item', pageProps, children); 38169 template.push(item); 38170 return template; 38171 }, []); 38172 }, [pagesByParentId, parentPageID]); 38173 const { 38174 isNested, 38175 hasSelectedChild, 38176 parentClientId, 38177 hasDraggedChild, 38178 isChildOfNavigation 38179 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 38180 const { 38181 getBlockParentsByBlockName, 38182 hasSelectedInnerBlock, 38183 hasDraggedInnerBlock 38184 } = select(external_wp_blockEditor_namespaceObject.store); 38185 const blockParents = getBlockParentsByBlockName(clientId, 'core/navigation-submenu', true); 38186 const navigationBlockParents = getBlockParentsByBlockName(clientId, 'core/navigation', true); 38187 return { 38188 isNested: blockParents.length > 0, 38189 isChildOfNavigation: navigationBlockParents.length > 0, 38190 hasSelectedChild: hasSelectedInnerBlock(clientId, true), 38191 hasDraggedChild: hasDraggedInnerBlock(clientId, true), 38192 parentClientId: navigationBlockParents[0] 38193 }; 38194 }, [clientId]); 38195 const convertToNavigationLinks = useConvertToNavigationLinks({ 38196 clientId, 38197 pages, 38198 parentClientId, 38199 parentPageID 38200 }); 38201 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 38202 renderAppender: false, 38203 __unstableDisableDropZone: true, 38204 templateLock: isChildOfNavigation ? false : 'all', 38205 onInput: NOOP, 38206 onChange: NOOP, 38207 value: blockList 38208 }); 38209 const { 38210 selectBlock 38211 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 38212 (0,external_wp_element_namespaceObject.useEffect)(() => { 38213 if (hasSelectedChild || hasDraggedChild) { 38214 openModal(); 38215 selectBlock(parentClientId); 38216 } 38217 }, [hasSelectedChild, hasDraggedChild, parentClientId, selectBlock, openModal]); 38218 (0,external_wp_element_namespaceObject.useEffect)(() => { 38219 setAttributes({ 38220 isNested 38221 }); 38222 }, [isNested, setAttributes]); 38223 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, pagesTree.length > 0 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { 38224 __next40pxDefaultSize: true, 38225 className: "editor-page-attributes__parent", 38226 label: (0,external_wp_i18n_namespaceObject.__)('Parent'), 38227 value: parentPageID, 38228 options: pagesTree, 38229 onChange: value => setAttributes({ 38230 parentPageID: value !== null && value !== void 0 ? value : 0 38231 }), 38232 help: (0,external_wp_i18n_namespaceObject.__)('Choose a page to show only its subpages.') 38233 })), allowConvertToLinks && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 38234 title: (0,external_wp_i18n_namespaceObject.__)('Edit this menu') 38235 }, (0,external_React_namespaceObject.createElement)("p", null, convertDescription), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 38236 variant: "primary", 38237 disabled: !hasResolvedPages, 38238 onClick: convertToNavigationLinks 38239 }, (0,external_wp_i18n_namespaceObject.__)('Edit')))), allowConvertToLinks && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 38240 group: "other" 38241 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 38242 title: (0,external_wp_i18n_namespaceObject.__)('Edit'), 38243 onClick: openModal 38244 }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), isOpen && (0,external_React_namespaceObject.createElement)(ConvertToLinksModal, { 38245 onClick: convertToNavigationLinks, 38246 onClose: closeModal, 38247 disabled: !hasResolvedPages 38248 })), (0,external_React_namespaceObject.createElement)(BlockContent, { 38249 blockProps: blockProps, 38250 innerBlocksProps: innerBlocksProps, 38251 hasResolvedPages: hasResolvedPages, 38252 blockList: blockList, 38253 pages: pages, 38254 parentPageID: parentPageID 38255 })); 38256 } 38257 38258 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js 38259 /** 38260 * WordPress dependencies 38261 */ 38262 38263 38264 /** 38265 * Internal dependencies 38266 */ 38267 38268 const page_list_metadata = { 38269 $schema: "https://schemas.wp.org/trunk/block.json", 38270 apiVersion: 3, 38271 name: "core/page-list", 38272 title: "Page List", 38273 category: "widgets", 38274 allowedBlocks: ["core/page-list-item"], 38275 description: "Display a list of all pages.", 38276 keywords: ["menu", "navigation"], 38277 textdomain: "default", 38278 attributes: { 38279 parentPageID: { 38280 type: "integer", 38281 "default": 0 38282 }, 38283 isNested: { 38284 type: "boolean", 38285 "default": false 38286 } 38287 }, 38288 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], 38289 supports: { 38290 reusable: false, 38291 html: false, 38292 typography: { 38293 fontSize: true, 38294 lineHeight: true, 38295 __experimentalFontFamily: true, 38296 __experimentalFontWeight: true, 38297 __experimentalFontStyle: true, 38298 __experimentalTextTransform: true, 38299 __experimentalTextDecoration: true, 38300 __experimentalLetterSpacing: true, 38301 __experimentalDefaultControls: { 38302 fontSize: true 38303 } 38304 }, 38305 interactivity: { 38306 clientNavigation: true 38307 } 38308 }, 38309 editorStyle: "wp-block-page-list-editor", 38310 style: "wp-block-page-list" 38311 }; 38312 38313 const { 38314 name: page_list_name 38315 } = page_list_metadata; 38316 38317 const page_list_settings = { 38318 icon: library_pages, 38319 example: {}, 38320 edit: PageListEdit 38321 }; 38322 const page_list_init = () => initBlock({ 38323 name: page_list_name, 38324 metadata: page_list_metadata, 38325 settings: page_list_settings 38326 }); 38327 38328 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js 38329 38330 /** 38331 * WordPress dependencies 38332 */ 38333 38334 const icons_ItemSubmenuIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 38335 xmlns: "http://www.w3.org/2000/svg", 38336 width: "12", 38337 height: "12", 38338 viewBox: "0 0 12 12", 38339 fill: "none" 38340 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 38341 d: "M1.50002 4L6.00002 8L10.5 4", 38342 strokeWidth: "1.5" 38343 })); 38344 38345 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list-item/edit.js 38346 38347 /** 38348 * External dependencies 38349 */ 38350 38351 /** 38352 * WordPress dependencies 38353 */ 38354 38355 38356 38357 38358 38359 /** 38360 * Internal dependencies 38361 */ 38362 38363 38364 function useFrontPageId() { 38365 return (0,external_wp_data_namespaceObject.useSelect)(select => { 38366 const canReadSettings = select(external_wp_coreData_namespaceObject.store).canUser('read', 'settings'); 38367 if (!canReadSettings) { 38368 return undefined; 38369 } 38370 const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site'); 38371 return site?.show_on_front === 'page' && site?.page_on_front; 38372 }, []); 38373 } 38374 function PageListItemEdit({ 38375 context, 38376 attributes 38377 }) { 38378 const { 38379 id, 38380 label, 38381 link, 38382 hasChildren, 38383 title 38384 } = attributes; 38385 const isNavigationChild = ('showSubmenuIcon' in context); 38386 const frontPageId = useFrontPageId(); 38387 const innerBlocksColors = getColors(context, true); 38388 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 38389 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(navigationChildBlockProps, { 38390 className: 'wp-block-pages-list__item' 38391 }); 38392 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps); 38393 return (0,external_React_namespaceObject.createElement)("li", { 38394 key: id, 38395 className: classnames_default()('wp-block-pages-list__item', { 38396 'has-child': hasChildren, 38397 'wp-block-navigation-item': isNavigationChild, 38398 'open-on-click': context.openSubmenusOnClick, 38399 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon, 38400 'menu-item-home': id === frontPageId 38401 }) 38402 }, hasChildren && context.openSubmenusOnClick ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("button", { 38403 type: "button", 38404 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle", 38405 "aria-expanded": "false" 38406 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label)), (0,external_React_namespaceObject.createElement)("span", { 38407 className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon" 38408 }, (0,external_React_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_React_namespaceObject.createElement)("a", { 38409 className: classnames_default()('wp-block-pages-list__item__link', { 38410 'wp-block-navigation-item__content': isNavigationChild 38411 }), 38412 href: link 38413 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), hasChildren && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_React_namespaceObject.createElement)("button", { 38414 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", 38415 "aria-expanded": "false", 38416 type: "button" 38417 }, (0,external_React_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_React_namespaceObject.createElement)("ul", { 38418 ...innerBlocksProps 38419 }))); 38420 } 38421 38422 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js 38423 /** 38424 * WordPress dependencies 38425 */ 38426 38427 38428 /** 38429 * Internal dependencies 38430 */ 38431 38432 const page_list_item_metadata = { 38433 $schema: "https://schemas.wp.org/trunk/block.json", 38434 apiVersion: 3, 38435 name: "core/page-list-item", 38436 title: "Page List Item", 38437 category: "widgets", 38438 parent: ["core/page-list"], 38439 description: "Displays a page inside a list of all pages.", 38440 keywords: ["page", "menu", "navigation"], 38441 textdomain: "default", 38442 attributes: { 38443 id: { 38444 type: "number" 38445 }, 38446 label: { 38447 type: "string" 38448 }, 38449 title: { 38450 type: "string" 38451 }, 38452 link: { 38453 type: "string" 38454 }, 38455 hasChildren: { 38456 type: "boolean" 38457 } 38458 }, 38459 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], 38460 supports: { 38461 reusable: false, 38462 html: false, 38463 lock: false, 38464 inserter: false, 38465 __experimentalToolbar: false, 38466 interactivity: { 38467 clientNavigation: true 38468 } 38469 }, 38470 editorStyle: "wp-block-page-list-editor", 38471 style: "wp-block-page-list" 38472 }; 38473 38474 const { 38475 name: page_list_item_name 38476 } = page_list_item_metadata; 38477 38478 const page_list_item_settings = { 38479 __experimentalLabel: ({ 38480 label 38481 }) => label, 38482 icon: library_page, 38483 example: {}, 38484 edit: PageListItemEdit 38485 }; 38486 const page_list_item_init = () => initBlock({ 38487 name: page_list_item_name, 38488 metadata: page_list_item_metadata, 38489 settings: page_list_item_settings 38490 }); 38491 38492 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js 38493 38494 /** 38495 * WordPress dependencies 38496 */ 38497 38498 const paragraph = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 38499 xmlns: "http://www.w3.org/2000/svg", 38500 viewBox: "0 0 24 24" 38501 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 38502 d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" 38503 })); 38504 /* harmony default export */ const library_paragraph = (paragraph); 38505 38506 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js 38507 38508 /** 38509 * External dependencies 38510 */ 38511 38512 38513 /** 38514 * WordPress dependencies 38515 */ 38516 38517 38518 38519 const deprecated_supports = { 38520 className: false 38521 }; 38522 const paragraph_deprecated_blockAttributes = { 38523 align: { 38524 type: 'string' 38525 }, 38526 content: { 38527 type: 'string', 38528 source: 'html', 38529 selector: 'p', 38530 default: '' 38531 }, 38532 dropCap: { 38533 type: 'boolean', 38534 default: false 38535 }, 38536 placeholder: { 38537 type: 'string' 38538 }, 38539 textColor: { 38540 type: 'string' 38541 }, 38542 backgroundColor: { 38543 type: 'string' 38544 }, 38545 fontSize: { 38546 type: 'string' 38547 }, 38548 direction: { 38549 type: 'string', 38550 enum: ['ltr', 'rtl'] 38551 }, 38552 style: { 38553 type: 'object' 38554 } 38555 }; 38556 const migrateCustomColorsAndFontSizes = attributes => { 38557 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) { 38558 return attributes; 38559 } 38560 const style = {}; 38561 if (attributes.customTextColor || attributes.customBackgroundColor) { 38562 style.color = {}; 38563 } 38564 if (attributes.customTextColor) { 38565 style.color.text = attributes.customTextColor; 38566 } 38567 if (attributes.customBackgroundColor) { 38568 style.color.background = attributes.customBackgroundColor; 38569 } 38570 if (attributes.customFontSize) { 38571 style.typography = { 38572 fontSize: attributes.customFontSize 38573 }; 38574 } 38575 const { 38576 customTextColor, 38577 customBackgroundColor, 38578 customFontSize, 38579 ...restAttributes 38580 } = attributes; 38581 return { 38582 ...restAttributes, 38583 style 38584 }; 38585 }; 38586 const { 38587 style, 38588 ...restBlockAttributes 38589 } = paragraph_deprecated_blockAttributes; 38590 const paragraph_deprecated_deprecated = [ 38591 // Version without drop cap on aligned text. 38592 { 38593 supports: deprecated_supports, 38594 attributes: { 38595 ...restBlockAttributes, 38596 customTextColor: { 38597 type: 'string' 38598 }, 38599 customBackgroundColor: { 38600 type: 'string' 38601 }, 38602 customFontSize: { 38603 type: 'number' 38604 } 38605 }, 38606 save({ 38607 attributes 38608 }) { 38609 const { 38610 align, 38611 content, 38612 dropCap, 38613 direction 38614 } = attributes; 38615 const className = classnames_default()({ 38616 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, 38617 [`has-text-align-$align}`]: align 38618 }); 38619 return (0,external_React_namespaceObject.createElement)("p", { 38620 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 38621 className, 38622 dir: direction 38623 }) 38624 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 38625 value: content 38626 })); 38627 } 38628 }, { 38629 supports: deprecated_supports, 38630 attributes: { 38631 ...restBlockAttributes, 38632 customTextColor: { 38633 type: 'string' 38634 }, 38635 customBackgroundColor: { 38636 type: 'string' 38637 }, 38638 customFontSize: { 38639 type: 'number' 38640 } 38641 }, 38642 migrate: migrateCustomColorsAndFontSizes, 38643 save({ 38644 attributes 38645 }) { 38646 const { 38647 align, 38648 content, 38649 dropCap, 38650 backgroundColor, 38651 textColor, 38652 customBackgroundColor, 38653 customTextColor, 38654 fontSize, 38655 customFontSize, 38656 direction 38657 } = attributes; 38658 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 38659 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 38660 const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); 38661 const className = classnames_default()({ 38662 'has-text-color': textColor || customTextColor, 38663 'has-background': backgroundColor || customBackgroundColor, 38664 'has-drop-cap': dropCap, 38665 [`has-text-align-$align}`]: align, 38666 [fontSizeClass]: fontSizeClass, 38667 [textClass]: textClass, 38668 [backgroundClass]: backgroundClass 38669 }); 38670 const styles = { 38671 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 38672 color: textClass ? undefined : customTextColor, 38673 fontSize: fontSizeClass ? undefined : customFontSize 38674 }; 38675 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 38676 tagName: "p", 38677 style: styles, 38678 className: className ? className : undefined, 38679 value: content, 38680 dir: direction 38681 }); 38682 } 38683 }, { 38684 supports: deprecated_supports, 38685 attributes: { 38686 ...restBlockAttributes, 38687 customTextColor: { 38688 type: 'string' 38689 }, 38690 customBackgroundColor: { 38691 type: 'string' 38692 }, 38693 customFontSize: { 38694 type: 'number' 38695 } 38696 }, 38697 migrate: migrateCustomColorsAndFontSizes, 38698 save({ 38699 attributes 38700 }) { 38701 const { 38702 align, 38703 content, 38704 dropCap, 38705 backgroundColor, 38706 textColor, 38707 customBackgroundColor, 38708 customTextColor, 38709 fontSize, 38710 customFontSize, 38711 direction 38712 } = attributes; 38713 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 38714 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 38715 const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); 38716 const className = classnames_default()({ 38717 'has-text-color': textColor || customTextColor, 38718 'has-background': backgroundColor || customBackgroundColor, 38719 'has-drop-cap': dropCap, 38720 [fontSizeClass]: fontSizeClass, 38721 [textClass]: textClass, 38722 [backgroundClass]: backgroundClass 38723 }); 38724 const styles = { 38725 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 38726 color: textClass ? undefined : customTextColor, 38727 fontSize: fontSizeClass ? undefined : customFontSize, 38728 textAlign: align 38729 }; 38730 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 38731 tagName: "p", 38732 style: styles, 38733 className: className ? className : undefined, 38734 value: content, 38735 dir: direction 38736 }); 38737 } 38738 }, { 38739 supports: deprecated_supports, 38740 attributes: { 38741 ...restBlockAttributes, 38742 customTextColor: { 38743 type: 'string' 38744 }, 38745 customBackgroundColor: { 38746 type: 'string' 38747 }, 38748 customFontSize: { 38749 type: 'number' 38750 }, 38751 width: { 38752 type: 'string' 38753 } 38754 }, 38755 migrate: migrateCustomColorsAndFontSizes, 38756 save({ 38757 attributes 38758 }) { 38759 const { 38760 width, 38761 align, 38762 content, 38763 dropCap, 38764 backgroundColor, 38765 textColor, 38766 customBackgroundColor, 38767 customTextColor, 38768 fontSize, 38769 customFontSize 38770 } = attributes; 38771 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 38772 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 38773 const fontSizeClass = fontSize && `is-$fontSize}-text`; 38774 const className = classnames_default()({ 38775 [`align$width}`]: width, 38776 'has-background': backgroundColor || customBackgroundColor, 38777 'has-drop-cap': dropCap, 38778 [fontSizeClass]: fontSizeClass, 38779 [textClass]: textClass, 38780 [backgroundClass]: backgroundClass 38781 }); 38782 const styles = { 38783 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 38784 color: textClass ? undefined : customTextColor, 38785 fontSize: fontSizeClass ? undefined : customFontSize, 38786 textAlign: align 38787 }; 38788 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 38789 tagName: "p", 38790 style: styles, 38791 className: className ? className : undefined, 38792 value: content 38793 }); 38794 } 38795 }, { 38796 supports: deprecated_supports, 38797 attributes: { 38798 ...restBlockAttributes, 38799 fontSize: { 38800 type: 'number' 38801 } 38802 }, 38803 save({ 38804 attributes 38805 }) { 38806 const { 38807 width, 38808 align, 38809 content, 38810 dropCap, 38811 backgroundColor, 38812 textColor, 38813 fontSize 38814 } = attributes; 38815 const className = classnames_default()({ 38816 [`align$width}`]: width, 38817 'has-background': backgroundColor, 38818 'has-drop-cap': dropCap 38819 }); 38820 const styles = { 38821 backgroundColor, 38822 color: textColor, 38823 fontSize, 38824 textAlign: align 38825 }; 38826 return (0,external_React_namespaceObject.createElement)("p", { 38827 style: styles, 38828 className: className ? className : undefined 38829 }, content); 38830 }, 38831 migrate(attributes) { 38832 return migrateCustomColorsAndFontSizes({ 38833 ...attributes, 38834 customFontSize: Number.isFinite(attributes.fontSize) ? attributes.fontSize : undefined, 38835 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 38836 customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined 38837 }); 38838 } 38839 }, { 38840 supports: deprecated_supports, 38841 attributes: { 38842 ...paragraph_deprecated_blockAttributes, 38843 content: { 38844 type: 'string', 38845 source: 'html', 38846 default: '' 38847 } 38848 }, 38849 save({ 38850 attributes 38851 }) { 38852 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content); 38853 }, 38854 migrate(attributes) { 38855 return attributes; 38856 } 38857 }]; 38858 /* harmony default export */ const paragraph_deprecated = (paragraph_deprecated_deprecated); 38859 38860 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js 38861 38862 /** 38863 * WordPress dependencies 38864 */ 38865 38866 const formatLtr = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 38867 xmlns: "http://www.w3.org/2000/svg", 38868 viewBox: "-2 -2 24 24" 38869 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 38870 d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z" 38871 })); 38872 /* harmony default export */ const format_ltr = (formatLtr); 38873 38874 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/use-enter.js 38875 /** 38876 * WordPress dependencies 38877 */ 38878 38879 38880 38881 38882 38883 38884 function useOnEnter(props) { 38885 const { 38886 batch 38887 } = (0,external_wp_data_namespaceObject.useRegistry)(); 38888 const { 38889 moveBlocksToPosition, 38890 replaceInnerBlocks, 38891 duplicateBlocks, 38892 insertBlock 38893 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 38894 const { 38895 getBlockRootClientId, 38896 getBlockIndex, 38897 getBlockOrder, 38898 getBlockName, 38899 getBlock, 38900 getNextBlockClientId, 38901 canInsertBlockType 38902 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 38903 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 38904 propsRef.current = props; 38905 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 38906 function onKeyDown(event) { 38907 if (event.defaultPrevented) { 38908 return; 38909 } 38910 if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 38911 return; 38912 } 38913 const { 38914 content, 38915 clientId 38916 } = propsRef.current; 38917 38918 // The paragraph should be empty. 38919 if (content.length) { 38920 return; 38921 } 38922 const wrapperClientId = getBlockRootClientId(clientId); 38923 if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) { 38924 return; 38925 } 38926 const order = getBlockOrder(wrapperClientId); 38927 const position = order.indexOf(clientId); 38928 38929 // If it is the last block, exit. 38930 if (position === order.length - 1) { 38931 let newWrapperClientId = wrapperClientId; 38932 while (!canInsertBlockType(getBlockName(clientId), getBlockRootClientId(newWrapperClientId))) { 38933 newWrapperClientId = getBlockRootClientId(newWrapperClientId); 38934 } 38935 if (typeof newWrapperClientId === 'string') { 38936 event.preventDefault(); 38937 moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(newWrapperClientId), getBlockIndex(newWrapperClientId) + 1); 38938 } 38939 return; 38940 } 38941 const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); 38942 if (!canInsertBlockType(defaultBlockName, getBlockRootClientId(wrapperClientId))) { 38943 return; 38944 } 38945 event.preventDefault(); 38946 38947 // If it is in the middle, split the block in two. 38948 const wrapperBlock = getBlock(wrapperClientId); 38949 batch(() => { 38950 duplicateBlocks([wrapperClientId]); 38951 const blockIndex = getBlockIndex(wrapperClientId); 38952 replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position)); 38953 replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1)); 38954 insertBlock((0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName), blockIndex + 1, getBlockRootClientId(wrapperClientId), true); 38955 }); 38956 } 38957 element.addEventListener('keydown', onKeyDown); 38958 return () => { 38959 element.removeEventListener('keydown', onKeyDown); 38960 }; 38961 }, []); 38962 } 38963 38964 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js 38965 38966 /** 38967 * External dependencies 38968 */ 38969 38970 38971 /** 38972 * WordPress dependencies 38973 */ 38974 38975 38976 38977 38978 38979 38980 /** 38981 * Internal dependencies 38982 */ 38983 38984 const edit_name = 'core/paragraph'; 38985 function ParagraphRTLControl({ 38986 direction, 38987 setDirection 38988 }) { 38989 return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 38990 icon: format_ltr, 38991 title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'), 38992 isActive: direction === 'ltr', 38993 onClick: () => { 38994 setDirection(direction === 'ltr' ? undefined : 'ltr'); 38995 } 38996 }); 38997 } 38998 function hasDropCapDisabled(align) { 38999 return align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center'; 39000 } 39001 function DropCapControl({ 39002 clientId, 39003 attributes, 39004 setAttributes 39005 }) { 39006 // Please do not add a useSelect call to the paragraph block unconditionally. 39007 // Every useSelect added to a (frequently used) block will degrade load 39008 // and type performance. By moving it within InspectorControls, the subscription is 39009 // now only added for the selected block(s). 39010 const [isDropCapFeatureEnabled] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.dropCap'); 39011 if (!isDropCapFeatureEnabled) { 39012 return null; 39013 } 39014 const { 39015 align, 39016 dropCap 39017 } = attributes; 39018 let helpText; 39019 if (hasDropCapDisabled(align)) { 39020 helpText = (0,external_wp_i18n_namespaceObject.__)('Not available for aligned text.'); 39021 } else if (dropCap) { 39022 helpText = (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.'); 39023 } else { 39024 helpText = (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.'); 39025 } 39026 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39027 hasValue: () => !!dropCap, 39028 label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), 39029 onDeselect: () => setAttributes({ 39030 dropCap: undefined 39031 }), 39032 resetAllFilter: () => ({ 39033 dropCap: undefined 39034 }), 39035 panelId: clientId 39036 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39037 __nextHasNoMarginBottom: true, 39038 label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), 39039 checked: !!dropCap, 39040 onChange: () => setAttributes({ 39041 dropCap: !dropCap 39042 }), 39043 help: helpText, 39044 disabled: hasDropCapDisabled(align) ? true : false 39045 })); 39046 } 39047 function ParagraphBlock({ 39048 attributes, 39049 mergeBlocks, 39050 onReplace, 39051 onRemove, 39052 setAttributes, 39053 clientId 39054 }) { 39055 const { 39056 align, 39057 content, 39058 direction, 39059 dropCap, 39060 placeholder 39061 } = attributes; 39062 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 39063 ref: useOnEnter({ 39064 clientId, 39065 content 39066 }), 39067 className: classnames_default()({ 39068 'has-drop-cap': hasDropCapDisabled(align) ? false : dropCap, 39069 [`has-text-align-$align}`]: align 39070 }), 39071 style: { 39072 direction 39073 } 39074 }); 39075 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 39076 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 39077 group: "block" 39078 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 39079 value: align, 39080 onChange: newAlign => setAttributes({ 39081 align: newAlign, 39082 dropCap: hasDropCapDisabled(newAlign) ? false : dropCap 39083 }) 39084 }), (0,external_React_namespaceObject.createElement)(ParagraphRTLControl, { 39085 direction: direction, 39086 setDirection: newDirection => setAttributes({ 39087 direction: newDirection 39088 }) 39089 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 39090 group: "typography" 39091 }, (0,external_React_namespaceObject.createElement)(DropCapControl, { 39092 clientId: clientId, 39093 attributes: attributes, 39094 setAttributes: setAttributes 39095 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 39096 identifier: "content", 39097 tagName: "p", 39098 ...blockProps, 39099 value: content, 39100 onChange: newContent => setAttributes({ 39101 content: newContent 39102 }), 39103 onSplit: (value, isOriginal) => { 39104 let newAttributes; 39105 if (isOriginal || value) { 39106 newAttributes = { 39107 ...attributes, 39108 content: value 39109 }; 39110 } 39111 const block = (0,external_wp_blocks_namespaceObject.createBlock)(edit_name, newAttributes); 39112 if (isOriginal) { 39113 block.clientId = clientId; 39114 } 39115 return block; 39116 }, 39117 onMerge: mergeBlocks, 39118 onReplace: onReplace, 39119 onRemove: onRemove, 39120 "aria-label": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block') : (0,external_wp_i18n_namespaceObject.__)('Block: Paragraph'), 39121 "data-empty": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content), 39122 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'), 39123 "data-custom-placeholder": placeholder ? true : undefined, 39124 __unstableEmbedURLOnPaste: true, 39125 __unstableAllowPrefixTransformations: true 39126 })); 39127 } 39128 /* harmony default export */ const paragraph_edit = (ParagraphBlock); 39129 39130 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js 39131 39132 /** 39133 * External dependencies 39134 */ 39135 39136 39137 /** 39138 * WordPress dependencies 39139 */ 39140 39141 39142 function paragraph_save_save({ 39143 attributes 39144 }) { 39145 const { 39146 align, 39147 content, 39148 dropCap, 39149 direction 39150 } = attributes; 39151 const className = classnames_default()({ 39152 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, 39153 [`has-text-align-$align}`]: align 39154 }); 39155 return (0,external_React_namespaceObject.createElement)("p", { 39156 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 39157 className, 39158 dir: direction 39159 }) 39160 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 39161 value: content 39162 })); 39163 } 39164 39165 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js 39166 /** 39167 * WordPress dependencies 39168 */ 39169 39170 39171 /** 39172 * Internal dependencies 39173 */ 39174 const { 39175 name: transforms_name 39176 } = { 39177 $schema: "https://schemas.wp.org/trunk/block.json", 39178 apiVersion: 3, 39179 name: "core/paragraph", 39180 title: "Paragraph", 39181 category: "text", 39182 description: "Start with the basic building block of all narrative.", 39183 keywords: ["text"], 39184 textdomain: "default", 39185 usesContext: ["postId"], 39186 attributes: { 39187 align: { 39188 type: "string" 39189 }, 39190 content: { 39191 type: "rich-text", 39192 source: "rich-text", 39193 selector: "p", 39194 __experimentalRole: "content" 39195 }, 39196 dropCap: { 39197 type: "boolean", 39198 "default": false 39199 }, 39200 placeholder: { 39201 type: "string" 39202 }, 39203 direction: { 39204 type: "string", 39205 "enum": ["ltr", "rtl"] 39206 } 39207 }, 39208 supports: { 39209 anchor: true, 39210 className: false, 39211 color: { 39212 gradients: true, 39213 link: true, 39214 __experimentalDefaultControls: { 39215 background: true, 39216 text: true 39217 } 39218 }, 39219 spacing: { 39220 margin: true, 39221 padding: true, 39222 __experimentalDefaultControls: { 39223 margin: false, 39224 padding: false 39225 } 39226 }, 39227 typography: { 39228 fontSize: true, 39229 lineHeight: true, 39230 __experimentalFontFamily: true, 39231 __experimentalTextDecoration: true, 39232 __experimentalFontStyle: true, 39233 __experimentalFontWeight: true, 39234 __experimentalLetterSpacing: true, 39235 __experimentalTextTransform: true, 39236 __experimentalWritingMode: true, 39237 __experimentalDefaultControls: { 39238 fontSize: true 39239 } 39240 }, 39241 __experimentalSelector: "p", 39242 __unstablePasteTextInline: true, 39243 interactivity: { 39244 clientNavigation: true 39245 } 39246 }, 39247 editorStyle: "wp-block-paragraph-editor", 39248 style: "wp-block-paragraph" 39249 }; 39250 const paragraph_transforms_transforms = { 39251 from: [{ 39252 type: 'raw', 39253 // Paragraph is a fallback and should be matched last. 39254 priority: 20, 39255 selector: 'p', 39256 schema: ({ 39257 phrasingContentSchema, 39258 isPaste 39259 }) => ({ 39260 p: { 39261 children: phrasingContentSchema, 39262 attributes: isPaste ? [] : ['style', 'id'] 39263 } 39264 }), 39265 transform(node) { 39266 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(transforms_name, node.outerHTML); 39267 const { 39268 textAlign 39269 } = node.style || {}; 39270 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 39271 attributes.align = textAlign; 39272 } 39273 return (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, attributes); 39274 } 39275 }] 39276 }; 39277 /* harmony default export */ const paragraph_transforms = (paragraph_transforms_transforms); 39278 39279 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 39280 /** 39281 * WordPress dependencies 39282 */ 39283 39284 39285 39286 /** 39287 * Internal dependencies 39288 */ 39289 39290 39291 39292 const paragraph_metadata = { 39293 $schema: "https://schemas.wp.org/trunk/block.json", 39294 apiVersion: 3, 39295 name: "core/paragraph", 39296 title: "Paragraph", 39297 category: "text", 39298 description: "Start with the basic building block of all narrative.", 39299 keywords: ["text"], 39300 textdomain: "default", 39301 usesContext: ["postId"], 39302 attributes: { 39303 align: { 39304 type: "string" 39305 }, 39306 content: { 39307 type: "rich-text", 39308 source: "rich-text", 39309 selector: "p", 39310 __experimentalRole: "content" 39311 }, 39312 dropCap: { 39313 type: "boolean", 39314 "default": false 39315 }, 39316 placeholder: { 39317 type: "string" 39318 }, 39319 direction: { 39320 type: "string", 39321 "enum": ["ltr", "rtl"] 39322 } 39323 }, 39324 supports: { 39325 anchor: true, 39326 className: false, 39327 color: { 39328 gradients: true, 39329 link: true, 39330 __experimentalDefaultControls: { 39331 background: true, 39332 text: true 39333 } 39334 }, 39335 spacing: { 39336 margin: true, 39337 padding: true, 39338 __experimentalDefaultControls: { 39339 margin: false, 39340 padding: false 39341 } 39342 }, 39343 typography: { 39344 fontSize: true, 39345 lineHeight: true, 39346 __experimentalFontFamily: true, 39347 __experimentalTextDecoration: true, 39348 __experimentalFontStyle: true, 39349 __experimentalFontWeight: true, 39350 __experimentalLetterSpacing: true, 39351 __experimentalTextTransform: true, 39352 __experimentalWritingMode: true, 39353 __experimentalDefaultControls: { 39354 fontSize: true 39355 } 39356 }, 39357 __experimentalSelector: "p", 39358 __unstablePasteTextInline: true, 39359 interactivity: { 39360 clientNavigation: true 39361 } 39362 }, 39363 editorStyle: "wp-block-paragraph-editor", 39364 style: "wp-block-paragraph" 39365 }; 39366 39367 39368 const { 39369 name: paragraph_name 39370 } = paragraph_metadata; 39371 39372 const paragraph_settings = { 39373 icon: library_paragraph, 39374 example: { 39375 attributes: { 39376 content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') 39377 } 39378 }, 39379 __experimentalLabel(attributes, { 39380 context 39381 }) { 39382 const customName = attributes?.metadata?.name; 39383 if (context === 'list-view' && customName) { 39384 return customName; 39385 } 39386 if (context === 'accessibility') { 39387 if (customName) { 39388 return customName; 39389 } 39390 const { 39391 content 39392 } = attributes; 39393 return !content || content.length === 0 ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content; 39394 } 39395 }, 39396 transforms: paragraph_transforms, 39397 deprecated: paragraph_deprecated, 39398 merge(attributes, attributesToMerge) { 39399 return { 39400 content: (attributes.content || '') + (attributesToMerge.content || '') 39401 }; 39402 }, 39403 edit: paragraph_edit, 39404 save: paragraph_save_save 39405 }; 39406 const paragraph_init = () => initBlock({ 39407 name: paragraph_name, 39408 metadata: paragraph_metadata, 39409 settings: paragraph_settings 39410 }); 39411 39412 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js 39413 39414 /** 39415 * WordPress dependencies 39416 */ 39417 39418 const postAuthor = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 39419 viewBox: "0 0 24 24", 39420 xmlns: "http://www.w3.org/2000/svg" 39421 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 39422 d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z", 39423 fillRule: "evenodd", 39424 clipRule: "evenodd" 39425 })); 39426 /* harmony default export */ const post_author = (postAuthor); 39427 39428 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js 39429 39430 /** 39431 * External dependencies 39432 */ 39433 39434 39435 /** 39436 * WordPress dependencies 39437 */ 39438 39439 39440 39441 39442 39443 const minimumUsersForCombobox = 25; 39444 const edit_AUTHORS_QUERY = { 39445 who: 'authors', 39446 per_page: 100 39447 }; 39448 function PostAuthorEdit({ 39449 isSelected, 39450 context: { 39451 postType, 39452 postId, 39453 queryId 39454 }, 39455 attributes, 39456 setAttributes 39457 }) { 39458 const isDescendentOfQueryLoop = Number.isFinite(queryId); 39459 const { 39460 authorId, 39461 authorDetails, 39462 authors 39463 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 39464 const { 39465 getEditedEntityRecord, 39466 getUser, 39467 getUsers 39468 } = select(external_wp_coreData_namespaceObject.store); 39469 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 39470 return { 39471 authorId: _authorId, 39472 authorDetails: _authorId ? getUser(_authorId) : null, 39473 authors: getUsers(edit_AUTHORS_QUERY) 39474 }; 39475 }, [postType, postId]); 39476 const { 39477 editEntityRecord 39478 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 39479 const { 39480 textAlign, 39481 showAvatar, 39482 showBio, 39483 byline, 39484 isLink, 39485 linkTarget 39486 } = attributes; 39487 const avatarSizes = []; 39488 const authorName = authorDetails?.name || (0,external_wp_i18n_namespaceObject.__)('Post Author'); 39489 if (authorDetails?.avatar_urls) { 39490 Object.keys(authorDetails.avatar_urls).forEach(size => { 39491 avatarSizes.push({ 39492 value: size, 39493 label: `$size} x $size}` 39494 }); 39495 }); 39496 } 39497 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 39498 className: classnames_default()({ 39499 [`has-text-align-$textAlign}`]: textAlign 39500 }) 39501 }); 39502 const authorOptions = authors?.length ? authors.map(({ 39503 id, 39504 name 39505 }) => { 39506 return { 39507 value: id, 39508 label: name 39509 }; 39510 }) : []; 39511 const handleSelect = nextAuthorId => { 39512 editEntityRecord('postType', postType, postId, { 39513 author: nextAuthorId 39514 }); 39515 }; 39516 const showCombobox = authorOptions.length >= minimumUsersForCombobox; 39517 const showAuthorControl = !!postId && !isDescendentOfQueryLoop && authorOptions.length > 0; 39518 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 39519 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 39520 }, showAuthorControl && (showCombobox && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, { 39521 __nextHasNoMarginBottom: true, 39522 label: (0,external_wp_i18n_namespaceObject.__)('Author'), 39523 options: authorOptions, 39524 value: authorId, 39525 onChange: handleSelect, 39526 allowReset: false 39527 }) || (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 39528 __nextHasNoMarginBottom: true, 39529 label: (0,external_wp_i18n_namespaceObject.__)('Author'), 39530 value: authorId, 39531 options: authorOptions, 39532 onChange: handleSelect 39533 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39534 __nextHasNoMarginBottom: true, 39535 label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'), 39536 checked: showAvatar, 39537 onChange: () => setAttributes({ 39538 showAvatar: !showAvatar 39539 }) 39540 }), showAvatar && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 39541 __nextHasNoMarginBottom: true, 39542 label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'), 39543 value: attributes.avatarSize, 39544 options: avatarSizes, 39545 onChange: size => { 39546 setAttributes({ 39547 avatarSize: Number(size) 39548 }); 39549 } 39550 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39551 __nextHasNoMarginBottom: true, 39552 label: (0,external_wp_i18n_namespaceObject.__)('Show bio'), 39553 checked: showBio, 39554 onChange: () => setAttributes({ 39555 showBio: !showBio 39556 }) 39557 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39558 __nextHasNoMarginBottom: true, 39559 label: (0,external_wp_i18n_namespaceObject.__)('Link author name to author page'), 39560 checked: isLink, 39561 onChange: () => setAttributes({ 39562 isLink: !isLink 39563 }) 39564 }), isLink && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39565 __nextHasNoMarginBottom: true, 39566 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 39567 onChange: value => setAttributes({ 39568 linkTarget: value ? '_blank' : '_self' 39569 }), 39570 checked: linkTarget === '_blank' 39571 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 39572 group: "block" 39573 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 39574 value: textAlign, 39575 onChange: nextAlign => { 39576 setAttributes({ 39577 textAlign: nextAlign 39578 }); 39579 } 39580 })), (0,external_React_namespaceObject.createElement)("div", { 39581 ...blockProps 39582 }, showAvatar && authorDetails?.avatar_urls && (0,external_React_namespaceObject.createElement)("div", { 39583 className: "wp-block-post-author__avatar" 39584 }, (0,external_React_namespaceObject.createElement)("img", { 39585 width: attributes.avatarSize, 39586 src: authorDetails.avatar_urls[attributes.avatarSize], 39587 alt: authorDetails.name 39588 })), (0,external_React_namespaceObject.createElement)("div", { 39589 className: "wp-block-post-author__content" 39590 }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 39591 className: "wp-block-post-author__byline", 39592 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'), 39593 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'), 39594 value: byline, 39595 onChange: value => setAttributes({ 39596 byline: value 39597 }) 39598 }), (0,external_React_namespaceObject.createElement)("p", { 39599 className: "wp-block-post-author__name" 39600 }, isLink ? (0,external_React_namespaceObject.createElement)("a", { 39601 href: "#post-author-pseudo-link", 39602 onClick: event => event.preventDefault() 39603 }, authorName) : authorName), showBio && (0,external_React_namespaceObject.createElement)("p", { 39604 className: "wp-block-post-author__bio", 39605 dangerouslySetInnerHTML: { 39606 __html: authorDetails?.description 39607 } 39608 })))); 39609 } 39610 /* harmony default export */ const post_author_edit = (PostAuthorEdit); 39611 39612 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js 39613 /** 39614 * WordPress dependencies 39615 */ 39616 39617 39618 /** 39619 * Internal dependencies 39620 */ 39621 39622 const post_author_metadata = { 39623 $schema: "https://schemas.wp.org/trunk/block.json", 39624 apiVersion: 3, 39625 name: "core/post-author", 39626 title: "Author", 39627 category: "theme", 39628 description: "Display post author details such as name, avatar, and bio.", 39629 textdomain: "default", 39630 attributes: { 39631 textAlign: { 39632 type: "string" 39633 }, 39634 avatarSize: { 39635 type: "number", 39636 "default": 48 39637 }, 39638 showAvatar: { 39639 type: "boolean", 39640 "default": true 39641 }, 39642 showBio: { 39643 type: "boolean" 39644 }, 39645 byline: { 39646 type: "string" 39647 }, 39648 isLink: { 39649 type: "boolean", 39650 "default": false 39651 }, 39652 linkTarget: { 39653 type: "string", 39654 "default": "_self" 39655 } 39656 }, 39657 usesContext: ["postType", "postId", "queryId"], 39658 supports: { 39659 html: false, 39660 spacing: { 39661 margin: true, 39662 padding: true 39663 }, 39664 typography: { 39665 fontSize: true, 39666 lineHeight: true, 39667 __experimentalFontFamily: true, 39668 __experimentalFontWeight: true, 39669 __experimentalFontStyle: true, 39670 __experimentalTextTransform: true, 39671 __experimentalTextDecoration: true, 39672 __experimentalLetterSpacing: true, 39673 __experimentalDefaultControls: { 39674 fontSize: true 39675 } 39676 }, 39677 color: { 39678 gradients: true, 39679 link: true, 39680 __experimentalDuotone: ".wp-block-post-author__avatar img", 39681 __experimentalDefaultControls: { 39682 background: true, 39683 text: true 39684 } 39685 }, 39686 interactivity: { 39687 clientNavigation: true 39688 } 39689 }, 39690 style: "wp-block-post-author" 39691 }; 39692 39693 const { 39694 name: post_author_name 39695 } = post_author_metadata; 39696 39697 const post_author_settings = { 39698 icon: post_author, 39699 edit: post_author_edit 39700 }; 39701 const post_author_init = () => initBlock({ 39702 name: post_author_name, 39703 metadata: post_author_metadata, 39704 settings: post_author_settings 39705 }); 39706 39707 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/edit.js 39708 39709 /** 39710 * External dependencies 39711 */ 39712 39713 39714 /** 39715 * WordPress dependencies 39716 */ 39717 39718 39719 39720 39721 39722 function PostAuthorNameEdit({ 39723 context: { 39724 postType, 39725 postId 39726 }, 39727 attributes: { 39728 textAlign, 39729 isLink, 39730 linkTarget 39731 }, 39732 setAttributes 39733 }) { 39734 const { 39735 authorName 39736 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 39737 const { 39738 getEditedEntityRecord, 39739 getUser 39740 } = select(external_wp_coreData_namespaceObject.store); 39741 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 39742 return { 39743 authorName: _authorId ? getUser(_authorId) : null 39744 }; 39745 }, [postType, postId]); 39746 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 39747 className: classnames_default()({ 39748 [`has-text-align-$textAlign}`]: textAlign 39749 }) 39750 }); 39751 const displayName = authorName?.name || (0,external_wp_i18n_namespaceObject.__)('Author Name'); 39752 const displayAuthor = isLink ? (0,external_React_namespaceObject.createElement)("a", { 39753 href: "#author-pseudo-link", 39754 onClick: event => event.preventDefault(), 39755 className: "wp-block-post-author-name__link" 39756 }, displayName) : displayName; 39757 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 39758 group: "block" 39759 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 39760 value: textAlign, 39761 onChange: nextAlign => { 39762 setAttributes({ 39763 textAlign: nextAlign 39764 }); 39765 } 39766 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 39767 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 39768 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39769 __nextHasNoMarginBottom: true, 39770 label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'), 39771 onChange: () => setAttributes({ 39772 isLink: !isLink 39773 }), 39774 checked: isLink 39775 }), isLink && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 39776 __nextHasNoMarginBottom: true, 39777 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 39778 onChange: value => setAttributes({ 39779 linkTarget: value ? '_blank' : '_self' 39780 }), 39781 checked: linkTarget === '_blank' 39782 }))), (0,external_React_namespaceObject.createElement)("div", { 39783 ...blockProps 39784 }, " ", displayAuthor, " ")); 39785 } 39786 /* harmony default export */ const post_author_name_edit = (PostAuthorNameEdit); 39787 39788 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/transforms.js 39789 /** 39790 * WordPress dependencies 39791 */ 39792 39793 const post_author_name_transforms_transforms = { 39794 from: [{ 39795 type: 'block', 39796 blocks: ['core/post-author'], 39797 transform: ({ 39798 textAlign 39799 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author-name', { 39800 textAlign 39801 }) 39802 }], 39803 to: [{ 39804 type: 'block', 39805 blocks: ['core/post-author'], 39806 transform: ({ 39807 textAlign 39808 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author', { 39809 textAlign 39810 }) 39811 }] 39812 }; 39813 /* harmony default export */ const post_author_name_transforms = (post_author_name_transforms_transforms); 39814 39815 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js 39816 /** 39817 * WordPress dependencies 39818 */ 39819 39820 39821 /** 39822 * Internal dependencies 39823 */ 39824 39825 const post_author_name_metadata = { 39826 $schema: "https://schemas.wp.org/trunk/block.json", 39827 apiVersion: 3, 39828 name: "core/post-author-name", 39829 title: "Author Name", 39830 category: "theme", 39831 description: "The author name.", 39832 textdomain: "default", 39833 attributes: { 39834 textAlign: { 39835 type: "string" 39836 }, 39837 isLink: { 39838 type: "boolean", 39839 "default": false 39840 }, 39841 linkTarget: { 39842 type: "string", 39843 "default": "_self" 39844 } 39845 }, 39846 usesContext: ["postType", "postId"], 39847 supports: { 39848 html: false, 39849 spacing: { 39850 margin: true, 39851 padding: true 39852 }, 39853 color: { 39854 gradients: true, 39855 link: true, 39856 __experimentalDefaultControls: { 39857 background: true, 39858 text: true, 39859 link: true 39860 } 39861 }, 39862 typography: { 39863 fontSize: true, 39864 lineHeight: true, 39865 __experimentalFontFamily: true, 39866 __experimentalFontWeight: true, 39867 __experimentalFontStyle: true, 39868 __experimentalTextTransform: true, 39869 __experimentalTextDecoration: true, 39870 __experimentalLetterSpacing: true, 39871 __experimentalDefaultControls: { 39872 fontSize: true 39873 } 39874 }, 39875 interactivity: { 39876 clientNavigation: true 39877 } 39878 } 39879 }; 39880 39881 39882 const { 39883 name: post_author_name_name 39884 } = post_author_name_metadata; 39885 39886 const post_author_name_settings = { 39887 icon: post_author, 39888 transforms: post_author_name_transforms, 39889 edit: post_author_name_edit 39890 }; 39891 const post_author_name_init = () => initBlock({ 39892 name: post_author_name_name, 39893 metadata: post_author_name_metadata, 39894 settings: post_author_name_settings 39895 }); 39896 39897 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js 39898 39899 /** 39900 * External dependencies 39901 */ 39902 39903 39904 /** 39905 * WordPress dependencies 39906 */ 39907 39908 39909 39910 39911 function PostAuthorBiographyEdit({ 39912 context: { 39913 postType, 39914 postId 39915 }, 39916 attributes: { 39917 textAlign 39918 }, 39919 setAttributes 39920 }) { 39921 const { 39922 authorDetails 39923 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 39924 const { 39925 getEditedEntityRecord, 39926 getUser 39927 } = select(external_wp_coreData_namespaceObject.store); 39928 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 39929 return { 39930 authorDetails: _authorId ? getUser(_authorId) : null 39931 }; 39932 }, [postType, postId]); 39933 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 39934 className: classnames_default()({ 39935 [`has-text-align-$textAlign}`]: textAlign 39936 }) 39937 }); 39938 const displayAuthorBiography = authorDetails?.description || (0,external_wp_i18n_namespaceObject.__)('Author Biography'); 39939 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 39940 group: "block" 39941 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 39942 value: textAlign, 39943 onChange: nextAlign => { 39944 setAttributes({ 39945 textAlign: nextAlign 39946 }); 39947 } 39948 })), (0,external_React_namespaceObject.createElement)("div", { 39949 ...blockProps, 39950 dangerouslySetInnerHTML: { 39951 __html: displayAuthorBiography 39952 } 39953 })); 39954 } 39955 /* harmony default export */ const post_author_biography_edit = (PostAuthorBiographyEdit); 39956 39957 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js 39958 /** 39959 * WordPress dependencies 39960 */ 39961 39962 39963 /** 39964 * Internal dependencies 39965 */ 39966 39967 const post_author_biography_metadata = { 39968 $schema: "https://schemas.wp.org/trunk/block.json", 39969 apiVersion: 3, 39970 name: "core/post-author-biography", 39971 title: "Author Biography", 39972 category: "theme", 39973 description: "The author biography.", 39974 textdomain: "default", 39975 attributes: { 39976 textAlign: { 39977 type: "string" 39978 } 39979 }, 39980 usesContext: ["postType", "postId"], 39981 supports: { 39982 spacing: { 39983 margin: true, 39984 padding: true 39985 }, 39986 color: { 39987 gradients: true, 39988 link: true, 39989 __experimentalDefaultControls: { 39990 background: true, 39991 text: true 39992 } 39993 }, 39994 typography: { 39995 fontSize: true, 39996 lineHeight: true, 39997 __experimentalFontFamily: true, 39998 __experimentalFontWeight: true, 39999 __experimentalFontStyle: true, 40000 __experimentalTextTransform: true, 40001 __experimentalTextDecoration: true, 40002 __experimentalLetterSpacing: true, 40003 __experimentalDefaultControls: { 40004 fontSize: true 40005 } 40006 }, 40007 interactivity: { 40008 clientNavigation: true 40009 } 40010 } 40011 }; 40012 40013 const { 40014 name: post_author_biography_name 40015 } = post_author_biography_metadata; 40016 40017 const post_author_biography_settings = { 40018 icon: post_author, 40019 edit: post_author_biography_edit 40020 }; 40021 const post_author_biography_init = () => initBlock({ 40022 name: post_author_biography_name, 40023 metadata: post_author_biography_metadata, 40024 settings: post_author_biography_settings 40025 }); 40026 40027 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js 40028 40029 /** 40030 * WordPress dependencies 40031 */ 40032 40033 const blockDefault = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 40034 xmlns: "http://www.w3.org/2000/svg", 40035 viewBox: "0 0 24 24" 40036 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 40037 d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" 40038 })); 40039 /* harmony default export */ const block_default = (blockDefault); 40040 40041 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/edit.js 40042 40043 /** 40044 * WordPress dependencies 40045 */ 40046 40047 40048 40049 40050 40051 const post_comment_edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; 40052 function post_comment_edit_Edit({ 40053 attributes: { 40054 commentId 40055 }, 40056 setAttributes 40057 }) { 40058 const [commentIdInput, setCommentIdInput] = (0,external_wp_element_namespaceObject.useState)(commentId); 40059 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 40060 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 40061 template: post_comment_edit_TEMPLATE 40062 }); 40063 if (!commentId) { 40064 return (0,external_React_namespaceObject.createElement)("div", { 40065 ...blockProps 40066 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 40067 icon: block_default, 40068 label: (0,external_wp_i18n_namespaceObject._x)('Post Comment', 'block title'), 40069 instructions: (0,external_wp_i18n_namespaceObject.__)('To show a comment, input the comment ID.') 40070 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 40071 __nextHasNoMarginBottom: true, 40072 value: commentId, 40073 onChange: val => setCommentIdInput(parseInt(val)) 40074 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 40075 variant: "primary", 40076 onClick: () => { 40077 setAttributes({ 40078 commentId: commentIdInput 40079 }); 40080 } 40081 }, (0,external_wp_i18n_namespaceObject.__)('Save')))); 40082 } 40083 return (0,external_React_namespaceObject.createElement)("div", { 40084 ...innerBlocksProps 40085 }); 40086 } 40087 40088 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/save.js 40089 40090 /** 40091 * WordPress dependencies 40092 */ 40093 40094 function post_comment_save_save() { 40095 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 40096 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 40097 return (0,external_React_namespaceObject.createElement)("div", { 40098 ...innerBlocksProps 40099 }); 40100 } 40101 40102 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js 40103 /** 40104 * WordPress dependencies 40105 */ 40106 40107 40108 /** 40109 * Internal dependencies 40110 */ 40111 40112 const post_comment_metadata = { 40113 $schema: "https://schemas.wp.org/trunk/block.json", 40114 apiVersion: 3, 40115 __experimental: "fse", 40116 name: "core/post-comment", 40117 title: "Comment (deprecated)", 40118 category: "theme", 40119 allowedBlocks: ["core/avatar", "core/comment-author-name", "core/comment-content", "core/comment-date", "core/comment-edit-link", "core/comment-reply-link"], 40120 description: "This block is deprecated. Please use the Comments block instead.", 40121 textdomain: "default", 40122 attributes: { 40123 commentId: { 40124 type: "number" 40125 } 40126 }, 40127 providesContext: { 40128 commentId: "commentId" 40129 }, 40130 supports: { 40131 html: false, 40132 inserter: false, 40133 interactivity: { 40134 clientNavigation: true 40135 } 40136 } 40137 }; 40138 40139 40140 const { 40141 name: post_comment_name 40142 } = post_comment_metadata; 40143 40144 const post_comment_settings = { 40145 icon: library_comment, 40146 edit: post_comment_edit_Edit, 40147 save: post_comment_save_save 40148 }; 40149 const post_comment_init = () => initBlock({ 40150 name: post_comment_name, 40151 metadata: post_comment_metadata, 40152 settings: post_comment_settings 40153 }); 40154 40155 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-count.js 40156 40157 /** 40158 * WordPress dependencies 40159 */ 40160 40161 const postCommentsCount = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 40162 xmlns: "http://www.w3.org/2000/svg", 40163 viewBox: "0 0 24 24" 40164 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 40165 d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.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-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z" 40166 })); 40167 /* harmony default export */ const post_comments_count = (postCommentsCount); 40168 40169 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-count/edit.js 40170 40171 /** 40172 * External dependencies 40173 */ 40174 40175 40176 /** 40177 * WordPress dependencies 40178 */ 40179 40180 40181 40182 40183 40184 function PostCommentsCountEdit({ 40185 attributes, 40186 context, 40187 setAttributes 40188 }) { 40189 const { 40190 textAlign 40191 } = attributes; 40192 const { 40193 postId 40194 } = context; 40195 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 40196 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40197 className: classnames_default()({ 40198 [`has-text-align-$textAlign}`]: textAlign 40199 }) 40200 }); 40201 (0,external_wp_element_namespaceObject.useEffect)(() => { 40202 if (!postId) { 40203 return; 40204 } 40205 const currentPostId = postId; 40206 external_wp_apiFetch_default()({ 40207 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 40208 post: postId 40209 }), 40210 parse: false 40211 }).then(res => { 40212 // Stale requests will have the `currentPostId` of an older closure. 40213 if (currentPostId === postId) { 40214 setCommentsCount(res.headers.get('X-WP-Total')); 40215 } 40216 }); 40217 }, [postId]); 40218 const hasPostAndComments = postId && commentsCount !== undefined; 40219 const blockStyles = { 40220 ...blockProps.style, 40221 textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : undefined 40222 }; 40223 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 40224 group: "block" 40225 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 40226 value: textAlign, 40227 onChange: nextAlign => { 40228 setAttributes({ 40229 textAlign: nextAlign 40230 }); 40231 } 40232 })), (0,external_React_namespaceObject.createElement)("div", { 40233 ...blockProps, 40234 style: blockStyles 40235 }, hasPostAndComments ? commentsCount : (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Count block: post not found.')))); 40236 } 40237 40238 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js 40239 /** 40240 * WordPress dependencies 40241 */ 40242 40243 40244 /** 40245 * Internal dependencies 40246 */ 40247 40248 const post_comments_count_metadata = { 40249 $schema: "https://schemas.wp.org/trunk/block.json", 40250 apiVersion: 3, 40251 __experimental: "fse", 40252 name: "core/post-comments-count", 40253 title: "Comments Count", 40254 category: "theme", 40255 description: "Display a post's comments count.", 40256 textdomain: "default", 40257 attributes: { 40258 textAlign: { 40259 type: "string" 40260 } 40261 }, 40262 usesContext: ["postId"], 40263 supports: { 40264 html: false, 40265 color: { 40266 gradients: true, 40267 __experimentalDefaultControls: { 40268 background: true, 40269 text: true 40270 } 40271 }, 40272 spacing: { 40273 margin: true, 40274 padding: true 40275 }, 40276 typography: { 40277 fontSize: true, 40278 lineHeight: true, 40279 __experimentalFontFamily: true, 40280 __experimentalFontWeight: true, 40281 __experimentalFontStyle: true, 40282 __experimentalTextTransform: true, 40283 __experimentalTextDecoration: true, 40284 __experimentalLetterSpacing: true, 40285 __experimentalDefaultControls: { 40286 fontSize: true 40287 } 40288 }, 40289 interactivity: { 40290 clientNavigation: true 40291 } 40292 } 40293 }; 40294 40295 const { 40296 name: post_comments_count_name 40297 } = post_comments_count_metadata; 40298 40299 const post_comments_count_settings = { 40300 icon: post_comments_count, 40301 edit: PostCommentsCountEdit 40302 }; 40303 const post_comments_count_init = () => initBlock({ 40304 name: post_comments_count_name, 40305 metadata: post_comments_count_metadata, 40306 settings: post_comments_count_settings 40307 }); 40308 40309 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js 40310 40311 /** 40312 * WordPress dependencies 40313 */ 40314 40315 const postCommentsForm = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 40316 xmlns: "http://www.w3.org/2000/svg", 40317 viewBox: "0 0 24 24" 40318 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 40319 d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.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-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z" 40320 })); 40321 /* harmony default export */ const post_comments_form = (postCommentsForm); 40322 40323 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js 40324 40325 /** 40326 * External dependencies 40327 */ 40328 40329 40330 /** 40331 * WordPress dependencies 40332 */ 40333 40334 40335 40336 40337 40338 /** 40339 * Internal dependencies 40340 */ 40341 40342 function PostCommentsFormEdit({ 40343 attributes, 40344 context, 40345 setAttributes 40346 }) { 40347 const { 40348 textAlign 40349 } = attributes; 40350 const { 40351 postId, 40352 postType 40353 } = context; 40354 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsFormEdit); 40355 const instanceIdDesc = (0,external_wp_i18n_namespaceObject.sprintf)('comments-form-edit-%d-desc', instanceId); 40356 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40357 className: classnames_default()({ 40358 [`has-text-align-$textAlign}`]: textAlign 40359 }), 40360 'aria-describedby': instanceIdDesc 40361 }); 40362 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 40363 group: "block" 40364 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 40365 value: textAlign, 40366 onChange: nextAlign => { 40367 setAttributes({ 40368 textAlign: nextAlign 40369 }); 40370 } 40371 })), (0,external_React_namespaceObject.createElement)("div", { 40372 ...blockProps 40373 }, (0,external_React_namespaceObject.createElement)(post_comments_form_form, { 40374 postId: postId, 40375 postType: postType 40376 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { 40377 id: instanceIdDesc 40378 }, (0,external_wp_i18n_namespaceObject.__)('Comments form disabled in editor.')))); 40379 } 40380 40381 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js 40382 /** 40383 * WordPress dependencies 40384 */ 40385 40386 40387 /** 40388 * Internal dependencies 40389 */ 40390 40391 const post_comments_form_metadata = { 40392 $schema: "https://schemas.wp.org/trunk/block.json", 40393 apiVersion: 3, 40394 name: "core/post-comments-form", 40395 title: "Comments Form", 40396 category: "theme", 40397 description: "Display a post's comments form.", 40398 textdomain: "default", 40399 attributes: { 40400 textAlign: { 40401 type: "string" 40402 } 40403 }, 40404 usesContext: ["postId", "postType"], 40405 supports: { 40406 html: false, 40407 color: { 40408 gradients: true, 40409 heading: true, 40410 link: true, 40411 __experimentalDefaultControls: { 40412 background: true, 40413 text: true 40414 } 40415 }, 40416 spacing: { 40417 margin: true, 40418 padding: true 40419 }, 40420 typography: { 40421 fontSize: true, 40422 lineHeight: true, 40423 __experimentalFontStyle: true, 40424 __experimentalFontWeight: true, 40425 __experimentalLetterSpacing: true, 40426 __experimentalTextTransform: true, 40427 __experimentalDefaultControls: { 40428 fontSize: true 40429 } 40430 } 40431 }, 40432 editorStyle: "wp-block-post-comments-form-editor", 40433 style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"] 40434 }; 40435 40436 const { 40437 name: post_comments_form_name 40438 } = post_comments_form_metadata; 40439 40440 const post_comments_form_settings = { 40441 icon: post_comments_form, 40442 edit: PostCommentsFormEdit 40443 }; 40444 const post_comments_form_init = () => initBlock({ 40445 name: post_comments_form_name, 40446 metadata: post_comments_form_metadata, 40447 settings: post_comments_form_settings 40448 }); 40449 40450 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-link/edit.js 40451 40452 /** 40453 * External dependencies 40454 */ 40455 40456 40457 /** 40458 * WordPress dependencies 40459 */ 40460 40461 40462 40463 40464 40465 40466 40467 function PostCommentsLinkEdit({ 40468 context, 40469 attributes, 40470 setAttributes 40471 }) { 40472 const { 40473 textAlign 40474 } = attributes; 40475 const { 40476 postType, 40477 postId 40478 } = context; 40479 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 40480 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40481 className: classnames_default()({ 40482 [`has-text-align-$textAlign}`]: textAlign 40483 }) 40484 }); 40485 (0,external_wp_element_namespaceObject.useEffect)(() => { 40486 if (!postId) { 40487 return; 40488 } 40489 const currentPostId = postId; 40490 external_wp_apiFetch_default()({ 40491 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 40492 post: postId 40493 }), 40494 parse: false 40495 }).then(res => { 40496 // Stale requests will have the `currentPostId` of an older closure. 40497 if (currentPostId === postId) { 40498 setCommentsCount(res.headers.get('X-WP-Total')); 40499 } 40500 }); 40501 }, [postId]); 40502 const post = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId), [postType, postId]); 40503 if (!post) { 40504 return null; 40505 } 40506 const { 40507 link 40508 } = post; 40509 let commentsText; 40510 if (commentsCount !== undefined) { 40511 const commentsNumber = parseInt(commentsCount); 40512 if (commentsNumber === 0) { 40513 commentsText = (0,external_wp_i18n_namespaceObject.__)('No comments'); 40514 } else { 40515 commentsText = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Number of comments */ 40516 (0,external_wp_i18n_namespaceObject._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString()); 40517 } 40518 } 40519 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 40520 group: "block" 40521 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 40522 value: textAlign, 40523 onChange: nextAlign => { 40524 setAttributes({ 40525 textAlign: nextAlign 40526 }); 40527 } 40528 })), (0,external_React_namespaceObject.createElement)("div", { 40529 ...blockProps 40530 }, link && commentsText !== undefined ? (0,external_React_namespaceObject.createElement)("a", { 40531 href: link + '#comments', 40532 onClick: event => event.preventDefault() 40533 }, commentsText) : (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Link block: post not found.')))); 40534 } 40535 /* harmony default export */ const post_comments_link_edit = (PostCommentsLinkEdit); 40536 40537 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js 40538 /** 40539 * WordPress dependencies 40540 */ 40541 40542 40543 /** 40544 * Internal dependencies 40545 */ 40546 40547 const post_comments_link_metadata = { 40548 $schema: "https://schemas.wp.org/trunk/block.json", 40549 apiVersion: 3, 40550 __experimental: "fse", 40551 name: "core/post-comments-link", 40552 title: "Comments Link", 40553 category: "theme", 40554 description: "Displays the link to the current post comments.", 40555 textdomain: "default", 40556 usesContext: ["postType", "postId"], 40557 attributes: { 40558 textAlign: { 40559 type: "string" 40560 } 40561 }, 40562 supports: { 40563 html: false, 40564 color: { 40565 link: true, 40566 text: false, 40567 __experimentalDefaultControls: { 40568 background: true, 40569 link: true 40570 } 40571 }, 40572 spacing: { 40573 margin: true, 40574 padding: true 40575 }, 40576 typography: { 40577 fontSize: true, 40578 lineHeight: true, 40579 __experimentalFontFamily: true, 40580 __experimentalFontWeight: true, 40581 __experimentalFontStyle: true, 40582 __experimentalTextTransform: true, 40583 __experimentalTextDecoration: true, 40584 __experimentalLetterSpacing: true, 40585 __experimentalDefaultControls: { 40586 fontSize: true 40587 } 40588 }, 40589 interactivity: { 40590 clientNavigation: true 40591 } 40592 } 40593 }; 40594 40595 const { 40596 name: post_comments_link_name 40597 } = post_comments_link_metadata; 40598 40599 const post_comments_link_settings = { 40600 edit: post_comments_link_edit, 40601 icon: post_comments_count 40602 }; 40603 const post_comments_link_init = () => initBlock({ 40604 name: post_comments_link_name, 40605 metadata: post_comments_link_metadata, 40606 settings: post_comments_link_settings 40607 }); 40608 40609 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js 40610 40611 /** 40612 * WordPress dependencies 40613 */ 40614 40615 const postContent = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 40616 xmlns: "http://www.w3.org/2000/svg", 40617 viewBox: "0 0 24 24" 40618 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 40619 d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z" 40620 })); 40621 /* harmony default export */ const post_content = (postContent); 40622 40623 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js 40624 /** 40625 * WordPress dependencies 40626 */ 40627 40628 40629 40630 /** 40631 * Returns whether the current user can edit the given entity. 40632 * 40633 * @param {string} kind Entity kind. 40634 * @param {string} name Entity name. 40635 * @param {string} recordId Record's id. 40636 */ 40637 function useCanEditEntity(kind, name, recordId) { 40638 return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]); 40639 } 40640 /* harmony default export */ const hooks = ({ 40641 useCanEditEntity 40642 }); 40643 40644 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js 40645 40646 /** 40647 * WordPress dependencies 40648 */ 40649 40650 40651 40652 40653 /** 40654 * Internal dependencies 40655 */ 40656 40657 function ReadOnlyContent({ 40658 layoutClassNames, 40659 userCanEdit, 40660 postType, 40661 postId 40662 }) { 40663 const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); 40664 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40665 className: layoutClassNames 40666 }); 40667 return content?.protected && !userCanEdit ? (0,external_React_namespaceObject.createElement)("div", { 40668 ...blockProps 40669 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_React_namespaceObject.createElement)("div", { 40670 ...blockProps, 40671 dangerouslySetInnerHTML: { 40672 __html: content?.rendered 40673 } 40674 }); 40675 } 40676 function EditableContent({ 40677 context = {} 40678 }) { 40679 const { 40680 postType, 40681 postId 40682 } = context; 40683 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { 40684 id: postId 40685 }); 40686 const entityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { 40687 return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); 40688 }, [postType, postId]); 40689 const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length; 40690 const initialInnerBlocks = [['core/paragraph']]; 40691 const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40692 className: 'entry-content' 40693 }), { 40694 value: blocks, 40695 onInput, 40696 onChange, 40697 template: !hasInnerBlocks ? initialInnerBlocks : undefined 40698 }); 40699 return (0,external_React_namespaceObject.createElement)("div", { 40700 ...props 40701 }); 40702 } 40703 function Content(props) { 40704 const { 40705 context: { 40706 queryId, 40707 postType, 40708 postId 40709 } = {}, 40710 layoutClassNames 40711 } = props; 40712 const userCanEdit = useCanEditEntity('postType', postType, postId); 40713 if (userCanEdit === undefined) { 40714 return null; 40715 } 40716 const isDescendentOfQueryLoop = Number.isFinite(queryId); 40717 const isEditable = userCanEdit && !isDescendentOfQueryLoop; 40718 return isEditable ? (0,external_React_namespaceObject.createElement)(EditableContent, { 40719 ...props 40720 }) : (0,external_React_namespaceObject.createElement)(ReadOnlyContent, { 40721 layoutClassNames: layoutClassNames, 40722 userCanEdit: userCanEdit, 40723 postType: postType, 40724 postId: postId 40725 }); 40726 } 40727 function edit_Placeholder({ 40728 layoutClassNames 40729 }) { 40730 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40731 className: layoutClassNames 40732 }); 40733 return (0,external_React_namespaceObject.createElement)("div", { 40734 ...blockProps 40735 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Content block, it will display all the blocks in any single post or page.')), (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.'))); 40736 } 40737 function RecursionError() { 40738 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 40739 return (0,external_React_namespaceObject.createElement)("div", { 40740 ...blockProps 40741 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.'))); 40742 } 40743 function PostContentEdit({ 40744 context, 40745 __unstableLayoutClassNames: layoutClassNames 40746 }) { 40747 const { 40748 postId: contextPostId, 40749 postType: contextPostType 40750 } = context; 40751 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(contextPostId); 40752 if (contextPostId && contextPostType && hasAlreadyRendered) { 40753 return (0,external_React_namespaceObject.createElement)(RecursionError, null); 40754 } 40755 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 40756 uniqueId: contextPostId 40757 }, contextPostId && contextPostType ? (0,external_React_namespaceObject.createElement)(Content, { 40758 context: context, 40759 layoutClassNames: layoutClassNames 40760 }) : (0,external_React_namespaceObject.createElement)(edit_Placeholder, { 40761 layoutClassNames: layoutClassNames 40762 })); 40763 } 40764 40765 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js 40766 /** 40767 * WordPress dependencies 40768 */ 40769 40770 40771 /** 40772 * Internal dependencies 40773 */ 40774 40775 const post_content_metadata = { 40776 $schema: "https://schemas.wp.org/trunk/block.json", 40777 apiVersion: 3, 40778 name: "core/post-content", 40779 title: "Content", 40780 category: "theme", 40781 description: "Displays the contents of a post or page.", 40782 textdomain: "default", 40783 usesContext: ["postId", "postType", "queryId"], 40784 supports: { 40785 align: ["wide", "full"], 40786 html: false, 40787 layout: true, 40788 dimensions: { 40789 minHeight: true 40790 }, 40791 spacing: { 40792 blockGap: true 40793 }, 40794 color: { 40795 gradients: true, 40796 link: true, 40797 __experimentalDefaultControls: { 40798 background: false, 40799 text: false 40800 } 40801 }, 40802 typography: { 40803 fontSize: true, 40804 lineHeight: true, 40805 __experimentalFontFamily: true, 40806 __experimentalFontWeight: true, 40807 __experimentalFontStyle: true, 40808 __experimentalTextTransform: true, 40809 __experimentalTextDecoration: true, 40810 __experimentalLetterSpacing: true, 40811 __experimentalDefaultControls: { 40812 fontSize: true 40813 } 40814 } 40815 }, 40816 editorStyle: "wp-block-post-content-editor" 40817 }; 40818 40819 const { 40820 name: post_content_name 40821 } = post_content_metadata; 40822 40823 const post_content_settings = { 40824 icon: post_content, 40825 edit: PostContentEdit 40826 }; 40827 const post_content_init = () => initBlock({ 40828 name: post_content_name, 40829 metadata: post_content_metadata, 40830 settings: post_content_settings 40831 }); 40832 40833 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js 40834 40835 /** 40836 * External dependencies 40837 */ 40838 40839 40840 /** 40841 * WordPress dependencies 40842 */ 40843 40844 40845 40846 40847 40848 40849 40850 40851 40852 function PostDateEdit({ 40853 attributes: { 40854 textAlign, 40855 format, 40856 isLink, 40857 displayType 40858 }, 40859 context: { 40860 postId, 40861 postType: postTypeSlug, 40862 queryId 40863 }, 40864 setAttributes 40865 }) { 40866 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40867 className: classnames_default()({ 40868 [`has-text-align-$textAlign}`]: textAlign, 40869 [`wp-block-post-date__modified-date`]: displayType === 'modified' 40870 }) 40871 }); 40872 40873 // Use internal state instead of a ref to make sure that the component 40874 // re-renders when the popover's anchor updates. 40875 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 40876 // Memoize popoverProps to avoid returning a new object every time. 40877 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 40878 anchor: popoverAnchor 40879 }), [popoverAnchor]); 40880 const isDescendentOfQueryLoop = Number.isFinite(queryId); 40881 const dateSettings = (0,external_wp_date_namespaceObject.getSettings)(); 40882 const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); 40883 const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format'); 40884 const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId); 40885 const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]); 40886 const dateLabel = displayType === 'date' ? (0,external_wp_i18n_namespaceObject.__)('Post Date') : (0,external_wp_i18n_namespaceObject.__)('Post Modified Date'); 40887 let postDate = date ? (0,external_React_namespaceObject.createElement)("time", { 40888 dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date), 40889 ref: setPopoverAnchor 40890 }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : dateLabel; 40891 if (isLink && date) { 40892 postDate = (0,external_React_namespaceObject.createElement)("a", { 40893 href: "#post-date-pseudo-link", 40894 onClick: event => event.preventDefault() 40895 }, postDate); 40896 } 40897 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 40898 group: "block" 40899 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 40900 value: textAlign, 40901 onChange: nextAlign => { 40902 setAttributes({ 40903 textAlign: nextAlign 40904 }); 40905 } 40906 }), date && displayType === 'date' && !isDescendentOfQueryLoop && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { 40907 popoverProps: popoverProps, 40908 renderContent: ({ 40909 onClose 40910 }) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, { 40911 currentDate: date, 40912 onChange: setDate, 40913 is12Hour: is12HourFormat(siteTimeFormat), 40914 onClose: onClose 40915 }), 40916 renderToggle: ({ 40917 isOpen, 40918 onToggle 40919 }) => { 40920 const openOnArrowDown = event => { 40921 if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { 40922 event.preventDefault(); 40923 onToggle(); 40924 } 40925 }; 40926 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 40927 "aria-expanded": isOpen, 40928 icon: library_edit, 40929 title: (0,external_wp_i18n_namespaceObject.__)('Change Date'), 40930 onClick: onToggle, 40931 onKeyDown: openOnArrowDown 40932 }); 40933 } 40934 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 40935 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 40936 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { 40937 format: format, 40938 defaultFormat: siteFormat, 40939 onChange: nextFormat => setAttributes({ 40940 format: nextFormat 40941 }) 40942 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 40943 __nextHasNoMarginBottom: true, 40944 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 40945 // translators: %s: Name of the post type e.g: "post". 40946 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 40947 onChange: () => setAttributes({ 40948 isLink: !isLink 40949 }), 40950 checked: isLink 40951 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 40952 __nextHasNoMarginBottom: true, 40953 label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'), 40954 onChange: value => setAttributes({ 40955 displayType: value ? 'modified' : 'date' 40956 }), 40957 checked: displayType === 'modified', 40958 help: (0,external_wp_i18n_namespaceObject.__)('Only shows if the post has been modified') 40959 }))), (0,external_React_namespaceObject.createElement)("div", { 40960 ...blockProps 40961 }, postDate)); 40962 } 40963 function is12HourFormat(format) { 40964 // To know if the time format is a 12 hour time, look for any of the 12 hour 40965 // format characters: 'a', 'A', 'g', and 'h'. The character must be 40966 // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I 40967 // feel when working with regular expressions. 40968 // https://www.php.net/manual/en/datetime.format.php 40969 return /(?:^|[^\\])[aAgh]/.test(format); 40970 } 40971 40972 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js 40973 /** 40974 * Internal dependencies 40975 */ 40976 40977 const post_date_deprecated_v1 = { 40978 attributes: { 40979 textAlign: { 40980 type: 'string' 40981 }, 40982 format: { 40983 type: 'string' 40984 }, 40985 isLink: { 40986 type: 'boolean', 40987 default: false 40988 } 40989 }, 40990 supports: { 40991 html: false, 40992 color: { 40993 gradients: true, 40994 link: true 40995 }, 40996 typography: { 40997 fontSize: true, 40998 lineHeight: true, 40999 __experimentalFontFamily: true, 41000 __experimentalFontWeight: true, 41001 __experimentalFontStyle: true, 41002 __experimentalTextTransform: true, 41003 __experimentalLetterSpacing: true 41004 } 41005 }, 41006 save() { 41007 return null; 41008 }, 41009 migrate: migrate_font_family, 41010 isEligible({ 41011 style 41012 }) { 41013 return style?.typography?.fontFamily; 41014 } 41015 }; 41016 41017 /** 41018 * New deprecations need to be placed first 41019 * for them to have higher priority. 41020 * 41021 * Old deprecations may need to be updated as well. 41022 * 41023 * See block-deprecation.md 41024 */ 41025 /* harmony default export */ const post_date_deprecated = ([post_date_deprecated_v1]); 41026 41027 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/variations.js 41028 /** 41029 * WordPress dependencies 41030 */ 41031 41032 41033 const post_date_variations_variations = [{ 41034 name: 'post-date-modified', 41035 title: (0,external_wp_i18n_namespaceObject.__)('Modified Date'), 41036 description: (0,external_wp_i18n_namespaceObject.__)("Display a post's last updated date."), 41037 attributes: { 41038 displayType: 'modified' 41039 }, 41040 scope: ['block', 'inserter'], 41041 isActive: blockAttributes => blockAttributes.displayType === 'modified', 41042 icon: post_date 41043 }]; 41044 /* harmony default export */ const post_date_variations = (post_date_variations_variations); 41045 41046 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js 41047 /** 41048 * WordPress dependencies 41049 */ 41050 41051 41052 /** 41053 * Internal dependencies 41054 */ 41055 41056 const post_date_metadata = { 41057 $schema: "https://schemas.wp.org/trunk/block.json", 41058 apiVersion: 3, 41059 name: "core/post-date", 41060 title: "Date", 41061 category: "theme", 41062 description: "Display the publish date for an entry such as a post or page.", 41063 textdomain: "default", 41064 attributes: { 41065 textAlign: { 41066 type: "string" 41067 }, 41068 format: { 41069 type: "string" 41070 }, 41071 isLink: { 41072 type: "boolean", 41073 "default": false 41074 }, 41075 displayType: { 41076 type: "string", 41077 "default": "date" 41078 } 41079 }, 41080 usesContext: ["postId", "postType", "queryId"], 41081 supports: { 41082 html: false, 41083 color: { 41084 gradients: true, 41085 link: true, 41086 __experimentalDefaultControls: { 41087 background: true, 41088 text: true, 41089 link: true 41090 } 41091 }, 41092 spacing: { 41093 margin: true, 41094 padding: true 41095 }, 41096 typography: { 41097 fontSize: true, 41098 lineHeight: true, 41099 __experimentalFontFamily: true, 41100 __experimentalFontWeight: true, 41101 __experimentalFontStyle: true, 41102 __experimentalTextTransform: true, 41103 __experimentalTextDecoration: true, 41104 __experimentalLetterSpacing: true, 41105 __experimentalDefaultControls: { 41106 fontSize: true 41107 } 41108 }, 41109 interactivity: { 41110 clientNavigation: true 41111 } 41112 } 41113 }; 41114 41115 41116 41117 const { 41118 name: post_date_name 41119 } = post_date_metadata; 41120 41121 const post_date_settings = { 41122 icon: post_date, 41123 edit: PostDateEdit, 41124 deprecated: post_date_deprecated, 41125 variations: post_date_variations 41126 }; 41127 const post_date_init = () => initBlock({ 41128 name: post_date_name, 41129 metadata: post_date_metadata, 41130 settings: post_date_settings 41131 }); 41132 41133 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js 41134 41135 /** 41136 * WordPress dependencies 41137 */ 41138 41139 const postExcerpt = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41140 xmlns: "http://www.w3.org/2000/svg", 41141 viewBox: "0 0 24 24" 41142 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41143 d: "M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z" 41144 })); 41145 /* harmony default export */ const post_excerpt = (postExcerpt); 41146 41147 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js 41148 41149 /** 41150 * External dependencies 41151 */ 41152 41153 41154 /** 41155 * WordPress dependencies 41156 */ 41157 41158 41159 41160 41161 41162 41163 41164 /** 41165 * Internal dependencies 41166 */ 41167 41168 const ELLIPSIS = '…'; 41169 function PostExcerptEditor({ 41170 attributes: { 41171 textAlign, 41172 moreText, 41173 showMoreOnNewLine, 41174 excerptLength 41175 }, 41176 setAttributes, 41177 isSelected, 41178 context: { 41179 postId, 41180 postType, 41181 queryId 41182 } 41183 }) { 41184 const isDescendentOfQueryLoop = Number.isFinite(queryId); 41185 const userCanEdit = useCanEditEntity('postType', postType, postId); 41186 const [rawExcerpt, setExcerpt, { 41187 rendered: renderedExcerpt, 41188 protected: isProtected 41189 } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId); 41190 41191 /** 41192 * Check if the post type supports excerpts. 41193 * Add an exception and return early for the "page" post type, 41194 * which is registered without support for the excerpt UI, 41195 * but supports saving the excerpt to the database. 41196 * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65 41197 * Without this exception, users that have excerpts saved to the database will 41198 * not be able to edit the excerpts. 41199 */ 41200 const postTypeSupportsExcerpts = (0,external_wp_data_namespaceObject.useSelect)(select => { 41201 if (postType === 'page') { 41202 return true; 41203 } 41204 return !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports?.excerpt; 41205 }, [postType]); 41206 41207 /** 41208 * The excerpt is editable if: 41209 * - The user can edit the post 41210 * - It is not a descendent of a Query Loop block 41211 * - The post type supports excerpts 41212 */ 41213 const isEditable = userCanEdit && !isDescendentOfQueryLoop && postTypeSupportsExcerpts; 41214 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 41215 className: classnames_default()({ 41216 [`has-text-align-$textAlign}`]: textAlign 41217 }) 41218 }); 41219 41220 /** 41221 * translators: If your word count is based on single characters (e.g. East Asian characters), 41222 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 41223 * Do not translate into your own language. 41224 */ 41225 const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); 41226 41227 /** 41228 * When excerpt is editable, strip the html tags from 41229 * rendered excerpt. This will be used if the entity's 41230 * excerpt has been produced from the content. 41231 */ 41232 const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => { 41233 if (!renderedExcerpt) return ''; 41234 const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html'); 41235 return document.body.textContent || document.body.innerText || ''; 41236 }, [renderedExcerpt]); 41237 if (!postType || !postId) { 41238 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 41239 value: textAlign, 41240 onChange: newAlign => setAttributes({ 41241 textAlign: newAlign 41242 }) 41243 })), (0,external_React_namespaceObject.createElement)("div", { 41244 ...blockProps 41245 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This block will display the excerpt.')))); 41246 } 41247 if (isProtected && !userCanEdit) { 41248 return (0,external_React_namespaceObject.createElement)("div", { 41249 ...blockProps 41250 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('The content is currently protected and does not have the available excerpt.'))); 41251 } 41252 const readMoreLink = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 41253 className: "wp-block-post-excerpt__more-link", 41254 tagName: "a", 41255 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 41256 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'), 41257 value: moreText, 41258 onChange: newMoreText => setAttributes({ 41259 moreText: newMoreText 41260 }), 41261 withoutInteractiveFormatting: true 41262 }); 41263 const excerptClassName = classnames_default()('wp-block-post-excerpt__excerpt', { 41264 'is-inline': !showMoreOnNewLine 41265 }); 41266 41267 /** 41268 * The excerpt length setting needs to be applied to both 41269 * the raw and the rendered excerpt depending on which is being used. 41270 */ 41271 const rawOrRenderedExcerpt = (rawExcerpt || strippedRenderedExcerpt).trim(); 41272 let trimmedExcerpt = ''; 41273 if (wordCountType === 'words') { 41274 trimmedExcerpt = rawOrRenderedExcerpt.split(' ', excerptLength).join(' '); 41275 } else if (wordCountType === 'characters_excluding_spaces') { 41276 /* 41277 * 1. Split the excerpt at the character limit, 41278 * then join the substrings back into one string. 41279 * 2. Count the number of spaces in the excerpt 41280 * by comparing the lengths of the string with and without spaces. 41281 * 3. Add the number to the length of the visible excerpt, 41282 * so that the spaces are excluded from the word count. 41283 */ 41284 const excerptWithSpaces = rawOrRenderedExcerpt.split('', excerptLength).join(''); 41285 const numberOfSpaces = excerptWithSpaces.length - excerptWithSpaces.replaceAll(' ', '').length; 41286 trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength + numberOfSpaces).join(''); 41287 } else if (wordCountType === 'characters_including_spaces') { 41288 trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength).join(''); 41289 } 41290 const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt; 41291 const excerptContent = isEditable ? (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 41292 className: excerptClassName, 41293 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Excerpt text'), 41294 value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0,external_wp_i18n_namespaceObject.__)('No excerpt found'), 41295 onChange: setExcerpt, 41296 tagName: "p" 41297 }) : (0,external_React_namespaceObject.createElement)("p", { 41298 className: excerptClassName 41299 }, !isTrimmed ? rawOrRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No excerpt found') : trimmedExcerpt + ELLIPSIS); 41300 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 41301 value: textAlign, 41302 onChange: newAlign => setAttributes({ 41303 textAlign: newAlign 41304 }) 41305 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 41306 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 41307 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 41308 __nextHasNoMarginBottom: true, 41309 label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'), 41310 checked: showMoreOnNewLine, 41311 onChange: newShowMoreOnNewLine => setAttributes({ 41312 showMoreOnNewLine: newShowMoreOnNewLine 41313 }) 41314 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 41315 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 41316 value: excerptLength, 41317 onChange: value => { 41318 setAttributes({ 41319 excerptLength: value 41320 }); 41321 }, 41322 min: "10", 41323 max: "100" 41324 }))), (0,external_React_namespaceObject.createElement)("div", { 41325 ...blockProps 41326 }, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_React_namespaceObject.createElement)("p", { 41327 className: "wp-block-post-excerpt__more-text" 41328 }, readMoreLink) : readMoreLink)); 41329 } 41330 41331 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js 41332 /** 41333 * WordPress dependencies 41334 */ 41335 41336 const post_excerpt_transforms_transforms = { 41337 from: [{ 41338 type: 'block', 41339 blocks: ['core/post-content'], 41340 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt') 41341 }], 41342 to: [{ 41343 type: 'block', 41344 blocks: ['core/post-content'], 41345 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content') 41346 }] 41347 }; 41348 /* harmony default export */ const post_excerpt_transforms = (post_excerpt_transforms_transforms); 41349 41350 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js 41351 /** 41352 * WordPress dependencies 41353 */ 41354 41355 41356 /** 41357 * Internal dependencies 41358 */ 41359 41360 const post_excerpt_metadata = { 41361 $schema: "https://schemas.wp.org/trunk/block.json", 41362 apiVersion: 3, 41363 name: "core/post-excerpt", 41364 title: "Excerpt", 41365 category: "theme", 41366 description: "Display the excerpt.", 41367 textdomain: "default", 41368 attributes: { 41369 textAlign: { 41370 type: "string" 41371 }, 41372 moreText: { 41373 type: "string" 41374 }, 41375 showMoreOnNewLine: { 41376 type: "boolean", 41377 "default": true 41378 }, 41379 excerptLength: { 41380 type: "number", 41381 "default": 55 41382 } 41383 }, 41384 usesContext: ["postId", "postType", "queryId"], 41385 supports: { 41386 html: false, 41387 color: { 41388 gradients: true, 41389 link: true, 41390 __experimentalDefaultControls: { 41391 background: true, 41392 text: true, 41393 link: true 41394 } 41395 }, 41396 spacing: { 41397 margin: true, 41398 padding: true 41399 }, 41400 typography: { 41401 fontSize: true, 41402 lineHeight: true, 41403 __experimentalFontFamily: true, 41404 __experimentalFontWeight: true, 41405 __experimentalFontStyle: true, 41406 __experimentalTextTransform: true, 41407 __experimentalTextDecoration: true, 41408 __experimentalLetterSpacing: true, 41409 __experimentalDefaultControls: { 41410 fontSize: true 41411 } 41412 }, 41413 interactivity: { 41414 clientNavigation: true 41415 } 41416 }, 41417 editorStyle: "wp-block-post-excerpt-editor", 41418 style: "wp-block-post-excerpt" 41419 }; 41420 41421 41422 const { 41423 name: post_excerpt_name 41424 } = post_excerpt_metadata; 41425 41426 const post_excerpt_settings = { 41427 icon: post_excerpt, 41428 transforms: post_excerpt_transforms, 41429 edit: PostExcerptEditor 41430 }; 41431 const post_excerpt_init = () => initBlock({ 41432 name: post_excerpt_name, 41433 metadata: post_excerpt_metadata, 41434 settings: post_excerpt_settings 41435 }); 41436 41437 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js 41438 41439 /** 41440 * WordPress dependencies 41441 */ 41442 41443 const postFeaturedImage = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 41444 xmlns: "http://www.w3.org/2000/svg", 41445 viewBox: "0 0 24 24" 41446 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 41447 d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" 41448 })); 41449 /* harmony default export */ const post_featured_image = (postFeaturedImage); 41450 41451 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js 41452 41453 /** 41454 * WordPress dependencies 41455 */ 41456 41457 41458 41459 const SCALE_OPTIONS = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 41460 value: "cover", 41461 label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control') 41462 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 41463 value: "contain", 41464 label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control') 41465 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 41466 value: "fill", 41467 label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control') 41468 })); 41469 const DEFAULT_SCALE = 'cover'; 41470 const DEFAULT_SIZE = 'full'; 41471 const scaleHelp = { 41472 cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'), 41473 contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'), 41474 fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.') 41475 }; 41476 const DimensionControls = ({ 41477 clientId, 41478 attributes: { 41479 aspectRatio, 41480 width, 41481 height, 41482 scale, 41483 sizeSlug 41484 }, 41485 setAttributes, 41486 imageSizeOptions = [] 41487 }) => { 41488 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 41489 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 41490 availableUnits: availableUnits || ['px', '%', 'vw', 'em', 'rem'] 41491 }); 41492 const onDimensionChange = (dimension, nextValue) => { 41493 const parsedValue = parseFloat(nextValue); 41494 /** 41495 * If we have no value set and we change the unit, 41496 * we don't want to set the attribute, as it would 41497 * end up having the unit as value without any number. 41498 */ 41499 if (isNaN(parsedValue) && nextValue) return; 41500 setAttributes({ 41501 [dimension]: parsedValue < 0 ? '0' : nextValue 41502 }); 41503 }; 41504 const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options'); 41505 const showScaleControl = height || aspectRatio && aspectRatio !== 'auto'; 41506 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 41507 group: "dimensions" 41508 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41509 hasValue: () => !!aspectRatio, 41510 label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), 41511 onDeselect: () => setAttributes({ 41512 aspectRatio: undefined 41513 }), 41514 resetAllFilter: () => ({ 41515 aspectRatio: undefined 41516 }), 41517 isShownByDefault: true, 41518 panelId: clientId 41519 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 41520 __nextHasNoMarginBottom: true, 41521 label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), 41522 value: aspectRatio, 41523 options: [ 41524 // These should use the same values as AspectRatioDropdown in @wordpress/block-editor 41525 { 41526 label: (0,external_wp_i18n_namespaceObject.__)('Original'), 41527 value: 'auto' 41528 }, { 41529 label: (0,external_wp_i18n_namespaceObject.__)('Square'), 41530 value: '1' 41531 }, { 41532 label: (0,external_wp_i18n_namespaceObject.__)('16:9'), 41533 value: '16/9' 41534 }, { 41535 label: (0,external_wp_i18n_namespaceObject.__)('4:3'), 41536 value: '4/3' 41537 }, { 41538 label: (0,external_wp_i18n_namespaceObject.__)('3:2'), 41539 value: '3/2' 41540 }, { 41541 label: (0,external_wp_i18n_namespaceObject.__)('9:16'), 41542 value: '9/16' 41543 }, { 41544 label: (0,external_wp_i18n_namespaceObject.__)('3:4'), 41545 value: '3/4' 41546 }, { 41547 label: (0,external_wp_i18n_namespaceObject.__)('2:3'), 41548 value: '2/3' 41549 }], 41550 onChange: nextAspectRatio => setAttributes({ 41551 aspectRatio: nextAspectRatio 41552 }) 41553 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41554 className: "single-column", 41555 hasValue: () => !!height, 41556 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 41557 onDeselect: () => setAttributes({ 41558 height: undefined 41559 }), 41560 resetAllFilter: () => ({ 41561 height: undefined 41562 }), 41563 isShownByDefault: true, 41564 panelId: clientId 41565 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 41566 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 41567 labelPosition: "top", 41568 value: height || '', 41569 min: 0, 41570 onChange: nextHeight => onDimensionChange('height', nextHeight), 41571 units: units 41572 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41573 className: "single-column", 41574 hasValue: () => !!width, 41575 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 41576 onDeselect: () => setAttributes({ 41577 width: undefined 41578 }), 41579 resetAllFilter: () => ({ 41580 width: undefined 41581 }), 41582 isShownByDefault: true, 41583 panelId: clientId 41584 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 41585 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 41586 labelPosition: "top", 41587 value: width || '', 41588 min: 0, 41589 onChange: nextWidth => onDimensionChange('width', nextWidth), 41590 units: units 41591 })), showScaleControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41592 hasValue: () => !!scale && scale !== DEFAULT_SCALE, 41593 label: scaleLabel, 41594 onDeselect: () => setAttributes({ 41595 scale: DEFAULT_SCALE 41596 }), 41597 resetAllFilter: () => ({ 41598 scale: DEFAULT_SCALE 41599 }), 41600 isShownByDefault: true, 41601 panelId: clientId 41602 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 41603 __nextHasNoMarginBottom: true, 41604 label: scaleLabel, 41605 value: scale, 41606 help: scaleHelp[scale], 41607 onChange: value => setAttributes({ 41608 scale: value 41609 }), 41610 isBlock: true 41611 }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41612 hasValue: () => !!sizeSlug, 41613 label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), 41614 onDeselect: () => setAttributes({ 41615 sizeSlug: undefined 41616 }), 41617 resetAllFilter: () => ({ 41618 sizeSlug: undefined 41619 }), 41620 isShownByDefault: false, 41621 panelId: clientId 41622 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 41623 __nextHasNoMarginBottom: true, 41624 label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), 41625 value: sizeSlug || DEFAULT_SIZE, 41626 options: imageSizeOptions, 41627 onChange: nextSizeSlug => setAttributes({ 41628 sizeSlug: nextSizeSlug 41629 }), 41630 help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.') 41631 }))); 41632 }; 41633 /* harmony default export */ const dimension_controls = (DimensionControls); 41634 41635 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/utils.js 41636 /** 41637 * Generates the opacity/dim class based on given number. 41638 * 41639 * @param {number} ratio Dim/opacity number. 41640 * 41641 * @return {string} Generated class. 41642 */ 41643 function utils_dimRatioToClass(ratio) { 41644 return ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 41645 } 41646 41647 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay.js 41648 41649 /** 41650 * External dependencies 41651 */ 41652 41653 41654 /** 41655 * WordPress dependencies 41656 */ 41657 41658 41659 41660 41661 41662 /** 41663 * Internal dependencies 41664 */ 41665 41666 const Overlay = ({ 41667 clientId, 41668 attributes, 41669 setAttributes, 41670 overlayColor, 41671 setOverlayColor 41672 }) => { 41673 const { 41674 dimRatio 41675 } = attributes; 41676 const { 41677 gradientClass, 41678 gradientValue, 41679 setGradient 41680 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 41681 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 41682 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 41683 const overlayStyles = { 41684 backgroundColor: overlayColor.color, 41685 backgroundImage: gradientValue, 41686 ...borderProps.style 41687 }; 41688 if (!colorGradientSettings.hasColorsOrGradients) { 41689 return null; 41690 } 41691 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !!dimRatio && (0,external_React_namespaceObject.createElement)("span", { 41692 "aria-hidden": "true", 41693 className: classnames_default()('wp-block-post-featured-image__overlay', utils_dimRatioToClass(dimRatio), { 41694 [overlayColor.class]: overlayColor.class, 41695 'has-background-dim': dimRatio !== undefined, 41696 'has-background-gradient': gradientValue, 41697 [gradientClass]: gradientClass 41698 }, borderProps.className), 41699 style: overlayStyles 41700 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 41701 group: "color" 41702 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 41703 __experimentalIsRenderedInSidebar: true, 41704 settings: [{ 41705 colorValue: overlayColor.color, 41706 gradientValue, 41707 label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), 41708 onColorChange: setOverlayColor, 41709 onGradientChange: setGradient, 41710 isShownByDefault: true, 41711 resetAllFilter: () => ({ 41712 overlayColor: undefined, 41713 customOverlayColor: undefined, 41714 gradient: undefined, 41715 customGradient: undefined 41716 }) 41717 }], 41718 panelId: clientId, 41719 ...colorGradientSettings 41720 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41721 hasValue: () => dimRatio !== undefined, 41722 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 41723 onDeselect: () => setAttributes({ 41724 dimRatio: 0 41725 }), 41726 resetAllFilter: () => ({ 41727 dimRatio: 0 41728 }), 41729 isShownByDefault: true, 41730 panelId: clientId 41731 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 41732 __nextHasNoMarginBottom: true, 41733 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 41734 value: dimRatio, 41735 onChange: newDimRatio => setAttributes({ 41736 dimRatio: newDimRatio 41737 }), 41738 min: 0, 41739 max: 100, 41740 step: 10, 41741 required: true, 41742 __next40pxDefaultSize: true 41743 })))); 41744 }; 41745 /* harmony default export */ const overlay = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ 41746 overlayColor: 'background-color' 41747 })])(Overlay)); 41748 41749 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js 41750 41751 /** 41752 * External dependencies 41753 */ 41754 41755 41756 /** 41757 * WordPress dependencies 41758 */ 41759 41760 41761 41762 41763 41764 41765 41766 41767 41768 /** 41769 * Internal dependencies 41770 */ 41771 41772 41773 const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image']; 41774 function getMediaSourceUrlBySizeSlug(media, slug) { 41775 return media?.media_details?.sizes?.[slug]?.source_url || media?.source_url; 41776 } 41777 const disabledClickProps = { 41778 onClick: event => event.preventDefault(), 41779 'aria-disabled': true 41780 }; 41781 function PostFeaturedImageEdit({ 41782 clientId, 41783 attributes, 41784 setAttributes, 41785 context: { 41786 postId, 41787 postType: postTypeSlug, 41788 queryId 41789 } 41790 }) { 41791 const isDescendentOfQueryLoop = Number.isFinite(queryId); 41792 const { 41793 isLink, 41794 aspectRatio, 41795 height, 41796 width, 41797 scale, 41798 sizeSlug, 41799 rel, 41800 linkTarget, 41801 useFirstImageFromPost 41802 } = attributes; 41803 const [storedFeaturedImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId); 41804 41805 // Fallback to post content if no featured image is set. 41806 // This is needed for the "Use first image from post" option. 41807 const [postContent] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'content', postId); 41808 const featuredImage = (0,external_wp_element_namespaceObject.useMemo)(() => { 41809 if (storedFeaturedImage) { 41810 return storedFeaturedImage; 41811 } 41812 if (!useFirstImageFromPost) { 41813 return; 41814 } 41815 const imageOpener = /<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec(postContent); 41816 const imageId = imageOpener?.groups?.attrs && JSON.parse(imageOpener.groups.attrs)?.id; 41817 return imageId; 41818 }, [storedFeaturedImage, useFirstImageFromPost, postContent]); 41819 const { 41820 media, 41821 postType, 41822 postPermalink 41823 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 41824 const { 41825 getMedia, 41826 getPostType, 41827 getEditedEntityRecord 41828 } = select(external_wp_coreData_namespaceObject.store); 41829 return { 41830 media: featuredImage && getMedia(featuredImage, { 41831 context: 'view' 41832 }), 41833 postType: postTypeSlug && getPostType(postTypeSlug), 41834 postPermalink: getEditedEntityRecord('postType', postTypeSlug, postId)?.link 41835 }; 41836 }, [featuredImage, postTypeSlug, postId]); 41837 const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug); 41838 const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []); 41839 const imageSizeOptions = imageSizes.filter(({ 41840 slug 41841 }) => { 41842 return media?.media_details?.sizes?.[slug]?.source_url; 41843 }).map(({ 41844 name, 41845 slug 41846 }) => ({ 41847 value: slug, 41848 label: name 41849 })); 41850 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 41851 style: { 41852 width, 41853 height, 41854 aspectRatio 41855 } 41856 }); 41857 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 41858 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 41859 const placeholder = content => { 41860 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 41861 className: classnames_default()('block-editor-media-placeholder', borderProps.className), 41862 withIllustration: true, 41863 style: { 41864 height: !!aspectRatio && '100%', 41865 width: !!aspectRatio && '100%', 41866 ...borderProps.style 41867 } 41868 }, content); 41869 }; 41870 const onSelectImage = value => { 41871 if (value?.id) { 41872 setFeaturedImage(value.id); 41873 } 41874 }; 41875 const { 41876 createErrorNotice 41877 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 41878 const onUploadError = message => { 41879 createErrorNotice(message, { 41880 type: 'snackbar' 41881 }); 41882 }; 41883 const controls = blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(overlay, { 41884 attributes: attributes, 41885 setAttributes: setAttributes, 41886 clientId: clientId 41887 }), (0,external_React_namespaceObject.createElement)(dimension_controls, { 41888 clientId: clientId, 41889 attributes: attributes, 41890 setAttributes: setAttributes, 41891 imageSizeOptions: imageSizeOptions 41892 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 41893 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 41894 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 41895 __nextHasNoMarginBottom: true, 41896 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 41897 // translators: %s: Name of the post type e.g: "Page". 41898 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 41899 onChange: () => setAttributes({ 41900 isLink: !isLink 41901 }), 41902 checked: isLink 41903 }), isLink && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 41904 __nextHasNoMarginBottom: true, 41905 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 41906 onChange: value => setAttributes({ 41907 linkTarget: value ? '_blank' : '_self' 41908 }), 41909 checked: linkTarget === '_blank' 41910 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 41911 __nextHasNoMarginBottom: true, 41912 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 41913 value: rel, 41914 onChange: newRel => setAttributes({ 41915 rel: newRel 41916 }) 41917 }))))); 41918 let image; 41919 41920 /** 41921 * A Post Featured Image block should not have image replacement 41922 * or upload options in the following cases: 41923 * - Is placed in a Query Loop. This is a consious decision to 41924 * prevent content editing of different posts in Query Loop, and 41925 * this could change in the future. 41926 * - Is in a context where it does not have a postId (for example 41927 * in a template or template part). 41928 */ 41929 if (!featuredImage && (isDescendentOfQueryLoop || !postId)) { 41930 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, controls, (0,external_React_namespaceObject.createElement)("div", { 41931 ...blockProps 41932 }, !!isLink ? (0,external_React_namespaceObject.createElement)("a", { 41933 href: postPermalink, 41934 target: linkTarget, 41935 ...disabledClickProps 41936 }, placeholder()) : placeholder())); 41937 } 41938 const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image'); 41939 const imageStyles = { 41940 ...borderProps.style, 41941 height: aspectRatio ? '100%' : height, 41942 width: !!aspectRatio && '100%', 41943 objectFit: !!(height || aspectRatio) && scale 41944 }; 41945 41946 /** 41947 * When the post featured image block is placed in a context where: 41948 * - It has a postId (for example in a single post) 41949 * - It is not inside a query loop 41950 * - It has no image assigned yet 41951 * Then display the placeholder with the image upload option. 41952 */ 41953 if (!featuredImage) { 41954 image = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 41955 onSelect: onSelectImage, 41956 accept: "image/*", 41957 allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, 41958 onError: onUploadError, 41959 placeholder: placeholder, 41960 mediaLibraryButton: ({ 41961 open 41962 }) => { 41963 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 41964 icon: library_upload, 41965 variant: "primary", 41966 label: label, 41967 showTooltip: true, 41968 tooltipPosition: "top center", 41969 onClick: () => { 41970 open(); 41971 } 41972 }); 41973 } 41974 }); 41975 } else { 41976 // We have a Featured image so show a Placeholder if is loading. 41977 image = !media ? placeholder() : (0,external_React_namespaceObject.createElement)("img", { 41978 className: borderProps.className, 41979 src: mediaUrl, 41980 alt: media.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( 41981 // translators: %s: The image's alt text. 41982 (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'), 41983 style: imageStyles 41984 }); 41985 } 41986 41987 /** 41988 * When the post featured image block: 41989 * - Has an image assigned 41990 * - Is not inside a query loop 41991 * Then display the image and the image replacement option. 41992 */ 41993 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 41994 group: "other" 41995 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 41996 mediaId: featuredImage, 41997 mediaURL: mediaUrl, 41998 allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, 41999 accept: "image/*", 42000 onSelect: onSelectImage, 42001 onError: onUploadError 42002 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 42003 onClick: () => setFeaturedImage(0) 42004 }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_React_namespaceObject.createElement)("figure", { 42005 ...blockProps 42006 }, !!isLink ? (0,external_React_namespaceObject.createElement)("a", { 42007 href: postPermalink, 42008 target: linkTarget, 42009 ...disabledClickProps 42010 }, image) : image)); 42011 } 42012 42013 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js 42014 /** 42015 * WordPress dependencies 42016 */ 42017 42018 42019 /** 42020 * Internal dependencies 42021 */ 42022 42023 const post_featured_image_metadata = { 42024 $schema: "https://schemas.wp.org/trunk/block.json", 42025 apiVersion: 3, 42026 name: "core/post-featured-image", 42027 title: "Featured Image", 42028 category: "theme", 42029 description: "Display a post's featured image.", 42030 textdomain: "default", 42031 attributes: { 42032 isLink: { 42033 type: "boolean", 42034 "default": false 42035 }, 42036 aspectRatio: { 42037 type: "string" 42038 }, 42039 width: { 42040 type: "string" 42041 }, 42042 height: { 42043 type: "string" 42044 }, 42045 scale: { 42046 type: "string", 42047 "default": "cover" 42048 }, 42049 sizeSlug: { 42050 type: "string" 42051 }, 42052 rel: { 42053 type: "string", 42054 attribute: "rel", 42055 "default": "" 42056 }, 42057 linkTarget: { 42058 type: "string", 42059 "default": "_self" 42060 }, 42061 overlayColor: { 42062 type: "string" 42063 }, 42064 customOverlayColor: { 42065 type: "string" 42066 }, 42067 dimRatio: { 42068 type: "number", 42069 "default": 0 42070 }, 42071 gradient: { 42072 type: "string" 42073 }, 42074 customGradient: { 42075 type: "string" 42076 }, 42077 useFirstImageFromPost: { 42078 type: "boolean", 42079 "default": false 42080 } 42081 }, 42082 usesContext: ["postId", "postType", "queryId"], 42083 supports: { 42084 align: ["left", "right", "center", "wide", "full"], 42085 color: { 42086 __experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before", 42087 text: false, 42088 background: false 42089 }, 42090 __experimentalBorder: { 42091 color: true, 42092 radius: true, 42093 width: true, 42094 __experimentalSelector: "img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay", 42095 __experimentalSkipSerialization: true, 42096 __experimentalDefaultControls: { 42097 color: true, 42098 radius: true, 42099 width: true 42100 } 42101 }, 42102 html: false, 42103 spacing: { 42104 margin: true, 42105 padding: true 42106 }, 42107 interactivity: { 42108 clientNavigation: true 42109 } 42110 }, 42111 editorStyle: "wp-block-post-featured-image-editor", 42112 style: "wp-block-post-featured-image" 42113 }; 42114 42115 const { 42116 name: post_featured_image_name 42117 } = post_featured_image_metadata; 42118 42119 const post_featured_image_settings = { 42120 icon: post_featured_image, 42121 edit: PostFeaturedImageEdit 42122 }; 42123 const post_featured_image_init = () => initBlock({ 42124 name: post_featured_image_name, 42125 metadata: post_featured_image_metadata, 42126 settings: post_featured_image_settings 42127 }); 42128 42129 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js 42130 42131 /** 42132 * External dependencies 42133 */ 42134 42135 42136 /** 42137 * WordPress dependencies 42138 */ 42139 42140 42141 42142 42143 42144 function PostNavigationLinkEdit({ 42145 context: { 42146 postType 42147 }, 42148 attributes: { 42149 type, 42150 label, 42151 showTitle, 42152 textAlign, 42153 linkLabel, 42154 arrow, 42155 taxonomy 42156 }, 42157 setAttributes 42158 }) { 42159 const isNext = type === 'next'; 42160 let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous'); 42161 const arrowMap = { 42162 none: '', 42163 arrow: isNext ? '→' : '←', 42164 chevron: isNext ? '»' : '«' 42165 }; 42166 const displayArrow = arrowMap[arrow]; 42167 if (showTitle) { 42168 /* translators: Label before for next and previous post. There is a space after the colon. */ 42169 placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: '); 42170 } 42171 const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post'); 42172 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42173 className: classnames_default()({ 42174 [`has-text-align-$textAlign}`]: textAlign 42175 }) 42176 }); 42177 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { 42178 const { 42179 getTaxonomies 42180 } = select(external_wp_coreData_namespaceObject.store); 42181 const filteredTaxonomies = getTaxonomies({ 42182 type: postType, 42183 per_page: -1 42184 }); 42185 return filteredTaxonomies; 42186 }, [postType]); 42187 const getTaxonomyOptions = () => { 42188 const selectOption = { 42189 label: (0,external_wp_i18n_namespaceObject.__)('Unfiltered'), 42190 value: '' 42191 }; 42192 const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(({ 42193 visibility 42194 }) => !!visibility?.publicly_queryable).map(item => { 42195 return { 42196 value: item.slug, 42197 label: item.name 42198 }; 42199 }); 42200 return [selectOption, ...taxonomyOptions]; 42201 }; 42202 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 42203 __nextHasNoMarginBottom: true, 42204 label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'), 42205 help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'), 42206 checked: !!showTitle, 42207 onChange: () => setAttributes({ 42208 showTitle: !showTitle 42209 }) 42210 }), showTitle && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 42211 __nextHasNoMarginBottom: true, 42212 label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'), 42213 checked: !!linkLabel, 42214 onChange: () => setAttributes({ 42215 linkLabel: !linkLabel 42216 }) 42217 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 42218 __nextHasNoMarginBottom: true, 42219 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 42220 value: arrow, 42221 onChange: value => { 42222 setAttributes({ 42223 arrow: value 42224 }); 42225 }, 42226 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow for the next and previous link.'), 42227 isBlock: true 42228 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 42229 value: "none", 42230 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Next/Previous link') 42231 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 42232 value: "arrow", 42233 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Next/Previous link') 42234 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 42235 value: "chevron", 42236 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Next/Previous link') 42237 })))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 42238 group: "advanced" 42239 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 42240 label: (0,external_wp_i18n_namespaceObject.__)('Filter by taxonomy'), 42241 value: taxonomy, 42242 options: getTaxonomyOptions(), 42243 onChange: value => setAttributes({ 42244 taxonomy: value 42245 }), 42246 help: (0,external_wp_i18n_namespaceObject.__)('Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.') 42247 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 42248 value: textAlign, 42249 onChange: nextAlign => { 42250 setAttributes({ 42251 textAlign: nextAlign 42252 }); 42253 } 42254 })), (0,external_React_namespaceObject.createElement)("div", { 42255 ...blockProps 42256 }, !isNext && displayArrow && (0,external_React_namespaceObject.createElement)("span", { 42257 className: `wp-block-post-navigation-link__arrow-previous is-arrow-$arrow}` 42258 }, displayArrow), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 42259 tagName: "a", 42260 "aria-label": ariaLabel, 42261 placeholder: placeholder, 42262 value: label, 42263 allowedFormats: ['core/bold', 'core/italic'], 42264 onChange: newLabel => setAttributes({ 42265 label: newLabel 42266 }) 42267 }), showTitle && (0,external_React_namespaceObject.createElement)("a", { 42268 href: "#post-navigation-pseudo-link", 42269 onClick: event => event.preventDefault() 42270 }, (0,external_wp_i18n_namespaceObject.__)('An example title')), isNext && displayArrow && (0,external_React_namespaceObject.createElement)("span", { 42271 className: `wp-block-post-navigation-link__arrow-next is-arrow-$arrow}`, 42272 "aria-hidden": true 42273 }, displayArrow))); 42274 } 42275 42276 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js 42277 42278 /** 42279 * WordPress dependencies 42280 */ 42281 42282 const next = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42283 xmlns: "http://www.w3.org/2000/svg", 42284 viewBox: "0 0 24 24" 42285 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42286 d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" 42287 })); 42288 /* harmony default export */ const library_next = (next); 42289 42290 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js 42291 42292 /** 42293 * WordPress dependencies 42294 */ 42295 42296 const previous = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42297 xmlns: "http://www.w3.org/2000/svg", 42298 viewBox: "0 0 24 24" 42299 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42300 d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" 42301 })); 42302 /* harmony default export */ const library_previous = (previous); 42303 42304 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js 42305 /** 42306 * WordPress dependencies 42307 */ 42308 42309 42310 const post_navigation_link_variations_variations = [{ 42311 isDefault: true, 42312 name: 'post-next', 42313 title: (0,external_wp_i18n_namespaceObject.__)('Next post'), 42314 description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'), 42315 icon: library_next, 42316 attributes: { 42317 type: 'next' 42318 }, 42319 scope: ['inserter', 'transform'] 42320 }, { 42321 name: 'post-previous', 42322 title: (0,external_wp_i18n_namespaceObject.__)('Previous post'), 42323 description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'), 42324 icon: library_previous, 42325 attributes: { 42326 type: 'previous' 42327 }, 42328 scope: ['inserter', 'transform'] 42329 }]; 42330 42331 /** 42332 * Add `isActive` function to all `post-navigation-link` variations, if not defined. 42333 * `isActive` function is used to find a variation match from a created 42334 * Block by providing its attributes. 42335 */ 42336 post_navigation_link_variations_variations.forEach(variation => { 42337 if (variation.isActive) return; 42338 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; 42339 }); 42340 /* harmony default export */ const post_navigation_link_variations = (post_navigation_link_variations_variations); 42341 42342 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js 42343 /** 42344 * Internal dependencies 42345 */ 42346 42347 const post_navigation_link_metadata = { 42348 $schema: "https://schemas.wp.org/trunk/block.json", 42349 apiVersion: 3, 42350 name: "core/post-navigation-link", 42351 title: "Post Navigation Link", 42352 category: "theme", 42353 description: "Displays the next or previous post link that is adjacent to the current post.", 42354 textdomain: "default", 42355 attributes: { 42356 textAlign: { 42357 type: "string" 42358 }, 42359 type: { 42360 type: "string", 42361 "default": "next" 42362 }, 42363 label: { 42364 type: "string" 42365 }, 42366 showTitle: { 42367 type: "boolean", 42368 "default": false 42369 }, 42370 linkLabel: { 42371 type: "boolean", 42372 "default": false 42373 }, 42374 arrow: { 42375 type: "string", 42376 "default": "none" 42377 }, 42378 taxonomy: { 42379 type: "string", 42380 "default": "" 42381 } 42382 }, 42383 usesContext: ["postType"], 42384 supports: { 42385 reusable: false, 42386 html: false, 42387 color: { 42388 link: true 42389 }, 42390 typography: { 42391 fontSize: true, 42392 lineHeight: true, 42393 __experimentalFontFamily: true, 42394 __experimentalFontWeight: true, 42395 __experimentalFontStyle: true, 42396 __experimentalTextTransform: true, 42397 __experimentalTextDecoration: true, 42398 __experimentalLetterSpacing: true, 42399 __experimentalWritingMode: true, 42400 __experimentalDefaultControls: { 42401 fontSize: true 42402 } 42403 }, 42404 interactivity: { 42405 clientNavigation: true 42406 } 42407 }, 42408 style: "wp-block-post-navigation-link" 42409 }; 42410 42411 42412 const { 42413 name: post_navigation_link_name 42414 } = post_navigation_link_metadata; 42415 42416 const post_navigation_link_settings = { 42417 edit: PostNavigationLinkEdit, 42418 variations: post_navigation_link_variations 42419 }; 42420 const post_navigation_link_init = () => initBlock({ 42421 name: post_navigation_link_name, 42422 metadata: post_navigation_link_metadata, 42423 settings: post_navigation_link_settings 42424 }); 42425 42426 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js 42427 42428 /** 42429 * External dependencies 42430 */ 42431 42432 42433 /** 42434 * WordPress dependencies 42435 */ 42436 42437 42438 42439 42440 42441 42442 42443 const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]; 42444 function PostTemplateInnerBlocks() { 42445 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 42446 className: 'wp-block-post' 42447 }, { 42448 template: post_template_edit_TEMPLATE, 42449 __unstableDisableLayoutClassNames: true 42450 }); 42451 return (0,external_React_namespaceObject.createElement)("li", { 42452 ...innerBlocksProps 42453 }); 42454 } 42455 function PostTemplateBlockPreview({ 42456 blocks, 42457 blockContextId, 42458 isHidden, 42459 setActiveBlockContextId 42460 }) { 42461 const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ 42462 blocks, 42463 props: { 42464 className: 'wp-block-post' 42465 } 42466 }); 42467 const handleOnClick = () => { 42468 setActiveBlockContextId(blockContextId); 42469 }; 42470 const style = { 42471 display: isHidden ? 'none' : undefined 42472 }; 42473 return (0,external_React_namespaceObject.createElement)("li", { 42474 ...blockPreviewProps, 42475 tabIndex: 0 42476 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role 42477 , 42478 role: "button", 42479 onClick: handleOnClick, 42480 onKeyPress: handleOnClick, 42481 style: style 42482 }); 42483 } 42484 const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview); 42485 function PostTemplateEdit({ 42486 setAttributes, 42487 clientId, 42488 context: { 42489 query: { 42490 perPage, 42491 offset = 0, 42492 postType, 42493 order, 42494 orderBy, 42495 author, 42496 search, 42497 exclude, 42498 sticky, 42499 inherit, 42500 taxQuery, 42501 parents, 42502 pages, 42503 // We gather extra query args to pass to the REST API call. 42504 // This way extenders of Query Loop can add their own query args, 42505 // and have accurate previews in the editor. 42506 // Noting though that these args should either be supported by the 42507 // REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`. 42508 ...restQueryArgs 42509 } = {}, 42510 templateSlug, 42511 previewPostType 42512 }, 42513 attributes: { 42514 layout 42515 }, 42516 __unstableLayoutClassNames 42517 }) { 42518 const { 42519 type: layoutType, 42520 columnCount = 3 42521 } = layout || {}; 42522 const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)(); 42523 const { 42524 posts, 42525 blocks 42526 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 42527 const { 42528 getEntityRecords, 42529 getTaxonomies 42530 } = select(external_wp_coreData_namespaceObject.store); 42531 const { 42532 getBlocks 42533 } = select(external_wp_blockEditor_namespaceObject.store); 42534 const templateCategory = inherit && templateSlug?.startsWith('category-') && getEntityRecords('taxonomy', 'category', { 42535 context: 'view', 42536 per_page: 1, 42537 _fields: ['id'], 42538 slug: templateSlug.replace('category-', '') 42539 }); 42540 const query = { 42541 offset: offset || 0, 42542 order, 42543 orderby: orderBy 42544 }; 42545 // There is no need to build the taxQuery if we inherit. 42546 if (taxQuery && !inherit) { 42547 const taxonomies = getTaxonomies({ 42548 type: postType, 42549 per_page: -1, 42550 context: 'view' 42551 }); 42552 // We have to build the tax query for the REST API and use as 42553 // keys the taxonomies `rest_base` with the `term ids` as values. 42554 const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, [taxonomySlug, terms]) => { 42555 const taxonomy = taxonomies?.find(({ 42556 slug 42557 }) => slug === taxonomySlug); 42558 if (taxonomy?.rest_base) { 42559 accumulator[taxonomy?.rest_base] = terms; 42560 } 42561 return accumulator; 42562 }, {}); 42563 if (!!Object.keys(builtTaxQuery).length) { 42564 Object.assign(query, builtTaxQuery); 42565 } 42566 } 42567 if (perPage) { 42568 query.per_page = perPage; 42569 } 42570 if (author) { 42571 query.author = author; 42572 } 42573 if (search) { 42574 query.search = search; 42575 } 42576 if (exclude?.length) { 42577 query.exclude = exclude; 42578 } 42579 if (parents?.length) { 42580 query.parent = parents; 42581 } 42582 // If sticky is not set, it will return all posts in the results. 42583 // If sticky is set to `only`, it will limit the results to sticky posts only. 42584 // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`. 42585 if (sticky) { 42586 query.sticky = sticky === 'only'; 42587 } 42588 // If `inherit` is truthy, adjust conditionally the query to create a better preview. 42589 if (inherit) { 42590 // Change the post-type if needed. 42591 if (templateSlug?.startsWith('archive-')) { 42592 query.postType = templateSlug.replace('archive-', ''); 42593 postType = query.postType; 42594 } else if (templateCategory) { 42595 query.categories = templateCategory[0]?.id; 42596 } 42597 } 42598 // When we preview Query Loop blocks we should prefer the current 42599 // block's postType, which is passed through block context. 42600 const usedPostType = previewPostType || postType; 42601 return { 42602 posts: getEntityRecords('postType', usedPostType, { 42603 ...query, 42604 ...restQueryArgs 42605 }), 42606 blocks: getBlocks(clientId) 42607 }; 42608 }, [perPage, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, restQueryArgs, previewPostType]); 42609 const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts?.map(post => ({ 42610 postType: post.type, 42611 postId: post.id 42612 })), [posts]); 42613 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42614 className: classnames_default()(__unstableLayoutClassNames, { 42615 [`columns-$columnCount}`]: layoutType === 'grid' && columnCount // Ensure column count is flagged via classname for backwards compatibility. 42616 }) 42617 }); 42618 if (!posts) { 42619 return (0,external_React_namespaceObject.createElement)("p", { 42620 ...blockProps 42621 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); 42622 } 42623 if (!posts.length) { 42624 return (0,external_React_namespaceObject.createElement)("p", { 42625 ...blockProps 42626 }, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.')); 42627 } 42628 const setDisplayLayout = newDisplayLayout => setAttributes({ 42629 layout: { 42630 ...layout, 42631 ...newDisplayLayout 42632 } 42633 }); 42634 const displayLayoutControls = [{ 42635 icon: library_list, 42636 title: (0,external_wp_i18n_namespaceObject.__)('List view'), 42637 onClick: () => setDisplayLayout({ 42638 type: 'default' 42639 }), 42640 isActive: layoutType === 'default' || layoutType === 'constrained' 42641 }, { 42642 icon: library_grid, 42643 title: (0,external_wp_i18n_namespaceObject.__)('Grid view'), 42644 onClick: () => setDisplayLayout({ 42645 type: 'grid', 42646 columnCount 42647 }), 42648 isActive: layoutType === 'grid' 42649 }]; 42650 42651 // To avoid flicker when switching active block contexts, a preview is rendered 42652 // for each block context, but the preview for the active block context is hidden. 42653 // This ensures that when it is displayed again, the cached rendering of the 42654 // block preview is used, instead of having to re-render the preview from scratch. 42655 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { 42656 controls: displayLayoutControls 42657 })), (0,external_React_namespaceObject.createElement)("ul", { 42658 ...blockProps 42659 }, blockContexts && blockContexts.map(blockContext => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 42660 key: blockContext.postId, 42661 value: blockContext 42662 }, blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? (0,external_React_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_React_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, { 42663 blocks: blocks, 42664 blockContextId: blockContext.postId, 42665 setActiveBlockContextId: setActiveBlockContextId, 42666 isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) 42667 }))))); 42668 } 42669 42670 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js 42671 42672 /** 42673 * WordPress dependencies 42674 */ 42675 42676 function PostTemplateSave() { 42677 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 42678 } 42679 42680 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js 42681 /** 42682 * WordPress dependencies 42683 */ 42684 42685 42686 /** 42687 * Internal dependencies 42688 */ 42689 42690 const post_template_metadata = { 42691 $schema: "https://schemas.wp.org/trunk/block.json", 42692 apiVersion: 3, 42693 name: "core/post-template", 42694 title: "Post Template", 42695 category: "theme", 42696 parent: ["core/query"], 42697 description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", 42698 textdomain: "default", 42699 usesContext: ["queryId", "query", "displayLayout", "templateSlug", "previewPostType", "enhancedPagination"], 42700 supports: { 42701 reusable: false, 42702 html: false, 42703 align: ["wide", "full"], 42704 layout: true, 42705 color: { 42706 gradients: true, 42707 link: true, 42708 __experimentalDefaultControls: { 42709 background: true, 42710 text: true 42711 } 42712 }, 42713 typography: { 42714 fontSize: true, 42715 lineHeight: true, 42716 __experimentalFontFamily: true, 42717 __experimentalFontWeight: true, 42718 __experimentalFontStyle: true, 42719 __experimentalTextTransform: true, 42720 __experimentalTextDecoration: true, 42721 __experimentalLetterSpacing: true, 42722 __experimentalDefaultControls: { 42723 fontSize: true 42724 } 42725 }, 42726 spacing: { 42727 blockGap: { 42728 __experimentalDefault: "1.25em" 42729 }, 42730 __experimentalDefaultControls: { 42731 blockGap: true 42732 } 42733 }, 42734 interactivity: { 42735 clientNavigation: true 42736 } 42737 }, 42738 style: "wp-block-post-template", 42739 editorStyle: "wp-block-post-template-editor" 42740 }; 42741 42742 42743 const { 42744 name: post_template_name 42745 } = post_template_metadata; 42746 42747 const post_template_settings = { 42748 icon: library_layout, 42749 edit: PostTemplateEdit, 42750 save: PostTemplateSave 42751 }; 42752 const post_template_init = () => initBlock({ 42753 name: post_template_name, 42754 metadata: post_template_metadata, 42755 settings: post_template_settings 42756 }); 42757 42758 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js 42759 42760 /** 42761 * WordPress dependencies 42762 */ 42763 42764 const postCategories = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42765 viewBox: "0 0 24 24", 42766 xmlns: "http://www.w3.org/2000/svg" 42767 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42768 d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z", 42769 fillRule: "evenodd", 42770 clipRule: "evenodd" 42771 })); 42772 /* harmony default export */ const post_categories = (postCategories); 42773 42774 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js 42775 /** 42776 * WordPress dependencies 42777 */ 42778 42779 42780 const use_post_terms_EMPTY_ARRAY = []; 42781 function usePostTerms({ 42782 postId, 42783 term 42784 }) { 42785 const { 42786 slug 42787 } = term; 42788 return (0,external_wp_data_namespaceObject.useSelect)(select => { 42789 const visible = term?.visibility?.publicly_queryable; 42790 if (!visible) { 42791 return { 42792 postTerms: use_post_terms_EMPTY_ARRAY, 42793 isLoading: false, 42794 hasPostTerms: false 42795 }; 42796 } 42797 const { 42798 getEntityRecords, 42799 isResolving 42800 } = select(external_wp_coreData_namespaceObject.store); 42801 const taxonomyArgs = ['taxonomy', slug, { 42802 post: postId, 42803 per_page: -1, 42804 context: 'view' 42805 }]; 42806 const terms = getEntityRecords(...taxonomyArgs); 42807 return { 42808 postTerms: terms, 42809 isLoading: isResolving('getEntityRecords', taxonomyArgs), 42810 hasPostTerms: !!terms?.length 42811 }; 42812 }, [postId, term?.visibility?.publicly_queryable, slug]); 42813 } 42814 42815 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js 42816 42817 /** 42818 * External dependencies 42819 */ 42820 42821 42822 /** 42823 * WordPress dependencies 42824 */ 42825 42826 42827 42828 42829 42830 42831 42832 42833 /** 42834 * Internal dependencies 42835 */ 42836 42837 42838 // Allowed formats for the prefix and suffix fields. 42839 const ALLOWED_FORMATS = ['core/bold', 'core/image', 'core/italic', 'core/link', 'core/strikethrough', 'core/text-color']; 42840 function PostTermsEdit({ 42841 attributes, 42842 clientId, 42843 context, 42844 isSelected, 42845 setAttributes, 42846 insertBlocksAfter 42847 }) { 42848 const { 42849 term, 42850 textAlign, 42851 separator, 42852 prefix, 42853 suffix 42854 } = attributes; 42855 const { 42856 postId, 42857 postType 42858 } = context; 42859 const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => { 42860 if (!term) return {}; 42861 const { 42862 getTaxonomy 42863 } = select(external_wp_coreData_namespaceObject.store); 42864 const taxonomy = getTaxonomy(term); 42865 return taxonomy?.visibility?.publicly_queryable ? taxonomy : {}; 42866 }, [term]); 42867 const { 42868 postTerms, 42869 hasPostTerms, 42870 isLoading 42871 } = usePostTerms({ 42872 postId, 42873 term: selectedTerm 42874 }); 42875 const hasPost = postId && postType; 42876 const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId); 42877 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42878 className: classnames_default()({ 42879 [`has-text-align-$textAlign}`]: textAlign, 42880 [`taxonomy-$term}`]: term 42881 }) 42882 }); 42883 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 42884 value: textAlign, 42885 onChange: nextAlign => { 42886 setAttributes({ 42887 textAlign: nextAlign 42888 }); 42889 } 42890 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 42891 group: "advanced" 42892 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 42893 __nextHasNoMarginBottom: true, 42894 autoComplete: "off", 42895 label: (0,external_wp_i18n_namespaceObject.__)('Separator'), 42896 value: separator || '', 42897 onChange: nextValue => { 42898 setAttributes({ 42899 separator: nextValue 42900 }); 42901 }, 42902 help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.') 42903 })), (0,external_React_namespaceObject.createElement)("div", { 42904 ...blockProps 42905 }, isLoading && hasPost && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && (isSelected || prefix) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 42906 allowedFormats: ALLOWED_FORMATS, 42907 className: "wp-block-post-terms__prefix", 42908 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Prefix'), 42909 placeholder: (0,external_wp_i18n_namespaceObject.__)('Prefix') + ' ', 42910 value: prefix, 42911 onChange: value => setAttributes({ 42912 prefix: value 42913 }), 42914 tagName: "span" 42915 }), (!hasPost || !term) && (0,external_React_namespaceObject.createElement)("span", null, blockInformation.title), hasPost && !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_React_namespaceObject.createElement)("a", { 42916 key: postTerm.id, 42917 href: postTerm.link, 42918 onClick: event => event.preventDefault() 42919 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTerm.name))).reduce((prev, curr) => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, prev, (0,external_React_namespaceObject.createElement)("span", { 42920 className: "wp-block-post-terms__separator" 42921 }, separator || ' '), curr)), hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0,external_wp_i18n_namespaceObject.__)('Term items not found.')), !isLoading && (isSelected || suffix) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 42922 allowedFormats: ALLOWED_FORMATS, 42923 className: "wp-block-post-terms__suffix", 42924 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suffix'), 42925 placeholder: ' ' + (0,external_wp_i18n_namespaceObject.__)('Suffix'), 42926 value: suffix, 42927 onChange: value => setAttributes({ 42928 suffix: value 42929 }), 42930 tagName: "span", 42931 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 42932 }))); 42933 } 42934 42935 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-terms.js 42936 42937 /** 42938 * WordPress dependencies 42939 */ 42940 42941 const postTerms = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 42942 viewBox: "0 0 24 24", 42943 xmlns: "http://www.w3.org/2000/svg" 42944 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 42945 d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" 42946 })); 42947 /* harmony default export */ const post_terms = (postTerms); 42948 42949 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/hooks.js 42950 /** 42951 * WordPress dependencies 42952 */ 42953 42954 const variationIconMap = { 42955 category: post_categories, 42956 post_tag: post_terms 42957 }; 42958 42959 // We add `icons` to categories and tags. The remaining ones use 42960 // the block's default icon. 42961 function enhanceVariations(settings, name) { 42962 if (name !== 'core/post-terms') { 42963 return settings; 42964 } 42965 const variations = settings.variations.map(variation => { 42966 var _variationIconMap$var; 42967 return { 42968 ...variation, 42969 ...{ 42970 icon: (_variationIconMap$var = variationIconMap[variation.name]) !== null && _variationIconMap$var !== void 0 ? _variationIconMap$var : post_categories 42971 } 42972 }; 42973 }); 42974 return { 42975 ...settings, 42976 variations 42977 }; 42978 } 42979 42980 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js 42981 /** 42982 * WordPress dependencies 42983 */ 42984 42985 42986 42987 /** 42988 * Internal dependencies 42989 */ 42990 42991 const post_terms_metadata = { 42992 $schema: "https://schemas.wp.org/trunk/block.json", 42993 apiVersion: 3, 42994 name: "core/post-terms", 42995 title: "Post Terms", 42996 category: "theme", 42997 description: "Post terms.", 42998 textdomain: "default", 42999 attributes: { 43000 term: { 43001 type: "string" 43002 }, 43003 textAlign: { 43004 type: "string" 43005 }, 43006 separator: { 43007 type: "string", 43008 "default": ", " 43009 }, 43010 prefix: { 43011 type: "string", 43012 "default": "" 43013 }, 43014 suffix: { 43015 type: "string", 43016 "default": "" 43017 } 43018 }, 43019 usesContext: ["postId", "postType"], 43020 supports: { 43021 html: false, 43022 color: { 43023 gradients: true, 43024 link: true, 43025 __experimentalDefaultControls: { 43026 background: true, 43027 text: true, 43028 link: true 43029 } 43030 }, 43031 spacing: { 43032 margin: true, 43033 padding: true 43034 }, 43035 typography: { 43036 fontSize: true, 43037 lineHeight: true, 43038 __experimentalFontFamily: true, 43039 __experimentalFontWeight: true, 43040 __experimentalFontStyle: true, 43041 __experimentalTextTransform: true, 43042 __experimentalTextDecoration: true, 43043 __experimentalLetterSpacing: true, 43044 __experimentalDefaultControls: { 43045 fontSize: true 43046 } 43047 }, 43048 interactivity: { 43049 clientNavigation: true 43050 } 43051 }, 43052 style: "wp-block-post-terms" 43053 }; 43054 43055 43056 const { 43057 name: post_terms_name 43058 } = post_terms_metadata; 43059 43060 const post_terms_settings = { 43061 icon: post_categories, 43062 edit: PostTermsEdit 43063 }; 43064 const post_terms_init = () => { 43065 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations); 43066 return initBlock({ 43067 name: post_terms_name, 43068 metadata: post_terms_metadata, 43069 settings: post_terms_settings 43070 }); 43071 }; 43072 43073 ;// CONCATENATED MODULE: external ["wp","wordcount"] 43074 const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; 43075 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/edit.js 43076 43077 /** 43078 * External dependencies 43079 */ 43080 43081 43082 /** 43083 * WordPress dependencies 43084 */ 43085 43086 43087 43088 43089 43090 43091 43092 /** 43093 * Average reading rate - based on average taken from 43094 * https://irisreading.com/average-reading-speed-in-various-languages/ 43095 * (Characters/minute used for Chinese rather than words). 43096 */ 43097 const AVERAGE_READING_RATE = 189; 43098 function PostTimeToReadEdit({ 43099 attributes, 43100 setAttributes, 43101 context 43102 }) { 43103 const { 43104 textAlign 43105 } = attributes; 43106 const { 43107 postId, 43108 postType 43109 } = context; 43110 const [contentStructure] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); 43111 const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { 43112 id: postId 43113 }); 43114 const minutesToReadString = (0,external_wp_element_namespaceObject.useMemo)(() => { 43115 // Replicates the logic found in getEditedPostContent(). 43116 let content; 43117 if (contentStructure instanceof Function) { 43118 content = contentStructure({ 43119 blocks 43120 }); 43121 } else if (blocks) { 43122 // If we have parsed blocks already, they should be our source of truth. 43123 // Parsing applies block deprecations and legacy block conversions that 43124 // unparsed content will not have. 43125 content = (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks); 43126 } else { 43127 content = contentStructure; 43128 } 43129 43130 /* 43131 * translators: If your word count is based on single characters (e.g. East Asian characters), 43132 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 43133 * Do not translate into your own language. 43134 */ 43135 const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); 43136 const minutesToRead = Math.max(1, Math.round((0,external_wp_wordcount_namespaceObject.count)(content, wordCountType) / AVERAGE_READING_RATE)); 43137 return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d is the number of minutes the post will take to read. */ 43138 (0,external_wp_i18n_namespaceObject._n)('%d minute', '%d minutes', minutesToRead), minutesToRead); 43139 }, [contentStructure, blocks]); 43140 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43141 className: classnames_default()({ 43142 [`has-text-align-$textAlign}`]: textAlign 43143 }) 43144 }); 43145 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 43146 group: "block" 43147 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 43148 value: textAlign, 43149 onChange: nextAlign => { 43150 setAttributes({ 43151 textAlign: nextAlign 43152 }); 43153 } 43154 })), (0,external_React_namespaceObject.createElement)("div", { 43155 ...blockProps 43156 }, minutesToReadString)); 43157 } 43158 /* harmony default export */ const post_time_to_read_edit = (PostTimeToReadEdit); 43159 43160 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/icon.js 43161 43162 /** 43163 * WordPress dependencies 43164 */ 43165 43166 /* harmony default export */ const icon = ((0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 43167 xmlns: "http://www.w3.org/2000/svg", 43168 width: "24", 43169 height: "24", 43170 viewBox: "0 0 24 24" 43171 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 43172 d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z" 43173 }))); 43174 43175 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js 43176 /** 43177 * Internal dependencies 43178 */ 43179 43180 const post_time_to_read_metadata = { 43181 $schema: "https://schemas.wp.org/trunk/block.json", 43182 apiVersion: 3, 43183 __experimental: true, 43184 name: "core/post-time-to-read", 43185 title: "Time To Read", 43186 category: "theme", 43187 description: "Show minutes required to finish reading the post.", 43188 textdomain: "default", 43189 usesContext: ["postId", "postType"], 43190 attributes: { 43191 textAlign: { 43192 type: "string" 43193 } 43194 }, 43195 supports: { 43196 color: { 43197 gradients: true, 43198 __experimentalDefaultControls: { 43199 background: true, 43200 text: true 43201 } 43202 }, 43203 html: false, 43204 spacing: { 43205 margin: true, 43206 padding: true, 43207 __experimentalDefaultControls: { 43208 margin: false, 43209 padding: false 43210 } 43211 }, 43212 typography: { 43213 fontSize: true, 43214 lineHeight: true, 43215 __experimentalFontFamily: true, 43216 __experimentalFontWeight: true, 43217 __experimentalFontStyle: true, 43218 __experimentalTextTransform: true, 43219 __experimentalTextDecoration: true, 43220 __experimentalLetterSpacing: true, 43221 __experimentalDefaultControls: { 43222 fontSize: true 43223 } 43224 }, 43225 interactivity: { 43226 clientNavigation: true 43227 } 43228 } 43229 }; 43230 43231 43232 const { 43233 name: post_time_to_read_name 43234 } = post_time_to_read_metadata; 43235 43236 const post_time_to_read_settings = { 43237 icon: icon, 43238 edit: post_time_to_read_edit 43239 }; 43240 const post_time_to_read_init = () => initBlock({ 43241 name: post_time_to_read_name, 43242 metadata: post_time_to_read_metadata, 43243 settings: post_time_to_read_settings 43244 }); 43245 43246 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js 43247 43248 /** 43249 * External dependencies 43250 */ 43251 43252 43253 /** 43254 * WordPress dependencies 43255 */ 43256 43257 43258 43259 43260 43261 43262 /** 43263 * Internal dependencies 43264 */ 43265 43266 function PostTitleEdit({ 43267 attributes: { 43268 level, 43269 textAlign, 43270 isLink, 43271 rel, 43272 linkTarget 43273 }, 43274 setAttributes, 43275 context: { 43276 postType, 43277 postId, 43278 queryId 43279 }, 43280 insertBlocksAfter 43281 }) { 43282 const TagName = 'h' + level; 43283 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43284 /** 43285 * Hack: useCanEditEntity may trigger an OPTIONS request to the REST API via the canUser resolver. 43286 * However, when the Post Title is a descendant of a Query Loop block, the title cannot be edited. 43287 * In order to avoid these unnecessary requests, we call the hook without 43288 * the proper data, resulting in returning early without making them. 43289 */ 43290 const userCanEdit = useCanEditEntity('postType', !isDescendentOfQueryLoop && postType, postId); 43291 const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 43292 const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId); 43293 const onSplitAtEnd = () => { 43294 insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())); 43295 }; 43296 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43297 className: classnames_default()({ 43298 [`has-text-align-$textAlign}`]: textAlign 43299 }) 43300 }); 43301 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 43302 let titleElement = (0,external_React_namespaceObject.createElement)(TagName, { 43303 ...blockProps 43304 }, (0,external_wp_i18n_namespaceObject.__)('Title')); 43305 if (postType && postId) { 43306 titleElement = userCanEdit ? (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 43307 tagName: TagName, 43308 placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'), 43309 value: rawTitle, 43310 onChange: setTitle, 43311 __experimentalVersion: 2, 43312 __unstableOnSplitAtEnd: onSplitAtEnd, 43313 ...blockProps 43314 }) : (0,external_React_namespaceObject.createElement)(TagName, { 43315 ...blockProps, 43316 dangerouslySetInnerHTML: { 43317 __html: fullTitle?.rendered 43318 } 43319 }); 43320 } 43321 if (isLink && postType && postId) { 43322 titleElement = userCanEdit ? (0,external_React_namespaceObject.createElement)(TagName, { 43323 ...blockProps 43324 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 43325 tagName: "a", 43326 href: link, 43327 target: linkTarget, 43328 rel: rel, 43329 placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null, 43330 value: rawTitle, 43331 onChange: setTitle, 43332 __experimentalVersion: 2, 43333 __unstableOnSplitAtEnd: onSplitAtEnd 43334 })) : (0,external_React_namespaceObject.createElement)(TagName, { 43335 ...blockProps 43336 }, (0,external_React_namespaceObject.createElement)("a", { 43337 href: link, 43338 target: linkTarget, 43339 rel: rel, 43340 onClick: event => event.preventDefault(), 43341 dangerouslySetInnerHTML: { 43342 __html: fullTitle?.rendered 43343 } 43344 })); 43345 } 43346 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, blockEditingMode === 'default' && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 43347 group: "block" 43348 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 43349 value: level, 43350 onChange: newLevel => setAttributes({ 43351 level: newLevel 43352 }) 43353 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 43354 value: textAlign, 43355 onChange: nextAlign => { 43356 setAttributes({ 43357 textAlign: nextAlign 43358 }); 43359 } 43360 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 43361 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 43362 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 43363 __nextHasNoMarginBottom: true, 43364 label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'), 43365 onChange: () => setAttributes({ 43366 isLink: !isLink 43367 }), 43368 checked: isLink 43369 }), isLink && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 43370 __nextHasNoMarginBottom: true, 43371 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 43372 onChange: value => setAttributes({ 43373 linkTarget: value ? '_blank' : '_self' 43374 }), 43375 checked: linkTarget === '_blank' 43376 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 43377 __nextHasNoMarginBottom: true, 43378 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 43379 value: rel, 43380 onChange: newRel => setAttributes({ 43381 rel: newRel 43382 }) 43383 }))))), titleElement); 43384 } 43385 43386 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js 43387 /** 43388 * Internal dependencies 43389 */ 43390 43391 const post_title_deprecated_v1 = { 43392 attributes: { 43393 textAlign: { 43394 type: 'string' 43395 }, 43396 level: { 43397 type: 'number', 43398 default: 2 43399 }, 43400 isLink: { 43401 type: 'boolean', 43402 default: false 43403 }, 43404 rel: { 43405 type: 'string', 43406 attribute: 'rel', 43407 default: '' 43408 }, 43409 linkTarget: { 43410 type: 'string', 43411 default: '_self' 43412 } 43413 }, 43414 supports: { 43415 align: ['wide', 'full'], 43416 html: false, 43417 color: { 43418 gradients: true, 43419 link: true 43420 }, 43421 spacing: { 43422 margin: true 43423 }, 43424 typography: { 43425 fontSize: true, 43426 lineHeight: true, 43427 __experimentalFontFamily: true, 43428 __experimentalFontWeight: true, 43429 __experimentalFontStyle: true, 43430 __experimentalTextTransform: true 43431 } 43432 }, 43433 save() { 43434 return null; 43435 }, 43436 migrate: migrate_font_family, 43437 isEligible({ 43438 style 43439 }) { 43440 return style?.typography?.fontFamily; 43441 } 43442 }; 43443 43444 /** 43445 * New deprecations need to be placed first 43446 * for them to have higher priority. 43447 * 43448 * Old deprecations may need to be updated as well. 43449 * 43450 * See block-deprecation.md 43451 */ 43452 /* harmony default export */ const post_title_deprecated = ([post_title_deprecated_v1]); 43453 43454 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js 43455 /** 43456 * WordPress dependencies 43457 */ 43458 43459 43460 /** 43461 * Internal dependencies 43462 */ 43463 43464 const post_title_metadata = { 43465 $schema: "https://schemas.wp.org/trunk/block.json", 43466 apiVersion: 3, 43467 name: "core/post-title", 43468 title: "Title", 43469 category: "theme", 43470 description: "Displays the title of a post, page, or any other content-type.", 43471 textdomain: "default", 43472 usesContext: ["postId", "postType", "queryId"], 43473 attributes: { 43474 textAlign: { 43475 type: "string" 43476 }, 43477 level: { 43478 type: "number", 43479 "default": 2 43480 }, 43481 isLink: { 43482 type: "boolean", 43483 "default": false 43484 }, 43485 rel: { 43486 type: "string", 43487 attribute: "rel", 43488 "default": "" 43489 }, 43490 linkTarget: { 43491 type: "string", 43492 "default": "_self" 43493 } 43494 }, 43495 supports: { 43496 align: ["wide", "full"], 43497 html: false, 43498 color: { 43499 gradients: true, 43500 link: true, 43501 __experimentalDefaultControls: { 43502 background: true, 43503 text: true, 43504 link: true 43505 } 43506 }, 43507 spacing: { 43508 margin: true, 43509 padding: true 43510 }, 43511 typography: { 43512 fontSize: true, 43513 lineHeight: true, 43514 __experimentalFontFamily: true, 43515 __experimentalFontWeight: true, 43516 __experimentalFontStyle: true, 43517 __experimentalTextTransform: true, 43518 __experimentalTextDecoration: true, 43519 __experimentalLetterSpacing: true, 43520 __experimentalDefaultControls: { 43521 fontSize: true 43522 } 43523 }, 43524 interactivity: { 43525 clientNavigation: true 43526 } 43527 }, 43528 style: "wp-block-post-title" 43529 }; 43530 43531 43532 const { 43533 name: post_title_name 43534 } = post_title_metadata; 43535 43536 const post_title_settings = { 43537 icon: library_title, 43538 edit: PostTitleEdit, 43539 deprecated: post_title_deprecated 43540 }; 43541 const post_title_init = () => initBlock({ 43542 name: post_title_name, 43543 metadata: post_title_metadata, 43544 settings: post_title_settings 43545 }); 43546 43547 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js 43548 43549 /** 43550 * WordPress dependencies 43551 */ 43552 43553 const preformatted = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 43554 viewBox: "0 0 24 24", 43555 xmlns: "http://www.w3.org/2000/svg" 43556 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 43557 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z" 43558 })); 43559 /* harmony default export */ const library_preformatted = (preformatted); 43560 43561 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js 43562 43563 /** 43564 * WordPress dependencies 43565 */ 43566 43567 43568 43569 function PreformattedEdit({ 43570 attributes, 43571 mergeBlocks, 43572 setAttributes, 43573 onRemove, 43574 insertBlocksAfter, 43575 style 43576 }) { 43577 const { 43578 content 43579 } = attributes; 43580 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43581 style 43582 }); 43583 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 43584 tagName: "pre", 43585 identifier: "content", 43586 preserveWhiteSpace: true, 43587 value: content, 43588 onChange: nextContent => { 43589 setAttributes({ 43590 content: nextContent 43591 }); 43592 }, 43593 onRemove: onRemove, 43594 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'), 43595 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'), 43596 onMerge: mergeBlocks, 43597 ...blockProps, 43598 __unstablePastePlainText: true, 43599 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 43600 }); 43601 } 43602 43603 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js 43604 43605 /** 43606 * WordPress dependencies 43607 */ 43608 43609 function preformatted_save_save({ 43610 attributes 43611 }) { 43612 const { 43613 content 43614 } = attributes; 43615 return (0,external_React_namespaceObject.createElement)("pre", { 43616 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 43617 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 43618 value: content 43619 })); 43620 } 43621 43622 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js 43623 /** 43624 * WordPress dependencies 43625 */ 43626 43627 const preformatted_transforms_transforms = { 43628 from: [{ 43629 type: 'block', 43630 blocks: ['core/code', 'core/paragraph'], 43631 transform: ({ 43632 content, 43633 anchor 43634 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', { 43635 content, 43636 anchor 43637 }) 43638 }, { 43639 type: 'raw', 43640 isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'), 43641 schema: ({ 43642 phrasingContentSchema 43643 }) => ({ 43644 pre: { 43645 children: phrasingContentSchema 43646 } 43647 }) 43648 }], 43649 to: [{ 43650 type: 'block', 43651 blocks: ['core/paragraph'], 43652 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) 43653 }, { 43654 type: 'block', 43655 blocks: ['core/code'], 43656 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes) 43657 }] 43658 }; 43659 /* harmony default export */ const preformatted_transforms = (preformatted_transforms_transforms); 43660 43661 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 43662 /** 43663 * WordPress dependencies 43664 */ 43665 43666 43667 43668 /** 43669 * Internal dependencies 43670 */ 43671 43672 43673 const preformatted_metadata = { 43674 $schema: "https://schemas.wp.org/trunk/block.json", 43675 apiVersion: 3, 43676 name: "core/preformatted", 43677 title: "Preformatted", 43678 category: "text", 43679 description: "Add text that respects your spacing and tabs, and also allows styling.", 43680 textdomain: "default", 43681 attributes: { 43682 content: { 43683 type: "rich-text", 43684 source: "rich-text", 43685 selector: "pre", 43686 __unstablePreserveWhiteSpace: true, 43687 __experimentalRole: "content" 43688 } 43689 }, 43690 supports: { 43691 anchor: true, 43692 color: { 43693 gradients: true, 43694 __experimentalDefaultControls: { 43695 background: true, 43696 text: true 43697 } 43698 }, 43699 spacing: { 43700 padding: true, 43701 margin: true 43702 }, 43703 typography: { 43704 fontSize: true, 43705 lineHeight: true, 43706 __experimentalFontFamily: true, 43707 __experimentalFontWeight: true, 43708 __experimentalFontStyle: true, 43709 __experimentalTextTransform: true, 43710 __experimentalTextDecoration: true, 43711 __experimentalLetterSpacing: true, 43712 __experimentalDefaultControls: { 43713 fontSize: true 43714 } 43715 }, 43716 interactivity: { 43717 clientNavigation: true 43718 } 43719 }, 43720 style: "wp-block-preformatted" 43721 }; 43722 43723 43724 const { 43725 name: preformatted_name 43726 } = preformatted_metadata; 43727 43728 const preformatted_settings = { 43729 icon: library_preformatted, 43730 example: { 43731 attributes: { 43732 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 43733 // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work. 43734 content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;') 43735 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 43736 } 43737 }, 43738 transforms: preformatted_transforms, 43739 edit: PreformattedEdit, 43740 save: preformatted_save_save, 43741 merge(attributes, attributesToMerge) { 43742 return { 43743 content: attributes.content + '\n\n' + attributesToMerge.content 43744 }; 43745 } 43746 }; 43747 const preformatted_init = () => initBlock({ 43748 name: preformatted_name, 43749 metadata: preformatted_metadata, 43750 settings: preformatted_settings 43751 }); 43752 43753 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js 43754 43755 /** 43756 * WordPress dependencies 43757 */ 43758 43759 const pullquote = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 43760 viewBox: "0 0 24 24", 43761 xmlns: "http://www.w3.org/2000/svg" 43762 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 43763 d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z" 43764 })); 43765 /* harmony default export */ const library_pullquote = (pullquote); 43766 43767 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js 43768 const SOLID_COLOR_CLASS = `is-style-solid-color`; 43769 43770 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js 43771 43772 /** 43773 * External dependencies 43774 */ 43775 43776 43777 /** 43778 * WordPress dependencies 43779 */ 43780 43781 43782 43783 /** 43784 * Internal dependencies 43785 */ 43786 43787 const pullquote_deprecated_blockAttributes = { 43788 value: { 43789 type: 'string', 43790 source: 'html', 43791 selector: 'blockquote', 43792 multiline: 'p' 43793 }, 43794 citation: { 43795 type: 'string', 43796 source: 'html', 43797 selector: 'cite', 43798 default: '' 43799 }, 43800 mainColor: { 43801 type: 'string' 43802 }, 43803 customMainColor: { 43804 type: 'string' 43805 }, 43806 textColor: { 43807 type: 'string' 43808 }, 43809 customTextColor: { 43810 type: 'string' 43811 } 43812 }; 43813 function parseBorderColor(styleString) { 43814 if (!styleString) { 43815 return; 43816 } 43817 const matches = styleString.match(/border-color:([^;]+)[;]?/); 43818 if (matches && matches[1]) { 43819 return matches[1]; 43820 } 43821 } 43822 function multilineToInline(value) { 43823 value = value || `<p></p>`; 43824 const padded = `</p>$value}<p>`; 43825 const values = padded.split(`</p><p>`); 43826 values.shift(); 43827 values.pop(); 43828 return values.join('<br>'); 43829 } 43830 const pullquote_deprecated_v5 = { 43831 attributes: { 43832 value: { 43833 type: 'string', 43834 source: 'html', 43835 selector: 'blockquote', 43836 multiline: 'p', 43837 __experimentalRole: 'content' 43838 }, 43839 citation: { 43840 type: 'string', 43841 source: 'html', 43842 selector: 'cite', 43843 default: '', 43844 __experimentalRole: 'content' 43845 }, 43846 textAlign: { 43847 type: 'string' 43848 } 43849 }, 43850 save({ 43851 attributes 43852 }) { 43853 const { 43854 textAlign, 43855 citation, 43856 value 43857 } = attributes; 43858 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); 43859 return (0,external_React_namespaceObject.createElement)("figure", { 43860 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 43861 className: classnames_default()({ 43862 [`has-text-align-$textAlign}`]: textAlign 43863 }) 43864 }) 43865 }, (0,external_React_namespaceObject.createElement)("blockquote", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 43866 value: value, 43867 multiline: true 43868 }), shouldShowCitation && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 43869 tagName: "cite", 43870 value: citation 43871 }))); 43872 }, 43873 migrate({ 43874 value, 43875 ...attributes 43876 }) { 43877 return { 43878 value: multilineToInline(value), 43879 ...attributes 43880 }; 43881 } 43882 }; 43883 43884 // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example 43885 43886 const pullquote_deprecated_v4 = { 43887 attributes: { 43888 ...pullquote_deprecated_blockAttributes 43889 }, 43890 save({ 43891 attributes 43892 }) { 43893 const { 43894 mainColor, 43895 customMainColor, 43896 customTextColor, 43897 textColor, 43898 value, 43899 citation, 43900 className 43901 } = attributes; 43902 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 43903 let figureClasses, figureStyles; 43904 43905 // Is solid color style 43906 if (isSolidColorStyle) { 43907 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 43908 figureClasses = classnames_default()({ 43909 'has-background': backgroundClass || customMainColor, 43910 [backgroundClass]: backgroundClass 43911 }); 43912 figureStyles = { 43913 backgroundColor: backgroundClass ? undefined : customMainColor 43914 }; 43915 // Is normal style and a custom color is being used ( we can set a style directly with its value) 43916 } else if (customMainColor) { 43917 figureStyles = { 43918 borderColor: customMainColor 43919 }; 43920 } 43921 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 43922 const blockquoteClasses = classnames_default()({ 43923 'has-text-color': textColor || customTextColor, 43924 [blockquoteTextColorClass]: blockquoteTextColorClass 43925 }); 43926 const blockquoteStyles = blockquoteTextColorClass ? undefined : { 43927 color: customTextColor 43928 }; 43929 return (0,external_React_namespaceObject.createElement)("figure", { 43930 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 43931 className: figureClasses, 43932 style: figureStyles 43933 }) 43934 }, (0,external_React_namespaceObject.createElement)("blockquote", { 43935 className: blockquoteClasses, 43936 style: blockquoteStyles 43937 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 43938 value: value, 43939 multiline: true 43940 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 43941 tagName: "cite", 43942 value: citation 43943 }))); 43944 }, 43945 migrate({ 43946 value, 43947 className, 43948 mainColor, 43949 customMainColor, 43950 customTextColor, 43951 ...attributes 43952 }) { 43953 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 43954 let style; 43955 if (customMainColor) { 43956 if (!isSolidColorStyle) { 43957 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 43958 style = { 43959 border: { 43960 color: customMainColor 43961 } 43962 }; 43963 } else { 43964 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 43965 style = { 43966 color: { 43967 background: customMainColor 43968 } 43969 }; 43970 } 43971 } 43972 43973 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 43974 if (customTextColor && style) { 43975 style.color = { 43976 ...style.color, 43977 text: customTextColor 43978 }; 43979 } 43980 return { 43981 value: multilineToInline(value), 43982 className, 43983 backgroundColor: isSolidColorStyle ? mainColor : undefined, 43984 borderColor: isSolidColorStyle ? undefined : mainColor, 43985 textAlign: isSolidColorStyle ? 'left' : undefined, 43986 style, 43987 ...attributes 43988 }; 43989 } 43990 }; 43991 const pullquote_deprecated_v3 = { 43992 attributes: { 43993 ...pullquote_deprecated_blockAttributes, 43994 // figureStyle is an attribute that never existed. 43995 // We are using it as a way to access the styles previously applied to the figure. 43996 figureStyle: { 43997 source: 'attribute', 43998 selector: 'figure', 43999 attribute: 'style' 44000 } 44001 }, 44002 save({ 44003 attributes 44004 }) { 44005 const { 44006 mainColor, 44007 customMainColor, 44008 textColor, 44009 customTextColor, 44010 value, 44011 citation, 44012 className, 44013 figureStyle 44014 } = attributes; 44015 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 44016 let figureClasses, figureStyles; 44017 44018 // Is solid color style 44019 if (isSolidColorStyle) { 44020 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 44021 figureClasses = classnames_default()({ 44022 'has-background': backgroundClass || customMainColor, 44023 [backgroundClass]: backgroundClass 44024 }); 44025 figureStyles = { 44026 backgroundColor: backgroundClass ? undefined : customMainColor 44027 }; 44028 // Is normal style and a custom color is being used ( we can set a style directly with its value) 44029 } else if (customMainColor) { 44030 figureStyles = { 44031 borderColor: customMainColor 44032 }; 44033 // If normal style and a named color are being used, we need to retrieve the color value to set the style, 44034 // as there is no expectation that themes create classes that set border colors. 44035 } else if (mainColor) { 44036 // Previously here we queried the color settings to know the color value 44037 // of a named color. This made the save function impure and the block was refactored, 44038 // because meanwhile a change in the editor made it impossible to query color settings in the save function. 44039 // Here instead of querying the color settings to know the color value, we retrieve the value 44040 // directly from the style previously serialized. 44041 const borderColor = parseBorderColor(figureStyle); 44042 figureStyles = { 44043 borderColor 44044 }; 44045 } 44046 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 44047 const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', { 44048 [blockquoteTextColorClass]: blockquoteTextColorClass 44049 }); 44050 const blockquoteStyles = blockquoteTextColorClass ? undefined : { 44051 color: customTextColor 44052 }; 44053 return (0,external_React_namespaceObject.createElement)("figure", { 44054 className: figureClasses, 44055 style: figureStyles 44056 }, (0,external_React_namespaceObject.createElement)("blockquote", { 44057 className: blockquoteClasses, 44058 style: blockquoteStyles 44059 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44060 value: value, 44061 multiline: true 44062 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44063 tagName: "cite", 44064 value: citation 44065 }))); 44066 }, 44067 migrate({ 44068 value, 44069 className, 44070 figureStyle, 44071 mainColor, 44072 customMainColor, 44073 customTextColor, 44074 ...attributes 44075 }) { 44076 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 44077 let style; 44078 if (customMainColor) { 44079 if (!isSolidColorStyle) { 44080 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 44081 style = { 44082 border: { 44083 color: customMainColor 44084 } 44085 }; 44086 } else { 44087 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 44088 style = { 44089 color: { 44090 background: customMainColor 44091 } 44092 }; 44093 } 44094 } 44095 44096 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 44097 if (customTextColor && style) { 44098 style.color = { 44099 ...style.color, 44100 text: customTextColor 44101 }; 44102 } 44103 // If is the default style, and a main color is set, 44104 // migrate the main color value into a custom border color. 44105 // The custom border color value is retrieved by parsing the figure styles. 44106 if (!isSolidColorStyle && mainColor && figureStyle) { 44107 const borderColor = parseBorderColor(figureStyle); 44108 if (borderColor) { 44109 return { 44110 value: multilineToInline(value), 44111 ...attributes, 44112 className, 44113 // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style. 44114 style: { 44115 border: { 44116 color: borderColor 44117 } 44118 } 44119 }; 44120 } 44121 } 44122 return { 44123 value: multilineToInline(value), 44124 className, 44125 backgroundColor: isSolidColorStyle ? mainColor : undefined, 44126 borderColor: isSolidColorStyle ? undefined : mainColor, 44127 textAlign: isSolidColorStyle ? 'left' : undefined, 44128 style, 44129 ...attributes 44130 }; 44131 } 44132 }; 44133 const pullquote_deprecated_v2 = { 44134 attributes: pullquote_deprecated_blockAttributes, 44135 save({ 44136 attributes 44137 }) { 44138 const { 44139 mainColor, 44140 customMainColor, 44141 textColor, 44142 customTextColor, 44143 value, 44144 citation, 44145 className 44146 } = attributes; 44147 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 44148 let figureClass, figureStyles; 44149 // Is solid color style 44150 if (isSolidColorStyle) { 44151 figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 44152 if (!figureClass) { 44153 figureStyles = { 44154 backgroundColor: customMainColor 44155 }; 44156 } 44157 // Is normal style and a custom color is being used ( we can set a style directly with its value) 44158 } else if (customMainColor) { 44159 figureStyles = { 44160 borderColor: customMainColor 44161 }; 44162 // Is normal style and a named color is being used, we need to retrieve the color value to set the style, 44163 // as there is no expectation that themes create classes that set border colors. 44164 } else if (mainColor) { 44165 var _select$getSettings$c; 44166 const colors = (_select$getSettings$c = (0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings().colors) !== null && _select$getSettings$c !== void 0 ? _select$getSettings$c : []; 44167 const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor); 44168 figureStyles = { 44169 borderColor: colorObject.color 44170 }; 44171 } 44172 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 44173 const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', { 44174 [blockquoteTextColorClass]: blockquoteTextColorClass 44175 }) : undefined; 44176 const blockquoteStyle = blockquoteTextColorClass ? undefined : { 44177 color: customTextColor 44178 }; 44179 return (0,external_React_namespaceObject.createElement)("figure", { 44180 className: figureClass, 44181 style: figureStyles 44182 }, (0,external_React_namespaceObject.createElement)("blockquote", { 44183 className: blockquoteClasses, 44184 style: blockquoteStyle 44185 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44186 value: value, 44187 multiline: true 44188 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44189 tagName: "cite", 44190 value: citation 44191 }))); 44192 }, 44193 migrate({ 44194 value, 44195 className, 44196 mainColor, 44197 customMainColor, 44198 customTextColor, 44199 ...attributes 44200 }) { 44201 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 44202 let style = {}; 44203 if (customMainColor) { 44204 if (!isSolidColorStyle) { 44205 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 44206 style = { 44207 border: { 44208 color: customMainColor 44209 } 44210 }; 44211 } else { 44212 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 44213 style = { 44214 color: { 44215 background: customMainColor 44216 } 44217 }; 44218 } 44219 } 44220 44221 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 44222 if (customTextColor && style) { 44223 style.color = { 44224 ...style.color, 44225 text: customTextColor 44226 }; 44227 } 44228 return { 44229 value: multilineToInline(value), 44230 className, 44231 backgroundColor: isSolidColorStyle ? mainColor : undefined, 44232 borderColor: isSolidColorStyle ? undefined : mainColor, 44233 textAlign: isSolidColorStyle ? 'left' : undefined, 44234 style, 44235 ...attributes 44236 }; 44237 } 44238 }; 44239 const pullquote_deprecated_v1 = { 44240 attributes: { 44241 ...pullquote_deprecated_blockAttributes 44242 }, 44243 save({ 44244 attributes 44245 }) { 44246 const { 44247 value, 44248 citation 44249 } = attributes; 44250 return (0,external_React_namespaceObject.createElement)("blockquote", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44251 value: value, 44252 multiline: true 44253 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44254 tagName: "cite", 44255 value: citation 44256 })); 44257 }, 44258 migrate({ 44259 value, 44260 ...attributes 44261 }) { 44262 return { 44263 value: multilineToInline(value), 44264 ...attributes 44265 }; 44266 } 44267 }; 44268 const deprecated_v0 = { 44269 attributes: { 44270 ...pullquote_deprecated_blockAttributes, 44271 citation: { 44272 type: 'string', 44273 source: 'html', 44274 selector: 'footer' 44275 }, 44276 align: { 44277 type: 'string', 44278 default: 'none' 44279 } 44280 }, 44281 save({ 44282 attributes 44283 }) { 44284 const { 44285 value, 44286 citation, 44287 align 44288 } = attributes; 44289 return (0,external_React_namespaceObject.createElement)("blockquote", { 44290 className: `align$align}` 44291 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44292 value: value, 44293 multiline: true 44294 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44295 tagName: "footer", 44296 value: citation 44297 })); 44298 }, 44299 migrate({ 44300 value, 44301 ...attributes 44302 }) { 44303 return { 44304 value: multilineToInline(value), 44305 ...attributes 44306 }; 44307 } 44308 }; 44309 44310 /** 44311 * New deprecations need to be placed first 44312 * for them to have higher priority. 44313 * 44314 * Old deprecations may need to be updated as well. 44315 * 44316 * See block-deprecation.md 44317 */ 44318 /* harmony default export */ const pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]); 44319 44320 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js 44321 const Figure = 'figure'; 44322 44323 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js 44324 const BlockQuote = 'blockquote'; 44325 44326 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js 44327 44328 /** 44329 * External dependencies 44330 */ 44331 44332 44333 /** 44334 * WordPress dependencies 44335 */ 44336 44337 44338 44339 44340 44341 /** 44342 * Internal dependencies 44343 */ 44344 44345 44346 const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; 44347 function PullQuoteEdit({ 44348 attributes, 44349 setAttributes, 44350 isSelected, 44351 insertBlocksAfter 44352 }) { 44353 const { 44354 textAlign, 44355 citation, 44356 value 44357 } = attributes; 44358 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 44359 className: classnames_default()({ 44360 [`has-text-align-$textAlign}`]: textAlign 44361 }) 44362 }); 44363 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected; 44364 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 44365 group: "block" 44366 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 44367 value: textAlign, 44368 onChange: nextAlign => { 44369 setAttributes({ 44370 textAlign: nextAlign 44371 }); 44372 } 44373 })), (0,external_React_namespaceObject.createElement)(Figure, { 44374 ...blockProps 44375 }, (0,external_React_namespaceObject.createElement)(BlockQuote, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 44376 identifier: "value", 44377 tagName: "p", 44378 value: value, 44379 onChange: nextValue => setAttributes({ 44380 value: nextValue 44381 }), 44382 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'), 44383 placeholder: 44384 // translators: placeholder text used for the quote 44385 (0,external_wp_i18n_namespaceObject.__)('Add quote'), 44386 textAlign: "center" 44387 }), shouldShowCitation && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 44388 identifier: "citation", 44389 tagName: isWebPlatform ? 'cite' : undefined, 44390 style: { 44391 display: 'block' 44392 }, 44393 value: citation, 44394 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'), 44395 placeholder: 44396 // translators: placeholder text used for the citation 44397 (0,external_wp_i18n_namespaceObject.__)('Add citation'), 44398 onChange: nextCitation => setAttributes({ 44399 citation: nextCitation 44400 }), 44401 className: "wp-block-pullquote__citation", 44402 __unstableMobileNoFocusOnMount: true, 44403 textAlign: "center", 44404 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 44405 })))); 44406 } 44407 /* harmony default export */ const pullquote_edit = (PullQuoteEdit); 44408 44409 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js 44410 44411 /** 44412 * External dependencies 44413 */ 44414 44415 44416 /** 44417 * WordPress dependencies 44418 */ 44419 44420 function pullquote_save_save({ 44421 attributes 44422 }) { 44423 const { 44424 textAlign, 44425 citation, 44426 value 44427 } = attributes; 44428 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); 44429 return (0,external_React_namespaceObject.createElement)("figure", { 44430 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 44431 className: classnames_default()({ 44432 [`has-text-align-$textAlign}`]: textAlign 44433 }) 44434 }) 44435 }, (0,external_React_namespaceObject.createElement)("blockquote", null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44436 tagName: "p", 44437 value: value 44438 }), shouldShowCitation && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 44439 tagName: "cite", 44440 value: citation 44441 }))); 44442 } 44443 44444 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js 44445 /** 44446 * WordPress dependencies 44447 */ 44448 44449 44450 const pullquote_transforms_transforms = { 44451 from: [{ 44452 type: 'block', 44453 isMultiBlock: true, 44454 blocks: ['core/paragraph'], 44455 transform: attributes => { 44456 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 44457 value: (0,external_wp_richText_namespaceObject.toHTMLString)({ 44458 value: (0,external_wp_richText_namespaceObject.join)(attributes.map(({ 44459 content 44460 }) => (0,external_wp_richText_namespaceObject.create)({ 44461 html: content 44462 })), '\n') 44463 }), 44464 anchor: attributes.anchor 44465 }); 44466 } 44467 }, { 44468 type: 'block', 44469 blocks: ['core/heading'], 44470 transform: ({ 44471 content, 44472 anchor 44473 }) => { 44474 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 44475 value: content, 44476 anchor 44477 }); 44478 } 44479 }], 44480 to: [{ 44481 type: 'block', 44482 blocks: ['core/paragraph'], 44483 transform: ({ 44484 value, 44485 citation 44486 }) => { 44487 const paragraphs = []; 44488 if (value) { 44489 paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 44490 content: value 44491 })); 44492 } 44493 if (citation) { 44494 paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 44495 content: citation 44496 })); 44497 } 44498 if (paragraphs.length === 0) { 44499 return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 44500 content: '' 44501 }); 44502 } 44503 return paragraphs; 44504 } 44505 }, { 44506 type: 'block', 44507 blocks: ['core/heading'], 44508 transform: ({ 44509 value, 44510 citation 44511 }) => { 44512 // If there is no pullquote content, use the citation as the 44513 // content of the resulting heading. A nonexistent citation 44514 // will result in an empty heading. 44515 if (!value) { 44516 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 44517 content: citation 44518 }); 44519 } 44520 const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 44521 content: value 44522 }); 44523 if (!citation) { 44524 return headingBlock; 44525 } 44526 return [headingBlock, (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 44527 content: citation 44528 })]; 44529 } 44530 }] 44531 }; 44532 /* harmony default export */ const pullquote_transforms = (pullquote_transforms_transforms); 44533 44534 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 44535 /** 44536 * WordPress dependencies 44537 */ 44538 44539 44540 44541 /** 44542 * Internal dependencies 44543 */ 44544 44545 44546 44547 const pullquote_metadata = { 44548 $schema: "https://schemas.wp.org/trunk/block.json", 44549 apiVersion: 3, 44550 name: "core/pullquote", 44551 title: "Pullquote", 44552 category: "text", 44553 description: "Give special visual emphasis to a quote from your text.", 44554 textdomain: "default", 44555 attributes: { 44556 value: { 44557 type: "rich-text", 44558 source: "rich-text", 44559 selector: "p", 44560 __experimentalRole: "content" 44561 }, 44562 citation: { 44563 type: "rich-text", 44564 source: "rich-text", 44565 selector: "cite", 44566 __experimentalRole: "content" 44567 }, 44568 textAlign: { 44569 type: "string" 44570 } 44571 }, 44572 supports: { 44573 anchor: true, 44574 align: ["left", "right", "wide", "full"], 44575 color: { 44576 gradients: true, 44577 background: true, 44578 link: true, 44579 __experimentalDefaultControls: { 44580 background: true, 44581 text: true 44582 } 44583 }, 44584 spacing: { 44585 margin: true, 44586 padding: true 44587 }, 44588 typography: { 44589 fontSize: true, 44590 lineHeight: true, 44591 __experimentalFontFamily: true, 44592 __experimentalFontWeight: true, 44593 __experimentalFontStyle: true, 44594 __experimentalTextTransform: true, 44595 __experimentalTextDecoration: true, 44596 __experimentalLetterSpacing: true, 44597 __experimentalDefaultControls: { 44598 fontSize: true 44599 } 44600 }, 44601 __experimentalBorder: { 44602 color: true, 44603 radius: true, 44604 style: true, 44605 width: true, 44606 __experimentalDefaultControls: { 44607 color: true, 44608 radius: true, 44609 style: true, 44610 width: true 44611 } 44612 }, 44613 __experimentalStyle: { 44614 typography: { 44615 fontSize: "1.5em", 44616 lineHeight: "1.6" 44617 } 44618 }, 44619 interactivity: { 44620 clientNavigation: true 44621 } 44622 }, 44623 editorStyle: "wp-block-pullquote-editor", 44624 style: "wp-block-pullquote" 44625 }; 44626 44627 44628 const { 44629 name: pullquote_name 44630 } = pullquote_metadata; 44631 44632 const pullquote_settings = { 44633 icon: library_pullquote, 44634 example: { 44635 attributes: { 44636 value: 44637 // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg. 44638 (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.'), 44639 citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg') 44640 } 44641 }, 44642 transforms: pullquote_transforms, 44643 edit: pullquote_edit, 44644 save: pullquote_save_save, 44645 deprecated: pullquote_deprecated 44646 }; 44647 const pullquote_init = () => initBlock({ 44648 name: pullquote_name, 44649 metadata: pullquote_metadata, 44650 settings: pullquote_settings 44651 }); 44652 44653 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js 44654 44655 /** 44656 * WordPress dependencies 44657 */ 44658 44659 const loop = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 44660 viewBox: "0 0 24 24", 44661 xmlns: "http://www.w3.org/2000/svg" 44662 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 44663 d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z" 44664 })); 44665 /* harmony default export */ const library_loop = (loop); 44666 44667 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js 44668 44669 /** 44670 * WordPress dependencies 44671 */ 44672 44673 const settings_settings = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 44674 xmlns: "http://www.w3.org/2000/svg", 44675 viewBox: "0 0 24 24" 44676 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 44677 d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" 44678 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 44679 d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" 44680 })); 44681 /* harmony default export */ const library_settings = (settings_settings); 44682 44683 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js 44684 /** 44685 * WordPress dependencies 44686 */ 44687 44688 44689 44690 44691 44692 44693 44694 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 44695 44696 /** 44697 * @typedef IHasNameAndId 44698 * @property {string|number} id The entity's id. 44699 * @property {string} name The entity's name. 44700 */ 44701 44702 /** 44703 * The object used in Query block that contains info and helper mappings 44704 * from an array of IHasNameAndId objects. 44705 * 44706 * @typedef {Object} QueryEntitiesInfo 44707 * @property {IHasNameAndId[]} entities The array of entities. 44708 * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value. 44709 * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value. 44710 * @property {string[]} names Array with the entities' names. 44711 */ 44712 44713 /** 44714 * Returns a helper object with mapping from Objects that implement 44715 * the `IHasNameAndId` interface. The returned object is used for 44716 * integration with `FormTokenField` component. 44717 * 44718 * @param {IHasNameAndId[]} entities The entities to extract of helper object. 44719 * @return {QueryEntitiesInfo} The object with the entities information. 44720 */ 44721 const getEntitiesInfo = entities => { 44722 const mapping = entities?.reduce((accumulator, entity) => { 44723 const { 44724 mapById, 44725 mapByName, 44726 names 44727 } = accumulator; 44728 mapById[entity.id] = entity; 44729 mapByName[entity.name] = entity; 44730 names.push(entity.name); 44731 return accumulator; 44732 }, { 44733 mapById: {}, 44734 mapByName: {}, 44735 names: [] 44736 }); 44737 return { 44738 entities, 44739 ...mapping 44740 }; 44741 }; 44742 44743 /** 44744 * Helper util to return a value from a certain path of the object. 44745 * Path is specified as a string of properties, separated by dots, 44746 * for example: "parent.child". 44747 * 44748 * @param {Object} object Input object. 44749 * @param {string} path Path to the object property. 44750 * @return {*} Value of the object property at the specified path. 44751 */ 44752 const getValueFromObjectPath = (object, path) => { 44753 const normalizedPath = path.split('.'); 44754 let value = object; 44755 normalizedPath.forEach(fieldName => { 44756 value = value?.[fieldName]; 44757 }); 44758 return value; 44759 }; 44760 44761 /** 44762 * Helper util to map records to add a `name` prop from a 44763 * provided path, in order to handle all entities in the same 44764 * fashion(implementing`IHasNameAndId` interface). 44765 * 44766 * @param {Object[]} entities The array of entities. 44767 * @param {string} path The path to map a `name` property from the entity. 44768 * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface. 44769 */ 44770 const mapToIHasNameAndId = (entities, path) => { 44771 return (entities || []).map(entity => ({ 44772 ...entity, 44773 name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getValueFromObjectPath(entity, path)) 44774 })); 44775 }; 44776 44777 /** 44778 * Returns a helper object that contains: 44779 * 1. An `options` object from the available post types, to be passed to a `SelectControl`. 44780 * 2. A helper map with available taxonomies per post type. 44781 * 44782 * @return {Object} The helper object related to post types. 44783 */ 44784 const usePostTypes = () => { 44785 const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => { 44786 const { 44787 getPostTypes 44788 } = select(external_wp_coreData_namespaceObject.store); 44789 const excludedPostTypes = ['attachment']; 44790 const filteredPostTypes = getPostTypes({ 44791 per_page: -1 44792 })?.filter(({ 44793 viewable, 44794 slug 44795 }) => viewable && !excludedPostTypes.includes(slug)); 44796 return filteredPostTypes; 44797 }, []); 44798 const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => { 44799 if (!postTypes?.length) return; 44800 return postTypes.reduce((accumulator, type) => { 44801 accumulator[type.slug] = type.taxonomies; 44802 return accumulator; 44803 }, {}); 44804 }, [postTypes]); 44805 const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(({ 44806 labels, 44807 slug 44808 }) => ({ 44809 label: labels.singular_name, 44810 value: slug 44811 })), [postTypes]); 44812 return { 44813 postTypesTaxonomiesMap, 44814 postTypesSelectOptions 44815 }; 44816 }; 44817 44818 /** 44819 * Hook that returns the taxonomies associated with a specific post type. 44820 * 44821 * @param {string} postType The post type from which to retrieve the associated taxonomies. 44822 * @return {Object[]} An array of the associated taxonomies. 44823 */ 44824 const useTaxonomies = postType => { 44825 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { 44826 const { 44827 getTaxonomies 44828 } = select(external_wp_coreData_namespaceObject.store); 44829 const filteredTaxonomies = getTaxonomies({ 44830 type: postType, 44831 per_page: -1, 44832 context: 'view' 44833 }); 44834 return filteredTaxonomies; 44835 }, [postType]); 44836 return taxonomies; 44837 }; 44838 44839 /** 44840 * Hook that returns whether a specific post type is hierarchical. 44841 * 44842 * @param {string} postType The post type to check. 44843 * @return {boolean} Whether a specific post type is hierarchical. 44844 */ 44845 function useIsPostTypeHierarchical(postType) { 44846 return (0,external_wp_data_namespaceObject.useSelect)(select => { 44847 const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType); 44848 return type?.viewable && type?.hierarchical; 44849 }, [postType]); 44850 } 44851 44852 /** 44853 * Hook that returns the query properties' names defined by the active 44854 * block variation, to determine which block's filters to show. 44855 * 44856 * @param {Object} attributes Block attributes. 44857 * @return {string[]} An array of the query attributes. 44858 */ 44859 function useAllowedControls(attributes) { 44860 return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.allowedControls, [attributes]); 44861 } 44862 function isControlAllowed(allowedControls, key) { 44863 // Every controls is allowed if the list is not defined. 44864 if (!allowedControls) { 44865 return true; 44866 } 44867 return allowedControls.includes(key); 44868 } 44869 44870 /** 44871 * Clones a pattern's blocks and then recurses over that list of blocks, 44872 * transforming them to retain some `query` attribute properties. 44873 * For now we retain the `postType` and `inherit` properties as they are 44874 * fundamental for the expected functionality of the block and don't affect 44875 * its design and presentation. 44876 * 44877 * Returns the cloned/transformed blocks and array of existing Query Loop 44878 * client ids for further manipulation, in order to avoid multiple recursions. 44879 * 44880 * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate). 44881 * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes. 44882 * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks. 44883 */ 44884 const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => { 44885 const { 44886 query: { 44887 postType, 44888 inherit 44889 } 44890 } = queryBlockAttributes; 44891 const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); 44892 const queryClientIds = []; 44893 const blocksQueue = [...clonedBlocks]; 44894 while (blocksQueue.length > 0) { 44895 const block = blocksQueue.shift(); 44896 if (block.name === 'core/query') { 44897 block.attributes.query = { 44898 ...block.attributes.query, 44899 postType, 44900 inherit 44901 }; 44902 queryClientIds.push(block.clientId); 44903 } 44904 block.innerBlocks?.forEach(innerBlock => { 44905 blocksQueue.push(innerBlock); 44906 }); 44907 } 44908 return { 44909 newBlocks: clonedBlocks, 44910 queryClientIds 44911 }; 44912 }; 44913 44914 /** 44915 * Helper hook that determines if there is an active variation of the block 44916 * and if there are available specific patterns for this variation. 44917 * If there are, these patterns are going to be the only ones suggested to 44918 * the user in setup and replace flow, without including the default ones 44919 * for Query Loop. 44920 * 44921 * If there are no such patterns, the default ones for Query Loop are going 44922 * to be suggested. 44923 * 44924 * @param {string} clientId The block's client ID. 44925 * @param {Object} attributes The block's attributes. 44926 * @return {string} The block name to be used in the patterns suggestions. 44927 */ 44928 function useBlockNameForPatterns(clientId, attributes) { 44929 const activeVariationName = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.name, [attributes]); 44930 const blockName = `core/query/$activeVariationName}`; 44931 const hasActiveVariationPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => { 44932 if (!activeVariationName) { 44933 return false; 44934 } 44935 const { 44936 getBlockRootClientId, 44937 getPatternsByBlockTypes 44938 } = select(external_wp_blockEditor_namespaceObject.store); 44939 const rootClientId = getBlockRootClientId(clientId); 44940 const activePatterns = getPatternsByBlockTypes(blockName, rootClientId); 44941 return activePatterns.length > 0; 44942 }, [clientId, activeVariationName, blockName]); 44943 return hasActiveVariationPatterns ? blockName : 'core/query'; 44944 } 44945 44946 /** 44947 * Helper hook that determines if there is an active variation of the block 44948 * and if there are available specific scoped `block` variations connected with 44949 * this variation. 44950 * 44951 * If there are, these variations are going to be the only ones suggested 44952 * to the user in setup flow when clicking to `start blank`, without including 44953 * the default ones for Query Loop. 44954 * 44955 * If there are no such scoped `block` variations, the default ones for Query 44956 * Loop are going to be suggested. 44957 * 44958 * The way we determine such variations is with the convention that they have the `namespace` 44959 * attribute defined as an array. This array should contain the names(`name` property) of any 44960 * variations they want to be connected to. 44961 * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`, 44962 * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`. 44963 * If the user selects this variation, the `namespace` attribute will be overridden by the 44964 * main `inserter` variation. 44965 * 44966 * @param {Object} attributes The block's attributes. 44967 * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`. 44968 */ 44969 function useScopedBlockVariations(attributes) { 44970 const { 44971 activeVariationName, 44972 blockVariations 44973 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 44974 const { 44975 getActiveBlockVariation, 44976 getBlockVariations 44977 } = select(external_wp_blocks_namespaceObject.store); 44978 return { 44979 activeVariationName: getActiveBlockVariation('core/query', attributes)?.name, 44980 blockVariations: getBlockVariations('core/query', 'block') 44981 }; 44982 }, [attributes]); 44983 const variations = (0,external_wp_element_namespaceObject.useMemo)(() => { 44984 // Filter out the variations that have defined a `namespace` attribute, 44985 // which means they are 'connected' to specific variations of the block. 44986 const isNotConnected = variation => !variation.attributes?.namespace; 44987 if (!activeVariationName) { 44988 return blockVariations.filter(isNotConnected); 44989 } 44990 const connectedVariations = blockVariations.filter(variation => variation.attributes?.namespace?.includes(activeVariationName)); 44991 if (!!connectedVariations.length) { 44992 return connectedVariations; 44993 } 44994 return blockVariations.filter(isNotConnected); 44995 }, [activeVariationName, blockVariations]); 44996 return variations; 44997 } 44998 44999 /** 45000 * Hook that returns the block patterns for a specific block type. 45001 * 45002 * @param {string} clientId The block's client ID. 45003 * @param {string} name The block type name. 45004 * @return {Object[]} An array of valid block patterns. 45005 */ 45006 const usePatterns = (clientId, name) => { 45007 return (0,external_wp_data_namespaceObject.useSelect)(select => { 45008 const { 45009 getBlockRootClientId, 45010 getPatternsByBlockTypes 45011 } = select(external_wp_blockEditor_namespaceObject.store); 45012 const rootClientId = getBlockRootClientId(clientId); 45013 return getPatternsByBlockTypes(name, rootClientId); 45014 }, [name, clientId]); 45015 }; 45016 45017 /** 45018 * The object returned by useUnsupportedBlocks with info about the type of 45019 * unsupported blocks present inside the Query block. 45020 * 45021 * @typedef {Object} UnsupportedBlocksInfo 45022 * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present. 45023 * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present. 45024 * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks. 45025 */ 45026 45027 /** 45028 * Hook that returns an object with information about the unsupported blocks 45029 * present inside a Query Loop with the given `clientId`. The returned object 45030 * contains props that are true when a certain type of unsupported block is 45031 * present. 45032 * 45033 * @param {string} clientId The block's client ID. 45034 * @return {UnsupportedBlocksInfo} The object containing the information. 45035 */ 45036 const useUnsupportedBlocks = clientId => { 45037 return (0,external_wp_data_namespaceObject.useSelect)(select => { 45038 const { 45039 getClientIdsOfDescendants, 45040 getBlockName 45041 } = select(external_wp_blockEditor_namespaceObject.store); 45042 const blocks = {}; 45043 getClientIdsOfDescendants(clientId).forEach(descendantClientId => { 45044 const blockName = getBlockName(descendantClientId); 45045 /* 45046 * Client side navigation can be true in two states: 45047 * - supports.interactivity = true; 45048 * - supports.interactivity.clientNavigation = true; 45049 */ 45050 const blockSupportsInteractivity = Object.is((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity'), true); 45051 const blockSupportsInteractivityClientNavigation = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity.clientNavigation'); 45052 const blockInteractivity = blockSupportsInteractivity || blockSupportsInteractivityClientNavigation; 45053 if (!blockInteractivity) { 45054 blocks.hasBlocksFromPlugins = true; 45055 } else if (blockName === 'core/post-content') { 45056 blocks.hasPostContentBlock = true; 45057 } 45058 }); 45059 blocks.hasUnsupportedBlocks = blocks.hasBlocksFromPlugins || blocks.hasPostContentBlock; 45060 return blocks; 45061 }, [clientId]); 45062 }; 45063 45064 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js 45065 45066 /** 45067 * WordPress dependencies 45068 */ 45069 45070 45071 45072 45073 45074 /** 45075 * Internal dependencies 45076 */ 45077 45078 function QueryToolbar({ 45079 attributes: { 45080 query 45081 }, 45082 setQuery, 45083 openPatternSelectionModal, 45084 name, 45085 clientId 45086 }) { 45087 const hasPatterns = !!usePatterns(clientId, name).length; 45088 const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input'); 45089 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !query.inherit && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { 45090 contentClassName: "block-library-query-toolbar__popover", 45091 renderToggle: ({ 45092 onToggle 45093 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 45094 icon: library_settings, 45095 label: (0,external_wp_i18n_namespaceObject.__)('Display settings'), 45096 onClick: onToggle 45097 }), 45098 renderContent: () => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, { 45099 __unstableInputWidth: "60px", 45100 label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'), 45101 labelPosition: "edge", 45102 min: 1, 45103 max: 100, 45104 onChange: value => { 45105 if (isNaN(value) || value < 1 || value > 100) { 45106 return; 45107 } 45108 setQuery({ 45109 perPage: value 45110 }); 45111 }, 45112 step: "1", 45113 value: query.perPage, 45114 isDragEnabled: false 45115 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, { 45116 __unstableInputWidth: "60px", 45117 label: (0,external_wp_i18n_namespaceObject.__)('Offset'), 45118 labelPosition: "edge", 45119 min: 0, 45120 max: 100, 45121 onChange: value => { 45122 if (isNaN(value) || value < 0 || value > 100) { 45123 return; 45124 } 45125 setQuery({ 45126 offset: value 45127 }); 45128 }, 45129 step: "1", 45130 value: query.offset, 45131 isDragEnabled: false 45132 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 45133 id: maxPageInputId, 45134 help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).') 45135 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, { 45136 id: maxPageInputId, 45137 __unstableInputWidth: "60px", 45138 label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'), 45139 labelPosition: "edge", 45140 min: 0, 45141 onChange: value => { 45142 if (isNaN(value) || value < 0) { 45143 return; 45144 } 45145 setQuery({ 45146 pages: value 45147 }); 45148 }, 45149 step: "1", 45150 value: query.pages, 45151 isDragEnabled: false 45152 }))) 45153 })), hasPatterns && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { 45154 className: "wp-block-template-part__block-control-group" 45155 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 45156 onClick: openPatternSelectionModal 45157 }, (0,external_wp_i18n_namespaceObject.__)('Replace')))); 45158 } 45159 45160 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js 45161 45162 /** 45163 * WordPress dependencies 45164 */ 45165 45166 45167 const orderOptions = [{ 45168 label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'), 45169 value: 'date/desc' 45170 }, { 45171 label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'), 45172 value: 'date/asc' 45173 }, { 45174 /* translators: label for ordering posts by title in ascending order */ 45175 label: (0,external_wp_i18n_namespaceObject.__)('A → Z'), 45176 value: 'title/asc' 45177 }, { 45178 /* translators: label for ordering posts by title in descending order */ 45179 label: (0,external_wp_i18n_namespaceObject.__)('Z → A'), 45180 value: 'title/desc' 45181 }]; 45182 function OrderControl({ 45183 order, 45184 orderBy, 45185 onChange 45186 }) { 45187 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 45188 __nextHasNoMarginBottom: true, 45189 label: (0,external_wp_i18n_namespaceObject.__)('Order by'), 45190 value: `$orderBy}/$order}`, 45191 options: orderOptions, 45192 onChange: value => { 45193 const [newOrderBy, newOrder] = value.split('/'); 45194 onChange({ 45195 order: newOrder, 45196 orderBy: newOrderBy 45197 }); 45198 } 45199 }); 45200 } 45201 /* harmony default export */ const order_control = (OrderControl); 45202 45203 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js 45204 45205 /** 45206 * WordPress dependencies 45207 */ 45208 45209 45210 45211 45212 45213 /** 45214 * Internal dependencies 45215 */ 45216 45217 const author_control_AUTHORS_QUERY = { 45218 who: 'authors', 45219 per_page: -1, 45220 _fields: 'id,name', 45221 context: 'view' 45222 }; 45223 function AuthorControl({ 45224 value, 45225 onChange 45226 }) { 45227 const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { 45228 const { 45229 getUsers 45230 } = select(external_wp_coreData_namespaceObject.store); 45231 return getUsers(author_control_AUTHORS_QUERY); 45232 }, []); 45233 if (!authorsList) { 45234 return null; 45235 } 45236 const authorsInfo = getEntitiesInfo(authorsList); 45237 /** 45238 * We need to normalize the value because the block operates on a 45239 * comma(`,`) separated string value and `FormTokenFiels` needs an 45240 * array. 45241 */ 45242 const normalizedValue = !value ? [] : value.toString().split(','); 45243 // Returns only the existing authors ids. This prevents the component 45244 // from crashing in the editor, when non existing ids are provided. 45245 const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => { 45246 const author = authorsInfo.mapById[authorId]; 45247 if (author) { 45248 accumulator.push({ 45249 id: authorId, 45250 value: author.name 45251 }); 45252 } 45253 return accumulator; 45254 }, []); 45255 const getIdByValue = (entitiesMappedByName, authorValue) => { 45256 const id = authorValue?.id || entitiesMappedByName[authorValue]?.id; 45257 if (id) return id; 45258 }; 45259 const onAuthorChange = newValue => { 45260 const ids = Array.from(newValue.reduce((accumulator, author) => { 45261 // Verify that new values point to existing entities. 45262 const id = getIdByValue(authorsInfo.mapByName, author); 45263 if (id) accumulator.add(id); 45264 return accumulator; 45265 }, new Set())); 45266 onChange({ 45267 author: ids.join(',') 45268 }); 45269 }; 45270 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, { 45271 label: (0,external_wp_i18n_namespaceObject.__)('Authors'), 45272 value: sanitizedValue, 45273 suggestions: authorsInfo.names, 45274 onChange: onAuthorChange, 45275 __experimentalShowHowTo: false 45276 }); 45277 } 45278 /* harmony default export */ const author_control = (AuthorControl); 45279 45280 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/parent-control.js 45281 45282 /** 45283 * WordPress dependencies 45284 */ 45285 45286 45287 45288 45289 45290 45291 45292 /** 45293 * Internal dependencies 45294 */ 45295 45296 const parent_control_EMPTY_ARRAY = []; 45297 const BASE_QUERY = { 45298 order: 'asc', 45299 _fields: 'id,title', 45300 context: 'view' 45301 }; 45302 function ParentControl({ 45303 parents, 45304 postType, 45305 onChange 45306 }) { 45307 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); 45308 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); 45309 const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); 45310 const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); 45311 const { 45312 searchResults, 45313 searchHasResolved 45314 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 45315 if (!search) { 45316 return { 45317 searchResults: parent_control_EMPTY_ARRAY, 45318 searchHasResolved: true 45319 }; 45320 } 45321 const { 45322 getEntityRecords, 45323 hasFinishedResolution 45324 } = select(external_wp_coreData_namespaceObject.store); 45325 const selectorArgs = ['postType', postType, { 45326 ...BASE_QUERY, 45327 search, 45328 orderby: 'relevance', 45329 exclude: parents, 45330 per_page: 20 45331 }]; 45332 return { 45333 searchResults: getEntityRecords(...selectorArgs), 45334 searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) 45335 }; 45336 }, [search, parents]); 45337 const currentParents = (0,external_wp_data_namespaceObject.useSelect)(select => { 45338 if (!parents?.length) return parent_control_EMPTY_ARRAY; 45339 const { 45340 getEntityRecords 45341 } = select(external_wp_coreData_namespaceObject.store); 45342 return getEntityRecords('postType', postType, { 45343 ...BASE_QUERY, 45344 include: parents, 45345 per_page: parents.length 45346 }); 45347 }, [parents]); 45348 // Update the `value` state only after the selectors are resolved 45349 // to avoid emptying the input when we're changing parents. 45350 (0,external_wp_element_namespaceObject.useEffect)(() => { 45351 if (!parents?.length) { 45352 setValue(parent_control_EMPTY_ARRAY); 45353 } 45354 if (!currentParents?.length) return; 45355 const currentParentsInfo = getEntitiesInfo(mapToIHasNameAndId(currentParents, 'title.rendered')); 45356 // Returns only the existing entity ids. This prevents the component 45357 // from crashing in the editor, when non existing ids are provided. 45358 const sanitizedValue = parents.reduce((accumulator, id) => { 45359 const entity = currentParentsInfo.mapById[id]; 45360 if (entity) { 45361 accumulator.push({ 45362 id, 45363 value: entity.name 45364 }); 45365 } 45366 return accumulator; 45367 }, []); 45368 setValue(sanitizedValue); 45369 }, [parents, currentParents]); 45370 const entitiesInfo = (0,external_wp_element_namespaceObject.useMemo)(() => { 45371 if (!searchResults?.length) return parent_control_EMPTY_ARRAY; 45372 return getEntitiesInfo(mapToIHasNameAndId(searchResults, 'title.rendered')); 45373 }, [searchResults]); 45374 // Update suggestions only when the query has resolved. 45375 (0,external_wp_element_namespaceObject.useEffect)(() => { 45376 if (!searchHasResolved) return; 45377 setSuggestions(entitiesInfo.names); 45378 }, [entitiesInfo.names, searchHasResolved]); 45379 const getIdByValue = (entitiesMappedByName, entity) => { 45380 const id = entity?.id || entitiesMappedByName?.[entity]?.id; 45381 if (id) return id; 45382 }; 45383 const onParentChange = newValue => { 45384 const ids = Array.from(newValue.reduce((accumulator, entity) => { 45385 // Verify that new values point to existing entities. 45386 const id = getIdByValue(entitiesInfo.mapByName, entity); 45387 if (id) accumulator.add(id); 45388 return accumulator; 45389 }, new Set())); 45390 setSuggestions(parent_control_EMPTY_ARRAY); 45391 onChange({ 45392 parents: ids 45393 }); 45394 }; 45395 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, { 45396 label: (0,external_wp_i18n_namespaceObject.__)('Parents'), 45397 value: value, 45398 onInputChange: debouncedSearch, 45399 suggestions: suggestions, 45400 onChange: onParentChange, 45401 __experimentalShowHowTo: false 45402 }); 45403 } 45404 /* harmony default export */ const parent_control = (ParentControl); 45405 45406 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js 45407 45408 /** 45409 * WordPress dependencies 45410 */ 45411 45412 45413 45414 45415 45416 45417 45418 /** 45419 * Internal dependencies 45420 */ 45421 45422 const taxonomy_controls_EMPTY_ARRAY = []; 45423 const taxonomy_controls_BASE_QUERY = { 45424 order: 'asc', 45425 _fields: 'id,name', 45426 context: 'view' 45427 }; 45428 45429 // Helper function to get the term id based on user input in terms `FormTokenField`. 45430 const getTermIdByTermValue = (terms, termValue) => { 45431 // First we check for exact match by `term.id` or case sensitive `term.name` match. 45432 const termId = termValue?.id || terms?.find(term => term.name === termValue)?.id; 45433 if (termId) { 45434 return termId; 45435 } 45436 45437 /** 45438 * Here we make an extra check for entered terms in a non case sensitive way, 45439 * to match user expectations, due to `FormTokenField` behaviour that shows 45440 * suggestions which are case insensitive. 45441 * 45442 * Although WP tries to discourage users to add terms with the same name (case insensitive), 45443 * it's still possible if you manually change the name, as long as the terms have different slugs. 45444 * In this edge case we always apply the first match from the terms list. 45445 */ 45446 const termValueLower = termValue.toLocaleLowerCase(); 45447 return terms?.find(term => term.name.toLocaleLowerCase() === termValueLower)?.id; 45448 }; 45449 function TaxonomyControls({ 45450 onChange, 45451 query 45452 }) { 45453 const { 45454 postType, 45455 taxQuery 45456 } = query; 45457 const taxonomies = useTaxonomies(postType); 45458 if (!taxonomies || taxonomies.length === 0) { 45459 return null; 45460 } 45461 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, taxonomies.map(taxonomy => { 45462 const termIds = taxQuery?.[taxonomy.slug] || []; 45463 const handleChange = newTermIds => onChange({ 45464 taxQuery: { 45465 ...taxQuery, 45466 [taxonomy.slug]: newTermIds 45467 } 45468 }); 45469 return (0,external_React_namespaceObject.createElement)(TaxonomyItem, { 45470 key: taxonomy.slug, 45471 taxonomy: taxonomy, 45472 termIds: termIds, 45473 onChange: handleChange 45474 }); 45475 })); 45476 } 45477 45478 /** 45479 * Renders a `FormTokenField` for a given taxonomy. 45480 * 45481 * @param {Object} props The props for the component. 45482 * @param {Object} props.taxonomy The taxonomy object. 45483 * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy. 45484 * @param {Function} props.onChange Callback `onChange` function. 45485 * @return {JSX.Element} The rendered component. 45486 */ 45487 function TaxonomyItem({ 45488 taxonomy, 45489 termIds, 45490 onChange 45491 }) { 45492 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); 45493 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); 45494 const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); 45495 const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); 45496 const { 45497 searchResults, 45498 searchHasResolved 45499 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 45500 if (!search) { 45501 return { 45502 searchResults: taxonomy_controls_EMPTY_ARRAY, 45503 searchHasResolved: true 45504 }; 45505 } 45506 const { 45507 getEntityRecords, 45508 hasFinishedResolution 45509 } = select(external_wp_coreData_namespaceObject.store); 45510 const selectorArgs = ['taxonomy', taxonomy.slug, { 45511 ...taxonomy_controls_BASE_QUERY, 45512 search, 45513 orderby: 'name', 45514 exclude: termIds, 45515 per_page: 20 45516 }]; 45517 return { 45518 searchResults: getEntityRecords(...selectorArgs), 45519 searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) 45520 }; 45521 }, [search, termIds]); 45522 // `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`. 45523 // They are used to extract the terms' names to populate the `FormTokenField` properly 45524 // and to sanitize the provided `termIds`, by setting only the ones that exist. 45525 const existingTerms = (0,external_wp_data_namespaceObject.useSelect)(select => { 45526 if (!termIds?.length) return taxonomy_controls_EMPTY_ARRAY; 45527 const { 45528 getEntityRecords 45529 } = select(external_wp_coreData_namespaceObject.store); 45530 return getEntityRecords('taxonomy', taxonomy.slug, { 45531 ...taxonomy_controls_BASE_QUERY, 45532 include: termIds, 45533 per_page: termIds.length 45534 }); 45535 }, [termIds]); 45536 // Update the `value` state only after the selectors are resolved 45537 // to avoid emptying the input when we're changing terms. 45538 (0,external_wp_element_namespaceObject.useEffect)(() => { 45539 if (!termIds?.length) { 45540 setValue(taxonomy_controls_EMPTY_ARRAY); 45541 } 45542 if (!existingTerms?.length) return; 45543 // Returns only the existing entity ids. This prevents the component 45544 // from crashing in the editor, when non existing ids are provided. 45545 const sanitizedValue = termIds.reduce((accumulator, id) => { 45546 const entity = existingTerms.find(term => term.id === id); 45547 if (entity) { 45548 accumulator.push({ 45549 id, 45550 value: entity.name 45551 }); 45552 } 45553 return accumulator; 45554 }, []); 45555 setValue(sanitizedValue); 45556 }, [termIds, existingTerms]); 45557 // Update suggestions only when the query has resolved. 45558 (0,external_wp_element_namespaceObject.useEffect)(() => { 45559 if (!searchHasResolved) return; 45560 setSuggestions(searchResults.map(result => result.name)); 45561 }, [searchResults, searchHasResolved]); 45562 const onTermsChange = newTermValues => { 45563 const newTermIds = new Set(); 45564 for (const termValue of newTermValues) { 45565 const termId = getTermIdByTermValue(searchResults, termValue); 45566 if (termId) { 45567 newTermIds.add(termId); 45568 } 45569 } 45570 setSuggestions(taxonomy_controls_EMPTY_ARRAY); 45571 onChange(Array.from(newTermIds)); 45572 }; 45573 return (0,external_React_namespaceObject.createElement)("div", { 45574 className: "block-library-query-inspector__taxonomy-control" 45575 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, { 45576 label: taxonomy.name, 45577 value: value, 45578 onInputChange: debouncedSearch, 45579 suggestions: suggestions, 45580 displayTransform: external_wp_htmlEntities_namespaceObject.decodeEntities, 45581 onChange: onTermsChange, 45582 __experimentalShowHowTo: false 45583 })); 45584 } 45585 45586 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js 45587 45588 /** 45589 * WordPress dependencies 45590 */ 45591 45592 45593 const stickyOptions = [{ 45594 label: (0,external_wp_i18n_namespaceObject.__)('Include'), 45595 value: '' 45596 }, { 45597 label: (0,external_wp_i18n_namespaceObject.__)('Exclude'), 45598 value: 'exclude' 45599 }, { 45600 label: (0,external_wp_i18n_namespaceObject.__)('Only'), 45601 value: 'only' 45602 }]; 45603 function StickyControl({ 45604 value, 45605 onChange 45606 }) { 45607 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 45608 __nextHasNoMarginBottom: true, 45609 label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'), 45610 options: stickyOptions, 45611 value: value, 45612 onChange: onChange, 45613 help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.') 45614 }); 45615 } 45616 45617 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js 45618 45619 /** 45620 * WordPress dependencies 45621 */ 45622 45623 45624 45625 /** 45626 * Internal dependencies 45627 */ 45628 45629 function EnhancedPaginationControl({ 45630 enhancedPagination, 45631 setAttributes, 45632 clientId 45633 }) { 45634 const { 45635 hasUnsupportedBlocks 45636 } = useUnsupportedBlocks(clientId); 45637 let help = (0,external_wp_i18n_namespaceObject.__)('Browsing between pages requires a full page reload.'); 45638 if (enhancedPagination) { 45639 help = (0,external_wp_i18n_namespaceObject.__)("Browsing between pages won't require a full page reload, unless non-compatible blocks are detected."); 45640 } else if (hasUnsupportedBlocks) { 45641 help = (0,external_wp_i18n_namespaceObject.__)("Force page reload can't be disabled because there are non-compatible blocks inside the Query block."); 45642 } 45643 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 45644 label: (0,external_wp_i18n_namespaceObject.__)('Force page reload'), 45645 help: help, 45646 checked: !enhancedPagination, 45647 disabled: hasUnsupportedBlocks, 45648 onChange: value => { 45649 setAttributes({ 45650 enhancedPagination: !value 45651 }); 45652 } 45653 })); 45654 } 45655 45656 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/create-new-post-link.js 45657 45658 /** 45659 * WordPress dependencies 45660 */ 45661 45662 45663 45664 const CreateNewPostLink = ({ 45665 attributes: { 45666 query: { 45667 postType 45668 } = {} 45669 } = {} 45670 }) => { 45671 if (!postType) return null; 45672 const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', { 45673 post_type: postType 45674 }); 45675 return (0,external_React_namespaceObject.createElement)("div", { 45676 className: "wp-block-query__create-new-link" 45677 }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Add new post</a>'), 45678 // eslint-disable-next-line jsx-a11y/anchor-has-content 45679 { 45680 a: (0,external_React_namespaceObject.createElement)("a", { 45681 href: newPostUrl 45682 }) 45683 })); 45684 }; 45685 /* harmony default export */ const create_new_post_link = (CreateNewPostLink); 45686 45687 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js 45688 45689 /** 45690 * WordPress dependencies 45691 */ 45692 45693 45694 45695 45696 45697 45698 /** 45699 * Internal dependencies 45700 */ 45701 45702 45703 45704 45705 45706 45707 45708 45709 45710 45711 const { 45712 BlockInfo 45713 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 45714 function QueryInspectorControls(props) { 45715 const { 45716 attributes, 45717 setQuery, 45718 setDisplayLayout, 45719 setAttributes, 45720 clientId 45721 } = props; 45722 const { 45723 query, 45724 displayLayout, 45725 enhancedPagination 45726 } = attributes; 45727 const { 45728 order, 45729 orderBy, 45730 author: authorIds, 45731 postType, 45732 sticky, 45733 inherit, 45734 taxQuery, 45735 parents 45736 } = query; 45737 const allowedControls = useAllowedControls(attributes); 45738 const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post'); 45739 const { 45740 postTypesTaxonomiesMap, 45741 postTypesSelectOptions 45742 } = usePostTypes(); 45743 const taxonomies = useTaxonomies(postType); 45744 const isPostTypeHierarchical = useIsPostTypeHierarchical(postType); 45745 (0,external_wp_element_namespaceObject.useEffect)(() => { 45746 setShowSticky(postType === 'post'); 45747 }, [postType]); 45748 const onPostTypeChange = newValue => { 45749 const updateQuery = { 45750 postType: newValue 45751 }; 45752 // We need to dynamically update the `taxQuery` property, 45753 // by removing any not supported taxonomy from the query. 45754 const supportedTaxonomies = postTypesTaxonomiesMap[newValue]; 45755 const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, [taxonomySlug, terms]) => { 45756 if (supportedTaxonomies.includes(taxonomySlug)) { 45757 accumulator[taxonomySlug] = terms; 45758 } 45759 return accumulator; 45760 }, {}); 45761 updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined; 45762 if (newValue !== 'post') { 45763 updateQuery.sticky = ''; 45764 } 45765 // We need to reset `parents` because they are tied to each post type. 45766 updateQuery.parents = []; 45767 setQuery(updateQuery); 45768 }; 45769 const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search); 45770 const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_wp_compose_namespaceObject.debounce)(() => { 45771 if (query.search !== querySearch) { 45772 setQuery({ 45773 search: querySearch 45774 }); 45775 } 45776 }, 250), [querySearch, query.search]); 45777 (0,external_wp_element_namespaceObject.useEffect)(() => { 45778 onChangeDebounced(); 45779 return onChangeDebounced.cancel; 45780 }, [querySearch, onChangeDebounced]); 45781 const showInheritControl = isControlAllowed(allowedControls, 'inherit'); 45782 const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType'); 45783 const showColumnsControl = false; 45784 const showOrderControl = !inherit && isControlAllowed(allowedControls, 'order'); 45785 const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, 'sticky'); 45786 const showSettingsPanel = showInheritControl || showPostTypeControl || showColumnsControl || showOrderControl || showStickyControl; 45787 const showTaxControl = !!taxonomies?.length && isControlAllowed(allowedControls, 'taxQuery'); 45788 const showAuthorControl = isControlAllowed(allowedControls, 'author'); 45789 const showSearchControl = isControlAllowed(allowedControls, 'search'); 45790 const showParentControl = isControlAllowed(allowedControls, 'parents') && isPostTypeHierarchical; 45791 const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl; 45792 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(BlockInfo, null, (0,external_React_namespaceObject.createElement)(create_new_post_link, { 45793 ...props 45794 })), showSettingsPanel && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 45795 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 45796 }, showInheritControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 45797 __nextHasNoMarginBottom: true, 45798 label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'), 45799 help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'), 45800 checked: !!inherit, 45801 onChange: value => setQuery({ 45802 inherit: !!value 45803 }) 45804 }), showPostTypeControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 45805 __nextHasNoMarginBottom: true, 45806 options: postTypesSelectOptions, 45807 value: postType, 45808 label: (0,external_wp_i18n_namespaceObject.__)('Post type'), 45809 onChange: onPostTypeChange, 45810 help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.') 45811 }), showColumnsControl && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 45812 __nextHasNoMarginBottom: true, 45813 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 45814 value: displayLayout.columns, 45815 onChange: value => setDisplayLayout({ 45816 columns: value 45817 }), 45818 min: 2, 45819 max: Math.max(6, displayLayout.columns) 45820 }), displayLayout.columns > 6 && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, { 45821 status: "warning", 45822 isDismissible: false 45823 }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), showOrderControl && (0,external_React_namespaceObject.createElement)(order_control, { 45824 order, 45825 orderBy, 45826 onChange: setQuery 45827 }), showStickyControl && (0,external_React_namespaceObject.createElement)(StickyControl, { 45828 value: sticky, 45829 onChange: value => setQuery({ 45830 sticky: value 45831 }) 45832 }), (0,external_React_namespaceObject.createElement)(EnhancedPaginationControl, { 45833 enhancedPagination: enhancedPagination, 45834 setAttributes: setAttributes, 45835 clientId: clientId 45836 })), !inherit && showFiltersPanel && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 45837 className: "block-library-query-toolspanel__filters", 45838 label: (0,external_wp_i18n_namespaceObject.__)('Filters'), 45839 resetAll: () => { 45840 setQuery({ 45841 author: '', 45842 parents: [], 45843 search: '', 45844 taxQuery: null 45845 }); 45846 setQuerySearch(''); 45847 }, 45848 dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS 45849 }, showTaxControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 45850 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomies'), 45851 hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length), 45852 onDeselect: () => setQuery({ 45853 taxQuery: null 45854 }) 45855 }, (0,external_React_namespaceObject.createElement)(TaxonomyControls, { 45856 onChange: setQuery, 45857 query: query 45858 })), showAuthorControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 45859 hasValue: () => !!authorIds, 45860 label: (0,external_wp_i18n_namespaceObject.__)('Authors'), 45861 onDeselect: () => setQuery({ 45862 author: '' 45863 }) 45864 }, (0,external_React_namespaceObject.createElement)(author_control, { 45865 value: authorIds, 45866 onChange: setQuery 45867 })), showSearchControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 45868 hasValue: () => !!querySearch, 45869 label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), 45870 onDeselect: () => setQuerySearch('') 45871 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 45872 __nextHasNoMarginBottom: true, 45873 label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), 45874 value: querySearch, 45875 onChange: setQuerySearch 45876 })), showParentControl && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 45877 hasValue: () => !!parents?.length, 45878 label: (0,external_wp_i18n_namespaceObject.__)('Parents'), 45879 onDeselect: () => setQuery({ 45880 parents: [] 45881 }) 45882 }, (0,external_React_namespaceObject.createElement)(parent_control, { 45883 parents: parents, 45884 postType: postType, 45885 onChange: setQuery 45886 })))); 45887 } 45888 45889 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/enhanced-pagination-modal.js 45890 45891 /** 45892 * WordPress dependencies 45893 */ 45894 45895 45896 45897 45898 /** 45899 * Internal dependencies 45900 */ 45901 45902 const modalDescriptionId = 'wp-block-query-enhanced-pagination-modal__description'; 45903 function EnhancedPaginationModal({ 45904 clientId, 45905 attributes: { 45906 enhancedPagination 45907 }, 45908 setAttributes 45909 }) { 45910 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 45911 const { 45912 hasBlocksFromPlugins, 45913 hasPostContentBlock, 45914 hasUnsupportedBlocks 45915 } = useUnsupportedBlocks(clientId); 45916 (0,external_wp_element_namespaceObject.useEffect)(() => { 45917 if (enhancedPagination && hasUnsupportedBlocks) { 45918 setAttributes({ 45919 enhancedPagination: false 45920 }); 45921 setOpen(true); 45922 } 45923 }, [enhancedPagination, hasUnsupportedBlocks, setAttributes]); 45924 const closeModal = () => { 45925 setOpen(false); 45926 }; 45927 let notice = (0,external_wp_i18n_namespaceObject.__)('If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.'); 45928 if (hasBlocksFromPlugins) { 45929 notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when non-interactive or non-clientNavigation compatible blocks from plugins are present inside the Query block.') + ' ' + notice; 45930 } else if (hasPostContentBlock) { 45931 notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.') + ' ' + notice; 45932 } 45933 return isOpen && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 45934 title: (0,external_wp_i18n_namespaceObject.__)('Query block: Force page reload enabled'), 45935 className: "wp-block-query__enhanced-pagination-modal", 45936 aria: { 45937 describedby: modalDescriptionId 45938 }, 45939 role: "alertdialog", 45940 focusOnMount: "firstElement", 45941 isDismissible: false, 45942 onRequestClose: closeModal 45943 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { 45944 alignment: "right", 45945 spacing: 5 45946 }, (0,external_React_namespaceObject.createElement)("span", { 45947 id: modalDescriptionId 45948 }, notice), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 45949 variant: "primary", 45950 onClick: closeModal 45951 }, (0,external_wp_i18n_namespaceObject.__)('OK')))); 45952 } 45953 45954 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-content.js 45955 45956 /** 45957 * WordPress dependencies 45958 */ 45959 45960 45961 45962 45963 45964 45965 45966 45967 /** 45968 * Internal dependencies 45969 */ 45970 45971 45972 45973 const DEFAULTS_POSTS_PER_PAGE = 3; 45974 const query_content_TEMPLATE = [['core/post-template']]; 45975 function QueryContent({ 45976 attributes, 45977 setAttributes, 45978 openPatternSelectionModal, 45979 name, 45980 clientId 45981 }) { 45982 const { 45983 queryId, 45984 query, 45985 displayLayout, 45986 tagName: TagName = 'div', 45987 query: { 45988 inherit 45989 } = {} 45990 } = attributes; 45991 const { 45992 __unstableMarkNextChangeAsNotPersistent 45993 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 45994 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent); 45995 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 45996 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 45997 template: query_content_TEMPLATE 45998 }); 45999 const { 46000 postsPerPage 46001 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 46002 const { 46003 getSettings 46004 } = select(external_wp_blockEditor_namespaceObject.store); 46005 const { 46006 getEntityRecord, 46007 canUser 46008 } = select(external_wp_coreData_namespaceObject.store); 46009 const settingPerPage = canUser('read', 'settings') ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage; 46010 return { 46011 postsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE 46012 }; 46013 }, []); 46014 // There are some effects running where some initialization logic is 46015 // happening and setting some values to some attributes (ex. queryId). 46016 // These updates can cause an `undo trap` where undoing will result in 46017 // resetting again, so we need to mark these changes as not persistent 46018 // with `__unstableMarkNextChangeAsNotPersistent`. 46019 46020 // Changes in query property (which is an object) need to be in the same callback, 46021 // because updates are batched after the render and changes in different query properties 46022 // would cause to override previous wanted changes. 46023 (0,external_wp_element_namespaceObject.useEffect)(() => { 46024 const newQuery = {}; 46025 // When we inherit from global query always need to set the `perPage` 46026 // based on the reading settings. 46027 if (inherit && query.perPage !== postsPerPage) { 46028 newQuery.perPage = postsPerPage; 46029 } else if (!query.perPage && postsPerPage) { 46030 newQuery.perPage = postsPerPage; 46031 } 46032 if (!!Object.keys(newQuery).length) { 46033 __unstableMarkNextChangeAsNotPersistent(); 46034 updateQuery(newQuery); 46035 } 46036 }, [query.perPage, postsPerPage, inherit]); 46037 // We need this for multi-query block pagination. 46038 // Query parameters for each block are scoped to their ID. 46039 (0,external_wp_element_namespaceObject.useEffect)(() => { 46040 if (!Number.isFinite(queryId)) { 46041 __unstableMarkNextChangeAsNotPersistent(); 46042 setAttributes({ 46043 queryId: instanceId 46044 }); 46045 } 46046 }, [queryId, instanceId]); 46047 const updateQuery = newQuery => setAttributes({ 46048 query: { 46049 ...query, 46050 ...newQuery 46051 } 46052 }); 46053 const updateDisplayLayout = newDisplayLayout => setAttributes({ 46054 displayLayout: { 46055 ...displayLayout, 46056 ...newDisplayLayout 46057 } 46058 }); 46059 const htmlElementMessages = { 46060 main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '), 46061 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."), 46062 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.") 46063 }; 46064 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(EnhancedPaginationModal, { 46065 attributes: attributes, 46066 setAttributes: setAttributes, 46067 clientId: clientId 46068 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(QueryInspectorControls, { 46069 attributes: attributes, 46070 setQuery: updateQuery, 46071 setDisplayLayout: updateDisplayLayout, 46072 setAttributes: setAttributes, 46073 clientId: clientId 46074 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(QueryToolbar, { 46075 name: name, 46076 clientId: clientId, 46077 attributes: attributes, 46078 setQuery: updateQuery, 46079 openPatternSelectionModal: openPatternSelectionModal 46080 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 46081 group: "advanced" 46082 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 46083 __nextHasNoMarginBottom: true, 46084 __next40pxDefaultSize: true, 46085 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 46086 options: [{ 46087 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 46088 value: 'div' 46089 }, { 46090 label: '<main>', 46091 value: 'main' 46092 }, { 46093 label: '<section>', 46094 value: 'section' 46095 }, { 46096 label: '<aside>', 46097 value: 'aside' 46098 }], 46099 value: TagName, 46100 onChange: value => setAttributes({ 46101 tagName: value 46102 }), 46103 help: htmlElementMessages[TagName] 46104 })), (0,external_React_namespaceObject.createElement)(TagName, { 46105 ...innerBlocksProps 46106 })); 46107 } 46108 46109 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js 46110 46111 /** 46112 * WordPress dependencies 46113 */ 46114 46115 46116 46117 46118 46119 46120 46121 /** 46122 * Internal dependencies 46123 */ 46124 46125 function QueryPlaceholder({ 46126 attributes, 46127 clientId, 46128 name, 46129 openPatternSelectionModal, 46130 setAttributes 46131 }) { 46132 const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false); 46133 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 46134 const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes); 46135 const { 46136 blockType, 46137 activeBlockVariation, 46138 hasPatterns 46139 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 46140 const { 46141 getActiveBlockVariation, 46142 getBlockType 46143 } = select(external_wp_blocks_namespaceObject.store); 46144 const { 46145 getBlockRootClientId, 46146 getPatternsByBlockTypes 46147 } = select(external_wp_blockEditor_namespaceObject.store); 46148 const rootClientId = getBlockRootClientId(clientId); 46149 return { 46150 blockType: getBlockType(name), 46151 activeBlockVariation: getActiveBlockVariation(name, attributes), 46152 hasPatterns: !!getPatternsByBlockTypes(blockNameForPatterns, rootClientId).length 46153 }; 46154 }, [name, blockNameForPatterns, clientId, attributes]); 46155 const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src; 46156 const label = activeBlockVariation?.title || blockType?.title; 46157 if (isStartingBlank) { 46158 return (0,external_React_namespaceObject.createElement)(QueryVariationPicker, { 46159 clientId: clientId, 46160 attributes: attributes, 46161 setAttributes: setAttributes, 46162 icon: icon, 46163 label: label 46164 }); 46165 } 46166 return (0,external_React_namespaceObject.createElement)("div", { 46167 ...blockProps 46168 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 46169 icon: icon, 46170 label: label, 46171 instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.') 46172 }, !!hasPatterns && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 46173 variant: "primary", 46174 onClick: openPatternSelectionModal 46175 }, (0,external_wp_i18n_namespaceObject.__)('Choose')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 46176 variant: "secondary", 46177 onClick: () => { 46178 setIsStartingBlank(true); 46179 } 46180 }, (0,external_wp_i18n_namespaceObject.__)('Start blank')))); 46181 } 46182 function QueryVariationPicker({ 46183 clientId, 46184 attributes, 46185 setAttributes, 46186 icon, 46187 label 46188 }) { 46189 const scopeVariations = useScopedBlockVariations(attributes); 46190 const { 46191 replaceInnerBlocks 46192 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 46193 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 46194 return (0,external_React_namespaceObject.createElement)("div", { 46195 ...blockProps 46196 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { 46197 icon: icon, 46198 label: label, 46199 variations: scopeVariations, 46200 onSelect: variation => { 46201 if (variation.attributes) { 46202 setAttributes({ 46203 ...variation.attributes, 46204 query: { 46205 ...variation.attributes.query, 46206 postType: attributes.query.postType || variation.attributes.query.postType 46207 }, 46208 namespace: attributes.namespace 46209 }); 46210 } 46211 if (variation.innerBlocks) { 46212 replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false); 46213 } 46214 } 46215 })); 46216 } 46217 46218 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/search-patterns.js 46219 /** 46220 * External dependencies 46221 */ 46222 46223 46224 /** 46225 * Sanitizes the search input string. 46226 * 46227 * @param {string} input The search input to normalize. 46228 * 46229 * @return {string} The normalized search input. 46230 */ 46231 function normalizeSearchInput(input = '') { 46232 // Disregard diacritics. 46233 input = remove_accents_default()(input); 46234 46235 // Trim & Lowercase. 46236 input = input.trim().toLowerCase(); 46237 return input; 46238 } 46239 46240 /** 46241 * Get the search rank for a given pattern and a specific search term. 46242 * 46243 * @param {Object} pattern Pattern to rank 46244 * @param {string} searchValue Search term 46245 * @return {number} A pattern search rank 46246 */ 46247 function getPatternSearchRank(pattern, searchValue) { 46248 const normalizedSearchValue = normalizeSearchInput(searchValue); 46249 const normalizedTitle = normalizeSearchInput(pattern.title); 46250 let rank = 0; 46251 if (normalizedSearchValue === normalizedTitle) { 46252 rank += 30; 46253 } else if (normalizedTitle.startsWith(normalizedSearchValue)) { 46254 rank += 20; 46255 } else { 46256 const searchTerms = normalizedSearchValue.split(' '); 46257 const hasMatchedTerms = searchTerms.every(searchTerm => normalizedTitle.includes(searchTerm)); 46258 46259 // Prefer pattern with every search word in the title. 46260 if (hasMatchedTerms) { 46261 rank += 10; 46262 } 46263 } 46264 return rank; 46265 } 46266 46267 /** 46268 * Filters an pattern list given a search term. 46269 * 46270 * @param {Array} patterns Item list 46271 * @param {string} searchValue Search input. 46272 * 46273 * @return {Array} Filtered pattern list. 46274 */ 46275 function searchPatterns(patterns = [], searchValue = '') { 46276 if (!searchValue) { 46277 return patterns; 46278 } 46279 const rankedPatterns = patterns.map(pattern => { 46280 return [pattern, getPatternSearchRank(pattern, searchValue)]; 46281 }).filter(([, rank]) => rank > 0); 46282 rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1); 46283 return rankedPatterns.map(([pattern]) => pattern); 46284 } 46285 46286 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/pattern-selection-modal.js 46287 46288 /** 46289 * WordPress dependencies 46290 */ 46291 46292 46293 46294 46295 46296 46297 46298 /** 46299 * Internal dependencies 46300 */ 46301 46302 46303 function PatternSelectionModal({ 46304 clientId, 46305 attributes, 46306 setIsPatternSelectionModalOpen 46307 }) { 46308 const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); 46309 const { 46310 replaceBlock, 46311 selectBlock 46312 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 46313 const onBlockPatternSelect = (pattern, blocks) => { 46314 const { 46315 newBlocks, 46316 queryClientIds 46317 } = getTransformedBlocksFromPattern(blocks, attributes); 46318 replaceBlock(clientId, newBlocks); 46319 if (queryClientIds[0]) { 46320 selectBlock(queryClientIds[0]); 46321 } 46322 }; 46323 // When we preview Query Loop blocks we should prefer the current 46324 // block's postType, which is passed through block context. 46325 const blockPreviewContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 46326 previewPostType: attributes.query.postType 46327 }), [attributes.query.postType]); 46328 const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes); 46329 const blockPatterns = usePatterns(clientId, blockNameForPatterns); 46330 const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { 46331 return searchPatterns(blockPatterns, searchValue); 46332 }, [blockPatterns, searchValue]); 46333 const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockPatterns); 46334 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 46335 overlayClassName: "block-library-query-pattern__selection-modal", 46336 title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), 46337 onRequestClose: () => setIsPatternSelectionModalOpen(false), 46338 isFullScreen: true 46339 }, (0,external_React_namespaceObject.createElement)("div", { 46340 className: "block-library-query-pattern__selection-content" 46341 }, (0,external_React_namespaceObject.createElement)("div", { 46342 className: "block-library-query-pattern__selection-search" 46343 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, { 46344 __nextHasNoMarginBottom: true, 46345 onChange: setSearchValue, 46346 value: searchValue, 46347 label: (0,external_wp_i18n_namespaceObject.__)('Search for patterns'), 46348 placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') 46349 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 46350 value: blockPreviewContext 46351 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 46352 blockPatterns: filteredBlockPatterns, 46353 shownPatterns: shownBlockPatterns, 46354 onClickPattern: onBlockPatternSelect 46355 })))); 46356 } 46357 46358 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js 46359 46360 /** 46361 * WordPress dependencies 46362 */ 46363 46364 46365 46366 46367 /** 46368 * Internal dependencies 46369 */ 46370 46371 46372 46373 const QueryEdit = props => { 46374 const { 46375 clientId, 46376 attributes 46377 } = props; 46378 const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); 46379 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]); 46380 const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder; 46381 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(Component, { 46382 ...props, 46383 openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true) 46384 }), isPatternSelectionModalOpen && (0,external_React_namespaceObject.createElement)(PatternSelectionModal, { 46385 clientId: clientId, 46386 attributes: attributes, 46387 setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen 46388 })); 46389 }; 46390 /* harmony default export */ const query_edit = (QueryEdit); 46391 46392 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js 46393 46394 /** 46395 * WordPress dependencies 46396 */ 46397 46398 function QuerySave({ 46399 attributes: { 46400 tagName: Tag = 'div' 46401 } 46402 }) { 46403 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 46404 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 46405 return (0,external_React_namespaceObject.createElement)(Tag, { 46406 ...innerBlocksProps 46407 }); 46408 } 46409 46410 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js 46411 46412 /** 46413 * WordPress dependencies 46414 */ 46415 46416 const titleDate = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 46417 xmlns: "http://www.w3.org/2000/svg", 46418 viewBox: "0 0 48 48" 46419 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 46420 d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z" 46421 })); 46422 const titleExcerpt = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 46423 xmlns: "http://www.w3.org/2000/svg", 46424 viewBox: "0 0 48 48" 46425 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 46426 d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z" 46427 })); 46428 const titleDateExcerpt = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 46429 xmlns: "http://www.w3.org/2000/svg", 46430 viewBox: "0 0 48 48" 46431 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 46432 d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z" 46433 })); 46434 const imageDateTitle = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 46435 xmlns: "http://www.w3.org/2000/svg", 46436 viewBox: "0 0 48 48" 46437 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 46438 d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z" 46439 })); 46440 46441 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js 46442 /** 46443 * WordPress dependencies 46444 */ 46445 46446 46447 46448 /** 46449 * Internal dependencies 46450 */ 46451 46452 const QUERY_DEFAULT_ATTRIBUTES = { 46453 query: { 46454 perPage: 3, 46455 pages: 0, 46456 offset: 0, 46457 postType: 'post', 46458 order: 'desc', 46459 orderBy: 'date', 46460 author: '', 46461 search: '', 46462 exclude: [], 46463 sticky: '', 46464 inherit: false 46465 } 46466 }; 46467 const query_variations_variations = [{ 46468 name: 'posts-list', 46469 title: (0,external_wp_i18n_namespaceObject.__)('Posts List'), 46470 description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'), 46471 icon: post_list, 46472 attributes: { 46473 namespace: 'core/posts-list', 46474 query: { 46475 perPage: 4, 46476 pages: 1, 46477 offset: 0, 46478 postType: 'post', 46479 order: 'desc', 46480 orderBy: 'date', 46481 author: '', 46482 search: '', 46483 sticky: 'exclude', 46484 inherit: false 46485 } 46486 }, 46487 scope: ['inserter'], 46488 isActive: ({ 46489 namespace, 46490 query 46491 }) => { 46492 return namespace === 'core/posts-list' && query.postType === 'post'; 46493 } 46494 }, { 46495 name: 'title-date', 46496 title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'), 46497 icon: titleDate, 46498 attributes: { 46499 ...QUERY_DEFAULT_ATTRIBUTES 46500 }, 46501 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']], 46502 scope: ['block'] 46503 }, { 46504 name: 'title-excerpt', 46505 title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'), 46506 icon: titleExcerpt, 46507 attributes: { 46508 ...QUERY_DEFAULT_ATTRIBUTES 46509 }, 46510 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], 46511 scope: ['block'] 46512 }, { 46513 name: 'title-date-excerpt', 46514 title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'), 46515 icon: titleDateExcerpt, 46516 attributes: { 46517 ...QUERY_DEFAULT_ATTRIBUTES 46518 }, 46519 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], 46520 scope: ['block'] 46521 }, { 46522 name: 'image-date-title', 46523 title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'), 46524 icon: imageDateTitle, 46525 attributes: { 46526 ...QUERY_DEFAULT_ATTRIBUTES 46527 }, 46528 innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']], 46529 scope: ['block'] 46530 }]; 46531 /* harmony default export */ const query_variations = (query_variations_variations); 46532 46533 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js 46534 46535 /** 46536 * WordPress dependencies 46537 */ 46538 46539 46540 46541 /** 46542 * Internal dependencies 46543 */ 46544 46545 const { 46546 cleanEmptyObject: deprecated_cleanEmptyObject 46547 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 46548 const migrateToTaxQuery = attributes => { 46549 const { 46550 query 46551 } = attributes; 46552 const { 46553 categoryIds, 46554 tagIds, 46555 ...newQuery 46556 } = query; 46557 if (query.categoryIds?.length || query.tagIds?.length) { 46558 newQuery.taxQuery = { 46559 category: !!query.categoryIds?.length ? query.categoryIds : undefined, 46560 post_tag: !!query.tagIds?.length ? query.tagIds : undefined 46561 }; 46562 } 46563 return { 46564 ...attributes, 46565 query: newQuery 46566 }; 46567 }; 46568 const migrateColors = (attributes, innerBlocks) => { 46569 // Remove color style attributes from the Query block. 46570 const { 46571 style, 46572 backgroundColor, 46573 gradient, 46574 textColor, 46575 ...newAttributes 46576 } = attributes; 46577 const hasColorStyles = backgroundColor || gradient || textColor || style?.color || style?.elements?.link; 46578 46579 // If the query block doesn't currently have any color styles, 46580 // nothing needs migrating. 46581 if (!hasColorStyles) { 46582 return [attributes, innerBlocks]; 46583 } 46584 46585 // Clean color values from style attribute object. 46586 if (style) { 46587 newAttributes.style = deprecated_cleanEmptyObject({ 46588 ...style, 46589 color: undefined, 46590 elements: { 46591 ...style.elements, 46592 link: undefined 46593 } 46594 }); 46595 } 46596 46597 // If the inner blocks are already wrapped in a single group 46598 // block, add the color support styles to that group block. 46599 if (hasSingleInnerGroupBlock(innerBlocks)) { 46600 const groupBlock = innerBlocks[0]; 46601 46602 // Create new styles for the group block. 46603 const hasStyles = style?.color || style?.elements?.link || groupBlock.attributes.style; 46604 const newStyles = hasStyles ? deprecated_cleanEmptyObject({ 46605 ...groupBlock.attributes.style, 46606 color: style?.color, 46607 elements: style?.elements?.link ? { 46608 link: style?.elements?.link 46609 } : undefined 46610 }) : undefined; 46611 46612 // Create a new Group block from the original. 46613 const updatedGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 46614 ...groupBlock.attributes, 46615 backgroundColor, 46616 gradient, 46617 textColor, 46618 style: newStyles 46619 }, groupBlock.innerBlocks); 46620 return [newAttributes, [updatedGroupBlock]]; 46621 } 46622 46623 // When we don't have a single wrapping group block for the inner 46624 // blocks, wrap the current inner blocks in a group applying the 46625 // color styles to that. 46626 const newGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 46627 backgroundColor, 46628 gradient, 46629 textColor, 46630 style: deprecated_cleanEmptyObject({ 46631 color: style?.color, 46632 elements: style?.elements?.link ? { 46633 link: style?.elements?.link 46634 } : undefined 46635 }) 46636 }, innerBlocks); 46637 return [newAttributes, [newGroupBlock]]; 46638 }; 46639 const hasSingleInnerGroupBlock = (innerBlocks = []) => innerBlocks.length === 1 && innerBlocks[0].name === 'core/group'; 46640 const migrateToConstrainedLayout = attributes => { 46641 const { 46642 layout = null 46643 } = attributes; 46644 if (!layout) { 46645 return attributes; 46646 } 46647 const { 46648 inherit = null, 46649 contentSize = null, 46650 ...newLayout 46651 } = layout; 46652 if (inherit || contentSize) { 46653 return { 46654 ...attributes, 46655 layout: { 46656 ...newLayout, 46657 contentSize, 46658 type: 'constrained' 46659 } 46660 }; 46661 } 46662 return attributes; 46663 }; 46664 const findPostTemplateBlock = (innerBlocks = []) => { 46665 let foundBlock = null; 46666 for (const block of innerBlocks) { 46667 if (block.name === 'core/post-template') { 46668 foundBlock = block; 46669 break; 46670 } else if (block.innerBlocks.length) { 46671 foundBlock = findPostTemplateBlock(block.innerBlocks); 46672 } 46673 } 46674 return foundBlock; 46675 }; 46676 const replacePostTemplateBlock = (innerBlocks = [], replacementBlock) => { 46677 innerBlocks.forEach((block, index) => { 46678 if (block.name === 'core/post-template') { 46679 innerBlocks.splice(index, 1, replacementBlock); 46680 } else if (block.innerBlocks.length) { 46681 block.innerBlocks = replacePostTemplateBlock(block.innerBlocks, replacementBlock); 46682 } 46683 }); 46684 return innerBlocks; 46685 }; 46686 const migrateDisplayLayout = (attributes, innerBlocks) => { 46687 const { 46688 displayLayout = null, 46689 ...newAttributes 46690 } = attributes; 46691 if (!displayLayout) { 46692 return [attributes, innerBlocks]; 46693 } 46694 const postTemplateBlock = findPostTemplateBlock(innerBlocks); 46695 if (!postTemplateBlock) { 46696 return [attributes, innerBlocks]; 46697 } 46698 const { 46699 type, 46700 columns 46701 } = displayLayout; 46702 46703 // Convert custom displayLayout values to canonical layout types. 46704 const updatedLayoutType = type === 'flex' ? 'grid' : 'default'; 46705 const newPostTemplateBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/post-template', { 46706 ...postTemplateBlock.attributes, 46707 layout: { 46708 type: updatedLayoutType, 46709 ...(columns && { 46710 columnCount: columns 46711 }) 46712 } 46713 }, postTemplateBlock.innerBlocks); 46714 return [newAttributes, replacePostTemplateBlock(innerBlocks, newPostTemplateBlock)]; 46715 }; 46716 46717 // Version with NO wrapper `div` element. 46718 const query_deprecated_v1 = { 46719 attributes: { 46720 queryId: { 46721 type: 'number' 46722 }, 46723 query: { 46724 type: 'object', 46725 default: { 46726 perPage: null, 46727 pages: 0, 46728 offset: 0, 46729 postType: 'post', 46730 categoryIds: [], 46731 tagIds: [], 46732 order: 'desc', 46733 orderBy: 'date', 46734 author: '', 46735 search: '', 46736 exclude: [], 46737 sticky: '', 46738 inherit: true 46739 } 46740 }, 46741 layout: { 46742 type: 'object', 46743 default: { 46744 type: 'list' 46745 } 46746 } 46747 }, 46748 supports: { 46749 html: false 46750 }, 46751 migrate(attributes, innerBlocks) { 46752 const withTaxQuery = migrateToTaxQuery(attributes); 46753 const { 46754 layout, 46755 ...restWithTaxQuery 46756 } = withTaxQuery; 46757 const newAttributes = { 46758 ...restWithTaxQuery, 46759 displayLayout: withTaxQuery.layout 46760 }; 46761 return migrateDisplayLayout(newAttributes, innerBlocks); 46762 }, 46763 save() { 46764 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 46765 } 46766 }; 46767 46768 // Version with `categoryIds and tagIds`. 46769 const query_deprecated_v2 = { 46770 attributes: { 46771 queryId: { 46772 type: 'number' 46773 }, 46774 query: { 46775 type: 'object', 46776 default: { 46777 perPage: null, 46778 pages: 0, 46779 offset: 0, 46780 postType: 'post', 46781 categoryIds: [], 46782 tagIds: [], 46783 order: 'desc', 46784 orderBy: 'date', 46785 author: '', 46786 search: '', 46787 exclude: [], 46788 sticky: '', 46789 inherit: true 46790 } 46791 }, 46792 tagName: { 46793 type: 'string', 46794 default: 'div' 46795 }, 46796 displayLayout: { 46797 type: 'object', 46798 default: { 46799 type: 'list' 46800 } 46801 } 46802 }, 46803 supports: { 46804 align: ['wide', 'full'], 46805 html: false, 46806 color: { 46807 gradients: true, 46808 link: true 46809 }, 46810 layout: true 46811 }, 46812 isEligible: ({ 46813 query: { 46814 categoryIds, 46815 tagIds 46816 } = {} 46817 }) => categoryIds || tagIds, 46818 migrate(attributes, innerBlocks) { 46819 const withTaxQuery = migrateToTaxQuery(attributes); 46820 const [withColorAttributes, withColorInnerBlocks] = migrateColors(withTaxQuery, innerBlocks); 46821 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 46822 return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); 46823 }, 46824 save({ 46825 attributes: { 46826 tagName: Tag = 'div' 46827 } 46828 }) { 46829 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 46830 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 46831 return (0,external_React_namespaceObject.createElement)(Tag, { 46832 ...innerBlocksProps 46833 }); 46834 } 46835 }; 46836 46837 // Version with color support prior to moving it to the PostTemplate block. 46838 const query_deprecated_v3 = { 46839 attributes: { 46840 queryId: { 46841 type: 'number' 46842 }, 46843 query: { 46844 type: 'object', 46845 default: { 46846 perPage: null, 46847 pages: 0, 46848 offset: 0, 46849 postType: 'post', 46850 order: 'desc', 46851 orderBy: 'date', 46852 author: '', 46853 search: '', 46854 exclude: [], 46855 sticky: '', 46856 inherit: true, 46857 taxQuery: null, 46858 parents: [] 46859 } 46860 }, 46861 tagName: { 46862 type: 'string', 46863 default: 'div' 46864 }, 46865 displayLayout: { 46866 type: 'object', 46867 default: { 46868 type: 'list' 46869 } 46870 }, 46871 namespace: { 46872 type: 'string' 46873 } 46874 }, 46875 supports: { 46876 align: ['wide', 'full'], 46877 html: false, 46878 color: { 46879 gradients: true, 46880 link: true, 46881 __experimentalDefaultControls: { 46882 background: true, 46883 text: true 46884 } 46885 }, 46886 layout: true 46887 }, 46888 isEligible(attributes) { 46889 const { 46890 style, 46891 backgroundColor, 46892 gradient, 46893 textColor 46894 } = attributes; 46895 return backgroundColor || gradient || textColor || style?.color || style?.elements?.link; 46896 }, 46897 migrate(attributes, innerBlocks) { 46898 const [withColorAttributes, withColorInnerBlocks] = migrateColors(attributes, innerBlocks); 46899 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 46900 return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); 46901 }, 46902 save({ 46903 attributes: { 46904 tagName: Tag = 'div' 46905 } 46906 }) { 46907 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 46908 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 46909 return (0,external_React_namespaceObject.createElement)(Tag, { 46910 ...innerBlocksProps 46911 }); 46912 } 46913 }; 46914 const query_deprecated_v4 = { 46915 attributes: { 46916 queryId: { 46917 type: 'number' 46918 }, 46919 query: { 46920 type: 'object', 46921 default: { 46922 perPage: null, 46923 pages: 0, 46924 offset: 0, 46925 postType: 'post', 46926 order: 'desc', 46927 orderBy: 'date', 46928 author: '', 46929 search: '', 46930 exclude: [], 46931 sticky: '', 46932 inherit: true, 46933 taxQuery: null, 46934 parents: [] 46935 } 46936 }, 46937 tagName: { 46938 type: 'string', 46939 default: 'div' 46940 }, 46941 displayLayout: { 46942 type: 'object', 46943 default: { 46944 type: 'list' 46945 } 46946 }, 46947 namespace: { 46948 type: 'string' 46949 } 46950 }, 46951 supports: { 46952 align: ['wide', 'full'], 46953 html: false, 46954 color: { 46955 gradients: true, 46956 link: true, 46957 __experimentalDefaultControls: { 46958 background: true, 46959 text: true 46960 } 46961 }, 46962 layout: true 46963 }, 46964 save({ 46965 attributes: { 46966 tagName: Tag = 'div' 46967 } 46968 }) { 46969 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 46970 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 46971 return (0,external_React_namespaceObject.createElement)(Tag, { 46972 ...innerBlocksProps 46973 }); 46974 }, 46975 isEligible: ({ 46976 layout 46977 }) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained', 46978 migrate(attributes, innerBlocks) { 46979 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(attributes); 46980 return migrateDisplayLayout(withConstrainedLayoutAttributes, innerBlocks); 46981 } 46982 }; 46983 const query_deprecated_v5 = { 46984 attributes: { 46985 queryId: { 46986 type: 'number' 46987 }, 46988 query: { 46989 type: 'object', 46990 default: { 46991 perPage: null, 46992 pages: 0, 46993 offset: 0, 46994 postType: 'post', 46995 order: 'desc', 46996 orderBy: 'date', 46997 author: '', 46998 search: '', 46999 exclude: [], 47000 sticky: '', 47001 inherit: true, 47002 taxQuery: null, 47003 parents: [] 47004 } 47005 }, 47006 tagName: { 47007 type: 'string', 47008 default: 'div' 47009 }, 47010 displayLayout: { 47011 type: 'object', 47012 default: { 47013 type: 'list' 47014 } 47015 }, 47016 namespace: { 47017 type: 'string' 47018 } 47019 }, 47020 supports: { 47021 align: ['wide', 'full'], 47022 anchor: true, 47023 html: false, 47024 layout: true 47025 }, 47026 save({ 47027 attributes: { 47028 tagName: Tag = 'div' 47029 } 47030 }) { 47031 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 47032 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 47033 return (0,external_React_namespaceObject.createElement)(Tag, { 47034 ...innerBlocksProps 47035 }); 47036 }, 47037 isEligible: ({ 47038 displayLayout 47039 }) => { 47040 return !!displayLayout; 47041 }, 47042 migrate: migrateDisplayLayout 47043 }; 47044 const query_deprecated_deprecated = [query_deprecated_v5, query_deprecated_v4, query_deprecated_v3, query_deprecated_v2, query_deprecated_v1]; 47045 /* harmony default export */ const query_deprecated = (query_deprecated_deprecated); 47046 47047 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js 47048 /** 47049 * WordPress dependencies 47050 */ 47051 47052 47053 /** 47054 * Internal dependencies 47055 */ 47056 47057 const query_metadata = { 47058 $schema: "https://schemas.wp.org/trunk/block.json", 47059 apiVersion: 3, 47060 name: "core/query", 47061 title: "Query Loop", 47062 category: "theme", 47063 description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.", 47064 textdomain: "default", 47065 attributes: { 47066 queryId: { 47067 type: "number" 47068 }, 47069 query: { 47070 type: "object", 47071 "default": { 47072 perPage: null, 47073 pages: 0, 47074 offset: 0, 47075 postType: "post", 47076 order: "desc", 47077 orderBy: "date", 47078 author: "", 47079 search: "", 47080 exclude: [], 47081 sticky: "", 47082 inherit: true, 47083 taxQuery: null, 47084 parents: [] 47085 } 47086 }, 47087 tagName: { 47088 type: "string", 47089 "default": "div" 47090 }, 47091 namespace: { 47092 type: "string" 47093 }, 47094 enhancedPagination: { 47095 type: "boolean", 47096 "default": false 47097 } 47098 }, 47099 providesContext: { 47100 queryId: "queryId", 47101 query: "query", 47102 displayLayout: "displayLayout", 47103 enhancedPagination: "enhancedPagination" 47104 }, 47105 supports: { 47106 align: ["wide", "full"], 47107 html: false, 47108 layout: true, 47109 interactivity: true 47110 }, 47111 editorStyle: "wp-block-query-editor" 47112 }; 47113 47114 47115 47116 47117 const { 47118 name: query_name 47119 } = query_metadata; 47120 47121 const query_settings = { 47122 icon: library_loop, 47123 edit: query_edit, 47124 save: QuerySave, 47125 variations: query_variations, 47126 deprecated: query_deprecated 47127 }; 47128 const query_init = () => initBlock({ 47129 name: query_name, 47130 metadata: query_metadata, 47131 settings: query_settings 47132 }); 47133 47134 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js 47135 47136 /** 47137 * WordPress dependencies 47138 */ 47139 47140 47141 const query_no_results_edit_TEMPLATE = [['core/paragraph', { 47142 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when a query returns no results.') 47143 }]]; 47144 function QueryNoResultsEdit() { 47145 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 47146 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 47147 template: query_no_results_edit_TEMPLATE 47148 }); 47149 return (0,external_React_namespaceObject.createElement)("div", { 47150 ...innerBlocksProps 47151 }); 47152 } 47153 47154 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js 47155 47156 /** 47157 * WordPress dependencies 47158 */ 47159 47160 function QueryNoResultsSave() { 47161 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 47162 } 47163 47164 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js 47165 /** 47166 * WordPress dependencies 47167 */ 47168 47169 47170 /** 47171 * Internal dependencies 47172 */ 47173 47174 const query_no_results_metadata = { 47175 $schema: "https://schemas.wp.org/trunk/block.json", 47176 apiVersion: 3, 47177 name: "core/query-no-results", 47178 title: "No results", 47179 category: "theme", 47180 description: "Contains the block elements used to render content when no query results are found.", 47181 parent: ["core/query"], 47182 textdomain: "default", 47183 usesContext: ["queryId", "query"], 47184 supports: { 47185 align: true, 47186 reusable: false, 47187 html: false, 47188 color: { 47189 gradients: true, 47190 link: true 47191 }, 47192 typography: { 47193 fontSize: true, 47194 lineHeight: true, 47195 __experimentalFontFamily: true, 47196 __experimentalFontWeight: true, 47197 __experimentalFontStyle: true, 47198 __experimentalTextTransform: true, 47199 __experimentalTextDecoration: true, 47200 __experimentalLetterSpacing: true, 47201 __experimentalDefaultControls: { 47202 fontSize: true 47203 } 47204 }, 47205 interactivity: { 47206 clientNavigation: true 47207 } 47208 } 47209 }; 47210 47211 47212 const { 47213 name: query_no_results_name 47214 } = query_no_results_metadata; 47215 47216 const query_no_results_settings = { 47217 icon: library_loop, 47218 edit: QueryNoResultsEdit, 47219 save: QueryNoResultsSave 47220 }; 47221 const query_no_results_init = () => initBlock({ 47222 name: query_no_results_name, 47223 metadata: query_no_results_metadata, 47224 settings: query_no_results_settings 47225 }); 47226 47227 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js 47228 47229 /** 47230 * WordPress dependencies 47231 */ 47232 47233 47234 function QueryPaginationArrowControls({ 47235 value, 47236 onChange 47237 }) { 47238 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 47239 __nextHasNoMarginBottom: true, 47240 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 47241 value: value, 47242 onChange: onChange, 47243 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'), 47244 isBlock: true 47245 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 47246 value: "none", 47247 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks') 47248 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 47249 value: "arrow", 47250 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks') 47251 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 47252 value: "chevron", 47253 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks') 47254 })); 47255 } 47256 47257 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-label-control.js 47258 47259 /** 47260 * WordPress dependencies 47261 */ 47262 47263 47264 function QueryPaginationLabelControl({ 47265 value, 47266 onChange 47267 }) { 47268 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 47269 __nextHasNoMarginBottom: true, 47270 label: (0,external_wp_i18n_namespaceObject.__)('Show label text'), 47271 help: (0,external_wp_i18n_namespaceObject.__)('Toggle off to hide the label text, e.g. "Next Page".'), 47272 onChange: onChange, 47273 checked: value === true 47274 }); 47275 } 47276 47277 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js 47278 47279 /** 47280 * WordPress dependencies 47281 */ 47282 47283 47284 47285 47286 47287 47288 /** 47289 * Internal dependencies 47290 */ 47291 47292 47293 const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']]; 47294 function edit_QueryPaginationEdit({ 47295 attributes: { 47296 paginationArrow, 47297 showLabel 47298 }, 47299 setAttributes, 47300 clientId 47301 }) { 47302 const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { 47303 const { 47304 getBlocks 47305 } = select(external_wp_blockEditor_namespaceObject.store); 47306 const innerBlocks = getBlocks(clientId); 47307 /** 47308 * Show the `paginationArrow` and `showLabel` controls only if a 47309 * `QueryPaginationNext/Previous` block exists. 47310 */ 47311 return innerBlocks?.find(innerBlock => { 47312 return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name); 47313 }); 47314 }, [clientId]); 47315 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 47316 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 47317 template: query_pagination_edit_TEMPLATE 47318 }); 47319 // Always show label text if paginationArrow is set to 'none'. 47320 (0,external_wp_element_namespaceObject.useEffect)(() => { 47321 if (paginationArrow === 'none' && !showLabel) { 47322 setAttributes({ 47323 showLabel: true 47324 }); 47325 } 47326 }, [paginationArrow, setAttributes, showLabel]); 47327 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 47328 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 47329 }, (0,external_React_namespaceObject.createElement)(QueryPaginationArrowControls, { 47330 value: paginationArrow, 47331 onChange: value => { 47332 setAttributes({ 47333 paginationArrow: value 47334 }); 47335 } 47336 }), paginationArrow !== 'none' && (0,external_React_namespaceObject.createElement)(QueryPaginationLabelControl, { 47337 value: showLabel, 47338 onChange: value => { 47339 setAttributes({ 47340 showLabel: value 47341 }); 47342 } 47343 }))), (0,external_React_namespaceObject.createElement)("nav", { 47344 ...innerBlocksProps 47345 })); 47346 } 47347 47348 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js 47349 47350 /** 47351 * WordPress dependencies 47352 */ 47353 47354 function query_pagination_save_save() { 47355 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null); 47356 } 47357 47358 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js 47359 47360 /** 47361 * WordPress dependencies 47362 */ 47363 47364 const query_pagination_deprecated_deprecated = [ 47365 // Version with wrapper `div` element. 47366 { 47367 save() { 47368 return (0,external_React_namespaceObject.createElement)("div", { 47369 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 47370 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 47371 } 47372 }]; 47373 /* harmony default export */ const query_pagination_deprecated = (query_pagination_deprecated_deprecated); 47374 47375 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js 47376 /** 47377 * WordPress dependencies 47378 */ 47379 47380 47381 /** 47382 * Internal dependencies 47383 */ 47384 47385 const query_pagination_metadata = { 47386 $schema: "https://schemas.wp.org/trunk/block.json", 47387 apiVersion: 3, 47388 name: "core/query-pagination", 47389 title: "Pagination", 47390 category: "theme", 47391 ancestor: ["core/query"], 47392 allowedBlocks: ["core/query-pagination-previous", "core/query-pagination-numbers", "core/query-pagination-next"], 47393 description: "Displays a paginated navigation to next/previous set of posts, when applicable.", 47394 textdomain: "default", 47395 attributes: { 47396 paginationArrow: { 47397 type: "string", 47398 "default": "none" 47399 }, 47400 showLabel: { 47401 type: "boolean", 47402 "default": true 47403 } 47404 }, 47405 usesContext: ["queryId", "query"], 47406 providesContext: { 47407 paginationArrow: "paginationArrow", 47408 showLabel: "showLabel" 47409 }, 47410 supports: { 47411 align: true, 47412 reusable: false, 47413 html: false, 47414 color: { 47415 gradients: true, 47416 link: true, 47417 __experimentalDefaultControls: { 47418 background: true, 47419 text: true, 47420 link: true 47421 } 47422 }, 47423 layout: { 47424 allowSwitching: false, 47425 allowInheriting: false, 47426 "default": { 47427 type: "flex" 47428 } 47429 }, 47430 typography: { 47431 fontSize: true, 47432 lineHeight: true, 47433 __experimentalFontFamily: true, 47434 __experimentalFontWeight: true, 47435 __experimentalFontStyle: true, 47436 __experimentalTextTransform: true, 47437 __experimentalTextDecoration: true, 47438 __experimentalLetterSpacing: true, 47439 __experimentalDefaultControls: { 47440 fontSize: true 47441 } 47442 }, 47443 interactivity: { 47444 clientNavigation: true 47445 } 47446 }, 47447 editorStyle: "wp-block-query-pagination-editor", 47448 style: "wp-block-query-pagination" 47449 }; 47450 47451 47452 47453 const { 47454 name: query_pagination_name 47455 } = query_pagination_metadata; 47456 47457 const query_pagination_settings = { 47458 icon: query_pagination, 47459 edit: edit_QueryPaginationEdit, 47460 save: query_pagination_save_save, 47461 deprecated: query_pagination_deprecated 47462 }; 47463 const query_pagination_init = () => initBlock({ 47464 name: query_pagination_name, 47465 metadata: query_pagination_metadata, 47466 settings: query_pagination_settings 47467 }); 47468 47469 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js 47470 47471 /** 47472 * WordPress dependencies 47473 */ 47474 47475 47476 const query_pagination_next_edit_arrowMap = { 47477 none: '', 47478 arrow: '→', 47479 chevron: '»' 47480 }; 47481 function QueryPaginationNextEdit({ 47482 attributes: { 47483 label 47484 }, 47485 setAttributes, 47486 context: { 47487 paginationArrow, 47488 showLabel 47489 } 47490 }) { 47491 const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow]; 47492 return (0,external_React_namespaceObject.createElement)("a", { 47493 href: "#pagination-next-pseudo-link", 47494 onClick: event => event.preventDefault(), 47495 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 47496 }, showLabel && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 47497 __experimentalVersion: 2, 47498 tagName: "span", 47499 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'), 47500 placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'), 47501 value: label, 47502 onChange: newLabel => setAttributes({ 47503 label: newLabel 47504 }) 47505 }), displayArrow && (0,external_React_namespaceObject.createElement)("span", { 47506 className: `wp-block-query-pagination-next-arrow is-arrow-$paginationArrow}`, 47507 "aria-hidden": true 47508 }, displayArrow)); 47509 } 47510 47511 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js 47512 /** 47513 * WordPress dependencies 47514 */ 47515 47516 47517 /** 47518 * Internal dependencies 47519 */ 47520 47521 const query_pagination_next_metadata = { 47522 $schema: "https://schemas.wp.org/trunk/block.json", 47523 apiVersion: 3, 47524 name: "core/query-pagination-next", 47525 title: "Next Page", 47526 category: "theme", 47527 parent: ["core/query-pagination"], 47528 description: "Displays the next posts page link.", 47529 textdomain: "default", 47530 attributes: { 47531 label: { 47532 type: "string" 47533 } 47534 }, 47535 usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], 47536 supports: { 47537 reusable: false, 47538 html: false, 47539 color: { 47540 gradients: true, 47541 text: false, 47542 __experimentalDefaultControls: { 47543 background: true 47544 } 47545 }, 47546 typography: { 47547 fontSize: true, 47548 lineHeight: true, 47549 __experimentalFontFamily: true, 47550 __experimentalFontWeight: true, 47551 __experimentalFontStyle: true, 47552 __experimentalTextTransform: true, 47553 __experimentalTextDecoration: true, 47554 __experimentalLetterSpacing: true, 47555 __experimentalDefaultControls: { 47556 fontSize: true 47557 } 47558 }, 47559 interactivity: { 47560 clientNavigation: true 47561 } 47562 } 47563 }; 47564 47565 const { 47566 name: query_pagination_next_name 47567 } = query_pagination_next_metadata; 47568 47569 const query_pagination_next_settings = { 47570 icon: query_pagination_next, 47571 edit: QueryPaginationNextEdit 47572 }; 47573 const query_pagination_next_init = () => initBlock({ 47574 name: query_pagination_next_name, 47575 metadata: query_pagination_next_metadata, 47576 settings: query_pagination_next_settings 47577 }); 47578 47579 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js 47580 47581 /** 47582 * WordPress dependencies 47583 */ 47584 47585 47586 47587 const createPaginationItem = (content, Tag = 'a', extraClass = '') => (0,external_React_namespaceObject.createElement)(Tag, { 47588 key: content, 47589 className: `page-numbers $extraClass}` 47590 }, content); 47591 const previewPaginationNumbers = midSize => { 47592 const paginationItems = []; 47593 47594 // First set of pagination items. 47595 for (let i = 1; i <= midSize; i++) { 47596 paginationItems.push(createPaginationItem(i)); 47597 } 47598 47599 // Current pagination item. 47600 paginationItems.push(createPaginationItem(midSize + 1, 'span', 'current')); 47601 47602 // Second set of pagination items. 47603 for (let i = 1; i <= midSize; i++) { 47604 paginationItems.push(createPaginationItem(midSize + 1 + i)); 47605 } 47606 47607 // Dots. 47608 paginationItems.push(createPaginationItem('...', 'span', 'dots')); 47609 47610 // Last pagination item. 47611 paginationItems.push(createPaginationItem(midSize * 2 + 3)); 47612 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, paginationItems); 47613 }; 47614 function QueryPaginationNumbersEdit({ 47615 attributes, 47616 setAttributes 47617 }) { 47618 const { 47619 midSize 47620 } = attributes; 47621 const paginationNumbers = previewPaginationNumbers(parseInt(midSize, 10)); 47622 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 47623 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 47624 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 47625 label: (0,external_wp_i18n_namespaceObject.__)('Number of links'), 47626 help: (0,external_wp_i18n_namespaceObject.__)('Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'), 47627 value: midSize, 47628 onChange: value => { 47629 setAttributes({ 47630 midSize: parseInt(value, 10) 47631 }); 47632 }, 47633 min: 0, 47634 max: 5, 47635 withInputField: false 47636 }))), (0,external_React_namespaceObject.createElement)("div", { 47637 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 47638 }, paginationNumbers)); 47639 } 47640 47641 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js 47642 /** 47643 * WordPress dependencies 47644 */ 47645 47646 47647 /** 47648 * Internal dependencies 47649 */ 47650 47651 const query_pagination_numbers_metadata = { 47652 $schema: "https://schemas.wp.org/trunk/block.json", 47653 apiVersion: 3, 47654 name: "core/query-pagination-numbers", 47655 title: "Page Numbers", 47656 category: "theme", 47657 parent: ["core/query-pagination"], 47658 description: "Displays a list of page numbers for pagination.", 47659 textdomain: "default", 47660 attributes: { 47661 midSize: { 47662 type: "number", 47663 "default": 2 47664 } 47665 }, 47666 usesContext: ["queryId", "query", "enhancedPagination"], 47667 supports: { 47668 reusable: false, 47669 html: false, 47670 color: { 47671 gradients: true, 47672 text: false, 47673 __experimentalDefaultControls: { 47674 background: true 47675 } 47676 }, 47677 typography: { 47678 fontSize: true, 47679 lineHeight: true, 47680 __experimentalFontFamily: true, 47681 __experimentalFontWeight: true, 47682 __experimentalFontStyle: true, 47683 __experimentalTextTransform: true, 47684 __experimentalTextDecoration: true, 47685 __experimentalLetterSpacing: true, 47686 __experimentalDefaultControls: { 47687 fontSize: true 47688 } 47689 }, 47690 interactivity: { 47691 clientNavigation: true 47692 } 47693 }, 47694 editorStyle: "wp-block-query-pagination-numbers-editor" 47695 }; 47696 47697 const { 47698 name: query_pagination_numbers_name 47699 } = query_pagination_numbers_metadata; 47700 47701 const query_pagination_numbers_settings = { 47702 icon: query_pagination_numbers, 47703 edit: QueryPaginationNumbersEdit 47704 }; 47705 const query_pagination_numbers_init = () => initBlock({ 47706 name: query_pagination_numbers_name, 47707 metadata: query_pagination_numbers_metadata, 47708 settings: query_pagination_numbers_settings 47709 }); 47710 47711 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js 47712 47713 /** 47714 * WordPress dependencies 47715 */ 47716 47717 47718 const query_pagination_previous_edit_arrowMap = { 47719 none: '', 47720 arrow: '←', 47721 chevron: '«' 47722 }; 47723 function QueryPaginationPreviousEdit({ 47724 attributes: { 47725 label 47726 }, 47727 setAttributes, 47728 context: { 47729 paginationArrow, 47730 showLabel 47731 } 47732 }) { 47733 const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow]; 47734 return (0,external_React_namespaceObject.createElement)("a", { 47735 href: "#pagination-previous-pseudo-link", 47736 onClick: event => event.preventDefault(), 47737 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 47738 }, displayArrow && (0,external_React_namespaceObject.createElement)("span", { 47739 className: `wp-block-query-pagination-previous-arrow is-arrow-$paginationArrow}`, 47740 "aria-hidden": true 47741 }, displayArrow), showLabel && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 47742 __experimentalVersion: 2, 47743 tagName: "span", 47744 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'), 47745 placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'), 47746 value: label, 47747 onChange: newLabel => setAttributes({ 47748 label: newLabel 47749 }) 47750 })); 47751 } 47752 47753 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js 47754 /** 47755 * WordPress dependencies 47756 */ 47757 47758 47759 /** 47760 * Internal dependencies 47761 */ 47762 47763 const query_pagination_previous_metadata = { 47764 $schema: "https://schemas.wp.org/trunk/block.json", 47765 apiVersion: 3, 47766 name: "core/query-pagination-previous", 47767 title: "Previous Page", 47768 category: "theme", 47769 parent: ["core/query-pagination"], 47770 description: "Displays the previous posts page link.", 47771 textdomain: "default", 47772 attributes: { 47773 label: { 47774 type: "string" 47775 } 47776 }, 47777 usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], 47778 supports: { 47779 reusable: false, 47780 html: false, 47781 color: { 47782 gradients: true, 47783 text: false, 47784 __experimentalDefaultControls: { 47785 background: true 47786 } 47787 }, 47788 typography: { 47789 fontSize: true, 47790 lineHeight: true, 47791 __experimentalFontFamily: true, 47792 __experimentalFontWeight: true, 47793 __experimentalFontStyle: true, 47794 __experimentalTextTransform: true, 47795 __experimentalTextDecoration: true, 47796 __experimentalLetterSpacing: true, 47797 __experimentalDefaultControls: { 47798 fontSize: true 47799 } 47800 }, 47801 interactivity: { 47802 clientNavigation: true 47803 } 47804 } 47805 }; 47806 47807 const { 47808 name: query_pagination_previous_name 47809 } = query_pagination_previous_metadata; 47810 47811 const query_pagination_previous_settings = { 47812 icon: query_pagination_previous, 47813 edit: QueryPaginationPreviousEdit 47814 }; 47815 const query_pagination_previous_init = () => initBlock({ 47816 name: query_pagination_previous_name, 47817 metadata: query_pagination_previous_metadata, 47818 settings: query_pagination_previous_settings 47819 }); 47820 47821 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js 47822 47823 /** 47824 * External dependencies 47825 */ 47826 47827 47828 /** 47829 * WordPress dependencies 47830 */ 47831 47832 47833 47834 47835 const SUPPORTED_TYPES = ['archive', 'search']; 47836 function QueryTitleEdit({ 47837 attributes: { 47838 type, 47839 level, 47840 textAlign, 47841 showPrefix, 47842 showSearchTerm 47843 }, 47844 setAttributes 47845 }) { 47846 const { 47847 archiveTypeTitle, 47848 archiveNameLabel 47849 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 47850 const { 47851 getSettings 47852 } = select(external_wp_blockEditor_namespaceObject.store); 47853 const { 47854 __experimentalArchiveTitleNameLabel, 47855 __experimentalArchiveTitleTypeLabel 47856 } = getSettings(); 47857 return { 47858 archiveTypeTitle: __experimentalArchiveTitleTypeLabel, 47859 archiveNameLabel: __experimentalArchiveTitleNameLabel 47860 }; 47861 }); 47862 const TagName = `h$level}`; 47863 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 47864 className: classnames_default()('wp-block-query-title__placeholder', { 47865 [`has-text-align-$textAlign}`]: textAlign 47866 }) 47867 }); 47868 if (!SUPPORTED_TYPES.includes(type)) { 47869 return (0,external_React_namespaceObject.createElement)("div", { 47870 ...blockProps 47871 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.'))); 47872 } 47873 let titleElement; 47874 if (type === 'archive') { 47875 let title; 47876 if (archiveTypeTitle) { 47877 if (showPrefix) { 47878 if (archiveNameLabel) { 47879 title = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */ 47880 (0,external_wp_i18n_namespaceObject.__)('%1$s: %2$s'), archiveTypeTitle, archiveNameLabel); 47881 } else { 47882 title = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Archive type title e.g: "Category", "Tag"... */ 47883 (0,external_wp_i18n_namespaceObject.__)('%s: Name'), archiveTypeTitle); 47884 } 47885 } else if (archiveNameLabel) { 47886 title = archiveNameLabel; 47887 } else { 47888 title = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Archive type title e.g: "Category", "Tag"... */ 47889 (0,external_wp_i18n_namespaceObject.__)('%s name'), archiveTypeTitle); 47890 } 47891 } else { 47892 title = showPrefix ? (0,external_wp_i18n_namespaceObject.__)('Archive type: Name') : (0,external_wp_i18n_namespaceObject.__)('Archive title'); 47893 } 47894 titleElement = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 47895 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 47896 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 47897 __nextHasNoMarginBottom: true, 47898 label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'), 47899 onChange: () => setAttributes({ 47900 showPrefix: !showPrefix 47901 }), 47902 checked: showPrefix 47903 }))), (0,external_React_namespaceObject.createElement)(TagName, { 47904 ...blockProps 47905 }, title)); 47906 } 47907 if (type === 'search') { 47908 titleElement = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 47909 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 47910 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 47911 __nextHasNoMarginBottom: true, 47912 label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'), 47913 onChange: () => setAttributes({ 47914 showSearchTerm: !showSearchTerm 47915 }), 47916 checked: showSearchTerm 47917 }))), (0,external_React_namespaceObject.createElement)(TagName, { 47918 ...blockProps 47919 }, showSearchTerm ? (0,external_wp_i18n_namespaceObject.__)('Search results for: “search term”') : (0,external_wp_i18n_namespaceObject.__)('Search results'))); 47920 } 47921 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 47922 group: "block" 47923 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 47924 value: level, 47925 onChange: newLevel => setAttributes({ 47926 level: newLevel 47927 }) 47928 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 47929 value: textAlign, 47930 onChange: nextAlign => { 47931 setAttributes({ 47932 textAlign: nextAlign 47933 }); 47934 } 47935 })), titleElement); 47936 } 47937 47938 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js 47939 /** 47940 * WordPress dependencies 47941 */ 47942 47943 47944 const query_title_variations_variations = [{ 47945 isDefault: true, 47946 name: 'archive-title', 47947 title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'), 47948 description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'), 47949 icon: library_title, 47950 attributes: { 47951 type: 'archive' 47952 }, 47953 scope: ['inserter'] 47954 }, { 47955 isDefault: false, 47956 name: 'search-title', 47957 title: (0,external_wp_i18n_namespaceObject.__)('Search Results Title'), 47958 description: (0,external_wp_i18n_namespaceObject.__)('Display the search results title based on the queried object.'), 47959 icon: library_title, 47960 attributes: { 47961 type: 'search' 47962 }, 47963 scope: ['inserter'] 47964 }]; 47965 47966 /** 47967 * Add `isActive` function to all `query-title` variations, if not defined. 47968 * `isActive` function is used to find a variation match from a created 47969 * Block by providing its attributes. 47970 */ 47971 query_title_variations_variations.forEach(variation => { 47972 if (variation.isActive) return; 47973 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; 47974 }); 47975 /* harmony default export */ const query_title_variations = (query_title_variations_variations); 47976 47977 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js 47978 /** 47979 * Internal dependencies 47980 */ 47981 47982 const query_title_deprecated_v1 = { 47983 attributes: { 47984 type: { 47985 type: 'string' 47986 }, 47987 textAlign: { 47988 type: 'string' 47989 }, 47990 level: { 47991 type: 'number', 47992 default: 1 47993 } 47994 }, 47995 supports: { 47996 align: ['wide', 'full'], 47997 html: false, 47998 color: { 47999 gradients: true 48000 }, 48001 spacing: { 48002 margin: true 48003 }, 48004 typography: { 48005 fontSize: true, 48006 lineHeight: true, 48007 __experimentalFontFamily: true 48008 } 48009 }, 48010 save() { 48011 return null; 48012 }, 48013 migrate: migrate_font_family, 48014 isEligible({ 48015 style 48016 }) { 48017 return style?.typography?.fontFamily; 48018 } 48019 }; 48020 48021 /** 48022 * New deprecations need to be placed first 48023 * for them to have higher priority. 48024 * 48025 * Old deprecations may need to be updated as well. 48026 * 48027 * See block-deprecation.md 48028 */ 48029 /* harmony default export */ const query_title_deprecated = ([query_title_deprecated_v1]); 48030 48031 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js 48032 /** 48033 * WordPress dependencies 48034 */ 48035 48036 48037 /** 48038 * Internal dependencies 48039 */ 48040 48041 const query_title_metadata = { 48042 $schema: "https://schemas.wp.org/trunk/block.json", 48043 apiVersion: 3, 48044 name: "core/query-title", 48045 title: "Query Title", 48046 category: "theme", 48047 description: "Display the query title.", 48048 textdomain: "default", 48049 attributes: { 48050 type: { 48051 type: "string" 48052 }, 48053 textAlign: { 48054 type: "string" 48055 }, 48056 level: { 48057 type: "number", 48058 "default": 1 48059 }, 48060 showPrefix: { 48061 type: "boolean", 48062 "default": true 48063 }, 48064 showSearchTerm: { 48065 type: "boolean", 48066 "default": true 48067 } 48068 }, 48069 supports: { 48070 align: ["wide", "full"], 48071 html: false, 48072 color: { 48073 gradients: true, 48074 __experimentalDefaultControls: { 48075 background: true, 48076 text: true 48077 } 48078 }, 48079 spacing: { 48080 margin: true, 48081 padding: true 48082 }, 48083 typography: { 48084 fontSize: true, 48085 lineHeight: true, 48086 __experimentalFontFamily: true, 48087 __experimentalFontStyle: true, 48088 __experimentalFontWeight: true, 48089 __experimentalLetterSpacing: true, 48090 __experimentalTextTransform: true, 48091 __experimentalTextDecoration: true, 48092 __experimentalDefaultControls: { 48093 fontSize: true 48094 } 48095 }, 48096 interactivity: { 48097 clientNavigation: true 48098 } 48099 }, 48100 style: "wp-block-query-title" 48101 }; 48102 48103 48104 48105 const { 48106 name: query_title_name 48107 } = query_title_metadata; 48108 48109 const query_title_settings = { 48110 icon: library_title, 48111 edit: QueryTitleEdit, 48112 variations: query_title_variations, 48113 deprecated: query_title_deprecated 48114 }; 48115 const query_title_init = () => initBlock({ 48116 name: query_title_name, 48117 metadata: query_title_metadata, 48118 settings: query_title_settings 48119 }); 48120 48121 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js 48122 48123 /** 48124 * WordPress dependencies 48125 */ 48126 48127 const quote = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 48128 viewBox: "0 0 24 24", 48129 xmlns: "http://www.w3.org/2000/svg" 48130 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 48131 d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z" 48132 })); 48133 /* harmony default export */ const library_quote = (quote); 48134 48135 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js 48136 48137 /** 48138 * External dependencies 48139 */ 48140 48141 48142 /** 48143 * WordPress dependencies 48144 */ 48145 48146 48147 const migrateToQuoteV2 = attributes => { 48148 const { 48149 value, 48150 ...restAttributes 48151 } = attributes; 48152 return [{ 48153 ...restAttributes 48154 }, value ? (0,external_wp_blocks_namespaceObject.parseWithAttributeSchema)(value, { 48155 type: 'array', 48156 source: 'query', 48157 selector: 'p', 48158 query: { 48159 content: { 48160 type: 'string', 48161 source: 'html' 48162 } 48163 } 48164 }).map(({ 48165 content 48166 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48167 content 48168 })) : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')]; 48169 }; 48170 const quote_deprecated_v3 = { 48171 attributes: { 48172 value: { 48173 type: 'string', 48174 source: 'html', 48175 selector: 'blockquote', 48176 multiline: 'p', 48177 default: '', 48178 __experimentalRole: 'content' 48179 }, 48180 citation: { 48181 type: 'string', 48182 source: 'html', 48183 selector: 'cite', 48184 default: '', 48185 __experimentalRole: 'content' 48186 }, 48187 align: { 48188 type: 'string' 48189 } 48190 }, 48191 supports: { 48192 anchor: true, 48193 __experimentalSlashInserter: true, 48194 typography: { 48195 fontSize: true, 48196 lineHeight: true, 48197 __experimentalFontStyle: true, 48198 __experimentalFontWeight: true, 48199 __experimentalLetterSpacing: true, 48200 __experimentalTextTransform: true, 48201 __experimentalDefaultControls: { 48202 fontSize: true, 48203 fontAppearance: true 48204 } 48205 } 48206 }, 48207 save({ 48208 attributes 48209 }) { 48210 const { 48211 align, 48212 value, 48213 citation 48214 } = attributes; 48215 const className = classnames_default()({ 48216 [`has-text-align-$align}`]: align 48217 }); 48218 return (0,external_React_namespaceObject.createElement)("blockquote", { 48219 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 48220 className 48221 }) 48222 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48223 multiline: true, 48224 value: value 48225 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48226 tagName: "cite", 48227 value: citation 48228 })); 48229 }, 48230 migrate: migrateToQuoteV2 48231 }; 48232 const quote_deprecated_v2 = { 48233 attributes: { 48234 value: { 48235 type: 'string', 48236 source: 'html', 48237 selector: 'blockquote', 48238 multiline: 'p', 48239 default: '' 48240 }, 48241 citation: { 48242 type: 'string', 48243 source: 'html', 48244 selector: 'cite', 48245 default: '' 48246 }, 48247 align: { 48248 type: 'string' 48249 } 48250 }, 48251 migrate: migrateToQuoteV2, 48252 save({ 48253 attributes 48254 }) { 48255 const { 48256 align, 48257 value, 48258 citation 48259 } = attributes; 48260 return (0,external_React_namespaceObject.createElement)("blockquote", { 48261 style: { 48262 textAlign: align ? align : null 48263 } 48264 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48265 multiline: true, 48266 value: value 48267 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48268 tagName: "cite", 48269 value: citation 48270 })); 48271 } 48272 }; 48273 const quote_deprecated_v1 = { 48274 attributes: { 48275 value: { 48276 type: 'string', 48277 source: 'html', 48278 selector: 'blockquote', 48279 multiline: 'p', 48280 default: '' 48281 }, 48282 citation: { 48283 type: 'string', 48284 source: 'html', 48285 selector: 'cite', 48286 default: '' 48287 }, 48288 align: { 48289 type: 'string' 48290 }, 48291 style: { 48292 type: 'number', 48293 default: 1 48294 } 48295 }, 48296 migrate(attributes) { 48297 if (attributes.style === 2) { 48298 const { 48299 style, 48300 ...restAttributes 48301 } = attributes; 48302 return migrateToQuoteV2({ 48303 ...restAttributes, 48304 className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large' 48305 }); 48306 } 48307 return migrateToQuoteV2(attributes); 48308 }, 48309 save({ 48310 attributes 48311 }) { 48312 const { 48313 align, 48314 value, 48315 citation, 48316 style 48317 } = attributes; 48318 return (0,external_React_namespaceObject.createElement)("blockquote", { 48319 className: style === 2 ? 'is-large' : '', 48320 style: { 48321 textAlign: align ? align : null 48322 } 48323 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48324 multiline: true, 48325 value: value 48326 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48327 tagName: "cite", 48328 value: citation 48329 })); 48330 } 48331 }; 48332 const quote_deprecated_v0 = { 48333 attributes: { 48334 value: { 48335 type: 'string', 48336 source: 'html', 48337 selector: 'blockquote', 48338 multiline: 'p', 48339 default: '' 48340 }, 48341 citation: { 48342 type: 'string', 48343 source: 'html', 48344 selector: 'footer', 48345 default: '' 48346 }, 48347 align: { 48348 type: 'string' 48349 }, 48350 style: { 48351 type: 'number', 48352 default: 1 48353 } 48354 }, 48355 migrate(attributes) { 48356 if (!isNaN(parseInt(attributes.style))) { 48357 const { 48358 style, 48359 ...restAttributes 48360 } = attributes; 48361 return migrateToQuoteV2({ 48362 ...restAttributes 48363 }); 48364 } 48365 return migrateToQuoteV2(attributes); 48366 }, 48367 save({ 48368 attributes 48369 }) { 48370 const { 48371 align, 48372 value, 48373 citation, 48374 style 48375 } = attributes; 48376 return (0,external_React_namespaceObject.createElement)("blockquote", { 48377 className: `blocks-quote-style-$style}`, 48378 style: { 48379 textAlign: align ? align : null 48380 } 48381 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48382 multiline: true, 48383 value: value 48384 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48385 tagName: "footer", 48386 value: citation 48387 })); 48388 } 48389 }; 48390 48391 /** 48392 * New deprecations need to be placed first 48393 * for them to have higher priority. 48394 * 48395 * Old deprecations may need to be updated as well. 48396 * 48397 * See block-deprecation.md 48398 */ 48399 /* harmony default export */ const quote_deprecated = ([quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]); 48400 48401 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js 48402 48403 /** 48404 * External dependencies 48405 */ 48406 48407 48408 /** 48409 * WordPress dependencies 48410 */ 48411 48412 48413 48414 48415 48416 48417 48418 48419 /** 48420 * Internal dependencies 48421 */ 48422 48423 const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; 48424 const quote_edit_TEMPLATE = [['core/paragraph', {}]]; 48425 48426 /** 48427 * At the moment, deprecations don't handle create blocks from attributes 48428 * (like when using CPT templates). For this reason, this hook is necessary 48429 * to avoid breaking templates using the old quote block format. 48430 * 48431 * @param {Object} attributes Block attributes. 48432 * @param {string} clientId Block client ID. 48433 */ 48434 const edit_useMigrateOnLoad = (attributes, clientId) => { 48435 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 48436 const { 48437 updateBlockAttributes, 48438 replaceInnerBlocks 48439 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 48440 (0,external_wp_element_namespaceObject.useEffect)(() => { 48441 // As soon as the block is loaded, migrate it to the new version. 48442 48443 if (!attributes.value) { 48444 // No need to migrate if it doesn't have the value attribute. 48445 return; 48446 } 48447 const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes); 48448 external_wp_deprecated_default()('Value attribute on the quote block', { 48449 since: '6.0', 48450 version: '6.5', 48451 alternative: 'inner blocks' 48452 }); 48453 registry.batch(() => { 48454 updateBlockAttributes(clientId, newAttributes); 48455 replaceInnerBlocks(clientId, newInnerBlocks); 48456 }); 48457 }, [attributes.value]); 48458 }; 48459 function QuoteEdit({ 48460 attributes, 48461 setAttributes, 48462 insertBlocksAfter, 48463 clientId, 48464 className, 48465 style 48466 }) { 48467 const { 48468 align, 48469 citation 48470 } = attributes; 48471 edit_useMigrateOnLoad(attributes, clientId); 48472 const hasSelection = (0,external_wp_data_namespaceObject.useSelect)(select => { 48473 const { 48474 isBlockSelected, 48475 hasSelectedInnerBlock 48476 } = select(external_wp_blockEditor_namespaceObject.store); 48477 return hasSelectedInnerBlock(clientId) || isBlockSelected(clientId); 48478 }, []); 48479 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 48480 className: classnames_default()(className, { 48481 [`has-text-align-$align}`]: align 48482 }), 48483 ...(!edit_isWebPlatform && { 48484 style 48485 }) 48486 }); 48487 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 48488 template: quote_edit_TEMPLATE, 48489 templateInsertUpdatesSelection: true, 48490 __experimentalCaptureToolbars: true 48491 }); 48492 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 48493 group: "block" 48494 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 48495 value: align, 48496 onChange: nextAlign => { 48497 setAttributes({ 48498 align: nextAlign 48499 }); 48500 } 48501 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, { 48502 ...innerBlocksProps 48503 }, innerBlocksProps.children, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || hasSelection) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 48504 identifier: "citation", 48505 tagName: edit_isWebPlatform ? 'cite' : undefined, 48506 style: { 48507 display: 'block' 48508 }, 48509 value: citation, 48510 onChange: nextCitation => { 48511 setAttributes({ 48512 citation: nextCitation 48513 }); 48514 }, 48515 __unstableMobileNoFocusOnMount: true, 48516 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation'), 48517 placeholder: 48518 // translators: placeholder text used for the 48519 // citation 48520 (0,external_wp_i18n_namespaceObject.__)('Add citation'), 48521 className: "wp-block-quote__citation", 48522 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 48523 ...(!edit_isWebPlatform ? { 48524 textAlign: align 48525 } : {}) 48526 }))); 48527 } 48528 48529 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js 48530 48531 /** 48532 * External dependencies 48533 */ 48534 48535 48536 /** 48537 * WordPress dependencies 48538 */ 48539 48540 function quote_save_save({ 48541 attributes 48542 }) { 48543 const { 48544 align, 48545 citation 48546 } = attributes; 48547 const className = classnames_default()({ 48548 [`has-text-align-$align}`]: align 48549 }); 48550 return (0,external_React_namespaceObject.createElement)("blockquote", { 48551 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 48552 className 48553 }) 48554 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 48555 tagName: "cite", 48556 value: citation 48557 })); 48558 } 48559 48560 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js 48561 /** 48562 * WordPress dependencies 48563 */ 48564 48565 48566 const quote_transforms_transforms = { 48567 from: [{ 48568 type: 'block', 48569 blocks: ['core/pullquote'], 48570 transform: ({ 48571 value, 48572 citation, 48573 anchor, 48574 fontSize, 48575 style 48576 }) => { 48577 return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { 48578 citation, 48579 anchor, 48580 fontSize, 48581 style 48582 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48583 content: value 48584 })]); 48585 } 48586 }, { 48587 type: 'prefix', 48588 prefix: '>', 48589 transform: content => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48590 content 48591 })]) 48592 }, { 48593 type: 'raw', 48594 schema: () => ({ 48595 blockquote: { 48596 children: '*' 48597 } 48598 }), 48599 selector: 'blockquote', 48600 transform: (node, handler) => { 48601 return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', 48602 // Don't try to parse any `cite` out of this content. 48603 // * There may be more than one cite. 48604 // * There may be more attribution text than just the cite. 48605 // * If the cite is nested in the quoted text, it's wrong to 48606 // remove it. 48607 {}, handler({ 48608 HTML: node.innerHTML, 48609 mode: 'BLOCKS' 48610 })); 48611 } 48612 }, { 48613 type: 'block', 48614 isMultiBlock: true, 48615 blocks: ['*'], 48616 isMatch: ({}, blocks) => { 48617 // When a single block is selected make the tranformation 48618 // available only to specific blocks that make sense. 48619 if (blocks.length === 1) { 48620 return ['core/paragraph', 'core/heading', 'core/list', 'core/pullquote'].includes(blocks[0].name); 48621 } 48622 return !blocks.some(({ 48623 name 48624 }) => name === 'core/quote'); 48625 }, 48626 __experimentalConvert: blocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks))) 48627 }], 48628 to: [{ 48629 type: 'block', 48630 blocks: ['core/pullquote'], 48631 isMatch: ({}, block) => { 48632 return block.innerBlocks.every(({ 48633 name 48634 }) => name === 'core/paragraph'); 48635 }, 48636 transform: ({ 48637 citation, 48638 anchor, 48639 fontSize, 48640 style 48641 }, innerBlocks) => { 48642 const value = innerBlocks.map(({ 48643 attributes 48644 }) => `$attributes.content}`).join('<br>'); 48645 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 48646 value, 48647 citation, 48648 anchor, 48649 fontSize, 48650 style 48651 }); 48652 } 48653 }, { 48654 type: 'block', 48655 blocks: ['core/paragraph'], 48656 transform: ({ 48657 citation 48658 }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48659 content: citation 48660 })] 48661 }, { 48662 type: 'block', 48663 blocks: ['core/group'], 48664 transform: ({ 48665 citation, 48666 anchor 48667 }, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 48668 anchor 48669 }, external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48670 content: citation 48671 })]) 48672 }], 48673 ungroup: ({ 48674 citation 48675 }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 48676 content: citation 48677 })] 48678 }; 48679 /* harmony default export */ const quote_transforms = (quote_transforms_transforms); 48680 48681 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js 48682 /** 48683 * WordPress dependencies 48684 */ 48685 48686 48687 48688 /** 48689 * Internal dependencies 48690 */ 48691 48692 48693 48694 const quote_metadata = { 48695 $schema: "https://schemas.wp.org/trunk/block.json", 48696 apiVersion: 3, 48697 name: "core/quote", 48698 title: "Quote", 48699 category: "text", 48700 description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar", 48701 keywords: ["blockquote", "cite"], 48702 textdomain: "default", 48703 attributes: { 48704 value: { 48705 type: "string", 48706 source: "html", 48707 selector: "blockquote", 48708 multiline: "p", 48709 "default": "", 48710 __experimentalRole: "content" 48711 }, 48712 citation: { 48713 type: "rich-text", 48714 source: "rich-text", 48715 selector: "cite", 48716 __experimentalRole: "content" 48717 }, 48718 align: { 48719 type: "string" 48720 } 48721 }, 48722 supports: { 48723 anchor: true, 48724 html: false, 48725 __experimentalOnEnter: true, 48726 __experimentalOnMerge: true, 48727 typography: { 48728 fontSize: true, 48729 lineHeight: true, 48730 __experimentalFontFamily: true, 48731 __experimentalFontWeight: true, 48732 __experimentalFontStyle: true, 48733 __experimentalTextTransform: true, 48734 __experimentalTextDecoration: true, 48735 __experimentalLetterSpacing: true, 48736 __experimentalDefaultControls: { 48737 fontSize: true 48738 } 48739 }, 48740 color: { 48741 gradients: true, 48742 heading: true, 48743 link: true, 48744 __experimentalDefaultControls: { 48745 background: true, 48746 text: true 48747 } 48748 }, 48749 layout: { 48750 allowEditing: false 48751 }, 48752 spacing: { 48753 blockGap: true 48754 }, 48755 interactivity: { 48756 clientNavigation: true 48757 } 48758 }, 48759 styles: [{ 48760 name: "default", 48761 label: "Default", 48762 isDefault: true 48763 }, { 48764 name: "plain", 48765 label: "Plain" 48766 }], 48767 editorStyle: "wp-block-quote-editor", 48768 style: "wp-block-quote" 48769 }; 48770 48771 48772 const { 48773 name: quote_name 48774 } = quote_metadata; 48775 48776 const quote_settings = { 48777 icon: library_quote, 48778 example: { 48779 attributes: { 48780 citation: 'Julio Cortázar' 48781 }, 48782 innerBlocks: [{ 48783 name: 'core/paragraph', 48784 attributes: { 48785 content: (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') 48786 } 48787 }] 48788 }, 48789 transforms: quote_transforms, 48790 edit: QuoteEdit, 48791 save: quote_save_save, 48792 deprecated: quote_deprecated 48793 }; 48794 const quote_init = () => initBlock({ 48795 name: quote_name, 48796 metadata: quote_metadata, 48797 settings: quote_settings 48798 }); 48799 48800 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js 48801 48802 /** 48803 * WordPress dependencies 48804 */ 48805 48806 const symbol = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 48807 xmlns: "http://www.w3.org/2000/svg", 48808 viewBox: "0 0 24 24" 48809 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 48810 d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" 48811 })); 48812 /* harmony default export */ const library_symbol = (symbol); 48813 48814 ;// CONCATENATED MODULE: external ["wp","patterns"] 48815 const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; 48816 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js 48817 48818 /** 48819 * External dependencies 48820 */ 48821 48822 48823 /** 48824 * WordPress dependencies 48825 */ 48826 48827 48828 48829 48830 48831 48832 48833 48834 48835 48836 /** 48837 * Internal dependencies 48838 */ 48839 48840 48841 const { 48842 useLayoutClasses 48843 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 48844 const { 48845 PARTIAL_SYNCING_SUPPORTED_BLOCKS 48846 } = unlock(external_wp_patterns_namespaceObject.privateApis); 48847 const fullAlignments = ['full', 'wide', 'left', 'right']; 48848 function getLegacyIdMap(blocks, content, nameCount = {}) { 48849 let idToClientIdMap = {}; 48850 for (const block of blocks) { 48851 if (block?.innerBlocks?.length) { 48852 idToClientIdMap = { 48853 ...idToClientIdMap, 48854 ...getLegacyIdMap(block.innerBlocks, content, nameCount) 48855 }; 48856 } 48857 const id = block.attributes.metadata?.id; 48858 const clientId = block.clientId; 48859 if (id && content?.[id]) { 48860 idToClientIdMap[clientId] = id; 48861 } 48862 } 48863 return idToClientIdMap; 48864 } 48865 const useInferredLayout = (blocks, parentLayout) => { 48866 const initialInferredAlignmentRef = (0,external_wp_element_namespaceObject.useRef)(); 48867 return (0,external_wp_element_namespaceObject.useMemo)(() => { 48868 // Exit early if the pattern's blocks haven't loaded yet. 48869 if (!blocks?.length) { 48870 return {}; 48871 } 48872 let alignment = initialInferredAlignmentRef.current; 48873 48874 // Only track the initial alignment so that temporarily removed 48875 // alignments can be reapplied. 48876 if (alignment === undefined) { 48877 const isConstrained = parentLayout?.type === 'constrained'; 48878 const hasFullAlignment = blocks.some(block => fullAlignments.includes(block.attributes.align)); 48879 alignment = isConstrained && hasFullAlignment ? 'full' : null; 48880 initialInferredAlignmentRef.current = alignment; 48881 } 48882 const layout = alignment ? parentLayout : undefined; 48883 return { 48884 alignment, 48885 layout 48886 }; 48887 }, [blocks, parentLayout]); 48888 }; 48889 function hasOverridableAttributes(block) { 48890 return Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(block.name) && !!block.attributes.metadata?.bindings && Object.values(block.attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides'); 48891 } 48892 function hasOverridableBlocks(blocks) { 48893 return blocks.some(block => { 48894 if (hasOverridableAttributes(block)) return true; 48895 return hasOverridableBlocks(block.innerBlocks); 48896 }); 48897 } 48898 function getOverridableAttributes(block) { 48899 return Object.entries(block.attributes.metadata.bindings).filter(([, binding]) => binding.source === 'core/pattern-overrides').map(([attributeKey]) => attributeKey); 48900 } 48901 function applyInitialContentValuesToInnerBlocks(blocks, content = {}, defaultValues, legacyIdMap) { 48902 return blocks.map(block => { 48903 var _legacyIdMap$block$cl; 48904 const innerBlocks = applyInitialContentValuesToInnerBlocks(block.innerBlocks, content, defaultValues, legacyIdMap); 48905 const metadataName = (_legacyIdMap$block$cl = legacyIdMap?.[block.clientId]) !== null && _legacyIdMap$block$cl !== void 0 ? _legacyIdMap$block$cl : block.attributes.metadata?.name; 48906 if (!metadataName || !hasOverridableAttributes(block)) { 48907 return { 48908 ...block, 48909 innerBlocks 48910 }; 48911 } 48912 const attributes = getOverridableAttributes(block); 48913 const newAttributes = { 48914 ...block.attributes 48915 }; 48916 for (const attributeKey of attributes) { 48917 var _defaultValues$metada; 48918 (_defaultValues$metada = defaultValues[metadataName]) !== null && _defaultValues$metada !== void 0 ? _defaultValues$metada : defaultValues[metadataName] = {}; 48919 defaultValues[metadataName][attributeKey] = block.attributes[attributeKey]; 48920 const contentValues = content[metadataName]; 48921 if (contentValues?.[attributeKey] !== undefined) { 48922 newAttributes[attributeKey] = contentValues[attributeKey]; 48923 } 48924 } 48925 return { 48926 ...block, 48927 attributes: newAttributes, 48928 innerBlocks 48929 }; 48930 }); 48931 } 48932 function isAttributeEqual(attribute1, attribute2) { 48933 if (attribute1 instanceof external_wp_richText_namespaceObject.RichTextData && attribute2 instanceof external_wp_richText_namespaceObject.RichTextData) { 48934 return attribute1.toString() === attribute2.toString(); 48935 } 48936 return attribute1 === attribute2; 48937 } 48938 function getContentValuesFromInnerBlocks(blocks, defaultValues, legacyIdMap) { 48939 /** @type {Record<string, { values: Record<string, unknown>}>} */ 48940 const content = {}; 48941 for (const block of blocks) { 48942 var _legacyIdMap$block$cl2; 48943 if (block.name === block_name) continue; 48944 if (block.innerBlocks.length) { 48945 Object.assign(content, getContentValuesFromInnerBlocks(block.innerBlocks, defaultValues, legacyIdMap)); 48946 } 48947 const metadataName = (_legacyIdMap$block$cl2 = legacyIdMap?.[block.clientId]) !== null && _legacyIdMap$block$cl2 !== void 0 ? _legacyIdMap$block$cl2 : block.attributes.metadata?.name; 48948 if (!metadataName || !hasOverridableAttributes(block)) { 48949 continue; 48950 } 48951 const attributes = getOverridableAttributes(block); 48952 for (const attributeKey of attributes) { 48953 if (!isAttributeEqual(block.attributes[attributeKey], defaultValues?.[metadataName]?.[attributeKey])) { 48954 var _content$metadataName; 48955 (_content$metadataName = content[metadataName]) !== null && _content$metadataName !== void 0 ? _content$metadataName : content[metadataName] = {}; 48956 // TODO: We need a way to represent `undefined` in the serialized overrides. 48957 // Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871 48958 content[metadataName][attributeKey] = block.attributes[attributeKey] === undefined ? 48959 // TODO: We use an empty string to represent undefined for now until 48960 // we support a richer format for overrides and the block binding API. 48961 // Currently only the `linkTarget` attribute of `core/button` is affected. 48962 '' : block.attributes[attributeKey]; 48963 } 48964 } 48965 } 48966 return Object.keys(content).length > 0 ? content : undefined; 48967 } 48968 function setBlockEditMode(setEditMode, blocks, mode) { 48969 blocks.forEach(block => { 48970 const editMode = mode || (hasOverridableAttributes(block) ? 'contentOnly' : 'disabled'); 48971 setEditMode(block.clientId, editMode); 48972 setBlockEditMode(setEditMode, block.innerBlocks, 48973 // Disable editing for nested patterns. 48974 block.name === block_name ? 'disabled' : mode); 48975 }); 48976 } 48977 function RecursionWarning() { 48978 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 48979 return (0,external_React_namespaceObject.createElement)("div", { 48980 ...blockProps 48981 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.'))); 48982 } 48983 48984 // Wrap the main Edit function for the pattern block with a recursion wrapper 48985 // that allows short-circuiting rendering as early as possible, before any 48986 // of the other effects in the block edit have run. 48987 function ReusableBlockEditRecursionWrapper(props) { 48988 const { 48989 ref 48990 } = props.attributes; 48991 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref); 48992 if (hasAlreadyRendered) { 48993 return (0,external_React_namespaceObject.createElement)(RecursionWarning, null); 48994 } 48995 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 48996 uniqueId: ref 48997 }, (0,external_React_namespaceObject.createElement)(ReusableBlockEdit, { 48998 ...props 48999 })); 49000 } 49001 function ReusableBlockEdit({ 49002 name, 49003 attributes: { 49004 ref, 49005 content 49006 }, 49007 __unstableParentLayout: parentLayout, 49008 clientId: patternClientId, 49009 setAttributes 49010 }) { 49011 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 49012 const { 49013 record, 49014 editedRecord, 49015 hasResolved 49016 } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_block', ref); 49017 const isMissing = hasResolved && !record; 49018 49019 // The initial value of the `content` attribute. 49020 const initialContent = (0,external_wp_element_namespaceObject.useRef)(content); 49021 49022 // The default content values from the original pattern for overridable attributes. 49023 // Set by the `applyInitialContentValuesToInnerBlocks` function. 49024 const defaultContent = (0,external_wp_element_namespaceObject.useRef)({}); 49025 const { 49026 replaceInnerBlocks, 49027 __unstableMarkNextChangeAsNotPersistent, 49028 setBlockEditingMode 49029 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 49030 const { 49031 syncDerivedUpdates 49032 } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); 49033 const { 49034 innerBlocks, 49035 userCanEdit, 49036 getBlockEditingMode, 49037 onNavigateToEntityRecord, 49038 editingMode, 49039 hasPatternOverridesSource 49040 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 49041 const { 49042 canUser 49043 } = select(external_wp_coreData_namespaceObject.store); 49044 const { 49045 getBlocks, 49046 getSettings, 49047 getBlockEditingMode: _getBlockEditingMode 49048 } = select(external_wp_blockEditor_namespaceObject.store); 49049 const { 49050 getBlockBindingsSource 49051 } = unlock(select(external_wp_blocks_namespaceObject.store)); 49052 const blocks = getBlocks(patternClientId); 49053 const canEdit = canUser('update', 'blocks', ref); 49054 49055 // For editing link to the site editor if the theme and user permissions support it. 49056 return { 49057 innerBlocks: blocks, 49058 userCanEdit: canEdit, 49059 getBlockEditingMode: _getBlockEditingMode, 49060 onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, 49061 editingMode: _getBlockEditingMode(patternClientId), 49062 hasPatternOverridesSource: !!getBlockBindingsSource('core/pattern-overrides') 49063 }; 49064 }, [patternClientId, ref]); 49065 49066 // Sync the editing mode of the pattern block with the inner blocks. 49067 (0,external_wp_element_namespaceObject.useEffect)(() => { 49068 setBlockEditMode(setBlockEditingMode, innerBlocks, 49069 // Disable editing if the pattern itself is disabled. 49070 editingMode === 'disabled' || !hasPatternOverridesSource ? 'disabled' : undefined); 49071 }, [editingMode, innerBlocks, setBlockEditingMode, hasPatternOverridesSource]); 49072 const canOverrideBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => hasPatternOverridesSource && hasOverridableBlocks(innerBlocks), [hasPatternOverridesSource, innerBlocks]); 49073 const initialBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { 49074 var _editedRecord$blocks$; 49075 return (// Clone the blocks to generate new client IDs. 49076 (_editedRecord$blocks$ = editedRecord.blocks?.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))) !== null && _editedRecord$blocks$ !== void 0 ? _editedRecord$blocks$ : editedRecord.content && typeof editedRecord.content !== 'function' ? (0,external_wp_blocks_namespaceObject.parse)(editedRecord.content) : [] 49077 ); 49078 }, [editedRecord.blocks, editedRecord.content]); 49079 const legacyIdMap = (0,external_wp_element_namespaceObject.useRef)({}); 49080 49081 // Apply the initial overrides from the pattern block to the inner blocks. 49082 (0,external_wp_element_namespaceObject.useEffect)(() => { 49083 // Build a map of clientIds to the old nano id system to provide back compat. 49084 legacyIdMap.current = getLegacyIdMap(initialBlocks, initialContent.current); 49085 defaultContent.current = {}; 49086 const originalEditingMode = getBlockEditingMode(patternClientId); 49087 // Replace the contents of the blocks with the overrides. 49088 registry.batch(() => { 49089 setBlockEditingMode(patternClientId, 'default'); 49090 syncDerivedUpdates(() => { 49091 const blocks = hasPatternOverridesSource ? applyInitialContentValuesToInnerBlocks(initialBlocks, initialContent.current, defaultContent.current, legacyIdMap.current) : initialBlocks; 49092 replaceInnerBlocks(patternClientId, blocks); 49093 }); 49094 setBlockEditingMode(patternClientId, originalEditingMode); 49095 }); 49096 }, [hasPatternOverridesSource, __unstableMarkNextChangeAsNotPersistent, patternClientId, initialBlocks, replaceInnerBlocks, registry, getBlockEditingMode, setBlockEditingMode, syncDerivedUpdates]); 49097 const { 49098 alignment, 49099 layout 49100 } = useInferredLayout(innerBlocks, parentLayout); 49101 const layoutClasses = useLayoutClasses({ 49102 layout 49103 }, name); 49104 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 49105 className: classnames_default()('block-library-block__reusable-block-container', layout && layoutClasses, { 49106 [`align$alignment}`]: alignment 49107 }) 49108 }); 49109 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 49110 templateLock: 'all', 49111 layout, 49112 renderAppender: innerBlocks?.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 49113 }); 49114 49115 // Sync the `content` attribute from the updated blocks to the pattern block. 49116 // `syncDerivedUpdates` is used here to avoid creating an additional undo level. 49117 (0,external_wp_element_namespaceObject.useEffect)(() => { 49118 if (!hasPatternOverridesSource) { 49119 return; 49120 } 49121 const { 49122 getBlocks 49123 } = registry.select(external_wp_blockEditor_namespaceObject.store); 49124 let prevBlocks = getBlocks(patternClientId); 49125 return registry.subscribe(() => { 49126 const blocks = getBlocks(patternClientId); 49127 if (blocks !== prevBlocks) { 49128 prevBlocks = blocks; 49129 syncDerivedUpdates(() => { 49130 setAttributes({ 49131 content: getContentValuesFromInnerBlocks(blocks, defaultContent.current, legacyIdMap.current) 49132 }); 49133 }); 49134 } 49135 }, external_wp_blockEditor_namespaceObject.store); 49136 }, [hasPatternOverridesSource, syncDerivedUpdates, patternClientId, registry, setAttributes]); 49137 const handleEditOriginal = () => { 49138 onNavigateToEntityRecord({ 49139 postId: ref, 49140 postType: 'wp_block' 49141 }); 49142 }; 49143 const resetContent = () => { 49144 if (content) { 49145 replaceInnerBlocks(patternClientId, initialBlocks); 49146 } 49147 }; 49148 let children = null; 49149 if (isMissing) { 49150 children = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')); 49151 } 49152 if (!hasResolved) { 49153 children = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)); 49154 } 49155 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, userCanEdit && onNavigateToEntityRecord && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 49156 onClick: handleEditOriginal 49157 }, (0,external_wp_i18n_namespaceObject.__)('Edit original')))), canOverrideBlocks && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 49158 onClick: resetContent, 49159 disabled: !content, 49160 __experimentalIsFocusable: true 49161 }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), children === null ? (0,external_React_namespaceObject.createElement)("div", { 49162 ...innerBlocksProps 49163 }) : (0,external_React_namespaceObject.createElement)("div", { 49164 ...blockProps 49165 }, children)); 49166 } 49167 49168 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/deprecated.js 49169 const isObject = obj => typeof obj === 'object' && !Array.isArray(obj) && obj !== null; 49170 49171 // v2: Migrate to a more condensed version of the 'content' attribute attribute. 49172 const block_deprecated_v2 = { 49173 attributes: { 49174 ref: { 49175 type: 'number' 49176 }, 49177 content: { 49178 type: 'object' 49179 } 49180 }, 49181 supports: { 49182 customClassName: false, 49183 html: false, 49184 inserter: false, 49185 renaming: false 49186 }, 49187 // Force this deprecation to run whenever there's a values sub-property that's an object. 49188 // 49189 // This could fail in the future if a block ever has binding to a `values` attribute. 49190 // Some extra protection is added to ensure `values` is an object, but this only reduces 49191 // the likelihood, it doesn't solve it completely. 49192 isEligible({ 49193 content 49194 }) { 49195 return !!content && Object.keys(content).every(contentKey => content[contentKey].values && isObject(content[contentKey].values)); 49196 }, 49197 /* 49198 * Old attribute format: 49199 * content: { 49200 * "V98q_x": { 49201 * // The attribute values are now stored as a 'values' sub-property. 49202 * values: { content: 'My content value' }, 49203 * // ... additional metadata, like the block name can be stored here. 49204 * } 49205 * } 49206 * 49207 * New attribute format: 49208 * content: { 49209 * "V98q_x": { 49210 * content: 'My content value', 49211 * } 49212 * } 49213 */ 49214 migrate(attributes) { 49215 const { 49216 content, 49217 ...retainedAttributes 49218 } = attributes; 49219 if (content && Object.keys(content).length) { 49220 const updatedContent = { 49221 ...content 49222 }; 49223 for (const contentKey in content) { 49224 updatedContent[contentKey] = content[contentKey].values; 49225 } 49226 return { 49227 ...retainedAttributes, 49228 content: updatedContent 49229 }; 49230 } 49231 return attributes; 49232 } 49233 }; 49234 49235 // v1: Rename the `overrides` attribute to the `content` attribute. 49236 const block_deprecated_v1 = { 49237 attributes: { 49238 ref: { 49239 type: 'number' 49240 }, 49241 overrides: { 49242 type: 'object' 49243 } 49244 }, 49245 supports: { 49246 customClassName: false, 49247 html: false, 49248 inserter: false, 49249 renaming: false 49250 }, 49251 // Force this deprecation to run whenever there's an `overrides` object. 49252 isEligible({ 49253 overrides 49254 }) { 49255 return !!overrides; 49256 }, 49257 /* 49258 * Old attribute format: 49259 * overrides: { 49260 * // An key is an id that represents a block. 49261 * // The values are the attribute values of the block. 49262 * "V98q_x": { content: 'My content value' } 49263 * } 49264 * 49265 * New attribute format: 49266 * content: { 49267 * "V98q_x": { content: 'My content value' } 49268 * } 49269 * 49270 */ 49271 migrate(attributes) { 49272 const { 49273 overrides, 49274 ...retainedAttributes 49275 } = attributes; 49276 const content = {}; 49277 Object.keys(overrides).forEach(id => { 49278 content[id] = overrides[id]; 49279 }); 49280 return { 49281 ...retainedAttributes, 49282 content 49283 }; 49284 } 49285 }; 49286 /* harmony default export */ const block_deprecated = ([block_deprecated_v2, block_deprecated_v1]); 49287 49288 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js 49289 /** 49290 * WordPress dependencies 49291 */ 49292 49293 49294 49295 49296 49297 /** 49298 * Internal dependencies 49299 */ 49300 49301 const block_metadata = { 49302 $schema: "https://schemas.wp.org/trunk/block.json", 49303 apiVersion: 3, 49304 name: "core/block", 49305 title: "Pattern", 49306 category: "reusable", 49307 description: "Reuse this design across your site.", 49308 keywords: ["reusable"], 49309 textdomain: "default", 49310 attributes: { 49311 ref: { 49312 type: "number" 49313 }, 49314 content: { 49315 type: "object" 49316 } 49317 }, 49318 supports: { 49319 customClassName: false, 49320 html: false, 49321 inserter: false, 49322 renaming: false, 49323 interactivity: { 49324 clientNavigation: true 49325 } 49326 } 49327 }; 49328 49329 49330 const { 49331 name: block_name 49332 } = block_metadata; 49333 49334 const block_settings = { 49335 deprecated: block_deprecated, 49336 edit: ReusableBlockEditRecursionWrapper, 49337 icon: library_symbol, 49338 __experimentalLabel: ({ 49339 ref 49340 }) => { 49341 if (!ref) { 49342 return; 49343 } 49344 const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_block', ref); 49345 if (!entity?.title) { 49346 return; 49347 } 49348 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title); 49349 } 49350 }; 49351 const block_init = () => initBlock({ 49352 name: block_name, 49353 metadata: block_metadata, 49354 settings: block_settings 49355 }); 49356 49357 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/edit.js 49358 49359 /** 49360 * WordPress dependencies 49361 */ 49362 49363 49364 49365 49366 function ReadMore({ 49367 attributes: { 49368 content, 49369 linkTarget 49370 }, 49371 setAttributes, 49372 insertBlocksAfter 49373 }) { 49374 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 49375 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 49376 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 49377 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 49378 __nextHasNoMarginBottom: true, 49379 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 49380 onChange: value => setAttributes({ 49381 linkTarget: value ? '_blank' : '_self' 49382 }), 49383 checked: linkTarget === '_blank' 49384 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 49385 tagName: "a", 49386 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 49387 placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'), 49388 value: content, 49389 onChange: newValue => setAttributes({ 49390 content: newValue 49391 }), 49392 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 49393 withoutInteractiveFormatting: true, 49394 ...blockProps 49395 })); 49396 } 49397 49398 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/index.js 49399 /** 49400 * WordPress dependencies 49401 */ 49402 49403 49404 /** 49405 * Internal dependencies 49406 */ 49407 49408 const read_more_metadata = { 49409 $schema: "https://schemas.wp.org/trunk/block.json", 49410 apiVersion: 3, 49411 name: "core/read-more", 49412 title: "Read More", 49413 category: "theme", 49414 description: "Displays the link of a post, page, or any other content-type.", 49415 textdomain: "default", 49416 attributes: { 49417 content: { 49418 type: "string" 49419 }, 49420 linkTarget: { 49421 type: "string", 49422 "default": "_self" 49423 } 49424 }, 49425 usesContext: ["postId"], 49426 supports: { 49427 html: false, 49428 color: { 49429 gradients: true, 49430 text: true 49431 }, 49432 typography: { 49433 fontSize: true, 49434 lineHeight: true, 49435 __experimentalFontFamily: true, 49436 __experimentalFontWeight: true, 49437 __experimentalFontStyle: true, 49438 __experimentalTextTransform: true, 49439 __experimentalLetterSpacing: true, 49440 __experimentalTextDecoration: true, 49441 __experimentalDefaultControls: { 49442 fontSize: true, 49443 textDecoration: true 49444 } 49445 }, 49446 spacing: { 49447 margin: ["top", "bottom"], 49448 padding: true, 49449 __experimentalDefaultControls: { 49450 padding: true 49451 } 49452 }, 49453 __experimentalBorder: { 49454 color: true, 49455 radius: true, 49456 width: true, 49457 __experimentalDefaultControls: { 49458 width: true 49459 } 49460 }, 49461 interactivity: { 49462 clientNavigation: true 49463 } 49464 }, 49465 style: "wp-block-read-more" 49466 }; 49467 49468 const { 49469 name: read_more_name 49470 } = read_more_metadata; 49471 49472 const read_more_settings = { 49473 icon: library_link, 49474 edit: ReadMore 49475 }; 49476 const read_more_init = () => initBlock({ 49477 name: read_more_name, 49478 metadata: read_more_metadata, 49479 settings: read_more_settings 49480 }); 49481 49482 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js 49483 49484 /** 49485 * WordPress dependencies 49486 */ 49487 49488 const rss = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 49489 xmlns: "http://www.w3.org/2000/svg", 49490 viewBox: "0 0 24 24" 49491 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 49492 d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z" 49493 })); 49494 /* harmony default export */ const library_rss = (rss); 49495 49496 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js 49497 49498 /** 49499 * WordPress dependencies 49500 */ 49501 49502 49503 49504 49505 49506 49507 49508 const DEFAULT_MIN_ITEMS = 1; 49509 const DEFAULT_MAX_ITEMS = 20; 49510 function RSSEdit({ 49511 attributes, 49512 setAttributes 49513 }) { 49514 const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL); 49515 const { 49516 blockLayout, 49517 columns, 49518 displayAuthor, 49519 displayDate, 49520 displayExcerpt, 49521 excerptLength, 49522 feedURL, 49523 itemsToShow 49524 } = attributes; 49525 function toggleAttribute(propName) { 49526 return () => { 49527 const value = attributes[propName]; 49528 setAttributes({ 49529 [propName]: !value 49530 }); 49531 }; 49532 } 49533 function onSubmitURL(event) { 49534 event.preventDefault(); 49535 if (feedURL) { 49536 setAttributes({ 49537 feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL) 49538 }); 49539 setIsEditing(false); 49540 } 49541 } 49542 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 49543 if (isEditing) { 49544 return (0,external_React_namespaceObject.createElement)("div", { 49545 ...blockProps 49546 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 49547 icon: library_rss, 49548 label: "RSS" 49549 }, (0,external_React_namespaceObject.createElement)("form", { 49550 onSubmit: onSubmitURL, 49551 className: "wp-block-rss__placeholder-form" 49552 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 49553 wrap: true 49554 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalInputControl, { 49555 __next40pxDefaultSize: true, 49556 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'), 49557 value: feedURL, 49558 onChange: value => setAttributes({ 49559 feedURL: value 49560 }), 49561 className: "wp-block-rss__placeholder-input" 49562 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 49563 __next40pxDefaultSize: true, 49564 variant: "primary", 49565 type: "submit" 49566 }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))))); 49567 } 49568 const toolbarControls = [{ 49569 icon: library_edit, 49570 title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'), 49571 onClick: () => setIsEditing(true) 49572 }, { 49573 icon: library_list, 49574 title: (0,external_wp_i18n_namespaceObject.__)('List view'), 49575 onClick: () => setAttributes({ 49576 blockLayout: 'list' 49577 }), 49578 isActive: blockLayout === 'list' 49579 }, { 49580 icon: library_grid, 49581 title: (0,external_wp_i18n_namespaceObject.__)('Grid view'), 49582 onClick: () => setAttributes({ 49583 blockLayout: 'grid' 49584 }), 49585 isActive: blockLayout === 'grid' 49586 }]; 49587 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, { 49588 controls: toolbarControls 49589 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 49590 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 49591 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 49592 __nextHasNoMarginBottom: true, 49593 __next40pxDefaultSize: true, 49594 label: (0,external_wp_i18n_namespaceObject.__)('Number of items'), 49595 value: itemsToShow, 49596 onChange: value => setAttributes({ 49597 itemsToShow: value 49598 }), 49599 min: DEFAULT_MIN_ITEMS, 49600 max: DEFAULT_MAX_ITEMS, 49601 required: true 49602 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 49603 __nextHasNoMarginBottom: true, 49604 label: (0,external_wp_i18n_namespaceObject.__)('Display author'), 49605 checked: displayAuthor, 49606 onChange: toggleAttribute('displayAuthor') 49607 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 49608 __nextHasNoMarginBottom: true, 49609 label: (0,external_wp_i18n_namespaceObject.__)('Display date'), 49610 checked: displayDate, 49611 onChange: toggleAttribute('displayDate') 49612 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 49613 __nextHasNoMarginBottom: true, 49614 label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), 49615 checked: displayExcerpt, 49616 onChange: toggleAttribute('displayExcerpt') 49617 }), displayExcerpt && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 49618 __nextHasNoMarginBottom: true, 49619 __next40pxDefaultSize: true, 49620 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'), 49621 value: excerptLength, 49622 onChange: value => setAttributes({ 49623 excerptLength: value 49624 }), 49625 min: 10, 49626 max: 100, 49627 required: true 49628 }), blockLayout === 'grid' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 49629 __nextHasNoMarginBottom: true, 49630 __next40pxDefaultSize: true, 49631 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 49632 value: columns, 49633 onChange: value => setAttributes({ 49634 columns: value 49635 }), 49636 min: 2, 49637 max: 6, 49638 required: true 49639 }))), (0,external_React_namespaceObject.createElement)("div", { 49640 ...blockProps 49641 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)((external_wp_serverSideRender_default()), { 49642 block: "core/rss", 49643 attributes: attributes 49644 })))); 49645 } 49646 49647 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js 49648 /** 49649 * WordPress dependencies 49650 */ 49651 49652 49653 /** 49654 * Internal dependencies 49655 */ 49656 49657 const rss_metadata = { 49658 $schema: "https://schemas.wp.org/trunk/block.json", 49659 apiVersion: 3, 49660 name: "core/rss", 49661 title: "RSS", 49662 category: "widgets", 49663 description: "Display entries from any RSS or Atom feed.", 49664 keywords: ["atom", "feed"], 49665 textdomain: "default", 49666 attributes: { 49667 columns: { 49668 type: "number", 49669 "default": 2 49670 }, 49671 blockLayout: { 49672 type: "string", 49673 "default": "list" 49674 }, 49675 feedURL: { 49676 type: "string", 49677 "default": "" 49678 }, 49679 itemsToShow: { 49680 type: "number", 49681 "default": 5 49682 }, 49683 displayExcerpt: { 49684 type: "boolean", 49685 "default": false 49686 }, 49687 displayAuthor: { 49688 type: "boolean", 49689 "default": false 49690 }, 49691 displayDate: { 49692 type: "boolean", 49693 "default": false 49694 }, 49695 excerptLength: { 49696 type: "number", 49697 "default": 55 49698 } 49699 }, 49700 supports: { 49701 align: true, 49702 html: false, 49703 interactivity: { 49704 clientNavigation: true 49705 } 49706 }, 49707 editorStyle: "wp-block-rss-editor", 49708 style: "wp-block-rss" 49709 }; 49710 49711 const { 49712 name: rss_name 49713 } = rss_metadata; 49714 49715 const rss_settings = { 49716 icon: library_rss, 49717 example: { 49718 attributes: { 49719 feedURL: 'https://wordpress.org' 49720 } 49721 }, 49722 edit: RSSEdit 49723 }; 49724 const rss_init = () => initBlock({ 49725 name: rss_name, 49726 metadata: rss_metadata, 49727 settings: rss_settings 49728 }); 49729 49730 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js 49731 49732 /** 49733 * WordPress dependencies 49734 */ 49735 49736 const search = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 49737 xmlns: "http://www.w3.org/2000/svg", 49738 viewBox: "0 0 24 24" 49739 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 49740 d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" 49741 })); 49742 /* harmony default export */ const library_search = (search); 49743 49744 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js 49745 49746 /** 49747 * WordPress dependencies 49748 */ 49749 49750 const buttonOnly = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49751 xmlns: "http://www.w3.org/2000/svg", 49752 viewBox: "0 0 24 24" 49753 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49754 x: "7", 49755 y: "10", 49756 width: "10", 49757 height: "4", 49758 rx: "1", 49759 fill: "currentColor" 49760 })); 49761 const buttonOutside = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49762 xmlns: "http://www.w3.org/2000/svg", 49763 viewBox: "0 0 24 24" 49764 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49765 x: "4.75", 49766 y: "15.25", 49767 width: "6.5", 49768 height: "9.5", 49769 transform: "rotate(-90 4.75 15.25)", 49770 stroke: "currentColor", 49771 strokeWidth: "1.5", 49772 fill: "none" 49773 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49774 x: "16", 49775 y: "10", 49776 width: "4", 49777 height: "4", 49778 rx: "1", 49779 fill: "currentColor" 49780 })); 49781 const buttonInside = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49782 xmlns: "http://www.w3.org/2000/svg", 49783 viewBox: "0 0 24 24" 49784 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49785 x: "4.75", 49786 y: "15.25", 49787 width: "6.5", 49788 height: "14.5", 49789 transform: "rotate(-90 4.75 15.25)", 49790 stroke: "currentColor", 49791 strokeWidth: "1.5", 49792 fill: "none" 49793 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49794 x: "14", 49795 y: "10", 49796 width: "4", 49797 height: "4", 49798 rx: "1", 49799 fill: "currentColor" 49800 })); 49801 const noButton = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49802 xmlns: "http://www.w3.org/2000/svg", 49803 viewBox: "0 0 24 24" 49804 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49805 x: "4.75", 49806 y: "15.25", 49807 width: "6.5", 49808 height: "14.5", 49809 transform: "rotate(-90 4.75 15.25)", 49810 stroke: "currentColor", 49811 fill: "none", 49812 strokeWidth: "1.5" 49813 })); 49814 const buttonWithIcon = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49815 xmlns: "http://www.w3.org/2000/svg", 49816 viewBox: "0 0 24 24" 49817 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49818 x: "4.75", 49819 y: "7.75", 49820 width: "14.5", 49821 height: "8.5", 49822 rx: "1.25", 49823 stroke: "currentColor", 49824 fill: "none", 49825 strokeWidth: "1.5" 49826 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49827 x: "8", 49828 y: "11", 49829 width: "8", 49830 height: "2", 49831 fill: "currentColor" 49832 })); 49833 const toggleLabel = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 49834 xmlns: "http://www.w3.org/2000/svg", 49835 viewBox: "0 0 24 24" 49836 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49837 x: "4.75", 49838 y: "17.25", 49839 width: "5.5", 49840 height: "14.5", 49841 transform: "rotate(-90 4.75 17.25)", 49842 stroke: "currentColor", 49843 fill: "none", 49844 strokeWidth: "1.5" 49845 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, { 49846 x: "4", 49847 y: "7", 49848 width: "10", 49849 height: "2", 49850 fill: "currentColor" 49851 })); 49852 49853 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js 49854 /** 49855 * Constants 49856 */ 49857 const PC_WIDTH_DEFAULT = 50; 49858 const PX_WIDTH_DEFAULT = 350; 49859 const MIN_WIDTH = 220; 49860 49861 /** 49862 * Returns a boolean whether passed unit is percentage 49863 * 49864 * @param {string} unit Block width unit. 49865 * 49866 * @return {boolean} Whether unit is '%'. 49867 */ 49868 function utils_isPercentageUnit(unit) { 49869 return unit === '%'; 49870 } 49871 49872 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js 49873 49874 /** 49875 * External dependencies 49876 */ 49877 49878 49879 /** 49880 * WordPress dependencies 49881 */ 49882 49883 49884 49885 49886 49887 49888 49889 49890 49891 /** 49892 * Internal dependencies 49893 */ 49894 49895 49896 49897 // Used to calculate border radius adjustment to avoid "fat" corners when 49898 // button is placed inside wrapper. 49899 const DEFAULT_INNER_PADDING = '4px'; 49900 function SearchEdit({ 49901 className, 49902 attributes, 49903 setAttributes, 49904 toggleSelection, 49905 isSelected, 49906 clientId 49907 }) { 49908 const { 49909 label, 49910 showLabel, 49911 placeholder, 49912 width, 49913 widthUnit, 49914 align, 49915 buttonText, 49916 buttonPosition, 49917 buttonUseIcon, 49918 isSearchFieldHidden, 49919 style 49920 } = attributes; 49921 const wasJustInsertedIntoNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => { 49922 const { 49923 getBlockParentsByBlockName, 49924 wasBlockJustInserted 49925 } = select(external_wp_blockEditor_namespaceObject.store); 49926 return !!getBlockParentsByBlockName(clientId, 'core/navigation')?.length && wasBlockJustInserted(clientId); 49927 }, [clientId]); 49928 const { 49929 __unstableMarkNextChangeAsNotPersistent 49930 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 49931 (0,external_wp_element_namespaceObject.useEffect)(() => { 49932 if (wasJustInsertedIntoNavigationBlock) { 49933 // This side-effect should not create an undo level. 49934 __unstableMarkNextChangeAsNotPersistent(); 49935 setAttributes({ 49936 showLabel: false, 49937 buttonUseIcon: true, 49938 buttonPosition: 'button-inside' 49939 }); 49940 } 49941 }, [__unstableMarkNextChangeAsNotPersistent, wasJustInsertedIntoNavigationBlock, setAttributes]); 49942 const borderRadius = style?.border?.radius; 49943 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 49944 49945 // Check for old deprecated numerical border radius. Done as a separate 49946 // check so that a borderRadius style won't overwrite the longhand 49947 // per-corner styles. 49948 if (typeof borderRadius === 'number') { 49949 borderProps.style.borderRadius = `$borderRadius}px`; 49950 } 49951 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 49952 const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); 49953 const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { 49954 typography: { 49955 fluid: fluidTypographySettings 49956 }, 49957 layout: { 49958 wideSize: layout?.wideSize 49959 } 49960 }); 49961 const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); 49962 const unitControlInputId = `wp-block-search__width-$unitControlInstanceId}`; 49963 const isButtonPositionInside = 'button-inside' === buttonPosition; 49964 const isButtonPositionOutside = 'button-outside' === buttonPosition; 49965 const hasNoButton = 'no-button' === buttonPosition; 49966 const hasOnlyButton = 'button-only' === buttonPosition; 49967 const searchFieldRef = (0,external_wp_element_namespaceObject.useRef)(); 49968 const buttonRef = (0,external_wp_element_namespaceObject.useRef)(); 49969 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 49970 availableUnits: ['%', 'px'], 49971 defaultValues: { 49972 '%': PC_WIDTH_DEFAULT, 49973 px: PX_WIDTH_DEFAULT 49974 } 49975 }); 49976 (0,external_wp_element_namespaceObject.useEffect)(() => { 49977 if (hasOnlyButton && !isSelected) { 49978 setAttributes({ 49979 isSearchFieldHidden: true 49980 }); 49981 } 49982 }, [hasOnlyButton, isSelected, setAttributes]); 49983 49984 // Show the search field when width changes. 49985 (0,external_wp_element_namespaceObject.useEffect)(() => { 49986 if (!hasOnlyButton || !isSelected) { 49987 return; 49988 } 49989 setAttributes({ 49990 isSearchFieldHidden: false 49991 }); 49992 }, [hasOnlyButton, isSelected, setAttributes, width]); 49993 const getBlockClassNames = () => { 49994 return classnames_default()(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined, hasOnlyButton && isSearchFieldHidden ? 'wp-block-search__searchfield-hidden' : undefined); 49995 }; 49996 const buttonPositionControls = [{ 49997 role: 'menuitemradio', 49998 title: (0,external_wp_i18n_namespaceObject.__)('Button outside'), 49999 isActive: buttonPosition === 'button-outside', 50000 icon: buttonOutside, 50001 onClick: () => { 50002 setAttributes({ 50003 buttonPosition: 'button-outside', 50004 isSearchFieldHidden: false 50005 }); 50006 } 50007 }, { 50008 role: 'menuitemradio', 50009 title: (0,external_wp_i18n_namespaceObject.__)('Button inside'), 50010 isActive: buttonPosition === 'button-inside', 50011 icon: buttonInside, 50012 onClick: () => { 50013 setAttributes({ 50014 buttonPosition: 'button-inside', 50015 isSearchFieldHidden: false 50016 }); 50017 } 50018 }, { 50019 role: 'menuitemradio', 50020 title: (0,external_wp_i18n_namespaceObject.__)('No button'), 50021 isActive: buttonPosition === 'no-button', 50022 icon: noButton, 50023 onClick: () => { 50024 setAttributes({ 50025 buttonPosition: 'no-button', 50026 isSearchFieldHidden: false 50027 }); 50028 } 50029 }, { 50030 role: 'menuitemradio', 50031 title: (0,external_wp_i18n_namespaceObject.__)('Button only'), 50032 isActive: buttonPosition === 'button-only', 50033 icon: buttonOnly, 50034 onClick: () => { 50035 setAttributes({ 50036 buttonPosition: 'button-only', 50037 isSearchFieldHidden: true 50038 }); 50039 } 50040 }]; 50041 const getButtonPositionIcon = () => { 50042 switch (buttonPosition) { 50043 case 'button-inside': 50044 return buttonInside; 50045 case 'button-outside': 50046 return buttonOutside; 50047 case 'no-button': 50048 return noButton; 50049 case 'button-only': 50050 return buttonOnly; 50051 } 50052 }; 50053 const getResizableSides = () => { 50054 if (hasOnlyButton) { 50055 return {}; 50056 } 50057 return { 50058 right: align !== 'right', 50059 left: align === 'right' 50060 }; 50061 }; 50062 const renderTextField = () => { 50063 // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control. 50064 const textFieldClasses = classnames_default()('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className); 50065 const textFieldStyles = { 50066 ...(isButtonPositionInside ? { 50067 borderRadius 50068 } : borderProps.style), 50069 ...typographyProps.style, 50070 textDecoration: undefined 50071 }; 50072 return (0,external_React_namespaceObject.createElement)("input", { 50073 type: "search", 50074 className: textFieldClasses, 50075 style: textFieldStyles, 50076 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') 50077 // We hide the placeholder field's placeholder when there is a value. This 50078 // stops screen readers from reading the placeholder field's placeholder 50079 // which is confusing. 50080 , 50081 placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), 50082 value: placeholder, 50083 onChange: event => setAttributes({ 50084 placeholder: event.target.value 50085 }), 50086 ref: searchFieldRef 50087 }); 50088 }; 50089 const renderButton = () => { 50090 // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button. 50091 const buttonClasses = classnames_default()('wp-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); 50092 const buttonStyles = { 50093 ...colorProps.style, 50094 ...typographyProps.style, 50095 ...(isButtonPositionInside ? { 50096 borderRadius 50097 } : borderProps.style) 50098 }; 50099 const handleButtonClick = () => { 50100 if (hasOnlyButton) { 50101 setAttributes({ 50102 isSearchFieldHidden: !isSearchFieldHidden 50103 }); 50104 } 50105 }; 50106 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, buttonUseIcon && (0,external_React_namespaceObject.createElement)("button", { 50107 type: "button", 50108 className: buttonClasses, 50109 style: buttonStyles, 50110 "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search'), 50111 onClick: handleButtonClick, 50112 ref: buttonRef 50113 }, (0,external_React_namespaceObject.createElement)(build_module_icon, { 50114 icon: library_search 50115 })), !buttonUseIcon && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 50116 className: buttonClasses, 50117 style: buttonStyles, 50118 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), 50119 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'), 50120 withoutInteractiveFormatting: true, 50121 value: buttonText, 50122 onChange: html => setAttributes({ 50123 buttonText: html 50124 }), 50125 onClick: handleButtonClick 50126 })); 50127 }; 50128 const controls = (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 50129 title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'), 50130 icon: toggleLabel, 50131 onClick: () => { 50132 setAttributes({ 50133 showLabel: !showLabel 50134 }); 50135 }, 50136 className: showLabel ? 'is-pressed' : undefined 50137 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 50138 icon: getButtonPositionIcon(), 50139 label: (0,external_wp_i18n_namespaceObject.__)('Change button position'), 50140 controls: buttonPositionControls 50141 }), !hasNoButton && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 50142 title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'), 50143 icon: buttonWithIcon, 50144 onClick: () => { 50145 setAttributes({ 50146 buttonUseIcon: !buttonUseIcon 50147 }); 50148 }, 50149 className: buttonUseIcon ? 'is-pressed' : undefined 50150 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 50151 title: (0,external_wp_i18n_namespaceObject.__)('Display Settings') 50152 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 50153 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 50154 id: unitControlInputId 50155 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 50156 id: unitControlInputId, 50157 min: utils_isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH, 50158 max: utils_isPercentageUnit(widthUnit) ? 100 : undefined, 50159 step: 1, 50160 onChange: newWidth => { 50161 const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth; 50162 setAttributes({ 50163 width: parseInt(filteredWidth, 10) 50164 }); 50165 }, 50166 onUnitChange: newUnit => { 50167 setAttributes({ 50168 width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT, 50169 widthUnit: newUnit 50170 }); 50171 }, 50172 __unstableInputWidth: '80px', 50173 value: `$width}$widthUnit}`, 50174 units: units 50175 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, { 50176 className: "wp-block-search__components-button-group", 50177 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage Width') 50178 }, [25, 50, 75, 100].map(widthValue => { 50179 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 50180 key: widthValue, 50181 size: "small", 50182 variant: widthValue === width && widthUnit === '%' ? 'primary' : undefined, 50183 onClick: () => setAttributes({ 50184 width: widthValue, 50185 widthUnit: '%' 50186 }) 50187 }, widthValue, "%"); 50188 })))))); 50189 const padBorderRadius = radius => radius ? `calc($radius} + $DEFAULT_INNER_PADDING})` : undefined; 50190 const getWrapperStyles = () => { 50191 const styles = isButtonPositionInside ? borderProps.style : { 50192 borderRadius: borderProps.style?.borderRadius, 50193 borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, 50194 borderTopRightRadius: borderProps.style?.borderTopRightRadius, 50195 borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, 50196 borderBottomRightRadius: borderProps.style?.borderBottomRightRadius 50197 }; 50198 const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0; 50199 if (isButtonPositionInside && isNonZeroBorderRadius) { 50200 // We have button inside wrapper and a border radius value to apply. 50201 // Add default padding so we don't get "fat" corners. 50202 // 50203 // CSS calc() is used here to support non-pixel units. The inline 50204 // style using calc() will only apply if both values have units. 50205 50206 if (typeof borderRadius === 'object') { 50207 // Individual corner border radii present. 50208 const { 50209 topLeft, 50210 topRight, 50211 bottomLeft, 50212 bottomRight 50213 } = borderRadius; 50214 return { 50215 ...styles, 50216 borderTopLeftRadius: padBorderRadius(topLeft), 50217 borderTopRightRadius: padBorderRadius(topRight), 50218 borderBottomLeftRadius: padBorderRadius(bottomLeft), 50219 borderBottomRightRadius: padBorderRadius(bottomRight) 50220 }; 50221 } 50222 50223 // The inline style using calc() will only apply if both values 50224 // supplied to calc() have units. Deprecated block's may have 50225 // unitless integer. 50226 const radius = Number.isInteger(borderRadius) ? `$borderRadius}px` : borderRadius; 50227 styles.borderRadius = `calc($radius} + $DEFAULT_INNER_PADDING})`; 50228 } 50229 return styles; 50230 }; 50231 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 50232 className: getBlockClassNames(), 50233 style: { 50234 ...typographyProps.style, 50235 // Input opts out of text decoration. 50236 textDecoration: undefined 50237 } 50238 }); 50239 const labelClassnames = classnames_default()('wp-block-search__label', typographyProps.className); 50240 return (0,external_React_namespaceObject.createElement)("div", { 50241 ...blockProps 50242 }, controls, showLabel && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 50243 className: labelClassnames, 50244 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), 50245 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'), 50246 withoutInteractiveFormatting: true, 50247 value: label, 50248 onChange: html => setAttributes({ 50249 label: html 50250 }), 50251 style: typographyProps.style 50252 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 50253 size: { 50254 width: `$width}$widthUnit}` 50255 }, 50256 className: classnames_default()('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined), 50257 style: getWrapperStyles(), 50258 minWidth: MIN_WIDTH, 50259 enable: getResizableSides(), 50260 onResizeStart: (event, direction, elt) => { 50261 setAttributes({ 50262 width: parseInt(elt.offsetWidth, 10), 50263 widthUnit: 'px' 50264 }); 50265 toggleSelection(false); 50266 }, 50267 onResizeStop: (event, direction, elt, delta) => { 50268 setAttributes({ 50269 width: parseInt(width + delta.width, 10) 50270 }); 50271 toggleSelection(true); 50272 }, 50273 showHandle: isSelected 50274 }, (isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasNoButton && renderTextField())); 50275 } 50276 50277 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js 50278 /** 50279 * WordPress dependencies 50280 */ 50281 50282 const search_variations_variations = [{ 50283 name: 'default', 50284 isDefault: true, 50285 attributes: { 50286 buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), 50287 label: (0,external_wp_i18n_namespaceObject.__)('Search') 50288 } 50289 }]; 50290 /* harmony default export */ const search_variations = (search_variations_variations); 50291 50292 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js 50293 /** 50294 * WordPress dependencies 50295 */ 50296 50297 50298 50299 /** 50300 * Internal dependencies 50301 */ 50302 50303 const search_metadata = { 50304 $schema: "https://schemas.wp.org/trunk/block.json", 50305 apiVersion: 3, 50306 name: "core/search", 50307 title: "Search", 50308 category: "widgets", 50309 description: "Help visitors find your content.", 50310 keywords: ["find"], 50311 textdomain: "default", 50312 attributes: { 50313 label: { 50314 type: "string", 50315 __experimentalRole: "content" 50316 }, 50317 showLabel: { 50318 type: "boolean", 50319 "default": true 50320 }, 50321 placeholder: { 50322 type: "string", 50323 "default": "", 50324 __experimentalRole: "content" 50325 }, 50326 width: { 50327 type: "number" 50328 }, 50329 widthUnit: { 50330 type: "string" 50331 }, 50332 buttonText: { 50333 type: "string", 50334 __experimentalRole: "content" 50335 }, 50336 buttonPosition: { 50337 type: "string", 50338 "default": "button-outside" 50339 }, 50340 buttonUseIcon: { 50341 type: "boolean", 50342 "default": false 50343 }, 50344 query: { 50345 type: "object", 50346 "default": {} 50347 }, 50348 isSearchFieldHidden: { 50349 type: "boolean", 50350 "default": false 50351 } 50352 }, 50353 supports: { 50354 align: ["left", "center", "right"], 50355 color: { 50356 gradients: true, 50357 __experimentalSkipSerialization: true, 50358 __experimentalDefaultControls: { 50359 background: true, 50360 text: true 50361 } 50362 }, 50363 interactivity: true, 50364 typography: { 50365 __experimentalSkipSerialization: true, 50366 __experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button", 50367 fontSize: true, 50368 lineHeight: true, 50369 __experimentalFontFamily: true, 50370 __experimentalFontWeight: true, 50371 __experimentalFontStyle: true, 50372 __experimentalTextTransform: true, 50373 __experimentalTextDecoration: true, 50374 __experimentalLetterSpacing: true, 50375 __experimentalDefaultControls: { 50376 fontSize: true 50377 } 50378 }, 50379 __experimentalBorder: { 50380 color: true, 50381 radius: true, 50382 width: true, 50383 __experimentalSkipSerialization: true, 50384 __experimentalDefaultControls: { 50385 color: true, 50386 radius: true, 50387 width: true 50388 } 50389 }, 50390 html: false 50391 }, 50392 editorStyle: "wp-block-search-editor", 50393 style: "wp-block-search" 50394 }; 50395 50396 50397 const { 50398 name: search_name 50399 } = search_metadata; 50400 50401 const search_settings = { 50402 icon: library_search, 50403 example: { 50404 attributes: { 50405 buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), 50406 label: (0,external_wp_i18n_namespaceObject.__)('Search') 50407 }, 50408 viewportWidth: 400 50409 }, 50410 variations: search_variations, 50411 edit: SearchEdit 50412 }; 50413 const search_init = () => initBlock({ 50414 name: search_name, 50415 metadata: search_metadata, 50416 settings: search_settings 50417 }); 50418 50419 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js 50420 50421 /** 50422 * WordPress dependencies 50423 */ 50424 50425 const separator = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 50426 viewBox: "0 0 24 24", 50427 xmlns: "http://www.w3.org/2000/svg" 50428 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 50429 d: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z" 50430 })); 50431 /* harmony default export */ const library_separator = (separator); 50432 50433 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js 50434 /** 50435 * WordPress dependencies 50436 */ 50437 50438 50439 function useDeprecatedOpacity(opacity, currentColor, setAttributes) { 50440 const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false); 50441 const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); 50442 50443 // A separator with no color set will always have previousColor set to undefined, 50444 // and we need to differentiate these from those with color set that will return 50445 // previousColor as undefined on the first render. 50446 (0,external_wp_element_namespaceObject.useEffect)(() => { 50447 if (opacity === 'css' && !currentColor && !previousColor) { 50448 setDeprecatedOpacityWithNoColor(true); 50449 } 50450 }, [currentColor, previousColor, opacity]); 50451 50452 // For deprecated blocks, that have a default 0.4 css opacity set, we 50453 // need to remove this if the current color is changed, or a color is added. 50454 // In these instances the opacity attribute is set back to the default of 50455 // alpha-channel which allows a new custom opacity to be set via the color picker. 50456 (0,external_wp_element_namespaceObject.useEffect)(() => { 50457 if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) { 50458 setAttributes({ 50459 opacity: 'alpha-channel' 50460 }); 50461 setDeprecatedOpacityWithNoColor(false); 50462 } 50463 }, [deprecatedOpacityWithNoColor, currentColor, previousColor]); 50464 } 50465 50466 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js 50467 50468 /** 50469 * External dependencies 50470 */ 50471 50472 50473 /** 50474 * WordPress dependencies 50475 */ 50476 50477 50478 50479 /** 50480 * Internal dependencies 50481 */ 50482 50483 function SeparatorEdit({ 50484 attributes, 50485 setAttributes 50486 }) { 50487 const { 50488 backgroundColor, 50489 opacity, 50490 style 50491 } = attributes; 50492 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 50493 const currentColor = colorProps?.style?.backgroundColor; 50494 const hasCustomColor = !!style?.color?.background; 50495 useDeprecatedOpacity(opacity, currentColor, setAttributes); 50496 50497 // The dots styles uses text for the dots, to change those dots color is 50498 // using color, not backgroundColor. 50499 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); 50500 const className = classnames_default()({ 50501 'has-text-color': backgroundColor || currentColor, 50502 [colorClass]: colorClass, 50503 'has-css-opacity': opacity === 'css', 50504 'has-alpha-channel-opacity': opacity === 'alpha-channel' 50505 }, colorProps.className); 50506 const styles = { 50507 color: currentColor, 50508 backgroundColor: currentColor 50509 }; 50510 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, { 50511 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 50512 className, 50513 style: hasCustomColor ? styles : undefined 50514 }) 50515 })); 50516 } 50517 50518 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js 50519 50520 /** 50521 * External dependencies 50522 */ 50523 50524 50525 /** 50526 * WordPress dependencies 50527 */ 50528 50529 function separatorSave({ 50530 attributes 50531 }) { 50532 const { 50533 backgroundColor, 50534 style, 50535 opacity 50536 } = attributes; 50537 const customColor = style?.color?.background; 50538 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 50539 // The hr support changing color using border-color, since border-color 50540 // is not yet supported in the color palette, we use background-color. 50541 50542 // The dots styles uses text for the dots, to change those dots color is 50543 // using color, not backgroundColor. 50544 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); 50545 const className = classnames_default()({ 50546 'has-text-color': backgroundColor || customColor, 50547 [colorClass]: colorClass, 50548 'has-css-opacity': opacity === 'css', 50549 'has-alpha-channel-opacity': opacity === 'alpha-channel' 50550 }, colorProps.className); 50551 const styles = { 50552 backgroundColor: colorProps?.style?.backgroundColor, 50553 color: colorClass ? undefined : customColor 50554 }; 50555 return (0,external_React_namespaceObject.createElement)("hr", { 50556 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 50557 className, 50558 style: styles 50559 }) 50560 }); 50561 } 50562 50563 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js 50564 /** 50565 * WordPress dependencies 50566 */ 50567 50568 const separator_transforms_transforms = { 50569 from: [{ 50570 type: 'enter', 50571 regExp: /^-{3,}$/, 50572 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator') 50573 }, { 50574 type: 'raw', 50575 selector: 'hr', 50576 schema: { 50577 hr: {} 50578 } 50579 }] 50580 }; 50581 /* harmony default export */ const separator_transforms = (separator_transforms_transforms); 50582 50583 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js 50584 50585 /** 50586 * External dependencies 50587 */ 50588 50589 50590 /** 50591 * WordPress dependencies 50592 */ 50593 50594 const separator_deprecated_v1 = { 50595 attributes: { 50596 color: { 50597 type: 'string' 50598 }, 50599 customColor: { 50600 type: 'string' 50601 } 50602 }, 50603 save({ 50604 attributes 50605 }) { 50606 const { 50607 color, 50608 customColor 50609 } = attributes; 50610 50611 // the hr support changing color using border-color, since border-color 50612 // is not yet supported in the color palette, we use background-color 50613 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); 50614 // the dots styles uses text for the dots, to change those dots color is 50615 // using color, not backgroundColor 50616 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color); 50617 const className = classnames_default()({ 50618 'has-text-color has-background': color || customColor, 50619 [backgroundClass]: backgroundClass, 50620 [colorClass]: colorClass 50621 }); 50622 const style = { 50623 backgroundColor: backgroundClass ? undefined : customColor, 50624 color: colorClass ? undefined : customColor 50625 }; 50626 return (0,external_React_namespaceObject.createElement)("hr", { 50627 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 50628 className, 50629 style 50630 }) 50631 }); 50632 }, 50633 migrate(attributes) { 50634 const { 50635 color, 50636 customColor, 50637 ...restAttributes 50638 } = attributes; 50639 return { 50640 ...restAttributes, 50641 backgroundColor: color ? color : undefined, 50642 opacity: 'css', 50643 style: customColor ? { 50644 color: { 50645 background: customColor 50646 } 50647 } : undefined 50648 }; 50649 } 50650 }; 50651 /* harmony default export */ const separator_deprecated = ([separator_deprecated_v1]); 50652 50653 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js 50654 /** 50655 * WordPress dependencies 50656 */ 50657 50658 50659 /** 50660 * Internal dependencies 50661 */ 50662 50663 50664 const separator_metadata = { 50665 $schema: "https://schemas.wp.org/trunk/block.json", 50666 apiVersion: 3, 50667 name: "core/separator", 50668 title: "Separator", 50669 category: "design", 50670 description: "Create a break between ideas or sections with a horizontal separator.", 50671 keywords: ["horizontal-line", "hr", "divider"], 50672 textdomain: "default", 50673 attributes: { 50674 opacity: { 50675 type: "string", 50676 "default": "alpha-channel" 50677 } 50678 }, 50679 supports: { 50680 anchor: true, 50681 align: ["center", "wide", "full"], 50682 color: { 50683 enableContrastChecker: false, 50684 __experimentalSkipSerialization: true, 50685 gradients: true, 50686 background: true, 50687 text: false, 50688 __experimentalDefaultControls: { 50689 background: true 50690 } 50691 }, 50692 spacing: { 50693 margin: ["top", "bottom"] 50694 }, 50695 interactivity: { 50696 clientNavigation: true 50697 } 50698 }, 50699 styles: [{ 50700 name: "default", 50701 label: "Default", 50702 isDefault: true 50703 }, { 50704 name: "wide", 50705 label: "Wide Line" 50706 }, { 50707 name: "dots", 50708 label: "Dots" 50709 }], 50710 editorStyle: "wp-block-separator-editor", 50711 style: "wp-block-separator" 50712 }; 50713 50714 50715 50716 const { 50717 name: separator_name 50718 } = separator_metadata; 50719 50720 const separator_settings = { 50721 icon: library_separator, 50722 example: { 50723 attributes: { 50724 customColor: '#065174', 50725 className: 'is-style-wide' 50726 } 50727 }, 50728 transforms: separator_transforms, 50729 edit: SeparatorEdit, 50730 save: separatorSave, 50731 deprecated: separator_deprecated 50732 }; 50733 const separator_init = () => initBlock({ 50734 name: separator_name, 50735 metadata: separator_metadata, 50736 settings: separator_settings 50737 }); 50738 50739 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js 50740 50741 /** 50742 * WordPress dependencies 50743 */ 50744 50745 const shortcode = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 50746 viewBox: "0 0 24 24", 50747 xmlns: "http://www.w3.org/2000/svg" 50748 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 50749 d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z" 50750 })); 50751 /* harmony default export */ const library_shortcode = (shortcode); 50752 50753 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js 50754 50755 /** 50756 * WordPress dependencies 50757 */ 50758 50759 50760 50761 50762 function ShortcodeEdit({ 50763 attributes, 50764 setAttributes 50765 }) { 50766 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit); 50767 const inputId = `blocks-shortcode-input-$instanceId}`; 50768 return (0,external_React_namespaceObject.createElement)("div", { 50769 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 50770 className: 'components-placeholder' 50771 }) 50772 }, (0,external_React_namespaceObject.createElement)("label", { 50773 htmlFor: inputId, 50774 className: "components-placeholder__label" 50775 }, (0,external_React_namespaceObject.createElement)(build_module_icon, { 50776 icon: library_shortcode 50777 }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, { 50778 className: "blocks-shortcode__textarea", 50779 id: inputId, 50780 value: attributes.text, 50781 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'), 50782 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'), 50783 onChange: text => setAttributes({ 50784 text 50785 }) 50786 })); 50787 } 50788 50789 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js 50790 50791 /** 50792 * WordPress dependencies 50793 */ 50794 50795 function shortcode_save_save({ 50796 attributes 50797 }) { 50798 return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text); 50799 } 50800 50801 ;// CONCATENATED MODULE: external ["wp","autop"] 50802 const external_wp_autop_namespaceObject = window["wp"]["autop"]; 50803 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js 50804 /** 50805 * WordPress dependencies 50806 */ 50807 50808 const shortcode_transforms_transforms = { 50809 from: [{ 50810 type: 'shortcode', 50811 // Per "Shortcode names should be all lowercase and use all 50812 // letters, but numbers and underscores should work fine too. 50813 // Be wary of using hyphens (dashes), you'll be better off not 50814 // using them." in https://codex.wordpress.org/Shortcode_API 50815 // Require that the first character be a letter. This notably 50816 // prevents footnote markings ([1]) from being caught as 50817 // shortcodes. 50818 tag: '[a-z][a-z0-9_-]*', 50819 attributes: { 50820 text: { 50821 type: 'string', 50822 shortcode: (attrs, { 50823 content 50824 }) => { 50825 return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content)); 50826 } 50827 } 50828 }, 50829 priority: 20 50830 }] 50831 }; 50832 /* harmony default export */ const shortcode_transforms = (shortcode_transforms_transforms); 50833 50834 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 50835 /** 50836 * WordPress dependencies 50837 */ 50838 50839 50840 /** 50841 * Internal dependencies 50842 */ 50843 50844 50845 50846 50847 const shortcode_metadata = { 50848 $schema: "https://schemas.wp.org/trunk/block.json", 50849 apiVersion: 3, 50850 name: "core/shortcode", 50851 title: "Shortcode", 50852 category: "widgets", 50853 description: "Insert additional custom elements with a WordPress shortcode.", 50854 textdomain: "default", 50855 attributes: { 50856 text: { 50857 type: "string", 50858 source: "raw" 50859 } 50860 }, 50861 supports: { 50862 className: false, 50863 customClassName: false, 50864 html: false 50865 }, 50866 editorStyle: "wp-block-shortcode-editor" 50867 }; 50868 const { 50869 name: shortcode_name 50870 } = shortcode_metadata; 50871 50872 const shortcode_settings = { 50873 icon: library_shortcode, 50874 transforms: shortcode_transforms, 50875 edit: ShortcodeEdit, 50876 save: shortcode_save_save 50877 }; 50878 const shortcode_init = () => initBlock({ 50879 name: shortcode_name, 50880 metadata: shortcode_metadata, 50881 settings: shortcode_settings 50882 }); 50883 50884 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js 50885 50886 /** 50887 * WordPress dependencies 50888 */ 50889 50890 const siteLogo = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 50891 xmlns: "http://www.w3.org/2000/svg", 50892 viewBox: "0 0 24 24" 50893 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 50894 d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z" 50895 })); 50896 /* harmony default export */ const site_logo = (siteLogo); 50897 50898 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js 50899 50900 /** 50901 * External dependencies 50902 */ 50903 50904 50905 /** 50906 * WordPress dependencies 50907 */ 50908 50909 50910 50911 50912 50913 50914 50915 50916 50917 50918 50919 /** 50920 * Internal dependencies 50921 */ 50922 50923 50924 /** 50925 * Module constants 50926 */ 50927 50928 const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image']; 50929 const ACCEPT_MEDIA_STRING = 'image/*'; 50930 const SiteLogo = ({ 50931 alt, 50932 attributes: { 50933 align, 50934 width, 50935 height, 50936 isLink, 50937 linkTarget, 50938 shouldSyncIcon 50939 }, 50940 containerRef, 50941 isSelected, 50942 setAttributes, 50943 setLogo, 50944 logoUrl, 50945 siteUrl, 50946 logoId, 50947 iconId, 50948 setIcon, 50949 canUserEdit 50950 }) => { 50951 const clientWidth = useClientWidth(containerRef, [align]); 50952 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); 50953 const isWideAligned = ['wide', 'full'].includes(align); 50954 const isResizable = !isWideAligned && isLargeViewport; 50955 const [{ 50956 naturalWidth, 50957 naturalHeight 50958 }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); 50959 const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); 50960 const { 50961 toggleSelection 50962 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 50963 const classes = classnames_default()('custom-logo-link', { 50964 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl) 50965 }); 50966 const { 50967 imageEditing, 50968 maxWidth, 50969 title 50970 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 50971 const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 50972 const siteEntities = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase'); 50973 return { 50974 title: siteEntities?.name, 50975 imageEditing: settings.imageEditing, 50976 maxWidth: settings.maxWidth 50977 }; 50978 }, []); 50979 (0,external_wp_element_namespaceObject.useEffect)(() => { 50980 // Turn the `Use as site icon` toggle off if it is on but the logo and icon have 50981 // fallen out of sync. This can happen if the toggle is saved in the `on` position, 50982 // but changes are later made to the site icon in the Customizer. 50983 if (shouldSyncIcon && logoId !== iconId) { 50984 setAttributes({ 50985 shouldSyncIcon: false 50986 }); 50987 } 50988 }, []); 50989 (0,external_wp_element_namespaceObject.useEffect)(() => { 50990 if (!isSelected) { 50991 setIsEditingImage(false); 50992 } 50993 }, [isSelected]); 50994 function onResizeStart() { 50995 toggleSelection(false); 50996 } 50997 function onResizeStop() { 50998 toggleSelection(true); 50999 } 51000 const img = (0,external_React_namespaceObject.createElement)("img", { 51001 className: "custom-logo", 51002 src: logoUrl, 51003 alt: alt, 51004 onLoad: event => { 51005 setNaturalSize({ 51006 naturalWidth: event.target.naturalWidth, 51007 naturalHeight: event.target.naturalHeight 51008 }); 51009 } 51010 }); 51011 let imgWrapper = img; 51012 51013 // Disable reason: Image itself is not meant to be interactive, but 51014 // should direct focus to block. 51015 if (isLink) { 51016 imgWrapper = /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 51017 (0,external_React_namespaceObject.createElement)("a", { 51018 href: siteUrl, 51019 className: classes, 51020 rel: "home", 51021 title: title, 51022 onClick: event => event.preventDefault() 51023 }, img) 51024 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; 51025 } 51026 let imageWidthWithinContainer; 51027 if (clientWidth && naturalWidth && naturalHeight) { 51028 const exceedMaxWidth = naturalWidth > clientWidth; 51029 imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth; 51030 } 51031 if (!isResizable || !imageWidthWithinContainer) { 51032 return (0,external_React_namespaceObject.createElement)("div", { 51033 style: { 51034 width, 51035 height 51036 } 51037 }, imgWrapper); 51038 } 51039 51040 // Set the default width to a responsible size. 51041 // Note that this width is also set in the attached frontend CSS file. 51042 const defaultWidth = 120; 51043 const currentWidth = width || defaultWidth; 51044 const ratio = naturalWidth / naturalHeight; 51045 const currentHeight = currentWidth / ratio; 51046 const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE * ratio); 51047 const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE / ratio); 51048 51049 // With the current implementation of ResizableBox, an image needs an 51050 // explicit pixel value for the max-width. In absence of being able to 51051 // set the content-width, this max-width is currently dictated by the 51052 // vanilla editor style. The following variable adds a buffer to this 51053 // vanilla style, so 3rd party themes have some wiggleroom. This does, 51054 // in most cases, allow you to scale the image beyond the width of the 51055 // main column, though not infinitely. 51056 // @todo It would be good to revisit this once a content-width variable 51057 // becomes available. 51058 const maxWidthBuffer = maxWidth * 2.5; 51059 let showRightHandle = false; 51060 let showLeftHandle = false; 51061 51062 /* eslint-disable no-lonely-if */ 51063 // See https://github.com/WordPress/gutenberg/issues/7584. 51064 if (align === 'center') { 51065 // When the image is centered, show both handles. 51066 showRightHandle = true; 51067 showLeftHandle = true; 51068 } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { 51069 // In RTL mode the image is on the right by default. 51070 // Show the right handle and hide the left handle only when it is 51071 // aligned left. Otherwise always show the left handle. 51072 if (align === 'left') { 51073 showRightHandle = true; 51074 } else { 51075 showLeftHandle = true; 51076 } 51077 } else { 51078 // Show the left handle and hide the right handle only when the 51079 // image is aligned right. Otherwise always show the right handle. 51080 if (align === 'right') { 51081 showLeftHandle = true; 51082 } else { 51083 showRightHandle = true; 51084 } 51085 } 51086 /* eslint-enable no-lonely-if */ 51087 51088 const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing; 51089 const imgEdit = canEditImage && isEditingImage ? (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { 51090 id: logoId, 51091 url: logoUrl, 51092 width: currentWidth, 51093 height: currentHeight, 51094 clientWidth: clientWidth, 51095 naturalHeight: naturalHeight, 51096 naturalWidth: naturalWidth, 51097 onSaveImage: imageAttributes => { 51098 setLogo(imageAttributes.id); 51099 }, 51100 onFinishEditing: () => { 51101 setIsEditingImage(false); 51102 } 51103 }) : (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 51104 size: { 51105 width: currentWidth, 51106 height: currentHeight 51107 }, 51108 showHandle: isSelected, 51109 minWidth: minWidth, 51110 maxWidth: maxWidthBuffer, 51111 minHeight: minHeight, 51112 maxHeight: maxWidthBuffer / ratio, 51113 lockAspectRatio: true, 51114 enable: { 51115 top: false, 51116 right: showRightHandle, 51117 bottom: true, 51118 left: showLeftHandle 51119 }, 51120 onResizeStart: onResizeStart, 51121 onResizeStop: (event, direction, elt, delta) => { 51122 onResizeStop(); 51123 setAttributes({ 51124 width: parseInt(currentWidth + delta.width, 10), 51125 height: parseInt(currentHeight + delta.height, 10) 51126 }); 51127 } 51128 }, imgWrapper); 51129 51130 // Support the previous location for the Site Icon settings. To be removed 51131 // when the required WP core version for Gutenberg is >= 6.5.0. 51132 const shouldUseNewUrl = !window?.__experimentalUseCustomizerSiteLogoUrl; 51133 const siteIconSettingsUrl = shouldUseNewUrl ? siteUrl + '/wp-admin/options-general.php' : siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline'; 51134 const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), { 51135 a: 51136 // eslint-disable-next-line jsx-a11y/anchor-has-content 51137 (0,external_React_namespaceObject.createElement)("a", { 51138 href: siteIconSettingsUrl, 51139 target: "_blank", 51140 rel: "noopener noreferrer" 51141 }) 51142 }); 51143 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 51144 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 51145 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 51146 __nextHasNoMarginBottom: true, 51147 __next40pxDefaultSize: true, 51148 label: (0,external_wp_i18n_namespaceObject.__)('Image width'), 51149 onChange: newWidth => setAttributes({ 51150 width: newWidth 51151 }), 51152 min: minWidth, 51153 max: maxWidthBuffer, 51154 initialPosition: Math.min(defaultWidth, maxWidthBuffer), 51155 value: width || '', 51156 disabled: !isResizable 51157 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 51158 __nextHasNoMarginBottom: true, 51159 label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'), 51160 onChange: () => setAttributes({ 51161 isLink: !isLink 51162 }), 51163 checked: isLink 51164 }), isLink && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 51165 __nextHasNoMarginBottom: true, 51166 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 51167 onChange: value => setAttributes({ 51168 linkTarget: value ? '_blank' : '_self' 51169 }), 51170 checked: linkTarget === '_blank' 51171 })), canUserEdit && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 51172 __nextHasNoMarginBottom: true, 51173 label: (0,external_wp_i18n_namespaceObject.__)('Use as Site Icon'), 51174 onChange: value => { 51175 setAttributes({ 51176 shouldSyncIcon: value 51177 }); 51178 setIcon(value ? logoId : undefined); 51179 }, 51180 checked: !!shouldSyncIcon, 51181 help: syncSiteIconHelpText 51182 })))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 51183 group: "block" 51184 }, canEditImage && !isEditingImage && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 51185 onClick: () => setIsEditingImage(true), 51186 icon: library_crop, 51187 label: (0,external_wp_i18n_namespaceObject.__)('Crop') 51188 })), imgEdit); 51189 }; 51190 51191 // This is a light wrapper around MediaReplaceFlow because the block has two 51192 // different MediaReplaceFlows, one for the inspector and one for the toolbar. 51193 function SiteLogoReplaceFlow({ 51194 onRemoveLogo, 51195 ...mediaReplaceProps 51196 }) { 51197 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 51198 ...mediaReplaceProps, 51199 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 51200 accept: ACCEPT_MEDIA_STRING 51201 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 51202 onClick: onRemoveLogo 51203 }, (0,external_wp_i18n_namespaceObject.__)('Reset'))); 51204 } 51205 const InspectorLogoPreview = ({ 51206 mediaItemData = {}, 51207 itemGroupProps 51208 }) => { 51209 const { 51210 alt_text: alt, 51211 source_url: logoUrl, 51212 slug: logoSlug, 51213 media_details: logoMediaDetails 51214 } = mediaItemData; 51215 const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug; 51216 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { 51217 ...itemGroupProps, 51218 as: "span" 51219 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 51220 justify: "flex-start", 51221 as: "span" 51222 }, (0,external_React_namespaceObject.createElement)("img", { 51223 src: logoUrl, 51224 alt: alt 51225 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { 51226 as: "span" 51227 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { 51228 numberOfLines: 1, 51229 className: "block-library-site-logo__inspector-media-replace-title" 51230 }, logoLabel)))); 51231 }; 51232 function LogoEdit({ 51233 attributes, 51234 className, 51235 setAttributes, 51236 isSelected 51237 }) { 51238 const { 51239 width, 51240 shouldSyncIcon 51241 } = attributes; 51242 const ref = (0,external_wp_element_namespaceObject.useRef)(); 51243 const { 51244 siteLogoId, 51245 canUserEdit, 51246 url, 51247 siteIconId, 51248 mediaItemData, 51249 isRequestingMediaItem 51250 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 51251 const { 51252 canUser, 51253 getEntityRecord, 51254 getEditedEntityRecord 51255 } = select(external_wp_coreData_namespaceObject.store); 51256 const _canUserEdit = canUser('update', 'settings'); 51257 const siteSettings = _canUserEdit ? getEditedEntityRecord('root', 'site') : undefined; 51258 const siteData = getEntityRecord('root', '__unstableBase'); 51259 const _siteLogoId = _canUserEdit ? siteSettings?.site_logo : siteData?.site_logo; 51260 const _siteIconId = siteSettings?.site_icon; 51261 const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, { 51262 context: 'view' 51263 }); 51264 const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, { 51265 context: 'view' 51266 }]); 51267 return { 51268 siteLogoId: _siteLogoId, 51269 canUserEdit: _canUserEdit, 51270 url: siteData?.home, 51271 mediaItemData: mediaItem, 51272 isRequestingMediaItem: _isRequestingMediaItem, 51273 siteIconId: _siteIconId 51274 }; 51275 }, []); 51276 const { 51277 getSettings 51278 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 51279 const { 51280 editEntityRecord 51281 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 51282 const setLogo = (newValue, shouldForceSync = false) => { 51283 // `shouldForceSync` is used to force syncing when the attribute 51284 // may not have updated yet. 51285 if (shouldSyncIcon || shouldForceSync) { 51286 setIcon(newValue); 51287 } 51288 editEntityRecord('root', 'site', undefined, { 51289 site_logo: newValue 51290 }); 51291 }; 51292 const setIcon = newValue => 51293 // The new value needs to be `null` to reset the Site Icon. 51294 editEntityRecord('root', 'site', undefined, { 51295 site_icon: newValue !== null && newValue !== void 0 ? newValue : null 51296 }); 51297 const { 51298 alt_text: alt, 51299 source_url: logoUrl 51300 } = mediaItemData !== null && mediaItemData !== void 0 ? mediaItemData : {}; 51301 const onInitialSelectLogo = media => { 51302 // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no 51303 // site icon, automatically sync the logo to the icon. 51304 if (shouldSyncIcon === undefined) { 51305 const shouldForceSync = !siteIconId; 51306 setAttributes({ 51307 shouldSyncIcon: shouldForceSync 51308 }); 51309 51310 // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by 51311 // the time `setLogo` is called, pass an argument to force the syncing. 51312 onSelectLogo(media, shouldForceSync); 51313 return; 51314 } 51315 onSelectLogo(media); 51316 }; 51317 const onSelectLogo = (media, shouldForceSync = false) => { 51318 if (!media) { 51319 return; 51320 } 51321 if (!media.id && media.url) { 51322 // This is a temporary blob image. 51323 setLogo(undefined); 51324 return; 51325 } 51326 setLogo(media.id, shouldForceSync); 51327 }; 51328 const onRemoveLogo = () => { 51329 setLogo(null); 51330 setAttributes({ 51331 width: undefined 51332 }); 51333 }; 51334 const { 51335 createErrorNotice 51336 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 51337 const onUploadError = message => { 51338 createErrorNotice(message, { 51339 type: 'snackbar' 51340 }); 51341 }; 51342 const onFilesDrop = filesList => { 51343 getSettings().mediaUpload({ 51344 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 51345 filesList, 51346 onFileChange([image]) { 51347 if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) { 51348 return; 51349 } 51350 onInitialSelectLogo(image); 51351 }, 51352 onError: onUploadError 51353 }); 51354 }; 51355 const mediaReplaceFlowProps = { 51356 mediaURL: logoUrl, 51357 onSelect: onSelectLogo, 51358 onError: onUploadError, 51359 onRemoveLogo 51360 }; 51361 const controls = canUserEdit && logoUrl && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 51362 group: "other" 51363 }, (0,external_React_namespaceObject.createElement)(SiteLogoReplaceFlow, { 51364 ...mediaReplaceFlowProps 51365 })); 51366 let logoImage; 51367 const isLoading = siteLogoId === undefined || isRequestingMediaItem; 51368 if (isLoading) { 51369 logoImage = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null); 51370 } 51371 if (!!logoUrl) { 51372 logoImage = (0,external_React_namespaceObject.createElement)(SiteLogo, { 51373 alt: alt, 51374 attributes: attributes, 51375 className: className, 51376 containerRef: ref, 51377 isSelected: isSelected, 51378 setAttributes: setAttributes, 51379 logoUrl: logoUrl, 51380 setLogo: setLogo, 51381 logoId: mediaItemData?.id || siteLogoId, 51382 siteUrl: url, 51383 setIcon: setIcon, 51384 iconId: siteIconId, 51385 canUserEdit: canUserEdit 51386 }); 51387 } 51388 const placeholder = content => { 51389 const placeholderClassName = classnames_default()('block-editor-media-placeholder', className); 51390 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 51391 className: placeholderClassName, 51392 preview: logoImage, 51393 withIllustration: true, 51394 style: { 51395 width 51396 } 51397 }, content); 51398 }; 51399 const classes = classnames_default()(className, { 51400 'is-default-size': !width 51401 }); 51402 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 51403 ref, 51404 className: classes 51405 }); 51406 const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo'); 51407 const mediaInspectorPanel = (canUserEdit || logoUrl) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 51408 title: (0,external_wp_i18n_namespaceObject.__)('Media') 51409 }, (0,external_React_namespaceObject.createElement)("div", { 51410 className: "block-library-site-logo__inspector-media-replace-container" 51411 }, !canUserEdit && !!logoUrl && (0,external_React_namespaceObject.createElement)(InspectorLogoPreview, { 51412 mediaItemData: mediaItemData, 51413 itemGroupProps: { 51414 isBordered: true, 51415 className: 'block-library-site-logo__inspector-readonly-logo-preview' 51416 } 51417 }), canUserEdit && !!logoUrl && (0,external_React_namespaceObject.createElement)(SiteLogoReplaceFlow, { 51418 ...mediaReplaceFlowProps, 51419 name: (0,external_React_namespaceObject.createElement)(InspectorLogoPreview, { 51420 mediaItemData: mediaItemData 51421 }), 51422 popoverProps: {} 51423 }), canUserEdit && !logoUrl && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { 51424 onSelect: onInitialSelectLogo, 51425 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 51426 render: ({ 51427 open 51428 }) => (0,external_React_namespaceObject.createElement)("div", { 51429 className: "block-library-site-logo__inspector-upload-container" 51430 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 51431 onClick: open, 51432 variant: "secondary" 51433 }, isLoading ? (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('Add media')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.DropZone, { 51434 onFilesDrop: onFilesDrop 51435 })) 51436 }))))); 51437 return (0,external_React_namespaceObject.createElement)("div", { 51438 ...blockProps 51439 }, controls, mediaInspectorPanel, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 51440 className: "site-logo_placeholder" 51441 }, !!isLoading && (0,external_React_namespaceObject.createElement)("span", { 51442 className: "components-placeholder__preview" 51443 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 51444 onSelect: onInitialSelectLogo, 51445 accept: ACCEPT_MEDIA_STRING, 51446 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 51447 onError: onUploadError, 51448 placeholder: placeholder, 51449 mediaLibraryButton: ({ 51450 open 51451 }) => { 51452 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 51453 icon: library_upload, 51454 variant: "primary", 51455 label: label, 51456 showTooltip: true, 51457 tooltipPosition: "top center", 51458 onClick: () => { 51459 open(); 51460 } 51461 }); 51462 } 51463 })); 51464 } 51465 51466 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js 51467 /** 51468 * WordPress dependencies 51469 */ 51470 51471 const site_logo_transforms_transforms = { 51472 to: [{ 51473 type: 'block', 51474 blocks: ['core/site-title'], 51475 transform: ({ 51476 isLink, 51477 linkTarget 51478 }) => { 51479 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', { 51480 isLink, 51481 linkTarget 51482 }); 51483 } 51484 }] 51485 }; 51486 /* harmony default export */ const site_logo_transforms = (site_logo_transforms_transforms); 51487 51488 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js 51489 /** 51490 * WordPress dependencies 51491 */ 51492 51493 51494 /** 51495 * Internal dependencies 51496 */ 51497 51498 const site_logo_metadata = { 51499 $schema: "https://schemas.wp.org/trunk/block.json", 51500 apiVersion: 3, 51501 name: "core/site-logo", 51502 title: "Site Logo", 51503 category: "theme", 51504 description: "Display an image to represent this site. Update this block and the changes apply everywhere.", 51505 textdomain: "default", 51506 attributes: { 51507 width: { 51508 type: "number" 51509 }, 51510 isLink: { 51511 type: "boolean", 51512 "default": true 51513 }, 51514 linkTarget: { 51515 type: "string", 51516 "default": "_self" 51517 }, 51518 shouldSyncIcon: { 51519 type: "boolean" 51520 } 51521 }, 51522 example: { 51523 viewportWidth: 500, 51524 attributes: { 51525 width: 350, 51526 className: "block-editor-block-types-list__site-logo-example" 51527 } 51528 }, 51529 supports: { 51530 html: false, 51531 align: true, 51532 alignWide: false, 51533 color: { 51534 __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before", 51535 text: false, 51536 background: false 51537 }, 51538 spacing: { 51539 margin: true, 51540 padding: true, 51541 __experimentalDefaultControls: { 51542 margin: false, 51543 padding: false 51544 } 51545 }, 51546 interactivity: { 51547 clientNavigation: true 51548 } 51549 }, 51550 styles: [{ 51551 name: "default", 51552 label: "Default", 51553 isDefault: true 51554 }, { 51555 name: "rounded", 51556 label: "Rounded" 51557 }], 51558 editorStyle: "wp-block-site-logo-editor", 51559 style: "wp-block-site-logo" 51560 }; 51561 51562 51563 const { 51564 name: site_logo_name 51565 } = site_logo_metadata; 51566 51567 const site_logo_settings = { 51568 icon: site_logo, 51569 example: {}, 51570 edit: LogoEdit, 51571 transforms: site_logo_transforms 51572 }; 51573 const site_logo_init = () => initBlock({ 51574 name: site_logo_name, 51575 metadata: site_logo_metadata, 51576 settings: site_logo_settings 51577 }); 51578 51579 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js 51580 51581 /** 51582 * External dependencies 51583 */ 51584 51585 51586 /** 51587 * WordPress dependencies 51588 */ 51589 51590 51591 51592 51593 51594 function SiteTaglineEdit({ 51595 attributes, 51596 setAttributes, 51597 insertBlocksAfter 51598 }) { 51599 const { 51600 textAlign 51601 } = attributes; 51602 const { 51603 canUserEdit, 51604 tagline 51605 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 51606 const { 51607 canUser, 51608 getEntityRecord, 51609 getEditedEntityRecord 51610 } = select(external_wp_coreData_namespaceObject.store); 51611 const canEdit = canUser('update', 'settings'); 51612 const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; 51613 const readOnlySettings = getEntityRecord('root', '__unstableBase'); 51614 return { 51615 canUserEdit: canUser('update', 'settings'), 51616 tagline: canEdit ? settings?.description : readOnlySettings?.description 51617 }; 51618 }, []); 51619 const { 51620 editEntityRecord 51621 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 51622 function setTagline(newTagline) { 51623 editEntityRecord('root', 'site', undefined, { 51624 description: newTagline 51625 }); 51626 } 51627 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 51628 className: classnames_default()({ 51629 [`has-text-align-$textAlign}`]: textAlign, 51630 'wp-block-site-tagline__placeholder': !canUserEdit && !tagline 51631 }) 51632 }); 51633 const siteTaglineContent = canUserEdit ? (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 51634 allowedFormats: [], 51635 onChange: setTagline, 51636 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'), 51637 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'), 51638 tagName: "p", 51639 value: tagline, 51640 disableLineBreaks: true, 51641 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 51642 ...blockProps 51643 }) : (0,external_React_namespaceObject.createElement)("p", { 51644 ...blockProps 51645 }, tagline || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder')); 51646 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 51647 group: "block" 51648 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 51649 onChange: newAlign => setAttributes({ 51650 textAlign: newAlign 51651 }), 51652 value: textAlign 51653 })), siteTaglineContent); 51654 } 51655 51656 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js 51657 51658 /** 51659 * WordPress dependencies 51660 */ 51661 51662 /* harmony default export */ const site_tagline_icon = ((0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { 51663 xmlns: "http://www.w3.org/2000/svg", 51664 width: "24", 51665 height: "24" 51666 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { 51667 d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z" 51668 }))); 51669 51670 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js 51671 /** 51672 * Internal dependencies 51673 */ 51674 51675 const site_tagline_deprecated_v1 = { 51676 attributes: { 51677 textAlign: { 51678 type: 'string' 51679 } 51680 }, 51681 supports: { 51682 align: ['wide', 'full'], 51683 html: false, 51684 color: { 51685 gradients: true 51686 }, 51687 spacing: { 51688 margin: true, 51689 padding: true 51690 }, 51691 typography: { 51692 fontSize: true, 51693 lineHeight: true, 51694 __experimentalFontFamily: true, 51695 __experimentalTextTransform: true, 51696 __experimentalFontStyle: true, 51697 __experimentalFontWeight: true, 51698 __experimentalLetterSpacing: true 51699 } 51700 }, 51701 save() { 51702 return null; 51703 }, 51704 migrate: migrate_font_family, 51705 isEligible({ 51706 style 51707 }) { 51708 return style?.typography?.fontFamily; 51709 } 51710 }; 51711 51712 /** 51713 * New deprecations need to be placed first 51714 * for them to have higher priority. 51715 * 51716 * Old deprecations may need to be updated as well. 51717 * 51718 * See block-deprecation.md 51719 */ 51720 /* harmony default export */ const site_tagline_deprecated = ([site_tagline_deprecated_v1]); 51721 51722 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js 51723 /** 51724 * Internal dependencies 51725 */ 51726 51727 const site_tagline_metadata = { 51728 $schema: "https://schemas.wp.org/trunk/block.json", 51729 apiVersion: 3, 51730 name: "core/site-tagline", 51731 title: "Site Tagline", 51732 category: "theme", 51733 description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it\u2019s not displayed in the theme design.", 51734 keywords: ["description"], 51735 textdomain: "default", 51736 attributes: { 51737 textAlign: { 51738 type: "string" 51739 } 51740 }, 51741 example: {}, 51742 supports: { 51743 align: ["wide", "full"], 51744 html: false, 51745 color: { 51746 gradients: true, 51747 __experimentalDefaultControls: { 51748 background: true, 51749 text: true 51750 } 51751 }, 51752 spacing: { 51753 margin: true, 51754 padding: true, 51755 __experimentalDefaultControls: { 51756 margin: false, 51757 padding: false 51758 } 51759 }, 51760 typography: { 51761 fontSize: true, 51762 lineHeight: true, 51763 __experimentalFontFamily: true, 51764 __experimentalTextTransform: true, 51765 __experimentalTextDecoration: true, 51766 __experimentalFontStyle: true, 51767 __experimentalFontWeight: true, 51768 __experimentalLetterSpacing: true, 51769 __experimentalDefaultControls: { 51770 fontSize: true 51771 } 51772 }, 51773 interactivity: { 51774 clientNavigation: true 51775 } 51776 }, 51777 editorStyle: "wp-block-site-tagline-editor" 51778 }; 51779 51780 51781 51782 const { 51783 name: site_tagline_name 51784 } = site_tagline_metadata; 51785 51786 const site_tagline_settings = { 51787 icon: site_tagline_icon, 51788 edit: SiteTaglineEdit, 51789 deprecated: site_tagline_deprecated 51790 }; 51791 const site_tagline_init = () => initBlock({ 51792 name: site_tagline_name, 51793 metadata: site_tagline_metadata, 51794 settings: site_tagline_settings 51795 }); 51796 51797 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js 51798 51799 /** 51800 * WordPress dependencies 51801 */ 51802 51803 const mapMarker = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 51804 xmlns: "http://www.w3.org/2000/svg", 51805 viewBox: "0 0 24 24" 51806 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 51807 d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z" 51808 })); 51809 /* harmony default export */ const map_marker = (mapMarker); 51810 51811 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js 51812 51813 /** 51814 * External dependencies 51815 */ 51816 51817 51818 /** 51819 * WordPress dependencies 51820 */ 51821 51822 51823 51824 51825 51826 51827 51828 const HEADING_LEVELS = [0, 1, 2, 3, 4, 5, 6]; 51829 function SiteTitleEdit({ 51830 attributes, 51831 setAttributes, 51832 insertBlocksAfter 51833 }) { 51834 const { 51835 level, 51836 textAlign, 51837 isLink, 51838 linkTarget 51839 } = attributes; 51840 const { 51841 canUserEdit, 51842 title 51843 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 51844 const { 51845 canUser, 51846 getEntityRecord, 51847 getEditedEntityRecord 51848 } = select(external_wp_coreData_namespaceObject.store); 51849 const canEdit = canUser('update', 'settings'); 51850 const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; 51851 const readOnlySettings = getEntityRecord('root', '__unstableBase'); 51852 return { 51853 canUserEdit: canEdit, 51854 title: canEdit ? settings?.title : readOnlySettings?.name 51855 }; 51856 }, []); 51857 const { 51858 editEntityRecord 51859 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 51860 function setTitle(newTitle) { 51861 editEntityRecord('root', 'site', undefined, { 51862 title: newTitle 51863 }); 51864 } 51865 const TagName = level === 0 ? 'p' : `h$level}`; 51866 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 51867 className: classnames_default()({ 51868 [`has-text-align-$textAlign}`]: textAlign, 51869 'wp-block-site-title__placeholder': !canUserEdit && !title 51870 }) 51871 }); 51872 const siteTitleContent = canUserEdit ? (0,external_React_namespaceObject.createElement)(TagName, { 51873 ...blockProps 51874 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 51875 tagName: isLink ? 'a' : 'span', 51876 href: isLink ? '#site-title-pseudo-link' : undefined, 51877 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'), 51878 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'), 51879 value: title, 51880 onChange: setTitle, 51881 allowedFormats: [], 51882 disableLineBreaks: true, 51883 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 51884 })) : (0,external_React_namespaceObject.createElement)(TagName, { 51885 ...blockProps 51886 }, isLink ? (0,external_React_namespaceObject.createElement)("a", { 51887 href: "#site-title-pseudo-link", 51888 onClick: event => event.preventDefault() 51889 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder'))); 51890 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 51891 group: "block" 51892 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 51893 options: HEADING_LEVELS, 51894 value: level, 51895 onChange: newLevel => setAttributes({ 51896 level: newLevel 51897 }) 51898 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 51899 value: textAlign, 51900 onChange: nextAlign => { 51901 setAttributes({ 51902 textAlign: nextAlign 51903 }); 51904 } 51905 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 51906 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 51907 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 51908 __nextHasNoMarginBottom: true, 51909 label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'), 51910 onChange: () => setAttributes({ 51911 isLink: !isLink 51912 }), 51913 checked: isLink 51914 }), isLink && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 51915 __nextHasNoMarginBottom: true, 51916 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 51917 onChange: value => setAttributes({ 51918 linkTarget: value ? '_blank' : '_self' 51919 }), 51920 checked: linkTarget === '_blank' 51921 }))), siteTitleContent); 51922 } 51923 51924 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js 51925 /** 51926 * Internal dependencies 51927 */ 51928 51929 const site_title_deprecated_v1 = { 51930 attributes: { 51931 level: { 51932 type: 'number', 51933 default: 1 51934 }, 51935 textAlign: { 51936 type: 'string' 51937 }, 51938 isLink: { 51939 type: 'boolean', 51940 default: true 51941 }, 51942 linkTarget: { 51943 type: 'string', 51944 default: '_self' 51945 } 51946 }, 51947 supports: { 51948 align: ['wide', 'full'], 51949 html: false, 51950 color: { 51951 gradients: true, 51952 link: true 51953 }, 51954 spacing: { 51955 padding: true, 51956 margin: true 51957 }, 51958 typography: { 51959 fontSize: true, 51960 lineHeight: true, 51961 __experimentalFontFamily: true, 51962 __experimentalTextTransform: true, 51963 __experimentalFontStyle: true, 51964 __experimentalFontWeight: true, 51965 __experimentalLetterSpacing: true 51966 } 51967 }, 51968 save() { 51969 return null; 51970 }, 51971 migrate: migrate_font_family, 51972 isEligible({ 51973 style 51974 }) { 51975 return style?.typography?.fontFamily; 51976 } 51977 }; 51978 51979 /** 51980 * New deprecations need to be placed first 51981 * for them to have higher priority. 51982 * 51983 * Old deprecations may need to be updated as well. 51984 * 51985 * See block-deprecation.md 51986 */ 51987 /* harmony default export */ const site_title_deprecated = ([site_title_deprecated_v1]); 51988 51989 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js 51990 /** 51991 * WordPress dependencies 51992 */ 51993 51994 const site_title_transforms_transforms = { 51995 to: [{ 51996 type: 'block', 51997 blocks: ['core/site-logo'], 51998 transform: ({ 51999 isLink, 52000 linkTarget 52001 }) => { 52002 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', { 52003 isLink, 52004 linkTarget 52005 }); 52006 } 52007 }] 52008 }; 52009 /* harmony default export */ const site_title_transforms = (site_title_transforms_transforms); 52010 52011 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js 52012 /** 52013 * WordPress dependencies 52014 */ 52015 52016 52017 /** 52018 * Internal dependencies 52019 */ 52020 52021 const site_title_metadata = { 52022 $schema: "https://schemas.wp.org/trunk/block.json", 52023 apiVersion: 3, 52024 name: "core/site-title", 52025 title: "Site Title", 52026 category: "theme", 52027 description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.", 52028 textdomain: "default", 52029 attributes: { 52030 level: { 52031 type: "number", 52032 "default": 1 52033 }, 52034 textAlign: { 52035 type: "string" 52036 }, 52037 isLink: { 52038 type: "boolean", 52039 "default": true 52040 }, 52041 linkTarget: { 52042 type: "string", 52043 "default": "_self" 52044 } 52045 }, 52046 example: { 52047 viewportWidth: 500 52048 }, 52049 supports: { 52050 align: ["wide", "full"], 52051 html: false, 52052 color: { 52053 gradients: true, 52054 link: true, 52055 __experimentalDefaultControls: { 52056 background: true, 52057 text: true, 52058 link: true 52059 } 52060 }, 52061 spacing: { 52062 padding: true, 52063 margin: true, 52064 __experimentalDefaultControls: { 52065 margin: false, 52066 padding: false 52067 } 52068 }, 52069 typography: { 52070 fontSize: true, 52071 lineHeight: true, 52072 __experimentalFontFamily: true, 52073 __experimentalTextTransform: true, 52074 __experimentalTextDecoration: true, 52075 __experimentalFontStyle: true, 52076 __experimentalFontWeight: true, 52077 __experimentalLetterSpacing: true, 52078 __experimentalDefaultControls: { 52079 fontSize: true 52080 } 52081 }, 52082 interactivity: { 52083 clientNavigation: true 52084 } 52085 }, 52086 editorStyle: "wp-block-site-title-editor", 52087 style: "wp-block-site-title" 52088 }; 52089 52090 52091 52092 const { 52093 name: site_title_name 52094 } = site_title_metadata; 52095 52096 const site_title_settings = { 52097 icon: map_marker, 52098 example: {}, 52099 edit: SiteTitleEdit, 52100 transforms: site_title_transforms, 52101 deprecated: site_title_deprecated 52102 }; 52103 const site_title_init = () => initBlock({ 52104 name: site_title_name, 52105 metadata: site_title_metadata, 52106 settings: site_title_settings 52107 }); 52108 52109 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js 52110 52111 /** 52112 * WordPress dependencies 52113 */ 52114 52115 const share = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52116 viewBox: "0 0 24 24", 52117 xmlns: "http://www.w3.org/2000/svg" 52118 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52119 d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z" 52120 })); 52121 /* harmony default export */ const library_share = (share); 52122 52123 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js 52124 52125 /** 52126 * WordPress dependencies 52127 */ 52128 52129 const keyboardReturn = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52130 xmlns: "http://www.w3.org/2000/svg", 52131 viewBox: "-2 -2 24 24" 52132 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52133 d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z" 52134 })); 52135 /* harmony default export */ const keyboard_return = (keyboardReturn); 52136 52137 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js 52138 52139 /** 52140 * WordPress dependencies 52141 */ 52142 52143 const WordPressIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52144 width: "24", 52145 height: "24", 52146 viewBox: "0 0 24 24", 52147 version: "1.1", 52148 xmlns: "http://www.w3.org/2000/svg" 52149 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52150 d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z" 52151 })); 52152 52153 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js 52154 52155 /** 52156 * WordPress dependencies 52157 */ 52158 52159 const FivehundredpxIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52160 width: "24", 52161 height: "24", 52162 viewBox: "0 0 24 24", 52163 version: "1.1" 52164 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52165 d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z" 52166 })); 52167 52168 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js 52169 52170 /** 52171 * WordPress dependencies 52172 */ 52173 52174 const AmazonIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52175 width: "24", 52176 height: "24", 52177 viewBox: "0 0 24 24", 52178 version: "1.1" 52179 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52180 d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z" 52181 })); 52182 52183 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js 52184 52185 /** 52186 * WordPress dependencies 52187 */ 52188 52189 52190 const BandcampIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52191 width: "24", 52192 height: "24", 52193 viewBox: "0 0 24 24", 52194 version: "1.1" 52195 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52196 d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289" 52197 })); 52198 52199 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js 52200 52201 /** 52202 * WordPress dependencies 52203 */ 52204 52205 const BehanceIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52206 width: "24", 52207 height: "24", 52208 viewBox: "0 0 24 24", 52209 version: "1.1" 52210 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52211 d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z" 52212 })); 52213 52214 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js 52215 52216 /** 52217 * WordPress dependencies 52218 */ 52219 52220 const ChainIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52221 width: "24", 52222 height: "24", 52223 viewBox: "0 0 24 24", 52224 version: "1.1" 52225 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52226 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" 52227 })); 52228 52229 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js 52230 52231 /** 52232 * WordPress dependencies 52233 */ 52234 52235 const CodepenIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52236 width: "24", 52237 height: "24", 52238 viewBox: "0 0 24 24", 52239 version: "1.1" 52240 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52241 d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z" 52242 })); 52243 52244 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js 52245 52246 /** 52247 * WordPress dependencies 52248 */ 52249 52250 const DeviantArtIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52251 width: "24", 52252 height: "24", 52253 viewBox: "0 0 24 24", 52254 version: "1.1" 52255 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52256 d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z" 52257 })); 52258 52259 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js 52260 52261 /** 52262 * WordPress dependencies 52263 */ 52264 52265 const DribbbleIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52266 width: "24", 52267 height: "24", 52268 viewBox: "0 0 24 24", 52269 version: "1.1" 52270 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52271 d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z" 52272 })); 52273 52274 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js 52275 52276 /** 52277 * WordPress dependencies 52278 */ 52279 52280 const DropboxIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52281 width: "24", 52282 height: "24", 52283 viewBox: "0 0 24 24", 52284 version: "1.1" 52285 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52286 d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z" 52287 })); 52288 52289 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js 52290 52291 /** 52292 * WordPress dependencies 52293 */ 52294 52295 const EtsyIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52296 width: "24", 52297 height: "24", 52298 viewBox: "0 0 24 24", 52299 version: "1.1" 52300 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52301 d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z" 52302 })); 52303 52304 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js 52305 52306 /** 52307 * WordPress dependencies 52308 */ 52309 52310 const FacebookIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52311 width: "24", 52312 height: "24", 52313 viewBox: "0 0 24 24", 52314 version: "1.1" 52315 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52316 d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z" 52317 })); 52318 52319 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js 52320 52321 /** 52322 * WordPress dependencies 52323 */ 52324 52325 const FeedIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52326 width: "24", 52327 height: "24", 52328 viewBox: "0 0 24 24", 52329 version: "1.1" 52330 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52331 d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z" 52332 })); 52333 52334 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js 52335 52336 /** 52337 * WordPress dependencies 52338 */ 52339 52340 const FlickrIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52341 width: "24", 52342 height: "24", 52343 viewBox: "0 0 24 24", 52344 version: "1.1" 52345 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52346 d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z" 52347 })); 52348 52349 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js 52350 52351 /** 52352 * WordPress dependencies 52353 */ 52354 52355 const FoursquareIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52356 width: "24", 52357 height: "24", 52358 viewBox: "0 0 24 24", 52359 version: "1.1" 52360 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52361 d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z" 52362 })); 52363 52364 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js 52365 52366 /** 52367 * WordPress dependencies 52368 */ 52369 52370 const GoodreadsIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52371 width: "24", 52372 height: "24", 52373 viewBox: "0 0 24 24", 52374 version: "1.1" 52375 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52376 d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z" 52377 })); 52378 52379 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js 52380 52381 /** 52382 * WordPress dependencies 52383 */ 52384 52385 const GoogleIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52386 width: "24", 52387 height: "24", 52388 viewBox: "0 0 24 24", 52389 version: "1.1" 52390 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52391 d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z" 52392 })); 52393 52394 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js 52395 52396 /** 52397 * WordPress dependencies 52398 */ 52399 52400 const GitHubIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52401 width: "24", 52402 height: "24", 52403 viewBox: "0 0 24 24", 52404 version: "1.1" 52405 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52406 d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z" 52407 })); 52408 52409 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/gravatar.js 52410 52411 /** 52412 * WordPress dependencies 52413 */ 52414 52415 const GravatarIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52416 width: "24", 52417 height: "24", 52418 viewBox: "0 0 24 24", 52419 version: "1.1" 52420 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52421 d: "M10.8001 4.69937V10.6494C10.8001 11.1001 10.9791 11.5323 11.2978 11.851C11.6165 12.1697 12.0487 12.3487 12.4994 12.3487C12.9501 12.3487 13.3824 12.1697 13.7011 11.851C14.0198 11.5323 14.1988 11.1001 14.1988 10.6494V6.69089C15.2418 7.05861 16.1371 7.75537 16.7496 8.67617C17.3622 9.59698 17.6589 10.6919 17.595 11.796C17.5311 12.9001 17.1101 13.9535 16.3954 14.7975C15.6807 15.6415 14.711 16.2303 13.6325 16.4753C12.5541 16.7202 11.4252 16.608 10.4161 16.1555C9.40691 15.703 8.57217 14.9348 8.03763 13.9667C7.50308 12.9985 7.29769 11.8828 7.45242 10.7877C7.60714 9.69266 8.11359 8.67755 8.89545 7.89537C9.20904 7.57521 9.38364 7.14426 9.38132 6.69611C9.37899 6.24797 9.19994 5.81884 8.88305 5.50195C8.56616 5.18506 8.13704 5.00601 7.68889 5.00369C7.24075 5.00137 6.80979 5.17597 6.48964 5.48956C5.09907 6.8801 4.23369 8.7098 4.04094 10.6669C3.84819 12.624 4.34 14.5873 5.43257 16.2224C6.52515 17.8575 8.15088 19.0632 10.0328 19.634C11.9146 20.2049 13.9362 20.1055 15.753 19.3529C17.5699 18.6003 19.0695 17.241 19.9965 15.5066C20.9234 13.7722 21.2203 11.7701 20.8366 9.84133C20.4528 7.91259 19.4122 6.17658 17.892 4.92911C16.3717 3.68163 14.466 2.99987 12.4994 3C12.0487 3 11.6165 3.17904 11.2978 3.49773C10.9791 3.81643 10.8001 4.24867 10.8001 4.69937Z" 52422 })); 52423 52424 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js 52425 52426 /** 52427 * WordPress dependencies 52428 */ 52429 52430 const InstagramIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52431 width: "24", 52432 height: "24", 52433 viewBox: "0 0 24 24", 52434 version: "1.1" 52435 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52436 d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z" 52437 })); 52438 52439 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js 52440 52441 /** 52442 * WordPress dependencies 52443 */ 52444 52445 const LastfmIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52446 width: "24", 52447 height: "24", 52448 viewBox: "0 0 24 24", 52449 version: "1.1" 52450 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52451 d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z" 52452 })); 52453 52454 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js 52455 52456 /** 52457 * WordPress dependencies 52458 */ 52459 52460 const LinkedInIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52461 width: "24", 52462 height: "24", 52463 viewBox: "0 0 24 24", 52464 version: "1.1" 52465 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52466 d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z" 52467 })); 52468 52469 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js 52470 52471 /** 52472 * WordPress dependencies 52473 */ 52474 52475 const MailIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52476 width: "24", 52477 height: "24", 52478 viewBox: "0 0 24 24", 52479 version: "1.1" 52480 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52481 d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z" 52482 })); 52483 52484 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js 52485 52486 /** 52487 * WordPress dependencies 52488 */ 52489 52490 const MastodonIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52491 width: "24", 52492 height: "24", 52493 viewBox: "0 0 24 24", 52494 version: "1.1" 52495 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52496 d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z" 52497 })); 52498 52499 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js 52500 52501 /** 52502 * WordPress dependencies 52503 */ 52504 52505 const MeetupIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52506 width: "24", 52507 height: "24", 52508 viewBox: "0 0 24 24", 52509 version: "1.1" 52510 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52511 d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z" 52512 })); 52513 52514 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js 52515 52516 /** 52517 * WordPress dependencies 52518 */ 52519 52520 const MediumIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52521 width: "24", 52522 height: "24", 52523 viewBox: "0 0 24 24", 52524 version: "1.1" 52525 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52526 d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z" 52527 })); 52528 52529 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js 52530 52531 /** 52532 * WordPress dependencies 52533 */ 52534 52535 const PatreonIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52536 width: "24", 52537 height: "24", 52538 viewBox: "0 0 24 24", 52539 version: "1.1" 52540 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52541 d: "M20 8.40755C19.9969 6.10922 18.2543 4.22555 16.2097 3.54588C13.6708 2.70188 10.3222 2.82421 7.89775 3.99921C4.95932 5.42355 4.03626 8.54355 4.00186 11.6552C3.97363 14.2136 4.2222 20.9517 7.92225 20.9997C10.6715 21.0356 11.0809 17.3967 12.3529 15.6442C13.258 14.3974 14.4233 14.0452 15.8578 13.6806C18.3233 13.0537 20.0036 11.0551 20 8.40755Z" 52542 })); 52543 52544 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js 52545 52546 /** 52547 * WordPress dependencies 52548 */ 52549 52550 const PinterestIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52551 width: "24", 52552 height: "24", 52553 viewBox: "0 0 24 24", 52554 version: "1.1" 52555 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52556 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" 52557 })); 52558 52559 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js 52560 52561 /** 52562 * WordPress dependencies 52563 */ 52564 52565 const PocketIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52566 width: "24", 52567 height: "24", 52568 viewBox: "0 0 24 24", 52569 version: "1.1" 52570 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52571 d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z" 52572 })); 52573 52574 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js 52575 52576 /** 52577 * WordPress dependencies 52578 */ 52579 52580 const RedditIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52581 width: "24", 52582 height: "24", 52583 viewBox: "0 0 24 24", 52584 version: "1.1" 52585 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52586 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" 52587 })); 52588 52589 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js 52590 52591 /** 52592 * WordPress dependencies 52593 */ 52594 52595 const SkypeIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52596 width: "24", 52597 height: "24", 52598 viewBox: "0 0 24 24", 52599 version: "1.1" 52600 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52601 d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z" 52602 })); 52603 52604 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js 52605 52606 /** 52607 * WordPress dependencies 52608 */ 52609 52610 const SnapchatIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52611 width: "24", 52612 height: "24", 52613 viewBox: "0 0 24 24", 52614 version: "1.1" 52615 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52616 d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z" 52617 })); 52618 52619 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js 52620 52621 /** 52622 * WordPress dependencies 52623 */ 52624 52625 const SoundCloudIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52626 width: "24", 52627 height: "24", 52628 viewBox: "0 0 24 24", 52629 version: "1.1" 52630 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52631 d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z" 52632 })); 52633 52634 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js 52635 52636 /** 52637 * WordPress dependencies 52638 */ 52639 52640 const SpotifyIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52641 width: "24", 52642 height: "24", 52643 viewBox: "0 0 24 24", 52644 version: "1.1" 52645 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52646 d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865" 52647 })); 52648 52649 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js 52650 52651 /** 52652 * WordPress dependencies 52653 */ 52654 52655 const TelegramIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52656 width: "24", 52657 height: "24", 52658 viewBox: "0 0 128 128", 52659 version: "1.1" 52660 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52661 d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z" 52662 })); 52663 52664 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/threads.js 52665 52666 /** 52667 * WordPress dependencies 52668 */ 52669 52670 const ThreadsIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52671 width: "24", 52672 height: "24", 52673 viewBox: "0 0 24 24", 52674 version: "1.1" 52675 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52676 d: "M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z" 52677 })); 52678 52679 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js 52680 52681 /** 52682 * WordPress dependencies 52683 */ 52684 52685 const TiktokIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52686 width: "24", 52687 height: "24", 52688 viewBox: "0 0 32 32", 52689 version: "1.1" 52690 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52691 d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z" 52692 })); 52693 52694 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js 52695 52696 /** 52697 * WordPress dependencies 52698 */ 52699 52700 const TumblrIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52701 width: "24", 52702 height: "24", 52703 viewBox: "0 0 24 24", 52704 version: "1.1" 52705 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52706 d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z" 52707 })); 52708 52709 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js 52710 52711 /** 52712 * WordPress dependencies 52713 */ 52714 52715 const TwitchIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52716 width: "24", 52717 height: "24", 52718 viewBox: "0 0 24 24", 52719 version: "1.1" 52720 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52721 d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z" 52722 })); 52723 52724 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js 52725 52726 /** 52727 * WordPress dependencies 52728 */ 52729 52730 const TwitterIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52731 width: "24", 52732 height: "24", 52733 viewBox: "0 0 24 24", 52734 version: "1.1" 52735 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52736 d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z" 52737 })); 52738 52739 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js 52740 52741 /** 52742 * WordPress dependencies 52743 */ 52744 52745 const VimeoIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52746 width: "24", 52747 height: "24", 52748 viewBox: "0 0 24 24", 52749 version: "1.1" 52750 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52751 d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z" 52752 })); 52753 52754 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js 52755 52756 /** 52757 * WordPress dependencies 52758 */ 52759 52760 const VkIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52761 width: "24", 52762 height: "24", 52763 viewBox: "0 0 24 24", 52764 version: "1.1" 52765 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52766 d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z" 52767 })); 52768 52769 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/whatsapp.js 52770 52771 /** 52772 * WordPress dependencies 52773 */ 52774 52775 const WhatsAppIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52776 width: "24", 52777 height: "24", 52778 viewBox: "0 0 24 24", 52779 version: "1.1" 52780 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52781 d: "M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z" 52782 })); 52783 52784 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/x.js 52785 52786 /** 52787 * WordPress dependencies 52788 */ 52789 52790 const XIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52791 width: "24", 52792 height: "24", 52793 viewBox: "0 0 24 24", 52794 version: "1.1" 52795 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52796 d: "M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" 52797 })); 52798 52799 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js 52800 52801 /** 52802 * WordPress dependencies 52803 */ 52804 52805 const YelpIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52806 width: "24", 52807 height: "24", 52808 viewBox: "0 0 24 24", 52809 version: "1.1" 52810 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52811 d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z" 52812 })); 52813 52814 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js 52815 52816 /** 52817 * WordPress dependencies 52818 */ 52819 52820 const YouTubeIcon = () => (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 52821 width: "24", 52822 height: "24", 52823 viewBox: "0 0 24 24", 52824 version: "1.1" 52825 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 52826 d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z" 52827 })); 52828 52829 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js 52830 /** 52831 * Internal dependencies 52832 */ 52833 52834 const social_link_variations_variations = [{ 52835 isDefault: true, 52836 name: 'wordpress', 52837 attributes: { 52838 service: 'wordpress' 52839 }, 52840 title: 'WordPress', 52841 icon: WordPressIcon 52842 }, { 52843 name: 'fivehundredpx', 52844 attributes: { 52845 service: 'fivehundredpx' 52846 }, 52847 title: '500px', 52848 icon: FivehundredpxIcon 52849 }, { 52850 name: 'amazon', 52851 attributes: { 52852 service: 'amazon' 52853 }, 52854 title: 'Amazon', 52855 icon: AmazonIcon 52856 }, { 52857 name: 'bandcamp', 52858 attributes: { 52859 service: 'bandcamp' 52860 }, 52861 title: 'Bandcamp', 52862 icon: BandcampIcon 52863 }, { 52864 name: 'behance', 52865 attributes: { 52866 service: 'behance' 52867 }, 52868 title: 'Behance', 52869 icon: BehanceIcon 52870 }, { 52871 name: 'chain', 52872 attributes: { 52873 service: 'chain' 52874 }, 52875 title: 'Link', 52876 icon: ChainIcon 52877 }, { 52878 name: 'codepen', 52879 attributes: { 52880 service: 'codepen' 52881 }, 52882 title: 'CodePen', 52883 icon: CodepenIcon 52884 }, { 52885 name: 'deviantart', 52886 attributes: { 52887 service: 'deviantart' 52888 }, 52889 title: 'DeviantArt', 52890 icon: DeviantArtIcon 52891 }, { 52892 name: 'dribbble', 52893 attributes: { 52894 service: 'dribbble' 52895 }, 52896 title: 'Dribbble', 52897 icon: DribbbleIcon 52898 }, { 52899 name: 'dropbox', 52900 attributes: { 52901 service: 'dropbox' 52902 }, 52903 title: 'Dropbox', 52904 icon: DropboxIcon 52905 }, { 52906 name: 'etsy', 52907 attributes: { 52908 service: 'etsy' 52909 }, 52910 title: 'Etsy', 52911 icon: EtsyIcon 52912 }, { 52913 name: 'facebook', 52914 attributes: { 52915 service: 'facebook' 52916 }, 52917 title: 'Facebook', 52918 icon: FacebookIcon 52919 }, { 52920 name: 'feed', 52921 attributes: { 52922 service: 'feed' 52923 }, 52924 title: 'RSS Feed', 52925 icon: FeedIcon 52926 }, { 52927 name: 'flickr', 52928 attributes: { 52929 service: 'flickr' 52930 }, 52931 title: 'Flickr', 52932 icon: FlickrIcon 52933 }, { 52934 name: 'foursquare', 52935 attributes: { 52936 service: 'foursquare' 52937 }, 52938 title: 'Foursquare', 52939 icon: FoursquareIcon 52940 }, { 52941 name: 'goodreads', 52942 attributes: { 52943 service: 'goodreads' 52944 }, 52945 title: 'Goodreads', 52946 icon: GoodreadsIcon 52947 }, { 52948 name: 'google', 52949 attributes: { 52950 service: 'google' 52951 }, 52952 title: 'Google', 52953 icon: GoogleIcon 52954 }, { 52955 name: 'github', 52956 attributes: { 52957 service: 'github' 52958 }, 52959 title: 'GitHub', 52960 icon: GitHubIcon 52961 }, { 52962 name: 'gravatar', 52963 attributes: { 52964 service: 'gravatar' 52965 }, 52966 title: 'Gravatar', 52967 icon: GravatarIcon 52968 }, { 52969 name: 'instagram', 52970 attributes: { 52971 service: 'instagram' 52972 }, 52973 title: 'Instagram', 52974 icon: InstagramIcon 52975 }, { 52976 name: 'lastfm', 52977 attributes: { 52978 service: 'lastfm' 52979 }, 52980 title: 'Last.fm', 52981 icon: LastfmIcon 52982 }, { 52983 name: 'linkedin', 52984 attributes: { 52985 service: 'linkedin' 52986 }, 52987 title: 'LinkedIn', 52988 icon: LinkedInIcon 52989 }, { 52990 name: 'mail', 52991 attributes: { 52992 service: 'mail' 52993 }, 52994 title: 'Mail', 52995 keywords: ['email', 'e-mail'], 52996 icon: MailIcon 52997 }, { 52998 name: 'mastodon', 52999 attributes: { 53000 service: 'mastodon' 53001 }, 53002 title: 'Mastodon', 53003 icon: MastodonIcon 53004 }, { 53005 name: 'meetup', 53006 attributes: { 53007 service: 'meetup' 53008 }, 53009 title: 'Meetup', 53010 icon: MeetupIcon 53011 }, { 53012 name: 'medium', 53013 attributes: { 53014 service: 'medium' 53015 }, 53016 title: 'Medium', 53017 icon: MediumIcon 53018 }, { 53019 name: 'patreon', 53020 attributes: { 53021 service: 'patreon' 53022 }, 53023 title: 'Patreon', 53024 icon: PatreonIcon 53025 }, { 53026 name: 'pinterest', 53027 attributes: { 53028 service: 'pinterest' 53029 }, 53030 title: 'Pinterest', 53031 icon: PinterestIcon 53032 }, { 53033 name: 'pocket', 53034 attributes: { 53035 service: 'pocket' 53036 }, 53037 title: 'Pocket', 53038 icon: PocketIcon 53039 }, { 53040 name: 'reddit', 53041 attributes: { 53042 service: 'reddit' 53043 }, 53044 title: 'Reddit', 53045 icon: RedditIcon 53046 }, { 53047 name: 'skype', 53048 attributes: { 53049 service: 'skype' 53050 }, 53051 title: 'Skype', 53052 icon: SkypeIcon 53053 }, { 53054 name: 'snapchat', 53055 attributes: { 53056 service: 'snapchat' 53057 }, 53058 title: 'Snapchat', 53059 icon: SnapchatIcon 53060 }, { 53061 name: 'soundcloud', 53062 attributes: { 53063 service: 'soundcloud' 53064 }, 53065 title: 'SoundCloud', 53066 icon: SoundCloudIcon 53067 }, { 53068 name: 'spotify', 53069 attributes: { 53070 service: 'spotify' 53071 }, 53072 title: 'Spotify', 53073 icon: SpotifyIcon 53074 }, { 53075 name: 'telegram', 53076 attributes: { 53077 service: 'telegram' 53078 }, 53079 title: 'Telegram', 53080 icon: TelegramIcon 53081 }, { 53082 name: 'threads', 53083 attributes: { 53084 service: 'threads' 53085 }, 53086 title: 'Threads', 53087 icon: ThreadsIcon 53088 }, { 53089 name: 'tiktok', 53090 attributes: { 53091 service: 'tiktok' 53092 }, 53093 title: 'TikTok', 53094 icon: TiktokIcon 53095 }, { 53096 name: 'tumblr', 53097 attributes: { 53098 service: 'tumblr' 53099 }, 53100 title: 'Tumblr', 53101 icon: TumblrIcon 53102 }, { 53103 name: 'twitch', 53104 attributes: { 53105 service: 'twitch' 53106 }, 53107 title: 'Twitch', 53108 icon: TwitchIcon 53109 }, { 53110 name: 'twitter', 53111 attributes: { 53112 service: 'twitter' 53113 }, 53114 title: 'Twitter', 53115 icon: TwitterIcon 53116 }, { 53117 name: 'vimeo', 53118 attributes: { 53119 service: 'vimeo' 53120 }, 53121 title: 'Vimeo', 53122 icon: VimeoIcon 53123 }, { 53124 name: 'vk', 53125 attributes: { 53126 service: 'vk' 53127 }, 53128 title: 'VK', 53129 icon: VkIcon 53130 }, { 53131 name: 'whatsapp', 53132 attributes: { 53133 service: 'whatsapp' 53134 }, 53135 title: 'WhatsApp', 53136 icon: WhatsAppIcon 53137 }, { 53138 name: 'x', 53139 attributes: { 53140 service: 'x' 53141 }, 53142 keywords: ['twitter'], 53143 title: 'X', 53144 icon: XIcon 53145 }, { 53146 name: 'yelp', 53147 attributes: { 53148 service: 'yelp' 53149 }, 53150 title: 'Yelp', 53151 icon: YelpIcon 53152 }, { 53153 name: 'youtube', 53154 attributes: { 53155 service: 'youtube' 53156 }, 53157 title: 'YouTube', 53158 icon: YouTubeIcon 53159 }]; 53160 53161 /** 53162 * Add `isActive` function to all `social link` variations, if not defined. 53163 * `isActive` function is used to find a variation match from a created 53164 * Block by providing its attributes. 53165 */ 53166 social_link_variations_variations.forEach(variation => { 53167 if (variation.isActive) return; 53168 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service; 53169 }); 53170 /* harmony default export */ const social_link_variations = (social_link_variations_variations); 53171 53172 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js 53173 /** 53174 * WordPress dependencies 53175 */ 53176 53177 53178 /** 53179 * Internal dependencies 53180 */ 53181 53182 53183 53184 /** 53185 * Retrieves the social service's icon component. 53186 * 53187 * @param {string} name key for a social service (lowercase slug) 53188 * 53189 * @return {Component} Icon component for social service. 53190 */ 53191 const getIconBySite = name => { 53192 const variation = social_link_variations.find(v => v.name === name); 53193 return variation ? variation.icon : ChainIcon; 53194 }; 53195 53196 /** 53197 * Retrieves the display name for the social service. 53198 * 53199 * @param {string} name key for a social service (lowercase slug) 53200 * 53201 * @return {string} Display name for social service 53202 */ 53203 const getNameBySite = name => { 53204 const variation = social_link_variations.find(v => v.name === name); 53205 return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon'); 53206 }; 53207 53208 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js 53209 53210 /** 53211 * External dependencies 53212 */ 53213 53214 53215 /** 53216 * WordPress dependencies 53217 */ 53218 53219 53220 53221 53222 53223 53224 53225 53226 /** 53227 * Internal dependencies 53228 */ 53229 53230 const SocialLinkURLPopover = ({ 53231 url, 53232 setAttributes, 53233 setPopover, 53234 popoverAnchor, 53235 clientId 53236 }) => { 53237 const { 53238 removeBlock 53239 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 53240 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, { 53241 anchor: popoverAnchor, 53242 onClose: () => setPopover(false) 53243 }, (0,external_React_namespaceObject.createElement)("form", { 53244 className: "block-editor-url-popover__link-editor", 53245 onSubmit: event => { 53246 event.preventDefault(); 53247 setPopover(false); 53248 } 53249 }, (0,external_React_namespaceObject.createElement)("div", { 53250 className: "block-editor-url-input" 53251 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, { 53252 __nextHasNoMarginBottom: true, 53253 value: url, 53254 onChange: nextURL => setAttributes({ 53255 url: nextURL 53256 }), 53257 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'), 53258 disableSuggestions: true, 53259 onKeyDown: event => { 53260 if (!!url || event.defaultPrevented || ![external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode)) { 53261 return; 53262 } 53263 removeBlock(clientId); 53264 } 53265 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 53266 icon: keyboard_return, 53267 label: (0,external_wp_i18n_namespaceObject.__)('Apply'), 53268 type: "submit" 53269 }))); 53270 }; 53271 const SocialLinkEdit = ({ 53272 attributes, 53273 context, 53274 isSelected, 53275 setAttributes, 53276 clientId 53277 }) => { 53278 const { 53279 url, 53280 service, 53281 label, 53282 rel 53283 } = attributes; 53284 const { 53285 showLabels, 53286 iconColor, 53287 iconColorValue, 53288 iconBackgroundColor, 53289 iconBackgroundColorValue 53290 } = context; 53291 const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false); 53292 const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, { 53293 'wp-social-link__is-incomplete': !url, 53294 [`has-$iconColor}-color`]: iconColor, 53295 [`has-$iconBackgroundColor}-background-color`]: iconBackgroundColor 53296 }); 53297 53298 // Use internal state instead of a ref to make sure that the component 53299 // re-renders when the popover's anchor updates. 53300 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 53301 const IconComponent = getIconBySite(service); 53302 const socialLinkName = getNameBySite(service); 53303 const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName; 53304 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 53305 className: classes, 53306 style: { 53307 color: iconColorValue, 53308 backgroundColor: iconBackgroundColorValue 53309 } 53310 }); 53311 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 53312 title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: name of the social service. */ 53313 (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName), 53314 initialOpen: false 53315 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 53316 __nextHasNoMarginBottom: true, 53317 label: (0,external_wp_i18n_namespaceObject.__)('Link label'), 53318 help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'), 53319 value: label || '', 53320 onChange: value => setAttributes({ 53321 label: value 53322 }) 53323 })))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 53324 group: "advanced" 53325 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 53326 __nextHasNoMarginBottom: true, 53327 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 53328 value: rel || '', 53329 onChange: value => setAttributes({ 53330 rel: value 53331 }) 53332 })), (0,external_React_namespaceObject.createElement)("li", { 53333 ...blockProps 53334 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 53335 className: "wp-block-social-link-anchor", 53336 ref: setPopoverAnchor, 53337 onClick: () => setPopover(true) 53338 }, (0,external_React_namespaceObject.createElement)(IconComponent, null), (0,external_React_namespaceObject.createElement)("span", { 53339 className: classnames_default()('wp-block-social-link-label', { 53340 'screen-reader-text': !showLabels 53341 }) 53342 }, socialLinkLabel), isSelected && showURLPopover && (0,external_React_namespaceObject.createElement)(SocialLinkURLPopover, { 53343 url: url, 53344 setAttributes: setAttributes, 53345 setPopover: setPopover, 53346 popoverAnchor: popoverAnchor, 53347 clientId: clientId 53348 })))); 53349 }; 53350 /* harmony default export */ const social_link_edit = (SocialLinkEdit); 53351 53352 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js 53353 /** 53354 * WordPress dependencies 53355 */ 53356 53357 53358 /** 53359 * Internal dependencies 53360 */ 53361 53362 53363 const social_link_metadata = { 53364 $schema: "https://schemas.wp.org/trunk/block.json", 53365 apiVersion: 3, 53366 name: "core/social-link", 53367 title: "Social Icon", 53368 category: "widgets", 53369 parent: ["core/social-links"], 53370 description: "Display an icon linking to a social media profile or site.", 53371 textdomain: "default", 53372 attributes: { 53373 url: { 53374 type: "string" 53375 }, 53376 service: { 53377 type: "string" 53378 }, 53379 label: { 53380 type: "string" 53381 }, 53382 rel: { 53383 type: "string" 53384 } 53385 }, 53386 usesContext: ["openInNewTab", "showLabels", "iconColor", "iconColorValue", "iconBackgroundColor", "iconBackgroundColorValue"], 53387 supports: { 53388 reusable: false, 53389 html: false, 53390 interactivity: { 53391 clientNavigation: true 53392 } 53393 }, 53394 editorStyle: "wp-block-social-link-editor" 53395 }; 53396 53397 const { 53398 name: social_link_name 53399 } = social_link_metadata; 53400 53401 const social_link_settings = { 53402 icon: library_share, 53403 edit: social_link_edit, 53404 variations: social_link_variations 53405 }; 53406 const social_link_init = () => initBlock({ 53407 name: social_link_name, 53408 metadata: social_link_metadata, 53409 settings: social_link_settings 53410 }); 53411 53412 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js 53413 53414 /** 53415 * External dependencies 53416 */ 53417 53418 53419 /** 53420 * WordPress dependencies 53421 */ 53422 53423 53424 /** 53425 * The specific handling by `className` below is needed because `itemsJustification` 53426 * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't 53427 * declared in block.json. 53428 * 53429 * @param {Object} attributes Block's attributes. 53430 */ 53431 const social_links_deprecated_migrateWithLayout = attributes => { 53432 if (!!attributes.layout) { 53433 return attributes; 53434 } 53435 const { 53436 className 53437 } = attributes; 53438 // Matches classes with `items-justified-` prefix. 53439 const prefix = `items-justified-`; 53440 const justifiedItemsRegex = new RegExp(`\\b$prefix}[^ ]*[ ]?\\b`, 'g'); 53441 const newAttributes = { 53442 ...attributes, 53443 className: className?.replace(justifiedItemsRegex, '').trim() 53444 }; 53445 /** 53446 * Add `layout` prop only if `justifyContent` is defined, for backwards 53447 * compatibility. In other cases the block's default layout will be used. 53448 * Also noting that due to the missing attribute, it's possible for a block 53449 * to have more than one of `justified` classes. 53450 */ 53451 const justifyContent = className?.match(justifiedItemsRegex)?.[0]?.trim(); 53452 if (justifyContent) { 53453 Object.assign(newAttributes, { 53454 layout: { 53455 type: 'flex', 53456 justifyContent: justifyContent.slice(prefix.length) 53457 } 53458 }); 53459 } 53460 return newAttributes; 53461 }; 53462 53463 // Social Links block deprecations. 53464 const social_links_deprecated_deprecated = [ 53465 // V1. Remove CSS variable use for colors. 53466 { 53467 attributes: { 53468 iconColor: { 53469 type: 'string' 53470 }, 53471 customIconColor: { 53472 type: 'string' 53473 }, 53474 iconColorValue: { 53475 type: 'string' 53476 }, 53477 iconBackgroundColor: { 53478 type: 'string' 53479 }, 53480 customIconBackgroundColor: { 53481 type: 'string' 53482 }, 53483 iconBackgroundColorValue: { 53484 type: 'string' 53485 }, 53486 openInNewTab: { 53487 type: 'boolean', 53488 default: false 53489 }, 53490 size: { 53491 type: 'string' 53492 } 53493 }, 53494 providesContext: { 53495 openInNewTab: 'openInNewTab' 53496 }, 53497 supports: { 53498 align: ['left', 'center', 'right'], 53499 anchor: true 53500 }, 53501 migrate: social_links_deprecated_migrateWithLayout, 53502 save: props => { 53503 const { 53504 attributes: { 53505 iconBackgroundColorValue, 53506 iconColorValue, 53507 itemsJustification, 53508 size 53509 } 53510 } = props; 53511 const className = classnames_default()(size, { 53512 'has-icon-color': iconColorValue, 53513 'has-icon-background-color': iconBackgroundColorValue, 53514 [`items-justified-$itemsJustification}`]: itemsJustification 53515 }); 53516 const style = { 53517 '--wp--social-links--icon-color': iconColorValue, 53518 '--wp--social-links--icon-background-color': iconBackgroundColorValue 53519 }; 53520 return (0,external_React_namespaceObject.createElement)("ul", { 53521 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 53522 className, 53523 style 53524 }) 53525 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)); 53526 } 53527 }]; 53528 /* harmony default export */ const social_links_deprecated = (social_links_deprecated_deprecated); 53529 53530 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js 53531 53532 /** 53533 * WordPress dependencies 53534 */ 53535 53536 const check = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 53537 xmlns: "http://www.w3.org/2000/svg", 53538 viewBox: "0 0 24 24" 53539 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 53540 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" 53541 })); 53542 /* harmony default export */ const library_check = (check); 53543 53544 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js 53545 53546 /** 53547 * External dependencies 53548 */ 53549 53550 53551 /** 53552 * WordPress dependencies 53553 */ 53554 53555 53556 53557 53558 53559 const sizeOptions = [{ 53560 name: (0,external_wp_i18n_namespaceObject.__)('Small'), 53561 value: 'has-small-icon-size' 53562 }, { 53563 name: (0,external_wp_i18n_namespaceObject.__)('Normal'), 53564 value: 'has-normal-icon-size' 53565 }, { 53566 name: (0,external_wp_i18n_namespaceObject.__)('Large'), 53567 value: 'has-large-icon-size' 53568 }, { 53569 name: (0,external_wp_i18n_namespaceObject.__)('Huge'), 53570 value: 'has-huge-icon-size' 53571 }]; 53572 function SocialLinksEdit(props) { 53573 var _attributes$layout$or; 53574 const { 53575 clientId, 53576 attributes, 53577 iconBackgroundColor, 53578 iconColor, 53579 isSelected, 53580 setAttributes, 53581 setIconBackgroundColor, 53582 setIconColor 53583 } = props; 53584 const { 53585 iconBackgroundColorValue, 53586 customIconBackgroundColor, 53587 iconColorValue, 53588 openInNewTab, 53589 showLabels, 53590 size 53591 } = attributes; 53592 const logosOnly = attributes.className?.includes('is-style-logos-only'); 53593 53594 // Remove icon background color when logos only style is selected or 53595 // restore it when any other style is selected. 53596 const backgroundBackup = (0,external_wp_element_namespaceObject.useRef)({}); 53597 (0,external_wp_element_namespaceObject.useEffect)(() => { 53598 if (logosOnly) { 53599 backgroundBackup.current = { 53600 iconBackgroundColor, 53601 iconBackgroundColorValue, 53602 customIconBackgroundColor 53603 }; 53604 setAttributes({ 53605 iconBackgroundColor: undefined, 53606 customIconBackgroundColor: undefined, 53607 iconBackgroundColorValue: undefined 53608 }); 53609 } else { 53610 setAttributes({ 53611 ...backgroundBackup.current 53612 }); 53613 } 53614 }, [logosOnly]); 53615 const SocialPlaceholder = (0,external_React_namespaceObject.createElement)("li", { 53616 className: "wp-block-social-links__social-placeholder" 53617 }, (0,external_React_namespaceObject.createElement)("div", { 53618 className: "wp-block-social-links__social-placeholder-icons" 53619 }, (0,external_React_namespaceObject.createElement)("div", { 53620 className: "wp-social-link wp-social-link-twitter" 53621 }), (0,external_React_namespaceObject.createElement)("div", { 53622 className: "wp-social-link wp-social-link-facebook" 53623 }), (0,external_React_namespaceObject.createElement)("div", { 53624 className: "wp-social-link wp-social-link-instagram" 53625 }))); 53626 const SelectedSocialPlaceholder = (0,external_React_namespaceObject.createElement)("li", { 53627 className: "wp-block-social-links__social-prompt" 53628 }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); 53629 53630 // Fallback color values are used maintain selections in case switching 53631 // themes and named colors in palette do not match. 53632 const className = classnames_default()(size, { 53633 'has-visible-labels': showLabels, 53634 'has-icon-color': iconColor.color || iconColorValue, 53635 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue 53636 }); 53637 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 53638 className 53639 }); 53640 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 53641 placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder, 53642 templateLock: false, 53643 orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal', 53644 __experimentalAppenderTagName: 'li' 53645 }); 53646 const POPOVER_PROPS = { 53647 position: 'bottom right' 53648 }; 53649 const colorSettings = [{ 53650 // Use custom attribute as fallback to prevent loss of named color selection when 53651 // switching themes to a new theme that does not have a matching named color. 53652 value: iconColor.color || iconColorValue, 53653 onChange: colorValue => { 53654 setIconColor(colorValue); 53655 setAttributes({ 53656 iconColorValue: colorValue 53657 }); 53658 }, 53659 label: (0,external_wp_i18n_namespaceObject.__)('Icon color'), 53660 resetAllFilter: () => { 53661 setIconColor(undefined); 53662 setAttributes({ 53663 iconColorValue: undefined 53664 }); 53665 } 53666 }]; 53667 if (!logosOnly) { 53668 colorSettings.push({ 53669 // Use custom attribute as fallback to prevent loss of named color selection when 53670 // switching themes to a new theme that does not have a matching named color. 53671 value: iconBackgroundColor.color || iconBackgroundColorValue, 53672 onChange: colorValue => { 53673 setIconBackgroundColor(colorValue); 53674 setAttributes({ 53675 iconBackgroundColorValue: colorValue 53676 }); 53677 }, 53678 label: (0,external_wp_i18n_namespaceObject.__)('Icon background'), 53679 resetAllFilter: () => { 53680 setIconBackgroundColor(undefined); 53681 setAttributes({ 53682 iconBackgroundColorValue: undefined 53683 }); 53684 } 53685 }); 53686 } 53687 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 53688 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 53689 group: "other" 53690 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 53691 label: (0,external_wp_i18n_namespaceObject.__)('Size'), 53692 text: (0,external_wp_i18n_namespaceObject.__)('Size'), 53693 icon: null, 53694 popoverProps: POPOVER_PROPS 53695 }, ({ 53696 onClose 53697 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => { 53698 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 53699 icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check, 53700 isSelected: size === entry.value, 53701 key: entry.value, 53702 onClick: () => { 53703 setAttributes({ 53704 size: entry.value 53705 }); 53706 }, 53707 onClose: onClose, 53708 role: "menuitemradio" 53709 }, entry.name); 53710 })))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 53711 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 53712 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 53713 __nextHasNoMarginBottom: true, 53714 label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'), 53715 checked: openInNewTab, 53716 onChange: () => setAttributes({ 53717 openInNewTab: !openInNewTab 53718 }) 53719 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 53720 __nextHasNoMarginBottom: true, 53721 label: (0,external_wp_i18n_namespaceObject.__)('Show labels'), 53722 checked: showLabels, 53723 onChange: () => setAttributes({ 53724 showLabels: !showLabels 53725 }) 53726 }))), colorGradientSettings.hasColorsOrGradients && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 53727 group: "color" 53728 }, colorSettings.map(({ 53729 onChange, 53730 label, 53731 value, 53732 resetAllFilter 53733 }) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 53734 key: `social-links-color-$label}`, 53735 __experimentalIsRenderedInSidebar: true, 53736 settings: [{ 53737 colorValue: value, 53738 label, 53739 onColorChange: onChange, 53740 isShownByDefault: true, 53741 resetAllFilter, 53742 enableAlpha: true 53743 }], 53744 panelId: clientId, 53745 ...colorGradientSettings 53746 })), !logosOnly && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 53747 textColor: iconColorValue, 53748 backgroundColor: iconBackgroundColorValue, 53749 isLargeText: false 53750 })), (0,external_React_namespaceObject.createElement)("ul", { 53751 ...innerBlocksProps 53752 })); 53753 } 53754 const iconColorAttributes = { 53755 iconColor: 'icon-color', 53756 iconBackgroundColor: 'icon-background-color' 53757 }; 53758 /* harmony default export */ const social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit)); 53759 53760 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js 53761 53762 /** 53763 * External dependencies 53764 */ 53765 53766 53767 /** 53768 * WordPress dependencies 53769 */ 53770 53771 function social_links_save_save(props) { 53772 const { 53773 attributes: { 53774 iconBackgroundColorValue, 53775 iconColorValue, 53776 showLabels, 53777 size 53778 } 53779 } = props; 53780 const className = classnames_default()(size, { 53781 'has-visible-labels': showLabels, 53782 'has-icon-color': iconColorValue, 53783 'has-icon-background-color': iconBackgroundColorValue 53784 }); 53785 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 53786 className 53787 }); 53788 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 53789 return (0,external_React_namespaceObject.createElement)("ul", { 53790 ...innerBlocksProps 53791 }); 53792 } 53793 53794 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js 53795 /** 53796 * WordPress dependencies 53797 */ 53798 53799 53800 /** 53801 * Internal dependencies 53802 */ 53803 53804 53805 53806 const social_links_metadata = { 53807 $schema: "https://schemas.wp.org/trunk/block.json", 53808 apiVersion: 3, 53809 name: "core/social-links", 53810 title: "Social Icons", 53811 category: "widgets", 53812 allowedBlocks: ["core/social-link"], 53813 description: "Display icons linking to your social media profiles or sites.", 53814 keywords: ["links"], 53815 textdomain: "default", 53816 attributes: { 53817 iconColor: { 53818 type: "string" 53819 }, 53820 customIconColor: { 53821 type: "string" 53822 }, 53823 iconColorValue: { 53824 type: "string" 53825 }, 53826 iconBackgroundColor: { 53827 type: "string" 53828 }, 53829 customIconBackgroundColor: { 53830 type: "string" 53831 }, 53832 iconBackgroundColorValue: { 53833 type: "string" 53834 }, 53835 openInNewTab: { 53836 type: "boolean", 53837 "default": false 53838 }, 53839 showLabels: { 53840 type: "boolean", 53841 "default": false 53842 }, 53843 size: { 53844 type: "string" 53845 } 53846 }, 53847 providesContext: { 53848 openInNewTab: "openInNewTab", 53849 showLabels: "showLabels", 53850 iconColor: "iconColor", 53851 iconColorValue: "iconColorValue", 53852 iconBackgroundColor: "iconBackgroundColor", 53853 iconBackgroundColorValue: "iconBackgroundColorValue" 53854 }, 53855 supports: { 53856 align: ["left", "center", "right"], 53857 anchor: true, 53858 __experimentalExposeControlsToChildren: true, 53859 layout: { 53860 allowSwitching: false, 53861 allowInheriting: false, 53862 allowVerticalAlignment: false, 53863 "default": { 53864 type: "flex" 53865 } 53866 }, 53867 color: { 53868 enableContrastChecker: false, 53869 background: true, 53870 gradients: true, 53871 text: false, 53872 __experimentalDefaultControls: { 53873 background: false 53874 } 53875 }, 53876 spacing: { 53877 blockGap: ["horizontal", "vertical"], 53878 margin: true, 53879 padding: true, 53880 units: ["px", "em", "rem", "vh", "vw"], 53881 __experimentalDefaultControls: { 53882 blockGap: true, 53883 margin: true, 53884 padding: false 53885 } 53886 }, 53887 interactivity: { 53888 clientNavigation: true 53889 } 53890 }, 53891 styles: [{ 53892 name: "default", 53893 label: "Default", 53894 isDefault: true 53895 }, { 53896 name: "logos-only", 53897 label: "Logos Only" 53898 }, { 53899 name: "pill-shape", 53900 label: "Pill Shape" 53901 }], 53902 editorStyle: "wp-block-social-links-editor", 53903 style: "wp-block-social-links" 53904 }; 53905 53906 const { 53907 name: social_links_name 53908 } = social_links_metadata; 53909 53910 const social_links_settings = { 53911 example: { 53912 innerBlocks: [{ 53913 name: 'core/social-link', 53914 attributes: { 53915 service: 'wordpress', 53916 url: 'https://wordpress.org' 53917 } 53918 }, { 53919 name: 'core/social-link', 53920 attributes: { 53921 service: 'facebook', 53922 url: 'https://www.facebook.com/WordPress/' 53923 } 53924 }, { 53925 name: 'core/social-link', 53926 attributes: { 53927 service: 'twitter', 53928 url: 'https://twitter.com/WordPress' 53929 } 53930 }] 53931 }, 53932 icon: library_share, 53933 edit: social_links_edit, 53934 save: social_links_save_save, 53935 deprecated: social_links_deprecated 53936 }; 53937 const social_links_init = () => initBlock({ 53938 name: social_links_name, 53939 metadata: social_links_metadata, 53940 settings: social_links_settings 53941 }); 53942 53943 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js 53944 53945 /** 53946 * WordPress dependencies 53947 */ 53948 53949 const resizeCornerNE = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 53950 viewBox: "0 0 24 24", 53951 xmlns: "http://www.w3.org/2000/svg" 53952 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 53953 d: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z" 53954 })); 53955 /* harmony default export */ const resize_corner_n_e = (resizeCornerNE); 53956 53957 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js 53958 53959 /** 53960 * WordPress dependencies 53961 */ 53962 53963 const spacer_deprecated_deprecated = [{ 53964 attributes: { 53965 height: { 53966 type: 'number', 53967 default: 100 53968 }, 53969 width: { 53970 type: 'number' 53971 } 53972 }, 53973 migrate(attributes) { 53974 const { 53975 height, 53976 width 53977 } = attributes; 53978 return { 53979 ...attributes, 53980 width: width !== undefined ? `$width}px` : undefined, 53981 height: height !== undefined ? `$height}px` : undefined 53982 }; 53983 }, 53984 save({ 53985 attributes 53986 }) { 53987 return (0,external_React_namespaceObject.createElement)("div", { 53988 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 53989 style: { 53990 height: attributes.height, 53991 width: attributes.width 53992 }, 53993 'aria-hidden': true 53994 }) 53995 }); 53996 } 53997 }]; 53998 /* harmony default export */ const spacer_deprecated = (spacer_deprecated_deprecated); 53999 54000 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/constants.js 54001 const MIN_SPACER_SIZE = 0; 54002 54003 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js 54004 54005 /** 54006 * WordPress dependencies 54007 */ 54008 54009 54010 54011 54012 54013 54014 /** 54015 * Internal dependencies 54016 */ 54017 54018 function DimensionInput({ 54019 label, 54020 onChange, 54021 isResizing, 54022 value = '' 54023 }) { 54024 const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); 54025 const [spacingSizes, spacingUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.spacingSizes', 'spacing.units'); 54026 // In most contexts the spacer size cannot meaningfully be set to a 54027 // percentage, since this is relative to the parent container. This 54028 // unit is disabled from the UI. 54029 const availableUnits = spacingUnits ? spacingUnits.filter(unit => unit !== '%') : ['px', 'em', 'rem', 'vw', 'vh']; 54030 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 54031 availableUnits, 54032 defaultValues: { 54033 px: 100, 54034 em: 10, 54035 rem: 10, 54036 vw: 10, 54037 vh: 25 54038 } 54039 }); 54040 const handleOnChange = unprocessedValue => { 54041 onChange(unprocessedValue.all); 54042 }; 54043 54044 // Force the unit to update to `px` when the Spacer is being resized. 54045 const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); 54046 const computedValue = (0,external_wp_blockEditor_namespaceObject.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? 'px' : parsedUnit].join(''); 54047 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (!spacingSizes || spacingSizes?.length === 0) && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 54048 label: label, 54049 id: inputId 54050 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 54051 id: inputId, 54052 isResetValueOnUnitChange: true, 54053 min: MIN_SPACER_SIZE, 54054 onChange: handleOnChange, 54055 style: { 54056 maxWidth: 80 54057 }, 54058 value: computedValue, 54059 units: units 54060 })), spacingSizes?.length > 0 && (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 54061 className: "tools-panel-item-spacing" 54062 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalSpacingSizesControl, { 54063 values: { 54064 all: computedValue 54065 }, 54066 onChange: handleOnChange, 54067 label: label, 54068 sides: ['all'], 54069 units: units, 54070 allowReset: false, 54071 splitOnAxis: false, 54072 showSideInLabel: false 54073 }))); 54074 } 54075 function SpacerControls({ 54076 setAttributes, 54077 orientation, 54078 height, 54079 width, 54080 isResizing 54081 }) { 54082 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 54083 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 54084 }, orientation === 'horizontal' && (0,external_React_namespaceObject.createElement)(DimensionInput, { 54085 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 54086 value: width, 54087 onChange: nextWidth => setAttributes({ 54088 width: nextWidth 54089 }), 54090 isResizing: isResizing 54091 }), orientation !== 'horizontal' && (0,external_React_namespaceObject.createElement)(DimensionInput, { 54092 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 54093 value: height, 54094 onChange: nextHeight => setAttributes({ 54095 height: nextHeight 54096 }), 54097 isResizing: isResizing 54098 }))); 54099 } 54100 54101 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js 54102 54103 /** 54104 * External dependencies 54105 */ 54106 54107 54108 /** 54109 * WordPress dependencies 54110 */ 54111 54112 54113 54114 54115 54116 54117 /** 54118 * Internal dependencies 54119 */ 54120 54121 54122 const ResizableSpacer = ({ 54123 orientation, 54124 onResizeStart, 54125 onResize, 54126 onResizeStop, 54127 isSelected, 54128 isResizing, 54129 setIsResizing, 54130 ...props 54131 }) => { 54132 const getCurrentSize = elt => { 54133 return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight; 54134 }; 54135 const getNextVal = elt => { 54136 return `$getCurrentSize(elt)}px`; 54137 }; 54138 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { 54139 className: classnames_default()('block-library-spacer__resize-container', { 54140 'resize-horizontal': orientation === 'horizontal', 54141 'is-resizing': isResizing, 54142 'is-selected': isSelected 54143 }), 54144 onResizeStart: (_event, _direction, elt) => { 54145 const nextVal = getNextVal(elt); 54146 onResizeStart(nextVal); 54147 onResize(nextVal); 54148 }, 54149 onResize: (_event, _direction, elt) => { 54150 onResize(getNextVal(elt)); 54151 if (!isResizing) { 54152 setIsResizing(true); 54153 } 54154 }, 54155 onResizeStop: (_event, _direction, elt) => { 54156 const nextVal = getCurrentSize(elt); 54157 onResizeStop(`$nextVal}px`); 54158 setIsResizing(false); 54159 }, 54160 __experimentalShowTooltip: true, 54161 __experimentalTooltipProps: { 54162 axis: orientation === 'horizontal' ? 'x' : 'y', 54163 position: 'corner', 54164 isVisible: isResizing 54165 }, 54166 showHandle: isSelected, 54167 ...props 54168 }); 54169 }; 54170 const SpacerEdit = ({ 54171 attributes, 54172 isSelected, 54173 setAttributes, 54174 toggleSelection, 54175 context, 54176 __unstableParentLayout: parentLayout, 54177 className 54178 }) => { 54179 const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => { 54180 const editorSettings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 54181 return editorSettings?.disableCustomSpacingSizes; 54182 }); 54183 const { 54184 orientation 54185 } = context; 54186 const { 54187 orientation: parentOrientation, 54188 type, 54189 default: { 54190 type: defaultType 54191 } = {} 54192 } = parentLayout || {}; 54193 // Check if the spacer is inside a flex container. 54194 const isFlexLayout = type === 'flex' || !type && defaultType === 'flex'; 54195 // If the spacer is inside a flex container, it should either inherit the orientation 54196 // of the parent or use the flex default orientation. 54197 const inheritedOrientation = !parentOrientation && isFlexLayout ? 'horizontal' : parentOrientation || orientation; 54198 const { 54199 height, 54200 width, 54201 style: blockStyle = {} 54202 } = attributes; 54203 const { 54204 layout = {} 54205 } = blockStyle; 54206 const { 54207 selfStretch, 54208 flexSize 54209 } = layout; 54210 const [spacingSizes] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.spacingSizes'); 54211 const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); 54212 const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null); 54213 const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null); 54214 const onResizeStart = () => toggleSelection(false); 54215 const onResizeStop = () => toggleSelection(true); 54216 const handleOnVerticalResizeStop = newHeight => { 54217 onResizeStop(); 54218 if (isFlexLayout) { 54219 setAttributes({ 54220 style: { 54221 ...blockStyle, 54222 layout: { 54223 ...layout, 54224 flexSize: newHeight, 54225 selfStretch: 'fixed' 54226 } 54227 } 54228 }); 54229 } 54230 setAttributes({ 54231 height: newHeight 54232 }); 54233 setTemporaryHeight(null); 54234 }; 54235 const handleOnHorizontalResizeStop = newWidth => { 54236 onResizeStop(); 54237 if (isFlexLayout) { 54238 setAttributes({ 54239 style: { 54240 ...blockStyle, 54241 layout: { 54242 ...layout, 54243 flexSize: newWidth, 54244 selfStretch: 'fixed' 54245 } 54246 } 54247 }); 54248 } 54249 setAttributes({ 54250 width: newWidth 54251 }); 54252 setTemporaryWidth(null); 54253 }; 54254 const getHeightForVerticalBlocks = () => { 54255 if (isFlexLayout) { 54256 return undefined; 54257 } 54258 return temporaryHeight || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(height) || undefined; 54259 }; 54260 const getWidthForHorizontalBlocks = () => { 54261 if (isFlexLayout) { 54262 return undefined; 54263 } 54264 return temporaryWidth || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) || undefined; 54265 }; 54266 const sizeConditionalOnOrientation = inheritedOrientation === 'horizontal' ? temporaryWidth || flexSize : temporaryHeight || flexSize; 54267 const style = { 54268 height: inheritedOrientation === 'horizontal' ? 24 : getHeightForVerticalBlocks(), 54269 width: inheritedOrientation === 'horizontal' ? getWidthForHorizontalBlocks() : undefined, 54270 // In vertical flex containers, the spacer shrinks to nothing without a minimum width. 54271 minWidth: inheritedOrientation === 'vertical' && isFlexLayout ? 48 : undefined, 54272 // Add flex-basis so temporary sizes are respected. 54273 flexBasis: isFlexLayout ? sizeConditionalOnOrientation : undefined, 54274 // Remove flex-grow when resizing. 54275 flexGrow: isFlexLayout && isResizing ? 0 : undefined 54276 }; 54277 const resizableBoxWithOrientation = blockOrientation => { 54278 if (blockOrientation === 'horizontal') { 54279 return (0,external_React_namespaceObject.createElement)(ResizableSpacer, { 54280 minWidth: MIN_SPACER_SIZE, 54281 enable: { 54282 top: false, 54283 right: true, 54284 bottom: false, 54285 left: false, 54286 topRight: false, 54287 bottomRight: false, 54288 bottomLeft: false, 54289 topLeft: false 54290 }, 54291 orientation: blockOrientation, 54292 onResizeStart: onResizeStart, 54293 onResize: setTemporaryWidth, 54294 onResizeStop: handleOnHorizontalResizeStop, 54295 isSelected: isSelected, 54296 isResizing: isResizing, 54297 setIsResizing: setIsResizing 54298 }); 54299 } 54300 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(ResizableSpacer, { 54301 minHeight: MIN_SPACER_SIZE, 54302 enable: { 54303 top: false, 54304 right: false, 54305 bottom: true, 54306 left: false, 54307 topRight: false, 54308 bottomRight: false, 54309 bottomLeft: false, 54310 topLeft: false 54311 }, 54312 orientation: blockOrientation, 54313 onResizeStart: onResizeStart, 54314 onResize: setTemporaryHeight, 54315 onResizeStop: handleOnVerticalResizeStop, 54316 isSelected: isSelected, 54317 isResizing: isResizing, 54318 setIsResizing: setIsResizing 54319 })); 54320 }; 54321 (0,external_wp_element_namespaceObject.useEffect)(() => { 54322 if (isFlexLayout && selfStretch !== 'fill' && selfStretch !== 'fit' && !flexSize) { 54323 if (inheritedOrientation === 'horizontal') { 54324 // If spacer is moving from a vertical container to a horizontal container, 54325 // it might not have width but have height instead. 54326 const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || '100px'; 54327 setAttributes({ 54328 width: '0px', 54329 style: { 54330 ...blockStyle, 54331 layout: { 54332 ...layout, 54333 flexSize: newSize, 54334 selfStretch: 'fixed' 54335 } 54336 } 54337 }); 54338 } else { 54339 const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || '100px'; 54340 setAttributes({ 54341 height: '0px', 54342 style: { 54343 ...blockStyle, 54344 layout: { 54345 ...layout, 54346 flexSize: newSize, 54347 selfStretch: 'fixed' 54348 } 54349 } 54350 }); 54351 } 54352 } else if (isFlexLayout && (selfStretch === 'fill' || selfStretch === 'fit')) { 54353 if (inheritedOrientation === 'horizontal') { 54354 setAttributes({ 54355 width: undefined 54356 }); 54357 } else { 54358 setAttributes({ 54359 height: undefined 54360 }); 54361 } 54362 } else if (!isFlexLayout && (selfStretch || flexSize)) { 54363 if (inheritedOrientation === 'horizontal') { 54364 setAttributes({ 54365 width: flexSize 54366 }); 54367 } else { 54368 setAttributes({ 54369 height: flexSize 54370 }); 54371 } 54372 setAttributes({ 54373 style: { 54374 ...blockStyle, 54375 layout: { 54376 ...layout, 54377 flexSize: undefined, 54378 selfStretch: undefined 54379 } 54380 } 54381 }); 54382 } 54383 }, [blockStyle, flexSize, height, inheritedOrientation, isFlexLayout, layout, selfStretch, setAttributes, spacingSizes, width]); 54384 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, { 54385 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 54386 style, 54387 className: classnames_default()(className, { 54388 'custom-sizes-disabled': disableCustomSpacingSizes 54389 }) 54390 }) 54391 }, resizableBoxWithOrientation(inheritedOrientation)), !isFlexLayout && (0,external_React_namespaceObject.createElement)(SpacerControls, { 54392 setAttributes: setAttributes, 54393 height: temporaryHeight || height, 54394 width: temporaryWidth || width, 54395 orientation: inheritedOrientation, 54396 isResizing: isResizing 54397 })); 54398 }; 54399 /* harmony default export */ const spacer_edit = (SpacerEdit); 54400 54401 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js 54402 54403 /** 54404 * WordPress dependencies 54405 */ 54406 54407 function spacer_save_save({ 54408 attributes 54409 }) { 54410 const { 54411 height, 54412 width, 54413 style 54414 } = attributes; 54415 const { 54416 layout: { 54417 selfStretch 54418 } = {} 54419 } = style || {}; 54420 // If selfStretch is set to 'fill' or 'fit', don't set default height. 54421 const finalHeight = selfStretch === 'fill' || selfStretch === 'fit' ? undefined : height; 54422 return (0,external_React_namespaceObject.createElement)("div", { 54423 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 54424 style: { 54425 height: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(finalHeight), 54426 width: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) 54427 }, 54428 'aria-hidden': true 54429 }) 54430 }); 54431 } 54432 54433 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js 54434 /** 54435 * WordPress dependencies 54436 */ 54437 54438 54439 /** 54440 * Internal dependencies 54441 */ 54442 54443 54444 54445 const spacer_metadata = { 54446 $schema: "https://schemas.wp.org/trunk/block.json", 54447 apiVersion: 3, 54448 name: "core/spacer", 54449 title: "Spacer", 54450 category: "design", 54451 description: "Add white space between blocks and customize its height.", 54452 textdomain: "default", 54453 attributes: { 54454 height: { 54455 type: "string", 54456 "default": "100px" 54457 }, 54458 width: { 54459 type: "string" 54460 } 54461 }, 54462 usesContext: ["orientation"], 54463 supports: { 54464 anchor: true, 54465 spacing: { 54466 margin: ["top", "bottom"], 54467 __experimentalDefaultControls: { 54468 margin: true 54469 } 54470 }, 54471 interactivity: { 54472 clientNavigation: true 54473 } 54474 }, 54475 editorStyle: "wp-block-spacer-editor", 54476 style: "wp-block-spacer" 54477 }; 54478 54479 const { 54480 name: spacer_name 54481 } = spacer_metadata; 54482 54483 const spacer_settings = { 54484 icon: resize_corner_n_e, 54485 edit: spacer_edit, 54486 save: spacer_save_save, 54487 deprecated: spacer_deprecated 54488 }; 54489 const spacer_init = () => initBlock({ 54490 name: spacer_name, 54491 metadata: spacer_metadata, 54492 settings: spacer_settings 54493 }); 54494 54495 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js 54496 54497 /** 54498 * WordPress dependencies 54499 */ 54500 54501 const blockTable = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 54502 viewBox: "0 0 24 24", 54503 xmlns: "http://www.w3.org/2000/svg" 54504 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 54505 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-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" 54506 })); 54507 /* harmony default export */ const block_table = (blockTable); 54508 54509 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js 54510 54511 /** 54512 * External dependencies 54513 */ 54514 54515 54516 /** 54517 * WordPress dependencies 54518 */ 54519 54520 54521 // As the previous arbitrary colors won't match theme color palettes, the hex 54522 // value will be mapped to the style.color.background attribute as if it was 54523 // a custom color selection. 54524 const oldColors = { 54525 'subtle-light-gray': '#f3f4f5', 54526 'subtle-pale-green': '#e9fbe5', 54527 'subtle-pale-blue': '#e7f5fe', 54528 'subtle-pale-pink': '#fcf0ef' 54529 }; 54530 54531 // In #41140 support was added to global styles for caption elements which 54532 // added a `wp-element-caption` classname to the embed figcaption element. 54533 const table_deprecated_v3 = { 54534 attributes: { 54535 hasFixedLayout: { 54536 type: 'boolean', 54537 default: false 54538 }, 54539 caption: { 54540 type: 'string', 54541 source: 'html', 54542 selector: 'figcaption', 54543 default: '' 54544 }, 54545 head: { 54546 type: 'array', 54547 default: [], 54548 source: 'query', 54549 selector: 'thead tr', 54550 query: { 54551 cells: { 54552 type: 'array', 54553 default: [], 54554 source: 'query', 54555 selector: 'td,th', 54556 query: { 54557 content: { 54558 type: 'string', 54559 source: 'html' 54560 }, 54561 tag: { 54562 type: 'string', 54563 default: 'td', 54564 source: 'tag' 54565 }, 54566 scope: { 54567 type: 'string', 54568 source: 'attribute', 54569 attribute: 'scope' 54570 }, 54571 align: { 54572 type: 'string', 54573 source: 'attribute', 54574 attribute: 'data-align' 54575 } 54576 } 54577 } 54578 } 54579 }, 54580 body: { 54581 type: 'array', 54582 default: [], 54583 source: 'query', 54584 selector: 'tbody tr', 54585 query: { 54586 cells: { 54587 type: 'array', 54588 default: [], 54589 source: 'query', 54590 selector: 'td,th', 54591 query: { 54592 content: { 54593 type: 'string', 54594 source: 'html' 54595 }, 54596 tag: { 54597 type: 'string', 54598 default: 'td', 54599 source: 'tag' 54600 }, 54601 scope: { 54602 type: 'string', 54603 source: 'attribute', 54604 attribute: 'scope' 54605 }, 54606 align: { 54607 type: 'string', 54608 source: 'attribute', 54609 attribute: 'data-align' 54610 } 54611 } 54612 } 54613 } 54614 }, 54615 foot: { 54616 type: 'array', 54617 default: [], 54618 source: 'query', 54619 selector: 'tfoot tr', 54620 query: { 54621 cells: { 54622 type: 'array', 54623 default: [], 54624 source: 'query', 54625 selector: 'td,th', 54626 query: { 54627 content: { 54628 type: 'string', 54629 source: 'html' 54630 }, 54631 tag: { 54632 type: 'string', 54633 default: 'td', 54634 source: 'tag' 54635 }, 54636 scope: { 54637 type: 'string', 54638 source: 'attribute', 54639 attribute: 'scope' 54640 }, 54641 align: { 54642 type: 'string', 54643 source: 'attribute', 54644 attribute: 'data-align' 54645 } 54646 } 54647 } 54648 } 54649 } 54650 }, 54651 supports: { 54652 anchor: true, 54653 align: true, 54654 color: { 54655 __experimentalSkipSerialization: true, 54656 gradients: true, 54657 __experimentalDefaultControls: { 54658 background: true, 54659 text: true 54660 } 54661 }, 54662 spacing: { 54663 margin: true, 54664 padding: true 54665 }, 54666 typography: { 54667 fontSize: true, 54668 lineHeight: true, 54669 __experimentalFontFamily: true, 54670 __experimentalFontStyle: true, 54671 __experimentalFontWeight: true, 54672 __experimentalLetterSpacing: true, 54673 __experimentalTextTransform: true, 54674 __experimentalTextDecoration: true, 54675 __experimentalDefaultControls: { 54676 fontSize: true 54677 } 54678 }, 54679 __experimentalBorder: { 54680 __experimentalSkipSerialization: true, 54681 color: true, 54682 style: true, 54683 width: true, 54684 __experimentalDefaultControls: { 54685 color: true, 54686 style: true, 54687 width: true 54688 } 54689 }, 54690 __experimentalSelector: '.wp-block-table > table' 54691 }, 54692 save({ 54693 attributes 54694 }) { 54695 const { 54696 hasFixedLayout, 54697 head, 54698 body, 54699 foot, 54700 caption 54701 } = attributes; 54702 const isEmpty = !head.length && !body.length && !foot.length; 54703 if (isEmpty) { 54704 return null; 54705 } 54706 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 54707 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 54708 const classes = classnames_default()(colorProps.className, borderProps.className, { 54709 'has-fixed-layout': hasFixedLayout 54710 }); 54711 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 54712 const Section = ({ 54713 type, 54714 rows 54715 }) => { 54716 if (!rows.length) { 54717 return null; 54718 } 54719 const Tag = `t$type}`; 54720 return (0,external_React_namespaceObject.createElement)(Tag, null, rows.map(({ 54721 cells 54722 }, rowIndex) => (0,external_React_namespaceObject.createElement)("tr", { 54723 key: rowIndex 54724 }, cells.map(({ 54725 content, 54726 tag, 54727 scope, 54728 align 54729 }, cellIndex) => { 54730 const cellClasses = classnames_default()({ 54731 [`has-text-align-$align}`]: align 54732 }); 54733 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 54734 className: cellClasses ? cellClasses : undefined, 54735 "data-align": align, 54736 tagName: tag, 54737 value: content, 54738 key: cellIndex, 54739 scope: tag === 'th' ? scope : undefined 54740 }); 54741 })))); 54742 }; 54743 return (0,external_React_namespaceObject.createElement)("figure", { 54744 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 54745 }, (0,external_React_namespaceObject.createElement)("table", { 54746 className: classes === '' ? undefined : classes, 54747 style: { 54748 ...colorProps.style, 54749 ...borderProps.style 54750 } 54751 }, (0,external_React_namespaceObject.createElement)(Section, { 54752 type: "head", 54753 rows: head 54754 }), (0,external_React_namespaceObject.createElement)(Section, { 54755 type: "body", 54756 rows: body 54757 }), (0,external_React_namespaceObject.createElement)(Section, { 54758 type: "foot", 54759 rows: foot 54760 })), hasCaption && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 54761 tagName: "figcaption", 54762 value: caption 54763 })); 54764 } 54765 }; 54766 54767 // Deprecation migrating table block to use colors block support feature. 54768 const table_deprecated_v2 = { 54769 attributes: { 54770 hasFixedLayout: { 54771 type: 'boolean', 54772 default: false 54773 }, 54774 backgroundColor: { 54775 type: 'string' 54776 }, 54777 caption: { 54778 type: 'string', 54779 source: 'html', 54780 selector: 'figcaption', 54781 default: '' 54782 }, 54783 head: { 54784 type: 'array', 54785 default: [], 54786 source: 'query', 54787 selector: 'thead tr', 54788 query: { 54789 cells: { 54790 type: 'array', 54791 default: [], 54792 source: 'query', 54793 selector: 'td,th', 54794 query: { 54795 content: { 54796 type: 'string', 54797 source: 'html' 54798 }, 54799 tag: { 54800 type: 'string', 54801 default: 'td', 54802 source: 'tag' 54803 }, 54804 scope: { 54805 type: 'string', 54806 source: 'attribute', 54807 attribute: 'scope' 54808 }, 54809 align: { 54810 type: 'string', 54811 source: 'attribute', 54812 attribute: 'data-align' 54813 } 54814 } 54815 } 54816 } 54817 }, 54818 body: { 54819 type: 'array', 54820 default: [], 54821 source: 'query', 54822 selector: 'tbody tr', 54823 query: { 54824 cells: { 54825 type: 'array', 54826 default: [], 54827 source: 'query', 54828 selector: 'td,th', 54829 query: { 54830 content: { 54831 type: 'string', 54832 source: 'html' 54833 }, 54834 tag: { 54835 type: 'string', 54836 default: 'td', 54837 source: 'tag' 54838 }, 54839 scope: { 54840 type: 'string', 54841 source: 'attribute', 54842 attribute: 'scope' 54843 }, 54844 align: { 54845 type: 'string', 54846 source: 'attribute', 54847 attribute: 'data-align' 54848 } 54849 } 54850 } 54851 } 54852 }, 54853 foot: { 54854 type: 'array', 54855 default: [], 54856 source: 'query', 54857 selector: 'tfoot tr', 54858 query: { 54859 cells: { 54860 type: 'array', 54861 default: [], 54862 source: 'query', 54863 selector: 'td,th', 54864 query: { 54865 content: { 54866 type: 'string', 54867 source: 'html' 54868 }, 54869 tag: { 54870 type: 'string', 54871 default: 'td', 54872 source: 'tag' 54873 }, 54874 scope: { 54875 type: 'string', 54876 source: 'attribute', 54877 attribute: 'scope' 54878 }, 54879 align: { 54880 type: 'string', 54881 source: 'attribute', 54882 attribute: 'data-align' 54883 } 54884 } 54885 } 54886 } 54887 } 54888 }, 54889 supports: { 54890 anchor: true, 54891 align: true, 54892 __experimentalSelector: '.wp-block-table > table' 54893 }, 54894 save: ({ 54895 attributes 54896 }) => { 54897 const { 54898 hasFixedLayout, 54899 head, 54900 body, 54901 foot, 54902 backgroundColor, 54903 caption 54904 } = attributes; 54905 const isEmpty = !head.length && !body.length && !foot.length; 54906 if (isEmpty) { 54907 return null; 54908 } 54909 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 54910 const classes = classnames_default()(backgroundClass, { 54911 'has-fixed-layout': hasFixedLayout, 54912 'has-background': !!backgroundClass 54913 }); 54914 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 54915 const Section = ({ 54916 type, 54917 rows 54918 }) => { 54919 if (!rows.length) { 54920 return null; 54921 } 54922 const Tag = `t$type}`; 54923 return (0,external_React_namespaceObject.createElement)(Tag, null, rows.map(({ 54924 cells 54925 }, rowIndex) => (0,external_React_namespaceObject.createElement)("tr", { 54926 key: rowIndex 54927 }, cells.map(({ 54928 content, 54929 tag, 54930 scope, 54931 align 54932 }, cellIndex) => { 54933 const cellClasses = classnames_default()({ 54934 [`has-text-align-$align}`]: align 54935 }); 54936 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 54937 className: cellClasses ? cellClasses : undefined, 54938 "data-align": align, 54939 tagName: tag, 54940 value: content, 54941 key: cellIndex, 54942 scope: tag === 'th' ? scope : undefined 54943 }); 54944 })))); 54945 }; 54946 return (0,external_React_namespaceObject.createElement)("figure", { 54947 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 54948 }, (0,external_React_namespaceObject.createElement)("table", { 54949 className: classes === '' ? undefined : classes 54950 }, (0,external_React_namespaceObject.createElement)(Section, { 54951 type: "head", 54952 rows: head 54953 }), (0,external_React_namespaceObject.createElement)(Section, { 54954 type: "body", 54955 rows: body 54956 }), (0,external_React_namespaceObject.createElement)(Section, { 54957 type: "foot", 54958 rows: foot 54959 })), hasCaption && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 54960 tagName: "figcaption", 54961 value: caption 54962 })); 54963 }, 54964 isEligible: attributes => { 54965 return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style; 54966 }, 54967 // This version is the first to introduce the style attribute to the 54968 // table block. As a result, we'll explicitly override that. 54969 migrate: attributes => { 54970 return { 54971 ...attributes, 54972 backgroundColor: undefined, 54973 style: { 54974 color: { 54975 background: oldColors[attributes.backgroundColor] 54976 } 54977 } 54978 }; 54979 } 54980 }; 54981 const table_deprecated_v1 = { 54982 attributes: { 54983 hasFixedLayout: { 54984 type: 'boolean', 54985 default: false 54986 }, 54987 backgroundColor: { 54988 type: 'string' 54989 }, 54990 head: { 54991 type: 'array', 54992 default: [], 54993 source: 'query', 54994 selector: 'thead tr', 54995 query: { 54996 cells: { 54997 type: 'array', 54998 default: [], 54999 source: 'query', 55000 selector: 'td,th', 55001 query: { 55002 content: { 55003 type: 'string', 55004 source: 'html' 55005 }, 55006 tag: { 55007 type: 'string', 55008 default: 'td', 55009 source: 'tag' 55010 }, 55011 scope: { 55012 type: 'string', 55013 source: 'attribute', 55014 attribute: 'scope' 55015 } 55016 } 55017 } 55018 } 55019 }, 55020 body: { 55021 type: 'array', 55022 default: [], 55023 source: 'query', 55024 selector: 'tbody tr', 55025 query: { 55026 cells: { 55027 type: 'array', 55028 default: [], 55029 source: 'query', 55030 selector: 'td,th', 55031 query: { 55032 content: { 55033 type: 'string', 55034 source: 'html' 55035 }, 55036 tag: { 55037 type: 'string', 55038 default: 'td', 55039 source: 'tag' 55040 }, 55041 scope: { 55042 type: 'string', 55043 source: 'attribute', 55044 attribute: 'scope' 55045 } 55046 } 55047 } 55048 } 55049 }, 55050 foot: { 55051 type: 'array', 55052 default: [], 55053 source: 'query', 55054 selector: 'tfoot tr', 55055 query: { 55056 cells: { 55057 type: 'array', 55058 default: [], 55059 source: 'query', 55060 selector: 'td,th', 55061 query: { 55062 content: { 55063 type: 'string', 55064 source: 'html' 55065 }, 55066 tag: { 55067 type: 'string', 55068 default: 'td', 55069 source: 'tag' 55070 }, 55071 scope: { 55072 type: 'string', 55073 source: 'attribute', 55074 attribute: 'scope' 55075 } 55076 } 55077 } 55078 } 55079 } 55080 }, 55081 supports: { 55082 align: true 55083 }, 55084 save({ 55085 attributes 55086 }) { 55087 const { 55088 hasFixedLayout, 55089 head, 55090 body, 55091 foot, 55092 backgroundColor 55093 } = attributes; 55094 const isEmpty = !head.length && !body.length && !foot.length; 55095 if (isEmpty) { 55096 return null; 55097 } 55098 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 55099 const classes = classnames_default()(backgroundClass, { 55100 'has-fixed-layout': hasFixedLayout, 55101 'has-background': !!backgroundClass 55102 }); 55103 const Section = ({ 55104 type, 55105 rows 55106 }) => { 55107 if (!rows.length) { 55108 return null; 55109 } 55110 const Tag = `t$type}`; 55111 return (0,external_React_namespaceObject.createElement)(Tag, null, rows.map(({ 55112 cells 55113 }, rowIndex) => (0,external_React_namespaceObject.createElement)("tr", { 55114 key: rowIndex 55115 }, cells.map(({ 55116 content, 55117 tag, 55118 scope 55119 }, cellIndex) => (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 55120 tagName: tag, 55121 value: content, 55122 key: cellIndex, 55123 scope: tag === 'th' ? scope : undefined 55124 }))))); 55125 }; 55126 return (0,external_React_namespaceObject.createElement)("table", { 55127 className: classes 55128 }, (0,external_React_namespaceObject.createElement)(Section, { 55129 type: "head", 55130 rows: head 55131 }), (0,external_React_namespaceObject.createElement)(Section, { 55132 type: "body", 55133 rows: body 55134 }), (0,external_React_namespaceObject.createElement)(Section, { 55135 type: "foot", 55136 rows: foot 55137 })); 55138 } 55139 }; 55140 55141 /** 55142 * New deprecations need to be placed first 55143 * for them to have higher priority. 55144 * 55145 * Old deprecations may need to be updated as well. 55146 * 55147 * See block-deprecation.md 55148 */ 55149 /* harmony default export */ const table_deprecated = ([table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]); 55150 55151 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js 55152 55153 /** 55154 * WordPress dependencies 55155 */ 55156 55157 const alignLeft = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55158 xmlns: "http://www.w3.org/2000/svg", 55159 viewBox: "0 0 24 24" 55160 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55161 d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" 55162 })); 55163 /* harmony default export */ const align_left = (alignLeft); 55164 55165 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js 55166 55167 /** 55168 * WordPress dependencies 55169 */ 55170 55171 const alignCenter = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55172 xmlns: "http://www.w3.org/2000/svg", 55173 viewBox: "0 0 24 24" 55174 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55175 d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" 55176 })); 55177 /* harmony default export */ const align_center = (alignCenter); 55178 55179 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js 55180 55181 /** 55182 * WordPress dependencies 55183 */ 55184 55185 const alignRight = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55186 xmlns: "http://www.w3.org/2000/svg", 55187 viewBox: "0 0 24 24" 55188 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55189 d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" 55190 })); 55191 /* harmony default export */ const align_right = (alignRight); 55192 55193 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-before.js 55194 55195 /** 55196 * WordPress dependencies 55197 */ 55198 55199 const tableRowBefore = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55200 xmlns: "http://www.w3.org/2000/svg", 55201 viewBox: "-2 -2 24 24" 55202 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55203 d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z" 55204 })); 55205 /* harmony default export */ const table_row_before = (tableRowBefore); 55206 55207 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js 55208 55209 /** 55210 * WordPress dependencies 55211 */ 55212 55213 const tableRowAfter = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55214 xmlns: "http://www.w3.org/2000/svg", 55215 viewBox: "-2 -2 24 24" 55216 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55217 d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z" 55218 })); 55219 /* harmony default export */ const table_row_after = (tableRowAfter); 55220 55221 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js 55222 55223 /** 55224 * WordPress dependencies 55225 */ 55226 55227 const tableRowDelete = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55228 xmlns: "http://www.w3.org/2000/svg", 55229 viewBox: "-2 -2 24 24" 55230 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55231 d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z" 55232 })); 55233 /* harmony default export */ const table_row_delete = (tableRowDelete); 55234 55235 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js 55236 55237 /** 55238 * WordPress dependencies 55239 */ 55240 55241 const tableColumnBefore = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55242 xmlns: "http://www.w3.org/2000/svg", 55243 viewBox: "-2 -2 24 24" 55244 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55245 d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z" 55246 })); 55247 /* harmony default export */ const table_column_before = (tableColumnBefore); 55248 55249 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js 55250 55251 /** 55252 * WordPress dependencies 55253 */ 55254 55255 const tableColumnAfter = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55256 xmlns: "http://www.w3.org/2000/svg", 55257 viewBox: "-2 -2 24 24" 55258 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55259 d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z" 55260 })); 55261 /* harmony default export */ const table_column_after = (tableColumnAfter); 55262 55263 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js 55264 55265 /** 55266 * WordPress dependencies 55267 */ 55268 55269 const tableColumnDelete = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55270 xmlns: "http://www.w3.org/2000/svg", 55271 viewBox: "-2 -2 24 24" 55272 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55273 d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z" 55274 })); 55275 /* harmony default export */ const table_column_delete = (tableColumnDelete); 55276 55277 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js 55278 55279 /** 55280 * WordPress dependencies 55281 */ 55282 55283 const table = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 55284 xmlns: "http://www.w3.org/2000/svg", 55285 viewBox: "0 0 24 24" 55286 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 55287 d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z" 55288 })); 55289 /* harmony default export */ const library_table = (table); 55290 55291 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js 55292 const INHERITED_COLUMN_ATTRIBUTES = ['align']; 55293 55294 /** 55295 * Creates a table state. 55296 * 55297 * @param {Object} options 55298 * @param {number} options.rowCount Row count for the table to create. 55299 * @param {number} options.columnCount Column count for the table to create. 55300 * 55301 * @return {Object} New table state. 55302 */ 55303 function createTable({ 55304 rowCount, 55305 columnCount 55306 }) { 55307 return { 55308 body: Array.from({ 55309 length: rowCount 55310 }).map(() => ({ 55311 cells: Array.from({ 55312 length: columnCount 55313 }).map(() => ({ 55314 content: '', 55315 tag: 'td' 55316 })) 55317 })) 55318 }; 55319 } 55320 55321 /** 55322 * Returns the first row in the table. 55323 * 55324 * @param {Object} state Current table state. 55325 * 55326 * @return {Object | undefined} The first table row. 55327 */ 55328 function getFirstRow(state) { 55329 if (!isEmptyTableSection(state.head)) { 55330 return state.head[0]; 55331 } 55332 if (!isEmptyTableSection(state.body)) { 55333 return state.body[0]; 55334 } 55335 if (!isEmptyTableSection(state.foot)) { 55336 return state.foot[0]; 55337 } 55338 } 55339 55340 /** 55341 * Gets an attribute for a cell. 55342 * 55343 * @param {Object} state Current table state. 55344 * @param {Object} cellLocation The location of the cell 55345 * @param {string} attributeName The name of the attribute to get the value of. 55346 * 55347 * @return {*} The attribute value. 55348 */ 55349 function getCellAttribute(state, cellLocation, attributeName) { 55350 const { 55351 sectionName, 55352 rowIndex, 55353 columnIndex 55354 } = cellLocation; 55355 return state[sectionName]?.[rowIndex]?.cells?.[columnIndex]?.[attributeName]; 55356 } 55357 55358 /** 55359 * Returns updated cell attributes after applying the `updateCell` function to the selection. 55360 * 55361 * @param {Object} state The block attributes. 55362 * @param {Object} selection The selection of cells to update. 55363 * @param {Function} updateCell A function to update the selected cell attributes. 55364 * 55365 * @return {Object} New table state including the updated cells. 55366 */ 55367 function updateSelectedCell(state, selection, updateCell) { 55368 if (!selection) { 55369 return state; 55370 } 55371 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 55372 const { 55373 sectionName: selectionSectionName, 55374 rowIndex: selectionRowIndex 55375 } = selection; 55376 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 55377 if (selectionSectionName && selectionSectionName !== sectionName) { 55378 return [sectionName, section]; 55379 } 55380 return [sectionName, section.map((row, rowIndex) => { 55381 if (selectionRowIndex && selectionRowIndex !== rowIndex) { 55382 return row; 55383 } 55384 return { 55385 cells: row.cells.map((cellAttributes, columnIndex) => { 55386 const cellLocation = { 55387 sectionName, 55388 columnIndex, 55389 rowIndex 55390 }; 55391 if (!isCellSelected(cellLocation, selection)) { 55392 return cellAttributes; 55393 } 55394 return updateCell(cellAttributes); 55395 }) 55396 }; 55397 })]; 55398 })); 55399 } 55400 55401 /** 55402 * Returns whether the cell at `cellLocation` is included in the selection `selection`. 55403 * 55404 * @param {Object} cellLocation An object containing cell location properties. 55405 * @param {Object} selection An object containing selection properties. 55406 * 55407 * @return {boolean} True if the cell is selected, false otherwise. 55408 */ 55409 function isCellSelected(cellLocation, selection) { 55410 if (!cellLocation || !selection) { 55411 return false; 55412 } 55413 switch (selection.type) { 55414 case 'column': 55415 return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex; 55416 case 'cell': 55417 return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex; 55418 } 55419 } 55420 55421 /** 55422 * Inserts a row in the table state. 55423 * 55424 * @param {Object} state Current table state. 55425 * @param {Object} options 55426 * @param {string} options.sectionName Section in which to insert the row. 55427 * @param {number} options.rowIndex Row index at which to insert the row. 55428 * @param {number} options.columnCount Column count for the table to create. 55429 * 55430 * @return {Object} New table state. 55431 */ 55432 function insertRow(state, { 55433 sectionName, 55434 rowIndex, 55435 columnCount 55436 }) { 55437 const firstRow = getFirstRow(state); 55438 const cellCount = columnCount === undefined ? firstRow?.cells?.length : columnCount; 55439 55440 // Bail early if the function cannot determine how many cells to add. 55441 if (!cellCount) { 55442 return state; 55443 } 55444 return { 55445 [sectionName]: [...state[sectionName].slice(0, rowIndex), { 55446 cells: Array.from({ 55447 length: cellCount 55448 }).map((_, index) => { 55449 var _firstRow$cells$index; 55450 const firstCellInColumn = (_firstRow$cells$index = firstRow?.cells?.[index]) !== null && _firstRow$cells$index !== void 0 ? _firstRow$cells$index : {}; 55451 const inheritedAttributes = Object.fromEntries(Object.entries(firstCellInColumn).filter(([key]) => INHERITED_COLUMN_ATTRIBUTES.includes(key))); 55452 return { 55453 ...inheritedAttributes, 55454 content: '', 55455 tag: sectionName === 'head' ? 'th' : 'td' 55456 }; 55457 }) 55458 }, ...state[sectionName].slice(rowIndex)] 55459 }; 55460 } 55461 55462 /** 55463 * Deletes a row from the table state. 55464 * 55465 * @param {Object} state Current table state. 55466 * @param {Object} options 55467 * @param {string} options.sectionName Section in which to delete the row. 55468 * @param {number} options.rowIndex Row index to delete. 55469 * 55470 * @return {Object} New table state. 55471 */ 55472 function deleteRow(state, { 55473 sectionName, 55474 rowIndex 55475 }) { 55476 return { 55477 [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex) 55478 }; 55479 } 55480 55481 /** 55482 * Inserts a column in the table state. 55483 * 55484 * @param {Object} state Current table state. 55485 * @param {Object} options 55486 * @param {number} options.columnIndex Column index at which to insert the column. 55487 * 55488 * @return {Object} New table state. 55489 */ 55490 function insertColumn(state, { 55491 columnIndex 55492 }) { 55493 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 55494 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 55495 // Bail early if the table section is empty. 55496 if (isEmptyTableSection(section)) { 55497 return [sectionName, section]; 55498 } 55499 return [sectionName, section.map(row => { 55500 // Bail early if the row is empty or it's an attempt to insert past 55501 // the last possible index of the array. 55502 if (isEmptyRow(row) || row.cells.length < columnIndex) { 55503 return row; 55504 } 55505 return { 55506 cells: [...row.cells.slice(0, columnIndex), { 55507 content: '', 55508 tag: sectionName === 'head' ? 'th' : 'td' 55509 }, ...row.cells.slice(columnIndex)] 55510 }; 55511 })]; 55512 })); 55513 } 55514 55515 /** 55516 * Deletes a column from the table state. 55517 * 55518 * @param {Object} state Current table state. 55519 * @param {Object} options 55520 * @param {number} options.columnIndex Column index to delete. 55521 * 55522 * @return {Object} New table state. 55523 */ 55524 function deleteColumn(state, { 55525 columnIndex 55526 }) { 55527 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 55528 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 55529 // Bail early if the table section is empty. 55530 if (isEmptyTableSection(section)) { 55531 return [sectionName, section]; 55532 } 55533 return [sectionName, section.map(row => ({ 55534 cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells 55535 })).filter(row => row.cells.length)]; 55536 })); 55537 } 55538 55539 /** 55540 * Toggles the existence of a section. 55541 * 55542 * @param {Object} state Current table state. 55543 * @param {string} sectionName Name of the section to toggle. 55544 * 55545 * @return {Object} New table state. 55546 */ 55547 function toggleSection(state, sectionName) { 55548 var _state$body$0$cells$l; 55549 // Section exists, replace it with an empty row to remove it. 55550 if (!isEmptyTableSection(state[sectionName])) { 55551 return { 55552 [sectionName]: [] 55553 }; 55554 } 55555 55556 // Get the length of the first row of the body to use when creating the header. 55557 const columnCount = (_state$body$0$cells$l = state.body?.[0]?.cells?.length) !== null && _state$body$0$cells$l !== void 0 ? _state$body$0$cells$l : 1; 55558 55559 // Section doesn't exist, insert an empty row to create the section. 55560 return insertRow(state, { 55561 sectionName, 55562 rowIndex: 0, 55563 columnCount 55564 }); 55565 } 55566 55567 /** 55568 * Determines whether a table section is empty. 55569 * 55570 * @param {Object} section Table section state. 55571 * 55572 * @return {boolean} True if the table section is empty, false otherwise. 55573 */ 55574 function isEmptyTableSection(section) { 55575 return !section || !section.length || section.every(isEmptyRow); 55576 } 55577 55578 /** 55579 * Determines whether a table row is empty. 55580 * 55581 * @param {Object} row Table row state. 55582 * 55583 * @return {boolean} True if the table section is empty, false otherwise. 55584 */ 55585 function isEmptyRow(row) { 55586 return !(row.cells && row.cells.length); 55587 } 55588 55589 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js 55590 55591 /** 55592 * External dependencies 55593 */ 55594 55595 55596 /** 55597 * WordPress dependencies 55598 */ 55599 55600 55601 55602 55603 55604 55605 55606 /** 55607 * Internal dependencies 55608 */ 55609 55610 const ALIGNMENT_CONTROLS = [{ 55611 icon: align_left, 55612 title: (0,external_wp_i18n_namespaceObject.__)('Align column left'), 55613 align: 'left' 55614 }, { 55615 icon: align_center, 55616 title: (0,external_wp_i18n_namespaceObject.__)('Align column center'), 55617 align: 'center' 55618 }, { 55619 icon: align_right, 55620 title: (0,external_wp_i18n_namespaceObject.__)('Align column right'), 55621 align: 'right' 55622 }]; 55623 const cellAriaLabel = { 55624 head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'), 55625 body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'), 55626 foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text') 55627 }; 55628 const edit_placeholder = { 55629 head: (0,external_wp_i18n_namespaceObject.__)('Header label'), 55630 foot: (0,external_wp_i18n_namespaceObject.__)('Footer label') 55631 }; 55632 function TSection({ 55633 name, 55634 ...props 55635 }) { 55636 const TagName = `t$name}`; 55637 return (0,external_React_namespaceObject.createElement)(TagName, { 55638 ...props 55639 }); 55640 } 55641 function TableEdit({ 55642 attributes, 55643 setAttributes, 55644 insertBlocksAfter, 55645 isSelected 55646 }) { 55647 const { 55648 hasFixedLayout, 55649 caption, 55650 head, 55651 foot 55652 } = attributes; 55653 const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2); 55654 const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2); 55655 const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)(); 55656 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 55657 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 55658 const tableRef = (0,external_wp_element_namespaceObject.useRef)(); 55659 const [hasTableCreated, setHasTableCreated] = (0,external_wp_element_namespaceObject.useState)(false); 55660 55661 /** 55662 * Updates the initial column count used for table creation. 55663 * 55664 * @param {number} count New initial column count. 55665 */ 55666 function onChangeInitialColumnCount(count) { 55667 setInitialColumnCount(count); 55668 } 55669 55670 /** 55671 * Updates the initial row count used for table creation. 55672 * 55673 * @param {number} count New initial row count. 55674 */ 55675 function onChangeInitialRowCount(count) { 55676 setInitialRowCount(count); 55677 } 55678 55679 /** 55680 * Creates a table based on dimensions in local state. 55681 * 55682 * @param {Object} event Form submit event. 55683 */ 55684 function onCreateTable(event) { 55685 event.preventDefault(); 55686 setAttributes(createTable({ 55687 rowCount: parseInt(initialRowCount, 10) || 2, 55688 columnCount: parseInt(initialColumnCount, 10) || 2 55689 })); 55690 setHasTableCreated(true); 55691 } 55692 55693 /** 55694 * Toggles whether the table has a fixed layout or not. 55695 */ 55696 function onChangeFixedLayout() { 55697 setAttributes({ 55698 hasFixedLayout: !hasFixedLayout 55699 }); 55700 } 55701 55702 /** 55703 * Changes the content of the currently selected cell. 55704 * 55705 * @param {Array} content A RichText content value. 55706 */ 55707 function onChange(content) { 55708 if (!selectedCell) { 55709 return; 55710 } 55711 setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ 55712 ...cellAttributes, 55713 content 55714 }))); 55715 } 55716 55717 /** 55718 * Align text within the a column. 55719 * 55720 * @param {string} align The new alignment to apply to the column. 55721 */ 55722 function onChangeColumnAlignment(align) { 55723 if (!selectedCell) { 55724 return; 55725 } 55726 55727 // Convert the cell selection to a column selection so that alignment 55728 // is applied to the entire column. 55729 const columnSelection = { 55730 type: 'column', 55731 columnIndex: selectedCell.columnIndex 55732 }; 55733 const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ 55734 ...cellAttributes, 55735 align 55736 })); 55737 setAttributes(newAttributes); 55738 } 55739 55740 /** 55741 * Get the alignment of the currently selected cell. 55742 * 55743 * @return {string | undefined} The new alignment to apply to the column. 55744 */ 55745 function getCellAlignment() { 55746 if (!selectedCell) { 55747 return; 55748 } 55749 return getCellAttribute(attributes, selectedCell, 'align'); 55750 } 55751 55752 /** 55753 * Add or remove a `head` table section. 55754 */ 55755 function onToggleHeaderSection() { 55756 setAttributes(toggleSection(attributes, 'head')); 55757 } 55758 55759 /** 55760 * Add or remove a `foot` table section. 55761 */ 55762 function onToggleFooterSection() { 55763 setAttributes(toggleSection(attributes, 'foot')); 55764 } 55765 55766 /** 55767 * Inserts a row at the currently selected row index, plus `delta`. 55768 * 55769 * @param {number} delta Offset for selected row index at which to insert. 55770 */ 55771 function onInsertRow(delta) { 55772 if (!selectedCell) { 55773 return; 55774 } 55775 const { 55776 sectionName, 55777 rowIndex 55778 } = selectedCell; 55779 const newRowIndex = rowIndex + delta; 55780 setAttributes(insertRow(attributes, { 55781 sectionName, 55782 rowIndex: newRowIndex 55783 })); 55784 // Select the first cell of the new row. 55785 setSelectedCell({ 55786 sectionName, 55787 rowIndex: newRowIndex, 55788 columnIndex: 0, 55789 type: 'cell' 55790 }); 55791 } 55792 55793 /** 55794 * Inserts a row before the currently selected row. 55795 */ 55796 function onInsertRowBefore() { 55797 onInsertRow(0); 55798 } 55799 55800 /** 55801 * Inserts a row after the currently selected row. 55802 */ 55803 function onInsertRowAfter() { 55804 onInsertRow(1); 55805 } 55806 55807 /** 55808 * Deletes the currently selected row. 55809 */ 55810 function onDeleteRow() { 55811 if (!selectedCell) { 55812 return; 55813 } 55814 const { 55815 sectionName, 55816 rowIndex 55817 } = selectedCell; 55818 setSelectedCell(); 55819 setAttributes(deleteRow(attributes, { 55820 sectionName, 55821 rowIndex 55822 })); 55823 } 55824 55825 /** 55826 * Inserts a column at the currently selected column index, plus `delta`. 55827 * 55828 * @param {number} delta Offset for selected column index at which to insert. 55829 */ 55830 function onInsertColumn(delta = 0) { 55831 if (!selectedCell) { 55832 return; 55833 } 55834 const { 55835 columnIndex 55836 } = selectedCell; 55837 const newColumnIndex = columnIndex + delta; 55838 setAttributes(insertColumn(attributes, { 55839 columnIndex: newColumnIndex 55840 })); 55841 // Select the first cell of the new column. 55842 setSelectedCell({ 55843 rowIndex: 0, 55844 columnIndex: newColumnIndex, 55845 type: 'cell' 55846 }); 55847 } 55848 55849 /** 55850 * Inserts a column before the currently selected column. 55851 */ 55852 function onInsertColumnBefore() { 55853 onInsertColumn(0); 55854 } 55855 55856 /** 55857 * Inserts a column after the currently selected column. 55858 */ 55859 function onInsertColumnAfter() { 55860 onInsertColumn(1); 55861 } 55862 55863 /** 55864 * Deletes the currently selected column. 55865 */ 55866 function onDeleteColumn() { 55867 if (!selectedCell) { 55868 return; 55869 } 55870 const { 55871 sectionName, 55872 columnIndex 55873 } = selectedCell; 55874 setSelectedCell(); 55875 setAttributes(deleteColumn(attributes, { 55876 sectionName, 55877 columnIndex 55878 })); 55879 } 55880 (0,external_wp_element_namespaceObject.useEffect)(() => { 55881 if (!isSelected) { 55882 setSelectedCell(); 55883 } 55884 }, [isSelected]); 55885 (0,external_wp_element_namespaceObject.useEffect)(() => { 55886 if (hasTableCreated) { 55887 tableRef?.current?.querySelector('td div[contentEditable="true"]')?.focus(); 55888 setHasTableCreated(false); 55889 } 55890 }, [hasTableCreated]); 55891 const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name])); 55892 const tableControls = [{ 55893 icon: table_row_before, 55894 title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'), 55895 isDisabled: !selectedCell, 55896 onClick: onInsertRowBefore 55897 }, { 55898 icon: table_row_after, 55899 title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'), 55900 isDisabled: !selectedCell, 55901 onClick: onInsertRowAfter 55902 }, { 55903 icon: table_row_delete, 55904 title: (0,external_wp_i18n_namespaceObject.__)('Delete row'), 55905 isDisabled: !selectedCell, 55906 onClick: onDeleteRow 55907 }, { 55908 icon: table_column_before, 55909 title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'), 55910 isDisabled: !selectedCell, 55911 onClick: onInsertColumnBefore 55912 }, { 55913 icon: table_column_after, 55914 title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'), 55915 isDisabled: !selectedCell, 55916 onClick: onInsertColumnAfter 55917 }, { 55918 icon: table_column_delete, 55919 title: (0,external_wp_i18n_namespaceObject.__)('Delete column'), 55920 isDisabled: !selectedCell, 55921 onClick: onDeleteColumn 55922 }]; 55923 const renderedSections = sections.map(name => (0,external_React_namespaceObject.createElement)(TSection, { 55924 name: name, 55925 key: name 55926 }, attributes[name].map(({ 55927 cells 55928 }, rowIndex) => (0,external_React_namespaceObject.createElement)("tr", { 55929 key: rowIndex 55930 }, cells.map(({ 55931 content, 55932 tag: CellTag, 55933 scope, 55934 align, 55935 colspan, 55936 rowspan 55937 }, columnIndex) => (0,external_React_namespaceObject.createElement)(CellTag, { 55938 key: columnIndex, 55939 scope: CellTag === 'th' ? scope : undefined, 55940 colSpan: colspan, 55941 rowSpan: rowspan, 55942 className: classnames_default()({ 55943 [`has-text-align-$align}`]: align 55944 }, 'wp-block-table__cell-content') 55945 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 55946 value: content, 55947 onChange: onChange, 55948 onFocus: () => { 55949 setSelectedCell({ 55950 sectionName: name, 55951 rowIndex, 55952 columnIndex, 55953 type: 'cell' 55954 }); 55955 }, 55956 "aria-label": cellAriaLabel[name], 55957 placeholder: edit_placeholder[name] 55958 }))))))); 55959 const isEmpty = !sections.length; 55960 return (0,external_React_namespaceObject.createElement)("figure", { 55961 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 55962 ref: tableRef 55963 }) 55964 }, !isEmpty && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 55965 group: "block" 55966 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 55967 label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'), 55968 alignmentControls: ALIGNMENT_CONTROLS, 55969 value: getCellAlignment(), 55970 onChange: nextAlign => onChangeColumnAlignment(nextAlign) 55971 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 55972 group: "other" 55973 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 55974 hasArrowIndicator: true, 55975 icon: library_table, 55976 label: (0,external_wp_i18n_namespaceObject.__)('Edit table'), 55977 controls: tableControls 55978 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 55979 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 55980 className: "blocks-table-settings" 55981 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 55982 __nextHasNoMarginBottom: true, 55983 label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'), 55984 checked: !!hasFixedLayout, 55985 onChange: onChangeFixedLayout 55986 }), !isEmpty && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 55987 __nextHasNoMarginBottom: true, 55988 label: (0,external_wp_i18n_namespaceObject.__)('Header section'), 55989 checked: !!(head && head.length), 55990 onChange: onToggleHeaderSection 55991 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 55992 __nextHasNoMarginBottom: true, 55993 label: (0,external_wp_i18n_namespaceObject.__)('Footer section'), 55994 checked: !!(foot && foot.length), 55995 onChange: onToggleFooterSection 55996 })))), !isEmpty && (0,external_React_namespaceObject.createElement)("table", { 55997 className: classnames_default()(colorProps.className, borderProps.className, { 55998 'has-fixed-layout': hasFixedLayout, 55999 // This is required in the editor only to overcome 56000 // the fact the editor rewrites individual border 56001 // widths into a shorthand format. 56002 'has-individual-borders': (0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes?.style?.border) 56003 }), 56004 style: { 56005 ...colorProps.style, 56006 ...borderProps.style 56007 } 56008 }, renderedSections), !isEmpty && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 56009 identifier: "caption", 56010 tagName: "figcaption", 56011 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 56012 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'), 56013 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), 56014 value: caption, 56015 onChange: value => setAttributes({ 56016 caption: value 56017 }) 56018 // Deselect the selected table cell when the caption is focused. 56019 , 56020 onFocus: () => setSelectedCell(), 56021 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 56022 }), isEmpty && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 56023 label: (0,external_wp_i18n_namespaceObject.__)('Table'), 56024 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 56025 icon: block_table, 56026 showColors: true 56027 }), 56028 instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.') 56029 }, (0,external_React_namespaceObject.createElement)("form", { 56030 className: "blocks-table__placeholder-form", 56031 onSubmit: onCreateTable 56032 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 56033 __nextHasNoMarginBottom: true, 56034 __next40pxDefaultSize: true, 56035 type: "number", 56036 label: (0,external_wp_i18n_namespaceObject.__)('Column count'), 56037 value: initialColumnCount, 56038 onChange: onChangeInitialColumnCount, 56039 min: "1", 56040 className: "blocks-table__placeholder-input" 56041 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 56042 __nextHasNoMarginBottom: true, 56043 __next40pxDefaultSize: true, 56044 type: "number", 56045 label: (0,external_wp_i18n_namespaceObject.__)('Row count'), 56046 value: initialRowCount, 56047 onChange: onChangeInitialRowCount, 56048 min: "1", 56049 className: "blocks-table__placeholder-input" 56050 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 56051 __next40pxDefaultSize: true, 56052 variant: "primary", 56053 type: "submit" 56054 }, (0,external_wp_i18n_namespaceObject.__)('Create Table'))))); 56055 } 56056 /* harmony default export */ const table_edit = (TableEdit); 56057 56058 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js 56059 56060 /** 56061 * External dependencies 56062 */ 56063 56064 56065 /** 56066 * WordPress dependencies 56067 */ 56068 56069 function table_save_save({ 56070 attributes 56071 }) { 56072 const { 56073 hasFixedLayout, 56074 head, 56075 body, 56076 foot, 56077 caption 56078 } = attributes; 56079 const isEmpty = !head.length && !body.length && !foot.length; 56080 if (isEmpty) { 56081 return null; 56082 } 56083 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 56084 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 56085 const classes = classnames_default()(colorProps.className, borderProps.className, { 56086 'has-fixed-layout': hasFixedLayout 56087 }); 56088 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 56089 const Section = ({ 56090 type, 56091 rows 56092 }) => { 56093 if (!rows.length) { 56094 return null; 56095 } 56096 const Tag = `t$type}`; 56097 return (0,external_React_namespaceObject.createElement)(Tag, null, rows.map(({ 56098 cells 56099 }, rowIndex) => (0,external_React_namespaceObject.createElement)("tr", { 56100 key: rowIndex 56101 }, cells.map(({ 56102 content, 56103 tag, 56104 scope, 56105 align, 56106 colspan, 56107 rowspan 56108 }, cellIndex) => { 56109 const cellClasses = classnames_default()({ 56110 [`has-text-align-$align}`]: align 56111 }); 56112 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 56113 className: cellClasses ? cellClasses : undefined, 56114 "data-align": align, 56115 tagName: tag, 56116 value: content, 56117 key: cellIndex, 56118 scope: tag === 'th' ? scope : undefined, 56119 colSpan: colspan, 56120 rowSpan: rowspan 56121 }); 56122 })))); 56123 }; 56124 return (0,external_React_namespaceObject.createElement)("figure", { 56125 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 56126 }, (0,external_React_namespaceObject.createElement)("table", { 56127 className: classes === '' ? undefined : classes, 56128 style: { 56129 ...colorProps.style, 56130 ...borderProps.style 56131 } 56132 }, (0,external_React_namespaceObject.createElement)(Section, { 56133 type: "head", 56134 rows: head 56135 }), (0,external_React_namespaceObject.createElement)(Section, { 56136 type: "body", 56137 rows: body 56138 }), (0,external_React_namespaceObject.createElement)(Section, { 56139 type: "foot", 56140 rows: foot 56141 })), hasCaption && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 56142 tagName: "figcaption", 56143 value: caption, 56144 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') 56145 })); 56146 } 56147 56148 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/utils.js 56149 /** 56150 * Normalize the rowspan/colspan value. 56151 * Returns undefined if the parameter is not a positive number 56152 * or the default value (1) for rowspan/colspan. 56153 * 56154 * @param {number|undefined} rowColSpan rowspan/colspan value. 56155 * 56156 * @return {string|undefined} normalized rowspan/colspan value. 56157 */ 56158 function normalizeRowColSpan(rowColSpan) { 56159 const parsedValue = parseInt(rowColSpan, 10); 56160 if (!Number.isInteger(parsedValue)) { 56161 return undefined; 56162 } 56163 return parsedValue < 0 || parsedValue === 1 ? undefined : parsedValue.toString(); 56164 } 56165 56166 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js 56167 /** 56168 * WordPress dependencies 56169 */ 56170 56171 56172 /** 56173 * Internal dependencies 56174 */ 56175 56176 const tableContentPasteSchema = ({ 56177 phrasingContentSchema 56178 }) => ({ 56179 tr: { 56180 allowEmpty: true, 56181 children: { 56182 th: { 56183 allowEmpty: true, 56184 children: phrasingContentSchema, 56185 attributes: ['scope', 'colspan', 'rowspan'] 56186 }, 56187 td: { 56188 allowEmpty: true, 56189 children: phrasingContentSchema, 56190 attributes: ['colspan', 'rowspan'] 56191 } 56192 } 56193 } 56194 }); 56195 const tablePasteSchema = args => ({ 56196 table: { 56197 children: { 56198 thead: { 56199 allowEmpty: true, 56200 children: tableContentPasteSchema(args) 56201 }, 56202 tfoot: { 56203 allowEmpty: true, 56204 children: tableContentPasteSchema(args) 56205 }, 56206 tbody: { 56207 allowEmpty: true, 56208 children: tableContentPasteSchema(args) 56209 } 56210 } 56211 } 56212 }); 56213 const table_transforms_transforms = { 56214 from: [{ 56215 type: 'raw', 56216 selector: 'table', 56217 schema: tablePasteSchema, 56218 transform: node => { 56219 const attributes = Array.from(node.children).reduce((sectionAcc, section) => { 56220 if (!section.children.length) { 56221 return sectionAcc; 56222 } 56223 const sectionName = section.nodeName.toLowerCase().slice(1); 56224 const sectionAttributes = Array.from(section.children).reduce((rowAcc, row) => { 56225 if (!row.children.length) { 56226 return rowAcc; 56227 } 56228 const rowAttributes = Array.from(row.children).reduce((colAcc, col) => { 56229 const rowspan = normalizeRowColSpan(col.getAttribute('rowspan')); 56230 const colspan = normalizeRowColSpan(col.getAttribute('colspan')); 56231 colAcc.push({ 56232 tag: col.nodeName.toLowerCase(), 56233 content: col.innerHTML, 56234 rowspan, 56235 colspan 56236 }); 56237 return colAcc; 56238 }, []); 56239 rowAcc.push({ 56240 cells: rowAttributes 56241 }); 56242 return rowAcc; 56243 }, []); 56244 sectionAcc[sectionName] = sectionAttributes; 56245 return sectionAcc; 56246 }, {}); 56247 return (0,external_wp_blocks_namespaceObject.createBlock)('core/table', attributes); 56248 } 56249 }] 56250 }; 56251 /* harmony default export */ const table_transforms = (table_transforms_transforms); 56252 56253 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js 56254 /** 56255 * WordPress dependencies 56256 */ 56257 56258 56259 56260 /** 56261 * Internal dependencies 56262 */ 56263 56264 56265 56266 const table_metadata = { 56267 $schema: "https://schemas.wp.org/trunk/block.json", 56268 apiVersion: 3, 56269 name: "core/table", 56270 title: "Table", 56271 category: "text", 56272 description: "Create structured content in rows and columns to display information.", 56273 textdomain: "default", 56274 attributes: { 56275 hasFixedLayout: { 56276 type: "boolean", 56277 "default": false 56278 }, 56279 caption: { 56280 type: "rich-text", 56281 source: "rich-text", 56282 selector: "figcaption" 56283 }, 56284 head: { 56285 type: "array", 56286 "default": [], 56287 source: "query", 56288 selector: "thead tr", 56289 query: { 56290 cells: { 56291 type: "array", 56292 "default": [], 56293 source: "query", 56294 selector: "td,th", 56295 query: { 56296 content: { 56297 type: "rich-text", 56298 source: "rich-text" 56299 }, 56300 tag: { 56301 type: "string", 56302 "default": "td", 56303 source: "tag" 56304 }, 56305 scope: { 56306 type: "string", 56307 source: "attribute", 56308 attribute: "scope" 56309 }, 56310 align: { 56311 type: "string", 56312 source: "attribute", 56313 attribute: "data-align" 56314 }, 56315 colspan: { 56316 type: "string", 56317 source: "attribute", 56318 attribute: "colspan" 56319 }, 56320 rowspan: { 56321 type: "string", 56322 source: "attribute", 56323 attribute: "rowspan" 56324 } 56325 } 56326 } 56327 } 56328 }, 56329 body: { 56330 type: "array", 56331 "default": [], 56332 source: "query", 56333 selector: "tbody tr", 56334 query: { 56335 cells: { 56336 type: "array", 56337 "default": [], 56338 source: "query", 56339 selector: "td,th", 56340 query: { 56341 content: { 56342 type: "rich-text", 56343 source: "rich-text" 56344 }, 56345 tag: { 56346 type: "string", 56347 "default": "td", 56348 source: "tag" 56349 }, 56350 scope: { 56351 type: "string", 56352 source: "attribute", 56353 attribute: "scope" 56354 }, 56355 align: { 56356 type: "string", 56357 source: "attribute", 56358 attribute: "data-align" 56359 }, 56360 colspan: { 56361 type: "string", 56362 source: "attribute", 56363 attribute: "colspan" 56364 }, 56365 rowspan: { 56366 type: "string", 56367 source: "attribute", 56368 attribute: "rowspan" 56369 } 56370 } 56371 } 56372 } 56373 }, 56374 foot: { 56375 type: "array", 56376 "default": [], 56377 source: "query", 56378 selector: "tfoot tr", 56379 query: { 56380 cells: { 56381 type: "array", 56382 "default": [], 56383 source: "query", 56384 selector: "td,th", 56385 query: { 56386 content: { 56387 type: "rich-text", 56388 source: "rich-text" 56389 }, 56390 tag: { 56391 type: "string", 56392 "default": "td", 56393 source: "tag" 56394 }, 56395 scope: { 56396 type: "string", 56397 source: "attribute", 56398 attribute: "scope" 56399 }, 56400 align: { 56401 type: "string", 56402 source: "attribute", 56403 attribute: "data-align" 56404 }, 56405 colspan: { 56406 type: "string", 56407 source: "attribute", 56408 attribute: "colspan" 56409 }, 56410 rowspan: { 56411 type: "string", 56412 source: "attribute", 56413 attribute: "rowspan" 56414 } 56415 } 56416 } 56417 } 56418 } 56419 }, 56420 supports: { 56421 anchor: true, 56422 align: true, 56423 color: { 56424 __experimentalSkipSerialization: true, 56425 gradients: true, 56426 __experimentalDefaultControls: { 56427 background: true, 56428 text: true 56429 } 56430 }, 56431 spacing: { 56432 margin: true, 56433 padding: true, 56434 __experimentalDefaultControls: { 56435 margin: false, 56436 padding: false 56437 } 56438 }, 56439 typography: { 56440 fontSize: true, 56441 lineHeight: true, 56442 __experimentalFontFamily: true, 56443 __experimentalFontStyle: true, 56444 __experimentalFontWeight: true, 56445 __experimentalLetterSpacing: true, 56446 __experimentalTextTransform: true, 56447 __experimentalTextDecoration: true, 56448 __experimentalDefaultControls: { 56449 fontSize: true 56450 } 56451 }, 56452 __experimentalBorder: { 56453 __experimentalSkipSerialization: true, 56454 color: true, 56455 style: true, 56456 width: true, 56457 __experimentalDefaultControls: { 56458 color: true, 56459 style: true, 56460 width: true 56461 } 56462 }, 56463 __experimentalSelector: ".wp-block-table > table", 56464 interactivity: { 56465 clientNavigation: true 56466 } 56467 }, 56468 styles: [{ 56469 name: "regular", 56470 label: "Default", 56471 isDefault: true 56472 }, { 56473 name: "stripes", 56474 label: "Stripes" 56475 }], 56476 editorStyle: "wp-block-table-editor", 56477 style: "wp-block-table" 56478 }; 56479 56480 56481 const { 56482 name: table_name 56483 } = table_metadata; 56484 56485 const table_settings = { 56486 icon: block_table, 56487 example: { 56488 attributes: { 56489 head: [{ 56490 cells: [{ 56491 content: (0,external_wp_i18n_namespaceObject.__)('Version'), 56492 tag: 'th' 56493 }, { 56494 content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'), 56495 tag: 'th' 56496 }, { 56497 content: (0,external_wp_i18n_namespaceObject.__)('Release Date'), 56498 tag: 'th' 56499 }] 56500 }], 56501 body: [{ 56502 cells: [{ 56503 content: '5.2', 56504 tag: 'td' 56505 }, { 56506 content: 'Jaco Pastorius', 56507 tag: 'td' 56508 }, { 56509 content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'), 56510 tag: 'td' 56511 }] 56512 }, { 56513 cells: [{ 56514 content: '5.1', 56515 tag: 'td' 56516 }, { 56517 content: 'Betty Carter', 56518 tag: 'td' 56519 }, { 56520 content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'), 56521 tag: 'td' 56522 }] 56523 }, { 56524 cells: [{ 56525 content: '5.0', 56526 tag: 'td' 56527 }, { 56528 content: 'Bebo Valdés', 56529 tag: 'td' 56530 }, { 56531 content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'), 56532 tag: 'td' 56533 }] 56534 }] 56535 }, 56536 viewportWidth: 450 56537 }, 56538 transforms: table_transforms, 56539 edit: table_edit, 56540 save: table_save_save, 56541 deprecated: table_deprecated 56542 }; 56543 const table_init = () => initBlock({ 56544 name: table_name, 56545 metadata: table_metadata, 56546 settings: table_settings 56547 }); 56548 56549 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-of-contents.js 56550 56551 /** 56552 * WordPress dependencies 56553 */ 56554 56555 const tableOfContents = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 56556 xmlns: "http://www.w3.org/2000/svg", 56557 viewBox: "0 0 24 24" 56558 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 56559 fillRule: "evenodd", 56560 clipRule: "evenodd", 56561 d: "M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" 56562 }), (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 56563 d: "M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" 56564 })); 56565 /* harmony default export */ const table_of_contents = (tableOfContents); 56566 56567 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/list.js 56568 56569 /** 56570 * External dependencies 56571 */ 56572 56573 /** 56574 * Internal dependencies 56575 */ 56576 56577 const ENTRY_CLASS_NAME = 'wp-block-table-of-contents__entry'; 56578 function TableOfContentsList({ 56579 nestedHeadingList, 56580 disableLinkActivation, 56581 onClick 56582 }) { 56583 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, nestedHeadingList.map((node, index) => { 56584 const { 56585 content, 56586 link 56587 } = node.heading; 56588 const entry = link ? (0,external_React_namespaceObject.createElement)("a", { 56589 className: ENTRY_CLASS_NAME, 56590 href: link, 56591 "aria-disabled": disableLinkActivation || undefined, 56592 onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined 56593 }, content) : (0,external_React_namespaceObject.createElement)("span", { 56594 className: ENTRY_CLASS_NAME 56595 }, content); 56596 return (0,external_React_namespaceObject.createElement)("li", { 56597 key: index 56598 }, entry, node.children ? (0,external_React_namespaceObject.createElement)("ol", null, (0,external_React_namespaceObject.createElement)(TableOfContentsList, { 56599 nestedHeadingList: node.children, 56600 disableLinkActivation: disableLinkActivation, 56601 onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined 56602 })) : null); 56603 })); 56604 } 56605 56606 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/utils.js 56607 /** 56608 * Takes a flat list of heading parameters and nests them based on each header's 56609 * immediate parent's level. 56610 * 56611 * @param headingList The flat list of headings to nest. 56612 * 56613 * @return The nested list of headings. 56614 */ 56615 function linearToNestedHeadingList(headingList) { 56616 const nestedHeadingList = []; 56617 headingList.forEach((heading, key) => { 56618 if (heading.content === '') { 56619 return; 56620 } 56621 56622 // Make sure we are only working with the same level as the first iteration in our set. 56623 if (heading.level === headingList[0].level) { 56624 // Check that the next iteration will return a value. 56625 // If it does and the next level is greater than the current level, 56626 // the next iteration becomes a child of the current iteration. 56627 if (headingList[key + 1]?.level > heading.level) { 56628 // We must calculate the last index before the next iteration that 56629 // has the same level (siblings). We then use this index to slice 56630 // the array for use in recursion. This prevents duplicate nodes. 56631 let endOfSlice = headingList.length; 56632 for (let i = key + 1; i < headingList.length; i++) { 56633 if (headingList[i].level === heading.level) { 56634 endOfSlice = i; 56635 break; 56636 } 56637 } 56638 56639 // We found a child node: Push a new node onto the return array 56640 // with children. 56641 nestedHeadingList.push({ 56642 heading, 56643 children: linearToNestedHeadingList(headingList.slice(key + 1, endOfSlice)) 56644 }); 56645 } else { 56646 // No child node: Push a new node onto the return array. 56647 nestedHeadingList.push({ 56648 heading, 56649 children: null 56650 }); 56651 } 56652 } 56653 }); 56654 return nestedHeadingList; 56655 } 56656 56657 // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js 56658 var es6 = __webpack_require__(7734); 56659 var es6_default = /*#__PURE__*/__webpack_require__.n(es6); 56660 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/hooks.js 56661 /** 56662 * External dependencies 56663 */ 56664 56665 56666 /** 56667 * WordPress dependencies 56668 */ 56669 56670 56671 56672 56673 56674 function getLatestHeadings(select, clientId) { 56675 var _select$getPermalink, _getBlockAttributes; 56676 const { 56677 getBlockAttributes, 56678 getBlockName, 56679 getClientIdsWithDescendants, 56680 getBlocksByName 56681 } = select(external_wp_blockEditor_namespaceObject.store); 56682 56683 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 56684 // Blocks can be loaded into a *non-post* block editor, so to avoid 56685 // declaring @wordpress/editor as a dependency, we must access its 56686 // store by string. When the store is not available, editorSelectors 56687 // will be null, and the block's saved markup will lack permalinks. 56688 // eslint-disable-next-line @wordpress/data-no-store-string-literals 56689 const permalink = (_select$getPermalink = select('core/editor').getPermalink()) !== null && _select$getPermalink !== void 0 ? _select$getPermalink : null; 56690 const isPaginated = getBlocksByName('core/nextpage').length !== 0; 56691 const { 56692 onlyIncludeCurrentPage 56693 } = (_getBlockAttributes = getBlockAttributes(clientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {}; 56694 56695 // Get the client ids of all blocks in the editor. 56696 const allBlockClientIds = getClientIdsWithDescendants(); 56697 56698 // If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation. 56699 let tocPage = 1; 56700 if (isPaginated && onlyIncludeCurrentPage) { 56701 // We can't use getBlockIndex because it only returns the index 56702 // relative to sibling blocks. 56703 const tocIndex = allBlockClientIds.indexOf(clientId); 56704 for (const [blockIndex, blockClientId] of allBlockClientIds.entries()) { 56705 // If we've reached blocks after the Table of Contents, we've 56706 // finished calculating which page the block is on. 56707 if (blockIndex >= tocIndex) { 56708 break; 56709 } 56710 if (getBlockName(blockClientId) === 'core/nextpage') { 56711 tocPage++; 56712 } 56713 } 56714 } 56715 const latestHeadings = []; 56716 56717 /** The page (of a paginated post) a heading will be part of. */ 56718 let headingPage = 1; 56719 let headingPageLink = null; 56720 56721 // If the core/editor store is available, we can add permalinks to the 56722 // generated table of contents. 56723 if (typeof permalink === 'string') { 56724 headingPageLink = isPaginated ? (0,external_wp_url_namespaceObject.addQueryArgs)(permalink, { 56725 page: headingPage 56726 }) : permalink; 56727 } 56728 for (const blockClientId of allBlockClientIds) { 56729 const blockName = getBlockName(blockClientId); 56730 if (blockName === 'core/nextpage') { 56731 headingPage++; 56732 56733 // If we're only including headings from the current page (of 56734 // a paginated post), then exit the loop if we've reached the 56735 // pages after the one with the Table of Contents block. 56736 if (onlyIncludeCurrentPage && headingPage > tocPage) { 56737 break; 56738 } 56739 if (typeof permalink === 'string') { 56740 headingPageLink = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(permalink, ['page']), { 56741 page: headingPage 56742 }); 56743 } 56744 } 56745 // If we're including all headings or we've reached headings on 56746 // the same page as the Table of Contents block, add them to the 56747 // list. 56748 else if (!onlyIncludeCurrentPage || headingPage === tocPage) { 56749 if (blockName === 'core/heading') { 56750 const headingAttributes = getBlockAttributes(blockClientId); 56751 const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== ''; 56752 latestHeadings.push({ 56753 // Convert line breaks to spaces, and get rid of HTML tags in the headings. 56754 content: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(<br *\/?>)+/g, ' ')), 56755 level: headingAttributes.level, 56756 link: canBeLinked ? `$headingPageLink}#${headingAttributes.anchor}` : null 56757 }); 56758 } 56759 } 56760 } 56761 return latestHeadings; 56762 } 56763 function observeCallback(select, dispatch, clientId) { 56764 const { 56765 getBlockAttributes 56766 } = select(external_wp_blockEditor_namespaceObject.store); 56767 const { 56768 updateBlockAttributes, 56769 __unstableMarkNextChangeAsNotPersistent 56770 } = dispatch(external_wp_blockEditor_namespaceObject.store); 56771 56772 /** 56773 * If the block no longer exists in the store, skip the update. 56774 * The "undo" action recreates the block and provides a new `clientId`. 56775 * The hook still might be observing the changes while the old block unmounts. 56776 */ 56777 const attributes = getBlockAttributes(clientId); 56778 if (attributes === null) { 56779 return; 56780 } 56781 const headings = getLatestHeadings(select, clientId); 56782 if (!es6_default()(headings, attributes.headings)) { 56783 __unstableMarkNextChangeAsNotPersistent(); 56784 updateBlockAttributes(clientId, { 56785 headings 56786 }); 56787 } 56788 } 56789 function useObserveHeadings(clientId) { 56790 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 56791 (0,external_wp_element_namespaceObject.useEffect)(() => { 56792 // Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`. 56793 // See: https://github.com/WordPress/gutenberg/pull/45513 56794 return registry.subscribe(() => observeCallback(registry.select, registry.dispatch, clientId)); 56795 }, [registry, clientId]); 56796 } 56797 56798 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/edit.js 56799 56800 /** 56801 * WordPress dependencies 56802 */ 56803 56804 56805 56806 56807 56808 56809 56810 56811 56812 56813 /** 56814 * Internal dependencies 56815 */ 56816 56817 56818 56819 56820 /** @typedef {import('./utils').HeadingData} HeadingData */ 56821 56822 /** 56823 * Table of Contents block edit component. 56824 * 56825 * @param {Object} props The props. 56826 * @param {Object} props.attributes The block attributes. 56827 * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post. 56828 * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated). 56829 * @param {string} props.clientId 56830 * @param {(attributes: Object) => void} props.setAttributes 56831 * 56832 * @return {Component} The component. 56833 */ 56834 function TableOfContentsEdit({ 56835 attributes: { 56836 headings = [], 56837 onlyIncludeCurrentPage 56838 }, 56839 clientId, 56840 setAttributes 56841 }) { 56842 useObserveHeadings(clientId); 56843 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 56844 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TableOfContentsEdit, 'table-of-contents'); 56845 56846 // If a user clicks to a link prevent redirection and show a warning. 56847 const { 56848 createWarningNotice, 56849 removeNotice 56850 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 56851 let noticeId; 56852 const showRedirectionPreventedNotice = event => { 56853 event.preventDefault(); 56854 // Remove previous warning if any, to show one at a time per block. 56855 removeNotice(noticeId); 56856 noticeId = `block-library/core/table-of-contents/redirection-prevented/$instanceId}`; 56857 createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { 56858 id: noticeId, 56859 type: 'snackbar' 56860 }); 56861 }; 56862 const canInsertList = (0,external_wp_data_namespaceObject.useSelect)(select => { 56863 const { 56864 getBlockRootClientId, 56865 canInsertBlockType 56866 } = select(external_wp_blockEditor_namespaceObject.store); 56867 const rootClientId = getBlockRootClientId(clientId); 56868 return canInsertBlockType('core/list', rootClientId); 56869 }, [clientId]); 56870 const { 56871 replaceBlocks 56872 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 56873 const headingTree = linearToNestedHeadingList(headings); 56874 const toolbarControls = canInsertList && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 56875 onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 56876 ordered: true, 56877 values: (0,external_wp_element_namespaceObject.renderToString)((0,external_React_namespaceObject.createElement)(TableOfContentsList, { 56878 nestedHeadingList: headingTree 56879 })) 56880 })) 56881 }, (0,external_wp_i18n_namespaceObject.__)('Convert to static list')))); 56882 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 56883 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 56884 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 56885 __nextHasNoMarginBottom: true, 56886 label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'), 56887 checked: onlyIncludeCurrentPage, 56888 onChange: value => setAttributes({ 56889 onlyIncludeCurrentPage: value 56890 }), 56891 help: onlyIncludeCurrentPage ? (0,external_wp_i18n_namespaceObject.__)('Only including headings from the current page (if the post is paginated).') : (0,external_wp_i18n_namespaceObject.__)('Toggle to only include headings from the current page (if the post is paginated).') 56892 }))); 56893 56894 // If there are no headings or the only heading is empty. 56895 // Note that the toolbar controls are intentionally omitted since the 56896 // "Convert to static list" option is useless to the placeholder state. 56897 if (headings.length === 0) { 56898 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", { 56899 ...blockProps 56900 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 56901 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 56902 icon: table_of_contents 56903 }), 56904 label: (0,external_wp_i18n_namespaceObject.__)('Table of Contents'), 56905 instructions: (0,external_wp_i18n_namespaceObject.__)('Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.') 56906 })), inspectorControls); 56907 } 56908 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("nav", { 56909 ...blockProps 56910 }, (0,external_React_namespaceObject.createElement)("ol", null, (0,external_React_namespaceObject.createElement)(TableOfContentsList, { 56911 nestedHeadingList: headingTree, 56912 disableLinkActivation: true, 56913 onClick: showRedirectionPreventedNotice 56914 }))), toolbarControls, inspectorControls); 56915 } 56916 56917 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/save.js 56918 56919 /** 56920 * WordPress dependencies 56921 */ 56922 56923 56924 /** 56925 * Internal dependencies 56926 */ 56927 56928 56929 function table_of_contents_save_save({ 56930 attributes: { 56931 headings = [] 56932 } 56933 }) { 56934 if (headings.length === 0) { 56935 return null; 56936 } 56937 return (0,external_React_namespaceObject.createElement)("nav", { 56938 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 56939 }, (0,external_React_namespaceObject.createElement)("ol", null, (0,external_React_namespaceObject.createElement)(TableOfContentsList, { 56940 nestedHeadingList: linearToNestedHeadingList(headings) 56941 }))); 56942 } 56943 56944 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js 56945 /** 56946 * WordPress dependencies 56947 */ 56948 56949 56950 /** 56951 * Internal dependencies 56952 */ 56953 56954 const table_of_contents_metadata = { 56955 $schema: "https://schemas.wp.org/trunk/block.json", 56956 apiVersion: 3, 56957 __experimental: true, 56958 name: "core/table-of-contents", 56959 title: "Table of Contents", 56960 category: "layout", 56961 description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.", 56962 keywords: ["document outline", "summary"], 56963 textdomain: "default", 56964 attributes: { 56965 headings: { 56966 type: "array", 56967 items: { 56968 type: "object" 56969 }, 56970 "default": [] 56971 }, 56972 onlyIncludeCurrentPage: { 56973 type: "boolean", 56974 "default": false 56975 } 56976 }, 56977 supports: { 56978 html: false, 56979 color: { 56980 text: true, 56981 background: true, 56982 gradients: true, 56983 link: true 56984 }, 56985 spacing: { 56986 margin: true, 56987 padding: true 56988 }, 56989 typography: { 56990 fontSize: true, 56991 lineHeight: true, 56992 __experimentalFontFamily: true, 56993 __experimentalFontWeight: true, 56994 __experimentalFontStyle: true, 56995 __experimentalTextTransform: true, 56996 __experimentalTextDecoration: true, 56997 __experimentalLetterSpacing: true, 56998 __experimentalDefaultControls: { 56999 fontSize: true 57000 } 57001 }, 57002 interactivity: { 57003 clientNavigation: true 57004 } 57005 }, 57006 example: {} 57007 }; 57008 57009 57010 const { 57011 name: table_of_contents_name 57012 } = table_of_contents_metadata; 57013 57014 const table_of_contents_settings = { 57015 icon: table_of_contents, 57016 edit: TableOfContentsEdit, 57017 save: table_of_contents_save_save 57018 }; 57019 const table_of_contents_init = () => initBlock({ 57020 name: table_of_contents_name, 57021 metadata: table_of_contents_metadata, 57022 settings: table_of_contents_settings 57023 }); 57024 57025 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js 57026 /** 57027 * WordPress dependencies 57028 */ 57029 57030 const tag_cloud_transforms_transforms = { 57031 from: [{ 57032 type: 'block', 57033 blocks: ['core/categories'], 57034 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud') 57035 }], 57036 to: [{ 57037 type: 'block', 57038 blocks: ['core/categories'], 57039 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories') 57040 }] 57041 }; 57042 /* harmony default export */ const tag_cloud_transforms = (tag_cloud_transforms_transforms); 57043 57044 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js 57045 57046 /** 57047 * WordPress dependencies 57048 */ 57049 57050 57051 57052 57053 57054 57055 57056 /** 57057 * Minimum number of tags a user can show using this block. 57058 * 57059 * @type {number} 57060 */ 57061 const MIN_TAGS = 1; 57062 57063 /** 57064 * Maximum number of tags a user can show using this block. 57065 * 57066 * @type {number} 57067 */ 57068 const MAX_TAGS = 100; 57069 const MIN_FONT_SIZE = 0.1; 57070 const MAX_FONT_SIZE = 100; 57071 function TagCloudEdit({ 57072 attributes, 57073 setAttributes 57074 }) { 57075 const { 57076 taxonomy, 57077 showTagCounts, 57078 numberOfTags, 57079 smallestFontSize, 57080 largestFontSize 57081 } = attributes; 57082 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 57083 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 57084 availableUnits: availableUnits || ['%', 'px', 'em', 'rem'] 57085 }); 57086 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTaxonomies({ 57087 per_page: -1 57088 }), []); 57089 const getTaxonomyOptions = () => { 57090 const selectOption = { 57091 label: (0,external_wp_i18n_namespaceObject.__)('- Select -'), 57092 value: '', 57093 disabled: true 57094 }; 57095 const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(tax => !!tax.show_cloud).map(item => { 57096 return { 57097 value: item.slug, 57098 label: item.name 57099 }; 57100 }); 57101 return [selectOption, ...taxonomyOptions]; 57102 }; 57103 const onFontSizeChange = (fontSizeLabel, newValue) => { 57104 // eslint-disable-next-line @wordpress/no-unused-vars-before-return 57105 const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue); 57106 if (!Number.isFinite(quantity)) { 57107 return; 57108 } 57109 const updateObj = { 57110 [fontSizeLabel]: newValue 57111 }; 57112 // We need to keep in sync the `unit` changes to both `smallestFontSize` 57113 // and `largestFontSize` attributes. 57114 Object.entries({ 57115 smallestFontSize, 57116 largestFontSize 57117 }).forEach(([attribute, currentValue]) => { 57118 const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); 57119 // Only add an update if the other font size attribute has a different unit. 57120 if (attribute !== fontSizeLabel && currentUnit !== newUnit) { 57121 updateObj[attribute] = `$currentQuantity}$newUnit}`; 57122 } 57123 }); 57124 setAttributes(updateObj); 57125 }; 57126 const inspectorControls = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 57127 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 57128 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 57129 __nextHasNoMarginBottom: true, 57130 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), 57131 options: getTaxonomyOptions(), 57132 value: taxonomy, 57133 onChange: selectedTaxonomy => setAttributes({ 57134 taxonomy: selectedTaxonomy 57135 }) 57136 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 57137 __nextHasNoMarginBottom: true, 57138 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 57139 checked: showTagCounts, 57140 onChange: () => setAttributes({ 57141 showTagCounts: !showTagCounts 57142 }) 57143 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 57144 __nextHasNoMarginBottom: true, 57145 __next40pxDefaultSize: true, 57146 label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'), 57147 value: numberOfTags, 57148 onChange: value => setAttributes({ 57149 numberOfTags: value 57150 }), 57151 min: MIN_TAGS, 57152 max: MAX_TAGS, 57153 required: true 57154 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { 57155 isBlock: true 57156 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 57157 label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'), 57158 value: smallestFontSize, 57159 onChange: value => { 57160 onFontSizeChange('smallestFontSize', value); 57161 }, 57162 units: units, 57163 min: MIN_FONT_SIZE, 57164 max: MAX_FONT_SIZE 57165 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { 57166 isBlock: true 57167 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, { 57168 label: (0,external_wp_i18n_namespaceObject.__)('Largest size'), 57169 value: largestFontSize, 57170 onChange: value => { 57171 onFontSizeChange('largestFontSize', value); 57172 }, 57173 units: units, 57174 min: MIN_FONT_SIZE, 57175 max: MAX_FONT_SIZE 57176 }))))); 57177 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, inspectorControls, (0,external_React_namespaceObject.createElement)("div", { 57178 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)() 57179 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)((external_wp_serverSideRender_default()), { 57180 skipBlockSupportAttributes: true, 57181 block: "core/tag-cloud", 57182 attributes: attributes 57183 })))); 57184 } 57185 /* harmony default export */ const tag_cloud_edit = (TagCloudEdit); 57186 57187 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 57188 /** 57189 * WordPress dependencies 57190 */ 57191 57192 57193 /** 57194 * Internal dependencies 57195 */ 57196 57197 57198 const tag_cloud_metadata = { 57199 $schema: "https://schemas.wp.org/trunk/block.json", 57200 apiVersion: 3, 57201 name: "core/tag-cloud", 57202 title: "Tag Cloud", 57203 category: "widgets", 57204 description: "A cloud of your most used tags.", 57205 textdomain: "default", 57206 attributes: { 57207 numberOfTags: { 57208 type: "number", 57209 "default": 45, 57210 minimum: 1, 57211 maximum: 100 57212 }, 57213 taxonomy: { 57214 type: "string", 57215 "default": "post_tag" 57216 }, 57217 showTagCounts: { 57218 type: "boolean", 57219 "default": false 57220 }, 57221 smallestFontSize: { 57222 type: "string", 57223 "default": "8pt" 57224 }, 57225 largestFontSize: { 57226 type: "string", 57227 "default": "22pt" 57228 } 57229 }, 57230 styles: [{ 57231 name: "default", 57232 label: "Default", 57233 isDefault: true 57234 }, { 57235 name: "outline", 57236 label: "Outline" 57237 }], 57238 supports: { 57239 html: false, 57240 align: true, 57241 spacing: { 57242 margin: true, 57243 padding: true 57244 }, 57245 typography: { 57246 lineHeight: true, 57247 __experimentalFontFamily: true, 57248 __experimentalFontWeight: true, 57249 __experimentalFontStyle: true, 57250 __experimentalTextTransform: true, 57251 __experimentalLetterSpacing: true 57252 }, 57253 interactivity: { 57254 clientNavigation: true 57255 } 57256 }, 57257 editorStyle: "wp-block-tag-cloud-editor" 57258 }; 57259 57260 const { 57261 name: tag_cloud_name 57262 } = tag_cloud_metadata; 57263 57264 const tag_cloud_settings = { 57265 icon: library_tag, 57266 example: {}, 57267 edit: tag_cloud_edit, 57268 transforms: tag_cloud_transforms 57269 }; 57270 const tag_cloud_init = () => initBlock({ 57271 name: tag_cloud_name, 57272 metadata: tag_cloud_metadata, 57273 settings: tag_cloud_settings 57274 }); 57275 57276 ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs 57277 /****************************************************************************** 57278 Copyright (c) Microsoft Corporation. 57279 57280 Permission to use, copy, modify, and/or distribute this software for any 57281 purpose with or without fee is hereby granted. 57282 57283 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 57284 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 57285 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 57286 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 57287 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 57288 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 57289 PERFORMANCE OF THIS SOFTWARE. 57290 ***************************************************************************** */ 57291 /* global Reflect, Promise, SuppressedError, Symbol */ 57292 57293 var extendStatics = function(d, b) { 57294 extendStatics = Object.setPrototypeOf || 57295 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 57296 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 57297 return extendStatics(d, b); 57298 }; 57299 57300 function __extends(d, b) { 57301 if (typeof b !== "function" && b !== null) 57302 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 57303 extendStatics(d, b); 57304 function __() { this.constructor = d; } 57305 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 57306 } 57307 57308 var __assign = function() { 57309 __assign = Object.assign || function __assign(t) { 57310 for (var s, i = 1, n = arguments.length; i < n; i++) { 57311 s = arguments[i]; 57312 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 57313 } 57314 return t; 57315 } 57316 return __assign.apply(this, arguments); 57317 } 57318 57319 function __rest(s, e) { 57320 var t = {}; 57321 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 57322 t[p] = s[p]; 57323 if (s != null && typeof Object.getOwnPropertySymbols === "function") 57324 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 57325 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 57326 t[p[i]] = s[p[i]]; 57327 } 57328 return t; 57329 } 57330 57331 function __decorate(decorators, target, key, desc) { 57332 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 57333 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 57334 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 57335 return c > 3 && r && Object.defineProperty(target, key, r), r; 57336 } 57337 57338 function __param(paramIndex, decorator) { 57339 return function (target, key) { decorator(target, key, paramIndex); } 57340 } 57341 57342 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 57343 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 57344 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 57345 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 57346 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 57347 var _, done = false; 57348 for (var i = decorators.length - 1; i >= 0; i--) { 57349 var context = {}; 57350 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 57351 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 57352 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 57353 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 57354 if (kind === "accessor") { 57355 if (result === void 0) continue; 57356 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 57357 if (_ = accept(result.get)) descriptor.get = _; 57358 if (_ = accept(result.set)) descriptor.set = _; 57359 if (_ = accept(result.init)) initializers.unshift(_); 57360 } 57361 else if (_ = accept(result)) { 57362 if (kind === "field") initializers.unshift(_); 57363 else descriptor[key] = _; 57364 } 57365 } 57366 if (target) Object.defineProperty(target, contextIn.name, descriptor); 57367 done = true; 57368 }; 57369 57370 function __runInitializers(thisArg, initializers, value) { 57371 var useValue = arguments.length > 2; 57372 for (var i = 0; i < initializers.length; i++) { 57373 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 57374 } 57375 return useValue ? value : void 0; 57376 }; 57377 57378 function __propKey(x) { 57379 return typeof x === "symbol" ? x : "".concat(x); 57380 }; 57381 57382 function __setFunctionName(f, name, prefix) { 57383 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 57384 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 57385 }; 57386 57387 function __metadata(metadataKey, metadataValue) { 57388 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 57389 } 57390 57391 function __awaiter(thisArg, _arguments, P, generator) { 57392 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 57393 return new (P || (P = Promise))(function (resolve, reject) { 57394 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 57395 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 57396 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 57397 step((generator = generator.apply(thisArg, _arguments || [])).next()); 57398 }); 57399 } 57400 57401 function __generator(thisArg, body) { 57402 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 57403 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 57404 function verb(n) { return function (v) { return step([n, v]); }; } 57405 function step(op) { 57406 if (f) throw new TypeError("Generator is already executing."); 57407 while (g && (g = 0, op[0] && (_ = 0)), _) try { 57408 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 57409 if (y = 0, t) op = [op[0] & 2, t.value]; 57410 switch (op[0]) { 57411 case 0: case 1: t = op; break; 57412 case 4: _.label++; return { value: op[1], done: false }; 57413 case 5: _.label++; y = op[1]; op = [0]; continue; 57414 case 7: op = _.ops.pop(); _.trys.pop(); continue; 57415 default: 57416 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 57417 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 57418 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 57419 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 57420 if (t[2]) _.ops.pop(); 57421 _.trys.pop(); continue; 57422 } 57423 op = body.call(thisArg, _); 57424 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 57425 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 57426 } 57427 } 57428 57429 var __createBinding = Object.create ? (function(o, m, k, k2) { 57430 if (k2 === undefined) k2 = k; 57431 var desc = Object.getOwnPropertyDescriptor(m, k); 57432 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 57433 desc = { enumerable: true, get: function() { return m[k]; } }; 57434 } 57435 Object.defineProperty(o, k2, desc); 57436 }) : (function(o, m, k, k2) { 57437 if (k2 === undefined) k2 = k; 57438 o[k2] = m[k]; 57439 }); 57440 57441 function __exportStar(m, o) { 57442 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 57443 } 57444 57445 function __values(o) { 57446 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 57447 if (m) return m.call(o); 57448 if (o && typeof o.length === "number") return { 57449 next: function () { 57450 if (o && i >= o.length) o = void 0; 57451 return { value: o && o[i++], done: !o }; 57452 } 57453 }; 57454 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 57455 } 57456 57457 function __read(o, n) { 57458 var m = typeof Symbol === "function" && o[Symbol.iterator]; 57459 if (!m) return o; 57460 var i = m.call(o), r, ar = [], e; 57461 try { 57462 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 57463 } 57464 catch (error) { e = { error: error }; } 57465 finally { 57466 try { 57467 if (r && !r.done && (m = i["return"])) m.call(i); 57468 } 57469 finally { if (e) throw e.error; } 57470 } 57471 return ar; 57472 } 57473 57474 /** @deprecated */ 57475 function __spread() { 57476 for (var ar = [], i = 0; i < arguments.length; i++) 57477 ar = ar.concat(__read(arguments[i])); 57478 return ar; 57479 } 57480 57481 /** @deprecated */ 57482 function __spreadArrays() { 57483 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 57484 for (var r = Array(s), k = 0, i = 0; i < il; i++) 57485 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 57486 r[k] = a[j]; 57487 return r; 57488 } 57489 57490 function __spreadArray(to, from, pack) { 57491 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 57492 if (ar || !(i in from)) { 57493 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 57494 ar[i] = from[i]; 57495 } 57496 } 57497 return to.concat(ar || Array.prototype.slice.call(from)); 57498 } 57499 57500 function __await(v) { 57501 return this instanceof __await ? (this.v = v, this) : new __await(v); 57502 } 57503 57504 function __asyncGenerator(thisArg, _arguments, generator) { 57505 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 57506 var g = generator.apply(thisArg, _arguments || []), i, q = []; 57507 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 57508 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 57509 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 57510 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 57511 function fulfill(value) { resume("next", value); } 57512 function reject(value) { resume("throw", value); } 57513 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 57514 } 57515 57516 function __asyncDelegator(o) { 57517 var i, p; 57518 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 57519 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 57520 } 57521 57522 function __asyncValues(o) { 57523 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 57524 var m = o[Symbol.asyncIterator], i; 57525 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 57526 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 57527 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 57528 } 57529 57530 function __makeTemplateObject(cooked, raw) { 57531 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 57532 return cooked; 57533 }; 57534 57535 var __setModuleDefault = Object.create ? (function(o, v) { 57536 Object.defineProperty(o, "default", { enumerable: true, value: v }); 57537 }) : function(o, v) { 57538 o["default"] = v; 57539 }; 57540 57541 function __importStar(mod) { 57542 if (mod && mod.__esModule) return mod; 57543 var result = {}; 57544 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 57545 __setModuleDefault(result, mod); 57546 return result; 57547 } 57548 57549 function __importDefault(mod) { 57550 return (mod && mod.__esModule) ? mod : { default: mod }; 57551 } 57552 57553 function __classPrivateFieldGet(receiver, state, kind, f) { 57554 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 57555 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 57556 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 57557 } 57558 57559 function __classPrivateFieldSet(receiver, state, value, kind, f) { 57560 if (kind === "m") throw new TypeError("Private method is not writable"); 57561 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 57562 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 57563 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 57564 } 57565 57566 function __classPrivateFieldIn(state, receiver) { 57567 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 57568 return typeof state === "function" ? receiver === state : state.has(receiver); 57569 } 57570 57571 function __addDisposableResource(env, value, async) { 57572 if (value !== null && value !== void 0) { 57573 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 57574 var dispose; 57575 if (async) { 57576 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 57577 dispose = value[Symbol.asyncDispose]; 57578 } 57579 if (dispose === void 0) { 57580 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 57581 dispose = value[Symbol.dispose]; 57582 } 57583 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 57584 env.stack.push({ value: value, dispose: dispose, async: async }); 57585 } 57586 else if (async) { 57587 env.stack.push({ async: true }); 57588 } 57589 return value; 57590 } 57591 57592 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 57593 var e = new Error(message); 57594 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 57595 }; 57596 57597 function __disposeResources(env) { 57598 function fail(e) { 57599 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 57600 env.hasError = true; 57601 } 57602 function next() { 57603 while (env.stack.length) { 57604 var rec = env.stack.pop(); 57605 try { 57606 var result = rec.dispose && rec.dispose.call(rec.value); 57607 if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 57608 } 57609 catch (e) { 57610 fail(e); 57611 } 57612 } 57613 if (env.hasError) throw env.error; 57614 } 57615 return next(); 57616 } 57617 57618 /* harmony default export */ const tslib_es6 = ({ 57619 __extends, 57620 __assign, 57621 __rest, 57622 __decorate, 57623 __param, 57624 __metadata, 57625 __awaiter, 57626 __generator, 57627 __createBinding, 57628 __exportStar, 57629 __values, 57630 __read, 57631 __spread, 57632 __spreadArrays, 57633 __spreadArray, 57634 __await, 57635 __asyncGenerator, 57636 __asyncDelegator, 57637 __asyncValues, 57638 __makeTemplateObject, 57639 __importStar, 57640 __importDefault, 57641 __classPrivateFieldGet, 57642 __classPrivateFieldSet, 57643 __classPrivateFieldIn, 57644 __addDisposableResource, 57645 __disposeResources, 57646 }); 57647 57648 ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js 57649 /** 57650 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt 57651 */ 57652 var SUPPORTED_LOCALE = { 57653 tr: { 57654 regexp: /\u0130|\u0049|\u0049\u0307/g, 57655 map: { 57656 İ: "\u0069", 57657 I: "\u0131", 57658 İ: "\u0069", 57659 }, 57660 }, 57661 az: { 57662 regexp: /\u0130/g, 57663 map: { 57664 İ: "\u0069", 57665 I: "\u0131", 57666 İ: "\u0069", 57667 }, 57668 }, 57669 lt: { 57670 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, 57671 map: { 57672 I: "\u0069\u0307", 57673 J: "\u006A\u0307", 57674 Į: "\u012F\u0307", 57675 Ì: "\u0069\u0307\u0300", 57676 Í: "\u0069\u0307\u0301", 57677 Ĩ: "\u0069\u0307\u0303", 57678 }, 57679 }, 57680 }; 57681 /** 57682 * Localized lower case. 57683 */ 57684 function localeLowerCase(str, locale) { 57685 var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; 57686 if (lang) 57687 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); 57688 return lowerCase(str); 57689 } 57690 /** 57691 * Lower case as a function. 57692 */ 57693 function lowerCase(str) { 57694 return str.toLowerCase(); 57695 } 57696 57697 ;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js 57698 57699 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). 57700 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 57701 // Remove all non-word characters. 57702 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 57703 /** 57704 * Normalize the string into something other libraries can manipulate easier. 57705 */ 57706 function noCase(input, options) { 57707 if (options === void 0) { options = {}; } 57708 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 57709 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 57710 var start = 0; 57711 var end = result.length; 57712 // Trim the delimiter from around the output string. 57713 while (result.charAt(start) === "\0") 57714 start++; 57715 while (result.charAt(end - 1) === "\0") 57716 end--; 57717 // Transform each token independently. 57718 return result.slice(start, end).split("\0").map(transform).join(delimiter); 57719 } 57720 /** 57721 * Replace `re` in the input string with the replacement value. 57722 */ 57723 function replace(input, re, value) { 57724 if (re instanceof RegExp) 57725 return input.replace(re, value); 57726 return re.reduce(function (input, re) { return input.replace(re, value); }, input); 57727 } 57728 57729 ;// CONCATENATED MODULE: ./node_modules/upper-case-first/dist.es2015/index.js 57730 /** 57731 * Upper case the first character of an input string. 57732 */ 57733 function upperCaseFirst(input) { 57734 return input.charAt(0).toUpperCase() + input.substr(1); 57735 } 57736 57737 ;// CONCATENATED MODULE: ./node_modules/capital-case/dist.es2015/index.js 57738 57739 57740 57741 function capitalCaseTransform(input) { 57742 return upperCaseFirst(input.toLowerCase()); 57743 } 57744 function capitalCase(input, options) { 57745 if (options === void 0) { options = {}; } 57746 return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); 57747 } 57748 57749 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js 57750 57751 /** 57752 * WordPress dependencies 57753 */ 57754 57755 const symbolFilled = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 57756 xmlns: "http://www.w3.org/2000/svg", 57757 viewBox: "0 0 24 24" 57758 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 57759 d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" 57760 })); 57761 /* harmony default export */ const symbol_filled = (symbolFilled); 57762 57763 ;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js 57764 57765 57766 function dotCase(input, options) { 57767 if (options === void 0) { options = {}; } 57768 return noCase(input, __assign({ delimiter: "." }, options)); 57769 } 57770 57771 ;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js 57772 57773 57774 function paramCase(input, options) { 57775 if (options === void 0) { options = {}; } 57776 return dotCase(input, __assign({ delimiter: "-" }, options)); 57777 } 57778 57779 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js 57780 /** 57781 * External dependencies 57782 */ 57783 57784 57785 /** 57786 * WordPress dependencies 57787 */ 57788 57789 57790 57791 57792 57793 57794 57795 /** 57796 * Internal dependencies 57797 */ 57798 57799 57800 /** 57801 * Retrieves the available template parts for the given area. 57802 * 57803 * @param {string} area Template part area. 57804 * @param {string} excludedId Template part ID to exclude. 57805 * 57806 * @return {{ templateParts: Array, isResolving: boolean }} array of template parts. 57807 */ 57808 function useAlternativeTemplateParts(area, excludedId) { 57809 const { 57810 templateParts, 57811 isResolving 57812 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 57813 const { 57814 getEntityRecords, 57815 isResolving: _isResolving 57816 } = select(external_wp_coreData_namespaceObject.store); 57817 const query = { 57818 per_page: -1 57819 }; 57820 return { 57821 templateParts: getEntityRecords('postType', 'wp_template_part', query), 57822 isResolving: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query]) 57823 }; 57824 }, []); 57825 const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { 57826 if (!templateParts) { 57827 return []; 57828 } 57829 return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || []; 57830 }, [templateParts, area, excludedId]); 57831 return { 57832 templateParts: filteredTemplateParts, 57833 isResolving 57834 }; 57835 } 57836 57837 /** 57838 * Retrieves the available block patterns for the given area. 57839 * 57840 * @param {string} area Template part area. 57841 * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks). 57842 * 57843 * @return {Array} array of block patterns. 57844 */ 57845 function useAlternativeBlockPatterns(area, clientId) { 57846 return (0,external_wp_data_namespaceObject.useSelect)(select => { 57847 const blockNameWithArea = area ? `core/template-part/$area}` : 'core/template-part'; 57848 const { 57849 getBlockRootClientId, 57850 getPatternsByBlockTypes 57851 } = select(external_wp_blockEditor_namespaceObject.store); 57852 const rootClientId = getBlockRootClientId(clientId); 57853 return getPatternsByBlockTypes(blockNameWithArea, rootClientId); 57854 }, [area, clientId]); 57855 } 57856 function useCreateTemplatePartFromBlocks(area, setAttributes) { 57857 const { 57858 saveEntityRecord 57859 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 57860 return async (blocks = [], title = (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')) => { 57861 // Currently template parts only allow latin chars. 57862 // Fallback slug will receive suffix by default. 57863 const cleanSlug = paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; 57864 57865 // If we have `area` set from block attributes, means an exposed 57866 // block variation was inserted. So add this prop to the template 57867 // part entity on creation. Afterwards remove `area` value from 57868 // block attributes. 57869 const record = { 57870 title, 57871 slug: cleanSlug, 57872 content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), 57873 // `area` is filterable on the server and defaults to `UNCATEGORIZED` 57874 // if provided value is not allowed. 57875 area 57876 }; 57877 const templatePart = await saveEntityRecord('postType', 'wp_template_part', record); 57878 setAttributes({ 57879 slug: templatePart.slug, 57880 theme: templatePart.theme, 57881 area: undefined 57882 }); 57883 }; 57884 } 57885 57886 /** 57887 * Retrieves the template part area object. 57888 * 57889 * @param {string} area Template part area identifier. 57890 * 57891 * @return {{icon: Object, label: string, tagName: string}} Template Part area. 57892 */ 57893 function useTemplatePartArea(area) { 57894 return (0,external_wp_data_namespaceObject.useSelect)(select => { 57895 var _selectedArea$area_ta; 57896 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 57897 // Blocks can be loaded into a *non-post* block editor. 57898 /* eslint-disable @wordpress/data-no-store-string-literals */ 57899 const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas(); 57900 /* eslint-enable @wordpress/data-no-store-string-literals */ 57901 57902 const selectedArea = definedAreas.find(definedArea => definedArea.area === area); 57903 const defaultArea = definedAreas.find(definedArea => definedArea.area === 'uncategorized'); 57904 return { 57905 icon: selectedArea?.icon || defaultArea?.icon, 57906 label: selectedArea?.label || (0,external_wp_i18n_namespaceObject.__)('Template Part'), 57907 tagName: (_selectedArea$area_ta = selectedArea?.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div' 57908 }; 57909 }, [area]); 57910 } 57911 57912 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js 57913 57914 /** 57915 * WordPress dependencies 57916 */ 57917 57918 57919 57920 function TitleModal({ 57921 areaLabel, 57922 onClose, 57923 onSubmit 57924 }) { 57925 // Restructure onCreate to set the blocks on local state. 57926 // Add modal to confirm title and trigger onCreate. 57927 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')); 57928 const submitForCreation = event => { 57929 event.preventDefault(); 57930 onSubmit(title); 57931 }; 57932 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 57933 title: (0,external_wp_i18n_namespaceObject.sprintf)( 57934 // Translators: %s as template part area title ("Header", "Footer", etc.). 57935 (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()), 57936 overlayClassName: "wp-block-template-part__placeholder-create-new__title-form", 57937 onRequestClose: onClose 57938 }, (0,external_React_namespaceObject.createElement)("form", { 57939 onSubmit: submitForCreation 57940 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { 57941 spacing: "5" 57942 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 57943 __nextHasNoMarginBottom: true, 57944 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 57945 value: title, 57946 onChange: setTitle 57947 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 57948 justify: "right" 57949 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 57950 variant: "primary", 57951 type: "submit", 57952 disabled: !title.length, 57953 "aria-disabled": !title.length 57954 }, (0,external_wp_i18n_namespaceObject.__)('Create')))))); 57955 } 57956 57957 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js 57958 57959 /** 57960 * WordPress dependencies 57961 */ 57962 57963 57964 57965 57966 /** 57967 * Internal dependencies 57968 */ 57969 57970 57971 function TemplatePartPlaceholder({ 57972 area, 57973 clientId, 57974 templatePartId, 57975 onOpenSelectionModal, 57976 setAttributes 57977 }) { 57978 const { 57979 templateParts, 57980 isResolving 57981 } = useAlternativeTemplateParts(area, templatePartId); 57982 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 57983 const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false); 57984 const areaObject = useTemplatePartArea(area); 57985 const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); 57986 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 57987 icon: areaObject.icon, 57988 label: areaObject.label, 57989 instructions: (0,external_wp_i18n_namespaceObject.sprintf)( 57990 // Translators: %s as template part area title ("Header", "Footer", etc.). 57991 (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase()) 57992 }, isResolving && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 57993 variant: "primary", 57994 onClick: onOpenSelectionModal 57995 }, (0,external_wp_i18n_namespaceObject.__)('Choose')), !isResolving && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 57996 variant: "secondary", 57997 onClick: () => { 57998 setShowTitleModal(true); 57999 } 58000 }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), showTitleModal && (0,external_React_namespaceObject.createElement)(TitleModal, { 58001 areaLabel: areaObject.label, 58002 onClose: () => setShowTitleModal(false), 58003 onSubmit: title => { 58004 createFromBlocks([], title); 58005 } 58006 })); 58007 } 58008 58009 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js 58010 58011 /** 58012 * WordPress dependencies 58013 */ 58014 58015 58016 58017 58018 58019 58020 58021 58022 58023 /** 58024 * Internal dependencies 58025 */ 58026 58027 58028 58029 function TemplatePartSelectionModal({ 58030 setAttributes, 58031 onClose, 58032 templatePartId = null, 58033 area, 58034 clientId 58035 }) { 58036 const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); 58037 const { 58038 templateParts 58039 } = useAlternativeTemplateParts(area, templatePartId); 58040 // We can map template parts to block patters to reuse the BlockPatternsList UI 58041 const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { 58042 const partsAsPatterns = templateParts.map(templatePart => ({ 58043 name: createTemplatePartId(templatePart.theme, templatePart.slug), 58044 title: templatePart.title.rendered, 58045 blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw), 58046 templatePart 58047 })); 58048 return searchPatterns(partsAsPatterns, searchValue); 58049 }, [templateParts, searchValue]); 58050 const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredTemplateParts); 58051 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 58052 const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { 58053 return searchPatterns(blockPatterns, searchValue); 58054 }, [blockPatterns, searchValue]); 58055 const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockPatterns); 58056 const { 58057 createSuccessNotice 58058 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 58059 const onTemplatePartSelect = templatePart => { 58060 setAttributes({ 58061 slug: templatePart.slug, 58062 theme: templatePart.theme, 58063 area: undefined 58064 }); 58065 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title. */ 58066 (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), templatePart.title?.rendered || templatePart.slug), { 58067 type: 'snackbar' 58068 }); 58069 onClose(); 58070 }; 58071 const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); 58072 const hasTemplateParts = !!filteredTemplateParts.length; 58073 const hasBlockPatterns = !!filteredBlockPatterns.length; 58074 return (0,external_React_namespaceObject.createElement)("div", { 58075 className: "block-library-template-part__selection-content" 58076 }, (0,external_React_namespaceObject.createElement)("div", { 58077 className: "block-library-template-part__selection-search" 58078 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, { 58079 __nextHasNoMarginBottom: true, 58080 onChange: setSearchValue, 58081 value: searchValue, 58082 label: (0,external_wp_i18n_namespaceObject.__)('Search for replacements'), 58083 placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') 58084 })), hasTemplateParts && (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Existing template parts')), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 58085 blockPatterns: filteredTemplateParts, 58086 shownPatterns: shownTemplateParts, 58087 onClickPattern: pattern => { 58088 onTemplatePartSelect(pattern.templatePart); 58089 } 58090 })), hasBlockPatterns && (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Patterns')), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 58091 blockPatterns: filteredBlockPatterns, 58092 shownPatterns: shownBlockPatterns, 58093 onClickPattern: (pattern, blocks) => { 58094 createFromBlocks(blocks, pattern.title); 58095 onClose(); 58096 } 58097 })), !hasTemplateParts && !hasBlockPatterns && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 58098 alignment: "center" 58099 }, (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.')))); 58100 } 58101 58102 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/transformers.js 58103 /** 58104 * WordPress dependencies 58105 */ 58106 58107 58108 /** 58109 * Converts a widget entity record into a block. 58110 * 58111 * @param {Object} widget The widget entity record. 58112 * @return {Object} a block (converted from the entity record). 58113 */ 58114 function transformWidgetToBlock(widget) { 58115 if (widget.id_base !== 'block') { 58116 let attributes; 58117 if (widget._embedded.about[0].is_multi) { 58118 attributes = { 58119 idBase: widget.id_base, 58120 instance: widget.instance 58121 }; 58122 } else { 58123 attributes = { 58124 id: widget.id 58125 }; 58126 } 58127 return switchLegacyWidgetType((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes)); 58128 } 58129 const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { 58130 __unstableSkipAutop: true 58131 }); 58132 if (!parsedBlocks.length) { 58133 return undefined; 58134 } 58135 const block = parsedBlocks[0]; 58136 if (block.name === 'core/widget-group') { 58137 return (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks)); 58138 } 58139 if (block.innerBlocks.length > 0) { 58140 return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, undefined, transformInnerBlocks(block.innerBlocks)); 58141 } 58142 return block; 58143 } 58144 58145 /** 58146 * Switch Legacy Widget to the first matching transformation block. 58147 * 58148 * @param {Object} block Legacy Widget block object 58149 * @return {Object|undefined} a block 58150 */ 58151 function switchLegacyWidgetType(block) { 58152 const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => { 58153 // The block without any transformations can't be a wildcard. 58154 if (!item.transforms) { 58155 return true; 58156 } 58157 const hasWildCardFrom = item.transforms?.from?.find(from => from.blocks && from.blocks.includes('*')); 58158 const hasWildCardTo = item.transforms?.to?.find(to => to.blocks && to.blocks.includes('*')); 58159 58160 // Skip wildcard transformations. 58161 return !hasWildCardFrom && !hasWildCardTo; 58162 }); 58163 if (!transforms.length) { 58164 return undefined; 58165 } 58166 return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name); 58167 } 58168 function transformInnerBlocks(innerBlocks = []) { 58169 return innerBlocks.flatMap(block => { 58170 if (block.name === 'core/legacy-widget') { 58171 return switchLegacyWidgetType(block); 58172 } 58173 return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks)); 58174 }).filter(block => !!block); 58175 } 58176 58177 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/import-controls.js 58178 58179 /** 58180 * WordPress dependencies 58181 */ 58182 58183 58184 58185 58186 58187 58188 58189 /** 58190 * Internal dependencies 58191 */ 58192 58193 58194 const SIDEBARS_QUERY = { 58195 per_page: -1, 58196 _fields: 'id,name,description,status,widgets' 58197 }; 58198 function TemplatePartImportControls({ 58199 area, 58200 setAttributes 58201 }) { 58202 const [selectedSidebar, setSelectedSidebar] = (0,external_wp_element_namespaceObject.useState)(''); 58203 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); 58204 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 58205 const { 58206 sidebars, 58207 hasResolved 58208 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 58209 const { 58210 getSidebars, 58211 hasFinishedResolution 58212 } = select(external_wp_coreData_namespaceObject.store); 58213 return { 58214 sidebars: getSidebars(SIDEBARS_QUERY), 58215 hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY]) 58216 }; 58217 }, []); 58218 const { 58219 createErrorNotice 58220 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 58221 const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); 58222 const options = (0,external_wp_element_namespaceObject.useMemo)(() => { 58223 const sidebarOptions = (sidebars !== null && sidebars !== void 0 ? sidebars : []).filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets' && widgetArea.widgets.length > 0).map(widgetArea => { 58224 return { 58225 value: widgetArea.id, 58226 label: widgetArea.name 58227 }; 58228 }); 58229 if (!sidebarOptions.length) { 58230 return []; 58231 } 58232 return [{ 58233 value: '', 58234 label: (0,external_wp_i18n_namespaceObject.__)('Select widget area') 58235 }, ...sidebarOptions]; 58236 }, [sidebars]); 58237 58238 // Render an empty node while data is loading to avoid SlotFill re-positioning bug. 58239 // See: https://github.com/WordPress/gutenberg/issues/15641. 58240 if (!hasResolved) { 58241 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, { 58242 marginBottom: "0" 58243 }); 58244 } 58245 if (hasResolved && !options.length) { 58246 return null; 58247 } 58248 async function createFromWidgets(event) { 58249 event.preventDefault(); 58250 if (isBusy || !selectedSidebar) { 58251 return; 58252 } 58253 setIsBusy(true); 58254 const sidebar = options.find(({ 58255 value 58256 }) => value === selectedSidebar); 58257 const { 58258 getWidgets 58259 } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); 58260 58261 // The widgets API always returns a successful response. 58262 const widgets = await getWidgets({ 58263 sidebar: sidebar.value, 58264 _embed: 'about' 58265 }); 58266 const skippedWidgets = new Set(); 58267 const blocks = widgets.flatMap(widget => { 58268 const block = transformWidgetToBlock(widget); 58269 58270 // Skip the block if we have no matching transformations. 58271 if (!block) { 58272 skippedWidgets.add(widget.id_base); 58273 return []; 58274 } 58275 return block; 58276 }); 58277 await createFromBlocks(blocks, /* translators: %s: name of the widget area */ 58278 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Widget area: %s'), sidebar.label)); 58279 if (skippedWidgets.size) { 58280 createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the list of widgets */ 58281 (0,external_wp_i18n_namespaceObject.__)('Unable to import the following widgets: %s.'), Array.from(skippedWidgets).join(', ')), { 58282 type: 'snackbar' 58283 }); 58284 } 58285 setIsBusy(false); 58286 } 58287 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, { 58288 marginBottom: "4" 58289 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 58290 as: "form", 58291 onSubmit: createFromWidgets 58292 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 58293 label: (0,external_wp_i18n_namespaceObject.__)('Import widget area'), 58294 value: selectedSidebar, 58295 options: options, 58296 onChange: value => setSelectedSidebar(value), 58297 disabled: !options.length, 58298 __next40pxDefaultSize: true, 58299 __nextHasNoMarginBottom: true 58300 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, { 58301 style: { 58302 marginBottom: '8px', 58303 marginTop: 'auto' 58304 } 58305 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 58306 __next40pxDefaultSize: true, 58307 variant: "primary", 58308 type: "submit", 58309 isBusy: isBusy, 58310 "aria-disabled": isBusy || !selectedSidebar 58311 }, (0,external_wp_i18n_namespaceObject._x)('Import', 'button label'))))); 58312 } 58313 58314 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js 58315 58316 /** 58317 * WordPress dependencies 58318 */ 58319 58320 58321 58322 58323 58324 /** 58325 * Internal dependencies 58326 */ 58327 58328 const htmlElementMessages = { 58329 header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), 58330 main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), 58331 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."), 58332 article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), 58333 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."), 58334 footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).') 58335 }; 58336 function TemplatePartAdvancedControls({ 58337 tagName, 58338 setAttributes, 58339 isEntityAvailable, 58340 templatePartId, 58341 defaultWrapper, 58342 hasInnerBlocks 58343 }) { 58344 const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId); 58345 const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId); 58346 const definedAreas = (0,external_wp_data_namespaceObject.useSelect)(select => { 58347 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 58348 // Blocks can be loaded into a *non-post* block editor. 58349 /* eslint-disable-next-line @wordpress/data-no-store-string-literals */ 58350 return select('core/editor').__experimentalGetDefaultTemplatePartAreas(); 58351 }, []); 58352 const areaOptions = definedAreas.map(({ 58353 label, 58354 area: _area 58355 }) => ({ 58356 label, 58357 value: _area 58358 })); 58359 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isEntityAvailable && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 58360 __nextHasNoMarginBottom: true, 58361 label: (0,external_wp_i18n_namespaceObject.__)('Title'), 58362 value: title, 58363 onChange: value => { 58364 setTitle(value); 58365 }, 58366 onFocus: event => event.target.select() 58367 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 58368 __nextHasNoMarginBottom: true, 58369 label: (0,external_wp_i18n_namespaceObject.__)('Area'), 58370 labelPosition: "top", 58371 options: areaOptions, 58372 value: area, 58373 onChange: setArea 58374 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 58375 __nextHasNoMarginBottom: true, 58376 __next40pxDefaultSize: true, 58377 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 58378 options: [{ 58379 label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: HTML tag based on area. */ 58380 (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<$defaultWrapper}>`), 58381 value: '' 58382 }, { 58383 label: '<header>', 58384 value: 'header' 58385 }, { 58386 label: '<main>', 58387 value: 'main' 58388 }, { 58389 label: '<section>', 58390 value: 'section' 58391 }, { 58392 label: '<article>', 58393 value: 'article' 58394 }, { 58395 label: '<aside>', 58396 value: 'aside' 58397 }, { 58398 label: '<footer>', 58399 value: 'footer' 58400 }, { 58401 label: '<div>', 58402 value: 'div' 58403 }], 58404 value: tagName || '', 58405 onChange: value => setAttributes({ 58406 tagName: value 58407 }), 58408 help: htmlElementMessages[tagName] 58409 }), !hasInnerBlocks && (0,external_React_namespaceObject.createElement)(TemplatePartImportControls, { 58410 area: area, 58411 setAttributes: setAttributes 58412 })); 58413 } 58414 58415 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js 58416 58417 /** 58418 * WordPress dependencies 58419 */ 58420 58421 58422 58423 function TemplatePartInnerBlocks({ 58424 postId: id, 58425 hasInnerBlocks, 58426 layout, 58427 tagName: TagName, 58428 blockProps 58429 }) { 58430 const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => { 58431 const { 58432 getSettings 58433 } = select(external_wp_blockEditor_namespaceObject.store); 58434 return getSettings()?.supportsLayout; 58435 }, []); 58436 const [defaultLayout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout'); 58437 const usedLayout = layout?.inherit ? defaultLayout || {} : layout; 58438 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', { 58439 id 58440 }); 58441 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 58442 value: blocks, 58443 onInput, 58444 onChange, 58445 renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender, 58446 layout: themeSupportsLayout ? usedLayout : undefined 58447 }); 58448 return (0,external_React_namespaceObject.createElement)(TagName, { 58449 ...innerBlocksProps 58450 }); 58451 } 58452 58453 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js 58454 58455 /** 58456 * WordPress dependencies 58457 */ 58458 58459 58460 58461 58462 58463 58464 58465 /** 58466 * Internal dependencies 58467 */ 58468 58469 58470 58471 58472 58473 58474 function ReplaceButton({ 58475 isEntityAvailable, 58476 area, 58477 clientId, 58478 templatePartId, 58479 isTemplatePartSelectionOpen, 58480 setIsTemplatePartSelectionOpen 58481 }) { 58482 const { 58483 templateParts 58484 } = useAlternativeTemplateParts(area, templatePartId); 58485 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 58486 const hasReplacements = !!templateParts.length || !!blockPatterns.length; 58487 const canReplace = isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); 58488 if (!canReplace) { 58489 return null; 58490 } 58491 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 58492 onClick: () => { 58493 setIsTemplatePartSelectionOpen(true); 58494 }, 58495 "aria-expanded": isTemplatePartSelectionOpen, 58496 "aria-haspopup": "dialog" 58497 }, (0,external_wp_i18n_namespaceObject.__)('Replace')); 58498 } 58499 function TemplatePartEdit({ 58500 attributes, 58501 setAttributes, 58502 clientId 58503 }) { 58504 const currentTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); 58505 const { 58506 slug, 58507 theme = currentTheme, 58508 tagName, 58509 layout = {} 58510 } = attributes; 58511 const templatePartId = createTemplatePartId(theme, slug); 58512 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(templatePartId); 58513 const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); 58514 const { 58515 isResolved, 58516 hasInnerBlocks, 58517 isMissing, 58518 area 58519 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 58520 const { 58521 getEditedEntityRecord, 58522 hasFinishedResolution 58523 } = select(external_wp_coreData_namespaceObject.store); 58524 const { 58525 getBlockCount 58526 } = select(external_wp_blockEditor_namespaceObject.store); 58527 const getEntityArgs = ['postType', 'wp_template_part', templatePartId]; 58528 const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null; 58529 const _area = entityRecord?.area || attributes.area; 58530 const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false; 58531 return { 58532 hasInnerBlocks: getBlockCount(clientId) > 0, 58533 isResolved: hasResolvedEntity, 58534 isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0), 58535 area: _area 58536 }; 58537 }, [templatePartId, attributes.area, clientId]); 58538 const areaObject = useTemplatePartArea(area); 58539 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 58540 const isPlaceholder = !slug; 58541 const isEntityAvailable = !isPlaceholder && !isMissing && isResolved; 58542 const TagName = tagName || areaObject.tagName; 58543 58544 // We don't want to render a missing state if we have any inner blocks. 58545 // A new template part is automatically created if we have any inner blocks but no entity. 58546 if (!hasInnerBlocks && (slug && !theme || slug && isMissing)) { 58547 return (0,external_React_namespaceObject.createElement)(TagName, { 58548 ...blockProps 58549 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Template part slug */ 58550 (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug))); 58551 } 58552 if (isEntityAvailable && hasAlreadyRendered) { 58553 return (0,external_React_namespaceObject.createElement)(TagName, { 58554 ...blockProps 58555 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.'))); 58556 } 58557 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 58558 uniqueId: templatePartId 58559 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, { 58560 group: "advanced" 58561 }, (0,external_React_namespaceObject.createElement)(TemplatePartAdvancedControls, { 58562 tagName: tagName, 58563 setAttributes: setAttributes, 58564 isEntityAvailable: isEntityAvailable, 58565 templatePartId: templatePartId, 58566 defaultWrapper: areaObject.tagName, 58567 hasInnerBlocks: hasInnerBlocks 58568 })), isPlaceholder && (0,external_React_namespaceObject.createElement)(TagName, { 58569 ...blockProps 58570 }, (0,external_React_namespaceObject.createElement)(TemplatePartPlaceholder, { 58571 area: attributes.area, 58572 templatePartId: templatePartId, 58573 clientId: clientId, 58574 setAttributes: setAttributes, 58575 onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true) 58576 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, ({ 58577 selectedClientIds 58578 }) => { 58579 // Only enable for single selection that matches the current block. 58580 // Ensures menu item doesn't render multiple times. 58581 if (!(selectedClientIds.length === 1 && clientId === selectedClientIds[0])) { 58582 return null; 58583 } 58584 return (0,external_React_namespaceObject.createElement)(ReplaceButton, { 58585 isEntityAvailable, 58586 area, 58587 clientId, 58588 templatePartId, 58589 isTemplatePartSelectionOpen, 58590 setIsTemplatePartSelectionOpen 58591 }); 58592 }), isEntityAvailable && (0,external_React_namespaceObject.createElement)(TemplatePartInnerBlocks, { 58593 tagName: TagName, 58594 blockProps: blockProps, 58595 postId: templatePartId, 58596 hasInnerBlocks: hasInnerBlocks, 58597 layout: layout 58598 }), !isPlaceholder && !isResolved && (0,external_React_namespaceObject.createElement)(TagName, { 58599 ...blockProps 58600 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), isTemplatePartSelectionOpen && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { 58601 overlayClassName: "block-editor-template-part__selection-modal", 58602 title: (0,external_wp_i18n_namespaceObject.sprintf)( 58603 // Translators: %s as template part area title ("Header", "Footer", etc.). 58604 (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()), 58605 onRequestClose: () => setIsTemplatePartSelectionOpen(false), 58606 isFullScreen: true 58607 }, (0,external_React_namespaceObject.createElement)(TemplatePartSelectionModal, { 58608 templatePartId: templatePartId, 58609 clientId: clientId, 58610 area: area, 58611 setAttributes: setAttributes, 58612 onClose: () => setIsTemplatePartSelectionOpen(false) 58613 }))); 58614 } 58615 58616 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js 58617 58618 /** 58619 * WordPress dependencies 58620 */ 58621 58622 const header = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 58623 xmlns: "http://www.w3.org/2000/svg", 58624 viewBox: "0 0 24 24" 58625 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 58626 d: "M18.5 10.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" 58627 })); 58628 /* harmony default export */ const library_header = (header); 58629 58630 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js 58631 58632 /** 58633 * WordPress dependencies 58634 */ 58635 58636 const footer = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 58637 xmlns: "http://www.w3.org/2000/svg", 58638 viewBox: "0 0 24 24" 58639 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 58640 fillRule: "evenodd", 58641 d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" 58642 })); 58643 /* harmony default export */ const library_footer = (footer); 58644 58645 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js 58646 58647 /** 58648 * WordPress dependencies 58649 */ 58650 58651 const sidebar = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 58652 xmlns: "http://www.w3.org/2000/svg", 58653 viewBox: "0 0 24 24" 58654 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 58655 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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" 58656 })); 58657 /* harmony default export */ const library_sidebar = (sidebar); 58658 58659 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js 58660 /** 58661 * WordPress dependencies 58662 */ 58663 58664 58665 58666 function getTemplatePartIcon(iconName) { 58667 if ('header' === iconName) { 58668 return library_header; 58669 } else if ('footer' === iconName) { 58670 return library_footer; 58671 } else if ('sidebar' === iconName) { 58672 return library_sidebar; 58673 } 58674 return symbol_filled; 58675 } 58676 function enhanceTemplatePartVariations(settings, name) { 58677 if (name !== 'core/template-part') { 58678 return settings; 58679 } 58680 if (settings.variations) { 58681 const isActive = (blockAttributes, variationAttributes) => { 58682 const { 58683 area, 58684 theme, 58685 slug 58686 } = blockAttributes; 58687 // We first check the `area` block attribute which is set during insertion. 58688 // This property is removed on the creation of a template part. 58689 if (area) return area === variationAttributes.area; 58690 // Find a matching variation from the created template part 58691 // by checking the entity's `area` property. 58692 if (!slug) return false; 58693 const { 58694 getCurrentTheme, 58695 getEntityRecord 58696 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 58697 const entity = getEntityRecord('postType', 'wp_template_part', `$theme || getCurrentTheme()?.stylesheet}//${slug}`); 58698 if (entity?.slug) { 58699 return entity.slug === variationAttributes.slug; 58700 } 58701 return entity?.area === variationAttributes.area; 58702 }; 58703 const variations = settings.variations.map(variation => { 58704 return { 58705 ...variation, 58706 ...(!variation.isActive && { 58707 isActive 58708 }), 58709 ...(typeof variation.icon === 'string' && { 58710 icon: getTemplatePartIcon(variation.icon) 58711 }) 58712 }; 58713 }); 58714 return { 58715 ...settings, 58716 variations 58717 }; 58718 } 58719 return settings; 58720 } 58721 58722 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js 58723 /** 58724 * External dependencies 58725 */ 58726 58727 58728 /** 58729 * WordPress dependencies 58730 */ 58731 58732 58733 58734 58735 58736 58737 /** 58738 * Internal dependencies 58739 */ 58740 58741 const template_part_metadata = { 58742 $schema: "https://schemas.wp.org/trunk/block.json", 58743 apiVersion: 3, 58744 name: "core/template-part", 58745 title: "Template Part", 58746 category: "theme", 58747 description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", 58748 textdomain: "default", 58749 attributes: { 58750 slug: { 58751 type: "string" 58752 }, 58753 theme: { 58754 type: "string" 58755 }, 58756 tagName: { 58757 type: "string" 58758 }, 58759 area: { 58760 type: "string" 58761 } 58762 }, 58763 supports: { 58764 align: true, 58765 html: false, 58766 reusable: false, 58767 renaming: false, 58768 interactivity: { 58769 clientNavigation: true 58770 } 58771 }, 58772 editorStyle: "wp-block-template-part-editor" 58773 }; 58774 58775 58776 const { 58777 name: template_part_name 58778 } = template_part_metadata; 58779 58780 const template_part_settings = { 58781 icon: symbol_filled, 58782 __experimentalLabel: ({ 58783 slug, 58784 theme 58785 }) => { 58786 // Attempt to find entity title if block is a template part. 58787 // Require slug to request, otherwise entity is uncreated and will throw 404. 58788 if (!slug) { 58789 return; 58790 } 58791 const { 58792 getCurrentTheme, 58793 getEditedEntityRecord 58794 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 58795 const entity = getEditedEntityRecord('postType', 'wp_template_part', (theme || getCurrentTheme()?.stylesheet) + '//' + slug); 58796 if (!entity) { 58797 return; 58798 } 58799 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title) || capitalCase(entity.slug || ''); 58800 }, 58801 edit: TemplatePartEdit 58802 }; 58803 const template_part_init = () => { 58804 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); 58805 58806 // Prevent adding template parts inside post templates. 58807 const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content']; 58808 (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, { 58809 getBlock, 58810 getBlockParentsByBlockName 58811 }) => { 58812 if (blockType.name !== 'core/template-part') { 58813 return canInsert; 58814 } 58815 for (const disallowedParentType of DISALLOWED_PARENTS) { 58816 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; 58817 if (hasDisallowedParent) { 58818 return false; 58819 } 58820 } 58821 return true; 58822 }); 58823 return initBlock({ 58824 name: template_part_name, 58825 metadata: template_part_metadata, 58826 settings: template_part_settings 58827 }); 58828 }; 58829 58830 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js 58831 58832 /** 58833 * WordPress dependencies 58834 */ 58835 58836 const term_description_tag = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 58837 xmlns: "http://www.w3.org/2000/svg", 58838 viewBox: "0 0 24 24" 58839 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 58840 d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z" 58841 })); 58842 /* harmony default export */ const term_description = (term_description_tag); 58843 58844 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js 58845 58846 /** 58847 * External dependencies 58848 */ 58849 58850 58851 /** 58852 * WordPress dependencies 58853 */ 58854 58855 58856 function TermDescriptionEdit({ 58857 attributes, 58858 setAttributes, 58859 mergedStyle 58860 }) { 58861 const { 58862 textAlign 58863 } = attributes; 58864 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 58865 className: classnames_default()({ 58866 [`has-text-align-$textAlign}`]: textAlign 58867 }), 58868 style: mergedStyle 58869 }); 58870 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 58871 group: "block" 58872 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 58873 value: textAlign, 58874 onChange: nextAlign => { 58875 setAttributes({ 58876 textAlign: nextAlign 58877 }); 58878 } 58879 })), (0,external_React_namespaceObject.createElement)("div", { 58880 ...blockProps 58881 }, (0,external_React_namespaceObject.createElement)("div", { 58882 className: "wp-block-term-description__placeholder" 58883 }, (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description'))))); 58884 } 58885 58886 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js 58887 /** 58888 * WordPress dependencies 58889 */ 58890 58891 58892 /** 58893 * Internal dependencies 58894 */ 58895 58896 const term_description_metadata = { 58897 $schema: "https://schemas.wp.org/trunk/block.json", 58898 apiVersion: 3, 58899 name: "core/term-description", 58900 title: "Term Description", 58901 category: "theme", 58902 description: "Display the description of categories, tags and custom taxonomies when viewing an archive.", 58903 textdomain: "default", 58904 attributes: { 58905 textAlign: { 58906 type: "string" 58907 } 58908 }, 58909 supports: { 58910 align: ["wide", "full"], 58911 html: false, 58912 color: { 58913 link: true, 58914 __experimentalDefaultControls: { 58915 background: true, 58916 text: true 58917 } 58918 }, 58919 spacing: { 58920 padding: true, 58921 margin: true 58922 }, 58923 typography: { 58924 fontSize: true, 58925 lineHeight: true, 58926 __experimentalFontFamily: true, 58927 __experimentalFontWeight: true, 58928 __experimentalFontStyle: true, 58929 __experimentalTextTransform: true, 58930 __experimentalTextDecoration: true, 58931 __experimentalLetterSpacing: true, 58932 __experimentalDefaultControls: { 58933 fontSize: true 58934 } 58935 }, 58936 interactivity: { 58937 clientNavigation: true 58938 } 58939 } 58940 }; 58941 58942 const { 58943 name: term_description_name 58944 } = term_description_metadata; 58945 58946 const term_description_settings = { 58947 icon: term_description, 58948 edit: TermDescriptionEdit 58949 }; 58950 const term_description_init = () => initBlock({ 58951 name: term_description_name, 58952 metadata: term_description_metadata, 58953 settings: term_description_settings 58954 }); 58955 58956 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js 58957 58958 /** 58959 * WordPress dependencies 58960 */ 58961 58962 58963 58964 58965 function TextColumnsEdit({ 58966 attributes, 58967 setAttributes 58968 }) { 58969 const { 58970 width, 58971 content, 58972 columns 58973 } = attributes; 58974 external_wp_deprecated_default()('The Text Columns block', { 58975 since: '5.3', 58976 alternative: 'the Columns block' 58977 }); 58978 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, { 58979 value: width, 58980 onChange: nextWidth => setAttributes({ 58981 width: nextWidth 58982 }), 58983 controls: ['center', 'wide', 'full'] 58984 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, { 58985 __nextHasNoMarginBottom: true, 58986 __next40pxDefaultSize: true, 58987 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 58988 value: columns, 58989 onChange: value => setAttributes({ 58990 columns: value 58991 }), 58992 min: 2, 58993 max: 4, 58994 required: true 58995 }))), (0,external_React_namespaceObject.createElement)("div", { 58996 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 58997 className: `align$width} columns-$columns}` 58998 }) 58999 }, Array.from({ 59000 length: columns 59001 }).map((_, index) => { 59002 return (0,external_React_namespaceObject.createElement)("div", { 59003 className: "wp-block-column", 59004 key: `column-$index}` 59005 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 59006 tagName: "p", 59007 value: content?.[index]?.children, 59008 onChange: nextContent => { 59009 setAttributes({ 59010 content: [...content.slice(0, index), { 59011 children: nextContent 59012 }, ...content.slice(index + 1)] 59013 }); 59014 }, 59015 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( 59016 // translators: %d: column index (starting with 1) 59017 (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1), 59018 placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column') 59019 })); 59020 }))); 59021 } 59022 59023 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js 59024 59025 /** 59026 * WordPress dependencies 59027 */ 59028 59029 function text_columns_save_save({ 59030 attributes 59031 }) { 59032 const { 59033 width, 59034 content, 59035 columns 59036 } = attributes; 59037 return (0,external_React_namespaceObject.createElement)("div", { 59038 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 59039 className: `align$width} columns-$columns}` 59040 }) 59041 }, Array.from({ 59042 length: columns 59043 }).map((_, index) => (0,external_React_namespaceObject.createElement)("div", { 59044 className: "wp-block-column", 59045 key: `column-$index}` 59046 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59047 tagName: "p", 59048 value: content?.[index]?.children 59049 })))); 59050 } 59051 59052 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js 59053 /** 59054 * WordPress dependencies 59055 */ 59056 59057 const text_columns_transforms_transforms = { 59058 to: [{ 59059 type: 'block', 59060 blocks: ['core/columns'], 59061 transform: ({ 59062 className, 59063 columns, 59064 content, 59065 width 59066 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { 59067 align: 'wide' === width || 'full' === width ? width : undefined, 59068 className, 59069 columns 59070 }, content.map(({ 59071 children 59072 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 59073 content: children 59074 })]))) 59075 }] 59076 }; 59077 /* harmony default export */ const text_columns_transforms = (text_columns_transforms_transforms); 59078 59079 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 59080 /** 59081 * Internal dependencies 59082 */ 59083 59084 59085 const text_columns_metadata = { 59086 $schema: "https://schemas.wp.org/trunk/block.json", 59087 apiVersion: 3, 59088 name: "core/text-columns", 59089 title: "Text Columns (deprecated)", 59090 icon: "columns", 59091 category: "design", 59092 description: "This block is deprecated. Please use the Columns block instead.", 59093 textdomain: "default", 59094 attributes: { 59095 content: { 59096 type: "array", 59097 source: "query", 59098 selector: "p", 59099 query: { 59100 children: { 59101 type: "string", 59102 source: "html" 59103 } 59104 }, 59105 "default": [{}, {}] 59106 }, 59107 columns: { 59108 type: "number", 59109 "default": 2 59110 }, 59111 width: { 59112 type: "string" 59113 } 59114 }, 59115 supports: { 59116 inserter: false, 59117 interactivity: { 59118 clientNavigation: true 59119 } 59120 }, 59121 editorStyle: "wp-block-text-columns-editor", 59122 style: "wp-block-text-columns" 59123 }; 59124 59125 59126 const { 59127 name: text_columns_name 59128 } = text_columns_metadata; 59129 59130 const text_columns_settings = { 59131 transforms: text_columns_transforms, 59132 getEditWrapperProps(attributes) { 59133 const { 59134 width 59135 } = attributes; 59136 if ('wide' === width || 'full' === width) { 59137 return { 59138 'data-align': width 59139 }; 59140 } 59141 }, 59142 edit: TextColumnsEdit, 59143 save: text_columns_save_save 59144 }; 59145 const text_columns_init = () => initBlock({ 59146 name: text_columns_name, 59147 metadata: text_columns_metadata, 59148 settings: text_columns_settings 59149 }); 59150 59151 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js 59152 59153 /** 59154 * WordPress dependencies 59155 */ 59156 59157 const verse = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 59158 viewBox: "0 0 24 24", 59159 xmlns: "http://www.w3.org/2000/svg" 59160 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 59161 d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" 59162 })); 59163 /* harmony default export */ const library_verse = (verse); 59164 59165 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js 59166 59167 /** 59168 * External dependencies 59169 */ 59170 59171 59172 /** 59173 * WordPress dependencies 59174 */ 59175 59176 59177 /** 59178 * Internal dependencies 59179 */ 59180 59181 const verse_deprecated_v1 = { 59182 attributes: { 59183 content: { 59184 type: 'string', 59185 source: 'html', 59186 selector: 'pre', 59187 default: '' 59188 }, 59189 textAlign: { 59190 type: 'string' 59191 } 59192 }, 59193 save({ 59194 attributes 59195 }) { 59196 const { 59197 textAlign, 59198 content 59199 } = attributes; 59200 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59201 tagName: "pre", 59202 style: { 59203 textAlign 59204 }, 59205 value: content 59206 }); 59207 } 59208 }; 59209 const verse_deprecated_v2 = { 59210 attributes: { 59211 content: { 59212 type: 'string', 59213 source: 'html', 59214 selector: 'pre', 59215 default: '', 59216 __unstablePreserveWhiteSpace: true, 59217 __experimentalRole: 'content' 59218 }, 59219 textAlign: { 59220 type: 'string' 59221 } 59222 }, 59223 supports: { 59224 anchor: true, 59225 color: { 59226 gradients: true, 59227 link: true 59228 }, 59229 typography: { 59230 fontSize: true, 59231 __experimentalFontFamily: true 59232 }, 59233 spacing: { 59234 padding: true 59235 } 59236 }, 59237 save({ 59238 attributes 59239 }) { 59240 const { 59241 textAlign, 59242 content 59243 } = attributes; 59244 const className = classnames_default()({ 59245 [`has-text-align-$textAlign}`]: textAlign 59246 }); 59247 return (0,external_React_namespaceObject.createElement)("pre", { 59248 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 59249 className 59250 }) 59251 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59252 value: content 59253 })); 59254 }, 59255 migrate: migrate_font_family, 59256 isEligible({ 59257 style 59258 }) { 59259 return style?.typography?.fontFamily; 59260 } 59261 }; 59262 59263 /** 59264 * New deprecations need to be placed first 59265 * for them to have higher priority. 59266 * 59267 * Old deprecations may need to be updated as well. 59268 * 59269 * See block-deprecation.md 59270 */ 59271 /* harmony default export */ const verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]); 59272 59273 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js 59274 59275 /** 59276 * External dependencies 59277 */ 59278 59279 59280 /** 59281 * WordPress dependencies 59282 */ 59283 59284 59285 59286 function VerseEdit({ 59287 attributes, 59288 setAttributes, 59289 mergeBlocks, 59290 onRemove, 59291 insertBlocksAfter, 59292 style 59293 }) { 59294 const { 59295 textAlign, 59296 content 59297 } = attributes; 59298 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 59299 className: classnames_default()({ 59300 [`has-text-align-$textAlign}`]: textAlign 59301 }), 59302 style 59303 }); 59304 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 59305 value: textAlign, 59306 onChange: nextAlign => { 59307 setAttributes({ 59308 textAlign: nextAlign 59309 }); 59310 } 59311 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 59312 tagName: "pre", 59313 identifier: "content", 59314 preserveWhiteSpace: true, 59315 value: content, 59316 onChange: nextContent => { 59317 setAttributes({ 59318 content: nextContent 59319 }); 59320 }, 59321 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'), 59322 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'), 59323 onRemove: onRemove, 59324 onMerge: mergeBlocks, 59325 textAlign: textAlign, 59326 ...blockProps, 59327 __unstablePastePlainText: true, 59328 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 59329 })); 59330 } 59331 59332 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js 59333 59334 /** 59335 * External dependencies 59336 */ 59337 59338 59339 /** 59340 * WordPress dependencies 59341 */ 59342 59343 function verse_save_save({ 59344 attributes 59345 }) { 59346 const { 59347 textAlign, 59348 content 59349 } = attributes; 59350 const className = classnames_default()({ 59351 [`has-text-align-$textAlign}`]: textAlign 59352 }); 59353 return (0,external_React_namespaceObject.createElement)("pre", { 59354 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 59355 className 59356 }) 59357 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59358 value: content 59359 })); 59360 } 59361 59362 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js 59363 /** 59364 * WordPress dependencies 59365 */ 59366 59367 const verse_transforms_transforms = { 59368 from: [{ 59369 type: 'block', 59370 blocks: ['core/paragraph'], 59371 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes) 59372 }], 59373 to: [{ 59374 type: 'block', 59375 blocks: ['core/paragraph'], 59376 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) 59377 }] 59378 }; 59379 /* harmony default export */ const verse_transforms = (verse_transforms_transforms); 59380 59381 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js 59382 /** 59383 * WordPress dependencies 59384 */ 59385 59386 59387 59388 /** 59389 * Internal dependencies 59390 */ 59391 59392 59393 59394 const verse_metadata = { 59395 $schema: "https://schemas.wp.org/trunk/block.json", 59396 apiVersion: 3, 59397 name: "core/verse", 59398 title: "Verse", 59399 category: "text", 59400 description: "Insert poetry. Use special spacing formats. Or quote song lyrics.", 59401 keywords: ["poetry", "poem"], 59402 textdomain: "default", 59403 attributes: { 59404 content: { 59405 type: "rich-text", 59406 source: "rich-text", 59407 selector: "pre", 59408 __unstablePreserveWhiteSpace: true, 59409 __experimentalRole: "content" 59410 }, 59411 textAlign: { 59412 type: "string" 59413 } 59414 }, 59415 supports: { 59416 anchor: true, 59417 color: { 59418 gradients: true, 59419 link: true, 59420 __experimentalDefaultControls: { 59421 background: true, 59422 text: true 59423 } 59424 }, 59425 typography: { 59426 fontSize: true, 59427 __experimentalFontFamily: true, 59428 lineHeight: true, 59429 __experimentalFontStyle: true, 59430 __experimentalFontWeight: true, 59431 __experimentalLetterSpacing: true, 59432 __experimentalTextTransform: true, 59433 __experimentalTextDecoration: true, 59434 __experimentalDefaultControls: { 59435 fontSize: true 59436 } 59437 }, 59438 spacing: { 59439 margin: true, 59440 padding: true, 59441 __experimentalDefaultControls: { 59442 margin: false, 59443 padding: false 59444 } 59445 }, 59446 __experimentalBorder: { 59447 radius: true, 59448 width: true, 59449 color: true, 59450 style: true 59451 }, 59452 interactivity: { 59453 clientNavigation: true 59454 } 59455 }, 59456 style: "wp-block-verse", 59457 editorStyle: "wp-block-verse-editor" 59458 }; 59459 59460 59461 const { 59462 name: verse_name 59463 } = verse_metadata; 59464 59465 const verse_settings = { 59466 icon: library_verse, 59467 example: { 59468 attributes: { 59469 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 59470 // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work. 59471 content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.') 59472 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 59473 } 59474 }, 59475 transforms: verse_transforms, 59476 deprecated: verse_deprecated, 59477 merge(attributes, attributesToMerge) { 59478 return { 59479 content: attributes.content + '\n\n' + attributesToMerge.content 59480 }; 59481 }, 59482 edit: VerseEdit, 59483 save: verse_save_save 59484 }; 59485 const verse_init = () => initBlock({ 59486 name: verse_name, 59487 metadata: verse_metadata, 59488 settings: verse_settings 59489 }); 59490 59491 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js 59492 59493 /** 59494 * WordPress dependencies 59495 */ 59496 59497 const video = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { 59498 viewBox: "0 0 24 24", 59499 xmlns: "http://www.w3.org/2000/svg" 59500 }, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { 59501 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-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" 59502 })); 59503 /* harmony default export */ const library_video = (video); 59504 59505 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js 59506 59507 function Tracks({ 59508 tracks = [] 59509 }) { 59510 return tracks.map(track => { 59511 return (0,external_React_namespaceObject.createElement)("track", { 59512 key: track.src, 59513 ...track 59514 }); 59515 }); 59516 } 59517 59518 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/deprecated.js 59519 59520 /** 59521 * WordPress dependencies 59522 */ 59523 59524 59525 /** 59526 * Internal dependencies 59527 */ 59528 const video_deprecated_metadata = { 59529 $schema: "https://schemas.wp.org/trunk/block.json", 59530 apiVersion: 3, 59531 name: "core/video", 59532 title: "Video", 59533 category: "media", 59534 description: "Embed a video from your media library or upload a new one.", 59535 keywords: ["movie"], 59536 textdomain: "default", 59537 attributes: { 59538 autoplay: { 59539 type: "boolean", 59540 source: "attribute", 59541 selector: "video", 59542 attribute: "autoplay" 59543 }, 59544 caption: { 59545 type: "rich-text", 59546 source: "rich-text", 59547 selector: "figcaption", 59548 __experimentalRole: "content" 59549 }, 59550 controls: { 59551 type: "boolean", 59552 source: "attribute", 59553 selector: "video", 59554 attribute: "controls", 59555 "default": true 59556 }, 59557 id: { 59558 type: "number", 59559 __experimentalRole: "content" 59560 }, 59561 loop: { 59562 type: "boolean", 59563 source: "attribute", 59564 selector: "video", 59565 attribute: "loop" 59566 }, 59567 muted: { 59568 type: "boolean", 59569 source: "attribute", 59570 selector: "video", 59571 attribute: "muted" 59572 }, 59573 poster: { 59574 type: "string", 59575 source: "attribute", 59576 selector: "video", 59577 attribute: "poster" 59578 }, 59579 preload: { 59580 type: "string", 59581 source: "attribute", 59582 selector: "video", 59583 attribute: "preload", 59584 "default": "metadata" 59585 }, 59586 src: { 59587 type: "string", 59588 source: "attribute", 59589 selector: "video", 59590 attribute: "src", 59591 __experimentalRole: "content" 59592 }, 59593 playsInline: { 59594 type: "boolean", 59595 source: "attribute", 59596 selector: "video", 59597 attribute: "playsinline" 59598 }, 59599 tracks: { 59600 __experimentalRole: "content", 59601 type: "array", 59602 items: { 59603 type: "object" 59604 }, 59605 "default": [] 59606 } 59607 }, 59608 supports: { 59609 anchor: true, 59610 align: true, 59611 spacing: { 59612 margin: true, 59613 padding: true, 59614 __experimentalDefaultControls: { 59615 margin: false, 59616 padding: false 59617 } 59618 }, 59619 interactivity: { 59620 clientNavigation: true 59621 } 59622 }, 59623 editorStyle: "wp-block-video-editor", 59624 style: "wp-block-video" 59625 }; 59626 59627 const { 59628 attributes: video_deprecated_blockAttributes 59629 } = video_deprecated_metadata; 59630 59631 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 59632 // to the video figcaption element. 59633 const video_deprecated_v1 = { 59634 attributes: video_deprecated_blockAttributes, 59635 save({ 59636 attributes 59637 }) { 59638 const { 59639 autoplay, 59640 caption, 59641 controls, 59642 loop, 59643 muted, 59644 poster, 59645 preload, 59646 src, 59647 playsInline, 59648 tracks 59649 } = attributes; 59650 return (0,external_React_namespaceObject.createElement)("figure", { 59651 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 59652 }, src && (0,external_React_namespaceObject.createElement)("video", { 59653 autoPlay: autoplay, 59654 controls: controls, 59655 loop: loop, 59656 muted: muted, 59657 poster: poster, 59658 preload: preload !== 'metadata' ? preload : undefined, 59659 src: src, 59660 playsInline: playsInline 59661 }, (0,external_React_namespaceObject.createElement)(Tracks, { 59662 tracks: tracks 59663 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59664 tagName: "figcaption", 59665 value: caption 59666 })); 59667 } 59668 }; 59669 const video_deprecated_deprecated = [video_deprecated_v1]; 59670 /* harmony default export */ const video_deprecated = (video_deprecated_deprecated); 59671 59672 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js 59673 59674 /** 59675 * WordPress dependencies 59676 */ 59677 59678 59679 59680 const options = [{ 59681 value: 'auto', 59682 label: (0,external_wp_i18n_namespaceObject.__)('Auto') 59683 }, { 59684 value: 'metadata', 59685 label: (0,external_wp_i18n_namespaceObject.__)('Metadata') 59686 }, { 59687 value: 'none', 59688 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') 59689 }]; 59690 const VideoSettings = ({ 59691 setAttributes, 59692 attributes 59693 }) => { 59694 const { 59695 autoplay, 59696 controls, 59697 loop, 59698 muted, 59699 playsInline, 59700 preload 59701 } = attributes; 59702 const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.'); 59703 const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({ 59704 web: (0,external_wp_element_namespaceObject.useCallback)(checked => { 59705 return checked ? autoPlayHelpText : null; 59706 }, []), 59707 native: autoPlayHelpText 59708 }); 59709 const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => { 59710 const toggleAttribute = attribute => { 59711 return newValue => { 59712 setAttributes({ 59713 [attribute]: newValue 59714 }); 59715 }; 59716 }; 59717 return { 59718 autoplay: toggleAttribute('autoplay'), 59719 loop: toggleAttribute('loop'), 59720 muted: toggleAttribute('muted'), 59721 controls: toggleAttribute('controls'), 59722 playsInline: toggleAttribute('playsInline') 59723 }; 59724 }, []); 59725 const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => { 59726 setAttributes({ 59727 preload: value 59728 }); 59729 }, []); 59730 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 59731 __nextHasNoMarginBottom: true, 59732 label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), 59733 onChange: toggleFactory.autoplay, 59734 checked: !!autoplay, 59735 help: getAutoplayHelp 59736 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 59737 __nextHasNoMarginBottom: true, 59738 label: (0,external_wp_i18n_namespaceObject.__)('Loop'), 59739 onChange: toggleFactory.loop, 59740 checked: !!loop 59741 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 59742 __nextHasNoMarginBottom: true, 59743 label: (0,external_wp_i18n_namespaceObject.__)('Muted'), 59744 onChange: toggleFactory.muted, 59745 checked: !!muted 59746 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 59747 __nextHasNoMarginBottom: true, 59748 label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'), 59749 onChange: toggleFactory.controls, 59750 checked: !!controls 59751 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, { 59752 __nextHasNoMarginBottom: true, 59753 label: (0,external_wp_i18n_namespaceObject.__)('Play inline'), 59754 onChange: toggleFactory.playsInline, 59755 checked: !!playsInline 59756 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 59757 __nextHasNoMarginBottom: true, 59758 label: (0,external_wp_i18n_namespaceObject.__)('Preload'), 59759 value: preload, 59760 onChange: onChangePreload, 59761 options: options, 59762 hideCancelButton: true 59763 })); 59764 }; 59765 /* harmony default export */ const edit_common_settings = (VideoSettings); 59766 59767 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js 59768 59769 /** 59770 * WordPress dependencies 59771 */ 59772 59773 59774 59775 59776 59777 59778 59779 const ALLOWED_TYPES = ['text/vtt']; 59780 const DEFAULT_KIND = 'subtitles'; 59781 const KIND_OPTIONS = [{ 59782 label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'), 59783 value: 'subtitles' 59784 }, { 59785 label: (0,external_wp_i18n_namespaceObject.__)('Captions'), 59786 value: 'captions' 59787 }, { 59788 label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'), 59789 value: 'descriptions' 59790 }, { 59791 label: (0,external_wp_i18n_namespaceObject.__)('Chapters'), 59792 value: 'chapters' 59793 }, { 59794 label: (0,external_wp_i18n_namespaceObject.__)('Metadata'), 59795 value: 'metadata' 59796 }]; 59797 function TrackList({ 59798 tracks, 59799 onEditPress 59800 }) { 59801 let content; 59802 if (tracks.length === 0) { 59803 content = (0,external_React_namespaceObject.createElement)("p", { 59804 className: "block-library-video-tracks-editor__tracks-informative-message" 59805 }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.')); 59806 } else { 59807 content = tracks.map((track, index) => { 59808 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 59809 key: index, 59810 className: "block-library-video-tracks-editor__track-list-track" 59811 }, (0,external_React_namespaceObject.createElement)("span", null, track.label, " "), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 59812 variant: "tertiary", 59813 onClick: () => onEditPress(index), 59814 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Label of the video text track e.g: "French subtitles" */ 59815 (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label) 59816 }, (0,external_wp_i18n_namespaceObject.__)('Edit'))); 59817 }); 59818 } 59819 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { 59820 label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'), 59821 className: "block-library-video-tracks-editor__track-list" 59822 }, content); 59823 } 59824 function SingleTrackEditor({ 59825 track, 59826 onChange, 59827 onClose, 59828 onRemove 59829 }) { 59830 const { 59831 src = '', 59832 label = '', 59833 srcLang = '', 59834 kind = DEFAULT_KIND 59835 } = track; 59836 const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || ''; 59837 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { 59838 className: "block-library-video-tracks-editor__single-track-editor", 59839 spacing: "4" 59840 }, (0,external_React_namespaceObject.createElement)("span", { 59841 className: "block-library-video-tracks-editor__single-track-editor-edit-track-label" 59842 }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_React_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_React_namespaceObject.createElement)("b", null, fileName)), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalGrid, { 59843 columns: 2, 59844 gap: 4 59845 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 59846 __nextHasNoMarginBottom: true 59847 /* eslint-disable jsx-a11y/no-autofocus */, 59848 autoFocus: true 59849 /* eslint-enable jsx-a11y/no-autofocus */, 59850 onChange: newLabel => onChange({ 59851 ...track, 59852 label: newLabel 59853 }), 59854 label: (0,external_wp_i18n_namespaceObject.__)('Label'), 59855 value: label, 59856 help: (0,external_wp_i18n_namespaceObject.__)('Title of track') 59857 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { 59858 __nextHasNoMarginBottom: true, 59859 onChange: newSrcLang => onChange({ 59860 ...track, 59861 srcLang: newSrcLang 59862 }), 59863 label: (0,external_wp_i18n_namespaceObject.__)('Source language'), 59864 value: srcLang, 59865 help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)') 59866 })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { 59867 spacing: "8" 59868 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, { 59869 __nextHasNoMarginBottom: true, 59870 className: "block-library-video-tracks-editor__single-track-editor-kind-select", 59871 options: KIND_OPTIONS, 59872 value: kind, 59873 label: (0,external_wp_i18n_namespaceObject.__)('Kind'), 59874 onChange: newKind => { 59875 onChange({ 59876 ...track, 59877 kind: newKind 59878 }); 59879 } 59880 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { 59881 className: "block-library-video-tracks-editor__single-track-editor-buttons-container" 59882 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 59883 variant: "secondary", 59884 onClick: () => { 59885 const changes = {}; 59886 let hasChanges = false; 59887 if (label === '') { 59888 changes.label = (0,external_wp_i18n_namespaceObject.__)('English'); 59889 hasChanges = true; 59890 } 59891 if (srcLang === '') { 59892 changes.srcLang = 'en'; 59893 hasChanges = true; 59894 } 59895 if (track.kind === undefined) { 59896 changes.kind = DEFAULT_KIND; 59897 hasChanges = true; 59898 } 59899 if (hasChanges) { 59900 onChange({ 59901 ...track, 59902 ...changes 59903 }); 59904 } 59905 onClose(); 59906 } 59907 }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 59908 isDestructive: true, 59909 variant: "link", 59910 onClick: onRemove 59911 }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))))); 59912 } 59913 function TracksEditor({ 59914 tracks = [], 59915 onChange 59916 }) { 59917 const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { 59918 return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload; 59919 }, []); 59920 const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null); 59921 if (!mediaUpload) { 59922 return null; 59923 } 59924 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, { 59925 contentClassName: "block-library-video-tracks-editor", 59926 renderToggle: ({ 59927 isOpen, 59928 onToggle 59929 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { 59930 label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'), 59931 showTooltip: true, 59932 "aria-expanded": isOpen, 59933 "aria-haspopup": "true", 59934 onClick: onToggle 59935 }, (0,external_wp_i18n_namespaceObject.__)('Text tracks'))), 59936 renderContent: () => { 59937 if (trackBeingEdited !== null) { 59938 return (0,external_React_namespaceObject.createElement)(SingleTrackEditor, { 59939 track: tracks[trackBeingEdited], 59940 onChange: newTrack => { 59941 const newTracks = [...tracks]; 59942 newTracks[trackBeingEdited] = newTrack; 59943 onChange(newTracks); 59944 }, 59945 onClose: () => setTrackBeingEdited(null), 59946 onRemove: () => { 59947 onChange(tracks.filter((_track, index) => index !== trackBeingEdited)); 59948 setTrackBeingEdited(null); 59949 } 59950 }); 59951 } 59952 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_React_namespaceObject.createElement)(TrackList, { 59953 tracks: tracks, 59954 onEditPress: setTrackBeingEdited 59955 }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { 59956 className: "block-library-video-tracks-editor__add-tracks-container", 59957 label: (0,external_wp_i18n_namespaceObject.__)('Add tracks') 59958 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { 59959 onSelect: ({ 59960 url 59961 }) => { 59962 const trackIndex = tracks.length; 59963 onChange([...tracks, { 59964 src: url 59965 }]); 59966 setTrackBeingEdited(trackIndex); 59967 }, 59968 allowedTypes: ALLOWED_TYPES, 59969 render: ({ 59970 open 59971 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 59972 icon: library_media, 59973 onClick: open 59974 }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library')) 59975 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, { 59976 onChange: event => { 59977 const files = event.target.files; 59978 const trackIndex = tracks.length; 59979 mediaUpload({ 59980 allowedTypes: ALLOWED_TYPES, 59981 filesList: files, 59982 onFileChange: ([{ 59983 url 59984 }]) => { 59985 const newTracks = [...tracks]; 59986 if (!newTracks[trackIndex]) { 59987 newTracks[trackIndex] = {}; 59988 } 59989 newTracks[trackIndex] = { 59990 ...tracks[trackIndex], 59991 src: url 59992 }; 59993 onChange(newTracks); 59994 setTrackBeingEdited(trackIndex); 59995 } 59996 }); 59997 }, 59998 accept: ".vtt,text/vtt", 59999 render: ({ 60000 openFileDialog 60001 }) => { 60002 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { 60003 icon: library_upload, 60004 onClick: () => { 60005 openFileDialog(); 60006 } 60007 }, (0,external_wp_i18n_namespaceObject.__)('Upload')); 60008 } 60009 }))))); 60010 } 60011 }); 60012 } 60013 60014 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js 60015 60016 /** 60017 * External dependencies 60018 */ 60019 60020 60021 /** 60022 * WordPress dependencies 60023 */ 60024 60025 60026 60027 60028 60029 60030 60031 60032 60033 60034 /** 60035 * Internal dependencies 60036 */ 60037 60038 60039 60040 60041 60042 60043 // Much of this description is duplicated from MediaPlaceholder. 60044 const video_edit_placeholder = content => { 60045 return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 60046 className: "block-editor-media-placeholder", 60047 withIllustration: true, 60048 icon: library_video, 60049 label: (0,external_wp_i18n_namespaceObject.__)('Video'), 60050 instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a video file, pick one from your media library, or add one with a URL.') 60051 }, content); 60052 }; 60053 const video_edit_ALLOWED_MEDIA_TYPES = ['video']; 60054 const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image']; 60055 function VideoEdit({ 60056 isSelected: isSingleSelected, 60057 attributes, 60058 className, 60059 setAttributes, 60060 insertBlocksAfter, 60061 onReplace 60062 }) { 60063 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit); 60064 const videoPlayer = (0,external_wp_element_namespaceObject.useRef)(); 60065 const posterImageButton = (0,external_wp_element_namespaceObject.useRef)(); 60066 const { 60067 id, 60068 controls, 60069 poster, 60070 src, 60071 tracks 60072 } = attributes; 60073 const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src); 60074 const { 60075 getSettings 60076 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 60077 (0,external_wp_element_namespaceObject.useEffect)(() => { 60078 if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) { 60079 const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src); 60080 if (file) { 60081 getSettings().mediaUpload({ 60082 filesList: [file], 60083 onFileChange: ([media]) => onSelectVideo(media), 60084 onError: onUploadError, 60085 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES 60086 }); 60087 } 60088 } 60089 }, []); 60090 (0,external_wp_element_namespaceObject.useEffect)(() => { 60091 // Placeholder may be rendered. 60092 if (videoPlayer.current) { 60093 videoPlayer.current.load(); 60094 } 60095 }, [poster]); 60096 function onSelectVideo(media) { 60097 if (!media || !media.url) { 60098 // In this case there was an error 60099 // previous attributes should be removed 60100 // because they may be temporary blob urls. 60101 setAttributes({ 60102 src: undefined, 60103 id: undefined, 60104 poster: undefined, 60105 caption: undefined 60106 }); 60107 return; 60108 } 60109 60110 // Sets the block's attribute and updates the edit component from the 60111 // selected media. 60112 setAttributes({ 60113 src: media.url, 60114 id: media.id, 60115 poster: media.image?.src !== media.icon ? media.image?.src : undefined, 60116 caption: media.caption 60117 }); 60118 } 60119 function onSelectURL(newSrc) { 60120 if (newSrc !== src) { 60121 // Check if there's an embed block that handles this URL. 60122 const embedBlock = createUpgradedEmbedBlock({ 60123 attributes: { 60124 url: newSrc 60125 } 60126 }); 60127 if (undefined !== embedBlock && onReplace) { 60128 onReplace(embedBlock); 60129 return; 60130 } 60131 setAttributes({ 60132 src: newSrc, 60133 id: undefined, 60134 poster: undefined 60135 }); 60136 } 60137 } 60138 const { 60139 createErrorNotice 60140 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 60141 function onUploadError(message) { 60142 createErrorNotice(message, { 60143 type: 'snackbar' 60144 }); 60145 } 60146 const classes = classnames_default()(className, { 60147 'is-transient': isTemporaryVideo 60148 }); 60149 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 60150 className: classes 60151 }); 60152 if (!src) { 60153 return (0,external_React_namespaceObject.createElement)("div", { 60154 ...blockProps 60155 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 60156 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 60157 icon: library_video 60158 }), 60159 onSelect: onSelectVideo, 60160 onSelectURL: onSelectURL, 60161 accept: "video/*", 60162 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, 60163 value: attributes, 60164 onError: onUploadError, 60165 placeholder: video_edit_placeholder 60166 })); 60167 } 60168 function onSelectPoster(image) { 60169 setAttributes({ 60170 poster: image.url 60171 }); 60172 } 60173 function onRemovePoster() { 60174 setAttributes({ 60175 poster: undefined 60176 }); 60177 60178 // Move focus back to the Media Upload button. 60179 posterImageButton.current.focus(); 60180 } 60181 const videoPosterDescription = `video-block__poster-image-description-${instanceId}`; 60182 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isSingleSelected && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(TracksEditor, { 60183 tracks: tracks, 60184 onChange: newTracks => { 60185 setAttributes({ 60186 tracks: newTracks 60187 }); 60188 } 60189 })), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { 60190 group: "other" 60191 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 60192 mediaId: id, 60193 mediaURL: src, 60194 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, 60195 accept: "video/*", 60196 onSelect: onSelectVideo, 60197 onSelectURL: onSelectURL, 60198 onError: onUploadError 60199 }))), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, { 60200 title: (0,external_wp_i18n_namespaceObject.__)('Settings') 60201 }, (0,external_React_namespaceObject.createElement)(edit_common_settings, { 60202 setAttributes: setAttributes, 60203 attributes: attributes 60204 }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, { 60205 className: "editor-video-poster-control" 60206 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { 60207 title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'), 60208 onSelect: onSelectPoster, 60209 allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES, 60210 render: ({ 60211 open 60212 }) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 60213 variant: "primary", 60214 onClick: open, 60215 ref: posterImageButton, 60216 "aria-describedby": videoPosterDescription 60217 }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace')) 60218 }), (0,external_React_namespaceObject.createElement)("p", { 60219 id: videoPosterDescription, 60220 hidden: true 60221 }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: poster image URL. */ 60222 (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { 60223 onClick: onRemovePoster, 60224 variant: "tertiary" 60225 }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (0,external_React_namespaceObject.createElement)("figure", { 60226 ...blockProps 60227 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, { 60228 isDisabled: !isSingleSelected 60229 }, (0,external_React_namespaceObject.createElement)("video", { 60230 controls: controls, 60231 poster: poster, 60232 src: src, 60233 ref: videoPlayer 60234 }, (0,external_React_namespaceObject.createElement)(Tracks, { 60235 tracks: tracks 60236 }))), isTemporaryVideo && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_React_namespaceObject.createElement)(Caption, { 60237 attributes: attributes, 60238 setAttributes: setAttributes, 60239 isSelected: isSingleSelected, 60240 insertBlocksAfter: insertBlocksAfter, 60241 label: (0,external_wp_i18n_namespaceObject.__)('Video caption text'), 60242 showToolbarButton: isSingleSelected 60243 }))); 60244 } 60245 /* harmony default export */ const video_edit = (VideoEdit); 60246 60247 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js 60248 60249 /** 60250 * WordPress dependencies 60251 */ 60252 60253 60254 /** 60255 * Internal dependencies 60256 */ 60257 60258 function video_save_save({ 60259 attributes 60260 }) { 60261 const { 60262 autoplay, 60263 caption, 60264 controls, 60265 loop, 60266 muted, 60267 poster, 60268 preload, 60269 src, 60270 playsInline, 60271 tracks 60272 } = attributes; 60273 return (0,external_React_namespaceObject.createElement)("figure", { 60274 ...external_wp_blockEditor_namespaceObject.useBlockProps.save() 60275 }, src && (0,external_React_namespaceObject.createElement)("video", { 60276 autoPlay: autoplay, 60277 controls: controls, 60278 loop: loop, 60279 muted: muted, 60280 poster: poster, 60281 preload: preload !== 'metadata' ? preload : undefined, 60282 src: src, 60283 playsInline: playsInline 60284 }, (0,external_React_namespaceObject.createElement)(Tracks, { 60285 tracks: tracks 60286 })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, { 60287 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 60288 tagName: "figcaption", 60289 value: caption 60290 })); 60291 } 60292 60293 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js 60294 /** 60295 * WordPress dependencies 60296 */ 60297 60298 60299 const video_transforms_transforms = { 60300 from: [{ 60301 type: 'files', 60302 isMatch(files) { 60303 return files.length === 1 && files[0].type.indexOf('video/') === 0; 60304 }, 60305 transform(files) { 60306 const file = files[0]; 60307 // We don't need to upload the media directly here 60308 // It's already done as part of the `componentDidMount` 60309 // in the video block 60310 const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 60311 src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 60312 }); 60313 return block; 60314 } 60315 }, { 60316 type: 'shortcode', 60317 tag: 'video', 60318 attributes: { 60319 src: { 60320 type: 'string', 60321 shortcode: ({ 60322 named: { 60323 src, 60324 mp4, 60325 m4v, 60326 webm, 60327 ogv, 60328 flv 60329 } 60330 }) => { 60331 return src || mp4 || m4v || webm || ogv || flv; 60332 } 60333 }, 60334 poster: { 60335 type: 'string', 60336 shortcode: ({ 60337 named: { 60338 poster 60339 } 60340 }) => { 60341 return poster; 60342 } 60343 }, 60344 loop: { 60345 type: 'string', 60346 shortcode: ({ 60347 named: { 60348 loop 60349 } 60350 }) => { 60351 return loop; 60352 } 60353 }, 60354 autoplay: { 60355 type: 'string', 60356 shortcode: ({ 60357 named: { 60358 autoplay 60359 } 60360 }) => { 60361 return autoplay; 60362 } 60363 }, 60364 preload: { 60365 type: 'string', 60366 shortcode: ({ 60367 named: { 60368 preload 60369 } 60370 }) => { 60371 return preload; 60372 } 60373 } 60374 } 60375 }, { 60376 type: 'raw', 60377 isMatch: node => node.nodeName === 'P' && node.children.length === 1 && node.firstChild.nodeName === 'VIDEO', 60378 transform: node => { 60379 const videoElement = node.firstChild; 60380 const attributes = { 60381 autoplay: videoElement.hasAttribute('autoplay') ? true : undefined, 60382 controls: videoElement.hasAttribute('controls') ? undefined : false, 60383 loop: videoElement.hasAttribute('loop') ? true : undefined, 60384 muted: videoElement.hasAttribute('muted') ? true : undefined, 60385 preload: videoElement.getAttribute('preload') || undefined, 60386 playsInline: videoElement.hasAttribute('playsinline') ? true : undefined, 60387 poster: videoElement.getAttribute('poster') || undefined, 60388 src: videoElement.getAttribute('src') || undefined 60389 }; 60390 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', attributes); 60391 } 60392 }] 60393 }; 60394 /* harmony default export */ const video_transforms = (video_transforms_transforms); 60395 60396 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js 60397 /** 60398 * WordPress dependencies 60399 */ 60400 60401 60402 60403 /** 60404 * Internal dependencies 60405 */ 60406 60407 60408 60409 const video_metadata = { 60410 $schema: "https://schemas.wp.org/trunk/block.json", 60411 apiVersion: 3, 60412 name: "core/video", 60413 title: "Video", 60414 category: "media", 60415 description: "Embed a video from your media library or upload a new one.", 60416 keywords: ["movie"], 60417 textdomain: "default", 60418 attributes: { 60419 autoplay: { 60420 type: "boolean", 60421 source: "attribute", 60422 selector: "video", 60423 attribute: "autoplay" 60424 }, 60425 caption: { 60426 type: "rich-text", 60427 source: "rich-text", 60428 selector: "figcaption", 60429 __experimentalRole: "content" 60430 }, 60431 controls: { 60432 type: "boolean", 60433 source: "attribute", 60434 selector: "video", 60435 attribute: "controls", 60436 "default": true 60437 }, 60438 id: { 60439 type: "number", 60440 __experimentalRole: "content" 60441 }, 60442 loop: { 60443 type: "boolean", 60444 source: "attribute", 60445 selector: "video", 60446 attribute: "loop" 60447 }, 60448 muted: { 60449 type: "boolean", 60450 source: "attribute", 60451 selector: "video", 60452 attribute: "muted" 60453 }, 60454 poster: { 60455 type: "string", 60456 source: "attribute", 60457 selector: "video", 60458 attribute: "poster" 60459 }, 60460 preload: { 60461 type: "string", 60462 source: "attribute", 60463 selector: "video", 60464 attribute: "preload", 60465 "default": "metadata" 60466 }, 60467 src: { 60468 type: "string", 60469 source: "attribute", 60470 selector: "video", 60471 attribute: "src", 60472 __experimentalRole: "content" 60473 }, 60474 playsInline: { 60475 type: "boolean", 60476 source: "attribute", 60477 selector: "video", 60478 attribute: "playsinline" 60479 }, 60480 tracks: { 60481 __experimentalRole: "content", 60482 type: "array", 60483 items: { 60484 type: "object" 60485 }, 60486 "default": [] 60487 } 60488 }, 60489 supports: { 60490 anchor: true, 60491 align: true, 60492 spacing: { 60493 margin: true, 60494 padding: true, 60495 __experimentalDefaultControls: { 60496 margin: false, 60497 padding: false 60498 } 60499 }, 60500 interactivity: { 60501 clientNavigation: true 60502 } 60503 }, 60504 editorStyle: "wp-block-video-editor", 60505 style: "wp-block-video" 60506 }; 60507 60508 60509 const { 60510 name: video_name 60511 } = video_metadata; 60512 60513 const video_settings = { 60514 icon: library_video, 60515 example: { 60516 attributes: { 60517 src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm', 60518 // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block. 60519 caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.') 60520 } 60521 }, 60522 transforms: video_transforms, 60523 deprecated: video_deprecated, 60524 edit: video_edit, 60525 save: video_save_save 60526 }; 60527 const video_init = () => initBlock({ 60528 name: video_name, 60529 metadata: video_metadata, 60530 settings: video_settings 60531 }); 60532 60533 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/edit.js 60534 60535 /** 60536 * WordPress dependencies 60537 */ 60538 60539 60540 60541 60542 60543 function FootnotesEdit({ 60544 context: { 60545 postType, 60546 postId 60547 } 60548 }) { 60549 const [meta, updateMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta', postId); 60550 const footnotesSupported = 'string' === typeof meta?.footnotes; 60551 const footnotes = meta?.footnotes ? JSON.parse(meta.footnotes) : []; 60552 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 60553 if (!footnotesSupported) { 60554 return (0,external_React_namespaceObject.createElement)("div", { 60555 ...blockProps 60556 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 60557 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 60558 icon: format_list_numbered 60559 }), 60560 label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), 60561 instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes are not supported here. Add this block to post or page content.') 60562 })); 60563 } 60564 if (!footnotes.length) { 60565 return (0,external_React_namespaceObject.createElement)("div", { 60566 ...blockProps 60567 }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, { 60568 icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, { 60569 icon: format_list_numbered 60570 }), 60571 label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), 60572 instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes found in blocks within this document will be displayed here.') 60573 })); 60574 } 60575 return (0,external_React_namespaceObject.createElement)("ol", { 60576 ...blockProps 60577 }, footnotes.map(({ 60578 id, 60579 content 60580 }) => /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ 60581 (0,external_React_namespaceObject.createElement)("li", { 60582 key: id, 60583 onMouseDown: event => { 60584 // When clicking on the list item (not on descendants), 60585 // focus the rich text element since it's only 1px wide when 60586 // empty. 60587 if (event.target === event.currentTarget) { 60588 event.target.firstElementChild.focus(); 60589 event.preventDefault(); 60590 } 60591 } 60592 }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { 60593 id: id, 60594 tagName: "span", 60595 value: content, 60596 identifier: id 60597 // To do: figure out why the browser is not scrolling 60598 // into view when it receives focus. 60599 , 60600 onFocus: event => { 60601 if (!event.target.textContent.trim()) { 60602 event.target.scrollIntoView(); 60603 } 60604 }, 60605 onChange: nextFootnote => { 60606 updateMeta({ 60607 ...meta, 60608 footnotes: JSON.stringify(footnotes.map(footnote => { 60609 return footnote.id === id ? { 60610 content: nextFootnote, 60611 id 60612 } : footnote; 60613 })) 60614 }); 60615 } 60616 }), ' ', (0,external_React_namespaceObject.createElement)("a", { 60617 href: `#$id}-link` 60618 }, "\u21A9\uFE0E")))); 60619 } 60620 60621 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js 60622 const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); 60623 /* harmony default export */ const esm_browser_native = ({ 60624 randomUUID 60625 }); 60626 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js 60627 // Unique ID creation requires a high quality random # generator. In the browser we therefore 60628 // require the crypto API and do not support built-in fallback to lower quality random number 60629 // generators (like Math.random()). 60630 let getRandomValues; 60631 const rnds8 = new Uint8Array(16); 60632 function rng() { 60633 // lazy load so that environments that need to polyfill have a chance to do so 60634 if (!getRandomValues) { 60635 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. 60636 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); 60637 60638 if (!getRandomValues) { 60639 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 60640 } 60641 } 60642 60643 return getRandomValues(rnds8); 60644 } 60645 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js 60646 60647 /** 60648 * Convert array of 16 byte values to UUID string format of the form: 60649 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 60650 */ 60651 60652 const byteToHex = []; 60653 60654 for (let i = 0; i < 256; ++i) { 60655 byteToHex.push((i + 0x100).toString(16).slice(1)); 60656 } 60657 60658 function unsafeStringify(arr, offset = 0) { 60659 // Note: Be careful editing this code! It's been tuned for performance 60660 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 60661 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; 60662 } 60663 60664 function stringify(arr, offset = 0) { 60665 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one 60666 // of the following: 60667 // - One or more input array values don't map to a hex octet (leading to 60668 // "undefined" in the uuid) 60669 // - Invalid input values for the RFC `version` or `variant` fields 60670 60671 if (!validate(uuid)) { 60672 throw TypeError('Stringified UUID is invalid'); 60673 } 60674 60675 return uuid; 60676 } 60677 60678 /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); 60679 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js 60680 60681 60682 60683 60684 function v4_v4(options, buf, offset) { 60685 if (esm_browser_native.randomUUID && !buf && !options) { 60686 return esm_browser_native.randomUUID(); 60687 } 60688 60689 options = options || {}; 60690 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 60691 60692 rnds[6] = rnds[6] & 0x0f | 0x40; 60693 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 60694 60695 if (buf) { 60696 offset = offset || 0; 60697 60698 for (let i = 0; i < 16; ++i) { 60699 buf[offset + i] = rnds[i]; 60700 } 60701 60702 return buf; 60703 } 60704 60705 return unsafeStringify(rnds); 60706 } 60707 60708 /* harmony default export */ const esm_browser_v4 = (v4_v4); 60709 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/format.js 60710 60711 /** 60712 * External dependencies 60713 */ 60714 60715 60716 /** 60717 * WordPress dependencies 60718 */ 60719 60720 60721 60722 60723 60724 60725 60726 60727 /** 60728 * Internal dependencies 60729 */ 60730 60731 const { 60732 usesContextKey 60733 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 60734 const formatName = 'core/footnote'; 60735 const POST_CONTENT_BLOCK_NAME = 'core/post-content'; 60736 const SYNCED_PATTERN_BLOCK_NAME = 'core/block'; 60737 const format = { 60738 title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), 60739 tagName: 'sup', 60740 className: 'fn', 60741 attributes: { 60742 'data-fn': 'data-fn' 60743 }, 60744 interactive: true, 60745 contentEditable: false, 60746 [usesContextKey]: ['postType', 'postId'], 60747 edit: function Edit({ 60748 value, 60749 onChange, 60750 isObjectActive, 60751 context: { 60752 postType, 60753 postId 60754 } 60755 }) { 60756 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 60757 const { 60758 getSelectedBlockClientId, 60759 getBlocks, 60760 getBlockRootClientId, 60761 getBlockName, 60762 getBlockParentsByBlockName 60763 } = registry.select(external_wp_blockEditor_namespaceObject.store); 60764 const isFootnotesSupported = (0,external_wp_data_namespaceObject.useSelect)(select => { 60765 if (!select(external_wp_blocks_namespaceObject.store).getBlockType('core/footnotes')) { 60766 return false; 60767 } 60768 const allowedBlocks = select(external_wp_blockEditor_namespaceObject.store).getSettings().allowedBlockTypes; 60769 if (allowedBlocks === false || Array.isArray(allowedBlocks) && !allowedBlocks.includes('core/footnotes')) { 60770 return false; 60771 } 60772 const entityRecord = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); 60773 if ('string' !== typeof entityRecord?.meta?.footnotes) { 60774 return false; 60775 } 60776 60777 // Checks if the selected block lives within a pattern. 60778 const { 60779 getBlockParentsByBlockName: _getBlockParentsByBlockName, 60780 getSelectedBlockClientId: _getSelectedBlockClientId 60781 } = select(external_wp_blockEditor_namespaceObject.store); 60782 const parentCoreBlocks = _getBlockParentsByBlockName(_getSelectedBlockClientId(), SYNCED_PATTERN_BLOCK_NAME); 60783 return !parentCoreBlocks || parentCoreBlocks.length === 0; 60784 }, [postType, postId]); 60785 const { 60786 selectionChange, 60787 insertBlock 60788 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 60789 if (!isFootnotesSupported) { 60790 return null; 60791 } 60792 function onClick() { 60793 registry.batch(() => { 60794 let id; 60795 if (isObjectActive) { 60796 const object = value.replacements[value.start]; 60797 id = object?.attributes?.['data-fn']; 60798 } else { 60799 id = esm_browser_v4(); 60800 const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, { 60801 type: formatName, 60802 attributes: { 60803 'data-fn': id 60804 }, 60805 innerHTML: `<a href="#$id}" id="$id}-link">*</a>` 60806 }, value.end, value.end); 60807 newValue.start = newValue.end - 1; 60808 onChange(newValue); 60809 } 60810 const selectedClientId = getSelectedBlockClientId(); 60811 60812 /* 60813 * Attempts to find a common parent post content block. 60814 * This allows for locating blocks within a page edited in the site editor. 60815 */ 60816 const parentPostContent = getBlockParentsByBlockName(selectedClientId, POST_CONTENT_BLOCK_NAME); 60817 60818 // When called with a post content block, getBlocks will return 60819 // the block with controlled inner blocks included. 60820 const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); 60821 60822 // BFS search to find the first footnote block. 60823 let fnBlock = null; 60824 { 60825 const queue = [...blocks]; 60826 while (queue.length) { 60827 const block = queue.shift(); 60828 if (block.name === 'core/footnotes') { 60829 fnBlock = block; 60830 break; 60831 } 60832 queue.push(...block.innerBlocks); 60833 } 60834 } 60835 60836 // Maybe this should all also be moved to the entity provider. 60837 // When there is no footnotes block in the post, create one and 60838 // insert it at the bottom. 60839 if (!fnBlock) { 60840 let rootClientId = getBlockRootClientId(selectedClientId); 60841 while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) { 60842 rootClientId = getBlockRootClientId(rootClientId); 60843 } 60844 fnBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/footnotes'); 60845 insertBlock(fnBlock, undefined, rootClientId); 60846 } 60847 selectionChange(fnBlock.clientId, id, 0, 0); 60848 }); 60849 } 60850 return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { 60851 icon: format_list_numbered, 60852 title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), 60853 onClick: onClick, 60854 isActive: isObjectActive 60855 }); 60856 } 60857 }; 60858 60859 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js 60860 /** 60861 * WordPress dependencies 60862 */ 60863 60864 60865 60866 /** 60867 * Internal dependencies 60868 */ 60869 60870 60871 const footnotes_metadata = { 60872 $schema: "https://schemas.wp.org/trunk/block.json", 60873 apiVersion: 3, 60874 name: "core/footnotes", 60875 title: "Footnotes", 60876 category: "text", 60877 description: "Display footnotes added to the page.", 60878 keywords: ["references"], 60879 textdomain: "default", 60880 usesContext: ["postId", "postType"], 60881 supports: { 60882 __experimentalBorder: { 60883 radius: true, 60884 color: true, 60885 width: true, 60886 style: true, 60887 __experimentalDefaultControls: { 60888 radius: false, 60889 color: false, 60890 width: false, 60891 style: false 60892 } 60893 }, 60894 color: { 60895 background: true, 60896 link: true, 60897 text: true, 60898 __experimentalDefaultControls: { 60899 link: true, 60900 text: true 60901 } 60902 }, 60903 html: false, 60904 multiple: false, 60905 reusable: false, 60906 inserter: false, 60907 spacing: { 60908 margin: true, 60909 padding: true, 60910 __experimentalDefaultControls: { 60911 margin: false, 60912 padding: false 60913 } 60914 }, 60915 typography: { 60916 fontSize: true, 60917 lineHeight: true, 60918 __experimentalFontFamily: true, 60919 __experimentalTextDecoration: true, 60920 __experimentalFontStyle: true, 60921 __experimentalFontWeight: true, 60922 __experimentalLetterSpacing: true, 60923 __experimentalTextTransform: true, 60924 __experimentalWritingMode: true, 60925 __experimentalDefaultControls: { 60926 fontSize: true 60927 } 60928 }, 60929 interactivity: { 60930 clientNavigation: true 60931 } 60932 }, 60933 style: "wp-block-footnotes" 60934 }; 60935 60936 const { 60937 name: footnotes_name 60938 } = footnotes_metadata; 60939 60940 const footnotes_settings = { 60941 icon: format_list_numbered, 60942 edit: FootnotesEdit 60943 }; 60944 (0,external_wp_richText_namespaceObject.registerFormatType)(formatName, format); 60945 const footnotes_init = () => { 60946 initBlock({ 60947 name: footnotes_name, 60948 metadata: footnotes_metadata, 60949 settings: footnotes_settings 60950 }); 60951 }; 60952 60953 // EXTERNAL MODULE: ./node_modules/@wordpress/block-library/build-module/utils/is-block-metadata-experimental.js 60954 var is_block_metadata_experimental = __webpack_require__(2321); 60955 var is_block_metadata_experimental_default = /*#__PURE__*/__webpack_require__.n(is_block_metadata_experimental); 60956 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js 60957 /** 60958 * WordPress dependencies 60959 */ 60960 60961 60962 /** 60963 * Internal dependencies 60964 */ 60965 // When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks 60966 // are transformed by packages/block-library/src/index.js as follows: 60967 // import * as experimentalBlock from './experimental-block' 60968 // becomes 60969 // const experimentalBlock = null; 60970 // This enables webpack to eliminate the experimental blocks code from the 60971 // production build to make the final bundle smaller. 60972 // 60973 // See https://github.com/WordPress/gutenberg/pull/40655 for more context. 60974 60975 60976 60977 60978 60979 60980 60981 60982 60983 60984 60985 60986 60987 60988 60989 60990 60991 60992 60993 60994 60995 60996 60997 60998 60999 61000 61001 61002 61003 61004 61005 61006 61007 61008 61009 61010 61011 61012 61013 61014 61015 61016 61017 61018 61019 61020 61021 61022 61023 61024 61025 61026 61027 61028 61029 61030 61031 61032 61033 61034 61035 61036 61037 61038 61039 61040 61041 61042 61043 61044 61045 61046 61047 61048 61049 61050 61051 61052 61053 61054 61055 61056 61057 61058 61059 61060 61061 61062 61063 61064 61065 61066 61067 61068 61069 61070 61071 61072 61073 61074 61075 61076 61077 /** 61078 * Function to get all the block-library blocks in an array 61079 */ 61080 const getAllBlocks = () => { 61081 const blocks = [ 61082 // Common blocks are grouped at the top to prioritize their display 61083 // in various contexts — like the inserter and auto-complete components. 61084 build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_list_item_namespaceObject, build_module_quote_namespaceObject, 61085 // Register all remaining core blocks. 61086 archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_comment_author_avatar_namespaceObject, build_module_cover_namespaceObject, build_module_details_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, page_list_item_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, footnotes_namespaceObject, 61087 // theme blocks 61088 build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, post_author_name_namespaceObject, post_comment_namespaceObject, build_module_post_comments_count_namespaceObject, post_comments_link_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, post_time_to_read_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, comments_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_form_namespaceObject, build_module_table_of_contents_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, query_title_namespaceObject, post_author_biography_namespaceObject]; 61089 if (window?.__experimentalEnableFormBlocks) { 61090 blocks.push(build_module_form_namespaceObject); 61091 blocks.push(form_input_namespaceObject); 61092 blocks.push(form_submit_button_namespaceObject); 61093 blocks.push(form_submission_notification_namespaceObject); 61094 } 61095 61096 // When in a WordPress context, conditionally 61097 // add the classic block and TinyMCE editor 61098 // under any of the following conditions: 61099 // - the current post contains a classic block 61100 // - the experiment to disable TinyMCE isn't active. 61101 // - a query argument specifies that TinyMCE should be loaded 61102 if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get('requiresTinymce'))) { 61103 blocks.push(freeform_namespaceObject); 61104 } 61105 return blocks.filter(Boolean); 61106 }; 61107 61108 /** 61109 * Function to get all the core blocks in an array. 61110 * 61111 * @example 61112 * ```js 61113 * import { __experimentalGetCoreBlocks } from '@wordpress/block-library'; 61114 * 61115 * const coreBlocks = __experimentalGetCoreBlocks(); 61116 * ``` 61117 */ 61118 const __experimentalGetCoreBlocks = () => getAllBlocks().filter(({ 61119 metadata 61120 }) => !is_block_metadata_experimental_default()(metadata)); 61121 61122 /** 61123 * Function to register core blocks provided by the block editor. 61124 * 61125 * @param {Array} blocks An optional array of the core blocks being registered. 61126 * 61127 * @example 61128 * ```js 61129 * import { registerCoreBlocks } from '@wordpress/block-library'; 61130 * 61131 * registerCoreBlocks(); 61132 * ``` 61133 */ 61134 const registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => { 61135 blocks.forEach(({ 61136 init 61137 }) => init()); 61138 (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name); 61139 if (window.wp && window.wp.oldEditor && blocks.some(({ 61140 name 61141 }) => name === freeform_name)) { 61142 (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name); 61143 } 61144 (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name); 61145 (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name); 61146 }; 61147 61148 /** 61149 * Function to register experimental core blocks depending on editor settings. 61150 * 61151 * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks. 61152 * @example 61153 * ```js 61154 * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library'; 61155 * 61156 * __experimentalRegisterExperimentalCoreBlocks( settings ); 61157 * ``` 61158 */ 61159 const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined; 61160 61161 })(); 61162 61163 (window.wp = window.wp || {}).blockLibrary = __webpack_exports__; 61164 /******/ })() 61165 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Wed May 8 08:20:02 2024 | Cross-referenced by PHPXref |