[ 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 /***/ 7734: 27 /***/ ((module) => { 28 29 "use strict"; 30 31 32 // do not edit .js files directly - edit src/index.jst 33 34 35 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 36 37 38 module.exports = function equal(a, b) { 39 if (a === b) return true; 40 41 if (a && b && typeof a == 'object' && typeof b == 'object') { 42 if (a.constructor !== b.constructor) return false; 43 44 var length, i, keys; 45 if (Array.isArray(a)) { 46 length = a.length; 47 if (length != b.length) return false; 48 for (i = length; i-- !== 0;) 49 if (!equal(a[i], b[i])) return false; 50 return true; 51 } 52 53 54 if ((a instanceof Map) && (b instanceof Map)) { 55 if (a.size !== b.size) return false; 56 for (i of a.entries()) 57 if (!b.has(i[0])) return false; 58 for (i of a.entries()) 59 if (!equal(i[1], b.get(i[0]))) return false; 60 return true; 61 } 62 63 if ((a instanceof Set) && (b instanceof Set)) { 64 if (a.size !== b.size) return false; 65 for (i of a.entries()) 66 if (!b.has(i[0])) return false; 67 return true; 68 } 69 70 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 71 length = a.length; 72 if (length != b.length) return false; 73 for (i = length; i-- !== 0;) 74 if (a[i] !== b[i]) return false; 75 return true; 76 } 77 78 79 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 80 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 81 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 82 83 keys = Object.keys(a); 84 length = keys.length; 85 if (length !== Object.keys(b).length) return false; 86 87 for (i = length; i-- !== 0;) 88 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 89 90 for (i = length; i-- !== 0;) { 91 var key = keys[i]; 92 93 if (!equal(a[key], b[key])) return false; 94 } 95 96 return true; 97 } 98 99 // true if both NaN, false otherwise 100 return a!==a && b!==b; 101 }; 102 103 104 /***/ }), 105 106 /***/ 9681: 107 /***/ ((module) => { 108 109 var characterMap = { 110 "À": "A", 111 "Á": "A", 112 "Â": "A", 113 "Ã": "A", 114 "Ä": "A", 115 "Å": "A", 116 "Ấ": "A", 117 "Ắ": "A", 118 "Ẳ": "A", 119 "Ẵ": "A", 120 "Ặ": "A", 121 "Æ": "AE", 122 "Ầ": "A", 123 "Ằ": "A", 124 "Ȃ": "A", 125 "Ả": "A", 126 "Ạ": "A", 127 "Ẩ": "A", 128 "Ẫ": "A", 129 "Ậ": "A", 130 "Ç": "C", 131 "Ḉ": "C", 132 "È": "E", 133 "É": "E", 134 "Ê": "E", 135 "Ë": "E", 136 "Ế": "E", 137 "Ḗ": "E", 138 "Ề": "E", 139 "Ḕ": "E", 140 "Ḝ": "E", 141 "Ȇ": "E", 142 "Ẻ": "E", 143 "Ẽ": "E", 144 "Ẹ": "E", 145 "Ể": "E", 146 "Ễ": "E", 147 "Ệ": "E", 148 "Ì": "I", 149 "Í": "I", 150 "Î": "I", 151 "Ï": "I", 152 "Ḯ": "I", 153 "Ȋ": "I", 154 "Ỉ": "I", 155 "Ị": "I", 156 "Ð": "D", 157 "Ñ": "N", 158 "Ò": "O", 159 "Ó": "O", 160 "Ô": "O", 161 "Õ": "O", 162 "Ö": "O", 163 "Ø": "O", 164 "Ố": "O", 165 "Ṍ": "O", 166 "Ṓ": "O", 167 "Ȏ": "O", 168 "Ỏ": "O", 169 "Ọ": "O", 170 "Ổ": "O", 171 "Ỗ": "O", 172 "Ộ": "O", 173 "Ờ": "O", 174 "Ở": "O", 175 "Ỡ": "O", 176 "Ớ": "O", 177 "Ợ": "O", 178 "Ù": "U", 179 "Ú": "U", 180 "Û": "U", 181 "Ü": "U", 182 "Ủ": "U", 183 "Ụ": "U", 184 "Ử": "U", 185 "Ữ": "U", 186 "Ự": "U", 187 "Ý": "Y", 188 "à": "a", 189 "á": "a", 190 "â": "a", 191 "ã": "a", 192 "ä": "a", 193 "å": "a", 194 "ấ": "a", 195 "ắ": "a", 196 "ẳ": "a", 197 "ẵ": "a", 198 "ặ": "a", 199 "æ": "ae", 200 "ầ": "a", 201 "ằ": "a", 202 "ȃ": "a", 203 "ả": "a", 204 "ạ": "a", 205 "ẩ": "a", 206 "ẫ": "a", 207 "ậ": "a", 208 "ç": "c", 209 "ḉ": "c", 210 "è": "e", 211 "é": "e", 212 "ê": "e", 213 "ë": "e", 214 "ế": "e", 215 "ḗ": "e", 216 "ề": "e", 217 "ḕ": "e", 218 "ḝ": "e", 219 "ȇ": "e", 220 "ẻ": "e", 221 "ẽ": "e", 222 "ẹ": "e", 223 "ể": "e", 224 "ễ": "e", 225 "ệ": "e", 226 "ì": "i", 227 "í": "i", 228 "î": "i", 229 "ï": "i", 230 "ḯ": "i", 231 "ȋ": "i", 232 "ỉ": "i", 233 "ị": "i", 234 "ð": "d", 235 "ñ": "n", 236 "ò": "o", 237 "ó": "o", 238 "ô": "o", 239 "õ": "o", 240 "ö": "o", 241 "ø": "o", 242 "ố": "o", 243 "ṍ": "o", 244 "ṓ": "o", 245 "ȏ": "o", 246 "ỏ": "o", 247 "ọ": "o", 248 "ổ": "o", 249 "ỗ": "o", 250 "ộ": "o", 251 "ờ": "o", 252 "ở": "o", 253 "ỡ": "o", 254 "ớ": "o", 255 "ợ": "o", 256 "ù": "u", 257 "ú": "u", 258 "û": "u", 259 "ü": "u", 260 "ủ": "u", 261 "ụ": "u", 262 "ử": "u", 263 "ữ": "u", 264 "ự": "u", 265 "ý": "y", 266 "ÿ": "y", 267 "Ā": "A", 268 "ā": "a", 269 "Ă": "A", 270 "ă": "a", 271 "Ą": "A", 272 "ą": "a", 273 "Ć": "C", 274 "ć": "c", 275 "Ĉ": "C", 276 "ĉ": "c", 277 "Ċ": "C", 278 "ċ": "c", 279 "Č": "C", 280 "č": "c", 281 "C̆": "C", 282 "c̆": "c", 283 "Ď": "D", 284 "ď": "d", 285 "Đ": "D", 286 "đ": "d", 287 "Ē": "E", 288 "ē": "e", 289 "Ĕ": "E", 290 "ĕ": "e", 291 "Ė": "E", 292 "ė": "e", 293 "Ę": "E", 294 "ę": "e", 295 "Ě": "E", 296 "ě": "e", 297 "Ĝ": "G", 298 "Ǵ": "G", 299 "ĝ": "g", 300 "ǵ": "g", 301 "Ğ": "G", 302 "ğ": "g", 303 "Ġ": "G", 304 "ġ": "g", 305 "Ģ": "G", 306 "ģ": "g", 307 "Ĥ": "H", 308 "ĥ": "h", 309 "Ħ": "H", 310 "ħ": "h", 311 "Ḫ": "H", 312 "ḫ": "h", 313 "Ĩ": "I", 314 "ĩ": "i", 315 "Ī": "I", 316 "ī": "i", 317 "Ĭ": "I", 318 "ĭ": "i", 319 "Į": "I", 320 "į": "i", 321 "İ": "I", 322 "ı": "i", 323 "IJ": "IJ", 324 "ij": "ij", 325 "Ĵ": "J", 326 "ĵ": "j", 327 "Ķ": "K", 328 "ķ": "k", 329 "Ḱ": "K", 330 "ḱ": "k", 331 "K̆": "K", 332 "k̆": "k", 333 "Ĺ": "L", 334 "ĺ": "l", 335 "Ļ": "L", 336 "ļ": "l", 337 "Ľ": "L", 338 "ľ": "l", 339 "Ŀ": "L", 340 "ŀ": "l", 341 "Ł": "l", 342 "ł": "l", 343 "Ḿ": "M", 344 "ḿ": "m", 345 "M̆": "M", 346 "m̆": "m", 347 "Ń": "N", 348 "ń": "n", 349 "Ņ": "N", 350 "ņ": "n", 351 "Ň": "N", 352 "ň": "n", 353 "ʼn": "n", 354 "N̆": "N", 355 "n̆": "n", 356 "Ō": "O", 357 "ō": "o", 358 "Ŏ": "O", 359 "ŏ": "o", 360 "Ő": "O", 361 "ő": "o", 362 "Œ": "OE", 363 "œ": "oe", 364 "P̆": "P", 365 "p̆": "p", 366 "Ŕ": "R", 367 "ŕ": "r", 368 "Ŗ": "R", 369 "ŗ": "r", 370 "Ř": "R", 371 "ř": "r", 372 "R̆": "R", 373 "r̆": "r", 374 "Ȓ": "R", 375 "ȓ": "r", 376 "Ś": "S", 377 "ś": "s", 378 "Ŝ": "S", 379 "ŝ": "s", 380 "Ş": "S", 381 "Ș": "S", 382 "ș": "s", 383 "ş": "s", 384 "Š": "S", 385 "š": "s", 386 "Ţ": "T", 387 "ţ": "t", 388 "ț": "t", 389 "Ț": "T", 390 "Ť": "T", 391 "ť": "t", 392 "Ŧ": "T", 393 "ŧ": "t", 394 "T̆": "T", 395 "t̆": "t", 396 "Ũ": "U", 397 "ũ": "u", 398 "Ū": "U", 399 "ū": "u", 400 "Ŭ": "U", 401 "ŭ": "u", 402 "Ů": "U", 403 "ů": "u", 404 "Ű": "U", 405 "ű": "u", 406 "Ų": "U", 407 "ų": "u", 408 "Ȗ": "U", 409 "ȗ": "u", 410 "V̆": "V", 411 "v̆": "v", 412 "Ŵ": "W", 413 "ŵ": "w", 414 "Ẃ": "W", 415 "ẃ": "w", 416 "X̆": "X", 417 "x̆": "x", 418 "Ŷ": "Y", 419 "ŷ": "y", 420 "Ÿ": "Y", 421 "Y̆": "Y", 422 "y̆": "y", 423 "Ź": "Z", 424 "ź": "z", 425 "Ż": "Z", 426 "ż": "z", 427 "Ž": "Z", 428 "ž": "z", 429 "ſ": "s", 430 "ƒ": "f", 431 "Ơ": "O", 432 "ơ": "o", 433 "Ư": "U", 434 "ư": "u", 435 "Ǎ": "A", 436 "ǎ": "a", 437 "Ǐ": "I", 438 "ǐ": "i", 439 "Ǒ": "O", 440 "ǒ": "o", 441 "Ǔ": "U", 442 "ǔ": "u", 443 "Ǖ": "U", 444 "ǖ": "u", 445 "Ǘ": "U", 446 "ǘ": "u", 447 "Ǚ": "U", 448 "ǚ": "u", 449 "Ǜ": "U", 450 "ǜ": "u", 451 "Ứ": "U", 452 "ứ": "u", 453 "Ṹ": "U", 454 "ṹ": "u", 455 "Ǻ": "A", 456 "ǻ": "a", 457 "Ǽ": "AE", 458 "ǽ": "ae", 459 "Ǿ": "O", 460 "ǿ": "o", 461 "Þ": "TH", 462 "þ": "th", 463 "Ṕ": "P", 464 "ṕ": "p", 465 "Ṥ": "S", 466 "ṥ": "s", 467 "X́": "X", 468 "x́": "x", 469 "Ѓ": "Г", 470 "ѓ": "г", 471 "Ќ": "К", 472 "ќ": "к", 473 "A̋": "A", 474 "a̋": "a", 475 "E̋": "E", 476 "e̋": "e", 477 "I̋": "I", 478 "i̋": "i", 479 "Ǹ": "N", 480 "ǹ": "n", 481 "Ồ": "O", 482 "ồ": "o", 483 "Ṑ": "O", 484 "ṑ": "o", 485 "Ừ": "U", 486 "ừ": "u", 487 "Ẁ": "W", 488 "ẁ": "w", 489 "Ỳ": "Y", 490 "ỳ": "y", 491 "Ȁ": "A", 492 "ȁ": "a", 493 "Ȅ": "E", 494 "ȅ": "e", 495 "Ȉ": "I", 496 "ȉ": "i", 497 "Ȍ": "O", 498 "ȍ": "o", 499 "Ȑ": "R", 500 "ȑ": "r", 501 "Ȕ": "U", 502 "ȕ": "u", 503 "B̌": "B", 504 "b̌": "b", 505 "Č̣": "C", 506 "č̣": "c", 507 "Ê̌": "E", 508 "ê̌": "e", 509 "F̌": "F", 510 "f̌": "f", 511 "Ǧ": "G", 512 "ǧ": "g", 513 "Ȟ": "H", 514 "ȟ": "h", 515 "J̌": "J", 516 "ǰ": "j", 517 "Ǩ": "K", 518 "ǩ": "k", 519 "M̌": "M", 520 "m̌": "m", 521 "P̌": "P", 522 "p̌": "p", 523 "Q̌": "Q", 524 "q̌": "q", 525 "Ř̩": "R", 526 "ř̩": "r", 527 "Ṧ": "S", 528 "ṧ": "s", 529 "V̌": "V", 530 "v̌": "v", 531 "W̌": "W", 532 "w̌": "w", 533 "X̌": "X", 534 "x̌": "x", 535 "Y̌": "Y", 536 "y̌": "y", 537 "A̧": "A", 538 "a̧": "a", 539 "B̧": "B", 540 "b̧": "b", 541 "Ḑ": "D", 542 "ḑ": "d", 543 "Ȩ": "E", 544 "ȩ": "e", 545 "Ɛ̧": "E", 546 "ɛ̧": "e", 547 "Ḩ": "H", 548 "ḩ": "h", 549 "I̧": "I", 550 "i̧": "i", 551 "Ɨ̧": "I", 552 "ɨ̧": "i", 553 "M̧": "M", 554 "m̧": "m", 555 "O̧": "O", 556 "o̧": "o", 557 "Q̧": "Q", 558 "q̧": "q", 559 "U̧": "U", 560 "u̧": "u", 561 "X̧": "X", 562 "x̧": "x", 563 "Z̧": "Z", 564 "z̧": "z", 565 "й":"и", 566 "Й":"И", 567 "ё":"е", 568 "Ё":"Е", 569 }; 570 571 var chars = Object.keys(characterMap).join('|'); 572 var allAccents = new RegExp(chars, 'g'); 573 var firstAccent = new RegExp(chars, ''); 574 575 function matcher(match) { 576 return characterMap[match]; 577 } 578 579 var removeAccents = function(string) { 580 return string.replace(allAccents, matcher); 581 }; 582 583 var hasAccents = function(string) { 584 return !!string.match(firstAccent); 585 }; 586 587 module.exports = removeAccents; 588 module.exports.has = hasAccents; 589 module.exports.remove = removeAccents; 590 591 592 /***/ }) 593 594 /******/ }); 595 /************************************************************************/ 596 /******/ // The module cache 597 /******/ var __webpack_module_cache__ = {}; 598 /******/ 599 /******/ // The require function 600 /******/ function __webpack_require__(moduleId) { 601 /******/ // Check if module is in cache 602 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 603 /******/ if (cachedModule !== undefined) { 604 /******/ return cachedModule.exports; 605 /******/ } 606 /******/ // Create a new module (and put it into the cache) 607 /******/ var module = __webpack_module_cache__[moduleId] = { 608 /******/ // no module.id needed 609 /******/ // no module.loaded needed 610 /******/ exports: {} 611 /******/ }; 612 /******/ 613 /******/ // Execute the module function 614 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 615 /******/ 616 /******/ // Return the exports of the module 617 /******/ return module.exports; 618 /******/ } 619 /******/ 620 /************************************************************************/ 621 /******/ /* webpack/runtime/compat get default export */ 622 /******/ (() => { 623 /******/ // getDefaultExport function for compatibility with non-harmony modules 624 /******/ __webpack_require__.n = (module) => { 625 /******/ var getter = module && module.__esModule ? 626 /******/ () => (module['default']) : 627 /******/ () => (module); 628 /******/ __webpack_require__.d(getter, { a: getter }); 629 /******/ return getter; 630 /******/ }; 631 /******/ })(); 632 /******/ 633 /******/ /* webpack/runtime/define property getters */ 634 /******/ (() => { 635 /******/ // define getter functions for harmony exports 636 /******/ __webpack_require__.d = (exports, definition) => { 637 /******/ for(var key in definition) { 638 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 639 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 640 /******/ } 641 /******/ } 642 /******/ }; 643 /******/ })(); 644 /******/ 645 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 646 /******/ (() => { 647 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 648 /******/ })(); 649 /******/ 650 /******/ /* webpack/runtime/make namespace object */ 651 /******/ (() => { 652 /******/ // define __esModule on exports 653 /******/ __webpack_require__.r = (exports) => { 654 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 655 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 656 /******/ } 657 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 658 /******/ }; 659 /******/ })(); 660 /******/ 661 /************************************************************************/ 662 var __webpack_exports__ = {}; 663 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 664 (() => { 665 "use strict"; 666 // ESM COMPAT FLAG 667 __webpack_require__.r(__webpack_exports__); 668 669 // EXPORTS 670 __webpack_require__.d(__webpack_exports__, { 671 __experimentalGetCoreBlocks: () => (/* binding */ __experimentalGetCoreBlocks), 672 __experimentalRegisterExperimentalCoreBlocks: () => (/* binding */ __experimentalRegisterExperimentalCoreBlocks), 673 privateApis: () => (/* reexport */ privateApis), 674 registerCoreBlocks: () => (/* binding */ registerCoreBlocks) 675 }); 676 677 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js 678 var archives_namespaceObject = {}; 679 __webpack_require__.r(archives_namespaceObject); 680 __webpack_require__.d(archives_namespaceObject, { 681 init: () => (init), 682 metadata: () => (metadata), 683 name: () => (archives_name), 684 settings: () => (settings) 685 }); 686 687 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js 688 var avatar_namespaceObject = {}; 689 __webpack_require__.r(avatar_namespaceObject); 690 __webpack_require__.d(avatar_namespaceObject, { 691 init: () => (avatar_init), 692 metadata: () => (avatar_metadata), 693 name: () => (avatar_name), 694 settings: () => (avatar_settings) 695 }); 696 697 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js 698 var build_module_audio_namespaceObject = {}; 699 __webpack_require__.r(build_module_audio_namespaceObject); 700 __webpack_require__.d(build_module_audio_namespaceObject, { 701 init: () => (audio_init), 702 metadata: () => (audio_metadata), 703 name: () => (audio_name), 704 settings: () => (audio_settings) 705 }); 706 707 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js 708 var build_module_button_namespaceObject = {}; 709 __webpack_require__.r(build_module_button_namespaceObject); 710 __webpack_require__.d(build_module_button_namespaceObject, { 711 init: () => (button_init), 712 metadata: () => (button_metadata), 713 name: () => (button_name), 714 settings: () => (button_settings) 715 }); 716 717 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js 718 var build_module_buttons_namespaceObject = {}; 719 __webpack_require__.r(build_module_buttons_namespaceObject); 720 __webpack_require__.d(build_module_buttons_namespaceObject, { 721 init: () => (buttons_init), 722 metadata: () => (buttons_metadata), 723 name: () => (buttons_name), 724 settings: () => (buttons_settings) 725 }); 726 727 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js 728 var build_module_calendar_namespaceObject = {}; 729 __webpack_require__.r(build_module_calendar_namespaceObject); 730 __webpack_require__.d(build_module_calendar_namespaceObject, { 731 init: () => (calendar_init), 732 metadata: () => (calendar_metadata), 733 name: () => (calendar_name), 734 settings: () => (calendar_settings) 735 }); 736 737 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js 738 var categories_namespaceObject = {}; 739 __webpack_require__.r(categories_namespaceObject); 740 __webpack_require__.d(categories_namespaceObject, { 741 init: () => (categories_init), 742 metadata: () => (categories_metadata), 743 name: () => (categories_name), 744 settings: () => (categories_settings) 745 }); 746 747 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js 748 var freeform_namespaceObject = {}; 749 __webpack_require__.r(freeform_namespaceObject); 750 __webpack_require__.d(freeform_namespaceObject, { 751 init: () => (freeform_init), 752 metadata: () => (freeform_metadata), 753 name: () => (freeform_name), 754 settings: () => (freeform_settings) 755 }); 756 757 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js 758 var build_module_code_namespaceObject = {}; 759 __webpack_require__.r(build_module_code_namespaceObject); 760 __webpack_require__.d(build_module_code_namespaceObject, { 761 init: () => (code_init), 762 metadata: () => (code_metadata), 763 name: () => (code_name), 764 settings: () => (code_settings) 765 }); 766 767 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js 768 var build_module_column_namespaceObject = {}; 769 __webpack_require__.r(build_module_column_namespaceObject); 770 __webpack_require__.d(build_module_column_namespaceObject, { 771 init: () => (column_init), 772 metadata: () => (column_metadata), 773 name: () => (column_name), 774 settings: () => (column_settings) 775 }); 776 777 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js 778 var build_module_columns_namespaceObject = {}; 779 __webpack_require__.r(build_module_columns_namespaceObject); 780 __webpack_require__.d(build_module_columns_namespaceObject, { 781 init: () => (columns_init), 782 metadata: () => (columns_metadata), 783 name: () => (columns_name), 784 settings: () => (columns_settings) 785 }); 786 787 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js 788 var comments_namespaceObject = {}; 789 __webpack_require__.r(comments_namespaceObject); 790 __webpack_require__.d(comments_namespaceObject, { 791 init: () => (comments_init), 792 metadata: () => (comments_metadata), 793 name: () => (comments_name), 794 settings: () => (comments_settings) 795 }); 796 797 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js 798 var build_module_comment_author_avatar_namespaceObject = {}; 799 __webpack_require__.r(build_module_comment_author_avatar_namespaceObject); 800 __webpack_require__.d(build_module_comment_author_avatar_namespaceObject, { 801 init: () => (comment_author_avatar_init), 802 metadata: () => (comment_author_avatar_metadata), 803 name: () => (comment_author_avatar_name), 804 settings: () => (comment_author_avatar_settings) 805 }); 806 807 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js 808 var build_module_comment_author_name_namespaceObject = {}; 809 __webpack_require__.r(build_module_comment_author_name_namespaceObject); 810 __webpack_require__.d(build_module_comment_author_name_namespaceObject, { 811 init: () => (comment_author_name_init), 812 metadata: () => (comment_author_name_metadata), 813 name: () => (comment_author_name_name), 814 settings: () => (comment_author_name_settings) 815 }); 816 817 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js 818 var build_module_comment_content_namespaceObject = {}; 819 __webpack_require__.r(build_module_comment_content_namespaceObject); 820 __webpack_require__.d(build_module_comment_content_namespaceObject, { 821 init: () => (comment_content_init), 822 metadata: () => (comment_content_metadata), 823 name: () => (comment_content_name), 824 settings: () => (comment_content_settings) 825 }); 826 827 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js 828 var comment_date_namespaceObject = {}; 829 __webpack_require__.r(comment_date_namespaceObject); 830 __webpack_require__.d(comment_date_namespaceObject, { 831 init: () => (comment_date_init), 832 metadata: () => (comment_date_metadata), 833 name: () => (comment_date_name), 834 settings: () => (comment_date_settings) 835 }); 836 837 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js 838 var build_module_comment_edit_link_namespaceObject = {}; 839 __webpack_require__.r(build_module_comment_edit_link_namespaceObject); 840 __webpack_require__.d(build_module_comment_edit_link_namespaceObject, { 841 init: () => (comment_edit_link_init), 842 metadata: () => (comment_edit_link_metadata), 843 name: () => (comment_edit_link_name), 844 settings: () => (comment_edit_link_settings) 845 }); 846 847 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js 848 var build_module_comment_reply_link_namespaceObject = {}; 849 __webpack_require__.r(build_module_comment_reply_link_namespaceObject); 850 __webpack_require__.d(build_module_comment_reply_link_namespaceObject, { 851 init: () => (comment_reply_link_init), 852 metadata: () => (comment_reply_link_metadata), 853 name: () => (comment_reply_link_name), 854 settings: () => (comment_reply_link_settings) 855 }); 856 857 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js 858 var comment_template_namespaceObject = {}; 859 __webpack_require__.r(comment_template_namespaceObject); 860 __webpack_require__.d(comment_template_namespaceObject, { 861 init: () => (comment_template_init), 862 metadata: () => (comment_template_metadata), 863 name: () => (comment_template_name), 864 settings: () => (comment_template_settings) 865 }); 866 867 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js 868 var comments_pagination_previous_namespaceObject = {}; 869 __webpack_require__.r(comments_pagination_previous_namespaceObject); 870 __webpack_require__.d(comments_pagination_previous_namespaceObject, { 871 init: () => (comments_pagination_previous_init), 872 metadata: () => (comments_pagination_previous_metadata), 873 name: () => (comments_pagination_previous_name), 874 settings: () => (comments_pagination_previous_settings) 875 }); 876 877 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js 878 var comments_pagination_namespaceObject = {}; 879 __webpack_require__.r(comments_pagination_namespaceObject); 880 __webpack_require__.d(comments_pagination_namespaceObject, { 881 init: () => (comments_pagination_init), 882 metadata: () => (comments_pagination_metadata), 883 name: () => (comments_pagination_name), 884 settings: () => (comments_pagination_settings) 885 }); 886 887 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js 888 var comments_pagination_next_namespaceObject = {}; 889 __webpack_require__.r(comments_pagination_next_namespaceObject); 890 __webpack_require__.d(comments_pagination_next_namespaceObject, { 891 init: () => (comments_pagination_next_init), 892 metadata: () => (comments_pagination_next_metadata), 893 name: () => (comments_pagination_next_name), 894 settings: () => (comments_pagination_next_settings) 895 }); 896 897 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js 898 var comments_pagination_numbers_namespaceObject = {}; 899 __webpack_require__.r(comments_pagination_numbers_namespaceObject); 900 __webpack_require__.d(comments_pagination_numbers_namespaceObject, { 901 init: () => (comments_pagination_numbers_init), 902 metadata: () => (comments_pagination_numbers_metadata), 903 name: () => (comments_pagination_numbers_name), 904 settings: () => (comments_pagination_numbers_settings) 905 }); 906 907 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js 908 var comments_title_namespaceObject = {}; 909 __webpack_require__.r(comments_title_namespaceObject); 910 __webpack_require__.d(comments_title_namespaceObject, { 911 init: () => (comments_title_init), 912 metadata: () => (comments_title_metadata), 913 name: () => (comments_title_name), 914 settings: () => (comments_title_settings) 915 }); 916 917 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js 918 var build_module_cover_namespaceObject = {}; 919 __webpack_require__.r(build_module_cover_namespaceObject); 920 __webpack_require__.d(build_module_cover_namespaceObject, { 921 init: () => (cover_init), 922 metadata: () => (cover_metadata), 923 name: () => (cover_name), 924 settings: () => (cover_settings) 925 }); 926 927 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/details/index.js 928 var build_module_details_namespaceObject = {}; 929 __webpack_require__.r(build_module_details_namespaceObject); 930 __webpack_require__.d(build_module_details_namespaceObject, { 931 init: () => (details_init), 932 metadata: () => (details_metadata), 933 name: () => (details_name), 934 settings: () => (details_settings) 935 }); 936 937 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js 938 var embed_namespaceObject = {}; 939 __webpack_require__.r(embed_namespaceObject); 940 __webpack_require__.d(embed_namespaceObject, { 941 init: () => (embed_init), 942 metadata: () => (embed_metadata), 943 name: () => (embed_name), 944 settings: () => (embed_settings) 945 }); 946 947 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js 948 var build_module_file_namespaceObject = {}; 949 __webpack_require__.r(build_module_file_namespaceObject); 950 __webpack_require__.d(build_module_file_namespaceObject, { 951 init: () => (file_init), 952 metadata: () => (file_metadata), 953 name: () => (file_name), 954 settings: () => (file_settings) 955 }); 956 957 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form/index.js 958 var build_module_form_namespaceObject = {}; 959 __webpack_require__.r(build_module_form_namespaceObject); 960 __webpack_require__.d(build_module_form_namespaceObject, { 961 init: () => (form_init), 962 metadata: () => (form_metadata), 963 name: () => (form_name), 964 settings: () => (form_settings) 965 }); 966 967 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-input/index.js 968 var form_input_namespaceObject = {}; 969 __webpack_require__.r(form_input_namespaceObject); 970 __webpack_require__.d(form_input_namespaceObject, { 971 init: () => (form_input_init), 972 metadata: () => (form_input_metadata), 973 name: () => (form_input_name), 974 settings: () => (form_input_settings) 975 }); 976 977 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js 978 var form_submit_button_namespaceObject = {}; 979 __webpack_require__.r(form_submit_button_namespaceObject); 980 __webpack_require__.d(form_submit_button_namespaceObject, { 981 init: () => (form_submit_button_init), 982 metadata: () => (form_submit_button_metadata), 983 name: () => (form_submit_button_name), 984 settings: () => (form_submit_button_settings) 985 }); 986 987 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js 988 var form_submission_notification_namespaceObject = {}; 989 __webpack_require__.r(form_submission_notification_namespaceObject); 990 __webpack_require__.d(form_submission_notification_namespaceObject, { 991 init: () => (form_submission_notification_init), 992 metadata: () => (form_submission_notification_metadata), 993 name: () => (form_submission_notification_name), 994 settings: () => (form_submission_notification_settings) 995 }); 996 997 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js 998 var build_module_gallery_namespaceObject = {}; 999 __webpack_require__.r(build_module_gallery_namespaceObject); 1000 __webpack_require__.d(build_module_gallery_namespaceObject, { 1001 init: () => (gallery_init), 1002 metadata: () => (gallery_metadata), 1003 name: () => (gallery_name), 1004 settings: () => (gallery_settings) 1005 }); 1006 1007 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js 1008 var build_module_group_namespaceObject = {}; 1009 __webpack_require__.r(build_module_group_namespaceObject); 1010 __webpack_require__.d(build_module_group_namespaceObject, { 1011 init: () => (group_init), 1012 metadata: () => (group_metadata), 1013 name: () => (group_name), 1014 settings: () => (group_settings) 1015 }); 1016 1017 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js 1018 var build_module_heading_namespaceObject = {}; 1019 __webpack_require__.r(build_module_heading_namespaceObject); 1020 __webpack_require__.d(build_module_heading_namespaceObject, { 1021 init: () => (heading_init), 1022 metadata: () => (heading_metadata), 1023 name: () => (heading_name), 1024 settings: () => (heading_settings) 1025 }); 1026 1027 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js 1028 var home_link_namespaceObject = {}; 1029 __webpack_require__.r(home_link_namespaceObject); 1030 __webpack_require__.d(home_link_namespaceObject, { 1031 init: () => (home_link_init), 1032 metadata: () => (home_link_metadata), 1033 name: () => (home_link_name), 1034 settings: () => (home_link_settings) 1035 }); 1036 1037 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js 1038 var build_module_html_namespaceObject = {}; 1039 __webpack_require__.r(build_module_html_namespaceObject); 1040 __webpack_require__.d(build_module_html_namespaceObject, { 1041 init: () => (html_init), 1042 metadata: () => (html_metadata), 1043 name: () => (html_name), 1044 settings: () => (html_settings) 1045 }); 1046 1047 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js 1048 var build_module_image_namespaceObject = {}; 1049 __webpack_require__.r(build_module_image_namespaceObject); 1050 __webpack_require__.d(build_module_image_namespaceObject, { 1051 init: () => (image_init), 1052 metadata: () => (image_metadata), 1053 name: () => (image_name), 1054 settings: () => (image_settings) 1055 }); 1056 1057 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 1058 var latest_comments_namespaceObject = {}; 1059 __webpack_require__.r(latest_comments_namespaceObject); 1060 __webpack_require__.d(latest_comments_namespaceObject, { 1061 init: () => (latest_comments_init), 1062 metadata: () => (latest_comments_metadata), 1063 name: () => (latest_comments_name), 1064 settings: () => (latest_comments_settings) 1065 }); 1066 1067 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 1068 var latest_posts_namespaceObject = {}; 1069 __webpack_require__.r(latest_posts_namespaceObject); 1070 __webpack_require__.d(latest_posts_namespaceObject, { 1071 init: () => (latest_posts_init), 1072 metadata: () => (latest_posts_metadata), 1073 name: () => (latest_posts_name), 1074 settings: () => (latest_posts_settings) 1075 }); 1076 1077 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js 1078 var build_module_list_namespaceObject = {}; 1079 __webpack_require__.r(build_module_list_namespaceObject); 1080 __webpack_require__.d(build_module_list_namespaceObject, { 1081 init: () => (list_init), 1082 metadata: () => (list_metadata), 1083 name: () => (list_name), 1084 settings: () => (list_settings) 1085 }); 1086 1087 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js 1088 var build_module_list_item_namespaceObject = {}; 1089 __webpack_require__.r(build_module_list_item_namespaceObject); 1090 __webpack_require__.d(build_module_list_item_namespaceObject, { 1091 init: () => (list_item_init), 1092 metadata: () => (list_item_metadata), 1093 name: () => (list_item_name), 1094 settings: () => (list_item_settings) 1095 }); 1096 1097 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js 1098 var loginout_namespaceObject = {}; 1099 __webpack_require__.r(loginout_namespaceObject); 1100 __webpack_require__.d(loginout_namespaceObject, { 1101 init: () => (loginout_init), 1102 metadata: () => (loginout_metadata), 1103 name: () => (loginout_name), 1104 settings: () => (loginout_settings) 1105 }); 1106 1107 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js 1108 var media_text_namespaceObject = {}; 1109 __webpack_require__.r(media_text_namespaceObject); 1110 __webpack_require__.d(media_text_namespaceObject, { 1111 init: () => (media_text_init), 1112 metadata: () => (media_text_metadata), 1113 name: () => (media_text_name), 1114 settings: () => (media_text_settings) 1115 }); 1116 1117 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js 1118 var missing_namespaceObject = {}; 1119 __webpack_require__.r(missing_namespaceObject); 1120 __webpack_require__.d(missing_namespaceObject, { 1121 init: () => (missing_init), 1122 metadata: () => (missing_metadata), 1123 name: () => (missing_name), 1124 settings: () => (missing_settings) 1125 }); 1126 1127 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js 1128 var build_module_more_namespaceObject = {}; 1129 __webpack_require__.r(build_module_more_namespaceObject); 1130 __webpack_require__.d(build_module_more_namespaceObject, { 1131 init: () => (more_init), 1132 metadata: () => (more_metadata), 1133 name: () => (more_name), 1134 settings: () => (more_settings) 1135 }); 1136 1137 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js 1138 var build_module_navigation_namespaceObject = {}; 1139 __webpack_require__.r(build_module_navigation_namespaceObject); 1140 __webpack_require__.d(build_module_navigation_namespaceObject, { 1141 init: () => (navigation_init), 1142 metadata: () => (navigation_metadata), 1143 name: () => (navigation_name), 1144 settings: () => (navigation_settings) 1145 }); 1146 1147 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js 1148 var navigation_link_namespaceObject = {}; 1149 __webpack_require__.r(navigation_link_namespaceObject); 1150 __webpack_require__.d(navigation_link_namespaceObject, { 1151 init: () => (navigation_link_init), 1152 metadata: () => (navigation_link_metadata), 1153 name: () => (navigation_link_name), 1154 settings: () => (navigation_link_settings) 1155 }); 1156 1157 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js 1158 var navigation_submenu_namespaceObject = {}; 1159 __webpack_require__.r(navigation_submenu_namespaceObject); 1160 __webpack_require__.d(navigation_submenu_namespaceObject, { 1161 init: () => (navigation_submenu_init), 1162 metadata: () => (navigation_submenu_metadata), 1163 name: () => (navigation_submenu_name), 1164 settings: () => (navigation_submenu_settings) 1165 }); 1166 1167 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 1168 var nextpage_namespaceObject = {}; 1169 __webpack_require__.r(nextpage_namespaceObject); 1170 __webpack_require__.d(nextpage_namespaceObject, { 1171 init: () => (nextpage_init), 1172 metadata: () => (nextpage_metadata), 1173 name: () => (nextpage_name), 1174 settings: () => (nextpage_settings) 1175 }); 1176 1177 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js 1178 var pattern_namespaceObject = {}; 1179 __webpack_require__.r(pattern_namespaceObject); 1180 __webpack_require__.d(pattern_namespaceObject, { 1181 init: () => (pattern_init), 1182 metadata: () => (pattern_metadata), 1183 name: () => (pattern_name), 1184 settings: () => (pattern_settings) 1185 }); 1186 1187 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js 1188 var page_list_namespaceObject = {}; 1189 __webpack_require__.r(page_list_namespaceObject); 1190 __webpack_require__.d(page_list_namespaceObject, { 1191 init: () => (page_list_init), 1192 metadata: () => (page_list_metadata), 1193 name: () => (page_list_name), 1194 settings: () => (page_list_settings) 1195 }); 1196 1197 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js 1198 var page_list_item_namespaceObject = {}; 1199 __webpack_require__.r(page_list_item_namespaceObject); 1200 __webpack_require__.d(page_list_item_namespaceObject, { 1201 init: () => (page_list_item_init), 1202 metadata: () => (page_list_item_metadata), 1203 name: () => (page_list_item_name), 1204 settings: () => (page_list_item_settings) 1205 }); 1206 1207 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 1208 var build_module_paragraph_namespaceObject = {}; 1209 __webpack_require__.r(build_module_paragraph_namespaceObject); 1210 __webpack_require__.d(build_module_paragraph_namespaceObject, { 1211 init: () => (paragraph_init), 1212 metadata: () => (paragraph_metadata), 1213 name: () => (paragraph_name), 1214 settings: () => (paragraph_settings) 1215 }); 1216 1217 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js 1218 var build_module_post_author_namespaceObject = {}; 1219 __webpack_require__.r(build_module_post_author_namespaceObject); 1220 __webpack_require__.d(build_module_post_author_namespaceObject, { 1221 init: () => (post_author_init), 1222 metadata: () => (post_author_metadata), 1223 name: () => (post_author_name), 1224 settings: () => (post_author_settings) 1225 }); 1226 1227 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js 1228 var post_author_name_namespaceObject = {}; 1229 __webpack_require__.r(post_author_name_namespaceObject); 1230 __webpack_require__.d(post_author_name_namespaceObject, { 1231 init: () => (post_author_name_init), 1232 metadata: () => (post_author_name_metadata), 1233 name: () => (post_author_name_name), 1234 settings: () => (post_author_name_settings) 1235 }); 1236 1237 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js 1238 var post_author_biography_namespaceObject = {}; 1239 __webpack_require__.r(post_author_biography_namespaceObject); 1240 __webpack_require__.d(post_author_biography_namespaceObject, { 1241 init: () => (post_author_biography_init), 1242 metadata: () => (post_author_biography_metadata), 1243 name: () => (post_author_biography_name), 1244 settings: () => (post_author_biography_settings) 1245 }); 1246 1247 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js 1248 var post_comment_namespaceObject = {}; 1249 __webpack_require__.r(post_comment_namespaceObject); 1250 __webpack_require__.d(post_comment_namespaceObject, { 1251 init: () => (post_comment_init), 1252 metadata: () => (post_comment_metadata), 1253 name: () => (post_comment_name), 1254 settings: () => (post_comment_settings) 1255 }); 1256 1257 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js 1258 var build_module_post_comments_count_namespaceObject = {}; 1259 __webpack_require__.r(build_module_post_comments_count_namespaceObject); 1260 __webpack_require__.d(build_module_post_comments_count_namespaceObject, { 1261 init: () => (post_comments_count_init), 1262 metadata: () => (post_comments_count_metadata), 1263 name: () => (post_comments_count_name), 1264 settings: () => (post_comments_count_settings) 1265 }); 1266 1267 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js 1268 var build_module_post_comments_form_namespaceObject = {}; 1269 __webpack_require__.r(build_module_post_comments_form_namespaceObject); 1270 __webpack_require__.d(build_module_post_comments_form_namespaceObject, { 1271 init: () => (post_comments_form_init), 1272 metadata: () => (post_comments_form_metadata), 1273 name: () => (post_comments_form_name), 1274 settings: () => (post_comments_form_settings) 1275 }); 1276 1277 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js 1278 var post_comments_link_namespaceObject = {}; 1279 __webpack_require__.r(post_comments_link_namespaceObject); 1280 __webpack_require__.d(post_comments_link_namespaceObject, { 1281 init: () => (post_comments_link_init), 1282 metadata: () => (post_comments_link_metadata), 1283 name: () => (post_comments_link_name), 1284 settings: () => (post_comments_link_settings) 1285 }); 1286 1287 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js 1288 var build_module_post_content_namespaceObject = {}; 1289 __webpack_require__.r(build_module_post_content_namespaceObject); 1290 __webpack_require__.d(build_module_post_content_namespaceObject, { 1291 init: () => (post_content_init), 1292 metadata: () => (post_content_metadata), 1293 name: () => (post_content_name), 1294 settings: () => (post_content_settings) 1295 }); 1296 1297 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js 1298 var build_module_post_date_namespaceObject = {}; 1299 __webpack_require__.r(build_module_post_date_namespaceObject); 1300 __webpack_require__.d(build_module_post_date_namespaceObject, { 1301 init: () => (post_date_init), 1302 metadata: () => (post_date_metadata), 1303 name: () => (post_date_name), 1304 settings: () => (post_date_settings) 1305 }); 1306 1307 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js 1308 var build_module_post_excerpt_namespaceObject = {}; 1309 __webpack_require__.r(build_module_post_excerpt_namespaceObject); 1310 __webpack_require__.d(build_module_post_excerpt_namespaceObject, { 1311 init: () => (post_excerpt_init), 1312 metadata: () => (post_excerpt_metadata), 1313 name: () => (post_excerpt_name), 1314 settings: () => (post_excerpt_settings) 1315 }); 1316 1317 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js 1318 var build_module_post_featured_image_namespaceObject = {}; 1319 __webpack_require__.r(build_module_post_featured_image_namespaceObject); 1320 __webpack_require__.d(build_module_post_featured_image_namespaceObject, { 1321 init: () => (post_featured_image_init), 1322 metadata: () => (post_featured_image_metadata), 1323 name: () => (post_featured_image_name), 1324 settings: () => (post_featured_image_settings) 1325 }); 1326 1327 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js 1328 var post_navigation_link_namespaceObject = {}; 1329 __webpack_require__.r(post_navigation_link_namespaceObject); 1330 __webpack_require__.d(post_navigation_link_namespaceObject, { 1331 init: () => (post_navigation_link_init), 1332 metadata: () => (post_navigation_link_metadata), 1333 name: () => (post_navigation_link_name), 1334 settings: () => (post_navigation_link_settings) 1335 }); 1336 1337 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js 1338 var post_template_namespaceObject = {}; 1339 __webpack_require__.r(post_template_namespaceObject); 1340 __webpack_require__.d(post_template_namespaceObject, { 1341 init: () => (post_template_init), 1342 metadata: () => (post_template_metadata), 1343 name: () => (post_template_name), 1344 settings: () => (post_template_settings) 1345 }); 1346 1347 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js 1348 var build_module_post_terms_namespaceObject = {}; 1349 __webpack_require__.r(build_module_post_terms_namespaceObject); 1350 __webpack_require__.d(build_module_post_terms_namespaceObject, { 1351 init: () => (post_terms_init), 1352 metadata: () => (post_terms_metadata), 1353 name: () => (post_terms_name), 1354 settings: () => (post_terms_settings) 1355 }); 1356 1357 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js 1358 var post_time_to_read_namespaceObject = {}; 1359 __webpack_require__.r(post_time_to_read_namespaceObject); 1360 __webpack_require__.d(post_time_to_read_namespaceObject, { 1361 init: () => (post_time_to_read_init), 1362 metadata: () => (post_time_to_read_metadata), 1363 name: () => (post_time_to_read_name), 1364 settings: () => (post_time_to_read_settings) 1365 }); 1366 1367 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js 1368 var post_title_namespaceObject = {}; 1369 __webpack_require__.r(post_title_namespaceObject); 1370 __webpack_require__.d(post_title_namespaceObject, { 1371 init: () => (post_title_init), 1372 metadata: () => (post_title_metadata), 1373 name: () => (post_title_name), 1374 settings: () => (post_title_settings) 1375 }); 1376 1377 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 1378 var build_module_preformatted_namespaceObject = {}; 1379 __webpack_require__.r(build_module_preformatted_namespaceObject); 1380 __webpack_require__.d(build_module_preformatted_namespaceObject, { 1381 init: () => (preformatted_init), 1382 metadata: () => (preformatted_metadata), 1383 name: () => (preformatted_name), 1384 settings: () => (preformatted_settings) 1385 }); 1386 1387 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 1388 var build_module_pullquote_namespaceObject = {}; 1389 __webpack_require__.r(build_module_pullquote_namespaceObject); 1390 __webpack_require__.d(build_module_pullquote_namespaceObject, { 1391 init: () => (pullquote_init), 1392 metadata: () => (pullquote_metadata), 1393 name: () => (pullquote_name), 1394 settings: () => (pullquote_settings) 1395 }); 1396 1397 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js 1398 var query_namespaceObject = {}; 1399 __webpack_require__.r(query_namespaceObject); 1400 __webpack_require__.d(query_namespaceObject, { 1401 init: () => (query_init), 1402 metadata: () => (query_metadata), 1403 name: () => (query_name), 1404 settings: () => (query_settings) 1405 }); 1406 1407 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js 1408 var query_no_results_namespaceObject = {}; 1409 __webpack_require__.r(query_no_results_namespaceObject); 1410 __webpack_require__.d(query_no_results_namespaceObject, { 1411 init: () => (query_no_results_init), 1412 metadata: () => (query_no_results_metadata), 1413 name: () => (query_no_results_name), 1414 settings: () => (query_no_results_settings) 1415 }); 1416 1417 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js 1418 var build_module_query_pagination_namespaceObject = {}; 1419 __webpack_require__.r(build_module_query_pagination_namespaceObject); 1420 __webpack_require__.d(build_module_query_pagination_namespaceObject, { 1421 init: () => (query_pagination_init), 1422 metadata: () => (query_pagination_metadata), 1423 name: () => (query_pagination_name), 1424 settings: () => (query_pagination_settings) 1425 }); 1426 1427 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js 1428 var build_module_query_pagination_next_namespaceObject = {}; 1429 __webpack_require__.r(build_module_query_pagination_next_namespaceObject); 1430 __webpack_require__.d(build_module_query_pagination_next_namespaceObject, { 1431 init: () => (query_pagination_next_init), 1432 metadata: () => (query_pagination_next_metadata), 1433 name: () => (query_pagination_next_name), 1434 settings: () => (query_pagination_next_settings) 1435 }); 1436 1437 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js 1438 var build_module_query_pagination_numbers_namespaceObject = {}; 1439 __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject); 1440 __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, { 1441 init: () => (query_pagination_numbers_init), 1442 metadata: () => (query_pagination_numbers_metadata), 1443 name: () => (query_pagination_numbers_name), 1444 settings: () => (query_pagination_numbers_settings) 1445 }); 1446 1447 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js 1448 var build_module_query_pagination_previous_namespaceObject = {}; 1449 __webpack_require__.r(build_module_query_pagination_previous_namespaceObject); 1450 __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, { 1451 init: () => (query_pagination_previous_init), 1452 metadata: () => (query_pagination_previous_metadata), 1453 name: () => (query_pagination_previous_name), 1454 settings: () => (query_pagination_previous_settings) 1455 }); 1456 1457 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js 1458 var query_title_namespaceObject = {}; 1459 __webpack_require__.r(query_title_namespaceObject); 1460 __webpack_require__.d(query_title_namespaceObject, { 1461 init: () => (query_title_init), 1462 metadata: () => (query_title_metadata), 1463 name: () => (query_title_name), 1464 settings: () => (query_title_settings) 1465 }); 1466 1467 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-total/index.js 1468 var query_total_namespaceObject = {}; 1469 __webpack_require__.r(query_total_namespaceObject); 1470 __webpack_require__.d(query_total_namespaceObject, { 1471 init: () => (query_total_init), 1472 metadata: () => (query_total_metadata), 1473 name: () => (query_total_name), 1474 settings: () => (query_total_settings) 1475 }); 1476 1477 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js 1478 var build_module_quote_namespaceObject = {}; 1479 __webpack_require__.r(build_module_quote_namespaceObject); 1480 __webpack_require__.d(build_module_quote_namespaceObject, { 1481 init: () => (quote_init), 1482 metadata: () => (quote_metadata), 1483 name: () => (quote_name), 1484 settings: () => (quote_settings) 1485 }); 1486 1487 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js 1488 var block_namespaceObject = {}; 1489 __webpack_require__.r(block_namespaceObject); 1490 __webpack_require__.d(block_namespaceObject, { 1491 init: () => (block_init), 1492 metadata: () => (block_metadata), 1493 name: () => (block_name), 1494 settings: () => (block_settings) 1495 }); 1496 1497 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js 1498 var read_more_namespaceObject = {}; 1499 __webpack_require__.r(read_more_namespaceObject); 1500 __webpack_require__.d(read_more_namespaceObject, { 1501 init: () => (read_more_init), 1502 metadata: () => (read_more_metadata), 1503 name: () => (read_more_name), 1504 settings: () => (read_more_settings) 1505 }); 1506 1507 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js 1508 var build_module_rss_namespaceObject = {}; 1509 __webpack_require__.r(build_module_rss_namespaceObject); 1510 __webpack_require__.d(build_module_rss_namespaceObject, { 1511 init: () => (rss_init), 1512 metadata: () => (rss_metadata), 1513 name: () => (rss_name), 1514 settings: () => (rss_settings) 1515 }); 1516 1517 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js 1518 var build_module_search_namespaceObject = {}; 1519 __webpack_require__.r(build_module_search_namespaceObject); 1520 __webpack_require__.d(build_module_search_namespaceObject, { 1521 init: () => (search_init), 1522 metadata: () => (search_metadata), 1523 name: () => (search_name), 1524 settings: () => (search_settings) 1525 }); 1526 1527 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js 1528 var build_module_separator_namespaceObject = {}; 1529 __webpack_require__.r(build_module_separator_namespaceObject); 1530 __webpack_require__.d(build_module_separator_namespaceObject, { 1531 init: () => (separator_init), 1532 metadata: () => (separator_metadata), 1533 name: () => (separator_name), 1534 settings: () => (separator_settings) 1535 }); 1536 1537 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 1538 var build_module_shortcode_namespaceObject = {}; 1539 __webpack_require__.r(build_module_shortcode_namespaceObject); 1540 __webpack_require__.d(build_module_shortcode_namespaceObject, { 1541 init: () => (shortcode_init), 1542 metadata: () => (shortcode_metadata), 1543 name: () => (shortcode_name), 1544 settings: () => (shortcode_settings) 1545 }); 1546 1547 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js 1548 var build_module_site_logo_namespaceObject = {}; 1549 __webpack_require__.r(build_module_site_logo_namespaceObject); 1550 __webpack_require__.d(build_module_site_logo_namespaceObject, { 1551 init: () => (site_logo_init), 1552 metadata: () => (site_logo_metadata), 1553 name: () => (site_logo_name), 1554 settings: () => (site_logo_settings) 1555 }); 1556 1557 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js 1558 var site_tagline_namespaceObject = {}; 1559 __webpack_require__.r(site_tagline_namespaceObject); 1560 __webpack_require__.d(site_tagline_namespaceObject, { 1561 init: () => (site_tagline_init), 1562 metadata: () => (site_tagline_metadata), 1563 name: () => (site_tagline_name), 1564 settings: () => (site_tagline_settings) 1565 }); 1566 1567 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js 1568 var site_title_namespaceObject = {}; 1569 __webpack_require__.r(site_title_namespaceObject); 1570 __webpack_require__.d(site_title_namespaceObject, { 1571 init: () => (site_title_init), 1572 metadata: () => (site_title_metadata), 1573 name: () => (site_title_name), 1574 settings: () => (site_title_settings) 1575 }); 1576 1577 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js 1578 var social_link_namespaceObject = {}; 1579 __webpack_require__.r(social_link_namespaceObject); 1580 __webpack_require__.d(social_link_namespaceObject, { 1581 init: () => (social_link_init), 1582 metadata: () => (social_link_metadata), 1583 name: () => (social_link_name), 1584 settings: () => (social_link_settings) 1585 }); 1586 1587 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js 1588 var social_links_namespaceObject = {}; 1589 __webpack_require__.r(social_links_namespaceObject); 1590 __webpack_require__.d(social_links_namespaceObject, { 1591 init: () => (social_links_init), 1592 metadata: () => (social_links_metadata), 1593 name: () => (social_links_name), 1594 settings: () => (social_links_settings) 1595 }); 1596 1597 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js 1598 var spacer_namespaceObject = {}; 1599 __webpack_require__.r(spacer_namespaceObject); 1600 __webpack_require__.d(spacer_namespaceObject, { 1601 init: () => (spacer_init), 1602 metadata: () => (spacer_metadata), 1603 name: () => (spacer_name), 1604 settings: () => (spacer_settings) 1605 }); 1606 1607 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js 1608 var build_module_table_namespaceObject = {}; 1609 __webpack_require__.r(build_module_table_namespaceObject); 1610 __webpack_require__.d(build_module_table_namespaceObject, { 1611 init: () => (table_init), 1612 metadata: () => (table_metadata), 1613 name: () => (table_name), 1614 settings: () => (table_settings) 1615 }); 1616 1617 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js 1618 var build_module_table_of_contents_namespaceObject = {}; 1619 __webpack_require__.r(build_module_table_of_contents_namespaceObject); 1620 __webpack_require__.d(build_module_table_of_contents_namespaceObject, { 1621 init: () => (table_of_contents_init), 1622 metadata: () => (table_of_contents_metadata), 1623 name: () => (table_of_contents_name), 1624 settings: () => (table_of_contents_settings) 1625 }); 1626 1627 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 1628 var tag_cloud_namespaceObject = {}; 1629 __webpack_require__.r(tag_cloud_namespaceObject); 1630 __webpack_require__.d(tag_cloud_namespaceObject, { 1631 init: () => (tag_cloud_init), 1632 metadata: () => (tag_cloud_metadata), 1633 name: () => (tag_cloud_name), 1634 settings: () => (tag_cloud_settings) 1635 }); 1636 1637 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js 1638 var template_part_namespaceObject = {}; 1639 __webpack_require__.r(template_part_namespaceObject); 1640 __webpack_require__.d(template_part_namespaceObject, { 1641 init: () => (template_part_init), 1642 metadata: () => (template_part_metadata), 1643 name: () => (template_part_name), 1644 settings: () => (template_part_settings) 1645 }); 1646 1647 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js 1648 var build_module_term_description_namespaceObject = {}; 1649 __webpack_require__.r(build_module_term_description_namespaceObject); 1650 __webpack_require__.d(build_module_term_description_namespaceObject, { 1651 init: () => (term_description_init), 1652 metadata: () => (term_description_metadata), 1653 name: () => (term_description_name), 1654 settings: () => (term_description_settings) 1655 }); 1656 1657 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 1658 var text_columns_namespaceObject = {}; 1659 __webpack_require__.r(text_columns_namespaceObject); 1660 __webpack_require__.d(text_columns_namespaceObject, { 1661 init: () => (text_columns_init), 1662 metadata: () => (text_columns_metadata), 1663 name: () => (text_columns_name), 1664 settings: () => (text_columns_settings) 1665 }); 1666 1667 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js 1668 var build_module_verse_namespaceObject = {}; 1669 __webpack_require__.r(build_module_verse_namespaceObject); 1670 __webpack_require__.d(build_module_verse_namespaceObject, { 1671 init: () => (verse_init), 1672 metadata: () => (verse_metadata), 1673 name: () => (verse_name), 1674 settings: () => (verse_settings) 1675 }); 1676 1677 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js 1678 var build_module_video_namespaceObject = {}; 1679 __webpack_require__.r(build_module_video_namespaceObject); 1680 __webpack_require__.d(build_module_video_namespaceObject, { 1681 init: () => (video_init), 1682 metadata: () => (video_metadata), 1683 name: () => (video_name), 1684 settings: () => (video_settings) 1685 }); 1686 1687 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js 1688 var footnotes_namespaceObject = {}; 1689 __webpack_require__.r(footnotes_namespaceObject); 1690 __webpack_require__.d(footnotes_namespaceObject, { 1691 init: () => (footnotes_init), 1692 metadata: () => (footnotes_metadata), 1693 name: () => (footnotes_name), 1694 settings: () => (footnotes_settings) 1695 }); 1696 1697 ;// external ["wp","blocks"] 1698 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; 1699 ;// external ["wp","primitives"] 1700 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 1701 ;// external "ReactJSXRuntime" 1702 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 1703 ;// ./node_modules/@wordpress/icons/build-module/library/archive.js 1704 /** 1705 * WordPress dependencies 1706 */ 1707 1708 1709 const archive = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 1710 viewBox: "0 0 24 24", 1711 xmlns: "http://www.w3.org/2000/svg", 1712 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 1713 fillRule: "evenodd", 1714 clipRule: "evenodd", 1715 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" 1716 }) 1717 }); 1718 /* harmony default export */ const library_archive = (archive); 1719 1720 ;// ./node_modules/@wordpress/block-library/build-module/utils/init-block.js 1721 /** 1722 * WordPress dependencies 1723 */ 1724 1725 1726 /** 1727 * Function to register an individual block. 1728 * 1729 * @param {Object} block The block to be registered. 1730 * 1731 * @return {WPBlockType | undefined} The block, if it has been successfully registered; 1732 * otherwise `undefined`. 1733 */ 1734 function initBlock(block) { 1735 if (!block) { 1736 return; 1737 } 1738 const { 1739 metadata, 1740 settings, 1741 name 1742 } = block; 1743 return (0,external_wp_blocks_namespaceObject.registerBlockType)({ 1744 name, 1745 ...metadata 1746 }, settings); 1747 } 1748 1749 ;// external ["wp","components"] 1750 const external_wp_components_namespaceObject = window["wp"]["components"]; 1751 ;// external ["wp","i18n"] 1752 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 1753 ;// external ["wp","blockEditor"] 1754 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; 1755 ;// external ["wp","serverSideRender"] 1756 const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; 1757 var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); 1758 ;// external ["wp","data"] 1759 const external_wp_data_namespaceObject = window["wp"]["data"]; 1760 ;// external ["wp","element"] 1761 const external_wp_element_namespaceObject = window["wp"]["element"]; 1762 ;// external ["wp","blob"] 1763 const external_wp_blob_namespaceObject = window["wp"]["blob"]; 1764 ;// external ["wp","coreData"] 1765 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; 1766 ;// external ["wp","compose"] 1767 const external_wp_compose_namespaceObject = window["wp"]["compose"]; 1768 ;// ./node_modules/@wordpress/block-library/build-module/utils/hooks.js 1769 /** 1770 * WordPress dependencies 1771 */ 1772 1773 1774 1775 1776 1777 1778 1779 /** 1780 * Returns whether the current user can edit the given entity. 1781 * 1782 * @param {string} kind Entity kind. 1783 * @param {string} name Entity name. 1784 * @param {string} recordId Record's id. 1785 */ 1786 function useCanEditEntity(kind, name, recordId) { 1787 return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('update', { 1788 kind, 1789 name, 1790 id: recordId 1791 }), [kind, name, recordId]); 1792 } 1793 1794 /** 1795 * Handles uploading a media file from a blob URL on mount. 1796 * 1797 * @param {Object} args Upload media arguments. 1798 * @param {string} args.url Blob URL. 1799 * @param {?Array} args.allowedTypes Array of allowed media types. 1800 * @param {Function} args.onChange Function called when the media is uploaded. 1801 * @param {Function} args.onError Function called when an error happens. 1802 */ 1803 function useUploadMediaFromBlobURL(args = {}) { 1804 const latestArgsRef = (0,external_wp_element_namespaceObject.useRef)(args); 1805 const hasUploadStartedRef = (0,external_wp_element_namespaceObject.useRef)(false); 1806 const { 1807 getSettings 1808 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 1809 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { 1810 latestArgsRef.current = args; 1811 }); 1812 (0,external_wp_element_namespaceObject.useEffect)(() => { 1813 // Uploading is a special effect that can't be canceled via the cleanup method. 1814 // The extra check avoids duplicate uploads in development mode (React.StrictMode). 1815 if (hasUploadStartedRef.current) { 1816 return; 1817 } 1818 if (!latestArgsRef.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgsRef.current.url)) { 1819 return; 1820 } 1821 const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgsRef.current.url); 1822 if (!file) { 1823 return; 1824 } 1825 const { 1826 url, 1827 allowedTypes, 1828 onChange, 1829 onError 1830 } = latestArgsRef.current; 1831 const { 1832 mediaUpload 1833 } = getSettings(); 1834 hasUploadStartedRef.current = true; 1835 mediaUpload({ 1836 filesList: [file], 1837 allowedTypes, 1838 onFileChange: ([media]) => { 1839 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) { 1840 return; 1841 } 1842 (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); 1843 onChange(media); 1844 hasUploadStartedRef.current = false; 1845 }, 1846 onError: message => { 1847 (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); 1848 onError(message); 1849 hasUploadStartedRef.current = false; 1850 } 1851 }); 1852 }, [getSettings]); 1853 } 1854 function useToolsPanelDropdownMenuProps() { 1855 const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); 1856 return !isMobile ? { 1857 popoverProps: { 1858 placement: 'left-start', 1859 // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) 1860 offset: 259 1861 } 1862 } : {}; 1863 } 1864 1865 ;// ./node_modules/@wordpress/block-library/build-module/archives/edit.js 1866 /** 1867 * WordPress dependencies 1868 */ 1869 1870 1871 1872 1873 1874 /** 1875 * Internal dependencies 1876 */ 1877 1878 1879 function ArchivesEdit({ 1880 attributes, 1881 setAttributes 1882 }) { 1883 const { 1884 showLabel, 1885 showPostCounts, 1886 displayAsDropdown, 1887 type 1888 } = attributes; 1889 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 1890 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 1891 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 1892 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 1893 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 1894 resetAll: () => { 1895 setAttributes({ 1896 displayAsDropdown: false, 1897 showLabel: false, 1898 showPostCounts: false, 1899 type: 'monthly' 1900 }); 1901 }, 1902 dropdownMenuProps: dropdownMenuProps, 1903 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 1904 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 1905 isShownByDefault: true, 1906 hasValue: () => displayAsDropdown, 1907 onDeselect: () => setAttributes({ 1908 displayAsDropdown: false 1909 }), 1910 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 1911 __nextHasNoMarginBottom: true, 1912 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 1913 checked: displayAsDropdown, 1914 onChange: () => setAttributes({ 1915 displayAsDropdown: !displayAsDropdown 1916 }) 1917 }) 1918 }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 1919 label: (0,external_wp_i18n_namespaceObject.__)('Show label'), 1920 isShownByDefault: true, 1921 hasValue: () => !showLabel, 1922 onDeselect: () => setAttributes({ 1923 showLabel: false 1924 }), 1925 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 1926 __nextHasNoMarginBottom: true, 1927 label: (0,external_wp_i18n_namespaceObject.__)('Show label'), 1928 checked: showLabel, 1929 onChange: () => setAttributes({ 1930 showLabel: !showLabel 1931 }) 1932 }) 1933 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 1934 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 1935 isShownByDefault: true, 1936 hasValue: () => showPostCounts, 1937 onDeselect: () => setAttributes({ 1938 showPostCounts: false 1939 }), 1940 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 1941 __nextHasNoMarginBottom: true, 1942 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 1943 checked: showPostCounts, 1944 onChange: () => setAttributes({ 1945 showPostCounts: !showPostCounts 1946 }) 1947 }) 1948 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 1949 label: (0,external_wp_i18n_namespaceObject.__)('Group by'), 1950 isShownByDefault: true, 1951 hasValue: () => type !== 'monthly', 1952 onDeselect: () => setAttributes({ 1953 type: 'monthly' 1954 }), 1955 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 1956 __next40pxDefaultSize: true, 1957 __nextHasNoMarginBottom: true, 1958 label: (0,external_wp_i18n_namespaceObject.__)('Group by'), 1959 options: [{ 1960 label: (0,external_wp_i18n_namespaceObject.__)('Year'), 1961 value: 'yearly' 1962 }, { 1963 label: (0,external_wp_i18n_namespaceObject.__)('Month'), 1964 value: 'monthly' 1965 }, { 1966 label: (0,external_wp_i18n_namespaceObject.__)('Week'), 1967 value: 'weekly' 1968 }, { 1969 label: (0,external_wp_i18n_namespaceObject.__)('Day'), 1970 value: 'daily' 1971 }], 1972 value: type, 1973 onChange: value => setAttributes({ 1974 type: value 1975 }) 1976 }) 1977 })] 1978 }) 1979 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 1980 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 1981 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 1982 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { 1983 block: "core/archives", 1984 skipBlockSupportAttributes: true, 1985 attributes: attributes 1986 }) 1987 }) 1988 })] 1989 }); 1990 } 1991 1992 ;// ./node_modules/@wordpress/block-library/build-module/archives/index.js 1993 /** 1994 * WordPress dependencies 1995 */ 1996 1997 1998 /** 1999 * Internal dependencies 2000 */ 2001 2002 const metadata = { 2003 $schema: "https://schemas.wp.org/trunk/block.json", 2004 apiVersion: 3, 2005 name: "core/archives", 2006 title: "Archives", 2007 category: "widgets", 2008 description: "Display a date archive of your posts.", 2009 textdomain: "default", 2010 attributes: { 2011 displayAsDropdown: { 2012 type: "boolean", 2013 "default": false 2014 }, 2015 showLabel: { 2016 type: "boolean", 2017 "default": true 2018 }, 2019 showPostCounts: { 2020 type: "boolean", 2021 "default": false 2022 }, 2023 type: { 2024 type: "string", 2025 "default": "monthly" 2026 } 2027 }, 2028 supports: { 2029 align: true, 2030 __experimentalBorder: { 2031 radius: true, 2032 color: true, 2033 width: true, 2034 style: true 2035 }, 2036 html: false, 2037 spacing: { 2038 margin: true, 2039 padding: true, 2040 __experimentalDefaultControls: { 2041 margin: false, 2042 padding: false 2043 } 2044 }, 2045 typography: { 2046 fontSize: true, 2047 lineHeight: true, 2048 __experimentalFontFamily: true, 2049 __experimentalFontWeight: true, 2050 __experimentalFontStyle: true, 2051 __experimentalTextTransform: true, 2052 __experimentalTextDecoration: true, 2053 __experimentalLetterSpacing: true, 2054 __experimentalDefaultControls: { 2055 fontSize: true 2056 } 2057 }, 2058 interactivity: { 2059 clientNavigation: true 2060 } 2061 }, 2062 editorStyle: "wp-block-archives-editor" 2063 }; 2064 2065 const { 2066 name: archives_name 2067 } = metadata; 2068 2069 const settings = { 2070 icon: library_archive, 2071 example: {}, 2072 edit: ArchivesEdit 2073 }; 2074 const init = () => initBlock({ 2075 name: archives_name, 2076 metadata, 2077 settings 2078 }); 2079 2080 ;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js 2081 /** 2082 * WordPress dependencies 2083 */ 2084 2085 2086 const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 2087 xmlns: "http://www.w3.org/2000/svg", 2088 viewBox: "0 0 24 24", 2089 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 2090 fillRule: "evenodd", 2091 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", 2092 clipRule: "evenodd" 2093 }) 2094 }); 2095 /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); 2096 2097 ;// ./node_modules/clsx/dist/clsx.mjs 2098 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); 2099 ;// external ["wp","url"] 2100 const external_wp_url_namespaceObject = window["wp"]["url"]; 2101 ;// ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js 2102 /** 2103 * WordPress dependencies 2104 */ 2105 2106 2107 2108 2109 function getAvatarSizes(sizes) { 2110 const minSize = sizes ? sizes[0] : 24; 2111 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 2112 const maxSizeBuffer = Math.floor(maxSize * 2.5); 2113 return { 2114 minSize, 2115 maxSize: maxSizeBuffer 2116 }; 2117 } 2118 function useDefaultAvatar() { 2119 const { 2120 avatarURL: defaultAvatarUrl 2121 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 2122 const { 2123 getSettings 2124 } = select(external_wp_blockEditor_namespaceObject.store); 2125 const { 2126 __experimentalDiscussionSettings 2127 } = getSettings(); 2128 return __experimentalDiscussionSettings; 2129 }); 2130 return defaultAvatarUrl; 2131 } 2132 function useCommentAvatar({ 2133 commentId 2134 }) { 2135 const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); 2136 const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); 2137 const avatarUrls = avatars ? Object.values(avatars) : null; 2138 const sizes = avatars ? Object.keys(avatars) : null; 2139 const { 2140 minSize, 2141 maxSize 2142 } = getAvatarSizes(sizes); 2143 const defaultAvatar = useDefaultAvatar(); 2144 return { 2145 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 2146 minSize, 2147 maxSize, 2148 alt: authorName ? 2149 // translators: %s: Author name. 2150 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') 2151 }; 2152 } 2153 function useUserAvatar({ 2154 userId, 2155 postId, 2156 postType 2157 }) { 2158 const { 2159 authorDetails 2160 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 2161 const { 2162 getEditedEntityRecord, 2163 getUser 2164 } = select(external_wp_coreData_namespaceObject.store); 2165 if (userId) { 2166 return { 2167 authorDetails: getUser(userId) 2168 }; 2169 } 2170 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 2171 return { 2172 authorDetails: _authorId ? getUser(_authorId) : null 2173 }; 2174 }, [postType, postId, userId]); 2175 const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; 2176 const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; 2177 const { 2178 minSize, 2179 maxSize 2180 } = getAvatarSizes(sizes); 2181 const defaultAvatar = useDefaultAvatar(); 2182 return { 2183 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 2184 minSize, 2185 maxSize, 2186 alt: authorDetails ? 2187 // translators: %s: Author name. 2188 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails?.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') 2189 }; 2190 } 2191 2192 ;// ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js 2193 /* wp:polyfill */ 2194 /** 2195 * WordPress dependencies 2196 */ 2197 2198 2199 2200 2201 2202 2203 const AUTHORS_QUERY = { 2204 who: 'authors', 2205 per_page: -1, 2206 _fields: 'id,name', 2207 context: 'view' 2208 }; 2209 function UserControl({ 2210 value, 2211 onChange 2212 }) { 2213 const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)(); 2214 const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { 2215 const { 2216 getUsers 2217 } = select(external_wp_coreData_namespaceObject.store); 2218 return getUsers(AUTHORS_QUERY); 2219 }, []); 2220 if (!authorsList) { 2221 return null; 2222 } 2223 const options = authorsList.map(author => { 2224 return { 2225 label: author.name, 2226 value: author.id 2227 }; 2228 }); 2229 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { 2230 __next40pxDefaultSize: true, 2231 __nextHasNoMarginBottom: true, 2232 label: (0,external_wp_i18n_namespaceObject.__)('User'), 2233 help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'), 2234 value: value, 2235 onChange: onChange, 2236 options: filteredAuthorsList || options, 2237 onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase()))) 2238 }); 2239 } 2240 /* harmony default export */ const user_control = (UserControl); 2241 2242 ;// ./node_modules/@wordpress/block-library/build-module/avatar/edit.js 2243 /** 2244 * External dependencies 2245 */ 2246 2247 2248 /** 2249 * WordPress dependencies 2250 */ 2251 2252 2253 2254 2255 2256 /** 2257 * Internal dependencies 2258 */ 2259 2260 2261 2262 const AvatarInspectorControls = ({ 2263 setAttributes, 2264 avatar, 2265 attributes, 2266 selectUser 2267 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 2268 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 2269 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 2270 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 2271 __nextHasNoMarginBottom: true, 2272 __next40pxDefaultSize: true, 2273 label: (0,external_wp_i18n_namespaceObject.__)('Image size'), 2274 onChange: newSize => setAttributes({ 2275 size: newSize 2276 }), 2277 min: avatar.minSize, 2278 max: avatar.maxSize, 2279 initialPosition: attributes?.size, 2280 value: attributes?.size 2281 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 2282 __nextHasNoMarginBottom: true, 2283 label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'), 2284 onChange: () => setAttributes({ 2285 isLink: !attributes.isLink 2286 }), 2287 checked: attributes.isLink 2288 }), attributes.isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 2289 __nextHasNoMarginBottom: true, 2290 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 2291 onChange: value => setAttributes({ 2292 linkTarget: value ? '_blank' : '_self' 2293 }), 2294 checked: attributes.linkTarget === '_blank' 2295 }), selectUser && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(user_control, { 2296 value: attributes?.userId, 2297 onChange: value => { 2298 setAttributes({ 2299 userId: value 2300 }); 2301 } 2302 })] 2303 }) 2304 }); 2305 const ResizableAvatar = ({ 2306 setAttributes, 2307 attributes, 2308 avatar, 2309 blockProps, 2310 isSelected 2311 }) => { 2312 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 2313 const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar?.src, ['s']), { 2314 s: attributes?.size * 2 2315 }); 2316 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 2317 ...blockProps, 2318 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 2319 size: { 2320 width: attributes.size, 2321 height: attributes.size 2322 }, 2323 showHandle: isSelected, 2324 onResizeStop: (event, direction, elt, delta) => { 2325 setAttributes({ 2326 size: parseInt(attributes.size + (delta.height || delta.width), 10) 2327 }); 2328 }, 2329 lockAspectRatio: true, 2330 enable: { 2331 top: false, 2332 right: !(0,external_wp_i18n_namespaceObject.isRTL)(), 2333 bottom: true, 2334 left: (0,external_wp_i18n_namespaceObject.isRTL)() 2335 }, 2336 minWidth: avatar.minSize, 2337 maxWidth: avatar.maxSize, 2338 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 2339 src: doubledSizedSrc, 2340 alt: avatar.alt, 2341 className: dist_clsx('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className), 2342 style: borderProps.style 2343 }) 2344 }) 2345 }); 2346 }; 2347 const CommentEdit = ({ 2348 attributes, 2349 context, 2350 setAttributes, 2351 isSelected 2352 }) => { 2353 const { 2354 commentId 2355 } = context; 2356 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 2357 const avatar = useCommentAvatar({ 2358 commentId 2359 }); 2360 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 2361 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { 2362 avatar: avatar, 2363 setAttributes: setAttributes, 2364 attributes: attributes, 2365 selectUser: false 2366 }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 2367 href: "#avatar-pseudo-link", 2368 className: "wp-block-avatar__link", 2369 onClick: event => event.preventDefault(), 2370 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { 2371 attributes: attributes, 2372 avatar: avatar, 2373 blockProps: blockProps, 2374 isSelected: isSelected, 2375 setAttributes: setAttributes 2376 }) 2377 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { 2378 attributes: attributes, 2379 avatar: avatar, 2380 blockProps: blockProps, 2381 isSelected: isSelected, 2382 setAttributes: setAttributes 2383 })] 2384 }); 2385 }; 2386 const UserEdit = ({ 2387 attributes, 2388 context, 2389 setAttributes, 2390 isSelected 2391 }) => { 2392 const { 2393 postId, 2394 postType 2395 } = context; 2396 const avatar = useUserAvatar({ 2397 userId: attributes?.userId, 2398 postId, 2399 postType 2400 }); 2401 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 2402 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 2403 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { 2404 selectUser: true, 2405 attributes: attributes, 2406 avatar: avatar, 2407 setAttributes: setAttributes 2408 }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 2409 href: "#avatar-pseudo-link", 2410 className: "wp-block-avatar__link", 2411 onClick: event => event.preventDefault(), 2412 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { 2413 attributes: attributes, 2414 avatar: avatar, 2415 blockProps: blockProps, 2416 isSelected: isSelected, 2417 setAttributes: setAttributes 2418 }) 2419 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { 2420 attributes: attributes, 2421 avatar: avatar, 2422 blockProps: blockProps, 2423 isSelected: isSelected, 2424 setAttributes: setAttributes 2425 })] 2426 }); 2427 }; 2428 function Edit(props) { 2429 // 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`). 2430 if (props?.context?.commentId || props?.context?.commentId === null) { 2431 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentEdit, { 2432 ...props 2433 }); 2434 } 2435 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UserEdit, { 2436 ...props 2437 }); 2438 } 2439 2440 ;// ./node_modules/@wordpress/block-library/build-module/avatar/index.js 2441 /** 2442 * WordPress dependencies 2443 */ 2444 2445 2446 /** 2447 * Internal dependencies 2448 */ 2449 2450 const avatar_metadata = { 2451 $schema: "https://schemas.wp.org/trunk/block.json", 2452 apiVersion: 3, 2453 name: "core/avatar", 2454 title: "Avatar", 2455 category: "theme", 2456 description: "Add a user\u2019s avatar.", 2457 textdomain: "default", 2458 attributes: { 2459 userId: { 2460 type: "number" 2461 }, 2462 size: { 2463 type: "number", 2464 "default": 96 2465 }, 2466 isLink: { 2467 type: "boolean", 2468 "default": false 2469 }, 2470 linkTarget: { 2471 type: "string", 2472 "default": "_self" 2473 } 2474 }, 2475 usesContext: ["postType", "postId", "commentId"], 2476 supports: { 2477 html: false, 2478 align: true, 2479 alignWide: false, 2480 spacing: { 2481 margin: true, 2482 padding: true, 2483 __experimentalDefaultControls: { 2484 margin: false, 2485 padding: false 2486 } 2487 }, 2488 __experimentalBorder: { 2489 __experimentalSkipSerialization: true, 2490 radius: true, 2491 width: true, 2492 color: true, 2493 style: true, 2494 __experimentalDefaultControls: { 2495 radius: true 2496 } 2497 }, 2498 color: { 2499 text: false, 2500 background: false, 2501 __experimentalDuotone: "img" 2502 }, 2503 interactivity: { 2504 clientNavigation: true 2505 } 2506 }, 2507 selectors: { 2508 border: ".wp-block-avatar img" 2509 }, 2510 editorStyle: "wp-block-avatar-editor", 2511 style: "wp-block-avatar" 2512 }; 2513 2514 const { 2515 name: avatar_name 2516 } = avatar_metadata; 2517 2518 const avatar_settings = { 2519 icon: comment_author_avatar, 2520 edit: Edit, 2521 example: {} 2522 }; 2523 const avatar_init = () => initBlock({ 2524 name: avatar_name, 2525 metadata: avatar_metadata, 2526 settings: avatar_settings 2527 }); 2528 2529 ;// ./node_modules/@wordpress/icons/build-module/library/audio.js 2530 /** 2531 * WordPress dependencies 2532 */ 2533 2534 2535 const audio = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 2536 viewBox: "0 0 24 24", 2537 xmlns: "http://www.w3.org/2000/svg", 2538 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 2539 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" 2540 }) 2541 }); 2542 /* harmony default export */ const library_audio = (audio); 2543 2544 ;// ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js 2545 /** 2546 * WordPress dependencies 2547 */ 2548 2549 2550 /* harmony default export */ const deprecated = ([{ 2551 attributes: { 2552 src: { 2553 type: 'string', 2554 source: 'attribute', 2555 selector: 'audio', 2556 attribute: 'src' 2557 }, 2558 caption: { 2559 type: 'string', 2560 source: 'html', 2561 selector: 'figcaption' 2562 }, 2563 id: { 2564 type: 'number' 2565 }, 2566 autoplay: { 2567 type: 'boolean', 2568 source: 'attribute', 2569 selector: 'audio', 2570 attribute: 'autoplay' 2571 }, 2572 loop: { 2573 type: 'boolean', 2574 source: 'attribute', 2575 selector: 'audio', 2576 attribute: 'loop' 2577 }, 2578 preload: { 2579 type: 'string', 2580 source: 'attribute', 2581 selector: 'audio', 2582 attribute: 'preload' 2583 } 2584 }, 2585 supports: { 2586 align: true 2587 }, 2588 save({ 2589 attributes 2590 }) { 2591 const { 2592 autoplay, 2593 caption, 2594 loop, 2595 preload, 2596 src 2597 } = attributes; 2598 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 2599 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { 2600 controls: "controls", 2601 src: src, 2602 autoPlay: autoplay, 2603 loop: loop, 2604 preload: preload 2605 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 2606 tagName: "figcaption", 2607 value: caption 2608 })] 2609 }); 2610 } 2611 }]); 2612 2613 ;// external ["wp","notices"] 2614 const external_wp_notices_namespaceObject = window["wp"]["notices"]; 2615 ;// ./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 ;// ./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 ;// external ["wp","privateApis"] 2807 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 2808 ;// ./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 acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library'); 2817 2818 ;// ./node_modules/@wordpress/block-library/build-module/embed/util.js 2819 /* wp:polyfill */ 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 role: "content" 2848 }, 2849 caption: { 2850 type: "rich-text", 2851 source: "rich-text", 2852 selector: "figcaption", 2853 role: "content" 2854 }, 2855 type: { 2856 type: "string", 2857 role: "content" 2858 }, 2859 providerNameSlug: { 2860 type: "string", 2861 role: "content" 2862 }, 2863 allowResponsive: { 2864 type: "boolean", 2865 "default": true 2866 }, 2867 responsive: { 2868 type: "boolean", 2869 "default": false, 2870 role: "content" 2871 }, 2872 previewable: { 2873 type: "boolean", 2874 "default": true, 2875 role: "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 2893 const { 2894 name: DEFAULT_EMBED_BLOCK 2895 } = util_metadata; 2896 const { 2897 kebabCase 2898 } = unlock(external_wp_components_namespaceObject.privateApis); 2899 2900 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 2901 2902 /** 2903 * Returns the embed block's information by matching the provided service provider 2904 * 2905 * @param {string} provider The embed block's provider 2906 * @return {WPBlockVariation} The embed block's information 2907 */ 2908 const getEmbedInfoByProvider = provider => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2909 name 2910 }) => name === provider); 2911 2912 /** 2913 * Returns true if any of the regular expressions match the URL. 2914 * 2915 * @param {string} url The URL to test. 2916 * @param {Array} patterns The list of regular expressions to test against. 2917 * @return {boolean} True if any of the regular expressions match the URL. 2918 */ 2919 const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern)); 2920 2921 /** 2922 * Finds the block variation that should be used for the URL, 2923 * based on the provided URL and the variation's patterns. 2924 * 2925 * @param {string} url The URL to test. 2926 * @return {WPBlockVariation} The block variation that should be used for this URL 2927 */ 2928 const findMoreSuitableBlock = url => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2929 patterns 2930 }) => matchesPatterns(url, patterns)); 2931 const isFromWordPress = html => html && html.includes('class="wp-embedded-content"'); 2932 const getPhotoHtml = photo => { 2933 // If full image url not found use thumbnail. 2934 const imageUrl = photo.url || photo.thumbnail_url; 2935 2936 // 100% width for the preview so it fits nicely into the document, some "thumbnails" are 2937 // actually the full size photo. 2938 const photoPreview = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 2939 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 2940 src: imageUrl, 2941 alt: photo.title, 2942 width: "100%" 2943 }) 2944 }); 2945 return (0,external_wp_element_namespaceObject.renderToString)(photoPreview); 2946 }; 2947 2948 /** 2949 * Creates a more suitable embed block based on the passed in props 2950 * and attributes generated from an embed block's preview. 2951 * 2952 * We require `attributesFromPreview` to be generated from the latest attributes 2953 * and preview, and because of the way the react lifecycle operates, we can't 2954 * guarantee that the attributes contained in the block's props are the latest 2955 * versions, so we require that these are generated separately. 2956 * See `getAttributesFromPreview` in the generated embed edit component. 2957 * 2958 * @param {Object} props The block's props. 2959 * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. 2960 * @return {Object|undefined} A more suitable embed block if one exists. 2961 */ 2962 const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { 2963 const { 2964 preview, 2965 attributes = {} 2966 } = props; 2967 const { 2968 url, 2969 providerNameSlug, 2970 type, 2971 ...restAttributes 2972 } = attributes; 2973 if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) { 2974 return; 2975 } 2976 const matchedBlock = findMoreSuitableBlock(url); 2977 2978 // WordPress blocks can work on multiple sites, and so don't have patterns, 2979 // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. 2980 const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; 2981 // If current block is not WordPress and a more suitable block found 2982 // that is different from the current one, create the new matched block. 2983 const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 2984 if (shouldCreateNewBlock) { 2985 return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { 2986 url, 2987 ...restAttributes, 2988 ...matchedBlock.attributes 2989 }); 2990 } 2991 const wpVariation = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ 2992 name 2993 }) => name === 'wordpress'); 2994 2995 // We can't match the URL for WordPress embeds, we have to check the HTML instead. 2996 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 2997 return; 2998 } 2999 3000 // This is not the WordPress embed block so transform it into one. 3001 return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { 3002 url, 3003 ...wpVariation.attributes, 3004 // By now we have the preview, but when the new block first renders, it 3005 // won't have had all the attributes set, and so won't get the correct 3006 // type and it won't render correctly. So, we pass through the current attributes 3007 // here so that the initial render works when we switch to the WordPress 3008 // block. This only affects the WordPress block because it can't be 3009 // rendered in the usual Sandbox (it has a sandbox of its own) and it 3010 // relies on the preview to set the correct render type. 3011 ...attributesFromPreview 3012 }); 3013 }; 3014 3015 /** 3016 * Determine if the block already has an aspect ratio class applied. 3017 * 3018 * @param {string} existingClassNames Existing block classes. 3019 * @return {boolean} True or false if the classnames contain an aspect ratio class. 3020 */ 3021 const hasAspectRatioClass = existingClassNames => { 3022 if (!existingClassNames) { 3023 return false; 3024 } 3025 return ASPECT_RATIOS.some(({ 3026 className 3027 }) => existingClassNames.includes(className)); 3028 }; 3029 3030 /** 3031 * Removes all previously set aspect ratio related classes and return the rest 3032 * existing class names. 3033 * 3034 * @param {string} existingClassNames Any existing class names. 3035 * @return {string} The class names without any aspect ratio related class. 3036 */ 3037 const removeAspectRatioClasses = existingClassNames => { 3038 if (!existingClassNames) { 3039 // Avoids extraneous work and also, by returning the same value as 3040 // received, ensures the post is not dirtied by a change of the block 3041 // attribute from `undefined` to an empty string. 3042 return existingClassNames; 3043 } 3044 const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, { 3045 className 3046 }) => { 3047 accumulator.push(className); 3048 return accumulator; 3049 }, ['wp-has-aspect-ratio']); 3050 let outputClassNames = existingClassNames; 3051 for (const className of aspectRatioClassNames) { 3052 outputClassNames = outputClassNames.replace(className, ''); 3053 } 3054 return outputClassNames.trim(); 3055 }; 3056 3057 /** 3058 * Returns class names with any relevant responsive aspect ratio names. 3059 * 3060 * @param {string} html The preview HTML that possibly contains an iframe with width and height set. 3061 * @param {string} existingClassNames Any existing class names. 3062 * @param {boolean} allowResponsive If the responsive class names should be added, or removed. 3063 * @return {string} Deduped class names. 3064 */ 3065 function getClassNames(html, existingClassNames, allowResponsive = true) { 3066 if (!allowResponsive) { 3067 return removeAspectRatioClasses(existingClassNames); 3068 } 3069 const previewDocument = document.implementation.createHTMLDocument(''); 3070 previewDocument.body.innerHTML = html; 3071 const iframe = previewDocument.body.querySelector('iframe'); 3072 3073 // If we have a fixed aspect iframe, and it's a responsive embed block. 3074 if (iframe && iframe.height && iframe.width) { 3075 const aspectRatio = (iframe.width / iframe.height).toFixed(2); 3076 // Given the actual aspect ratio, find the widest ratio to support it. 3077 for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 3078 const potentialRatio = ASPECT_RATIOS[ratioIndex]; 3079 if (aspectRatio >= potentialRatio.ratio) { 3080 // Evaluate the difference between actual aspect ratio and closest match. 3081 // If the difference is too big, do not scale the embed according to aspect ratio. 3082 const ratioDiff = aspectRatio - potentialRatio.ratio; 3083 if (ratioDiff > 0.1) { 3084 // No close aspect ratio match found. 3085 return removeAspectRatioClasses(existingClassNames); 3086 } 3087 // Close aspect ratio match found. 3088 return dist_clsx(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); 3089 } 3090 } 3091 } 3092 return existingClassNames; 3093 } 3094 3095 /** 3096 * Fallback behaviour for unembeddable URLs. 3097 * Creates a paragraph block containing a link to the URL, and calls `onReplace`. 3098 * 3099 * @param {string} url The URL that could not be embedded. 3100 * @param {Function} onReplace Function to call with the created fallback block. 3101 */ 3102 function fallback(url, onReplace) { 3103 const link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 3104 href: url, 3105 children: url 3106 }); 3107 onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 3108 content: (0,external_wp_element_namespaceObject.renderToString)(link) 3109 })); 3110 } 3111 3112 /*** 3113 * Gets block attributes based on the preview and responsive state. 3114 * 3115 * @param {Object} preview The preview data. 3116 * @param {string} title The block's title, e.g. Twitter. 3117 * @param {Object} currentClassNames The block's current class names. 3118 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3119 * @param {boolean} allowResponsive Apply responsive classes to fixed size content. 3120 * @return {Object} Attributes and values. 3121 */ 3122 const getAttributesFromPreview = memize((preview, title, currentClassNames, isResponsive, allowResponsive = true) => { 3123 if (!preview) { 3124 return {}; 3125 } 3126 const attributes = {}; 3127 // Some plugins only return HTML with no type info, so default this to 'rich'. 3128 let { 3129 type = 'rich' 3130 } = preview; 3131 // If we got a provider name from the API, use it for the slug, otherwise we use the title, 3132 // because not all embed code gives us a provider name. 3133 const { 3134 html, 3135 provider_name: providerName 3136 } = preview; 3137 const providerNameSlug = kebabCase((providerName || title).toLowerCase()); 3138 if (isFromWordPress(html)) { 3139 type = WP_EMBED_TYPE; 3140 } 3141 if (html || 'photo' === type) { 3142 attributes.type = type; 3143 attributes.providerNameSlug = providerNameSlug; 3144 } 3145 3146 // Aspect ratio classes are removed when the embed URL is updated. 3147 // If the embed already has an aspect ratio class, that means the URL has not changed. 3148 // Which also means no need to regenerate it with getClassNames. 3149 if (hasAspectRatioClass(currentClassNames)) { 3150 return attributes; 3151 } 3152 attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); 3153 return attributes; 3154 }); 3155 3156 /** 3157 * Returns the attributes derived from the preview, merged with the current attributes. 3158 * 3159 * @param {Object} currentAttributes The current attributes of the block. 3160 * @param {Object} preview The preview data. 3161 * @param {string} title The block's title, e.g. Twitter. 3162 * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. 3163 * @return {Object} Merged attributes. 3164 */ 3165 const getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { 3166 const { 3167 allowResponsive, 3168 className 3169 } = currentAttributes; 3170 return { 3171 ...currentAttributes, 3172 ...getAttributesFromPreview(preview, title, className, isResponsive, allowResponsive) 3173 }; 3174 }; 3175 3176 ;// ./node_modules/@wordpress/icons/build-module/library/caption.js 3177 /** 3178 * WordPress dependencies 3179 */ 3180 3181 3182 const caption = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 3183 viewBox: "0 0 24 24", 3184 xmlns: "http://www.w3.org/2000/svg", 3185 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 3186 fillRule: "evenodd", 3187 clipRule: "evenodd", 3188 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" 3189 }) 3190 }); 3191 /* harmony default export */ const library_caption = (caption); 3192 3193 ;// ./node_modules/@wordpress/block-library/build-module/utils/caption.js 3194 /** 3195 * External dependencies 3196 */ 3197 3198 3199 /** 3200 * WordPress dependencies 3201 */ 3202 3203 3204 3205 3206 3207 3208 3209 3210 /** 3211 * Internal dependencies 3212 */ 3213 3214 3215 function Caption({ 3216 attributeKey = 'caption', 3217 attributes, 3218 setAttributes, 3219 isSelected, 3220 insertBlocksAfter, 3221 placeholder = (0,external_wp_i18n_namespaceObject.__)('Add caption'), 3222 label = (0,external_wp_i18n_namespaceObject.__)('Caption text'), 3223 showToolbarButton = true, 3224 excludeElementClassName, 3225 className, 3226 readOnly, 3227 tagName = 'figcaption', 3228 addLabel = (0,external_wp_i18n_namespaceObject.__)('Add caption'), 3229 removeLabel = (0,external_wp_i18n_namespaceObject.__)('Remove caption'), 3230 icon = library_caption, 3231 ...props 3232 }) { 3233 const caption = attributes[attributeKey]; 3234 const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption); 3235 const { 3236 PrivateRichText: RichText 3237 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 3238 const isCaptionEmpty = RichText.isEmpty(caption); 3239 const isPrevCaptionEmpty = RichText.isEmpty(prevCaption); 3240 const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!isCaptionEmpty); 3241 3242 // We need to show the caption when changes come from 3243 // history navigation(undo/redo). 3244 (0,external_wp_element_namespaceObject.useEffect)(() => { 3245 if (!isCaptionEmpty && isPrevCaptionEmpty) { 3246 setShowCaption(true); 3247 } 3248 }, [isCaptionEmpty, isPrevCaptionEmpty]); 3249 (0,external_wp_element_namespaceObject.useEffect)(() => { 3250 if (!isSelected && isCaptionEmpty) { 3251 setShowCaption(false); 3252 } 3253 }, [isSelected, isCaptionEmpty]); 3254 3255 // Focus the caption when we click to add one. 3256 const ref = (0,external_wp_element_namespaceObject.useCallback)(node => { 3257 if (node && isCaptionEmpty) { 3258 node.focus(); 3259 } 3260 }, [isCaptionEmpty]); 3261 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 3262 children: [showToolbarButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 3263 group: "block", 3264 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 3265 onClick: () => { 3266 setShowCaption(!showCaption); 3267 if (showCaption && caption) { 3268 setAttributes({ 3269 [attributeKey]: undefined 3270 }); 3271 } 3272 }, 3273 icon: icon, 3274 isPressed: showCaption, 3275 label: showCaption ? removeLabel : addLabel 3276 }) 3277 }), showCaption && (!RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RichText, { 3278 identifier: attributeKey, 3279 tagName: tagName, 3280 className: dist_clsx(className, excludeElementClassName ? '' : (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 3281 ref: ref, 3282 "aria-label": label, 3283 placeholder: placeholder, 3284 value: caption, 3285 onChange: value => setAttributes({ 3286 [attributeKey]: value 3287 }), 3288 inlineToolbar: true, 3289 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 3290 readOnly: readOnly, 3291 ...props 3292 })] 3293 }); 3294 } 3295 3296 ;// ./node_modules/@wordpress/block-library/build-module/audio/edit.js 3297 /** 3298 * External dependencies 3299 */ 3300 3301 3302 /** 3303 * WordPress dependencies 3304 */ 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 /** 3315 * Internal dependencies 3316 */ 3317 3318 3319 3320 3321 const ALLOWED_MEDIA_TYPES = ['audio']; 3322 function AudioEdit({ 3323 attributes, 3324 className, 3325 setAttributes, 3326 onReplace, 3327 isSelected: isSingleSelected, 3328 insertBlocksAfter 3329 }) { 3330 const { 3331 id, 3332 autoplay, 3333 loop, 3334 preload, 3335 src 3336 } = attributes; 3337 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); 3338 useUploadMediaFromBlobURL({ 3339 url: temporaryURL, 3340 allowedTypes: ALLOWED_MEDIA_TYPES, 3341 onChange: onSelectAudio, 3342 onError: onUploadError 3343 }); 3344 function toggleAttribute(attribute) { 3345 return newValue => { 3346 setAttributes({ 3347 [attribute]: newValue 3348 }); 3349 }; 3350 } 3351 function onSelectURL(newSrc) { 3352 // Set the block's src from the edit component's state, and switch off 3353 // the editing UI. 3354 if (newSrc !== src) { 3355 // Check if there's an embed block that handles this URL. 3356 const embedBlock = createUpgradedEmbedBlock({ 3357 attributes: { 3358 url: newSrc 3359 } 3360 }); 3361 if (undefined !== embedBlock && onReplace) { 3362 onReplace(embedBlock); 3363 return; 3364 } 3365 setAttributes({ 3366 src: newSrc, 3367 id: undefined, 3368 blob: undefined 3369 }); 3370 setTemporaryURL(); 3371 } 3372 } 3373 const { 3374 createErrorNotice 3375 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 3376 function onUploadError(message) { 3377 createErrorNotice(message, { 3378 type: 'snackbar' 3379 }); 3380 } 3381 function getAutoplayHelp(checked) { 3382 return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null; 3383 } 3384 function onSelectAudio(media) { 3385 if (!media || !media.url) { 3386 // In this case there was an error and we should continue in the editing state 3387 // previous attributes should be removed because they may be temporary blob urls. 3388 setAttributes({ 3389 src: undefined, 3390 id: undefined, 3391 caption: undefined, 3392 blob: undefined 3393 }); 3394 setTemporaryURL(); 3395 return; 3396 } 3397 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 3398 setTemporaryURL(media.url); 3399 return; 3400 } 3401 3402 // Sets the block's attribute and updates the edit component from the 3403 // selected media, then switches off the editing UI. 3404 setAttributes({ 3405 blob: undefined, 3406 src: media.url, 3407 id: media.id, 3408 caption: media.caption 3409 }); 3410 setTemporaryURL(); 3411 } 3412 const classes = dist_clsx(className, { 3413 'is-transient': !!temporaryURL 3414 }); 3415 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 3416 className: classes 3417 }); 3418 if (!src && !temporaryURL) { 3419 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 3420 ...blockProps, 3421 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 3422 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 3423 icon: library_audio 3424 }), 3425 onSelect: onSelectAudio, 3426 onSelectURL: onSelectURL, 3427 accept: "audio/*", 3428 allowedTypes: ALLOWED_MEDIA_TYPES, 3429 value: attributes, 3430 onError: onUploadError 3431 }) 3432 }); 3433 } 3434 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 3435 children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 3436 group: "other", 3437 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 3438 mediaId: id, 3439 mediaURL: src, 3440 allowedTypes: ALLOWED_MEDIA_TYPES, 3441 accept: "audio/*", 3442 onSelect: onSelectAudio, 3443 onSelectURL: onSelectURL, 3444 onError: onUploadError, 3445 onReset: () => onSelectAudio(undefined) 3446 }) 3447 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 3448 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 3449 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 3450 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 3451 __nextHasNoMarginBottom: true, 3452 label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), 3453 onChange: toggleAttribute('autoplay'), 3454 checked: autoplay, 3455 help: getAutoplayHelp 3456 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 3457 __nextHasNoMarginBottom: true, 3458 label: (0,external_wp_i18n_namespaceObject.__)('Loop'), 3459 onChange: toggleAttribute('loop'), 3460 checked: loop 3461 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 3462 __next40pxDefaultSize: true, 3463 __nextHasNoMarginBottom: true, 3464 label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), 3465 value: preload || '' 3466 // `undefined` is required for the preload attribute to be unset. 3467 , 3468 onChange: value => setAttributes({ 3469 preload: value || undefined 3470 }), 3471 options: [{ 3472 value: '', 3473 label: (0,external_wp_i18n_namespaceObject.__)('Browser default') 3474 }, { 3475 value: 'auto', 3476 label: (0,external_wp_i18n_namespaceObject.__)('Auto') 3477 }, { 3478 value: 'metadata', 3479 label: (0,external_wp_i18n_namespaceObject.__)('Metadata') 3480 }, { 3481 value: 'none', 3482 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') 3483 }] 3484 })] 3485 }) 3486 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 3487 ...blockProps, 3488 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 3489 isDisabled: !isSingleSelected, 3490 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { 3491 controls: "controls", 3492 src: src !== null && src !== void 0 ? src : temporaryURL 3493 }) 3494 }), !!temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 3495 attributes: attributes, 3496 setAttributes: setAttributes, 3497 isSelected: isSingleSelected, 3498 insertBlocksAfter: insertBlocksAfter, 3499 label: (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), 3500 showToolbarButton: isSingleSelected 3501 })] 3502 })] 3503 }); 3504 } 3505 /* harmony default export */ const edit = (AudioEdit); 3506 3507 ;// ./node_modules/@wordpress/block-library/build-module/audio/save.js 3508 /** 3509 * WordPress dependencies 3510 */ 3511 3512 3513 function save({ 3514 attributes 3515 }) { 3516 const { 3517 autoplay, 3518 caption, 3519 loop, 3520 preload, 3521 src 3522 } = attributes; 3523 return src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 3524 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 3525 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { 3526 controls: "controls", 3527 src: src, 3528 autoPlay: autoplay, 3529 loop: loop, 3530 preload: preload 3531 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 3532 tagName: "figcaption", 3533 value: caption, 3534 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') 3535 })] 3536 }); 3537 } 3538 3539 ;// ./node_modules/@wordpress/block-library/build-module/audio/transforms.js 3540 /** 3541 * WordPress dependencies 3542 */ 3543 3544 3545 const transforms = { 3546 from: [{ 3547 type: 'files', 3548 isMatch(files) { 3549 return files.length === 1 && files[0].type.indexOf('audio/') === 0; 3550 }, 3551 transform(files) { 3552 const file = files[0]; 3553 // We don't need to upload the media directly here 3554 // It's already done as part of the `componentDidMount` 3555 // in the audio block. 3556 const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { 3557 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 3558 }); 3559 return block; 3560 } 3561 }, { 3562 type: 'shortcode', 3563 tag: 'audio', 3564 attributes: { 3565 src: { 3566 type: 'string', 3567 shortcode: ({ 3568 named: { 3569 src, 3570 mp3, 3571 m4a, 3572 ogg, 3573 wav, 3574 wma 3575 } 3576 }) => { 3577 return src || mp3 || m4a || ogg || wav || wma; 3578 } 3579 }, 3580 loop: { 3581 type: 'string', 3582 shortcode: ({ 3583 named: { 3584 loop 3585 } 3586 }) => { 3587 return loop; 3588 } 3589 }, 3590 autoplay: { 3591 type: 'string', 3592 shortcode: ({ 3593 named: { 3594 autoplay 3595 } 3596 }) => { 3597 return autoplay; 3598 } 3599 }, 3600 preload: { 3601 type: 'string', 3602 shortcode: ({ 3603 named: { 3604 preload 3605 } 3606 }) => { 3607 return preload; 3608 } 3609 } 3610 } 3611 }] 3612 }; 3613 /* harmony default export */ const audio_transforms = (transforms); 3614 3615 ;// ./node_modules/@wordpress/block-library/build-module/audio/index.js 3616 /** 3617 * WordPress dependencies 3618 */ 3619 3620 3621 /** 3622 * Internal dependencies 3623 */ 3624 3625 3626 3627 const audio_metadata = { 3628 $schema: "https://schemas.wp.org/trunk/block.json", 3629 apiVersion: 3, 3630 name: "core/audio", 3631 title: "Audio", 3632 category: "media", 3633 description: "Embed a simple audio player.", 3634 keywords: ["music", "sound", "podcast", "recording"], 3635 textdomain: "default", 3636 attributes: { 3637 blob: { 3638 type: "string", 3639 role: "local" 3640 }, 3641 src: { 3642 type: "string", 3643 source: "attribute", 3644 selector: "audio", 3645 attribute: "src", 3646 role: "content" 3647 }, 3648 caption: { 3649 type: "rich-text", 3650 source: "rich-text", 3651 selector: "figcaption", 3652 role: "content" 3653 }, 3654 id: { 3655 type: "number", 3656 role: "content" 3657 }, 3658 autoplay: { 3659 type: "boolean", 3660 source: "attribute", 3661 selector: "audio", 3662 attribute: "autoplay" 3663 }, 3664 loop: { 3665 type: "boolean", 3666 source: "attribute", 3667 selector: "audio", 3668 attribute: "loop" 3669 }, 3670 preload: { 3671 type: "string", 3672 source: "attribute", 3673 selector: "audio", 3674 attribute: "preload" 3675 } 3676 }, 3677 supports: { 3678 anchor: true, 3679 align: true, 3680 spacing: { 3681 margin: true, 3682 padding: true, 3683 __experimentalDefaultControls: { 3684 margin: false, 3685 padding: false 3686 } 3687 }, 3688 interactivity: { 3689 clientNavigation: true 3690 } 3691 }, 3692 editorStyle: "wp-block-audio-editor", 3693 style: "wp-block-audio" 3694 }; 3695 3696 3697 const { 3698 name: audio_name 3699 } = audio_metadata; 3700 3701 const audio_settings = { 3702 icon: library_audio, 3703 example: { 3704 attributes: { 3705 src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg' 3706 }, 3707 viewportWidth: 350 3708 }, 3709 transforms: audio_transforms, 3710 deprecated: deprecated, 3711 edit: edit, 3712 save: save 3713 }; 3714 const audio_init = () => initBlock({ 3715 name: audio_name, 3716 metadata: audio_metadata, 3717 settings: audio_settings 3718 }); 3719 3720 ;// ./node_modules/@wordpress/icons/build-module/library/button.js 3721 /** 3722 * WordPress dependencies 3723 */ 3724 3725 3726 const button_button = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 3727 viewBox: "0 0 24 24", 3728 xmlns: "http://www.w3.org/2000/svg", 3729 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 3730 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" 3731 }) 3732 }); 3733 /* harmony default export */ const library_button = (button_button); 3734 3735 ;// ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js 3736 /** 3737 * WordPress dependencies 3738 */ 3739 3740 3741 /** 3742 * Internal dependencies 3743 */ 3744 3745 const { 3746 cleanEmptyObject 3747 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 3748 3749 /** 3750 * Migrates the current style.typography.fontFamily attribute, 3751 * whose value was "var:preset|font-family|helvetica-arial", 3752 * to the style.fontFamily attribute, whose value will be "helvetica-arial". 3753 * 3754 * @param {Object} attributes The current attributes 3755 * @return {Object} The updated attributes. 3756 */ 3757 /* harmony default export */ function migrate_font_family(attributes) { 3758 if (!attributes?.style?.typography?.fontFamily) { 3759 return attributes; 3760 } 3761 const { 3762 fontFamily, 3763 ...typography 3764 } = attributes.style.typography; 3765 return { 3766 ...attributes, 3767 style: cleanEmptyObject({ 3768 ...attributes.style, 3769 typography 3770 }), 3771 fontFamily: fontFamily.split('|').pop() 3772 }; 3773 } 3774 3775 ;// ./node_modules/@wordpress/block-library/build-module/button/deprecated.js 3776 /* wp:polyfill */ 3777 /** 3778 * External dependencies 3779 */ 3780 3781 3782 /** 3783 * WordPress dependencies 3784 */ 3785 3786 3787 3788 /** 3789 * Internal dependencies 3790 */ 3791 3792 3793 const migrateBorderRadius = attributes => { 3794 const { 3795 borderRadius, 3796 ...newAttributes 3797 } = attributes; 3798 // We have to check old property `borderRadius` and if 3799 // `styles.border.radius` is a `number` 3800 const oldBorderRadius = [borderRadius, newAttributes.style?.border?.radius].find(possibleBorderRadius => { 3801 return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0; 3802 }); 3803 if (!oldBorderRadius) { 3804 return newAttributes; 3805 } 3806 return { 3807 ...newAttributes, 3808 style: { 3809 ...newAttributes.style, 3810 border: { 3811 ...newAttributes.style?.border, 3812 radius: `$oldBorderRadius}px` 3813 } 3814 } 3815 }; 3816 }; 3817 function migrateAlign(attributes) { 3818 if (!attributes.align) { 3819 return attributes; 3820 } 3821 const { 3822 align, 3823 ...otherAttributes 3824 } = attributes; 3825 return { 3826 ...otherAttributes, 3827 className: dist_clsx(otherAttributes.className, `align$attributes.align}`) 3828 }; 3829 } 3830 const migrateCustomColorsAndGradients = attributes => { 3831 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) { 3832 return attributes; 3833 } 3834 const style = { 3835 color: {} 3836 }; 3837 if (attributes.customTextColor) { 3838 style.color.text = attributes.customTextColor; 3839 } 3840 if (attributes.customBackgroundColor) { 3841 style.color.background = attributes.customBackgroundColor; 3842 } 3843 if (attributes.customGradient) { 3844 style.color.gradient = attributes.customGradient; 3845 } 3846 const { 3847 customTextColor, 3848 customBackgroundColor, 3849 customGradient, 3850 ...restAttributes 3851 } = attributes; 3852 return { 3853 ...restAttributes, 3854 style 3855 }; 3856 }; 3857 const oldColorsMigration = attributes => { 3858 const { 3859 color, 3860 textColor, 3861 ...restAttributes 3862 } = { 3863 ...attributes, 3864 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 3865 customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined 3866 }; 3867 return migrateCustomColorsAndGradients(restAttributes); 3868 }; 3869 const blockAttributes = { 3870 url: { 3871 type: 'string', 3872 source: 'attribute', 3873 selector: 'a', 3874 attribute: 'href' 3875 }, 3876 title: { 3877 type: 'string', 3878 source: 'attribute', 3879 selector: 'a', 3880 attribute: 'title' 3881 }, 3882 text: { 3883 type: 'string', 3884 source: 'html', 3885 selector: 'a' 3886 } 3887 }; 3888 const v12 = { 3889 attributes: { 3890 tagName: { 3891 type: 'string', 3892 enum: ['a', 'button'], 3893 default: 'a' 3894 }, 3895 type: { 3896 type: 'string', 3897 default: 'button' 3898 }, 3899 textAlign: { 3900 type: 'string' 3901 }, 3902 url: { 3903 type: 'string', 3904 source: 'attribute', 3905 selector: 'a', 3906 attribute: 'href' 3907 }, 3908 title: { 3909 type: 'string', 3910 source: 'attribute', 3911 selector: 'a,button', 3912 attribute: 'title', 3913 role: 'content' 3914 }, 3915 text: { 3916 type: 'rich-text', 3917 source: 'rich-text', 3918 selector: 'a,button', 3919 role: 'content' 3920 }, 3921 linkTarget: { 3922 type: 'string', 3923 source: 'attribute', 3924 selector: 'a', 3925 attribute: 'target', 3926 role: 'content' 3927 }, 3928 rel: { 3929 type: 'string', 3930 source: 'attribute', 3931 selector: 'a', 3932 attribute: 'rel', 3933 role: 'content' 3934 }, 3935 placeholder: { 3936 type: 'string' 3937 }, 3938 backgroundColor: { 3939 type: 'string' 3940 }, 3941 textColor: { 3942 type: 'string' 3943 }, 3944 gradient: { 3945 type: 'string' 3946 }, 3947 width: { 3948 type: 'number' 3949 } 3950 }, 3951 supports: { 3952 anchor: true, 3953 align: true, 3954 alignWide: false, 3955 color: { 3956 __experimentalSkipSerialization: true, 3957 gradients: true, 3958 __experimentalDefaultControls: { 3959 background: true, 3960 text: true 3961 } 3962 }, 3963 typography: { 3964 fontSize: true, 3965 lineHeight: true, 3966 __experimentalFontFamily: true, 3967 __experimentalFontWeight: true, 3968 __experimentalFontStyle: true, 3969 __experimentalTextTransform: true, 3970 __experimentalTextDecoration: true, 3971 __experimentalLetterSpacing: true, 3972 __experimentalWritingMode: true, 3973 __experimentalDefaultControls: { 3974 fontSize: true 3975 } 3976 }, 3977 reusable: false, 3978 shadow: { 3979 __experimentalSkipSerialization: true 3980 }, 3981 spacing: { 3982 __experimentalSkipSerialization: true, 3983 padding: ['horizontal', 'vertical'], 3984 __experimentalDefaultControls: { 3985 padding: true 3986 } 3987 }, 3988 __experimentalBorder: { 3989 color: true, 3990 radius: true, 3991 style: true, 3992 width: true, 3993 __experimentalSkipSerialization: true, 3994 __experimentalDefaultControls: { 3995 color: true, 3996 radius: true, 3997 style: true, 3998 width: true 3999 } 4000 }, 4001 __experimentalSelector: '.wp-block-button__link', 4002 interactivity: { 4003 clientNavigation: true 4004 } 4005 }, 4006 save({ 4007 attributes, 4008 className 4009 }) { 4010 const { 4011 tagName, 4012 type, 4013 textAlign, 4014 fontSize, 4015 linkTarget, 4016 rel, 4017 style, 4018 text, 4019 title, 4020 url, 4021 width 4022 } = attributes; 4023 const TagName = tagName || 'a'; 4024 const isButtonTag = 'button' === TagName; 4025 const buttonType = type || 'button'; 4026 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 4027 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4028 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 4029 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 4030 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { 4031 [`has-text-align-$textAlign}`]: textAlign, 4032 // For backwards compatibility add style that isn't provided via 4033 // block support. 4034 'no-border-radius': style?.border?.radius === 0 4035 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); 4036 const buttonStyle = { 4037 ...borderProps.style, 4038 ...colorProps.style, 4039 ...spacingProps.style, 4040 ...shadowProps.style 4041 }; 4042 4043 // The use of a `title` attribute here is soft-deprecated, but still applied 4044 // if it had already been assigned, for the sake of backward-compatibility. 4045 // A title will no longer be assigned for new or updated button block links. 4046 4047 const wrapperClasses = dist_clsx(className, { 4048 [`has-custom-width wp-block-button__width-$width}`]: width, 4049 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4050 }); 4051 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4052 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4053 className: wrapperClasses 4054 }), 4055 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4056 tagName: TagName, 4057 type: isButtonTag ? buttonType : null, 4058 className: buttonClasses, 4059 href: isButtonTag ? null : url, 4060 title: title, 4061 style: buttonStyle, 4062 value: text, 4063 target: isButtonTag ? null : linkTarget, 4064 rel: isButtonTag ? null : rel 4065 }) 4066 }); 4067 } 4068 }; 4069 const v11 = { 4070 attributes: { 4071 url: { 4072 type: 'string', 4073 source: 'attribute', 4074 selector: 'a', 4075 attribute: 'href' 4076 }, 4077 title: { 4078 type: 'string', 4079 source: 'attribute', 4080 selector: 'a', 4081 attribute: 'title' 4082 }, 4083 text: { 4084 type: 'string', 4085 source: 'html', 4086 selector: 'a' 4087 }, 4088 linkTarget: { 4089 type: 'string', 4090 source: 'attribute', 4091 selector: 'a', 4092 attribute: 'target' 4093 }, 4094 rel: { 4095 type: 'string', 4096 source: 'attribute', 4097 selector: 'a', 4098 attribute: 'rel' 4099 }, 4100 placeholder: { 4101 type: 'string' 4102 }, 4103 backgroundColor: { 4104 type: 'string' 4105 }, 4106 textColor: { 4107 type: 'string' 4108 }, 4109 gradient: { 4110 type: 'string' 4111 }, 4112 width: { 4113 type: 'number' 4114 } 4115 }, 4116 supports: { 4117 anchor: true, 4118 align: true, 4119 alignWide: false, 4120 color: { 4121 __experimentalSkipSerialization: true, 4122 gradients: true, 4123 __experimentalDefaultControls: { 4124 background: true, 4125 text: true 4126 } 4127 }, 4128 typography: { 4129 fontSize: true, 4130 __experimentalFontFamily: true, 4131 __experimentalDefaultControls: { 4132 fontSize: true 4133 } 4134 }, 4135 reusable: false, 4136 spacing: { 4137 __experimentalSkipSerialization: true, 4138 padding: ['horizontal', 'vertical'], 4139 __experimentalDefaultControls: { 4140 padding: true 4141 } 4142 }, 4143 __experimentalBorder: { 4144 radius: true, 4145 __experimentalSkipSerialization: true, 4146 __experimentalDefaultControls: { 4147 radius: true 4148 } 4149 }, 4150 __experimentalSelector: '.wp-block-button__link' 4151 }, 4152 save({ 4153 attributes, 4154 className 4155 }) { 4156 const { 4157 fontSize, 4158 linkTarget, 4159 rel, 4160 style, 4161 text, 4162 title, 4163 url, 4164 width 4165 } = attributes; 4166 if (!text) { 4167 return null; 4168 } 4169 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 4170 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4171 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 4172 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { 4173 // For backwards compatibility add style that isn't provided via 4174 // block support. 4175 'no-border-radius': style?.border?.radius === 0 4176 }); 4177 const buttonStyle = { 4178 ...borderProps.style, 4179 ...colorProps.style, 4180 ...spacingProps.style 4181 }; 4182 4183 // The use of a `title` attribute here is soft-deprecated, but still applied 4184 // if it had already been assigned, for the sake of backward-compatibility. 4185 // A title will no longer be assigned for new or updated button block links. 4186 4187 const wrapperClasses = dist_clsx(className, { 4188 [`has-custom-width wp-block-button__width-$width}`]: width, 4189 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4190 }); 4191 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4192 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4193 className: wrapperClasses 4194 }), 4195 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4196 tagName: "a", 4197 className: buttonClasses, 4198 href: url, 4199 title: title, 4200 style: buttonStyle, 4201 value: text, 4202 target: linkTarget, 4203 rel: rel 4204 }) 4205 }); 4206 } 4207 }; 4208 const v10 = { 4209 attributes: { 4210 url: { 4211 type: 'string', 4212 source: 'attribute', 4213 selector: 'a', 4214 attribute: 'href' 4215 }, 4216 title: { 4217 type: 'string', 4218 source: 'attribute', 4219 selector: 'a', 4220 attribute: 'title' 4221 }, 4222 text: { 4223 type: 'string', 4224 source: 'html', 4225 selector: 'a' 4226 }, 4227 linkTarget: { 4228 type: 'string', 4229 source: 'attribute', 4230 selector: 'a', 4231 attribute: 'target' 4232 }, 4233 rel: { 4234 type: 'string', 4235 source: 'attribute', 4236 selector: 'a', 4237 attribute: 'rel' 4238 }, 4239 placeholder: { 4240 type: 'string' 4241 }, 4242 backgroundColor: { 4243 type: 'string' 4244 }, 4245 textColor: { 4246 type: 'string' 4247 }, 4248 gradient: { 4249 type: 'string' 4250 }, 4251 width: { 4252 type: 'number' 4253 } 4254 }, 4255 supports: { 4256 anchor: true, 4257 align: true, 4258 alignWide: false, 4259 color: { 4260 __experimentalSkipSerialization: true, 4261 gradients: true 4262 }, 4263 typography: { 4264 fontSize: true, 4265 __experimentalFontFamily: true 4266 }, 4267 reusable: false, 4268 spacing: { 4269 __experimentalSkipSerialization: true, 4270 padding: ['horizontal', 'vertical'], 4271 __experimentalDefaultControls: { 4272 padding: true 4273 } 4274 }, 4275 __experimentalBorder: { 4276 radius: true, 4277 __experimentalSkipSerialization: true 4278 }, 4279 __experimentalSelector: '.wp-block-button__link' 4280 }, 4281 save({ 4282 attributes, 4283 className 4284 }) { 4285 const { 4286 fontSize, 4287 linkTarget, 4288 rel, 4289 style, 4290 text, 4291 title, 4292 url, 4293 width 4294 } = attributes; 4295 if (!text) { 4296 return null; 4297 } 4298 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 4299 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4300 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 4301 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { 4302 // For backwards compatibility add style that isn't provided via 4303 // block support. 4304 'no-border-radius': style?.border?.radius === 0 4305 }); 4306 const buttonStyle = { 4307 ...borderProps.style, 4308 ...colorProps.style, 4309 ...spacingProps.style 4310 }; 4311 4312 // The use of a `title` attribute here is soft-deprecated, but still applied 4313 // if it had already been assigned, for the sake of backward-compatibility. 4314 // A title will no longer be assigned for new or updated button block links. 4315 4316 const wrapperClasses = dist_clsx(className, { 4317 [`has-custom-width wp-block-button__width-$width}`]: width, 4318 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4319 }); 4320 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4321 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4322 className: wrapperClasses 4323 }), 4324 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4325 tagName: "a", 4326 className: buttonClasses, 4327 href: url, 4328 title: title, 4329 style: buttonStyle, 4330 value: text, 4331 target: linkTarget, 4332 rel: rel 4333 }) 4334 }); 4335 }, 4336 migrate: migrate_font_family, 4337 isEligible({ 4338 style 4339 }) { 4340 return style?.typography?.fontFamily; 4341 } 4342 }; 4343 const deprecated_deprecated = [v12, v11, v10, { 4344 supports: { 4345 anchor: true, 4346 align: true, 4347 alignWide: false, 4348 color: { 4349 __experimentalSkipSerialization: true, 4350 gradients: true 4351 }, 4352 typography: { 4353 fontSize: true, 4354 __experimentalFontFamily: true 4355 }, 4356 reusable: false, 4357 __experimentalSelector: '.wp-block-button__link' 4358 }, 4359 attributes: { 4360 ...blockAttributes, 4361 linkTarget: { 4362 type: 'string', 4363 source: 'attribute', 4364 selector: 'a', 4365 attribute: 'target' 4366 }, 4367 rel: { 4368 type: 'string', 4369 source: 'attribute', 4370 selector: 'a', 4371 attribute: 'rel' 4372 }, 4373 placeholder: { 4374 type: 'string' 4375 }, 4376 backgroundColor: { 4377 type: 'string' 4378 }, 4379 textColor: { 4380 type: 'string' 4381 }, 4382 gradient: { 4383 type: 'string' 4384 }, 4385 width: { 4386 type: 'number' 4387 } 4388 }, 4389 isEligible({ 4390 style 4391 }) { 4392 return typeof style?.border?.radius === 'number'; 4393 }, 4394 save({ 4395 attributes, 4396 className 4397 }) { 4398 const { 4399 fontSize, 4400 linkTarget, 4401 rel, 4402 style, 4403 text, 4404 title, 4405 url, 4406 width 4407 } = attributes; 4408 if (!text) { 4409 return null; 4410 } 4411 const borderRadius = style?.border?.radius; 4412 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4413 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 4414 'no-border-radius': style?.border?.radius === 0 4415 }); 4416 const buttonStyle = { 4417 borderRadius: borderRadius ? borderRadius : undefined, 4418 ...colorProps.style 4419 }; 4420 4421 // The use of a `title` attribute here is soft-deprecated, but still applied 4422 // if it had already been assigned, for the sake of backward-compatibility. 4423 // A title will no longer be assigned for new or updated button block links. 4424 4425 const wrapperClasses = dist_clsx(className, { 4426 [`has-custom-width wp-block-button__width-$width}`]: width, 4427 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 4428 }); 4429 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4430 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4431 className: wrapperClasses 4432 }), 4433 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4434 tagName: "a", 4435 className: buttonClasses, 4436 href: url, 4437 title: title, 4438 style: buttonStyle, 4439 value: text, 4440 target: linkTarget, 4441 rel: rel 4442 }) 4443 }); 4444 }, 4445 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4446 }, { 4447 supports: { 4448 anchor: true, 4449 align: true, 4450 alignWide: false, 4451 color: { 4452 __experimentalSkipSerialization: true 4453 }, 4454 reusable: false, 4455 __experimentalSelector: '.wp-block-button__link' 4456 }, 4457 attributes: { 4458 ...blockAttributes, 4459 linkTarget: { 4460 type: 'string', 4461 source: 'attribute', 4462 selector: 'a', 4463 attribute: 'target' 4464 }, 4465 rel: { 4466 type: 'string', 4467 source: 'attribute', 4468 selector: 'a', 4469 attribute: 'rel' 4470 }, 4471 placeholder: { 4472 type: 'string' 4473 }, 4474 borderRadius: { 4475 type: 'number' 4476 }, 4477 backgroundColor: { 4478 type: 'string' 4479 }, 4480 textColor: { 4481 type: 'string' 4482 }, 4483 gradient: { 4484 type: 'string' 4485 }, 4486 style: { 4487 type: 'object' 4488 }, 4489 width: { 4490 type: 'number' 4491 } 4492 }, 4493 save({ 4494 attributes, 4495 className 4496 }) { 4497 const { 4498 borderRadius, 4499 linkTarget, 4500 rel, 4501 text, 4502 title, 4503 url, 4504 width 4505 } = attributes; 4506 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4507 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 4508 'no-border-radius': borderRadius === 0 4509 }); 4510 const buttonStyle = { 4511 borderRadius: borderRadius ? borderRadius + 'px' : undefined, 4512 ...colorProps.style 4513 }; 4514 4515 // The use of a `title` attribute here is soft-deprecated, but still applied 4516 // if it had already been assigned, for the sake of backward-compatibility. 4517 // A title will no longer be assigned for new or updated button block links. 4518 4519 const wrapperClasses = dist_clsx(className, { 4520 [`has-custom-width wp-block-button__width-$width}`]: width 4521 }); 4522 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4523 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4524 className: wrapperClasses 4525 }), 4526 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4527 tagName: "a", 4528 className: buttonClasses, 4529 href: url, 4530 title: title, 4531 style: buttonStyle, 4532 value: text, 4533 target: linkTarget, 4534 rel: rel 4535 }) 4536 }); 4537 }, 4538 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4539 }, { 4540 supports: { 4541 anchor: true, 4542 align: true, 4543 alignWide: false, 4544 color: { 4545 __experimentalSkipSerialization: true 4546 }, 4547 reusable: false, 4548 __experimentalSelector: '.wp-block-button__link' 4549 }, 4550 attributes: { 4551 ...blockAttributes, 4552 linkTarget: { 4553 type: 'string', 4554 source: 'attribute', 4555 selector: 'a', 4556 attribute: 'target' 4557 }, 4558 rel: { 4559 type: 'string', 4560 source: 'attribute', 4561 selector: 'a', 4562 attribute: 'rel' 4563 }, 4564 placeholder: { 4565 type: 'string' 4566 }, 4567 borderRadius: { 4568 type: 'number' 4569 }, 4570 backgroundColor: { 4571 type: 'string' 4572 }, 4573 textColor: { 4574 type: 'string' 4575 }, 4576 gradient: { 4577 type: 'string' 4578 }, 4579 style: { 4580 type: 'object' 4581 }, 4582 width: { 4583 type: 'number' 4584 } 4585 }, 4586 save({ 4587 attributes, 4588 className 4589 }) { 4590 const { 4591 borderRadius, 4592 linkTarget, 4593 rel, 4594 text, 4595 title, 4596 url, 4597 width 4598 } = attributes; 4599 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 4600 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 4601 'no-border-radius': borderRadius === 0 4602 }); 4603 const buttonStyle = { 4604 borderRadius: borderRadius ? borderRadius + 'px' : undefined, 4605 ...colorProps.style 4606 }; 4607 4608 // The use of a `title` attribute here is soft-deprecated, but still applied 4609 // if it had already been assigned, for the sake of backward-compatibility. 4610 // A title will no longer be assigned for new or updated button block links. 4611 4612 const wrapperClasses = dist_clsx(className, { 4613 [`has-custom-width wp-block-button__width-$width}`]: width 4614 }); 4615 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4616 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 4617 className: wrapperClasses 4618 }), 4619 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4620 tagName: "a", 4621 className: buttonClasses, 4622 href: url, 4623 title: title, 4624 style: buttonStyle, 4625 value: text, 4626 target: linkTarget, 4627 rel: rel 4628 }) 4629 }); 4630 }, 4631 migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) 4632 }, { 4633 supports: { 4634 align: true, 4635 alignWide: false, 4636 color: { 4637 gradients: true 4638 } 4639 }, 4640 attributes: { 4641 ...blockAttributes, 4642 linkTarget: { 4643 type: 'string', 4644 source: 'attribute', 4645 selector: 'a', 4646 attribute: 'target' 4647 }, 4648 rel: { 4649 type: 'string', 4650 source: 'attribute', 4651 selector: 'a', 4652 attribute: 'rel' 4653 }, 4654 placeholder: { 4655 type: 'string' 4656 }, 4657 borderRadius: { 4658 type: 'number' 4659 }, 4660 backgroundColor: { 4661 type: 'string' 4662 }, 4663 textColor: { 4664 type: 'string' 4665 }, 4666 gradient: { 4667 type: 'string' 4668 }, 4669 style: { 4670 type: 'object' 4671 } 4672 }, 4673 save({ 4674 attributes 4675 }) { 4676 const { 4677 borderRadius, 4678 linkTarget, 4679 rel, 4680 text, 4681 title, 4682 url 4683 } = attributes; 4684 const buttonClasses = dist_clsx('wp-block-button__link', { 4685 'no-border-radius': borderRadius === 0 4686 }); 4687 const buttonStyle = { 4688 borderRadius: borderRadius ? borderRadius + 'px' : undefined 4689 }; 4690 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4691 tagName: "a", 4692 className: buttonClasses, 4693 href: url, 4694 title: title, 4695 style: buttonStyle, 4696 value: text, 4697 target: linkTarget, 4698 rel: rel 4699 }); 4700 }, 4701 migrate: migrateBorderRadius 4702 }, { 4703 supports: { 4704 align: true, 4705 alignWide: false 4706 }, 4707 attributes: { 4708 ...blockAttributes, 4709 linkTarget: { 4710 type: 'string', 4711 source: 'attribute', 4712 selector: 'a', 4713 attribute: 'target' 4714 }, 4715 rel: { 4716 type: 'string', 4717 source: 'attribute', 4718 selector: 'a', 4719 attribute: 'rel' 4720 }, 4721 placeholder: { 4722 type: 'string' 4723 }, 4724 borderRadius: { 4725 type: 'number' 4726 }, 4727 backgroundColor: { 4728 type: 'string' 4729 }, 4730 textColor: { 4731 type: 'string' 4732 }, 4733 customBackgroundColor: { 4734 type: 'string' 4735 }, 4736 customTextColor: { 4737 type: 'string' 4738 }, 4739 customGradient: { 4740 type: 'string' 4741 }, 4742 gradient: { 4743 type: 'string' 4744 } 4745 }, 4746 isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align, 4747 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients, migrateAlign), 4748 save({ 4749 attributes 4750 }) { 4751 const { 4752 backgroundColor, 4753 borderRadius, 4754 customBackgroundColor, 4755 customTextColor, 4756 customGradient, 4757 linkTarget, 4758 gradient, 4759 rel, 4760 text, 4761 textColor, 4762 title, 4763 url 4764 } = attributes; 4765 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4766 const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4767 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 4768 const buttonClasses = dist_clsx('wp-block-button__link', { 4769 'has-text-color': textColor || customTextColor, 4770 [textClass]: textClass, 4771 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient, 4772 [backgroundClass]: backgroundClass, 4773 'no-border-radius': borderRadius === 0, 4774 [gradientClass]: gradientClass 4775 }); 4776 const buttonStyle = { 4777 background: customGradient ? customGradient : undefined, 4778 backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor, 4779 color: textClass ? undefined : customTextColor, 4780 borderRadius: borderRadius ? borderRadius + 'px' : undefined 4781 }; 4782 4783 // The use of a `title` attribute here is soft-deprecated, but still applied 4784 // if it had already been assigned, for the sake of backward-compatibility. 4785 // A title will no longer be assigned for new or updated button block links. 4786 4787 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4788 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4789 tagName: "a", 4790 className: buttonClasses, 4791 href: url, 4792 title: title, 4793 style: buttonStyle, 4794 value: text, 4795 target: linkTarget, 4796 rel: rel 4797 }) 4798 }); 4799 } 4800 }, { 4801 attributes: { 4802 ...blockAttributes, 4803 align: { 4804 type: 'string', 4805 default: 'none' 4806 }, 4807 backgroundColor: { 4808 type: 'string' 4809 }, 4810 textColor: { 4811 type: 'string' 4812 }, 4813 customBackgroundColor: { 4814 type: 'string' 4815 }, 4816 customTextColor: { 4817 type: 'string' 4818 }, 4819 linkTarget: { 4820 type: 'string', 4821 source: 'attribute', 4822 selector: 'a', 4823 attribute: 'target' 4824 }, 4825 rel: { 4826 type: 'string', 4827 source: 'attribute', 4828 selector: 'a', 4829 attribute: 'rel' 4830 }, 4831 placeholder: { 4832 type: 'string' 4833 } 4834 }, 4835 isEligible(attribute) { 4836 return attribute.className && attribute.className.includes('is-style-squared'); 4837 }, 4838 migrate(attributes) { 4839 let newClassName = attributes.className; 4840 if (newClassName) { 4841 newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim(); 4842 } 4843 return migrateBorderRadius(migrateCustomColorsAndGradients({ 4844 ...attributes, 4845 className: newClassName ? newClassName : undefined, 4846 borderRadius: 0 4847 })); 4848 }, 4849 save({ 4850 attributes 4851 }) { 4852 const { 4853 backgroundColor, 4854 customBackgroundColor, 4855 customTextColor, 4856 linkTarget, 4857 rel, 4858 text, 4859 textColor, 4860 title, 4861 url 4862 } = attributes; 4863 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4864 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4865 const buttonClasses = dist_clsx('wp-block-button__link', { 4866 'has-text-color': textColor || customTextColor, 4867 [textClass]: textClass, 4868 'has-background': backgroundColor || customBackgroundColor, 4869 [backgroundClass]: backgroundClass 4870 }); 4871 const buttonStyle = { 4872 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 4873 color: textClass ? undefined : customTextColor 4874 }; 4875 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4876 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4877 tagName: "a", 4878 className: buttonClasses, 4879 href: url, 4880 title: title, 4881 style: buttonStyle, 4882 value: text, 4883 target: linkTarget, 4884 rel: rel 4885 }) 4886 }); 4887 } 4888 }, { 4889 attributes: { 4890 ...blockAttributes, 4891 align: { 4892 type: 'string', 4893 default: 'none' 4894 }, 4895 backgroundColor: { 4896 type: 'string' 4897 }, 4898 textColor: { 4899 type: 'string' 4900 }, 4901 customBackgroundColor: { 4902 type: 'string' 4903 }, 4904 customTextColor: { 4905 type: 'string' 4906 } 4907 }, 4908 migrate: oldColorsMigration, 4909 save({ 4910 attributes 4911 }) { 4912 const { 4913 url, 4914 text, 4915 title, 4916 backgroundColor, 4917 textColor, 4918 customBackgroundColor, 4919 customTextColor 4920 } = attributes; 4921 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 4922 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 4923 const buttonClasses = dist_clsx('wp-block-button__link', { 4924 'has-text-color': textColor || customTextColor, 4925 [textClass]: textClass, 4926 'has-background': backgroundColor || customBackgroundColor, 4927 [backgroundClass]: backgroundClass 4928 }); 4929 const buttonStyle = { 4930 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 4931 color: textClass ? undefined : customTextColor 4932 }; 4933 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4934 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4935 tagName: "a", 4936 className: buttonClasses, 4937 href: url, 4938 title: title, 4939 style: buttonStyle, 4940 value: text 4941 }) 4942 }); 4943 } 4944 }, { 4945 attributes: { 4946 ...blockAttributes, 4947 color: { 4948 type: 'string' 4949 }, 4950 textColor: { 4951 type: 'string' 4952 }, 4953 align: { 4954 type: 'string', 4955 default: 'none' 4956 } 4957 }, 4958 save({ 4959 attributes 4960 }) { 4961 const { 4962 url, 4963 text, 4964 title, 4965 align, 4966 color, 4967 textColor 4968 } = attributes; 4969 const buttonStyle = { 4970 backgroundColor: color, 4971 color: textColor 4972 }; 4973 const linkClass = 'wp-block-button__link'; 4974 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 4975 className: `align$align}`, 4976 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 4977 tagName: "a", 4978 className: linkClass, 4979 href: url, 4980 title: title, 4981 style: buttonStyle, 4982 value: text 4983 }) 4984 }); 4985 }, 4986 migrate: oldColorsMigration 4987 }, { 4988 attributes: { 4989 ...blockAttributes, 4990 color: { 4991 type: 'string' 4992 }, 4993 textColor: { 4994 type: 'string' 4995 }, 4996 align: { 4997 type: 'string', 4998 default: 'none' 4999 } 5000 }, 5001 save({ 5002 attributes 5003 }) { 5004 const { 5005 url, 5006 text, 5007 title, 5008 align, 5009 color, 5010 textColor 5011 } = attributes; 5012 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 5013 className: `align$align}`, 5014 style: { 5015 backgroundColor: color 5016 }, 5017 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 5018 tagName: "a", 5019 href: url, 5020 title: title, 5021 style: { 5022 color: textColor 5023 }, 5024 value: text 5025 }) 5026 }); 5027 }, 5028 migrate: oldColorsMigration 5029 }]; 5030 /* harmony default export */ const button_deprecated = (deprecated_deprecated); 5031 5032 ;// ./node_modules/@wordpress/block-library/build-module/button/constants.js 5033 const NEW_TAB_REL = 'noreferrer noopener'; 5034 const NEW_TAB_TARGET = '_blank'; 5035 const NOFOLLOW_REL = 'nofollow'; 5036 5037 ;// ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js 5038 /** 5039 * Internal dependencies 5040 */ 5041 5042 5043 /** 5044 * WordPress dependencies 5045 */ 5046 5047 5048 /** 5049 * Updates the link attributes. 5050 * 5051 * @param {Object} attributes The current block attributes. 5052 * @param {string} attributes.rel The current link rel attribute. 5053 * @param {string} attributes.url The current link url. 5054 * @param {boolean} attributes.opensInNewTab Whether the link should open in a new window. 5055 * @param {boolean} attributes.nofollow Whether the link should be marked as nofollow. 5056 */ 5057 function getUpdatedLinkAttributes({ 5058 rel = '', 5059 url = '', 5060 opensInNewTab, 5061 nofollow 5062 }) { 5063 let newLinkTarget; 5064 // Since `rel` is editable attribute, we need to check for existing values and proceed accordingly. 5065 let updatedRel = rel; 5066 if (opensInNewTab) { 5067 newLinkTarget = NEW_TAB_TARGET; 5068 updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` $NEW_TAB_REL}`; 5069 } else { 5070 const relRegex = new RegExp(`\\b$NEW_TAB_REL}\\s*`, 'g'); 5071 updatedRel = updatedRel?.replace(relRegex, '').trim(); 5072 } 5073 if (nofollow) { 5074 updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` $NOFOLLOW_REL}`).trim(); 5075 } else { 5076 const relRegex = new RegExp(`\\b$NOFOLLOW_REL}\\s*`, 'g'); 5077 updatedRel = updatedRel?.replace(relRegex, '').trim(); 5078 } 5079 return { 5080 url: (0,external_wp_url_namespaceObject.prependHTTP)(url), 5081 linkTarget: newLinkTarget, 5082 rel: updatedRel || undefined 5083 }; 5084 } 5085 5086 ;// ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js 5087 /** 5088 * Removes anchor tags from a string. 5089 * 5090 * @param {string} value The value to remove anchor tags from. 5091 * 5092 * @return {string} The value with anchor tags removed. 5093 */ 5094 function removeAnchorTag(value) { 5095 // To do: Refactor this to use rich text's removeFormat instead. 5096 return value.toString().replace(/<\/?a[^>]*>/g, ''); 5097 } 5098 5099 ;// external ["wp","keycodes"] 5100 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; 5101 ;// ./node_modules/@wordpress/icons/build-module/library/link.js 5102 /** 5103 * WordPress dependencies 5104 */ 5105 5106 5107 const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 5108 xmlns: "http://www.w3.org/2000/svg", 5109 viewBox: "0 0 24 24", 5110 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 5111 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" 5112 }) 5113 }); 5114 /* harmony default export */ const library_link = (link_link); 5115 5116 ;// ./node_modules/@wordpress/icons/build-module/library/link-off.js 5117 /** 5118 * WordPress dependencies 5119 */ 5120 5121 5122 const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 5123 xmlns: "http://www.w3.org/2000/svg", 5124 viewBox: "0 0 24 24", 5125 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 5126 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" 5127 }) 5128 }); 5129 /* harmony default export */ const link_off = (linkOff); 5130 5131 ;// ./node_modules/@wordpress/block-library/build-module/button/edit.js 5132 /** 5133 * External dependencies 5134 */ 5135 5136 5137 /** 5138 * Internal dependencies 5139 */ 5140 5141 5142 5143 5144 5145 /** 5146 * WordPress dependencies 5147 */ 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS, { 5159 id: 'nofollow', 5160 title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') 5161 }]; 5162 function useEnter(props) { 5163 const { 5164 replaceBlocks, 5165 selectionChange 5166 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 5167 const { 5168 getBlock, 5169 getBlockRootClientId, 5170 getBlockIndex 5171 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 5172 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 5173 propsRef.current = props; 5174 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 5175 function onKeyDown(event) { 5176 if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 5177 return; 5178 } 5179 const { 5180 content, 5181 clientId 5182 } = propsRef.current; 5183 if (content.length) { 5184 return; 5185 } 5186 event.preventDefault(); 5187 const topParentListBlock = getBlock(getBlockRootClientId(clientId)); 5188 const blockIndex = getBlockIndex(clientId); 5189 const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ 5190 ...topParentListBlock, 5191 innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) 5192 }); 5193 const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); 5194 const after = topParentListBlock.innerBlocks.slice(blockIndex + 1); 5195 const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ 5196 ...topParentListBlock, 5197 innerBlocks: after 5198 })] : []; 5199 replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); 5200 // We manually change the selection here because we are replacing 5201 // a different block than the selected one. 5202 selectionChange(middle.clientId); 5203 } 5204 element.addEventListener('keydown', onKeyDown); 5205 return () => { 5206 element.removeEventListener('keydown', onKeyDown); 5207 }; 5208 }, []); 5209 } 5210 function WidthPanel({ 5211 selectedWidth, 5212 setAttributes 5213 }) { 5214 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 5215 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 5216 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 5217 resetAll: () => setAttributes({ 5218 width: undefined 5219 }), 5220 dropdownMenuProps: dropdownMenuProps, 5221 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 5222 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 5223 isShownByDefault: true, 5224 hasValue: () => !!selectedWidth, 5225 onDeselect: () => setAttributes({ 5226 width: undefined 5227 }), 5228 __nextHasNoMarginBottom: true, 5229 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 5230 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 5231 value: selectedWidth, 5232 onChange: newWidth => setAttributes({ 5233 width: newWidth 5234 }), 5235 isBlock: true, 5236 __next40pxDefaultSize: true, 5237 __nextHasNoMarginBottom: true, 5238 children: [25, 50, 75, 100].map(widthValue => { 5239 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 5240 value: widthValue, 5241 label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ 5242 (0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue) 5243 }, widthValue); 5244 }) 5245 }) 5246 }) 5247 }); 5248 } 5249 function ButtonEdit(props) { 5250 const { 5251 attributes, 5252 setAttributes, 5253 className, 5254 isSelected, 5255 onReplace, 5256 mergeBlocks, 5257 clientId, 5258 context 5259 } = props; 5260 const { 5261 tagName, 5262 textAlign, 5263 linkTarget, 5264 placeholder, 5265 rel, 5266 style, 5267 text, 5268 url, 5269 width, 5270 metadata 5271 } = attributes; 5272 const TagName = tagName || 'a'; 5273 function onKeyDown(event) { 5274 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { 5275 startEditing(event); 5276 } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) { 5277 unlink(); 5278 richTextRef.current?.focus(); 5279 } 5280 } 5281 5282 // Use internal state instead of a ref to make sure that the component 5283 // re-renders when the popover's anchor updates. 5284 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 5285 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 5286 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 5287 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 5288 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 5289 const ref = (0,external_wp_element_namespaceObject.useRef)(); 5290 const richTextRef = (0,external_wp_element_namespaceObject.useRef)(); 5291 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 5292 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), 5293 onKeyDown 5294 }); 5295 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 5296 const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); 5297 const isURLSet = !!url; 5298 const opensInNewTab = linkTarget === NEW_TAB_TARGET; 5299 const nofollow = !!rel?.includes(NOFOLLOW_REL); 5300 const isLinkTag = 'a' === TagName; 5301 function startEditing(event) { 5302 event.preventDefault(); 5303 setIsEditingURL(true); 5304 } 5305 function unlink() { 5306 setAttributes({ 5307 url: undefined, 5308 linkTarget: undefined, 5309 rel: undefined 5310 }); 5311 setIsEditingURL(false); 5312 } 5313 (0,external_wp_element_namespaceObject.useEffect)(() => { 5314 if (!isSelected) { 5315 setIsEditingURL(false); 5316 } 5317 }, [isSelected]); 5318 5319 // Memoize link value to avoid overriding the LinkControl's internal state. 5320 // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256. 5321 const linkValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 5322 url, 5323 opensInNewTab, 5324 nofollow 5325 }), [url, opensInNewTab, nofollow]); 5326 const useEnterRef = useEnter({ 5327 content: text, 5328 clientId 5329 }); 5330 const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, richTextRef]); 5331 const { 5332 lockUrlControls = false 5333 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 5334 if (!isSelected) { 5335 return {}; 5336 } 5337 const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(metadata?.bindings?.url?.source); 5338 return { 5339 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 5340 select, 5341 context, 5342 args: metadata?.bindings?.url?.args 5343 }) 5344 }; 5345 }, [context, isSelected, metadata?.bindings?.url]); 5346 const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); 5347 const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { 5348 typography: { 5349 fluid: fluidTypographySettings 5350 }, 5351 layout: { 5352 wideSize: layout?.wideSize 5353 } 5354 }); 5355 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 5356 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 5357 ...blockProps, 5358 className: dist_clsx(blockProps.className, { 5359 [`has-custom-width wp-block-button__width-$width}`]: width 5360 }), 5361 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 5362 ref: mergedRef, 5363 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), 5364 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), 5365 value: text, 5366 onChange: value => setAttributes({ 5367 text: removeAnchorTag(value) 5368 }), 5369 withoutInteractiveFormatting: true, 5370 className: dist_clsx(className, 'wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { 5371 [`has-text-align-$textAlign}`]: textAlign, 5372 // For backwards compatibility add style that isn't 5373 // provided via block support. 5374 'no-border-radius': style?.border?.radius === 0, 5375 [`has-custom-font-size`]: blockProps.style.fontSize 5376 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 5377 style: { 5378 ...borderProps.style, 5379 ...colorProps.style, 5380 ...spacingProps.style, 5381 ...shadowProps.style, 5382 ...typographyProps.style, 5383 writingMode: undefined 5384 }, 5385 onReplace: onReplace, 5386 onMerge: mergeBlocks, 5387 identifier: "text" 5388 }) 5389 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 5390 group: "block", 5391 children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 5392 value: textAlign, 5393 onChange: nextAlign => { 5394 setAttributes({ 5395 textAlign: nextAlign 5396 }); 5397 } 5398 }), !isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 5399 name: "link", 5400 icon: library_link, 5401 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 5402 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 5403 onClick: startEditing 5404 }), isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 5405 name: "link", 5406 icon: link_off, 5407 title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), 5408 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), 5409 onClick: unlink, 5410 isActive: true 5411 })] 5412 }), isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { 5413 placement: "bottom", 5414 onClose: () => { 5415 setIsEditingURL(false); 5416 richTextRef.current?.focus(); 5417 }, 5418 anchor: popoverAnchor, 5419 focusOnMount: isEditingURL ? 'firstElement' : false, 5420 __unstableSlotName: "__unstable-block-tools-after", 5421 shift: true, 5422 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { 5423 value: linkValue, 5424 onChange: ({ 5425 url: newURL, 5426 opensInNewTab: newOpensInNewTab, 5427 nofollow: newNofollow 5428 }) => setAttributes(getUpdatedLinkAttributes({ 5429 rel, 5430 url: newURL, 5431 opensInNewTab: newOpensInNewTab, 5432 nofollow: newNofollow 5433 })), 5434 onRemove: () => { 5435 unlink(); 5436 richTextRef.current?.focus(); 5437 }, 5438 forceIsEditingLink: isEditingURL, 5439 settings: LINK_SETTINGS 5440 }) 5441 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 5442 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidthPanel, { 5443 selectedWidth: width, 5444 setAttributes: setAttributes 5445 }) 5446 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 5447 group: "advanced", 5448 children: isLinkTag && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 5449 __next40pxDefaultSize: true, 5450 __nextHasNoMarginBottom: true, 5451 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 5452 value: rel || '', 5453 onChange: newRel => setAttributes({ 5454 rel: newRel 5455 }) 5456 }) 5457 })] 5458 }); 5459 } 5460 /* harmony default export */ const button_edit = (ButtonEdit); 5461 5462 ;// ./node_modules/@wordpress/block-library/build-module/button/save.js 5463 /** 5464 * External dependencies 5465 */ 5466 5467 5468 /** 5469 * WordPress dependencies 5470 */ 5471 5472 5473 function save_save({ 5474 attributes, 5475 className 5476 }) { 5477 const { 5478 tagName, 5479 type, 5480 textAlign, 5481 fontSize, 5482 linkTarget, 5483 rel, 5484 style, 5485 text, 5486 title, 5487 url, 5488 width 5489 } = attributes; 5490 const TagName = tagName || 'a'; 5491 const isButtonTag = 'button' === TagName; 5492 const buttonType = type || 'button'; 5493 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 5494 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 5495 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 5496 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 5497 const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes); 5498 const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { 5499 [`has-text-align-$textAlign}`]: textAlign, 5500 // For backwards compatibility add style that isn't provided via 5501 // block support. 5502 'no-border-radius': style?.border?.radius === 0, 5503 [`has-custom-font-size`]: fontSize || style?.typography?.fontSize 5504 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); 5505 const buttonStyle = { 5506 ...borderProps.style, 5507 ...colorProps.style, 5508 ...spacingProps.style, 5509 ...shadowProps.style, 5510 ...typographyProps.style, 5511 writingMode: undefined 5512 }; 5513 5514 // The use of a `title` attribute here is soft-deprecated, but still applied 5515 // if it had already been assigned, for the sake of backward-compatibility. 5516 // A title will no longer be assigned for new or updated button block links. 5517 5518 const wrapperClasses = dist_clsx(className, { 5519 [`has-custom-width wp-block-button__width-$width}`]: width 5520 }); 5521 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 5522 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 5523 className: wrapperClasses 5524 }), 5525 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 5526 tagName: TagName, 5527 type: isButtonTag ? buttonType : null, 5528 className: buttonClasses, 5529 href: isButtonTag ? null : url, 5530 title: title, 5531 style: buttonStyle, 5532 value: text, 5533 target: isButtonTag ? null : linkTarget, 5534 rel: isButtonTag ? null : rel 5535 }) 5536 }); 5537 } 5538 5539 ;// ./node_modules/@wordpress/block-library/build-module/button/index.js 5540 /** 5541 * WordPress dependencies 5542 */ 5543 5544 5545 5546 /** 5547 * Internal dependencies 5548 */ 5549 5550 5551 5552 const button_metadata = { 5553 $schema: "https://schemas.wp.org/trunk/block.json", 5554 apiVersion: 3, 5555 name: "core/button", 5556 title: "Button", 5557 category: "design", 5558 parent: ["core/buttons"], 5559 description: "Prompt visitors to take action with a button-style link.", 5560 keywords: ["link"], 5561 textdomain: "default", 5562 attributes: { 5563 tagName: { 5564 type: "string", 5565 "enum": ["a", "button"], 5566 "default": "a" 5567 }, 5568 type: { 5569 type: "string", 5570 "default": "button" 5571 }, 5572 textAlign: { 5573 type: "string" 5574 }, 5575 url: { 5576 type: "string", 5577 source: "attribute", 5578 selector: "a", 5579 attribute: "href", 5580 role: "content" 5581 }, 5582 title: { 5583 type: "string", 5584 source: "attribute", 5585 selector: "a,button", 5586 attribute: "title", 5587 role: "content" 5588 }, 5589 text: { 5590 type: "rich-text", 5591 source: "rich-text", 5592 selector: "a,button", 5593 role: "content" 5594 }, 5595 linkTarget: { 5596 type: "string", 5597 source: "attribute", 5598 selector: "a", 5599 attribute: "target", 5600 role: "content" 5601 }, 5602 rel: { 5603 type: "string", 5604 source: "attribute", 5605 selector: "a", 5606 attribute: "rel", 5607 role: "content" 5608 }, 5609 placeholder: { 5610 type: "string" 5611 }, 5612 backgroundColor: { 5613 type: "string" 5614 }, 5615 textColor: { 5616 type: "string" 5617 }, 5618 gradient: { 5619 type: "string" 5620 }, 5621 width: { 5622 type: "number" 5623 } 5624 }, 5625 supports: { 5626 anchor: true, 5627 splitting: true, 5628 align: false, 5629 alignWide: false, 5630 color: { 5631 __experimentalSkipSerialization: true, 5632 gradients: true, 5633 __experimentalDefaultControls: { 5634 background: true, 5635 text: true 5636 } 5637 }, 5638 typography: { 5639 __experimentalSkipSerialization: ["fontSize", "lineHeight", "fontFamily", "fontWeight", "fontStyle", "textTransform", "textDecoration", "letterSpacing"], 5640 fontSize: true, 5641 lineHeight: true, 5642 __experimentalFontFamily: true, 5643 __experimentalFontWeight: true, 5644 __experimentalFontStyle: true, 5645 __experimentalTextTransform: true, 5646 __experimentalTextDecoration: true, 5647 __experimentalLetterSpacing: true, 5648 __experimentalWritingMode: true, 5649 __experimentalDefaultControls: { 5650 fontSize: true 5651 } 5652 }, 5653 reusable: false, 5654 shadow: { 5655 __experimentalSkipSerialization: true 5656 }, 5657 spacing: { 5658 __experimentalSkipSerialization: true, 5659 padding: ["horizontal", "vertical"], 5660 __experimentalDefaultControls: { 5661 padding: true 5662 } 5663 }, 5664 __experimentalBorder: { 5665 color: true, 5666 radius: true, 5667 style: true, 5668 width: true, 5669 __experimentalSkipSerialization: true, 5670 __experimentalDefaultControls: { 5671 color: true, 5672 radius: true, 5673 style: true, 5674 width: true 5675 } 5676 }, 5677 interactivity: { 5678 clientNavigation: true 5679 } 5680 }, 5681 styles: [{ 5682 name: "fill", 5683 label: "Fill", 5684 isDefault: true 5685 }, { 5686 name: "outline", 5687 label: "Outline" 5688 }], 5689 editorStyle: "wp-block-button-editor", 5690 style: "wp-block-button", 5691 selectors: { 5692 root: ".wp-block-button .wp-block-button__link", 5693 typography: { 5694 writingMode: ".wp-block-button" 5695 } 5696 } 5697 }; 5698 5699 const { 5700 name: button_name 5701 } = button_metadata; 5702 5703 const button_settings = { 5704 icon: library_button, 5705 example: { 5706 attributes: { 5707 className: 'is-style-fill', 5708 text: (0,external_wp_i18n_namespaceObject.__)('Call to action') 5709 } 5710 }, 5711 edit: button_edit, 5712 save: save_save, 5713 deprecated: button_deprecated, 5714 merge: (a, { 5715 text = '' 5716 }) => ({ 5717 ...a, 5718 text: (a.text || '') + text 5719 }) 5720 }; 5721 const button_init = () => initBlock({ 5722 name: button_name, 5723 metadata: button_metadata, 5724 settings: button_settings 5725 }); 5726 5727 ;// ./node_modules/@wordpress/icons/build-module/library/buttons.js 5728 /** 5729 * WordPress dependencies 5730 */ 5731 5732 5733 const buttons = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 5734 viewBox: "0 0 24 24", 5735 xmlns: "http://www.w3.org/2000/svg", 5736 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 5737 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" 5738 }) 5739 }); 5740 /* harmony default export */ const library_buttons = (buttons); 5741 5742 ;// ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js 5743 /** 5744 * External dependencies 5745 */ 5746 5747 /** 5748 * WordPress dependencies 5749 */ 5750 5751 5752 /** 5753 * @param {Object} attributes Block's attributes. 5754 */ 5755 5756 const migrateWithLayout = attributes => { 5757 if (!!attributes.layout) { 5758 return attributes; 5759 } 5760 const { 5761 contentJustification, 5762 orientation, 5763 ...updatedAttributes 5764 } = attributes; 5765 if (contentJustification || orientation) { 5766 Object.assign(updatedAttributes, { 5767 layout: { 5768 type: 'flex', 5769 ...(contentJustification && { 5770 justifyContent: contentJustification 5771 }), 5772 ...(orientation && { 5773 orientation 5774 }) 5775 } 5776 }); 5777 } 5778 return updatedAttributes; 5779 }; 5780 const buttons_deprecated_deprecated = [{ 5781 attributes: { 5782 contentJustification: { 5783 type: 'string' 5784 }, 5785 orientation: { 5786 type: 'string', 5787 default: 'horizontal' 5788 } 5789 }, 5790 supports: { 5791 anchor: true, 5792 align: ['wide', 'full'], 5793 __experimentalExposeControlsToChildren: true, 5794 spacing: { 5795 blockGap: true, 5796 margin: ['top', 'bottom'], 5797 __experimentalDefaultControls: { 5798 blockGap: true 5799 } 5800 } 5801 }, 5802 isEligible: ({ 5803 contentJustification, 5804 orientation 5805 }) => !!contentJustification || !!orientation, 5806 migrate: migrateWithLayout, 5807 save({ 5808 attributes: { 5809 contentJustification, 5810 orientation 5811 } 5812 }) { 5813 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 5814 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 5815 className: dist_clsx({ 5816 [`is-content-justification-$contentJustification}`]: contentJustification, 5817 'is-vertical': orientation === 'vertical' 5818 }) 5819 }), 5820 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 5821 }); 5822 } 5823 }, { 5824 supports: { 5825 align: ['center', 'left', 'right'], 5826 anchor: true 5827 }, 5828 save() { 5829 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 5830 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 5831 }); 5832 }, 5833 isEligible({ 5834 align 5835 }) { 5836 return align && ['center', 'left', 'right'].includes(align); 5837 }, 5838 migrate(attributes) { 5839 return migrateWithLayout({ 5840 ...attributes, 5841 align: undefined, 5842 // Floating Buttons blocks shouldn't have been supported in the 5843 // first place. Most users using them probably expected them to 5844 // act like content justification controls, so these blocks are 5845 // migrated to use content justification. 5846 // As for center-aligned Buttons blocks, the content justification 5847 // equivalent will create an identical end result in most cases. 5848 contentJustification: attributes.align 5849 }); 5850 } 5851 }]; 5852 /* harmony default export */ const buttons_deprecated = (buttons_deprecated_deprecated); 5853 5854 ;// external ["wp","richText"] 5855 const external_wp_richText_namespaceObject = window["wp"]["richText"]; 5856 ;// ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js 5857 /* wp:polyfill */ 5858 /** 5859 * WordPress dependencies 5860 */ 5861 5862 5863 /** 5864 * Transform the metadata attribute with only the values and bindings specified by each transform. 5865 * Returns `undefined` if the input metadata is falsy. 5866 * 5867 * @param {Object} metadata Original metadata attribute from the block that is being transformed. 5868 * @param {Object} newBlockName Name of the final block after the transformation. 5869 * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object. 5870 * @return {Object|undefined} New metadata object only with the relevant properties. 5871 */ 5872 function getTransformedMetadata(metadata, newBlockName, bindingsCallback) { 5873 if (!metadata) { 5874 return; 5875 } 5876 const { 5877 supports 5878 } = (0,external_wp_blocks_namespaceObject.getBlockType)(newBlockName); 5879 // Fixed until an opt-in mechanism is implemented. 5880 const BLOCK_BINDINGS_SUPPORTED_BLOCKS = ['core/paragraph', 'core/heading', 'core/image', 'core/button']; 5881 // The metadata properties that should be preserved after the transform. 5882 const transformSupportedProps = []; 5883 // If it support bindings, and there is a transform bindings callback, add the `id` and `bindings` properties. 5884 if (BLOCK_BINDINGS_SUPPORTED_BLOCKS.includes(newBlockName) && bindingsCallback) { 5885 transformSupportedProps.push('id', 'bindings'); 5886 } 5887 // If it support block naming (true by default), add the `name` property. 5888 if (supports.renaming !== false) { 5889 transformSupportedProps.push('name'); 5890 } 5891 5892 // Return early if no supported properties. 5893 if (!transformSupportedProps.length) { 5894 return; 5895 } 5896 const newMetadata = Object.entries(metadata).reduce((obj, [prop, value]) => { 5897 // If prop is not supported, don't add it to the new metadata object. 5898 if (!transformSupportedProps.includes(prop)) { 5899 return obj; 5900 } 5901 obj[prop] = prop === 'bindings' ? bindingsCallback(value) : value; 5902 return obj; 5903 }, {}); 5904 5905 // Return undefined if object is empty. 5906 return Object.keys(newMetadata).length ? newMetadata : undefined; 5907 } 5908 5909 ;// ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js 5910 /* wp:polyfill */ 5911 /** 5912 * WordPress dependencies 5913 */ 5914 5915 5916 5917 /** 5918 * Internal dependencies 5919 */ 5920 5921 const transforms_transforms = { 5922 from: [{ 5923 type: 'block', 5924 isMultiBlock: true, 5925 blocks: ['core/button'], 5926 transform: buttons => 5927 // Creates the buttons block. 5928 (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, 5929 // Loop the selected buttons. 5930 buttons.map(attributes => 5931 // Create singular button in the buttons block. 5932 (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes))) 5933 }, { 5934 type: 'block', 5935 isMultiBlock: true, 5936 blocks: ['core/paragraph'], 5937 transform: buttons => 5938 // Creates the buttons block. 5939 (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, 5940 // Loop the selected buttons. 5941 buttons.map(attributes => { 5942 const { 5943 content, 5944 metadata 5945 } = attributes; 5946 const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, content); 5947 // Remove any HTML tags. 5948 const text = element.innerText || ''; 5949 // Get first url. 5950 const link = element.querySelector('a'); 5951 const url = link?.getAttribute('href'); 5952 // Create singular button in the buttons block. 5953 return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { 5954 text, 5955 url, 5956 metadata: getTransformedMetadata(metadata, 'core/button', ({ 5957 content: contentBinding 5958 }) => ({ 5959 text: contentBinding 5960 })) 5961 }); 5962 })), 5963 isMatch: paragraphs => { 5964 return paragraphs.every(attributes => { 5965 const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); 5966 const text = element.innerText || ''; 5967 const links = element.querySelectorAll('a'); 5968 return text.length <= 30 && links.length <= 1; 5969 }); 5970 } 5971 }] 5972 }; 5973 /* harmony default export */ const buttons_transforms = (transforms_transforms); 5974 5975 ;// ./node_modules/@wordpress/block-library/build-module/buttons/edit.js 5976 /** 5977 * External dependencies 5978 */ 5979 5980 5981 /** 5982 * WordPress dependencies 5983 */ 5984 5985 5986 5987 5988 const DEFAULT_BLOCK = { 5989 name: 'core/button', 5990 attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width'] 5991 }; 5992 function ButtonsEdit({ 5993 attributes, 5994 className 5995 }) { 5996 var _layout$orientation; 5997 const { 5998 fontSize, 5999 layout, 6000 style 6001 } = attributes; 6002 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 6003 className: dist_clsx(className, { 6004 'has-custom-font-size': fontSize || style?.typography?.fontSize 6005 }) 6006 }); 6007 const { 6008 hasButtonVariations 6009 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 6010 const buttonVariations = select(external_wp_blocks_namespaceObject.store).getBlockVariations('core/button', 'inserter'); 6011 return { 6012 hasButtonVariations: buttonVariations.length > 0 6013 }; 6014 }, []); 6015 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 6016 defaultBlock: DEFAULT_BLOCK, 6017 // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. 6018 directInsert: !hasButtonVariations, 6019 template: [['core/button']], 6020 templateInsertUpdatesSelection: true, 6021 orientation: (_layout$orientation = layout?.orientation) !== null && _layout$orientation !== void 0 ? _layout$orientation : 'horizontal' 6022 }); 6023 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 6024 ...innerBlocksProps 6025 }); 6026 } 6027 /* harmony default export */ const buttons_edit = (ButtonsEdit); 6028 6029 ;// ./node_modules/@wordpress/block-library/build-module/buttons/save.js 6030 /** 6031 * External dependencies 6032 */ 6033 6034 6035 /** 6036 * WordPress dependencies 6037 */ 6038 6039 6040 function buttons_save_save({ 6041 attributes, 6042 className 6043 }) { 6044 const { 6045 fontSize, 6046 style 6047 } = attributes; 6048 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 6049 className: dist_clsx(className, { 6050 'has-custom-font-size': fontSize || style?.typography?.fontSize 6051 }) 6052 }); 6053 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 6054 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 6055 ...innerBlocksProps 6056 }); 6057 } 6058 6059 ;// ./node_modules/@wordpress/block-library/build-module/buttons/index.js 6060 /** 6061 * WordPress dependencies 6062 */ 6063 6064 6065 6066 /** 6067 * Internal dependencies 6068 */ 6069 6070 6071 6072 6073 const buttons_metadata = { 6074 $schema: "https://schemas.wp.org/trunk/block.json", 6075 apiVersion: 3, 6076 name: "core/buttons", 6077 title: "Buttons", 6078 category: "design", 6079 allowedBlocks: ["core/button"], 6080 description: "Prompt visitors to take action with a group of button-style links.", 6081 keywords: ["link"], 6082 textdomain: "default", 6083 supports: { 6084 anchor: true, 6085 align: ["wide", "full"], 6086 html: false, 6087 __experimentalExposeControlsToChildren: true, 6088 color: { 6089 gradients: true, 6090 text: false, 6091 __experimentalDefaultControls: { 6092 background: true 6093 } 6094 }, 6095 spacing: { 6096 blockGap: ["horizontal", "vertical"], 6097 padding: true, 6098 margin: ["top", "bottom"], 6099 __experimentalDefaultControls: { 6100 blockGap: true 6101 } 6102 }, 6103 typography: { 6104 fontSize: true, 6105 lineHeight: true, 6106 __experimentalFontFamily: true, 6107 __experimentalFontWeight: true, 6108 __experimentalFontStyle: true, 6109 __experimentalTextTransform: true, 6110 __experimentalTextDecoration: true, 6111 __experimentalLetterSpacing: true, 6112 __experimentalDefaultControls: { 6113 fontSize: true 6114 } 6115 }, 6116 __experimentalBorder: { 6117 color: true, 6118 radius: true, 6119 style: true, 6120 width: true, 6121 __experimentalDefaultControls: { 6122 color: true, 6123 radius: true, 6124 style: true, 6125 width: true 6126 } 6127 }, 6128 layout: { 6129 allowSwitching: false, 6130 allowInheriting: false, 6131 "default": { 6132 type: "flex" 6133 } 6134 }, 6135 interactivity: { 6136 clientNavigation: true 6137 } 6138 }, 6139 editorStyle: "wp-block-buttons-editor", 6140 style: "wp-block-buttons" 6141 }; 6142 6143 const { 6144 name: buttons_name 6145 } = buttons_metadata; 6146 6147 const buttons_settings = { 6148 icon: library_buttons, 6149 example: { 6150 attributes: { 6151 layout: { 6152 type: 'flex', 6153 justifyContent: 'center' 6154 } 6155 }, 6156 innerBlocks: [{ 6157 name: 'core/button', 6158 attributes: { 6159 text: (0,external_wp_i18n_namespaceObject.__)('Find out more') 6160 } 6161 }, { 6162 name: 'core/button', 6163 attributes: { 6164 text: (0,external_wp_i18n_namespaceObject.__)('Contact us') 6165 } 6166 }] 6167 }, 6168 deprecated: buttons_deprecated, 6169 transforms: buttons_transforms, 6170 edit: buttons_edit, 6171 save: buttons_save_save 6172 }; 6173 const buttons_init = () => initBlock({ 6174 name: buttons_name, 6175 metadata: buttons_metadata, 6176 settings: buttons_settings 6177 }); 6178 6179 ;// ./node_modules/@wordpress/icons/build-module/library/calendar.js 6180 /** 6181 * WordPress dependencies 6182 */ 6183 6184 6185 const calendar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 6186 viewBox: "0 0 24 24", 6187 xmlns: "http://www.w3.org/2000/svg", 6188 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 6189 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" 6190 }) 6191 }); 6192 /* harmony default export */ const library_calendar = (calendar); 6193 6194 ;// ./node_modules/@wordpress/block-library/build-module/calendar/edit.js 6195 /** 6196 * External dependencies 6197 */ 6198 6199 6200 /** 6201 * WordPress dependencies 6202 */ 6203 6204 6205 6206 6207 6208 6209 6210 6211 /** 6212 * Returns the year and month of a specified date. 6213 * 6214 * @see `WP_REST_Posts_Controller::prepare_date_response()`. 6215 * 6216 * @param {string} date Date in `ISO8601/RFC3339` format. 6217 * @return {Object} Year and date of the specified date. 6218 */ 6219 6220 const getYearMonth = memize(date => { 6221 if (!date) { 6222 return {}; 6223 } 6224 const dateObj = new Date(date); 6225 return { 6226 year: dateObj.getFullYear(), 6227 month: dateObj.getMonth() + 1 6228 }; 6229 }); 6230 function CalendarEdit({ 6231 attributes 6232 }) { 6233 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 6234 const { 6235 date, 6236 hasPosts, 6237 hasPostsResolved 6238 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 6239 const { 6240 getEntityRecords, 6241 hasFinishedResolution 6242 } = select(external_wp_coreData_namespaceObject.store); 6243 const singlePublishedPostQuery = { 6244 status: 'publish', 6245 per_page: 1 6246 }; 6247 const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery); 6248 const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]); 6249 let _date; 6250 6251 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 6252 // Blocks can be loaded into a *non-post* block editor. 6253 // eslint-disable-next-line @wordpress/data-no-store-string-literals 6254 const editorSelectors = select('core/editor'); 6255 if (editorSelectors) { 6256 const postType = editorSelectors.getEditedPostAttribute('type'); 6257 // Dates are used to overwrite year and month used on the calendar. 6258 // This overwrite should only happen for 'post' post types. 6259 // For other post types the calendar always displays the current month. 6260 if (postType === 'post') { 6261 _date = editorSelectors.getEditedPostAttribute('date'); 6262 } 6263 } 6264 return { 6265 date: _date, 6266 hasPostsResolved: postsResolved, 6267 hasPosts: postsResolved && posts?.length === 1 6268 }; 6269 }, []); 6270 if (!hasPosts) { 6271 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 6272 ...blockProps, 6273 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 6274 icon: library_calendar, 6275 label: (0,external_wp_i18n_namespaceObject.__)('Calendar'), 6276 children: !hasPostsResolved ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.') 6277 }) 6278 }); 6279 } 6280 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 6281 ...blockProps, 6282 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 6283 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { 6284 block: "core/calendar", 6285 attributes: { 6286 ...attributes, 6287 ...getYearMonth(date) 6288 } 6289 }) 6290 }) 6291 }); 6292 } 6293 6294 ;// ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js 6295 /** 6296 * WordPress dependencies 6297 */ 6298 6299 const calendar_transforms_transforms = { 6300 from: [{ 6301 type: 'block', 6302 blocks: ['core/archives'], 6303 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar') 6304 }], 6305 to: [{ 6306 type: 'block', 6307 blocks: ['core/archives'], 6308 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives') 6309 }] 6310 }; 6311 /* harmony default export */ const calendar_transforms = (calendar_transforms_transforms); 6312 6313 ;// ./node_modules/@wordpress/block-library/build-module/calendar/index.js 6314 /** 6315 * WordPress dependencies 6316 */ 6317 6318 6319 /** 6320 * Internal dependencies 6321 */ 6322 6323 const calendar_metadata = { 6324 $schema: "https://schemas.wp.org/trunk/block.json", 6325 apiVersion: 3, 6326 name: "core/calendar", 6327 title: "Calendar", 6328 category: "widgets", 6329 description: "A calendar of your site\u2019s posts.", 6330 keywords: ["posts", "archive"], 6331 textdomain: "default", 6332 attributes: { 6333 month: { 6334 type: "integer" 6335 }, 6336 year: { 6337 type: "integer" 6338 } 6339 }, 6340 supports: { 6341 align: true, 6342 color: { 6343 link: true, 6344 __experimentalSkipSerialization: ["text", "background"], 6345 __experimentalDefaultControls: { 6346 background: true, 6347 text: true 6348 }, 6349 __experimentalSelector: "table, th" 6350 }, 6351 typography: { 6352 fontSize: true, 6353 lineHeight: true, 6354 __experimentalFontFamily: true, 6355 __experimentalFontWeight: true, 6356 __experimentalFontStyle: true, 6357 __experimentalTextTransform: true, 6358 __experimentalLetterSpacing: true, 6359 __experimentalDefaultControls: { 6360 fontSize: true 6361 } 6362 }, 6363 interactivity: { 6364 clientNavigation: true 6365 } 6366 }, 6367 style: "wp-block-calendar" 6368 }; 6369 6370 6371 const { 6372 name: calendar_name 6373 } = calendar_metadata; 6374 6375 const calendar_settings = { 6376 icon: library_calendar, 6377 example: {}, 6378 edit: CalendarEdit, 6379 transforms: calendar_transforms 6380 }; 6381 const calendar_init = () => initBlock({ 6382 name: calendar_name, 6383 metadata: calendar_metadata, 6384 settings: calendar_settings 6385 }); 6386 6387 ;// ./node_modules/@wordpress/icons/build-module/library/category.js 6388 /** 6389 * WordPress dependencies 6390 */ 6391 6392 6393 const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 6394 viewBox: "0 0 24 24", 6395 xmlns: "http://www.w3.org/2000/svg", 6396 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 6397 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", 6398 fillRule: "evenodd", 6399 clipRule: "evenodd" 6400 }) 6401 }); 6402 /* harmony default export */ const library_category = (category); 6403 6404 ;// external ["wp","htmlEntities"] 6405 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; 6406 ;// ./node_modules/@wordpress/icons/build-module/library/pin.js 6407 /** 6408 * WordPress dependencies 6409 */ 6410 6411 6412 const pin = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 6413 xmlns: "http://www.w3.org/2000/svg", 6414 viewBox: "0 0 24 24", 6415 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 6416 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" 6417 }) 6418 }); 6419 /* harmony default export */ const library_pin = (pin); 6420 6421 ;// ./node_modules/@wordpress/block-library/build-module/categories/edit.js 6422 /* wp:polyfill */ 6423 /** 6424 * External dependencies 6425 */ 6426 6427 6428 /** 6429 * WordPress dependencies 6430 */ 6431 6432 6433 6434 6435 6436 6437 6438 6439 /** 6440 * Internal dependencies 6441 */ 6442 6443 6444 function CategoriesEdit({ 6445 attributes: { 6446 displayAsDropdown, 6447 showHierarchy, 6448 showPostCounts, 6449 showOnlyTopLevel, 6450 showEmpty, 6451 label, 6452 showLabel, 6453 taxonomy: taxonomySlug 6454 }, 6455 setAttributes, 6456 className 6457 }) { 6458 const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); 6459 const { 6460 records: allTaxonomies, 6461 isResolvingTaxonomies 6462 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'taxonomy'); 6463 const taxonomies = allTaxonomies?.filter(t => t.visibility.public); 6464 const taxonomy = taxonomies?.find(t => t.slug === taxonomySlug); 6465 const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical; 6466 const query = { 6467 per_page: -1, 6468 hide_empty: !showEmpty, 6469 context: 'view' 6470 }; 6471 if (isHierarchicalTaxonomy && showOnlyTopLevel) { 6472 query.parent = 0; 6473 } 6474 const { 6475 records: categories, 6476 isResolving 6477 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', taxonomySlug, query); 6478 const getCategoriesList = parentId => { 6479 if (!categories?.length) { 6480 return []; 6481 } 6482 if (parentId === null) { 6483 return categories; 6484 } 6485 return categories.filter(({ 6486 parent 6487 }) => parent === parentId); 6488 }; 6489 const toggleAttribute = attributeName => newValue => setAttributes({ 6490 [attributeName]: newValue 6491 }); 6492 const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim(); 6493 const renderCategoryList = () => { 6494 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 6495 const categoriesList = getCategoriesList(parentId); 6496 return categoriesList.map(category => renderCategoryListItem(category)); 6497 }; 6498 const renderCategoryListItem = category => { 6499 const childCategories = getCategoriesList(category.id); 6500 const { 6501 id, 6502 link, 6503 count, 6504 name 6505 } = category; 6506 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 6507 className: `cat-item cat-item-$id}`, 6508 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 6509 href: link, 6510 target: "_blank", 6511 rel: "noreferrer noopener", 6512 children: renderCategoryName(name) 6513 }), showPostCounts && ` ($count})`, isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 6514 className: "children", 6515 children: childCategories.map(childCategory => renderCategoryListItem(childCategory)) 6516 })] 6517 }, id); 6518 }; 6519 const renderCategoryDropdown = () => { 6520 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 6521 const categoriesList = getCategoriesList(parentId); 6522 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 6523 children: [showLabel ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 6524 className: "wp-block-categories__label", 6525 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), 6526 placeholder: taxonomy.name, 6527 withoutInteractiveFormatting: true, 6528 value: label, 6529 onChange: html => setAttributes({ 6530 label: html 6531 }) 6532 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { 6533 as: "label", 6534 htmlFor: selectId, 6535 children: label ? label : taxonomy.name 6536 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("select", { 6537 id: selectId, 6538 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { 6539 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: taxonomy's singular name */ 6540 (0,external_wp_i18n_namespaceObject.__)('Select %s'), taxonomy.labels.singular_name) 6541 }), categoriesList.map(category => renderCategoryDropdownItem(category, 0))] 6542 })] 6543 }); 6544 }; 6545 const renderCategoryDropdownItem = (category, level) => { 6546 const { 6547 id, 6548 count, 6549 name 6550 } = category; 6551 const childCategories = getCategoriesList(id); 6552 return [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("option", { 6553 className: `level-$level}`, 6554 children: [Array.from({ 6555 length: level * 3 6556 }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` ($count})`] 6557 }, id), isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; 6558 }; 6559 const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div'; 6560 const classes = dist_clsx(className, { 6561 'wp-block-categories-list': !!categories?.length && !displayAsDropdown && !isResolving, 6562 'wp-block-categories-dropdown': !!categories?.length && displayAsDropdown && !isResolving 6563 }); 6564 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 6565 className: classes 6566 }); 6567 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 6568 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 6569 ...blockProps, 6570 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 6571 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 6572 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 6573 resetAll: () => { 6574 setAttributes({ 6575 taxonomy: 'category', 6576 displayAsDropdown: false, 6577 showHierarchy: false, 6578 showPostCounts: false, 6579 showOnlyTopLevel: false, 6580 showEmpty: false, 6581 showLabel: true 6582 }); 6583 }, 6584 dropdownMenuProps: dropdownMenuProps, 6585 children: [Array.isArray(taxonomies) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6586 hasValue: () => { 6587 return taxonomySlug !== 'category'; 6588 }, 6589 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), 6590 onDeselect: () => { 6591 setAttributes({ 6592 taxonomy: 'category' 6593 }); 6594 }, 6595 isShownByDefault: true, 6596 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 6597 __nextHasNoMarginBottom: true, 6598 __next40pxDefaultSize: true, 6599 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), 6600 options: taxonomies.map(t => ({ 6601 label: t.name, 6602 value: t.slug 6603 })), 6604 value: taxonomySlug, 6605 onChange: selectedTaxonomy => setAttributes({ 6606 taxonomy: selectedTaxonomy 6607 }) 6608 }) 6609 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6610 hasValue: () => !!displayAsDropdown, 6611 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 6612 onDeselect: () => setAttributes({ 6613 displayAsDropdown: false 6614 }), 6615 isShownByDefault: true, 6616 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6617 __nextHasNoMarginBottom: true, 6618 label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), 6619 checked: displayAsDropdown, 6620 onChange: toggleAttribute('displayAsDropdown') 6621 }) 6622 }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6623 hasValue: () => !showLabel, 6624 label: (0,external_wp_i18n_namespaceObject.__)('Show label'), 6625 onDeselect: () => setAttributes({ 6626 showLabel: true 6627 }), 6628 isShownByDefault: true, 6629 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6630 __nextHasNoMarginBottom: true, 6631 className: "wp-block-categories__indentation", 6632 label: (0,external_wp_i18n_namespaceObject.__)('Show label'), 6633 checked: showLabel, 6634 onChange: toggleAttribute('showLabel') 6635 }) 6636 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6637 hasValue: () => !!showPostCounts, 6638 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 6639 onDeselect: () => setAttributes({ 6640 showPostCounts: false 6641 }), 6642 isShownByDefault: true, 6643 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6644 __nextHasNoMarginBottom: true, 6645 label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), 6646 checked: showPostCounts, 6647 onChange: toggleAttribute('showPostCounts') 6648 }) 6649 }), isHierarchicalTaxonomy && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6650 hasValue: () => !!showOnlyTopLevel, 6651 label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), 6652 onDeselect: () => setAttributes({ 6653 showOnlyTopLevel: false 6654 }), 6655 isShownByDefault: true, 6656 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6657 __nextHasNoMarginBottom: true, 6658 label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), 6659 checked: showOnlyTopLevel, 6660 onChange: toggleAttribute('showOnlyTopLevel') 6661 }) 6662 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6663 hasValue: () => !!showEmpty, 6664 label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), 6665 onDeselect: () => setAttributes({ 6666 showEmpty: false 6667 }), 6668 isShownByDefault: true, 6669 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6670 __nextHasNoMarginBottom: true, 6671 label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), 6672 checked: showEmpty, 6673 onChange: toggleAttribute('showEmpty') 6674 }) 6675 }), isHierarchicalTaxonomy && !showOnlyTopLevel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 6676 hasValue: () => !!showHierarchy, 6677 label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), 6678 onDeselect: () => setAttributes({ 6679 showHierarchy: false 6680 }), 6681 isShownByDefault: true, 6682 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 6683 __nextHasNoMarginBottom: true, 6684 label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), 6685 checked: showHierarchy, 6686 onChange: toggleAttribute('showHierarchy') 6687 }) 6688 })] 6689 }) 6690 }), isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 6691 icon: library_pin, 6692 label: (0,external_wp_i18n_namespaceObject.__)('Terms'), 6693 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 6694 }), !isResolving && categories?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 6695 children: taxonomy.labels.no_terms 6696 }), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())] 6697 }); 6698 } 6699 6700 ;// ./node_modules/@wordpress/block-library/build-module/categories/variations.js 6701 /** 6702 * WordPress dependencies 6703 */ 6704 6705 6706 const variations = [{ 6707 name: 'terms', 6708 title: (0,external_wp_i18n_namespaceObject.__)('Terms List'), 6709 icon: library_category, 6710 attributes: { 6711 // We need to set an attribute here that will be set when inserting the block. 6712 // We cannot leave this empty, as that would be interpreted as the default value, 6713 // which is `category` -- for which we're defining a distinct variation below, 6714 // for backwards compatibility reasons. 6715 // The logical fallback is thus the only other built-in and public taxonomy: Tags. 6716 taxonomy: 'post_tag' 6717 }, 6718 isActive: blockAttributes => 6719 // This variation is used for any taxonomy other than `category`. 6720 blockAttributes.taxonomy !== 'category' 6721 }, { 6722 name: 'categories', 6723 title: (0,external_wp_i18n_namespaceObject.__)('Categories List'), 6724 description: (0,external_wp_i18n_namespaceObject.__)('Display a list of all categories.'), 6725 icon: library_category, 6726 attributes: { 6727 taxonomy: 'category' 6728 }, 6729 isActive: ['taxonomy'], 6730 // The following is needed to prevent "Terms List" from showing up twice in the inserter 6731 // (once for the block, once for the variation). Fortunately, it does not collide with 6732 // `categories` being the default value of the `taxonomy` attribute. 6733 isDefault: true 6734 }]; 6735 /* harmony default export */ const categories_variations = (variations); 6736 6737 ;// ./node_modules/@wordpress/block-library/build-module/categories/index.js 6738 /** 6739 * WordPress dependencies 6740 */ 6741 6742 6743 /** 6744 * Internal dependencies 6745 */ 6746 6747 const categories_metadata = { 6748 $schema: "https://schemas.wp.org/trunk/block.json", 6749 apiVersion: 3, 6750 name: "core/categories", 6751 title: "Terms List", 6752 category: "widgets", 6753 description: "Display a list of all terms of a given taxonomy.", 6754 keywords: ["categories"], 6755 textdomain: "default", 6756 attributes: { 6757 taxonomy: { 6758 type: "string", 6759 "default": "category" 6760 }, 6761 displayAsDropdown: { 6762 type: "boolean", 6763 "default": false 6764 }, 6765 showHierarchy: { 6766 type: "boolean", 6767 "default": false 6768 }, 6769 showPostCounts: { 6770 type: "boolean", 6771 "default": false 6772 }, 6773 showOnlyTopLevel: { 6774 type: "boolean", 6775 "default": false 6776 }, 6777 showEmpty: { 6778 type: "boolean", 6779 "default": false 6780 }, 6781 label: { 6782 type: "string", 6783 role: "content" 6784 }, 6785 showLabel: { 6786 type: "boolean", 6787 "default": true 6788 } 6789 }, 6790 usesContext: ["enhancedPagination"], 6791 supports: { 6792 align: true, 6793 html: false, 6794 spacing: { 6795 margin: true, 6796 padding: true, 6797 __experimentalDefaultControls: { 6798 margin: false, 6799 padding: false 6800 } 6801 }, 6802 typography: { 6803 fontSize: true, 6804 lineHeight: true, 6805 __experimentalFontFamily: true, 6806 __experimentalFontWeight: true, 6807 __experimentalFontStyle: true, 6808 __experimentalTextTransform: true, 6809 __experimentalTextDecoration: true, 6810 __experimentalLetterSpacing: true, 6811 __experimentalDefaultControls: { 6812 fontSize: true 6813 } 6814 }, 6815 interactivity: { 6816 clientNavigation: true 6817 }, 6818 __experimentalBorder: { 6819 radius: true, 6820 color: true, 6821 width: true, 6822 style: true, 6823 __experimentalDefaultControls: { 6824 radius: true, 6825 color: true, 6826 width: true, 6827 style: true 6828 } 6829 } 6830 }, 6831 editorStyle: "wp-block-categories-editor", 6832 style: "wp-block-categories" 6833 }; 6834 6835 6836 const { 6837 name: categories_name 6838 } = categories_metadata; 6839 6840 const categories_settings = { 6841 icon: library_category, 6842 example: {}, 6843 edit: CategoriesEdit, 6844 variations: categories_variations 6845 }; 6846 const categories_init = () => initBlock({ 6847 name: categories_name, 6848 metadata: categories_metadata, 6849 settings: categories_settings 6850 }); 6851 6852 ;// ./node_modules/@wordpress/icons/build-module/library/classic.js 6853 /** 6854 * WordPress dependencies 6855 */ 6856 6857 6858 const classic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 6859 viewBox: "0 0 24 24", 6860 xmlns: "http://www.w3.org/2000/svg", 6861 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 6862 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" 6863 }) 6864 }); 6865 /* harmony default export */ const library_classic = (classic); 6866 6867 ;// ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js 6868 /** 6869 * WordPress dependencies 6870 */ 6871 6872 6873 6874 6875 6876 6877 const ConvertToBlocksButton = ({ 6878 clientId 6879 }) => { 6880 const { 6881 replaceBlocks 6882 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 6883 const block = (0,external_wp_data_namespaceObject.useSelect)(select => { 6884 return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId); 6885 }, [clientId]); 6886 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 6887 onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ 6888 HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) 6889 })), 6890 children: (0,external_wp_i18n_namespaceObject.__)('Convert to blocks') 6891 }); 6892 }; 6893 /* harmony default export */ const convert_to_blocks_button = (ConvertToBlocksButton); 6894 6895 ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js 6896 /** 6897 * WordPress dependencies 6898 */ 6899 6900 6901 const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 6902 xmlns: "http://www.w3.org/2000/svg", 6903 viewBox: "0 0 24 24", 6904 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 6905 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" 6906 }) 6907 }); 6908 /* harmony default export */ const library_fullscreen = (fullscreen); 6909 6910 ;// ./node_modules/@wordpress/block-library/build-module/freeform/modal.js 6911 /* wp:polyfill */ 6912 /** 6913 * WordPress dependencies 6914 */ 6915 6916 6917 6918 6919 6920 6921 6922 6923 function ModalAuxiliaryActions({ 6924 onClick, 6925 isModalFullScreen 6926 }) { 6927 // 'small' to match the rules in editor.scss. 6928 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); 6929 if (isMobileViewport) { 6930 return null; 6931 } 6932 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 6933 size: "compact", 6934 onClick: onClick, 6935 icon: library_fullscreen, 6936 isPressed: isModalFullScreen, 6937 label: isModalFullScreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen') 6938 }); 6939 } 6940 function ClassicEdit(props) { 6941 const styles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles); 6942 (0,external_wp_element_namespaceObject.useEffect)(() => { 6943 const { 6944 baseURL, 6945 suffix, 6946 settings 6947 } = window.wpEditorL10n.tinymce; 6948 window.tinymce.EditorManager.overrideDefaults({ 6949 base_url: baseURL, 6950 suffix 6951 }); 6952 window.wp.oldEditor.initialize(props.id, { 6953 tinymce: { 6954 ...settings, 6955 setup(editor) { 6956 editor.on('init', () => { 6957 const doc = editor.getDoc(); 6958 styles.forEach(({ 6959 css 6960 }) => { 6961 const styleEl = doc.createElement('style'); 6962 styleEl.innerHTML = css; 6963 doc.head.appendChild(styleEl); 6964 }); 6965 }); 6966 } 6967 } 6968 }); 6969 return () => { 6970 window.wp.oldEditor.remove(props.id); 6971 }; 6972 }, []); 6973 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { 6974 ...props 6975 }); 6976 } 6977 function ModalEdit(props) { 6978 const { 6979 clientId, 6980 attributes: { 6981 content 6982 }, 6983 setAttributes, 6984 onReplace 6985 } = props; 6986 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 6987 const [isModalFullScreen, setIsModalFullScreen] = (0,external_wp_element_namespaceObject.useState)(false); 6988 const id = `editor-$clientId}`; 6989 const onClose = () => content ? setOpen(false) : onReplace([]); 6990 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 6991 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 6992 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 6993 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 6994 onClick: () => setOpen(true), 6995 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 6996 }) 6997 }) 6998 }), content && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 6999 children: content 7000 }), (isOpen || !content) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { 7001 title: (0,external_wp_i18n_namespaceObject.__)('Classic Editor'), 7002 onRequestClose: onClose, 7003 shouldCloseOnClickOutside: false, 7004 overlayClassName: "block-editor-freeform-modal", 7005 isFullScreen: isModalFullScreen, 7006 className: "block-editor-freeform-modal__content", 7007 headerActions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalAuxiliaryActions, { 7008 onClick: () => setIsModalFullScreen(!isModalFullScreen), 7009 isModalFullScreen: isModalFullScreen 7010 }), 7011 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClassicEdit, { 7012 id: id, 7013 defaultValue: content 7014 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { 7015 className: "block-editor-freeform-modal__actions", 7016 justify: "flex-end", 7017 expanded: false, 7018 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 7019 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 7020 __next40pxDefaultSize: true, 7021 variant: "tertiary", 7022 onClick: onClose, 7023 children: (0,external_wp_i18n_namespaceObject.__)('Cancel') 7024 }) 7025 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 7026 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 7027 __next40pxDefaultSize: true, 7028 variant: "primary", 7029 onClick: () => { 7030 setAttributes({ 7031 content: window.wp.oldEditor.getContent(id) 7032 }); 7033 setOpen(false); 7034 }, 7035 children: (0,external_wp_i18n_namespaceObject.__)('Save') 7036 }) 7037 })] 7038 })] 7039 })] 7040 }); 7041 } 7042 7043 ;// ./node_modules/@wordpress/block-library/build-module/freeform/edit.js 7044 /** 7045 * WordPress dependencies 7046 */ 7047 7048 7049 7050 7051 7052 7053 7054 7055 /** 7056 * Internal dependencies 7057 */ 7058 7059 7060 7061 const { 7062 wp 7063 } = window; 7064 function isTmceEmpty(editor) { 7065 // When tinyMce is empty the content seems to be: 7066 // <p><br data-mce-bogus="1"></p> 7067 // avoid expensive checks for large documents 7068 const body = editor.getBody(); 7069 if (body.childNodes.length > 1) { 7070 return false; 7071 } else if (body.childNodes.length === 0) { 7072 return true; 7073 } 7074 if (body.childNodes[0].childNodes.length > 1) { 7075 return false; 7076 } 7077 return /^\n?$/.test(body.innerText || body.textContent); 7078 } 7079 function FreeformEdit(props) { 7080 const { 7081 clientId 7082 } = props; 7083 const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); 7084 const [isIframed, setIsIframed] = (0,external_wp_element_namespaceObject.useState)(false); 7085 const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 7086 setIsIframed(element.ownerDocument !== document); 7087 }, []); 7088 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 7089 children: [canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 7090 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 7091 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(convert_to_blocks_button, { 7092 clientId: clientId 7093 }) 7094 }) 7095 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7096 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 7097 ref 7098 }), 7099 children: isIframed ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalEdit, { 7100 ...props 7101 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ClassicEdit, { 7102 ...props 7103 }) 7104 })] 7105 }); 7106 } 7107 function edit_ClassicEdit({ 7108 clientId, 7109 attributes: { 7110 content 7111 }, 7112 setAttributes, 7113 onReplace 7114 }) { 7115 const { 7116 getMultiSelectedBlockClientIds 7117 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 7118 const didMountRef = (0,external_wp_element_namespaceObject.useRef)(false); 7119 (0,external_wp_element_namespaceObject.useEffect)(() => { 7120 if (!didMountRef.current) { 7121 return; 7122 } 7123 const editor = window.tinymce.get(`editor-$clientId}`); 7124 if (!editor) { 7125 return; 7126 } 7127 const currentContent = editor.getContent(); 7128 if (currentContent !== content) { 7129 editor.setContent(content || ''); 7130 } 7131 }, [clientId, content]); 7132 (0,external_wp_element_namespaceObject.useEffect)(() => { 7133 const { 7134 baseURL, 7135 suffix 7136 } = window.wpEditorL10n.tinymce; 7137 didMountRef.current = true; 7138 window.tinymce.EditorManager.overrideDefaults({ 7139 base_url: baseURL, 7140 suffix 7141 }); 7142 function onSetup(editor) { 7143 let bookmark; 7144 if (content) { 7145 editor.on('loadContent', () => editor.setContent(content)); 7146 } 7147 editor.on('blur', () => { 7148 bookmark = editor.selection.getBookmark(2, true); 7149 // 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. 7150 // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking 7151 // scroll position until this is fixed in core. 7152 const scrollContainer = document.querySelector('.interface-interface-skeleton__content'); 7153 const scrollPosition = scrollContainer.scrollTop; 7154 7155 // Only update attributes if we aren't multi-selecting blocks. 7156 // Updating during multi-selection can overwrite attributes of other blocks. 7157 if (!getMultiSelectedBlockClientIds()?.length) { 7158 setAttributes({ 7159 content: editor.getContent() 7160 }); 7161 } 7162 editor.once('focus', () => { 7163 if (bookmark) { 7164 editor.selection.moveToBookmark(bookmark); 7165 if (scrollContainer.scrollTop !== scrollPosition) { 7166 scrollContainer.scrollTop = scrollPosition; 7167 } 7168 } 7169 }); 7170 return false; 7171 }); 7172 editor.on('mousedown touchstart', () => { 7173 bookmark = null; 7174 }); 7175 const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => { 7176 const value = editor.getContent(); 7177 if (value !== editor._lastChange) { 7178 editor._lastChange = value; 7179 setAttributes({ 7180 content: value 7181 }); 7182 } 7183 }, 250); 7184 editor.on('Paste Change input Undo Redo', debouncedOnChange); 7185 7186 // We need to cancel the debounce call because when we remove 7187 // the editor (onUnmount) this callback is executed in 7188 // another tick. This results in setting the content to empty. 7189 editor.on('remove', debouncedOnChange.cancel); 7190 editor.on('keydown', event => { 7191 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) { 7192 // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected. 7193 event.stopPropagation(); 7194 } 7195 if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) { 7196 // Delete the block. 7197 onReplace([]); 7198 event.preventDefault(); 7199 event.stopImmediatePropagation(); 7200 } 7201 const { 7202 altKey 7203 } = event; 7204 /* 7205 * Prevent Mousetrap from kicking in: TinyMCE already uses its own 7206 * `alt+f10` shortcut to focus its toolbar. 7207 */ 7208 if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) { 7209 event.stopPropagation(); 7210 } 7211 }); 7212 editor.on('init', () => { 7213 const rootNode = editor.getBody(); 7214 7215 // Create the toolbar by refocussing the editor. 7216 if (rootNode.ownerDocument.activeElement === rootNode) { 7217 rootNode.blur(); 7218 editor.focus(); 7219 } 7220 }); 7221 } 7222 function initialize() { 7223 const { 7224 settings 7225 } = window.wpEditorL10n.tinymce; 7226 wp.oldEditor.initialize(`editor-$clientId}`, { 7227 tinymce: { 7228 ...settings, 7229 inline: true, 7230 content_css: false, 7231 fixed_toolbar_container: `#toolbar-$clientId}`, 7232 setup: onSetup 7233 } 7234 }); 7235 } 7236 function onReadyStateChange() { 7237 if (document.readyState === 'complete') { 7238 initialize(); 7239 } 7240 } 7241 if (document.readyState === 'complete') { 7242 initialize(); 7243 } else { 7244 document.addEventListener('readystatechange', onReadyStateChange); 7245 } 7246 return () => { 7247 document.removeEventListener('readystatechange', onReadyStateChange); 7248 wp.oldEditor.remove(`editor-$clientId}`); 7249 didMountRef.current = false; 7250 }; 7251 }, []); 7252 function focus() { 7253 const editor = window.tinymce.get(`editor-$clientId}`); 7254 if (editor) { 7255 editor.focus(); 7256 } 7257 } 7258 function onToolbarKeyDown(event) { 7259 // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar. 7260 event.stopPropagation(); 7261 // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar. 7262 event.nativeEvent.stopImmediatePropagation(); 7263 } 7264 7265 // Disable reasons: 7266 // 7267 // jsx-a11y/no-static-element-interactions 7268 // - the toolbar itself is non-interactive, but must capture events 7269 // from the KeyboardShortcuts component to stop their propagation. 7270 7271 /* eslint-disable jsx-a11y/no-static-element-interactions */ 7272 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 7273 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7274 id: `toolbar-$clientId}`, 7275 className: "block-library-classic__toolbar", 7276 onClick: focus, 7277 "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), 7278 onKeyDown: onToolbarKeyDown 7279 }, "toolbar"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7280 id: `editor-$clientId}`, 7281 className: "wp-block-freeform block-library-rich-text__tinymce" 7282 }, "editor")] 7283 }); 7284 /* eslint-enable jsx-a11y/no-static-element-interactions */ 7285 } 7286 7287 ;// ./node_modules/@wordpress/block-library/build-module/freeform/save.js 7288 /** 7289 * WordPress dependencies 7290 */ 7291 7292 7293 function freeform_save_save({ 7294 attributes 7295 }) { 7296 const { 7297 content 7298 } = attributes; 7299 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 7300 children: content 7301 }); 7302 } 7303 7304 ;// ./node_modules/@wordpress/block-library/build-module/freeform/index.js 7305 /** 7306 * WordPress dependencies 7307 */ 7308 7309 7310 /** 7311 * Internal dependencies 7312 */ 7313 7314 7315 const freeform_metadata = { 7316 $schema: "https://schemas.wp.org/trunk/block.json", 7317 apiVersion: 3, 7318 name: "core/freeform", 7319 title: "Classic", 7320 category: "text", 7321 description: "Use the classic WordPress editor.", 7322 textdomain: "default", 7323 attributes: { 7324 content: { 7325 type: "string", 7326 source: "raw" 7327 } 7328 }, 7329 supports: { 7330 className: false, 7331 customClassName: false, 7332 reusable: false 7333 }, 7334 editorStyle: "wp-block-freeform-editor" 7335 }; 7336 7337 const { 7338 name: freeform_name 7339 } = freeform_metadata; 7340 7341 const freeform_settings = { 7342 icon: library_classic, 7343 edit: FreeformEdit, 7344 save: freeform_save_save 7345 }; 7346 const freeform_init = () => initBlock({ 7347 name: freeform_name, 7348 metadata: freeform_metadata, 7349 settings: freeform_settings 7350 }); 7351 7352 ;// ./node_modules/@wordpress/icons/build-module/library/code.js 7353 /** 7354 * WordPress dependencies 7355 */ 7356 7357 7358 const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 7359 viewBox: "0 0 24 24", 7360 xmlns: "http://www.w3.org/2000/svg", 7361 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 7362 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" 7363 }) 7364 }); 7365 /* harmony default export */ const library_code = (code); 7366 7367 ;// ./node_modules/@wordpress/block-library/build-module/code/edit.js 7368 /** 7369 * WordPress dependencies 7370 */ 7371 7372 7373 7374 7375 function CodeEdit({ 7376 attributes, 7377 setAttributes, 7378 onRemove, 7379 insertBlocksAfter, 7380 mergeBlocks 7381 }) { 7382 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 7383 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { 7384 ...blockProps, 7385 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 7386 tagName: "code", 7387 identifier: "content", 7388 value: attributes.content, 7389 onChange: content => setAttributes({ 7390 content 7391 }), 7392 onRemove: onRemove, 7393 onMerge: mergeBlocks, 7394 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), 7395 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), 7396 preserveWhiteSpace: true, 7397 __unstablePastePlainText: true, 7398 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 7399 }) 7400 }); 7401 } 7402 7403 ;// ./node_modules/@wordpress/block-library/build-module/code/utils.js 7404 /** 7405 * WordPress dependencies 7406 */ 7407 7408 7409 /** 7410 * Escapes ampersands, shortcodes, and links. 7411 * 7412 * @param {string} content The content of a code block. 7413 * @return {string} The given content with some characters escaped. 7414 */ 7415 function utils_escape(content) { 7416 return (0,external_wp_compose_namespaceObject.pipe)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); 7417 } 7418 7419 /** 7420 * Returns the given content with all opening shortcode characters converted 7421 * into their HTML entity counterpart (i.e. [ => [). For instance, a 7422 * shortcode like [embed] becomes [embed] 7423 * 7424 * This function replicates the escaping of HTML tags, where a tag like 7425 * <strong> becomes <strong>. 7426 * 7427 * @param {string} content The content of a code block. 7428 * @return {string} The given content with its opening shortcode characters 7429 * converted into their HTML entity counterpart 7430 * (i.e. [ => [) 7431 */ 7432 function escapeOpeningSquareBrackets(content) { 7433 return content.replace(/\[/g, '['); 7434 } 7435 7436 /** 7437 * Converts the first two forward slashes of any isolated URL into their HTML 7438 * counterparts (i.e. // => //). For instance, https://youtube.com/watch?x 7439 * becomes https://youtube.com/watch?x. 7440 * 7441 * An isolated URL is a URL that sits in its own line, surrounded only by spacing 7442 * characters. 7443 * 7444 * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403 7445 * 7446 * @param {string} content The content of a code block. 7447 * @return {string} The given content with its ampersands converted into 7448 * their HTML entity counterpart (i.e. & => &) 7449 */ 7450 function escapeProtocolInIsolatedUrls(content) { 7451 return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); 7452 } 7453 7454 ;// ./node_modules/@wordpress/block-library/build-module/code/save.js 7455 /** 7456 * WordPress dependencies 7457 */ 7458 7459 7460 /** 7461 * Internal dependencies 7462 */ 7463 7464 7465 function code_save_save({ 7466 attributes 7467 }) { 7468 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { 7469 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 7470 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 7471 tagName: "code" 7472 // To do: `escape` encodes characters in shortcodes and URLs to 7473 // prevent embedding in PHP. Ideally checks for the code block, 7474 // or pre/code tags, should be made on the PHP side? 7475 , 7476 value: utils_escape(typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString({ 7477 preserveWhiteSpace: true 7478 })) 7479 }) 7480 }); 7481 } 7482 7483 ;// ./node_modules/@wordpress/block-library/build-module/code/transforms.js 7484 /** 7485 * WordPress dependencies 7486 */ 7487 7488 7489 7490 /** 7491 * Internal dependencies 7492 */ 7493 7494 const code_transforms_transforms = { 7495 from: [{ 7496 type: 'enter', 7497 regExp: /^```$/, 7498 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code') 7499 }, { 7500 type: 'block', 7501 blocks: ['core/paragraph'], 7502 transform: ({ 7503 content, 7504 metadata 7505 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { 7506 content, 7507 metadata: getTransformedMetadata(metadata, 'core/code') 7508 }) 7509 }, { 7510 type: 'block', 7511 blocks: ['core/html'], 7512 transform: ({ 7513 content: text, 7514 metadata 7515 }) => { 7516 return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { 7517 // The HTML is plain text (with plain line breaks), so 7518 // convert it to rich text. 7519 content: (0,external_wp_richText_namespaceObject.toHTMLString)({ 7520 value: (0,external_wp_richText_namespaceObject.create)({ 7521 text 7522 }) 7523 }), 7524 metadata: getTransformedMetadata(metadata, 'core/code') 7525 }); 7526 } 7527 }, { 7528 type: 'raw', 7529 isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE', 7530 schema: { 7531 pre: { 7532 children: { 7533 code: { 7534 children: { 7535 '#text': {} 7536 } 7537 } 7538 } 7539 } 7540 } 7541 }], 7542 to: [{ 7543 type: 'block', 7544 blocks: ['core/paragraph'], 7545 transform: ({ 7546 content, 7547 metadata 7548 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 7549 content, 7550 metadata: getTransformedMetadata(metadata, 'core/paragraph') 7551 }) 7552 }] 7553 }; 7554 /* harmony default export */ const code_transforms = (code_transforms_transforms); 7555 7556 ;// ./node_modules/@wordpress/block-library/build-module/code/index.js 7557 /** 7558 * WordPress dependencies 7559 */ 7560 7561 7562 7563 /** 7564 * Internal dependencies 7565 */ 7566 7567 7568 const code_metadata = { 7569 $schema: "https://schemas.wp.org/trunk/block.json", 7570 apiVersion: 3, 7571 name: "core/code", 7572 title: "Code", 7573 category: "text", 7574 description: "Display code snippets that respect your spacing and tabs.", 7575 textdomain: "default", 7576 attributes: { 7577 content: { 7578 type: "rich-text", 7579 source: "rich-text", 7580 selector: "code", 7581 __unstablePreserveWhiteSpace: true 7582 } 7583 }, 7584 supports: { 7585 align: ["wide"], 7586 anchor: true, 7587 typography: { 7588 fontSize: true, 7589 lineHeight: true, 7590 __experimentalFontFamily: true, 7591 __experimentalFontWeight: true, 7592 __experimentalFontStyle: true, 7593 __experimentalTextTransform: true, 7594 __experimentalTextDecoration: true, 7595 __experimentalLetterSpacing: true, 7596 __experimentalDefaultControls: { 7597 fontSize: true 7598 } 7599 }, 7600 spacing: { 7601 margin: ["top", "bottom"], 7602 padding: true, 7603 __experimentalDefaultControls: { 7604 margin: false, 7605 padding: false 7606 } 7607 }, 7608 __experimentalBorder: { 7609 radius: true, 7610 color: true, 7611 width: true, 7612 style: true, 7613 __experimentalDefaultControls: { 7614 width: true, 7615 color: true 7616 } 7617 }, 7618 color: { 7619 text: true, 7620 background: true, 7621 gradients: true, 7622 __experimentalDefaultControls: { 7623 background: true, 7624 text: true 7625 } 7626 }, 7627 interactivity: { 7628 clientNavigation: true 7629 } 7630 }, 7631 style: "wp-block-code" 7632 }; 7633 7634 7635 const { 7636 name: code_name 7637 } = code_metadata; 7638 7639 const code_settings = { 7640 icon: library_code, 7641 example: { 7642 attributes: { 7643 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 7644 // translators: Preserve \n markers for line breaks 7645 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 );') 7646 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 7647 } 7648 }, 7649 merge(attributes, attributesToMerge) { 7650 return { 7651 content: attributes.content + '\n\n' + attributesToMerge.content 7652 }; 7653 }, 7654 transforms: code_transforms, 7655 edit: CodeEdit, 7656 save: code_save_save 7657 }; 7658 const code_init = () => initBlock({ 7659 name: code_name, 7660 metadata: code_metadata, 7661 settings: code_settings 7662 }); 7663 7664 ;// ./node_modules/@wordpress/icons/build-module/library/column.js 7665 /** 7666 * WordPress dependencies 7667 */ 7668 7669 7670 const column = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 7671 xmlns: "http://www.w3.org/2000/svg", 7672 viewBox: "0 0 24 24", 7673 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 7674 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" 7675 }) 7676 }); 7677 /* harmony default export */ const library_column = (column); 7678 7679 ;// ./node_modules/@wordpress/block-library/build-module/column/deprecated.js 7680 /** 7681 * External dependencies 7682 */ 7683 7684 7685 /** 7686 * WordPress dependencies 7687 */ 7688 7689 7690 const column_deprecated_deprecated = [{ 7691 attributes: { 7692 verticalAlignment: { 7693 type: 'string' 7694 }, 7695 width: { 7696 type: 'number', 7697 min: 0, 7698 max: 100 7699 } 7700 }, 7701 isEligible({ 7702 width 7703 }) { 7704 return isFinite(width); 7705 }, 7706 migrate(attributes) { 7707 return { 7708 ...attributes, 7709 width: `$attributes.width}%` 7710 }; 7711 }, 7712 save({ 7713 attributes 7714 }) { 7715 const { 7716 verticalAlignment, 7717 width 7718 } = attributes; 7719 const wrapperClasses = dist_clsx({ 7720 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7721 }); 7722 const style = { 7723 flexBasis: width + '%' 7724 }; 7725 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7726 className: wrapperClasses, 7727 style: style, 7728 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 7729 }); 7730 } 7731 }]; 7732 /* harmony default export */ const column_deprecated = (column_deprecated_deprecated); 7733 7734 ;// ./node_modules/@wordpress/block-library/build-module/column/edit.js 7735 /** 7736 * External dependencies 7737 */ 7738 7739 7740 /** 7741 * WordPress dependencies 7742 */ 7743 7744 7745 7746 7747 7748 /** 7749 * Internal dependencies 7750 */ 7751 7752 7753 function ColumnInspectorControls({ 7754 width, 7755 setAttributes 7756 }) { 7757 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 7758 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 7759 availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] 7760 }); 7761 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 7762 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 7763 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 7764 resetAll: () => { 7765 setAttributes({ 7766 width: undefined 7767 }); 7768 }, 7769 dropdownMenuProps: dropdownMenuProps, 7770 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 7771 hasValue: () => width !== undefined, 7772 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 7773 onDeselect: () => setAttributes({ 7774 width: undefined 7775 }), 7776 isShownByDefault: true, 7777 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 7778 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 7779 __unstableInputWidth: "calc(50% - 8px)", 7780 __next40pxDefaultSize: true, 7781 value: width || '', 7782 onChange: nextWidth => { 7783 nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; 7784 setAttributes({ 7785 width: nextWidth 7786 }); 7787 }, 7788 units: units 7789 }) 7790 }) 7791 }); 7792 } 7793 function ColumnEdit({ 7794 attributes: { 7795 verticalAlignment, 7796 width, 7797 templateLock, 7798 allowedBlocks 7799 }, 7800 setAttributes, 7801 clientId 7802 }) { 7803 const classes = dist_clsx('block-core-columns', { 7804 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7805 }); 7806 const { 7807 columnsIds, 7808 hasChildBlocks, 7809 rootClientId 7810 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 7811 const { 7812 getBlockOrder, 7813 getBlockRootClientId 7814 } = select(external_wp_blockEditor_namespaceObject.store); 7815 const rootId = getBlockRootClientId(clientId); 7816 return { 7817 hasChildBlocks: getBlockOrder(clientId).length > 0, 7818 rootClientId: rootId, 7819 columnsIds: getBlockOrder(rootId) 7820 }; 7821 }, [clientId]); 7822 const { 7823 updateBlockAttributes 7824 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 7825 const updateAlignment = value => { 7826 // Update own alignment. 7827 setAttributes({ 7828 verticalAlignment: value 7829 }); 7830 // Reset parent Columns block. 7831 updateBlockAttributes(rootClientId, { 7832 verticalAlignment: null 7833 }); 7834 }; 7835 const widthWithUnit = Number.isFinite(width) ? width + '%' : width; 7836 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 7837 className: classes, 7838 style: widthWithUnit ? { 7839 flexBasis: widthWithUnit 7840 } : undefined 7841 }); 7842 const columnsCount = columnsIds.length; 7843 const currentColumnPosition = columnsIds.indexOf(clientId) + 1; 7844 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 */ 7845 (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); 7846 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 7847 ...blockProps, 7848 'aria-label': label 7849 }, { 7850 templateLock, 7851 allowedBlocks, 7852 renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 7853 }); 7854 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 7855 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 7856 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { 7857 onChange: updateAlignment, 7858 value: verticalAlignment, 7859 controls: ['top', 'center', 'bottom', 'stretch'] 7860 }) 7861 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 7862 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColumnInspectorControls, { 7863 width: width, 7864 setAttributes: setAttributes 7865 }) 7866 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7867 ...innerBlocksProps 7868 })] 7869 }); 7870 } 7871 /* harmony default export */ const column_edit = (ColumnEdit); 7872 7873 ;// ./node_modules/@wordpress/block-library/build-module/column/save.js 7874 /** 7875 * External dependencies 7876 */ 7877 7878 7879 /** 7880 * WordPress dependencies 7881 */ 7882 7883 7884 function column_save_save({ 7885 attributes 7886 }) { 7887 const { 7888 verticalAlignment, 7889 width 7890 } = attributes; 7891 const wrapperClasses = dist_clsx({ 7892 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 7893 }); 7894 let style; 7895 if (width && /\d/.test(width)) { 7896 // Numbers are handled for backward compatibility as they can be still provided with templates. 7897 let flexBasis = Number.isFinite(width) ? width + '%' : width; 7898 // In some cases we need to round the width to a shorter float. 7899 if (!Number.isFinite(width) && width?.endsWith('%')) { 7900 const multiplier = 1000000000000; 7901 // Shrink the number back to a reasonable float. 7902 flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%'; 7903 } 7904 style = { 7905 flexBasis 7906 }; 7907 } 7908 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 7909 className: wrapperClasses, 7910 style 7911 }); 7912 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 7913 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 7914 ...innerBlocksProps 7915 }); 7916 } 7917 7918 ;// ./node_modules/@wordpress/block-library/build-module/column/index.js 7919 /** 7920 * WordPress dependencies 7921 */ 7922 7923 7924 /** 7925 * Internal dependencies 7926 */ 7927 7928 7929 7930 const column_metadata = { 7931 $schema: "https://schemas.wp.org/trunk/block.json", 7932 apiVersion: 3, 7933 name: "core/column", 7934 title: "Column", 7935 category: "design", 7936 parent: ["core/columns"], 7937 description: "A single column within a columns block.", 7938 textdomain: "default", 7939 attributes: { 7940 verticalAlignment: { 7941 type: "string" 7942 }, 7943 width: { 7944 type: "string" 7945 }, 7946 allowedBlocks: { 7947 type: "array" 7948 }, 7949 templateLock: { 7950 type: ["string", "boolean"], 7951 "enum": ["all", "insert", "contentOnly", false] 7952 } 7953 }, 7954 supports: { 7955 __experimentalOnEnter: true, 7956 anchor: true, 7957 reusable: false, 7958 html: false, 7959 color: { 7960 gradients: true, 7961 heading: true, 7962 button: true, 7963 link: true, 7964 __experimentalDefaultControls: { 7965 background: true, 7966 text: true 7967 } 7968 }, 7969 shadow: true, 7970 spacing: { 7971 blockGap: true, 7972 padding: true, 7973 __experimentalDefaultControls: { 7974 padding: true, 7975 blockGap: true 7976 } 7977 }, 7978 __experimentalBorder: { 7979 color: true, 7980 radius: true, 7981 style: true, 7982 width: true, 7983 __experimentalDefaultControls: { 7984 color: true, 7985 radius: true, 7986 style: true, 7987 width: true 7988 } 7989 }, 7990 typography: { 7991 fontSize: true, 7992 lineHeight: true, 7993 __experimentalFontFamily: true, 7994 __experimentalFontWeight: true, 7995 __experimentalFontStyle: true, 7996 __experimentalTextTransform: true, 7997 __experimentalTextDecoration: true, 7998 __experimentalLetterSpacing: true, 7999 __experimentalDefaultControls: { 8000 fontSize: true 8001 } 8002 }, 8003 layout: true, 8004 interactivity: { 8005 clientNavigation: true 8006 } 8007 } 8008 }; 8009 8010 const { 8011 name: column_name 8012 } = column_metadata; 8013 8014 const column_settings = { 8015 icon: library_column, 8016 edit: column_edit, 8017 save: column_save_save, 8018 deprecated: column_deprecated 8019 }; 8020 const column_init = () => initBlock({ 8021 name: column_name, 8022 metadata: column_metadata, 8023 settings: column_settings 8024 }); 8025 8026 ;// ./node_modules/@wordpress/icons/build-module/library/columns.js 8027 /** 8028 * WordPress dependencies 8029 */ 8030 8031 8032 const columns = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 8033 viewBox: "0 0 24 24", 8034 xmlns: "http://www.w3.org/2000/svg", 8035 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 8036 fillRule: "evenodd", 8037 clipRule: "evenodd", 8038 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" 8039 }) 8040 }); 8041 /* harmony default export */ const library_columns = (columns); 8042 8043 ;// ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js 8044 /* wp:polyfill */ 8045 /** 8046 * External dependencies 8047 */ 8048 8049 8050 /** 8051 * WordPress dependencies 8052 */ 8053 8054 8055 8056 /** 8057 * Given an HTML string for a deprecated columns inner block, returns the 8058 * column index to which the migrated inner block should be assigned. Returns 8059 * undefined if the inner block was not assigned to a column. 8060 * 8061 * @param {string} originalContent Deprecated Columns inner block HTML. 8062 * 8063 * @return {number | undefined} Column to which inner block is to be assigned. 8064 */ 8065 8066 function getDeprecatedLayoutColumn(originalContent) { 8067 let { 8068 doc 8069 } = getDeprecatedLayoutColumn; 8070 if (!doc) { 8071 doc = document.implementation.createHTMLDocument(''); 8072 getDeprecatedLayoutColumn.doc = doc; 8073 } 8074 let columnMatch; 8075 doc.body.innerHTML = originalContent; 8076 for (const classListItem of doc.body.firstChild.classList) { 8077 if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { 8078 return Number(columnMatch[1]) - 1; 8079 } 8080 } 8081 } 8082 const migrateCustomColors = attributes => { 8083 if (!attributes.customTextColor && !attributes.customBackgroundColor) { 8084 return attributes; 8085 } 8086 const style = { 8087 color: {} 8088 }; 8089 if (attributes.customTextColor) { 8090 style.color.text = attributes.customTextColor; 8091 } 8092 if (attributes.customBackgroundColor) { 8093 style.color.background = attributes.customBackgroundColor; 8094 } 8095 const { 8096 customTextColor, 8097 customBackgroundColor, 8098 ...restAttributes 8099 } = attributes; 8100 return { 8101 ...restAttributes, 8102 style, 8103 isStackedOnMobile: true 8104 }; 8105 }; 8106 /* harmony default export */ const columns_deprecated = ([{ 8107 attributes: { 8108 verticalAlignment: { 8109 type: 'string' 8110 }, 8111 backgroundColor: { 8112 type: 'string' 8113 }, 8114 customBackgroundColor: { 8115 type: 'string' 8116 }, 8117 customTextColor: { 8118 type: 'string' 8119 }, 8120 textColor: { 8121 type: 'string' 8122 } 8123 }, 8124 migrate: migrateCustomColors, 8125 save({ 8126 attributes 8127 }) { 8128 const { 8129 verticalAlignment, 8130 backgroundColor, 8131 customBackgroundColor, 8132 textColor, 8133 customTextColor 8134 } = attributes; 8135 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 8136 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 8137 const className = dist_clsx({ 8138 'has-background': backgroundColor || customBackgroundColor, 8139 'has-text-color': textColor || customTextColor, 8140 [backgroundClass]: backgroundClass, 8141 [textClass]: textClass, 8142 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8143 }); 8144 const style = { 8145 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 8146 color: textClass ? undefined : customTextColor 8147 }; 8148 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8149 className: className ? className : undefined, 8150 style: style, 8151 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 8152 }); 8153 } 8154 }, { 8155 attributes: { 8156 columns: { 8157 type: 'number', 8158 default: 2 8159 } 8160 }, 8161 isEligible(attributes, innerBlocks) { 8162 // Since isEligible is called on every valid instance of the 8163 // Columns block and a deprecation is the unlikely case due to 8164 // its subsequent migration, optimize for the `false` condition 8165 // by performing a naive, inaccurate pass at inner blocks. 8166 const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent)); 8167 if (!isFastPassEligible) { 8168 return false; 8169 } 8170 8171 // Only if the fast pass is considered eligible is the more 8172 // accurate, durable, slower condition performed. 8173 return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined); 8174 }, 8175 migrate(attributes, innerBlocks) { 8176 const columns = innerBlocks.reduce((accumulator, innerBlock) => { 8177 const { 8178 originalContent 8179 } = innerBlock; 8180 let columnIndex = getDeprecatedLayoutColumn(originalContent); 8181 if (columnIndex === undefined) { 8182 columnIndex = 0; 8183 } 8184 if (!accumulator[columnIndex]) { 8185 accumulator[columnIndex] = []; 8186 } 8187 accumulator[columnIndex].push(innerBlock); 8188 return accumulator; 8189 }, []); 8190 const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks)); 8191 const { 8192 columns: ignoredColumns, 8193 ...restAttributes 8194 } = attributes; 8195 return [{ 8196 ...restAttributes, 8197 isStackedOnMobile: true 8198 }, migratedInnerBlocks]; 8199 }, 8200 save({ 8201 attributes 8202 }) { 8203 const { 8204 columns 8205 } = attributes; 8206 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8207 className: `has-$columns}-columns`, 8208 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 8209 }); 8210 } 8211 }, { 8212 attributes: { 8213 columns: { 8214 type: 'number', 8215 default: 2 8216 } 8217 }, 8218 migrate(attributes, innerBlocks) { 8219 const { 8220 columns, 8221 ...restAttributes 8222 } = attributes; 8223 attributes = { 8224 ...restAttributes, 8225 isStackedOnMobile: true 8226 }; 8227 return [attributes, innerBlocks]; 8228 }, 8229 save({ 8230 attributes 8231 }) { 8232 const { 8233 verticalAlignment, 8234 columns 8235 } = attributes; 8236 const wrapperClasses = dist_clsx(`has-$columns}-columns`, { 8237 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8238 }); 8239 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8240 className: wrapperClasses, 8241 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 8242 }); 8243 } 8244 }]); 8245 8246 ;// ./node_modules/@wordpress/block-library/build-module/columns/utils.js 8247 /* wp:polyfill */ 8248 /** 8249 * Returns a column width attribute value rounded to standard precision. 8250 * Returns `undefined` if the value is not a valid finite number. 8251 * 8252 * @param {?number} value Raw value. 8253 * 8254 * @return {number} Value rounded to standard precision. 8255 */ 8256 const toWidthPrecision = value => { 8257 const unitlessValue = parseFloat(value); 8258 return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined; 8259 }; 8260 /** 8261 * Returns an effective width for a given block. An effective width is equal to 8262 * its attribute value if set, or a computed value assuming equal distribution. 8263 * 8264 * @param {WPBlock} block Block object. 8265 * @param {number} totalBlockCount Total number of blocks in Columns. 8266 * 8267 * @return {number} Effective column width. 8268 */ 8269 function getEffectiveColumnWidth(block, totalBlockCount) { 8270 const { 8271 width = 100 / totalBlockCount 8272 } = block.attributes; 8273 return toWidthPrecision(width); 8274 } 8275 8276 /** 8277 * Returns the total width occupied by the given set of column blocks. 8278 * 8279 * @param {WPBlock[]} blocks Block objects. 8280 * @param {?number} totalBlockCount Total number of blocks in Columns. 8281 * Defaults to number of blocks passed. 8282 * 8283 * @return {number} Total width occupied by blocks. 8284 */ 8285 function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { 8286 return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0); 8287 } 8288 8289 /** 8290 * Returns an object of `clientId` → `width` of effective column widths. 8291 * 8292 * @param {WPBlock[]} blocks Block objects. 8293 * @param {?number} totalBlockCount Total number of blocks in Columns. 8294 * Defaults to number of blocks passed. 8295 * 8296 * @return {Object<string,number>} Column widths. 8297 */ 8298 function getColumnWidths(blocks, totalBlockCount = blocks.length) { 8299 return blocks.reduce((accumulator, block) => { 8300 const width = getEffectiveColumnWidth(block, totalBlockCount); 8301 return Object.assign(accumulator, { 8302 [block.clientId]: width 8303 }); 8304 }, {}); 8305 } 8306 8307 /** 8308 * Returns an object of `clientId` → `width` of column widths as redistributed 8309 * proportional to their current widths, constrained or expanded to fit within 8310 * the given available width. 8311 * 8312 * @param {WPBlock[]} blocks Block objects. 8313 * @param {number} availableWidth Maximum width to fit within. 8314 * @param {?number} totalBlockCount Total number of blocks in Columns. 8315 * Defaults to number of blocks passed. 8316 * 8317 * @return {Object<string,number>} Redistributed column widths. 8318 */ 8319 function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { 8320 const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); 8321 return Object.fromEntries(Object.entries(getColumnWidths(blocks, totalBlockCount)).map(([clientId, width]) => { 8322 const newWidth = availableWidth * width / totalWidth; 8323 return [clientId, toWidthPrecision(newWidth)]; 8324 })); 8325 } 8326 8327 /** 8328 * Returns true if column blocks within the provided set are assigned with 8329 * explicit widths, or false otherwise. 8330 * 8331 * @param {WPBlock[]} blocks Block objects. 8332 * 8333 * @return {boolean} Whether columns have explicit widths. 8334 */ 8335 function hasExplicitPercentColumnWidths(blocks) { 8336 return blocks.every(block => { 8337 const blockWidth = block.attributes.width; 8338 return Number.isFinite(blockWidth?.endsWith?.('%') ? parseFloat(blockWidth) : blockWidth); 8339 }); 8340 } 8341 8342 /** 8343 * Returns a copy of the given set of blocks with new widths assigned from the 8344 * provided object of redistributed column widths. 8345 * 8346 * @param {WPBlock[]} blocks Block objects. 8347 * @param {Object<string,number>} widths Redistributed column widths. 8348 * 8349 * @return {WPBlock[]} blocks Mapped block objects. 8350 */ 8351 function getMappedColumnWidths(blocks, widths) { 8352 return blocks.map(block => ({ 8353 ...block, 8354 attributes: { 8355 ...block.attributes, 8356 width: `$widths[block.clientId]}%` 8357 } 8358 })); 8359 } 8360 8361 /** 8362 * Returns an array with columns widths values, parsed or no depends on `withParsing` flag. 8363 * 8364 * @param {WPBlock[]} blocks Block objects. 8365 * @param {?boolean} withParsing Whether value has to be parsed. 8366 * 8367 * @return {Array<number,string>} Column widths. 8368 */ 8369 function getWidths(blocks, withParsing = true) { 8370 return blocks.map(innerColumn => { 8371 const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length; 8372 return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth; 8373 }); 8374 } 8375 8376 /** 8377 * Returns a column width with unit. 8378 * 8379 * @param {string} width Column width. 8380 * @param {string} unit Column width unit. 8381 * 8382 * @return {string} Column width with unit. 8383 */ 8384 function getWidthWithUnit(width, unit) { 8385 width = 0 > parseFloat(width) ? '0' : width; 8386 if (isPercentageUnit(unit)) { 8387 width = Math.min(width, 100); 8388 } 8389 return `$width}$unit}`; 8390 } 8391 8392 /** 8393 * Returns a boolean whether passed unit is percentage 8394 * 8395 * @param {string} unit Column width unit. 8396 * 8397 * @return {boolean} Whether unit is '%'. 8398 */ 8399 function isPercentageUnit(unit) { 8400 return unit === '%'; 8401 } 8402 8403 ;// ./node_modules/@wordpress/block-library/build-module/columns/edit.js 8404 /* wp:polyfill */ 8405 /** 8406 * External dependencies 8407 */ 8408 8409 8410 /** 8411 * WordPress dependencies 8412 */ 8413 8414 8415 8416 8417 8418 8419 /** 8420 * Internal dependencies 8421 */ 8422 8423 8424 8425 const edit_DEFAULT_BLOCK = { 8426 name: 'core/column' 8427 }; 8428 function edit_ColumnInspectorControls({ 8429 clientId, 8430 setAttributes, 8431 isStackedOnMobile 8432 }) { 8433 const { 8434 count, 8435 canInsertColumnBlock, 8436 minCount 8437 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 8438 const { 8439 canInsertBlockType, 8440 canRemoveBlock, 8441 getBlockOrder 8442 } = select(external_wp_blockEditor_namespaceObject.store); 8443 const blockOrder = getBlockOrder(clientId); 8444 8445 // Get the indexes of columns for which removal is prevented. 8446 // The highest index will be used to determine the minimum column count. 8447 const preventRemovalBlockIndexes = blockOrder.reduce((acc, blockId, index) => { 8448 if (!canRemoveBlock(blockId)) { 8449 acc.push(index); 8450 } 8451 return acc; 8452 }, []); 8453 return { 8454 count: blockOrder.length, 8455 canInsertColumnBlock: canInsertBlockType('core/column', clientId), 8456 minCount: Math.max(...preventRemovalBlockIndexes) + 1 8457 }; 8458 }, [clientId]); 8459 const { 8460 getBlocks 8461 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 8462 const { 8463 replaceInnerBlocks 8464 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 8465 8466 /** 8467 * Updates the column count, including necessary revisions to child Column 8468 * blocks to grant required or redistribute available space. 8469 * 8470 * @param {number} previousColumns Previous column count. 8471 * @param {number} newColumns New column count. 8472 */ 8473 function updateColumns(previousColumns, newColumns) { 8474 let innerBlocks = getBlocks(clientId); 8475 const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); 8476 8477 // Redistribute available width for existing inner blocks. 8478 const isAddingColumn = newColumns > previousColumns; 8479 if (isAddingColumn && hasExplicitWidths) { 8480 // If adding a new column, assign width to the new column equal to 8481 // as if it were `1 / columns` of the total available space. 8482 const newColumnWidth = toWidthPrecision(100 / newColumns); 8483 const newlyAddedColumns = newColumns - previousColumns; 8484 8485 // Redistribute in consideration of pending block insertion as 8486 // constraining the available working width. 8487 const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth * newlyAddedColumns); 8488 innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({ 8489 length: newlyAddedColumns 8490 }).map(() => { 8491 return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', { 8492 width: `$newColumnWidth}%` 8493 }); 8494 })]; 8495 } else if (isAddingColumn) { 8496 innerBlocks = [...innerBlocks, ...Array.from({ 8497 length: newColumns - previousColumns 8498 }).map(() => { 8499 return (0,external_wp_blocks_namespaceObject.createBlock)('core/column'); 8500 })]; 8501 } else if (newColumns < previousColumns) { 8502 // The removed column will be the last of the inner blocks. 8503 innerBlocks = innerBlocks.slice(0, -(previousColumns - newColumns)); 8504 if (hasExplicitWidths) { 8505 // Redistribute as if block is already removed. 8506 const widths = getRedistributedColumnWidths(innerBlocks, 100); 8507 innerBlocks = getMappedColumnWidths(innerBlocks, widths); 8508 } 8509 } 8510 replaceInnerBlocks(clientId, innerBlocks); 8511 } 8512 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 8513 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 8514 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 8515 resetAll: () => { 8516 updateColumns(count, minCount); 8517 setAttributes({ 8518 isStackedOnMobile: true 8519 }); 8520 }, 8521 dropdownMenuProps: dropdownMenuProps, 8522 children: [canInsertColumnBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 8523 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 8524 isShownByDefault: true, 8525 hasValue: () => count, 8526 onDeselect: () => updateColumns(count, minCount), 8527 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 8528 spacing: 4, 8529 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 8530 __nextHasNoMarginBottom: true, 8531 __next40pxDefaultSize: true, 8532 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 8533 value: count, 8534 onChange: value => updateColumns(count, Math.max(minCount, value)), 8535 min: Math.max(1, minCount), 8536 max: Math.max(6, count) 8537 }), count > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 8538 status: "warning", 8539 isDismissible: false, 8540 children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') 8541 })] 8542 }) 8543 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 8544 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 8545 isShownByDefault: true, 8546 hasValue: () => isStackedOnMobile !== true, 8547 onDeselect: () => setAttributes({ 8548 isStackedOnMobile: true 8549 }), 8550 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 8551 __nextHasNoMarginBottom: true, 8552 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 8553 checked: isStackedOnMobile, 8554 onChange: () => setAttributes({ 8555 isStackedOnMobile: !isStackedOnMobile 8556 }) 8557 }) 8558 })] 8559 }); 8560 } 8561 function ColumnsEditContainer({ 8562 attributes, 8563 setAttributes, 8564 clientId 8565 }) { 8566 const { 8567 isStackedOnMobile, 8568 verticalAlignment, 8569 templateLock 8570 } = attributes; 8571 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 8572 const { 8573 getBlockOrder 8574 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 8575 const { 8576 updateBlockAttributes 8577 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 8578 const classes = dist_clsx({ 8579 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 8580 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 8581 }); 8582 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 8583 className: classes 8584 }); 8585 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 8586 defaultBlock: edit_DEFAULT_BLOCK, 8587 directInsert: true, 8588 orientation: 'horizontal', 8589 renderAppender: false, 8590 templateLock 8591 }); 8592 8593 /** 8594 * Update all child Column blocks with a new vertical alignment setting 8595 * based on whatever alignment is passed in. This allows change to parent 8596 * to override anything set on a individual column basis. 8597 * 8598 * @param {string} newVerticalAlignment The vertical alignment setting. 8599 */ 8600 function updateAlignment(newVerticalAlignment) { 8601 const innerBlockClientIds = getBlockOrder(clientId); 8602 8603 // Update own and child Column block vertical alignments. 8604 // This is a single action; the batching prevents creating multiple history records. 8605 registry.batch(() => { 8606 setAttributes({ 8607 verticalAlignment: newVerticalAlignment 8608 }); 8609 updateBlockAttributes(innerBlockClientIds, { 8610 verticalAlignment: newVerticalAlignment 8611 }); 8612 }); 8613 } 8614 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 8615 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 8616 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { 8617 onChange: updateAlignment, 8618 value: verticalAlignment 8619 }) 8620 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 8621 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ColumnInspectorControls, { 8622 clientId: clientId, 8623 setAttributes: setAttributes, 8624 isStackedOnMobile: isStackedOnMobile 8625 }) 8626 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8627 ...innerBlocksProps 8628 })] 8629 }); 8630 } 8631 function Placeholder({ 8632 clientId, 8633 name, 8634 setAttributes 8635 }) { 8636 const { 8637 blockType, 8638 defaultVariation, 8639 variations 8640 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 8641 const { 8642 getBlockVariations, 8643 getBlockType, 8644 getDefaultBlockVariation 8645 } = select(external_wp_blocks_namespaceObject.store); 8646 return { 8647 blockType: getBlockType(name), 8648 defaultVariation: getDefaultBlockVariation(name, 'block'), 8649 variations: getBlockVariations(name, 'block') 8650 }; 8651 }, [name]); 8652 const { 8653 replaceInnerBlocks 8654 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 8655 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 8656 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8657 ...blockProps, 8658 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { 8659 icon: blockType?.icon?.src, 8660 label: blockType?.title, 8661 variations: variations, 8662 instructions: (0,external_wp_i18n_namespaceObject.__)('Divide into columns. Select a layout:'), 8663 onSelect: (nextVariation = defaultVariation) => { 8664 if (nextVariation.attributes) { 8665 setAttributes(nextVariation.attributes); 8666 } 8667 if (nextVariation.innerBlocks) { 8668 replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); 8669 } 8670 }, 8671 allowSkip: true 8672 }) 8673 }); 8674 } 8675 const ColumnsEdit = props => { 8676 const { 8677 clientId 8678 } = props; 8679 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]); 8680 const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder; 8681 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { 8682 ...props 8683 }); 8684 }; 8685 /* harmony default export */ const columns_edit = (ColumnsEdit); 8686 8687 ;// ./node_modules/@wordpress/block-library/build-module/columns/save.js 8688 /** 8689 * External dependencies 8690 */ 8691 8692 8693 /** 8694 * WordPress dependencies 8695 */ 8696 8697 8698 function columns_save_save({ 8699 attributes 8700 }) { 8701 const { 8702 isStackedOnMobile, 8703 verticalAlignment 8704 } = attributes; 8705 const className = dist_clsx({ 8706 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 8707 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 8708 }); 8709 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 8710 className 8711 }); 8712 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 8713 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 8714 ...innerBlocksProps 8715 }); 8716 } 8717 8718 ;// ./node_modules/@wordpress/block-library/build-module/columns/variations.js 8719 /** 8720 * WordPress dependencies 8721 */ 8722 8723 8724 8725 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 8726 8727 /** 8728 * Template option choices for predefined columns layouts. 8729 * 8730 * @type {WPBlockVariation[]} 8731 */ 8732 8733 const variations_variations = [{ 8734 name: 'one-column-full', 8735 title: (0,external_wp_i18n_namespaceObject.__)('100'), 8736 description: (0,external_wp_i18n_namespaceObject.__)('One column'), 8737 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8738 xmlns: "http://www.w3.org/2000/svg", 8739 width: "48", 8740 height: "48", 8741 viewBox: "0 0 48 48", 8742 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8743 d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" 8744 }) 8745 }), 8746 innerBlocks: [['core/column']], 8747 scope: ['block'] 8748 }, { 8749 name: 'two-columns-equal', 8750 title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'), 8751 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'), 8752 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8753 xmlns: "http://www.w3.org/2000/svg", 8754 width: "48", 8755 height: "48", 8756 viewBox: "0 0 48 48", 8757 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8758 d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" 8759 }) 8760 }), 8761 isDefault: true, 8762 innerBlocks: [['core/column'], ['core/column']], 8763 scope: ['block'] 8764 }, { 8765 name: 'two-columns-one-third-two-thirds', 8766 title: (0,external_wp_i18n_namespaceObject.__)('33 / 66'), 8767 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'), 8768 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8769 xmlns: "http://www.w3.org/2000/svg", 8770 width: "48", 8771 height: "48", 8772 viewBox: "0 0 48 48", 8773 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8774 d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" 8775 }) 8776 }), 8777 innerBlocks: [['core/column', { 8778 width: '33.33%' 8779 }], ['core/column', { 8780 width: '66.66%' 8781 }]], 8782 scope: ['block'] 8783 }, { 8784 name: 'two-columns-two-thirds-one-third', 8785 title: (0,external_wp_i18n_namespaceObject.__)('66 / 33'), 8786 description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'), 8787 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8788 xmlns: "http://www.w3.org/2000/svg", 8789 width: "48", 8790 height: "48", 8791 viewBox: "0 0 48 48", 8792 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8793 d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" 8794 }) 8795 }), 8796 innerBlocks: [['core/column', { 8797 width: '66.66%' 8798 }], ['core/column', { 8799 width: '33.33%' 8800 }]], 8801 scope: ['block'] 8802 }, { 8803 name: 'three-columns-equal', 8804 title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'), 8805 description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'), 8806 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8807 xmlns: "http://www.w3.org/2000/svg", 8808 width: "48", 8809 height: "48", 8810 viewBox: "0 0 48 48", 8811 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8812 d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" 8813 }) 8814 }), 8815 innerBlocks: [['core/column'], ['core/column'], ['core/column']], 8816 scope: ['block'] 8817 }, { 8818 name: 'three-columns-wider-center', 8819 title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'), 8820 description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'), 8821 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 8822 xmlns: "http://www.w3.org/2000/svg", 8823 width: "48", 8824 height: "48", 8825 viewBox: "0 0 48 48", 8826 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 8827 d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" 8828 }) 8829 }), 8830 innerBlocks: [['core/column', { 8831 width: '25%' 8832 }], ['core/column', { 8833 width: '50%' 8834 }], ['core/column', { 8835 width: '25%' 8836 }]], 8837 scope: ['block'] 8838 }]; 8839 /* harmony default export */ const columns_variations = (variations_variations); 8840 8841 ;// ./node_modules/@wordpress/block-library/build-module/columns/transforms.js 8842 /* wp:polyfill */ 8843 /** 8844 * WordPress dependencies 8845 */ 8846 8847 const MAXIMUM_SELECTED_BLOCKS = 6; 8848 const columns_transforms_transforms = { 8849 from: [{ 8850 type: 'block', 8851 isMultiBlock: true, 8852 blocks: ['*'], 8853 __experimentalConvert: blocks => { 8854 const columnWidth = +(100 / blocks.length).toFixed(2); 8855 const innerBlocksTemplate = blocks.map(({ 8856 name, 8857 attributes, 8858 innerBlocks 8859 }) => ['core/column', { 8860 width: `$columnWidth}%` 8861 }, [[name, { 8862 ...attributes 8863 }, innerBlocks]]]); 8864 return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); 8865 }, 8866 isMatch: ({ 8867 length: selectedBlocksLength 8868 }, blocks) => { 8869 // If a user is trying to transform a single Columns block, skip 8870 // the transformation. Enabling this functiontionality creates 8871 // nested Columns blocks resulting in an unintuitive user experience. 8872 // Multiple Columns blocks can still be transformed. 8873 if (blocks.length === 1 && blocks[0].name === 'core/columns') { 8874 return false; 8875 } 8876 return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; 8877 } 8878 }, { 8879 type: 'block', 8880 blocks: ['core/media-text'], 8881 priority: 1, 8882 transform: (attributes, innerBlocks) => { 8883 const { 8884 align, 8885 backgroundColor, 8886 textColor, 8887 style, 8888 mediaAlt: alt, 8889 mediaId: id, 8890 mediaPosition, 8891 mediaSizeSlug: sizeSlug, 8892 mediaType, 8893 mediaUrl: url, 8894 mediaWidth, 8895 verticalAlignment 8896 } = attributes; 8897 let media; 8898 if (mediaType === 'image' || !mediaType) { 8899 const imageAttrs = { 8900 id, 8901 alt, 8902 url, 8903 sizeSlug 8904 }; 8905 const linkAttrs = { 8906 href: attributes.href, 8907 linkClass: attributes.linkClass, 8908 linkDestination: attributes.linkDestination, 8909 linkTarget: attributes.linkTarget, 8910 rel: attributes.rel 8911 }; 8912 media = ['core/image', { 8913 ...imageAttrs, 8914 ...linkAttrs 8915 }]; 8916 } else { 8917 media = ['core/video', { 8918 id, 8919 src: url 8920 }]; 8921 } 8922 const innerBlocksTemplate = [['core/column', { 8923 width: `$mediaWidth}%` 8924 }, [media]], ['core/column', { 8925 width: `$100 - mediaWidth}%` 8926 }, innerBlocks]]; 8927 if (mediaPosition === 'right') { 8928 innerBlocksTemplate.reverse(); 8929 } 8930 return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { 8931 align, 8932 backgroundColor, 8933 textColor, 8934 style, 8935 verticalAlignment 8936 }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); 8937 } 8938 }], 8939 ungroup: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks) 8940 }; 8941 /* harmony default export */ const columns_transforms = (columns_transforms_transforms); 8942 8943 ;// ./node_modules/@wordpress/block-library/build-module/columns/index.js 8944 /** 8945 * WordPress dependencies 8946 */ 8947 8948 8949 8950 /** 8951 * Internal dependencies 8952 */ 8953 8954 8955 8956 const columns_metadata = { 8957 $schema: "https://schemas.wp.org/trunk/block.json", 8958 apiVersion: 3, 8959 name: "core/columns", 8960 title: "Columns", 8961 category: "design", 8962 allowedBlocks: ["core/column"], 8963 description: "Display content in multiple columns, with blocks added to each column.", 8964 textdomain: "default", 8965 attributes: { 8966 verticalAlignment: { 8967 type: "string" 8968 }, 8969 isStackedOnMobile: { 8970 type: "boolean", 8971 "default": true 8972 }, 8973 templateLock: { 8974 type: ["string", "boolean"], 8975 "enum": ["all", "insert", "contentOnly", false] 8976 } 8977 }, 8978 supports: { 8979 anchor: true, 8980 align: ["wide", "full"], 8981 html: false, 8982 color: { 8983 gradients: true, 8984 link: true, 8985 heading: true, 8986 button: true, 8987 __experimentalDefaultControls: { 8988 background: true, 8989 text: true 8990 } 8991 }, 8992 spacing: { 8993 blockGap: { 8994 __experimentalDefault: "2em", 8995 sides: ["horizontal", "vertical"] 8996 }, 8997 margin: ["top", "bottom"], 8998 padding: true, 8999 __experimentalDefaultControls: { 9000 padding: true, 9001 blockGap: true 9002 } 9003 }, 9004 layout: { 9005 allowSwitching: false, 9006 allowInheriting: false, 9007 allowEditing: false, 9008 "default": { 9009 type: "flex", 9010 flexWrap: "nowrap" 9011 } 9012 }, 9013 __experimentalBorder: { 9014 color: true, 9015 radius: true, 9016 style: true, 9017 width: true, 9018 __experimentalDefaultControls: { 9019 color: true, 9020 radius: true, 9021 style: true, 9022 width: true 9023 } 9024 }, 9025 typography: { 9026 fontSize: true, 9027 lineHeight: true, 9028 __experimentalFontFamily: true, 9029 __experimentalFontWeight: true, 9030 __experimentalFontStyle: true, 9031 __experimentalTextTransform: true, 9032 __experimentalTextDecoration: true, 9033 __experimentalLetterSpacing: true, 9034 __experimentalDefaultControls: { 9035 fontSize: true 9036 } 9037 }, 9038 interactivity: { 9039 clientNavigation: true 9040 }, 9041 shadow: true 9042 }, 9043 editorStyle: "wp-block-columns-editor", 9044 style: "wp-block-columns" 9045 }; 9046 9047 9048 9049 const { 9050 name: columns_name 9051 } = columns_metadata; 9052 9053 const columns_settings = { 9054 icon: library_columns, 9055 variations: columns_variations, 9056 example: { 9057 viewportWidth: 782, 9058 // Columns collapse "@media (max-width: 781px)". 9059 innerBlocks: [{ 9060 name: 'core/column', 9061 innerBlocks: [{ 9062 name: 'core/paragraph', 9063 attributes: { 9064 /* translators: example text. */ 9065 content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.') 9066 } 9067 }, { 9068 name: 'core/image', 9069 attributes: { 9070 url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg' 9071 } 9072 }, { 9073 name: 'core/paragraph', 9074 attributes: { 9075 /* translators: example text. */ 9076 content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.') 9077 } 9078 }] 9079 }, { 9080 name: 'core/column', 9081 innerBlocks: [{ 9082 name: 'core/paragraph', 9083 attributes: { 9084 /* translators: example text. */ 9085 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.') 9086 } 9087 }, { 9088 name: 'core/paragraph', 9089 attributes: { 9090 /* translators: example text. */ 9091 content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.') 9092 } 9093 }] 9094 }] 9095 }, 9096 deprecated: columns_deprecated, 9097 edit: columns_edit, 9098 save: columns_save_save, 9099 transforms: columns_transforms 9100 }; 9101 const columns_init = () => initBlock({ 9102 name: columns_name, 9103 metadata: columns_metadata, 9104 settings: columns_settings 9105 }); 9106 9107 ;// ./node_modules/@wordpress/icons/build-module/library/post-comments.js 9108 /** 9109 * WordPress dependencies 9110 */ 9111 9112 9113 const postComments = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 9114 xmlns: "http://www.w3.org/2000/svg", 9115 viewBox: "0 0 24 24", 9116 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 9117 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" 9118 }) 9119 }); 9120 /* harmony default export */ const post_comments = (postComments); 9121 9122 ;// ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js 9123 /** 9124 * WordPress dependencies 9125 */ 9126 9127 9128 // v1: Deprecate the initial version of the block which was called "Comments 9129 // Query Loop" instead of "Comments". 9130 9131 const v1 = { 9132 attributes: { 9133 tagName: { 9134 type: 'string', 9135 default: 'div' 9136 } 9137 }, 9138 apiVersion: 3, 9139 supports: { 9140 align: ['wide', 'full'], 9141 html: false, 9142 color: { 9143 gradients: true, 9144 link: true, 9145 __experimentalDefaultControls: { 9146 background: true, 9147 text: true, 9148 link: true 9149 } 9150 } 9151 }, 9152 save({ 9153 attributes: { 9154 tagName: Tag 9155 } 9156 }) { 9157 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 9158 const { 9159 className 9160 } = blockProps; 9161 const classes = className?.split(' ') || []; 9162 9163 // The ID of the previous version of the block 9164 // didn't have the `wp-block-comments` class, 9165 // so we need to remove it here in order to mimic it. 9166 const newClasses = classes?.filter(cls => cls !== 'wp-block-comments'); 9167 const newBlockProps = { 9168 ...blockProps, 9169 className: newClasses.join(' ') 9170 }; 9171 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 9172 ...newBlockProps, 9173 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 9174 }); 9175 } 9176 }; 9177 /* harmony default export */ const comments_deprecated = ([v1]); 9178 9179 ;// ./node_modules/@wordpress/block-library/build-module/utils/messages.js 9180 /** 9181 * WordPress dependencies 9182 */ 9183 9184 const htmlElementMessages = { 9185 article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), 9186 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."), 9187 div: (0,external_wp_i18n_namespaceObject.__)('The <div> element should only be used if the block is a design element with no semantic meaning.'), 9188 footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'), 9189 header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), 9190 main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), 9191 nav: (0,external_wp_i18n_namespaceObject.__)('The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'), 9192 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.") 9193 }; 9194 9195 ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js 9196 /** 9197 * WordPress dependencies 9198 */ 9199 9200 9201 9202 9203 /** 9204 * Internal dependencies 9205 */ 9206 9207 9208 function CommentsInspectorControls({ 9209 attributes: { 9210 tagName 9211 }, 9212 setAttributes 9213 }) { 9214 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 9215 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 9216 group: "advanced", 9217 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 9218 __nextHasNoMarginBottom: true, 9219 __next40pxDefaultSize: true, 9220 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 9221 options: [{ 9222 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 9223 value: 'div' 9224 }, { 9225 label: '<section>', 9226 value: 'section' 9227 }, { 9228 label: '<aside>', 9229 value: 'aside' 9230 }], 9231 value: tagName, 9232 onChange: value => setAttributes({ 9233 tagName: value 9234 }), 9235 help: htmlElementMessages[tagName] 9236 }) 9237 }) 9238 }); 9239 } 9240 9241 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js 9242 /** 9243 * External dependencies 9244 */ 9245 9246 9247 /** 9248 * WordPress dependencies 9249 */ 9250 9251 9252 9253 9254 9255 9256 9257 const CommentsFormPlaceholder = () => { 9258 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder); 9259 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9260 className: "comment-respond", 9261 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { 9262 className: "comment-reply-title", 9263 children: (0,external_wp_i18n_namespaceObject.__)('Leave a Reply') 9264 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { 9265 noValidate: true, 9266 className: "comment-form", 9267 onSubmit: event => event.preventDefault(), 9268 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { 9269 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { 9270 htmlFor: `comment-$instanceId}`, 9271 children: (0,external_wp_i18n_namespaceObject.__)('Comment') 9272 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { 9273 id: `comment-$instanceId}`, 9274 name: "comment", 9275 cols: "45", 9276 rows: "8", 9277 readOnly: true 9278 })] 9279 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 9280 className: "form-submit wp-block-button", 9281 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 9282 name: "submit", 9283 type: "submit", 9284 className: dist_clsx('wp-block-button__link', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 9285 label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), 9286 value: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), 9287 "aria-disabled": "true" 9288 }) 9289 })] 9290 })] 9291 }); 9292 }; 9293 const CommentsForm = ({ 9294 postId, 9295 postType 9296 }) => { 9297 const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId); 9298 const isSiteEditor = postType === undefined || postId === undefined; 9299 const { 9300 defaultCommentStatus 9301 } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); 9302 const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => postType ? !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports.comments : false); 9303 if (!isSiteEditor && 'open' !== commentStatus) { 9304 if ('closed' === commentStatus) { 9305 const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 9306 __next40pxDefaultSize: true, 9307 onClick: () => setCommentStatus('open'), 9308 variant: "primary", 9309 children: (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post') 9310 }, "enableComments")]; 9311 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 9312 actions: actions, 9313 children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.') 9314 }); 9315 } else if (!postTypeSupportsComments) { 9316 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 9317 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Post type (i.e. "post", "page") */ 9318 (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType) 9319 }); 9320 } else if ('open' !== defaultCommentStatus) { 9321 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 9322 children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.') 9323 }); 9324 } 9325 } 9326 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsFormPlaceholder, {}); 9327 }; 9328 /* harmony default export */ const post_comments_form_form = (CommentsForm); 9329 9330 ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js 9331 /** 9332 * WordPress dependencies 9333 */ 9334 9335 9336 9337 9338 9339 9340 /** 9341 * Internal dependencies 9342 */ 9343 9344 9345 function PostCommentsPlaceholder({ 9346 postType, 9347 postId 9348 }) { 9349 let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 9350 postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title'); 9351 const { 9352 avatarURL 9353 } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); 9354 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9355 className: "wp-block-comments__legacy-placeholder", 9356 inert: "true", 9357 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { 9358 children: /* translators: %s: Post title. */ 9359 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle) 9360 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9361 className: "navigation", 9362 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9363 className: "alignleft", 9364 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 9365 href: "#top", 9366 children: ["\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments')] 9367 }) 9368 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9369 className: "alignright", 9370 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 9371 href: "#top", 9372 children: [(0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"] 9373 }) 9374 })] 9375 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 9376 className: "commentlist", 9377 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 9378 className: "comment even thread-even depth-1", 9379 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("article", { 9380 className: "comment-body", 9381 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("footer", { 9382 className: "comment-meta", 9383 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9384 className: "comment-author vcard", 9385 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 9386 alt: (0,external_wp_i18n_namespaceObject.__)('Commenter Avatar'), 9387 src: avatarURL, 9388 className: "avatar avatar-32 photo", 9389 height: "32", 9390 width: "32", 9391 loading: "lazy" 9392 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("b", { 9393 className: "fn", 9394 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 9395 href: "#top", 9396 className: "url", 9397 children: (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter') 9398 }) 9399 }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { 9400 className: "says", 9401 children: [(0,external_wp_i18n_namespaceObject.__)('says'), ":"] 9402 })] 9403 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9404 className: "comment-metadata", 9405 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 9406 href: "#top", 9407 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { 9408 dateTime: "2000-01-01T00:00:00+00:00", 9409 children: (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am') 9410 }) 9411 }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 9412 className: "edit-link", 9413 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 9414 className: "comment-edit-link", 9415 href: "#top", 9416 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 9417 }) 9418 })] 9419 })] 9420 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9421 className: "comment-content", 9422 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { 9423 children: [(0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>.'), { 9424 a: 9425 /*#__PURE__*/ 9426 // eslint-disable-next-line jsx-a11y/anchor-has-content 9427 (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 9428 href: "https://gravatar.com/" 9429 }) 9430 })] 9431 }) 9432 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9433 className: "reply", 9434 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 9435 className: "comment-reply-link", 9436 href: "#top", 9437 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Reply to A WordPress Commenter'), 9438 children: (0,external_wp_i18n_namespaceObject.__)('Reply') 9439 }) 9440 })] 9441 }) 9442 }) 9443 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9444 className: "navigation", 9445 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9446 className: "alignleft", 9447 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 9448 href: "#top", 9449 children: ["\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments')] 9450 }) 9451 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9452 className: "alignright", 9453 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 9454 href: "#top", 9455 children: [(0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"] 9456 }) 9457 })] 9458 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_form_form, { 9459 postId: postId, 9460 postType: postType 9461 })] 9462 }); 9463 } 9464 9465 ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js 9466 /** 9467 * External dependencies 9468 */ 9469 9470 9471 /** 9472 * WordPress dependencies 9473 */ 9474 9475 9476 9477 9478 /** 9479 * Internal dependencies 9480 */ 9481 9482 9483 function CommentsLegacy({ 9484 attributes, 9485 setAttributes, 9486 context: { 9487 postType, 9488 postId 9489 } 9490 }) { 9491 const { 9492 textAlign 9493 } = attributes; 9494 const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 9495 __next40pxDefaultSize: true, 9496 onClick: () => void setAttributes({ 9497 legacy: false 9498 }), 9499 variant: "primary", 9500 children: (0,external_wp_i18n_namespaceObject.__)('Switch to editable mode') 9501 }, "convert")]; 9502 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9503 className: dist_clsx({ 9504 [`has-text-align-$textAlign}`]: textAlign 9505 }) 9506 }); 9507 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 9508 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 9509 group: "block", 9510 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9511 value: textAlign, 9512 onChange: nextAlign => { 9513 setAttributes({ 9514 textAlign: nextAlign 9515 }); 9516 } 9517 }) 9518 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 9519 ...blockProps, 9520 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 9521 actions: actions, 9522 children: (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.') 9523 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCommentsPlaceholder, { 9524 postId: postId, 9525 postType: postType 9526 })] 9527 })] 9528 }); 9529 } 9530 9531 ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js 9532 const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', { 9533 width: '40px' 9534 }, [['core/avatar', { 9535 size: 40, 9536 style: { 9537 border: { 9538 radius: '20px' 9539 } 9540 } 9541 }]]], ['core/column', {}, [['core/comment-author-name', { 9542 fontSize: 'small' 9543 }], ['core/group', { 9544 layout: { 9545 type: 'flex' 9546 }, 9547 style: { 9548 spacing: { 9549 margin: { 9550 top: '0px', 9551 bottom: '0px' 9552 } 9553 } 9554 } 9555 }, [['core/comment-date', { 9556 fontSize: 'small' 9557 }], ['core/comment-edit-link', { 9558 fontSize: 'small' 9559 }]]], ['core/comment-content'], ['core/comment-reply-link', { 9560 fontSize: 'small' 9561 }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']]; 9562 /* harmony default export */ const template = (TEMPLATE); 9563 9564 ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js 9565 /** 9566 * WordPress dependencies 9567 */ 9568 9569 9570 /** 9571 * Internal dependencies 9572 */ 9573 9574 9575 9576 9577 function CommentsEdit(props) { 9578 const { 9579 attributes, 9580 setAttributes 9581 } = props; 9582 const { 9583 tagName: TagName, 9584 legacy 9585 } = attributes; 9586 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 9587 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 9588 template: template 9589 }); 9590 if (legacy) { 9591 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsLegacy, { 9592 ...props 9593 }); 9594 } 9595 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 9596 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsInspectorControls, { 9597 attributes: attributes, 9598 setAttributes: setAttributes 9599 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 9600 ...innerBlocksProps 9601 })] 9602 }); 9603 } 9604 9605 ;// ./node_modules/@wordpress/block-library/build-module/comments/save.js 9606 /** 9607 * WordPress dependencies 9608 */ 9609 9610 9611 function comments_save_save({ 9612 attributes: { 9613 tagName: Tag, 9614 legacy 9615 } 9616 }) { 9617 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 9618 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 9619 9620 // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner 9621 // blocks, so nothing is saved in that case. 9622 return legacy ? null : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 9623 ...innerBlocksProps 9624 }); 9625 } 9626 9627 ;// ./node_modules/@wordpress/block-library/build-module/comments/index.js 9628 /** 9629 * WordPress dependencies 9630 */ 9631 9632 9633 /** 9634 * Internal dependencies 9635 */ 9636 9637 const comments_metadata = { 9638 $schema: "https://schemas.wp.org/trunk/block.json", 9639 apiVersion: 3, 9640 name: "core/comments", 9641 title: "Comments", 9642 category: "theme", 9643 description: "An advanced block that allows displaying post comments using different visual configurations.", 9644 textdomain: "default", 9645 attributes: { 9646 tagName: { 9647 type: "string", 9648 "default": "div" 9649 }, 9650 legacy: { 9651 type: "boolean", 9652 "default": false 9653 } 9654 }, 9655 supports: { 9656 align: ["wide", "full"], 9657 html: false, 9658 color: { 9659 gradients: true, 9660 heading: true, 9661 link: true, 9662 __experimentalDefaultControls: { 9663 background: true, 9664 text: true, 9665 link: true 9666 } 9667 }, 9668 spacing: { 9669 margin: true, 9670 padding: true 9671 }, 9672 typography: { 9673 fontSize: true, 9674 lineHeight: true, 9675 __experimentalFontFamily: true, 9676 __experimentalFontWeight: true, 9677 __experimentalFontStyle: true, 9678 __experimentalTextTransform: true, 9679 __experimentalTextDecoration: true, 9680 __experimentalLetterSpacing: true, 9681 __experimentalDefaultControls: { 9682 fontSize: true 9683 } 9684 }, 9685 __experimentalBorder: { 9686 radius: true, 9687 color: true, 9688 width: true, 9689 style: true, 9690 __experimentalDefaultControls: { 9691 radius: true, 9692 color: true, 9693 width: true, 9694 style: true 9695 } 9696 } 9697 }, 9698 editorStyle: "wp-block-comments-editor", 9699 usesContext: ["postId", "postType"] 9700 }; 9701 9702 9703 9704 const { 9705 name: comments_name 9706 } = comments_metadata; 9707 9708 const comments_settings = { 9709 icon: post_comments, 9710 example: {}, 9711 edit: CommentsEdit, 9712 save: comments_save_save, 9713 deprecated: comments_deprecated 9714 }; 9715 const comments_init = () => initBlock({ 9716 name: comments_name, 9717 metadata: comments_metadata, 9718 settings: comments_settings 9719 }); 9720 9721 ;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js 9722 /** 9723 * WordPress dependencies 9724 */ 9725 9726 9727 9728 9729 9730 9731 function edit_Edit({ 9732 attributes, 9733 context: { 9734 commentId 9735 }, 9736 setAttributes, 9737 isSelected 9738 }) { 9739 const { 9740 height, 9741 width 9742 } = attributes; 9743 const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); 9744 const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); 9745 const avatarUrls = avatars ? Object.values(avatars) : null; 9746 const sizes = avatars ? Object.keys(avatars) : null; 9747 const minSize = sizes ? sizes[0] : 24; 9748 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 9749 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 9750 const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); 9751 const maxSizeBuffer = Math.floor(maxSize * 2.5); 9752 const { 9753 avatarURL 9754 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 9755 const { 9756 getSettings 9757 } = select(external_wp_blockEditor_namespaceObject.store); 9758 const { 9759 __experimentalDiscussionSettings 9760 } = getSettings(); 9761 return __experimentalDiscussionSettings; 9762 }); 9763 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 9764 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 9765 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 9766 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 9767 __nextHasNoMarginBottom: true, 9768 __next40pxDefaultSize: true, 9769 label: (0,external_wp_i18n_namespaceObject.__)('Image size'), 9770 onChange: newWidth => setAttributes({ 9771 width: newWidth, 9772 height: newWidth 9773 }), 9774 min: minSize, 9775 max: maxSizeBuffer, 9776 initialPosition: width, 9777 value: width 9778 }) 9779 }) 9780 }); 9781 const resizableAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 9782 size: { 9783 width, 9784 height 9785 }, 9786 showHandle: isSelected, 9787 onResizeStop: (event, direction, elt, delta) => { 9788 setAttributes({ 9789 height: parseInt(height + delta.height, 10), 9790 width: parseInt(width + delta.width, 10) 9791 }); 9792 }, 9793 lockAspectRatio: true, 9794 enable: { 9795 top: false, 9796 right: !(0,external_wp_i18n_namespaceObject.isRTL)(), 9797 bottom: true, 9798 left: (0,external_wp_i18n_namespaceObject.isRTL)() 9799 }, 9800 minWidth: minSize, 9801 maxWidth: maxSizeBuffer, 9802 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 9803 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL, 9804 alt: `$authorName} ${(0,external_wp_i18n_namespaceObject.__)('Avatar')}`, 9805 ...blockProps 9806 }) 9807 }); 9808 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 9809 children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 9810 ...spacingProps, 9811 children: resizableAvatar 9812 })] 9813 }); 9814 } 9815 9816 ;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js 9817 /** 9818 * WordPress dependencies 9819 */ 9820 9821 9822 /** 9823 * Internal dependencies 9824 */ 9825 9826 const comment_author_avatar_metadata = { 9827 $schema: "https://schemas.wp.org/trunk/block.json", 9828 apiVersion: 3, 9829 __experimental: "fse", 9830 name: "core/comment-author-avatar", 9831 title: "Comment Author Avatar (deprecated)", 9832 category: "theme", 9833 ancestor: ["core/comment-template"], 9834 description: "This block is deprecated. Please use the Avatar block instead.", 9835 textdomain: "default", 9836 attributes: { 9837 width: { 9838 type: "number", 9839 "default": 96 9840 }, 9841 height: { 9842 type: "number", 9843 "default": 96 9844 } 9845 }, 9846 usesContext: ["commentId"], 9847 supports: { 9848 html: false, 9849 inserter: false, 9850 __experimentalBorder: { 9851 radius: true, 9852 width: true, 9853 color: true, 9854 style: true 9855 }, 9856 color: { 9857 background: true, 9858 text: false, 9859 __experimentalDefaultControls: { 9860 background: true 9861 } 9862 }, 9863 spacing: { 9864 __experimentalSkipSerialization: true, 9865 margin: true, 9866 padding: true 9867 }, 9868 interactivity: { 9869 clientNavigation: true 9870 } 9871 } 9872 }; 9873 9874 const { 9875 name: comment_author_avatar_name 9876 } = comment_author_avatar_metadata; 9877 9878 const comment_author_avatar_settings = { 9879 icon: comment_author_avatar, 9880 edit: edit_Edit 9881 }; 9882 const comment_author_avatar_init = () => initBlock({ 9883 name: comment_author_avatar_name, 9884 metadata: comment_author_avatar_metadata, 9885 settings: comment_author_avatar_settings 9886 }); 9887 9888 ;// ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js 9889 /** 9890 * WordPress dependencies 9891 */ 9892 9893 9894 const commentAuthorName = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 9895 viewBox: "0 0 24 24", 9896 xmlns: "http://www.w3.org/2000/svg", 9897 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 9898 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", 9899 fillRule: "evenodd", 9900 clipRule: "evenodd" 9901 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 9902 d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15", 9903 fillRule: "evenodd", 9904 clipRule: "evenodd" 9905 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, { 9906 cx: "12", 9907 cy: "9", 9908 r: "2", 9909 fillRule: "evenodd", 9910 clipRule: "evenodd" 9911 })] 9912 }); 9913 /* harmony default export */ const comment_author_name = (commentAuthorName); 9914 9915 ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js 9916 /** 9917 * External dependencies 9918 */ 9919 9920 9921 /** 9922 * WordPress dependencies 9923 */ 9924 9925 9926 9927 9928 9929 9930 /** 9931 * Renders the `core/comment-author-name` block on the editor. 9932 * 9933 * @param {Object} props React props. 9934 * @param {Object} props.setAttributes Callback for updating block attributes. 9935 * @param {Object} props.attributes Block attributes. 9936 * @param {string} props.attributes.isLink Whether the author name should be linked. 9937 * @param {string} props.attributes.linkTarget Target of the link. 9938 * @param {string} props.attributes.textAlign Text alignment. 9939 * @param {Object} props.context Inherited context. 9940 * @param {string} props.context.commentId The comment ID. 9941 * 9942 * @return {JSX.Element} React element. 9943 */ 9944 9945 function comment_author_name_edit_Edit({ 9946 attributes: { 9947 isLink, 9948 linkTarget, 9949 textAlign 9950 }, 9951 context: { 9952 commentId 9953 }, 9954 setAttributes 9955 }) { 9956 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 9957 className: dist_clsx({ 9958 [`has-text-align-$textAlign}`]: textAlign 9959 }) 9960 }); 9961 let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => { 9962 const { 9963 getEntityRecord 9964 } = select(external_wp_coreData_namespaceObject.store); 9965 const comment = getEntityRecord('root', 'comment', commentId); 9966 const authorName = comment?.author_name; // eslint-disable-line camelcase 9967 9968 if (comment && !authorName) { 9969 var _user$name; 9970 const user = getEntityRecord('root', 'user', comment.author); 9971 return (_user$name = user?.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous'); 9972 } 9973 return authorName !== null && authorName !== void 0 ? authorName : ''; 9974 }, [commentId]); 9975 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 9976 group: "block", 9977 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 9978 value: textAlign, 9979 onChange: newAlign => setAttributes({ 9980 textAlign: newAlign 9981 }) 9982 }) 9983 }); 9984 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 9985 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 9986 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 9987 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 9988 __nextHasNoMarginBottom: true, 9989 label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'), 9990 onChange: () => setAttributes({ 9991 isLink: !isLink 9992 }), 9993 checked: isLink 9994 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 9995 __nextHasNoMarginBottom: true, 9996 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 9997 onChange: value => setAttributes({ 9998 linkTarget: value ? '_blank' : '_self' 9999 }), 10000 checked: linkTarget === '_blank' 10001 })] 10002 }) 10003 }); 10004 if (!commentId || !displayName) { 10005 displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title'); 10006 } 10007 const displayAuthor = isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 10008 href: "#comment-author-pseudo-link", 10009 onClick: event => event.preventDefault(), 10010 children: displayName 10011 }) : displayName; 10012 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10013 children: [inspectorControls, blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10014 ...blockProps, 10015 children: displayAuthor 10016 })] 10017 }); 10018 } 10019 10020 ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js 10021 /** 10022 * Internal dependencies 10023 */ 10024 10025 const deprecated_v1 = { 10026 attributes: { 10027 isLink: { 10028 type: 'boolean', 10029 default: false 10030 }, 10031 linkTarget: { 10032 type: 'string', 10033 default: '_self' 10034 } 10035 }, 10036 supports: { 10037 html: false, 10038 color: { 10039 gradients: true, 10040 link: true 10041 }, 10042 typography: { 10043 fontSize: true, 10044 lineHeight: true, 10045 __experimentalFontFamily: true, 10046 __experimentalFontWeight: true, 10047 __experimentalFontStyle: true, 10048 __experimentalTextTransform: true, 10049 __experimentalLetterSpacing: true 10050 } 10051 }, 10052 save() { 10053 return null; 10054 }, 10055 migrate: migrate_font_family, 10056 isEligible({ 10057 style 10058 }) { 10059 return style?.typography?.fontFamily; 10060 } 10061 }; 10062 10063 /** 10064 * New deprecations need to be placed first 10065 * for them to have higher priority. 10066 * 10067 * Old deprecations may need to be updated as well. 10068 * 10069 * See block-deprecation.md 10070 */ 10071 /* harmony default export */ const comment_author_name_deprecated = ([deprecated_v1]); 10072 10073 ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js 10074 /** 10075 * WordPress dependencies 10076 */ 10077 10078 10079 /** 10080 * Internal dependencies 10081 */ 10082 10083 const comment_author_name_metadata = { 10084 $schema: "https://schemas.wp.org/trunk/block.json", 10085 apiVersion: 3, 10086 name: "core/comment-author-name", 10087 title: "Comment Author Name", 10088 category: "theme", 10089 ancestor: ["core/comment-template"], 10090 description: "Displays the name of the author of the comment.", 10091 textdomain: "default", 10092 attributes: { 10093 isLink: { 10094 type: "boolean", 10095 "default": true 10096 }, 10097 linkTarget: { 10098 type: "string", 10099 "default": "_self" 10100 }, 10101 textAlign: { 10102 type: "string" 10103 } 10104 }, 10105 usesContext: ["commentId"], 10106 supports: { 10107 html: false, 10108 spacing: { 10109 margin: true, 10110 padding: true 10111 }, 10112 color: { 10113 gradients: true, 10114 link: true, 10115 __experimentalDefaultControls: { 10116 background: true, 10117 text: true, 10118 link: true 10119 } 10120 }, 10121 typography: { 10122 fontSize: true, 10123 lineHeight: true, 10124 __experimentalFontFamily: true, 10125 __experimentalFontWeight: true, 10126 __experimentalFontStyle: true, 10127 __experimentalTextTransform: true, 10128 __experimentalTextDecoration: true, 10129 __experimentalLetterSpacing: true, 10130 __experimentalDefaultControls: { 10131 fontSize: true 10132 } 10133 }, 10134 interactivity: { 10135 clientNavigation: true 10136 }, 10137 __experimentalBorder: { 10138 radius: true, 10139 color: true, 10140 width: true, 10141 style: true, 10142 __experimentalDefaultControls: { 10143 radius: true, 10144 color: true, 10145 width: true, 10146 style: true 10147 } 10148 } 10149 }, 10150 style: "wp-block-comment-author-name" 10151 }; 10152 10153 10154 const { 10155 name: comment_author_name_name 10156 } = comment_author_name_metadata; 10157 10158 const comment_author_name_settings = { 10159 icon: comment_author_name, 10160 edit: comment_author_name_edit_Edit, 10161 deprecated: comment_author_name_deprecated, 10162 example: {} 10163 }; 10164 const comment_author_name_init = () => initBlock({ 10165 name: comment_author_name_name, 10166 metadata: comment_author_name_metadata, 10167 settings: comment_author_name_settings 10168 }); 10169 10170 ;// ./node_modules/@wordpress/icons/build-module/library/comment-content.js 10171 /** 10172 * WordPress dependencies 10173 */ 10174 10175 10176 const commentContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 10177 viewBox: "0 0 24 24", 10178 xmlns: "http://www.w3.org/2000/svg", 10179 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10180 fillRule: "evenodd", 10181 clipRule: "evenodd", 10182 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" 10183 }) 10184 }); 10185 /* harmony default export */ const comment_content = (commentContent); 10186 10187 ;// ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js 10188 /** 10189 * External dependencies 10190 */ 10191 10192 10193 /** 10194 * WordPress dependencies 10195 */ 10196 10197 10198 10199 10200 10201 10202 /** 10203 * Renders the `core/comment-content` block on the editor. 10204 * 10205 * @param {Object} props React props. 10206 * @param {Object} props.setAttributes Callback for updating block attributes. 10207 * @param {Object} props.attributes Block attributes. 10208 * @param {string} props.attributes.textAlign The `textAlign` attribute. 10209 * @param {Object} props.context Inherited context. 10210 * @param {string} props.context.commentId The comment ID. 10211 * 10212 * @return {JSX.Element} React element. 10213 */ 10214 10215 function comment_content_edit_Edit({ 10216 setAttributes, 10217 attributes: { 10218 textAlign 10219 }, 10220 context: { 10221 commentId 10222 } 10223 }) { 10224 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 10225 className: dist_clsx({ 10226 [`has-text-align-$textAlign}`]: textAlign 10227 }) 10228 }); 10229 const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId); 10230 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 10231 group: "block", 10232 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 10233 value: textAlign, 10234 onChange: newAlign => setAttributes({ 10235 textAlign: newAlign 10236 }) 10237 }) 10238 }); 10239 if (!commentId || !content) { 10240 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10241 children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10242 ...blockProps, 10243 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 10244 children: (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title') 10245 }) 10246 })] 10247 }); 10248 } 10249 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10250 children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10251 ...blockProps, 10252 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 10253 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 10254 children: content.rendered 10255 }, "html") 10256 }) 10257 })] 10258 }); 10259 } 10260 10261 ;// ./node_modules/@wordpress/block-library/build-module/comment-content/index.js 10262 /** 10263 * WordPress dependencies 10264 */ 10265 10266 10267 /** 10268 * Internal dependencies 10269 */ 10270 10271 const comment_content_metadata = { 10272 $schema: "https://schemas.wp.org/trunk/block.json", 10273 apiVersion: 3, 10274 name: "core/comment-content", 10275 title: "Comment Content", 10276 category: "theme", 10277 ancestor: ["core/comment-template"], 10278 description: "Displays the contents of a comment.", 10279 textdomain: "default", 10280 usesContext: ["commentId"], 10281 attributes: { 10282 textAlign: { 10283 type: "string" 10284 } 10285 }, 10286 supports: { 10287 color: { 10288 gradients: true, 10289 link: true, 10290 __experimentalDefaultControls: { 10291 background: true, 10292 text: true 10293 } 10294 }, 10295 typography: { 10296 fontSize: true, 10297 lineHeight: true, 10298 __experimentalFontFamily: true, 10299 __experimentalFontWeight: true, 10300 __experimentalFontStyle: true, 10301 __experimentalTextTransform: true, 10302 __experimentalTextDecoration: true, 10303 __experimentalLetterSpacing: true, 10304 __experimentalDefaultControls: { 10305 fontSize: true 10306 } 10307 }, 10308 __experimentalBorder: { 10309 radius: true, 10310 color: true, 10311 width: true, 10312 style: true, 10313 __experimentalDefaultControls: { 10314 radius: true, 10315 color: true, 10316 width: true, 10317 style: true 10318 } 10319 }, 10320 spacing: { 10321 padding: ["horizontal", "vertical"], 10322 __experimentalDefaultControls: { 10323 padding: true 10324 } 10325 }, 10326 html: false 10327 }, 10328 style: "wp-block-comment-content" 10329 }; 10330 10331 const { 10332 name: comment_content_name 10333 } = comment_content_metadata; 10334 10335 const comment_content_settings = { 10336 icon: comment_content, 10337 edit: comment_content_edit_Edit, 10338 example: {} 10339 }; 10340 const comment_content_init = () => initBlock({ 10341 name: comment_content_name, 10342 metadata: comment_content_metadata, 10343 settings: comment_content_settings 10344 }); 10345 10346 ;// ./node_modules/@wordpress/icons/build-module/library/post-date.js 10347 /** 10348 * WordPress dependencies 10349 */ 10350 10351 10352 const postDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 10353 xmlns: "http://www.w3.org/2000/svg", 10354 viewBox: "0 0 24 24", 10355 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10356 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" 10357 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10358 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" 10359 })] 10360 }); 10361 /* harmony default export */ const post_date = (postDate); 10362 10363 ;// external ["wp","date"] 10364 const external_wp_date_namespaceObject = window["wp"]["date"]; 10365 ;// ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js 10366 /** 10367 * WordPress dependencies 10368 */ 10369 10370 10371 10372 10373 10374 10375 /** 10376 * Renders the `core/comment-date` block on the editor. 10377 * 10378 * @param {Object} props React props. 10379 * @param {Object} props.setAttributes Callback for updating block attributes. 10380 * @param {Object} props.attributes Block attributes. 10381 * @param {string} props.attributes.format Format of the date. 10382 * @param {string} props.attributes.isLink Whether the author name should be linked. 10383 * @param {Object} props.context Inherited context. 10384 * @param {string} props.context.commentId The comment ID. 10385 * 10386 * @return {JSX.Element} React element. 10387 */ 10388 10389 function comment_date_edit_Edit({ 10390 attributes: { 10391 format, 10392 isLink 10393 }, 10394 context: { 10395 commentId 10396 }, 10397 setAttributes 10398 }) { 10399 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 10400 let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId); 10401 const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); 10402 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 10403 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 10404 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 10405 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { 10406 format: format, 10407 defaultFormat: siteFormat, 10408 onChange: nextFormat => setAttributes({ 10409 format: nextFormat 10410 }) 10411 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 10412 __nextHasNoMarginBottom: true, 10413 label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'), 10414 onChange: () => setAttributes({ 10415 isLink: !isLink 10416 }), 10417 checked: isLink 10418 })] 10419 }) 10420 }); 10421 if (!commentId || !date) { 10422 date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title'); 10423 } 10424 let commentDate = date instanceof Date ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { 10425 dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date), 10426 children: format === 'human-diff' ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date) 10427 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { 10428 children: date 10429 }); 10430 if (isLink) { 10431 commentDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 10432 href: "#comment-date-pseudo-link", 10433 onClick: event => event.preventDefault(), 10434 children: commentDate 10435 }); 10436 } 10437 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10438 children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10439 ...blockProps, 10440 children: commentDate 10441 })] 10442 }); 10443 } 10444 10445 ;// ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js 10446 /** 10447 * Internal dependencies 10448 */ 10449 10450 const comment_date_deprecated_v1 = { 10451 attributes: { 10452 format: { 10453 type: 'string' 10454 }, 10455 isLink: { 10456 type: 'boolean', 10457 default: false 10458 } 10459 }, 10460 supports: { 10461 html: false, 10462 color: { 10463 gradients: true, 10464 link: true 10465 }, 10466 typography: { 10467 fontSize: true, 10468 lineHeight: true, 10469 __experimentalFontFamily: true, 10470 __experimentalFontWeight: true, 10471 __experimentalFontStyle: true, 10472 __experimentalTextTransform: true, 10473 __experimentalLetterSpacing: true 10474 } 10475 }, 10476 save() { 10477 return null; 10478 }, 10479 migrate: migrate_font_family, 10480 isEligible({ 10481 style 10482 }) { 10483 return style?.typography?.fontFamily; 10484 } 10485 }; 10486 10487 /** 10488 * New deprecations need to be placed first 10489 * for them to have higher priority. 10490 * 10491 * Old deprecations may need to be updated as well. 10492 * 10493 * See block-deprecation.md 10494 */ 10495 /* harmony default export */ const comment_date_deprecated = ([comment_date_deprecated_v1]); 10496 10497 ;// ./node_modules/@wordpress/block-library/build-module/comment-date/index.js 10498 /** 10499 * WordPress dependencies 10500 */ 10501 10502 10503 /** 10504 * Internal dependencies 10505 */ 10506 10507 const comment_date_metadata = { 10508 $schema: "https://schemas.wp.org/trunk/block.json", 10509 apiVersion: 3, 10510 name: "core/comment-date", 10511 title: "Comment Date", 10512 category: "theme", 10513 ancestor: ["core/comment-template"], 10514 description: "Displays the date on which the comment was posted.", 10515 textdomain: "default", 10516 attributes: { 10517 format: { 10518 type: "string" 10519 }, 10520 isLink: { 10521 type: "boolean", 10522 "default": true 10523 } 10524 }, 10525 usesContext: ["commentId"], 10526 supports: { 10527 html: false, 10528 color: { 10529 gradients: true, 10530 link: true, 10531 __experimentalDefaultControls: { 10532 background: true, 10533 text: true, 10534 link: true 10535 } 10536 }, 10537 spacing: { 10538 margin: true, 10539 padding: true 10540 }, 10541 typography: { 10542 fontSize: true, 10543 lineHeight: true, 10544 __experimentalFontFamily: true, 10545 __experimentalFontWeight: true, 10546 __experimentalFontStyle: true, 10547 __experimentalTextTransform: true, 10548 __experimentalTextDecoration: true, 10549 __experimentalLetterSpacing: true, 10550 __experimentalDefaultControls: { 10551 fontSize: true 10552 } 10553 }, 10554 interactivity: { 10555 clientNavigation: true 10556 }, 10557 __experimentalBorder: { 10558 radius: true, 10559 color: true, 10560 width: true, 10561 style: true, 10562 __experimentalDefaultControls: { 10563 radius: true, 10564 color: true, 10565 width: true, 10566 style: true 10567 } 10568 } 10569 }, 10570 style: "wp-block-comment-date" 10571 }; 10572 10573 10574 const { 10575 name: comment_date_name 10576 } = comment_date_metadata; 10577 10578 const comment_date_settings = { 10579 icon: post_date, 10580 edit: comment_date_edit_Edit, 10581 deprecated: comment_date_deprecated, 10582 example: {} 10583 }; 10584 const comment_date_init = () => initBlock({ 10585 name: comment_date_name, 10586 metadata: comment_date_metadata, 10587 settings: comment_date_settings 10588 }); 10589 10590 ;// ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js 10591 /** 10592 * WordPress dependencies 10593 */ 10594 10595 10596 const commentEditLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 10597 width: "24", 10598 height: "24", 10599 viewBox: "0 0 24 24", 10600 xmlns: "http://www.w3.org/2000/svg", 10601 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10602 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" 10603 }) 10604 }); 10605 /* harmony default export */ const comment_edit_link = (commentEditLink); 10606 10607 ;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js 10608 /** 10609 * External dependencies 10610 */ 10611 10612 10613 /** 10614 * WordPress dependencies 10615 */ 10616 10617 10618 10619 10620 function comment_edit_link_edit_Edit({ 10621 attributes: { 10622 linkTarget, 10623 textAlign 10624 }, 10625 setAttributes 10626 }) { 10627 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 10628 className: dist_clsx({ 10629 [`has-text-align-$textAlign}`]: textAlign 10630 }) 10631 }); 10632 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 10633 group: "block", 10634 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 10635 value: textAlign, 10636 onChange: newAlign => setAttributes({ 10637 textAlign: newAlign 10638 }) 10639 }) 10640 }); 10641 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 10642 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 10643 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 10644 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 10645 __nextHasNoMarginBottom: true, 10646 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 10647 onChange: value => setAttributes({ 10648 linkTarget: value ? '_blank' : '_self' 10649 }), 10650 checked: linkTarget === '_blank' 10651 }) 10652 }) 10653 }); 10654 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10655 children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10656 ...blockProps, 10657 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 10658 href: "#edit-comment-pseudo-link", 10659 onClick: event => event.preventDefault(), 10660 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 10661 }) 10662 })] 10663 }); 10664 } 10665 10666 ;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js 10667 /** 10668 * WordPress dependencies 10669 */ 10670 10671 10672 /** 10673 * Internal dependencies 10674 */ 10675 10676 const comment_edit_link_metadata = { 10677 $schema: "https://schemas.wp.org/trunk/block.json", 10678 apiVersion: 3, 10679 name: "core/comment-edit-link", 10680 title: "Comment Edit Link", 10681 category: "theme", 10682 ancestor: ["core/comment-template"], 10683 description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", 10684 textdomain: "default", 10685 usesContext: ["commentId"], 10686 attributes: { 10687 linkTarget: { 10688 type: "string", 10689 "default": "_self" 10690 }, 10691 textAlign: { 10692 type: "string" 10693 } 10694 }, 10695 supports: { 10696 html: false, 10697 color: { 10698 link: true, 10699 gradients: true, 10700 text: false, 10701 __experimentalDefaultControls: { 10702 background: true, 10703 link: true 10704 } 10705 }, 10706 spacing: { 10707 margin: true, 10708 padding: true, 10709 __experimentalDefaultControls: { 10710 margin: false, 10711 padding: false 10712 } 10713 }, 10714 typography: { 10715 fontSize: true, 10716 lineHeight: true, 10717 __experimentalFontFamily: true, 10718 __experimentalFontWeight: true, 10719 __experimentalFontStyle: true, 10720 __experimentalTextTransform: true, 10721 __experimentalTextDecoration: true, 10722 __experimentalLetterSpacing: true, 10723 __experimentalDefaultControls: { 10724 fontSize: true 10725 } 10726 }, 10727 interactivity: { 10728 clientNavigation: true 10729 }, 10730 __experimentalBorder: { 10731 radius: true, 10732 color: true, 10733 width: true, 10734 style: true 10735 } 10736 }, 10737 style: "wp-block-comment-edit-link" 10738 }; 10739 10740 const { 10741 name: comment_edit_link_name 10742 } = comment_edit_link_metadata; 10743 10744 const comment_edit_link_settings = { 10745 icon: comment_edit_link, 10746 edit: comment_edit_link_edit_Edit, 10747 example: {} 10748 }; 10749 const comment_edit_link_init = () => initBlock({ 10750 name: comment_edit_link_name, 10751 metadata: comment_edit_link_metadata, 10752 settings: comment_edit_link_settings 10753 }); 10754 10755 ;// ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js 10756 /** 10757 * WordPress dependencies 10758 */ 10759 10760 10761 const commentReplyLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 10762 width: "24", 10763 height: "24", 10764 viewBox: "0 0 24 24", 10765 xmlns: "http://www.w3.org/2000/svg", 10766 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10767 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" 10768 }) 10769 }); 10770 /* harmony default export */ const comment_reply_link = (commentReplyLink); 10771 10772 ;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js 10773 /** 10774 * External dependencies 10775 */ 10776 10777 10778 /** 10779 * WordPress dependencies 10780 */ 10781 10782 10783 10784 /** 10785 * Renders the `core/comment-reply-link` block on the editor. 10786 * 10787 * @param {Object} props React props. 10788 * @param {Object} props.setAttributes Callback for updating block attributes. 10789 * @param {Object} props.attributes Block attributes. 10790 * @param {string} props.attributes.textAlign The `textAlign` attribute. 10791 * 10792 * @return {JSX.Element} React element. 10793 */ 10794 10795 function comment_reply_link_edit_Edit({ 10796 setAttributes, 10797 attributes: { 10798 textAlign 10799 } 10800 }) { 10801 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 10802 className: dist_clsx({ 10803 [`has-text-align-$textAlign}`]: textAlign 10804 }) 10805 }); 10806 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 10807 group: "block", 10808 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 10809 value: textAlign, 10810 onChange: newAlign => setAttributes({ 10811 textAlign: newAlign 10812 }) 10813 }) 10814 }); 10815 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 10816 children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 10817 ...blockProps, 10818 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 10819 href: "#comment-reply-pseudo-link", 10820 onClick: event => event.preventDefault(), 10821 children: (0,external_wp_i18n_namespaceObject.__)('Reply') 10822 }) 10823 })] 10824 }); 10825 } 10826 /* harmony default export */ const comment_reply_link_edit = (comment_reply_link_edit_Edit); 10827 10828 ;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js 10829 /** 10830 * WordPress dependencies 10831 */ 10832 10833 10834 /** 10835 * Internal dependencies 10836 */ 10837 10838 const comment_reply_link_metadata = { 10839 $schema: "https://schemas.wp.org/trunk/block.json", 10840 apiVersion: 3, 10841 name: "core/comment-reply-link", 10842 title: "Comment Reply Link", 10843 category: "theme", 10844 ancestor: ["core/comment-template"], 10845 description: "Displays a link to reply to a comment.", 10846 textdomain: "default", 10847 usesContext: ["commentId"], 10848 attributes: { 10849 textAlign: { 10850 type: "string" 10851 } 10852 }, 10853 supports: { 10854 color: { 10855 gradients: true, 10856 link: true, 10857 text: false, 10858 __experimentalDefaultControls: { 10859 background: true, 10860 link: true 10861 } 10862 }, 10863 spacing: { 10864 margin: true, 10865 padding: true, 10866 __experimentalDefaultControls: { 10867 margin: false, 10868 padding: false 10869 } 10870 }, 10871 typography: { 10872 fontSize: true, 10873 lineHeight: true, 10874 __experimentalFontFamily: true, 10875 __experimentalFontWeight: true, 10876 __experimentalFontStyle: true, 10877 __experimentalTextTransform: true, 10878 __experimentalTextDecoration: true, 10879 __experimentalLetterSpacing: true, 10880 __experimentalDefaultControls: { 10881 fontSize: true 10882 } 10883 }, 10884 __experimentalBorder: { 10885 radius: true, 10886 color: true, 10887 width: true, 10888 style: true 10889 }, 10890 html: false 10891 }, 10892 style: "wp-block-comment-reply-link" 10893 }; 10894 10895 const { 10896 name: comment_reply_link_name 10897 } = comment_reply_link_metadata; 10898 10899 const comment_reply_link_settings = { 10900 edit: comment_reply_link_edit, 10901 icon: comment_reply_link, 10902 example: {} 10903 }; 10904 const comment_reply_link_init = () => initBlock({ 10905 name: comment_reply_link_name, 10906 metadata: comment_reply_link_metadata, 10907 settings: comment_reply_link_settings 10908 }); 10909 10910 ;// ./node_modules/@wordpress/icons/build-module/library/layout.js 10911 /** 10912 * WordPress dependencies 10913 */ 10914 10915 10916 const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 10917 xmlns: "http://www.w3.org/2000/svg", 10918 viewBox: "0 0 24 24", 10919 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 10920 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" 10921 }) 10922 }); 10923 /* harmony default export */ const library_layout = (layout); 10924 10925 ;// external ["wp","apiFetch"] 10926 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; 10927 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); 10928 ;// ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js 10929 /* wp:polyfill */ 10930 /** 10931 * WordPress dependencies 10932 */ 10933 10934 10935 10936 10937 10938 10939 // This is limited by WP REST API 10940 const MAX_COMMENTS_PER_PAGE = 100; 10941 10942 /** 10943 * Return an object with the query args needed to fetch the default page of 10944 * comments. 10945 * 10946 * @param {Object} props Hook props. 10947 * @param {number} props.postId ID of the post that contains the comments. 10948 * discussion settings. 10949 * 10950 * @return {Object} Query args to retrieve the comments. 10951 */ 10952 const useCommentQueryArgs = ({ 10953 postId 10954 }) => { 10955 // Initialize the query args that are not going to change. 10956 const queryArgs = { 10957 status: 'approve', 10958 order: 'asc', 10959 context: 'embed', 10960 parent: 0, 10961 _embed: 'children' 10962 }; 10963 10964 // Get the Discussion settings that may be needed to query the comments. 10965 const { 10966 pageComments, 10967 commentsPerPage, 10968 defaultCommentsPage: defaultPage 10969 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 10970 const { 10971 getSettings 10972 } = select(external_wp_blockEditor_namespaceObject.store); 10973 const { 10974 __experimentalDiscussionSettings 10975 } = getSettings(); 10976 return __experimentalDiscussionSettings; 10977 }); 10978 10979 // WP REST API doesn't allow fetching more than max items limit set per single page of data. 10980 // As for the editor performance is more important than completeness of data and fetching only the 10981 // max allowed for single page should be enough for the purpose of design and laying out the page. 10982 // Fetching over the limit would return an error here but would work with backend query. 10983 const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; 10984 10985 // Get the number of the default page. 10986 const page = useDefaultPageIndex({ 10987 defaultPage, 10988 postId, 10989 perPage, 10990 queryArgs 10991 }); 10992 10993 // Merge, memoize and return all query arguments, unless the default page's 10994 // number is not known yet. 10995 return (0,external_wp_element_namespaceObject.useMemo)(() => { 10996 return page ? { 10997 ...queryArgs, 10998 post: postId, 10999 per_page: perPage, 11000 page 11001 } : null; 11002 }, [postId, perPage, page]); 11003 }; 11004 11005 /** 11006 * Return the index of the default page, depending on whether `defaultPage` is 11007 * `newest` or `oldest`. In the first case, the only way to know the page's 11008 * index is by using the `X-WP-TotalPages` header, which forces to make an 11009 * additional request. 11010 * 11011 * @param {Object} props Hook props. 11012 * @param {string} props.defaultPage Page shown by default (newest/oldest). 11013 * @param {number} props.postId ID of the post that contains the comments. 11014 * @param {number} props.perPage The number of comments included per page. 11015 * @param {Object} props.queryArgs Other query args. 11016 * 11017 * @return {number} Index of the default comments page. 11018 */ 11019 const useDefaultPageIndex = ({ 11020 defaultPage, 11021 postId, 11022 perPage, 11023 queryArgs 11024 }) => { 11025 // Store the default page indices. 11026 const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({}); 11027 const key = `$postId}_$perPage}`; 11028 const page = defaultPages[key] || 0; 11029 (0,external_wp_element_namespaceObject.useEffect)(() => { 11030 // Do nothing if the page is already known or not the newest page. 11031 if (page || defaultPage !== 'newest') { 11032 return; 11033 } 11034 // We need to fetch comments to know the index. Use HEAD and limit 11035 // fields just to ID, to make this call as light as possible. 11036 external_wp_apiFetch_default()({ 11037 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 11038 ...queryArgs, 11039 post: postId, 11040 per_page: perPage, 11041 _fields: 'id' 11042 }), 11043 method: 'HEAD', 11044 parse: false 11045 }).then(res => { 11046 const pages = parseInt(res.headers.get('X-WP-TotalPages')); 11047 setDefaultPages({ 11048 ...defaultPages, 11049 [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page. 11050 }); 11051 }); 11052 }, [defaultPage, postId, perPage, setDefaultPages]); 11053 11054 // The oldest one is always the first one. 11055 return defaultPage === 'newest' ? page : 1; 11056 }; 11057 11058 /** 11059 * Generate a tree structure of comment IDs from a list of comment entities. The 11060 * children of each comment are obtained from `_embedded`. 11061 * 11062 * @typedef {{ commentId: number, children: CommentNode }} CommentNode 11063 * 11064 * @param {Object[]} topLevelComments List of comment entities. 11065 * @return {{ commentTree: CommentNode[]}} Tree of comment IDs. 11066 */ 11067 const useCommentTree = topLevelComments => { 11068 const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments?.map(({ 11069 id, 11070 _embedded 11071 }) => { 11072 const [children] = _embedded?.children || [[]]; 11073 return { 11074 commentId: id, 11075 children: children.map(child => ({ 11076 commentId: child.id 11077 })) 11078 }; 11079 }), [topLevelComments]); 11080 return commentTree; 11081 }; 11082 11083 ;// ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js 11084 /* wp:polyfill */ 11085 /** 11086 * WordPress dependencies 11087 */ 11088 11089 11090 11091 11092 11093 11094 11095 /** 11096 * Internal dependencies 11097 */ 11098 11099 11100 const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; 11101 11102 /** 11103 * Function that returns a comment structure that will be rendered with default placehoders. 11104 * 11105 * Each comment has a `commentId` property that is always a negative number in 11106 * case of the placeholders. This is to ensure that the comment does not 11107 * conflict with the actual (real) comments. 11108 * 11109 * @param {Object} settings Discussion Settings. 11110 * @param {number} [settings.perPage] - Comments per page setting or block attribute. 11111 * @param {boolean} [settings.pageComments] - Enable break comments into pages setting. 11112 * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting. 11113 * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments. 11114 * 11115 * @typedef {{id: null, children: EmptyComment[]}} EmptyComment 11116 * @return {EmptyComment[]} Inner blocks of the Comment Template 11117 */ 11118 const getCommentsPlaceholder = ({ 11119 perPage, 11120 pageComments, 11121 threadComments, 11122 threadCommentsDepth 11123 }) => { 11124 // Limit commentsDepth to 3 11125 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); 11126 const buildChildrenComment = commentsLevel => { 11127 // Render children comments until commentsDepth is reached 11128 if (commentsLevel < commentsDepth) { 11129 const nextLevel = commentsLevel + 1; 11130 return [{ 11131 commentId: -(commentsLevel + 3), 11132 children: buildChildrenComment(nextLevel) 11133 }]; 11134 } 11135 return []; 11136 }; 11137 11138 // Add the first comment and its children 11139 const placeholderComments = [{ 11140 commentId: -1, 11141 children: buildChildrenComment(1) 11142 }]; 11143 11144 // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max 11145 if ((!pageComments || perPage >= 2) && commentsDepth < 3) { 11146 placeholderComments.push({ 11147 commentId: -2, 11148 children: [] 11149 }); 11150 } 11151 11152 // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments 11153 if ((!pageComments || perPage >= 3) && commentsDepth < 2) { 11154 placeholderComments.push({ 11155 commentId: -3, 11156 children: [] 11157 }); 11158 } 11159 11160 // In case that the value is set but larger than 3 we truncate it to 3. 11161 return placeholderComments; 11162 }; 11163 11164 /** 11165 * Component which renders the inner blocks of the Comment Template. 11166 * 11167 * @param {Object} props Component props. 11168 * @param {Array} [props.comment] - A comment object. 11169 * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. 11170 * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. 11171 * @param {Array} [props.firstCommentId] - ID of the first comment in the array. 11172 * @param {Array} [props.blocks] - Array of blocks returned from 11173 * getBlocks() in parent . 11174 * @return {Element} Inner blocks of the Comment Template 11175 */ 11176 function CommentTemplateInnerBlocks({ 11177 comment, 11178 activeCommentId, 11179 setActiveCommentId, 11180 firstCommentId, 11181 blocks 11182 }) { 11183 const { 11184 children, 11185 ...innerBlocksProps 11186 } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, { 11187 template: edit_TEMPLATE 11188 }); 11189 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 11190 ...innerBlocksProps, 11191 children: [comment.commentId === (activeCommentId || firstCommentId) ? children : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedCommentTemplatePreview, { 11192 blocks: blocks, 11193 commentId: comment.commentId, 11194 setActiveCommentId: setActiveCommentId, 11195 isHidden: comment.commentId === (activeCommentId || firstCommentId) 11196 }), comment?.children?.length > 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { 11197 comments: comment.children, 11198 activeCommentId: activeCommentId, 11199 setActiveCommentId: setActiveCommentId, 11200 blocks: blocks, 11201 firstCommentId: firstCommentId 11202 }) : null] 11203 }); 11204 } 11205 const CommentTemplatePreview = ({ 11206 blocks, 11207 commentId, 11208 setActiveCommentId, 11209 isHidden 11210 }) => { 11211 const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ 11212 blocks 11213 }); 11214 const handleOnClick = () => { 11215 setActiveCommentId(commentId); 11216 }; 11217 11218 // We have to hide the preview block if the `comment` props points to 11219 // the currently active block! 11220 11221 // Or, to put it differently, every preview block is visible unless it is the 11222 // currently active block - in this case we render its inner blocks. 11223 const style = { 11224 display: isHidden ? 'none' : undefined 11225 }; 11226 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 11227 ...blockPreviewProps, 11228 tabIndex: 0, 11229 role: "button", 11230 style: style 11231 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role 11232 , 11233 onClick: handleOnClick, 11234 onKeyPress: handleOnClick 11235 }); 11236 }; 11237 const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview); 11238 11239 /** 11240 * Component that renders a list of (nested) comments. It is called recursively. 11241 * 11242 * @param {Object} props Component props. 11243 * @param {Array} [props.comments] - Array of comment objects. 11244 * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`. 11245 * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. 11246 * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. 11247 * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent. 11248 * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of 11249 * comment objects. 11250 * @return {Element} List of comments. 11251 */ 11252 const CommentsList = ({ 11253 comments, 11254 blockProps, 11255 activeCommentId, 11256 setActiveCommentId, 11257 blocks, 11258 firstCommentId 11259 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 11260 ...blockProps, 11261 children: comments && comments.map(({ 11262 commentId, 11263 ...comment 11264 }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 11265 value: { 11266 // If the commentId is negative it means that this comment is a 11267 // "placeholder" and that the block is most likely being used in the 11268 // site editor. In this case, we have to set the commentId to `null` 11269 // because otherwise the (non-existent) comment with a negative ID 11270 // would be requested from the REST API. 11271 commentId: commentId < 0 ? null : commentId 11272 }, 11273 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentTemplateInnerBlocks, { 11274 comment: { 11275 commentId, 11276 ...comment 11277 }, 11278 activeCommentId: activeCommentId, 11279 setActiveCommentId: setActiveCommentId, 11280 blocks: blocks, 11281 firstCommentId: firstCommentId 11282 }) 11283 }, comment.commentId || index)) 11284 }); 11285 function CommentTemplateEdit({ 11286 clientId, 11287 context: { 11288 postId 11289 } 11290 }) { 11291 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 11292 const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)(); 11293 const { 11294 commentOrder, 11295 threadCommentsDepth, 11296 threadComments, 11297 commentsPerPage, 11298 pageComments 11299 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 11300 const { 11301 getSettings 11302 } = select(external_wp_blockEditor_namespaceObject.store); 11303 return getSettings().__experimentalDiscussionSettings; 11304 }); 11305 const commentQuery = useCommentQueryArgs({ 11306 postId 11307 }); 11308 const { 11309 topLevelComments, 11310 blocks 11311 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 11312 const { 11313 getEntityRecords 11314 } = select(external_wp_coreData_namespaceObject.store); 11315 const { 11316 getBlocks 11317 } = select(external_wp_blockEditor_namespaceObject.store); 11318 return { 11319 // Request only top-level comments. Replies are embedded. 11320 topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null, 11321 blocks: getBlocks(clientId) 11322 }; 11323 }, [clientId, commentQuery]); 11324 11325 // Generate a tree structure of comment IDs. 11326 let commentTree = useCommentTree( 11327 // Reverse the order of top comments if needed. 11328 commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments); 11329 if (!topLevelComments) { 11330 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 11331 ...blockProps, 11332 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 11333 }); 11334 } 11335 if (!postId) { 11336 commentTree = getCommentsPlaceholder({ 11337 perPage: commentsPerPage, 11338 pageComments, 11339 threadComments, 11340 threadCommentsDepth 11341 }); 11342 } 11343 if (!commentTree.length) { 11344 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 11345 ...blockProps, 11346 children: (0,external_wp_i18n_namespaceObject.__)('No results found.') 11347 }); 11348 } 11349 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { 11350 comments: commentTree, 11351 blockProps: blockProps, 11352 blocks: blocks, 11353 activeCommentId: activeCommentId, 11354 setActiveCommentId: setActiveCommentId, 11355 firstCommentId: commentTree[0]?.commentId 11356 }); 11357 } 11358 11359 ;// ./node_modules/@wordpress/block-library/build-module/comment-template/save.js 11360 /** 11361 * WordPress dependencies 11362 */ 11363 11364 11365 function CommentTemplateSave() { 11366 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 11367 } 11368 11369 ;// ./node_modules/@wordpress/block-library/build-module/comment-template/index.js 11370 /** 11371 * WordPress dependencies 11372 */ 11373 11374 11375 /** 11376 * Internal dependencies 11377 */ 11378 11379 const comment_template_metadata = { 11380 $schema: "https://schemas.wp.org/trunk/block.json", 11381 apiVersion: 3, 11382 name: "core/comment-template", 11383 title: "Comment Template", 11384 category: "design", 11385 parent: ["core/comments"], 11386 description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", 11387 textdomain: "default", 11388 usesContext: ["postId"], 11389 supports: { 11390 align: true, 11391 html: false, 11392 reusable: false, 11393 spacing: { 11394 margin: true, 11395 padding: true 11396 }, 11397 typography: { 11398 fontSize: true, 11399 lineHeight: true, 11400 __experimentalFontFamily: true, 11401 __experimentalFontWeight: true, 11402 __experimentalFontStyle: true, 11403 __experimentalTextTransform: true, 11404 __experimentalTextDecoration: true, 11405 __experimentalLetterSpacing: true, 11406 __experimentalDefaultControls: { 11407 fontSize: true 11408 } 11409 }, 11410 interactivity: { 11411 clientNavigation: true 11412 }, 11413 __experimentalBorder: { 11414 radius: true, 11415 color: true, 11416 width: true, 11417 style: true, 11418 __experimentalDefaultControls: { 11419 radius: true, 11420 color: true, 11421 width: true, 11422 style: true 11423 } 11424 } 11425 }, 11426 style: "wp-block-comment-template" 11427 }; 11428 11429 11430 const { 11431 name: comment_template_name 11432 } = comment_template_metadata; 11433 11434 const comment_template_settings = { 11435 icon: library_layout, 11436 edit: CommentTemplateEdit, 11437 save: CommentTemplateSave 11438 }; 11439 const comment_template_init = () => initBlock({ 11440 name: comment_template_name, 11441 metadata: comment_template_metadata, 11442 settings: comment_template_settings 11443 }); 11444 11445 ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js 11446 /** 11447 * WordPress dependencies 11448 */ 11449 11450 11451 const queryPaginationPrevious = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 11452 xmlns: "http://www.w3.org/2000/svg", 11453 viewBox: "0 0 24 24", 11454 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 11455 d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" 11456 }) 11457 }); 11458 /* harmony default export */ const query_pagination_previous = (queryPaginationPrevious); 11459 11460 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js 11461 /** 11462 * WordPress dependencies 11463 */ 11464 11465 11466 11467 const arrowMap = { 11468 none: '', 11469 arrow: '←', 11470 chevron: '«' 11471 }; 11472 function CommentsPaginationPreviousEdit({ 11473 attributes: { 11474 label 11475 }, 11476 setAttributes, 11477 context: { 11478 'comments/paginationArrow': paginationArrow 11479 } 11480 }) { 11481 const displayArrow = arrowMap[paginationArrow]; 11482 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 11483 href: "#comments-pagination-previous-pseudo-link", 11484 onClick: event => event.preventDefault(), 11485 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 11486 children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 11487 className: `wp-block-comments-pagination-previous-arrow is-arrow-$paginationArrow}`, 11488 children: displayArrow 11489 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 11490 __experimentalVersion: 2, 11491 tagName: "span", 11492 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'), 11493 placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'), 11494 value: label, 11495 onChange: newLabel => setAttributes({ 11496 label: newLabel 11497 }) 11498 })] 11499 }); 11500 } 11501 11502 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js 11503 /** 11504 * WordPress dependencies 11505 */ 11506 11507 11508 11509 /** 11510 * Internal dependencies 11511 */ 11512 11513 const comments_pagination_previous_metadata = { 11514 $schema: "https://schemas.wp.org/trunk/block.json", 11515 apiVersion: 3, 11516 name: "core/comments-pagination-previous", 11517 title: "Comments Previous Page", 11518 category: "theme", 11519 parent: ["core/comments-pagination"], 11520 description: "Displays the previous comment's page link.", 11521 textdomain: "default", 11522 attributes: { 11523 label: { 11524 type: "string" 11525 } 11526 }, 11527 usesContext: ["postId", "comments/paginationArrow"], 11528 supports: { 11529 reusable: false, 11530 html: false, 11531 color: { 11532 gradients: true, 11533 text: false, 11534 __experimentalDefaultControls: { 11535 background: true 11536 } 11537 }, 11538 typography: { 11539 fontSize: true, 11540 lineHeight: true, 11541 __experimentalFontFamily: true, 11542 __experimentalFontWeight: true, 11543 __experimentalFontStyle: true, 11544 __experimentalTextTransform: true, 11545 __experimentalTextDecoration: true, 11546 __experimentalLetterSpacing: true, 11547 __experimentalDefaultControls: { 11548 fontSize: true 11549 } 11550 }, 11551 interactivity: { 11552 clientNavigation: true 11553 } 11554 } 11555 }; 11556 11557 const { 11558 name: comments_pagination_previous_name 11559 } = comments_pagination_previous_metadata; 11560 11561 const comments_pagination_previous_settings = { 11562 icon: query_pagination_previous, 11563 edit: CommentsPaginationPreviousEdit, 11564 example: { 11565 attributes: { 11566 label: (0,external_wp_i18n_namespaceObject.__)('Older Comments') 11567 } 11568 } 11569 }; 11570 const comments_pagination_previous_init = () => initBlock({ 11571 name: comments_pagination_previous_name, 11572 metadata: comments_pagination_previous_metadata, 11573 settings: comments_pagination_previous_settings 11574 }); 11575 11576 ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination.js 11577 /** 11578 * WordPress dependencies 11579 */ 11580 11581 11582 const queryPagination = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 11583 xmlns: "http://www.w3.org/2000/svg", 11584 viewBox: "0 0 24 24", 11585 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 11586 d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" 11587 }) 11588 }); 11589 /* harmony default export */ const query_pagination = (queryPagination); 11590 11591 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js 11592 /** 11593 * WordPress dependencies 11594 */ 11595 11596 11597 11598 function CommentsPaginationArrowControls({ 11599 value, 11600 onChange 11601 }) { 11602 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 11603 __next40pxDefaultSize: true, 11604 __nextHasNoMarginBottom: true, 11605 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 11606 value: value, 11607 onChange: onChange, 11608 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'), 11609 isBlock: true, 11610 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 11611 value: "none", 11612 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks') 11613 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 11614 value: "arrow", 11615 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks') 11616 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 11617 value: "chevron", 11618 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks') 11619 })] 11620 }); 11621 } 11622 11623 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js 11624 /** 11625 * WordPress dependencies 11626 */ 11627 11628 11629 11630 11631 11632 /** 11633 * Internal dependencies 11634 */ 11635 11636 11637 const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']]; 11638 function QueryPaginationEdit({ 11639 attributes: { 11640 paginationArrow 11641 }, 11642 setAttributes, 11643 clientId 11644 }) { 11645 const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { 11646 const { 11647 getBlocks 11648 } = select(external_wp_blockEditor_namespaceObject.store); 11649 const innerBlocks = getBlocks(clientId); 11650 /** 11651 * Show the `paginationArrow` control only if a 11652 * Comments Pagination Next or Comments Pagination Previous 11653 * block exists. 11654 */ 11655 return innerBlocks?.find(innerBlock => { 11656 return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name); 11657 }); 11658 }, []); 11659 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 11660 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 11661 template: comments_pagination_edit_TEMPLATE 11662 }); 11663 11664 // Get the Discussion settings 11665 const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => { 11666 const { 11667 getSettings 11668 } = select(external_wp_blockEditor_namespaceObject.store); 11669 const { 11670 __experimentalDiscussionSettings 11671 } = getSettings(); 11672 return __experimentalDiscussionSettings?.pageComments; 11673 }, []); 11674 11675 // If paging comments is not enabled in the Discussion Settings then hide the pagination 11676 // controls. We don't want to remove them from the template so that when the user enables 11677 // paging comments, the controls will be visible. 11678 if (!pageComments) { 11679 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 11680 children: (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings') 11681 }); 11682 } 11683 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 11684 children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 11685 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 11686 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 11687 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsPaginationArrowControls, { 11688 value: paginationArrow, 11689 onChange: value => { 11690 setAttributes({ 11691 paginationArrow: value 11692 }); 11693 } 11694 }) 11695 }) 11696 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 11697 ...innerBlocksProps 11698 })] 11699 }); 11700 } 11701 11702 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js 11703 /** 11704 * WordPress dependencies 11705 */ 11706 11707 11708 function comments_pagination_save_save() { 11709 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 11710 } 11711 11712 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js 11713 /** 11714 * WordPress dependencies 11715 */ 11716 11717 11718 /** 11719 * Internal dependencies 11720 */ 11721 11722 const comments_pagination_metadata = { 11723 $schema: "https://schemas.wp.org/trunk/block.json", 11724 apiVersion: 3, 11725 name: "core/comments-pagination", 11726 title: "Comments Pagination", 11727 category: "theme", 11728 parent: ["core/comments"], 11729 allowedBlocks: ["core/comments-pagination-previous", "core/comments-pagination-numbers", "core/comments-pagination-next"], 11730 description: "Displays a paginated navigation to next/previous set of comments, when applicable.", 11731 textdomain: "default", 11732 attributes: { 11733 paginationArrow: { 11734 type: "string", 11735 "default": "none" 11736 } 11737 }, 11738 example: { 11739 attributes: { 11740 paginationArrow: "none" 11741 } 11742 }, 11743 providesContext: { 11744 "comments/paginationArrow": "paginationArrow" 11745 }, 11746 supports: { 11747 align: true, 11748 reusable: false, 11749 html: false, 11750 color: { 11751 gradients: true, 11752 link: true, 11753 __experimentalDefaultControls: { 11754 background: true, 11755 text: true, 11756 link: true 11757 } 11758 }, 11759 layout: { 11760 allowSwitching: false, 11761 allowInheriting: false, 11762 "default": { 11763 type: "flex" 11764 } 11765 }, 11766 typography: { 11767 fontSize: true, 11768 lineHeight: true, 11769 __experimentalFontFamily: true, 11770 __experimentalFontWeight: true, 11771 __experimentalFontStyle: true, 11772 __experimentalTextTransform: true, 11773 __experimentalTextDecoration: true, 11774 __experimentalLetterSpacing: true, 11775 __experimentalDefaultControls: { 11776 fontSize: true 11777 } 11778 }, 11779 interactivity: { 11780 clientNavigation: true 11781 } 11782 }, 11783 editorStyle: "wp-block-comments-pagination-editor", 11784 style: "wp-block-comments-pagination" 11785 }; 11786 11787 11788 const { 11789 name: comments_pagination_name 11790 } = comments_pagination_metadata; 11791 11792 const comments_pagination_settings = { 11793 icon: query_pagination, 11794 edit: QueryPaginationEdit, 11795 save: comments_pagination_save_save 11796 }; 11797 const comments_pagination_init = () => initBlock({ 11798 name: comments_pagination_name, 11799 metadata: comments_pagination_metadata, 11800 settings: comments_pagination_settings 11801 }); 11802 11803 ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js 11804 /** 11805 * WordPress dependencies 11806 */ 11807 11808 11809 const queryPaginationNext = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 11810 xmlns: "http://www.w3.org/2000/svg", 11811 viewBox: "0 0 24 24", 11812 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 11813 d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" 11814 }) 11815 }); 11816 /* harmony default export */ const query_pagination_next = (queryPaginationNext); 11817 11818 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js 11819 /** 11820 * WordPress dependencies 11821 */ 11822 11823 11824 11825 const edit_arrowMap = { 11826 none: '', 11827 arrow: '→', 11828 chevron: '»' 11829 }; 11830 function CommentsPaginationNextEdit({ 11831 attributes: { 11832 label 11833 }, 11834 setAttributes, 11835 context: { 11836 'comments/paginationArrow': paginationArrow 11837 } 11838 }) { 11839 const displayArrow = edit_arrowMap[paginationArrow]; 11840 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 11841 href: "#comments-pagination-next-pseudo-link", 11842 onClick: event => event.preventDefault(), 11843 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 11844 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 11845 __experimentalVersion: 2, 11846 tagName: "span", 11847 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'), 11848 placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), 11849 value: label, 11850 onChange: newLabel => setAttributes({ 11851 label: newLabel 11852 }) 11853 }), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 11854 className: `wp-block-comments-pagination-next-arrow is-arrow-$paginationArrow}`, 11855 children: displayArrow 11856 })] 11857 }); 11858 } 11859 11860 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js 11861 /** 11862 * WordPress dependencies 11863 */ 11864 11865 11866 11867 /** 11868 * Internal dependencies 11869 */ 11870 11871 const comments_pagination_next_metadata = { 11872 $schema: "https://schemas.wp.org/trunk/block.json", 11873 apiVersion: 3, 11874 name: "core/comments-pagination-next", 11875 title: "Comments Next Page", 11876 category: "theme", 11877 parent: ["core/comments-pagination"], 11878 description: "Displays the next comment's page link.", 11879 textdomain: "default", 11880 attributes: { 11881 label: { 11882 type: "string" 11883 } 11884 }, 11885 usesContext: ["postId", "comments/paginationArrow"], 11886 supports: { 11887 reusable: false, 11888 html: false, 11889 color: { 11890 gradients: true, 11891 text: false, 11892 __experimentalDefaultControls: { 11893 background: true 11894 } 11895 }, 11896 typography: { 11897 fontSize: true, 11898 lineHeight: true, 11899 __experimentalFontFamily: true, 11900 __experimentalFontWeight: true, 11901 __experimentalFontStyle: true, 11902 __experimentalTextTransform: true, 11903 __experimentalTextDecoration: true, 11904 __experimentalLetterSpacing: true, 11905 __experimentalDefaultControls: { 11906 fontSize: true 11907 } 11908 }, 11909 interactivity: { 11910 clientNavigation: true 11911 } 11912 } 11913 }; 11914 11915 const { 11916 name: comments_pagination_next_name 11917 } = comments_pagination_next_metadata; 11918 11919 const comments_pagination_next_settings = { 11920 icon: query_pagination_next, 11921 edit: CommentsPaginationNextEdit, 11922 example: { 11923 attributes: { 11924 label: (0,external_wp_i18n_namespaceObject.__)('Newer Comments') 11925 } 11926 } 11927 }; 11928 const comments_pagination_next_init = () => initBlock({ 11929 name: comments_pagination_next_name, 11930 metadata: comments_pagination_next_metadata, 11931 settings: comments_pagination_next_settings 11932 }); 11933 11934 ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js 11935 /** 11936 * WordPress dependencies 11937 */ 11938 11939 11940 const queryPaginationNumbers = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 11941 xmlns: "http://www.w3.org/2000/svg", 11942 viewBox: "0 0 24 24", 11943 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 11944 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" 11945 }) 11946 }); 11947 /* harmony default export */ const query_pagination_numbers = (queryPaginationNumbers); 11948 11949 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js 11950 /** 11951 * WordPress dependencies 11952 */ 11953 11954 11955 const PaginationItem = ({ 11956 content, 11957 tag: Tag = 'a', 11958 extraClass = '' 11959 }) => Tag === 'a' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 11960 className: `page-numbers $extraClass}`, 11961 href: "#comments-pagination-numbers-pseudo-link", 11962 onClick: event => event.preventDefault(), 11963 children: content 11964 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 11965 className: `page-numbers $extraClass}`, 11966 children: content 11967 }); 11968 function CommentsPaginationNumbersEdit() { 11969 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 11970 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 11971 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11972 content: "1" 11973 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11974 content: "2" 11975 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11976 content: "3", 11977 tag: "span", 11978 extraClass: "current" 11979 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11980 content: "4" 11981 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11982 content: "5" 11983 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11984 content: "...", 11985 tag: "span", 11986 extraClass: "dots" 11987 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { 11988 content: "8" 11989 })] 11990 }); 11991 } 11992 11993 ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js 11994 /** 11995 * WordPress dependencies 11996 */ 11997 11998 11999 /** 12000 * Internal dependencies 12001 */ 12002 12003 const comments_pagination_numbers_metadata = { 12004 $schema: "https://schemas.wp.org/trunk/block.json", 12005 apiVersion: 3, 12006 name: "core/comments-pagination-numbers", 12007 title: "Comments Page Numbers", 12008 category: "theme", 12009 parent: ["core/comments-pagination"], 12010 description: "Displays a list of page numbers for comments pagination.", 12011 textdomain: "default", 12012 usesContext: ["postId"], 12013 supports: { 12014 reusable: false, 12015 html: false, 12016 color: { 12017 gradients: true, 12018 text: false, 12019 __experimentalDefaultControls: { 12020 background: true 12021 } 12022 }, 12023 typography: { 12024 fontSize: true, 12025 lineHeight: true, 12026 __experimentalFontFamily: true, 12027 __experimentalFontWeight: true, 12028 __experimentalFontStyle: true, 12029 __experimentalTextTransform: true, 12030 __experimentalTextDecoration: true, 12031 __experimentalLetterSpacing: true, 12032 __experimentalDefaultControls: { 12033 fontSize: true 12034 } 12035 }, 12036 interactivity: { 12037 clientNavigation: true 12038 } 12039 } 12040 }; 12041 12042 const { 12043 name: comments_pagination_numbers_name 12044 } = comments_pagination_numbers_metadata; 12045 12046 const comments_pagination_numbers_settings = { 12047 icon: query_pagination_numbers, 12048 edit: CommentsPaginationNumbersEdit, 12049 example: {} 12050 }; 12051 const comments_pagination_numbers_init = () => initBlock({ 12052 name: comments_pagination_numbers_name, 12053 metadata: comments_pagination_numbers_metadata, 12054 settings: comments_pagination_numbers_settings 12055 }); 12056 12057 ;// ./node_modules/@wordpress/icons/build-module/library/title.js 12058 /** 12059 * WordPress dependencies 12060 */ 12061 12062 12063 const title = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 12064 xmlns: "http://www.w3.org/2000/svg", 12065 viewBox: "0 0 24 24", 12066 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 12067 d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" 12068 }) 12069 }); 12070 /* harmony default export */ const library_title = (title); 12071 12072 ;// ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js 12073 /** 12074 * External dependencies 12075 */ 12076 12077 12078 /** 12079 * WordPress dependencies 12080 */ 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 function comments_title_edit_Edit({ 12091 attributes: { 12092 textAlign, 12093 showPostTitle, 12094 showCommentsCount, 12095 level, 12096 levelOptions 12097 }, 12098 setAttributes, 12099 context: { 12100 postType, 12101 postId 12102 } 12103 }) { 12104 const TagName = 'h' + level; 12105 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 12106 const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 12107 const isSiteEditor = typeof postId === 'undefined'; 12108 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 12109 className: dist_clsx({ 12110 [`has-text-align-$textAlign}`]: textAlign 12111 }) 12112 }); 12113 const { 12114 threadCommentsDepth, 12115 threadComments, 12116 commentsPerPage, 12117 pageComments 12118 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 12119 const { 12120 getSettings 12121 } = select(external_wp_blockEditor_namespaceObject.store); 12122 return getSettings().__experimentalDiscussionSettings; 12123 }); 12124 (0,external_wp_element_namespaceObject.useEffect)(() => { 12125 if (isSiteEditor) { 12126 // Match the number of comments that will be shown in the comment-template/edit.js placeholder 12127 12128 const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; 12129 const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; 12130 const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); 12131 setCommentsCount(Math.min(commentsNumber, 3)); 12132 return; 12133 } 12134 const currentPostId = postId; 12135 external_wp_apiFetch_default()({ 12136 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 12137 post: postId, 12138 _fields: 'id' 12139 }), 12140 method: 'HEAD', 12141 parse: false 12142 }).then(res => { 12143 // Stale requests will have the `currentPostId` of an older closure. 12144 if (currentPostId === postId) { 12145 setCommentsCount(parseInt(res.headers.get('X-WP-Total'))); 12146 } 12147 }).catch(() => { 12148 setCommentsCount(0); 12149 }); 12150 }, [postId]); 12151 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 12152 group: "block", 12153 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 12154 value: textAlign, 12155 onChange: newAlign => setAttributes({ 12156 textAlign: newAlign 12157 }) 12158 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 12159 value: level, 12160 options: levelOptions, 12161 onChange: newLevel => setAttributes({ 12162 level: newLevel 12163 }) 12164 })] 12165 }); 12166 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 12167 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 12168 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 12169 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 12170 __nextHasNoMarginBottom: true, 12171 label: (0,external_wp_i18n_namespaceObject.__)('Show post title'), 12172 checked: showPostTitle, 12173 onChange: value => setAttributes({ 12174 showPostTitle: value 12175 }) 12176 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 12177 __nextHasNoMarginBottom: true, 12178 label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'), 12179 checked: showCommentsCount, 12180 onChange: value => setAttributes({ 12181 showCommentsCount: value 12182 }) 12183 })] 12184 }) 12185 }); 12186 const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('“Post Title”') : `"$rawTitle}"`; 12187 let placeholder; 12188 if (showCommentsCount && commentsCount !== undefined) { 12189 if (showPostTitle) { 12190 if (commentsCount === 1) { 12191 /* translators: %s: Post title. */ 12192 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle); 12193 } else { 12194 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Number of comments, 2: Post title. */ 12195 (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle); 12196 } 12197 } else if (commentsCount === 1) { 12198 placeholder = (0,external_wp_i18n_namespaceObject.__)('One response'); 12199 } else { 12200 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Number of comments. */ 12201 (0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount); 12202 } 12203 } else if (showPostTitle) { 12204 if (commentsCount === 1) { 12205 /* translators: %s: Post title. */ 12206 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle); 12207 } else { 12208 /* translators: %s: Post title. */ 12209 placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle); 12210 } 12211 } else if (commentsCount === 1) { 12212 placeholder = (0,external_wp_i18n_namespaceObject.__)('Response'); 12213 } else { 12214 placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses'); 12215 } 12216 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 12217 children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 12218 ...blockProps, 12219 children: placeholder 12220 })] 12221 }); 12222 } 12223 12224 ;// ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js 12225 /** 12226 * Internal dependencies 12227 */ 12228 const deprecated_metadata = { 12229 $schema: "https://schemas.wp.org/trunk/block.json", 12230 apiVersion: 3, 12231 name: "core/comments-title", 12232 title: "Comments Title", 12233 category: "theme", 12234 ancestor: ["core/comments"], 12235 description: "Displays a title with the number of comments.", 12236 textdomain: "default", 12237 usesContext: ["postId", "postType"], 12238 attributes: { 12239 textAlign: { 12240 type: "string" 12241 }, 12242 showPostTitle: { 12243 type: "boolean", 12244 "default": true 12245 }, 12246 showCommentsCount: { 12247 type: "boolean", 12248 "default": true 12249 }, 12250 level: { 12251 type: "number", 12252 "default": 2 12253 }, 12254 levelOptions: { 12255 type: "array" 12256 } 12257 }, 12258 supports: { 12259 anchor: false, 12260 align: true, 12261 html: false, 12262 __experimentalBorder: { 12263 radius: true, 12264 color: true, 12265 width: true, 12266 style: true 12267 }, 12268 color: { 12269 gradients: true, 12270 __experimentalDefaultControls: { 12271 background: true, 12272 text: true 12273 } 12274 }, 12275 spacing: { 12276 margin: true, 12277 padding: true 12278 }, 12279 typography: { 12280 fontSize: true, 12281 lineHeight: true, 12282 __experimentalFontFamily: true, 12283 __experimentalFontWeight: true, 12284 __experimentalFontStyle: true, 12285 __experimentalTextTransform: true, 12286 __experimentalTextDecoration: true, 12287 __experimentalLetterSpacing: true, 12288 __experimentalDefaultControls: { 12289 fontSize: true, 12290 __experimentalFontFamily: true, 12291 __experimentalFontStyle: true, 12292 __experimentalFontWeight: true 12293 } 12294 }, 12295 interactivity: { 12296 clientNavigation: true 12297 } 12298 } 12299 }; 12300 const { 12301 attributes, 12302 supports 12303 } = deprecated_metadata; 12304 /* harmony default export */ const comments_title_deprecated = ([{ 12305 attributes: { 12306 ...attributes, 12307 singleCommentLabel: { 12308 type: 'string' 12309 }, 12310 multipleCommentsLabel: { 12311 type: 'string' 12312 } 12313 }, 12314 supports, 12315 migrate: oldAttributes => { 12316 const { 12317 singleCommentLabel, 12318 multipleCommentsLabel, 12319 ...newAttributes 12320 } = oldAttributes; 12321 return newAttributes; 12322 }, 12323 isEligible: ({ 12324 multipleCommentsLabel, 12325 singleCommentLabel 12326 }) => multipleCommentsLabel || singleCommentLabel, 12327 save: () => null 12328 }]); 12329 12330 ;// ./node_modules/@wordpress/block-library/build-module/comments-title/index.js 12331 /** 12332 * WordPress dependencies 12333 */ 12334 12335 12336 /** 12337 * Internal dependencies 12338 */ 12339 12340 const comments_title_metadata = { 12341 $schema: "https://schemas.wp.org/trunk/block.json", 12342 apiVersion: 3, 12343 name: "core/comments-title", 12344 title: "Comments Title", 12345 category: "theme", 12346 ancestor: ["core/comments"], 12347 description: "Displays a title with the number of comments.", 12348 textdomain: "default", 12349 usesContext: ["postId", "postType"], 12350 attributes: { 12351 textAlign: { 12352 type: "string" 12353 }, 12354 showPostTitle: { 12355 type: "boolean", 12356 "default": true 12357 }, 12358 showCommentsCount: { 12359 type: "boolean", 12360 "default": true 12361 }, 12362 level: { 12363 type: "number", 12364 "default": 2 12365 }, 12366 levelOptions: { 12367 type: "array" 12368 } 12369 }, 12370 supports: { 12371 anchor: false, 12372 align: true, 12373 html: false, 12374 __experimentalBorder: { 12375 radius: true, 12376 color: true, 12377 width: true, 12378 style: true 12379 }, 12380 color: { 12381 gradients: true, 12382 __experimentalDefaultControls: { 12383 background: true, 12384 text: true 12385 } 12386 }, 12387 spacing: { 12388 margin: true, 12389 padding: true 12390 }, 12391 typography: { 12392 fontSize: true, 12393 lineHeight: true, 12394 __experimentalFontFamily: true, 12395 __experimentalFontWeight: true, 12396 __experimentalFontStyle: true, 12397 __experimentalTextTransform: true, 12398 __experimentalTextDecoration: true, 12399 __experimentalLetterSpacing: true, 12400 __experimentalDefaultControls: { 12401 fontSize: true, 12402 __experimentalFontFamily: true, 12403 __experimentalFontStyle: true, 12404 __experimentalFontWeight: true 12405 } 12406 }, 12407 interactivity: { 12408 clientNavigation: true 12409 } 12410 } 12411 }; 12412 12413 12414 const { 12415 name: comments_title_name 12416 } = comments_title_metadata; 12417 12418 const comments_title_settings = { 12419 icon: library_title, 12420 edit: comments_title_edit_Edit, 12421 deprecated: comments_title_deprecated, 12422 example: {} 12423 }; 12424 const comments_title_init = () => initBlock({ 12425 name: comments_title_name, 12426 metadata: comments_title_metadata, 12427 settings: comments_title_settings 12428 }); 12429 12430 ;// ./node_modules/@wordpress/icons/build-module/library/cover.js 12431 /** 12432 * WordPress dependencies 12433 */ 12434 12435 12436 const cover = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 12437 xmlns: "http://www.w3.org/2000/svg", 12438 viewBox: "0 0 24 24", 12439 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 12440 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" 12441 }) 12442 }); 12443 /* harmony default export */ const library_cover = (cover); 12444 12445 ;// ./node_modules/@wordpress/block-library/build-module/cover/shared.js 12446 /** 12447 * WordPress dependencies 12448 */ 12449 12450 const POSITION_CLASSNAMES = { 12451 'top left': 'is-position-top-left', 12452 'top center': 'is-position-top-center', 12453 'top right': 'is-position-top-right', 12454 'center left': 'is-position-center-left', 12455 'center center': 'is-position-center-center', 12456 center: 'is-position-center-center', 12457 'center right': 'is-position-center-right', 12458 'bottom left': 'is-position-bottom-left', 12459 'bottom center': 'is-position-bottom-center', 12460 'bottom right': 'is-position-bottom-right' 12461 }; 12462 const IMAGE_BACKGROUND_TYPE = 'image'; 12463 const VIDEO_BACKGROUND_TYPE = 'video'; 12464 const COVER_MIN_HEIGHT = 50; 12465 const COVER_MAX_HEIGHT = 1000; 12466 const COVER_DEFAULT_HEIGHT = 300; 12467 const DEFAULT_FOCAL_POINT = { 12468 x: 0.5, 12469 y: 0.5 12470 }; 12471 const shared_ALLOWED_MEDIA_TYPES = ['image', 'video']; 12472 function mediaPosition({ 12473 x, 12474 y 12475 } = DEFAULT_FOCAL_POINT) { 12476 return `$Math.round(x * 100)}% $Math.round(y * 100)}%`; 12477 } 12478 function dimRatioToClass(ratio) { 12479 return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 12480 } 12481 function attributesFromMedia(media) { 12482 if (!media || !media.url && !media.src) { 12483 return { 12484 url: undefined, 12485 id: undefined 12486 }; 12487 } 12488 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 12489 media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); 12490 } 12491 let mediaType; 12492 // For media selections originated from a file upload. 12493 if (media.media_type) { 12494 if (media.media_type === IMAGE_BACKGROUND_TYPE) { 12495 mediaType = IMAGE_BACKGROUND_TYPE; 12496 } else { 12497 // Only images and videos are accepted so if the media_type is not an image we can assume it is a video. 12498 // Videos contain the media type of 'file' in the object returned from the rest api. 12499 mediaType = VIDEO_BACKGROUND_TYPE; 12500 } 12501 // For media selections originated from existing files in the media library. 12502 } else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) { 12503 mediaType = media.type; 12504 } else { 12505 return; 12506 } 12507 return { 12508 url: media.url || media.src, 12509 id: media.id, 12510 alt: media?.alt, 12511 backgroundType: mediaType, 12512 ...(mediaType === VIDEO_BACKGROUND_TYPE ? { 12513 hasParallax: undefined 12514 } : {}) 12515 }; 12516 } 12517 12518 /** 12519 * Checks of the contentPosition is the center (default) position. 12520 * 12521 * @param {string} contentPosition The current content position. 12522 * @return {boolean} Whether the contentPosition is center. 12523 */ 12524 function isContentPositionCenter(contentPosition) { 12525 return !contentPosition || contentPosition === 'center center' || contentPosition === 'center'; 12526 } 12527 12528 /** 12529 * Retrieves the className for the current contentPosition. 12530 * The default position (center) will not have a className. 12531 * 12532 * @param {string} contentPosition The current content position. 12533 * @return {string} The className assigned to the contentPosition. 12534 */ 12535 function getPositionClassName(contentPosition) { 12536 /* 12537 * Only render a className if the contentPosition is not center (the default). 12538 */ 12539 if (isContentPositionCenter(contentPosition)) { 12540 return ''; 12541 } 12542 return POSITION_CLASSNAMES[contentPosition]; 12543 } 12544 12545 ;// ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js 12546 /** 12547 * External dependencies 12548 */ 12549 12550 12551 /** 12552 * WordPress dependencies 12553 */ 12554 12555 12556 12557 12558 12559 /** 12560 * Internal dependencies 12561 */ 12562 12563 12564 function backgroundImageStyles(url) { 12565 return url ? { 12566 backgroundImage: `url($url})` 12567 } : {}; 12568 } 12569 12570 /** 12571 * Original function to determine the background opacity classname 12572 * 12573 * Used in deprecations: v1-7. 12574 * 12575 * @param {number} ratio ratio to use for opacity. 12576 * @return {string} background opacity class . 12577 */ 12578 function dimRatioToClassV1(ratio) { 12579 return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 12580 } 12581 function migrateDimRatio(attributes) { 12582 return { 12583 ...attributes, 12584 dimRatio: !attributes.url ? 100 : attributes.dimRatio 12585 }; 12586 } 12587 function migrateTag(attributes) { 12588 if (!attributes.tagName) { 12589 attributes = { 12590 ...attributes, 12591 tagName: 'div' 12592 }; 12593 } 12594 return { 12595 ...attributes 12596 }; 12597 } 12598 const deprecated_blockAttributes = { 12599 url: { 12600 type: 'string' 12601 }, 12602 id: { 12603 type: 'number' 12604 }, 12605 hasParallax: { 12606 type: 'boolean', 12607 default: false 12608 }, 12609 dimRatio: { 12610 type: 'number', 12611 default: 50 12612 }, 12613 overlayColor: { 12614 type: 'string' 12615 }, 12616 customOverlayColor: { 12617 type: 'string' 12618 }, 12619 backgroundType: { 12620 type: 'string', 12621 default: 'image' 12622 }, 12623 focalPoint: { 12624 type: 'object' 12625 } 12626 }; 12627 const v8ToV11BlockAttributes = { 12628 url: { 12629 type: 'string' 12630 }, 12631 id: { 12632 type: 'number' 12633 }, 12634 alt: { 12635 type: 'string', 12636 source: 'attribute', 12637 selector: 'img', 12638 attribute: 'alt', 12639 default: '' 12640 }, 12641 hasParallax: { 12642 type: 'boolean', 12643 default: false 12644 }, 12645 isRepeated: { 12646 type: 'boolean', 12647 default: false 12648 }, 12649 dimRatio: { 12650 type: 'number', 12651 default: 100 12652 }, 12653 overlayColor: { 12654 type: 'string' 12655 }, 12656 customOverlayColor: { 12657 type: 'string' 12658 }, 12659 backgroundType: { 12660 type: 'string', 12661 default: 'image' 12662 }, 12663 focalPoint: { 12664 type: 'object' 12665 }, 12666 minHeight: { 12667 type: 'number' 12668 }, 12669 minHeightUnit: { 12670 type: 'string' 12671 }, 12672 gradient: { 12673 type: 'string' 12674 }, 12675 customGradient: { 12676 type: 'string' 12677 }, 12678 contentPosition: { 12679 type: 'string' 12680 }, 12681 isDark: { 12682 type: 'boolean', 12683 default: true 12684 }, 12685 allowedBlocks: { 12686 type: 'array' 12687 }, 12688 templateLock: { 12689 type: ['string', 'boolean'], 12690 enum: ['all', 'insert', false] 12691 } 12692 }; 12693 const v12toV13BlockAttributes = { 12694 ...v8ToV11BlockAttributes, 12695 useFeaturedImage: { 12696 type: 'boolean', 12697 default: false 12698 }, 12699 tagName: { 12700 type: 'string', 12701 default: 'div' 12702 } 12703 }; 12704 const v14BlockAttributes = { 12705 ...v12toV13BlockAttributes, 12706 isUserOverlayColor: { 12707 type: 'boolean' 12708 }, 12709 sizeSlug: { 12710 type: 'string' 12711 }, 12712 alt: { 12713 type: 'string', 12714 default: '' 12715 } 12716 }; 12717 const v7toV11BlockSupports = { 12718 anchor: true, 12719 align: true, 12720 html: false, 12721 spacing: { 12722 padding: true, 12723 __experimentalDefaultControls: { 12724 padding: true 12725 } 12726 }, 12727 color: { 12728 __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', 12729 text: false, 12730 background: false 12731 } 12732 }; 12733 const v12BlockSupports = { 12734 ...v7toV11BlockSupports, 12735 spacing: { 12736 padding: true, 12737 margin: ['top', 'bottom'], 12738 blockGap: true, 12739 __experimentalDefaultControls: { 12740 padding: true, 12741 blockGap: true 12742 } 12743 }, 12744 __experimentalBorder: { 12745 color: true, 12746 radius: true, 12747 style: true, 12748 width: true, 12749 __experimentalDefaultControls: { 12750 color: true, 12751 radius: true, 12752 style: true, 12753 width: true 12754 } 12755 }, 12756 color: { 12757 __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', 12758 heading: true, 12759 text: true, 12760 background: false, 12761 __experimentalSkipSerialization: ['gradients'], 12762 enableContrastChecker: false 12763 }, 12764 typography: { 12765 fontSize: true, 12766 lineHeight: true, 12767 __experimentalFontFamily: true, 12768 __experimentalFontWeight: true, 12769 __experimentalFontStyle: true, 12770 __experimentalTextTransform: true, 12771 __experimentalTextDecoration: true, 12772 __experimentalLetterSpacing: true, 12773 __experimentalDefaultControls: { 12774 fontSize: true 12775 } 12776 }, 12777 layout: { 12778 allowJustification: false 12779 } 12780 }; 12781 const v14BlockSupports = { 12782 ...v12BlockSupports, 12783 shadow: true, 12784 dimensions: { 12785 aspectRatio: true 12786 }, 12787 interactivity: { 12788 clientNavigation: true 12789 } 12790 }; 12791 12792 // Deprecation for blocks that have z-index. 12793 const v14 = { 12794 attributes: v14BlockAttributes, 12795 supports: v14BlockSupports, 12796 save({ 12797 attributes 12798 }) { 12799 const { 12800 backgroundType, 12801 gradient, 12802 contentPosition, 12803 customGradient, 12804 customOverlayColor, 12805 dimRatio, 12806 focalPoint, 12807 useFeaturedImage, 12808 hasParallax, 12809 isDark, 12810 isRepeated, 12811 overlayColor, 12812 url, 12813 alt, 12814 id, 12815 minHeight: minHeightProp, 12816 minHeightUnit, 12817 tagName: Tag, 12818 sizeSlug 12819 } = attributes; 12820 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12821 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12822 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12823 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12824 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12825 const isImgElement = !(hasParallax || isRepeated); 12826 const style = { 12827 minHeight: minHeight || undefined 12828 }; 12829 const bgStyle = { 12830 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12831 background: customGradient ? customGradient : undefined 12832 }; 12833 const objectPosition = 12834 // prettier-ignore 12835 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 12836 const backgroundImage = url ? `url($url})` : undefined; 12837 const backgroundPosition = mediaPosition(focalPoint); 12838 const classes = dist_clsx({ 12839 'is-light': !isDark, 12840 'has-parallax': hasParallax, 12841 'is-repeated': isRepeated, 12842 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12843 }, getPositionClassName(contentPosition)); 12844 const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 12845 [`size-$sizeSlug}`]: sizeSlug, 12846 'has-parallax': hasParallax, 12847 'is-repeated': isRepeated 12848 }); 12849 const gradientValue = gradient || customGradient; 12850 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { 12851 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12852 className: classes, 12853 style 12854 }), 12855 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 12856 "aria-hidden": "true", 12857 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12858 'has-background-dim': dimRatio !== undefined, 12859 // For backwards compatibility. Former versions of the Cover Block applied 12860 // `.wp-block-cover__gradient-background` in the presence of 12861 // media, a gradient and a dim. 12862 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12863 'has-background-gradient': gradientValue, 12864 [gradientClass]: gradientClass 12865 }), 12866 style: bgStyle 12867 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 12868 className: imgClasses, 12869 alt: alt, 12870 src: url, 12871 style: { 12872 objectPosition 12873 }, 12874 "data-object-fit": "cover", 12875 "data-object-position": objectPosition 12876 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 12877 role: alt ? 'img' : undefined, 12878 "aria-label": alt ? alt : undefined, 12879 className: imgClasses, 12880 style: { 12881 backgroundPosition, 12882 backgroundImage 12883 } 12884 })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 12885 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 12886 autoPlay: true, 12887 muted: true, 12888 loop: true, 12889 playsInline: true, 12890 src: url, 12891 style: { 12892 objectPosition 12893 }, 12894 "data-object-fit": "cover", 12895 "data-object-position": objectPosition 12896 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 12897 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 12898 className: 'wp-block-cover__inner-container' 12899 }) 12900 })] 12901 }); 12902 } 12903 }; 12904 12905 // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated. 12906 const v13 = { 12907 attributes: v12toV13BlockAttributes, 12908 supports: v12BlockSupports, 12909 save({ 12910 attributes 12911 }) { 12912 const { 12913 backgroundType, 12914 gradient, 12915 contentPosition, 12916 customGradient, 12917 customOverlayColor, 12918 dimRatio, 12919 focalPoint, 12920 useFeaturedImage, 12921 hasParallax, 12922 isDark, 12923 isRepeated, 12924 overlayColor, 12925 url, 12926 alt, 12927 id, 12928 minHeight: minHeightProp, 12929 minHeightUnit, 12930 tagName: Tag 12931 } = attributes; 12932 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 12933 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 12934 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12935 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12936 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12937 const isImgElement = !(hasParallax || isRepeated); 12938 const style = { 12939 minHeight: minHeight || undefined 12940 }; 12941 const bgStyle = { 12942 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 12943 background: customGradient ? customGradient : undefined 12944 }; 12945 const objectPosition = 12946 // prettier-ignore 12947 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 12948 const backgroundImage = url ? `url($url})` : undefined; 12949 const backgroundPosition = mediaPosition(focalPoint); 12950 const classes = dist_clsx({ 12951 'is-light': !isDark, 12952 'has-parallax': hasParallax, 12953 'is-repeated': isRepeated, 12954 'has-custom-content-position': !isContentPositionCenter(contentPosition) 12955 }, getPositionClassName(contentPosition)); 12956 const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 12957 'has-parallax': hasParallax, 12958 'is-repeated': isRepeated 12959 }); 12960 const gradientValue = gradient || customGradient; 12961 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { 12962 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 12963 className: classes, 12964 style 12965 }), 12966 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 12967 "aria-hidden": "true", 12968 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 12969 'has-background-dim': dimRatio !== undefined, 12970 // For backwards compatibility. Former versions of the Cover Block applied 12971 // `.wp-block-cover__gradient-background` in the presence of 12972 // media, a gradient and a dim. 12973 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 12974 'has-background-gradient': gradientValue, 12975 [gradientClass]: gradientClass 12976 }), 12977 style: bgStyle 12978 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 12979 className: imgClasses, 12980 alt: alt, 12981 src: url, 12982 style: { 12983 objectPosition 12984 }, 12985 "data-object-fit": "cover", 12986 "data-object-position": objectPosition 12987 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 12988 role: "img", 12989 className: imgClasses, 12990 style: { 12991 backgroundPosition, 12992 backgroundImage 12993 } 12994 })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 12995 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 12996 autoPlay: true, 12997 muted: true, 12998 loop: true, 12999 playsInline: true, 13000 src: url, 13001 style: { 13002 objectPosition 13003 }, 13004 "data-object-fit": "cover", 13005 "data-object-position": objectPosition 13006 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13007 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13008 className: 'wp-block-cover__inner-container' 13009 }) 13010 })] 13011 }); 13012 } 13013 }; 13014 13015 // Deprecation for blocks to prevent auto overlay color from overriding previously set values. 13016 const deprecated_v12 = { 13017 attributes: v12toV13BlockAttributes, 13018 supports: v12BlockSupports, 13019 isEligible(attributes) { 13020 return (attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined) && attributes.isUserOverlayColor === undefined; 13021 }, 13022 migrate(attributes) { 13023 return { 13024 ...attributes, 13025 isUserOverlayColor: true 13026 }; 13027 }, 13028 save({ 13029 attributes 13030 }) { 13031 const { 13032 backgroundType, 13033 gradient, 13034 contentPosition, 13035 customGradient, 13036 customOverlayColor, 13037 dimRatio, 13038 focalPoint, 13039 useFeaturedImage, 13040 hasParallax, 13041 isDark, 13042 isRepeated, 13043 overlayColor, 13044 url, 13045 alt, 13046 id, 13047 minHeight: minHeightProp, 13048 minHeightUnit, 13049 tagName: Tag 13050 } = attributes; 13051 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13052 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13053 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13054 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13055 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13056 const isImgElement = !(hasParallax || isRepeated); 13057 const style = { 13058 minHeight: minHeight || undefined 13059 }; 13060 const bgStyle = { 13061 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13062 background: customGradient ? customGradient : undefined 13063 }; 13064 const objectPosition = 13065 // prettier-ignore 13066 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 13067 const backgroundImage = url ? `url($url})` : undefined; 13068 const backgroundPosition = mediaPosition(focalPoint); 13069 const classes = dist_clsx({ 13070 'is-light': !isDark, 13071 'has-parallax': hasParallax, 13072 'is-repeated': isRepeated, 13073 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13074 }, getPositionClassName(contentPosition)); 13075 const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 13076 'has-parallax': hasParallax, 13077 'is-repeated': isRepeated 13078 }); 13079 const gradientValue = gradient || customGradient; 13080 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { 13081 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13082 className: classes, 13083 style 13084 }), 13085 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13086 "aria-hidden": "true", 13087 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 13088 'has-background-dim': dimRatio !== undefined, 13089 // For backwards compatibility. Former versions of the Cover Block applied 13090 // `.wp-block-cover__gradient-background` in the presence of 13091 // media, a gradient and a dim. 13092 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 13093 'has-background-gradient': gradientValue, 13094 [gradientClass]: gradientClass 13095 }), 13096 style: bgStyle 13097 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13098 className: imgClasses, 13099 alt: alt, 13100 src: url, 13101 style: { 13102 objectPosition 13103 }, 13104 "data-object-fit": "cover", 13105 "data-object-position": objectPosition 13106 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13107 role: "img", 13108 className: imgClasses, 13109 style: { 13110 backgroundPosition, 13111 backgroundImage 13112 } 13113 })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13114 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13115 autoPlay: true, 13116 muted: true, 13117 loop: true, 13118 playsInline: true, 13119 src: url, 13120 style: { 13121 objectPosition 13122 }, 13123 "data-object-fit": "cover", 13124 "data-object-position": objectPosition 13125 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13126 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13127 className: 'wp-block-cover__inner-container' 13128 }) 13129 })] 13130 }); 13131 } 13132 }; 13133 13134 // Deprecation for blocks that does not have a HTML tag option. 13135 const deprecated_v11 = { 13136 attributes: v8ToV11BlockAttributes, 13137 supports: v7toV11BlockSupports, 13138 save({ 13139 attributes 13140 }) { 13141 const { 13142 backgroundType, 13143 gradient, 13144 contentPosition, 13145 customGradient, 13146 customOverlayColor, 13147 dimRatio, 13148 focalPoint, 13149 useFeaturedImage, 13150 hasParallax, 13151 isDark, 13152 isRepeated, 13153 overlayColor, 13154 url, 13155 alt, 13156 id, 13157 minHeight: minHeightProp, 13158 minHeightUnit 13159 } = attributes; 13160 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13161 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13162 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13163 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13164 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13165 const isImgElement = !(hasParallax || isRepeated); 13166 const style = { 13167 minHeight: minHeight || undefined 13168 }; 13169 const bgStyle = { 13170 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13171 background: customGradient ? customGradient : undefined 13172 }; 13173 const objectPosition = 13174 // prettier-ignore 13175 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 13176 const backgroundImage = url ? `url($url})` : undefined; 13177 const backgroundPosition = mediaPosition(focalPoint); 13178 const classes = dist_clsx({ 13179 'is-light': !isDark, 13180 'has-parallax': hasParallax, 13181 'is-repeated': isRepeated, 13182 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13183 }, getPositionClassName(contentPosition)); 13184 const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 13185 'has-parallax': hasParallax, 13186 'is-repeated': isRepeated 13187 }); 13188 const gradientValue = gradient || customGradient; 13189 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13190 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13191 className: classes, 13192 style 13193 }), 13194 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13195 "aria-hidden": "true", 13196 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 13197 'has-background-dim': dimRatio !== undefined, 13198 // For backwards compatibility. Former versions of the Cover Block applied 13199 // `.wp-block-cover__gradient-background` in the presence of 13200 // media, a gradient and a dim. 13201 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 13202 'has-background-gradient': gradientValue, 13203 [gradientClass]: gradientClass 13204 }), 13205 style: bgStyle 13206 }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13207 className: imgClasses, 13208 alt: alt, 13209 src: url, 13210 style: { 13211 objectPosition 13212 }, 13213 "data-object-fit": "cover", 13214 "data-object-position": objectPosition 13215 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13216 role: "img", 13217 className: imgClasses, 13218 style: { 13219 backgroundPosition, 13220 backgroundImage 13221 } 13222 })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13223 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13224 autoPlay: true, 13225 muted: true, 13226 loop: true, 13227 playsInline: true, 13228 src: url, 13229 style: { 13230 objectPosition 13231 }, 13232 "data-object-fit": "cover", 13233 "data-object-position": objectPosition 13234 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13235 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13236 className: 'wp-block-cover__inner-container' 13237 }) 13238 })] 13239 }); 13240 }, 13241 migrate: migrateTag 13242 }; 13243 13244 // Deprecation for blocks that renders fixed background as background from the main block container. 13245 const deprecated_v10 = { 13246 attributes: v8ToV11BlockAttributes, 13247 supports: v7toV11BlockSupports, 13248 save({ 13249 attributes 13250 }) { 13251 const { 13252 backgroundType, 13253 gradient, 13254 contentPosition, 13255 customGradient, 13256 customOverlayColor, 13257 dimRatio, 13258 focalPoint, 13259 useFeaturedImage, 13260 hasParallax, 13261 isDark, 13262 isRepeated, 13263 overlayColor, 13264 url, 13265 alt, 13266 id, 13267 minHeight: minHeightProp, 13268 minHeightUnit 13269 } = attributes; 13270 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13271 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13272 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13273 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13274 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13275 const isImgElement = !(hasParallax || isRepeated); 13276 const style = { 13277 ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}), 13278 minHeight: minHeight || undefined 13279 }; 13280 const bgStyle = { 13281 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13282 background: customGradient ? customGradient : undefined 13283 }; 13284 const objectPosition = 13285 // prettier-ignore 13286 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 13287 const classes = dist_clsx({ 13288 'is-light': !isDark, 13289 'has-parallax': hasParallax, 13290 'is-repeated': isRepeated, 13291 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13292 }, getPositionClassName(contentPosition)); 13293 const gradientValue = gradient || customGradient; 13294 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13295 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13296 className: classes, 13297 style 13298 }), 13299 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13300 "aria-hidden": "true", 13301 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 13302 'has-background-dim': dimRatio !== undefined, 13303 // For backwards compatibility. Former versions of the Cover Block applied 13304 // `.wp-block-cover__gradient-background` in the presence of 13305 // media, a gradient and a dim. 13306 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 13307 'has-background-gradient': gradientValue, 13308 [gradientClass]: gradientClass 13309 }), 13310 style: bgStyle 13311 }), !useFeaturedImage && isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13312 className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 13313 alt: alt, 13314 src: url, 13315 style: { 13316 objectPosition 13317 }, 13318 "data-object-fit": "cover", 13319 "data-object-position": objectPosition 13320 }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13321 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13322 autoPlay: true, 13323 muted: true, 13324 loop: true, 13325 playsInline: true, 13326 src: url, 13327 style: { 13328 objectPosition 13329 }, 13330 "data-object-fit": "cover", 13331 "data-object-position": objectPosition 13332 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13333 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13334 className: 'wp-block-cover__inner-container' 13335 }) 13336 })] 13337 }); 13338 }, 13339 migrate: migrateTag 13340 }; 13341 13342 // Deprecation for blocks with `minHeightUnit` set but no `minHeight`. 13343 const v9 = { 13344 attributes: v8ToV11BlockAttributes, 13345 supports: v7toV11BlockSupports, 13346 save({ 13347 attributes 13348 }) { 13349 const { 13350 backgroundType, 13351 gradient, 13352 contentPosition, 13353 customGradient, 13354 customOverlayColor, 13355 dimRatio, 13356 focalPoint, 13357 hasParallax, 13358 isDark, 13359 isRepeated, 13360 overlayColor, 13361 url, 13362 alt, 13363 id, 13364 minHeight: minHeightProp, 13365 minHeightUnit 13366 } = attributes; 13367 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13368 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13369 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13370 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13371 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13372 const isImgElement = !(hasParallax || isRepeated); 13373 const style = { 13374 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 13375 minHeight: minHeight || undefined 13376 }; 13377 const bgStyle = { 13378 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13379 background: customGradient ? customGradient : undefined 13380 }; 13381 const objectPosition = 13382 // prettier-ignore 13383 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 13384 const classes = dist_clsx({ 13385 'is-light': !isDark, 13386 'has-parallax': hasParallax, 13387 'is-repeated': isRepeated, 13388 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13389 }, getPositionClassName(contentPosition)); 13390 const gradientValue = gradient || customGradient; 13391 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13392 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13393 className: classes, 13394 style 13395 }), 13396 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13397 "aria-hidden": "true", 13398 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 13399 'has-background-dim': dimRatio !== undefined, 13400 // For backwards compatibility. Former versions of the Cover Block applied 13401 // `.wp-block-cover__gradient-background` in the presence of 13402 // media, a gradient and a dim. 13403 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 13404 'has-background-gradient': gradientValue, 13405 [gradientClass]: gradientClass 13406 }), 13407 style: bgStyle 13408 }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13409 className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 13410 alt: alt, 13411 src: url, 13412 style: { 13413 objectPosition 13414 }, 13415 "data-object-fit": "cover", 13416 "data-object-position": objectPosition 13417 }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13418 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13419 autoPlay: true, 13420 muted: true, 13421 loop: true, 13422 playsInline: true, 13423 src: url, 13424 style: { 13425 objectPosition 13426 }, 13427 "data-object-fit": "cover", 13428 "data-object-position": objectPosition 13429 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13430 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13431 className: 'wp-block-cover__inner-container' 13432 }) 13433 })] 13434 }); 13435 }, 13436 migrate: migrateTag 13437 }; 13438 13439 // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`. 13440 const v8 = { 13441 attributes: v8ToV11BlockAttributes, 13442 supports: v7toV11BlockSupports, 13443 save({ 13444 attributes 13445 }) { 13446 const { 13447 backgroundType, 13448 gradient, 13449 contentPosition, 13450 customGradient, 13451 customOverlayColor, 13452 dimRatio, 13453 focalPoint, 13454 hasParallax, 13455 isDark, 13456 isRepeated, 13457 overlayColor, 13458 url, 13459 alt, 13460 id, 13461 minHeight: minHeightProp, 13462 minHeightUnit 13463 } = attributes; 13464 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13465 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13466 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13467 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13468 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13469 const isImgElement = !(hasParallax || isRepeated); 13470 const style = { 13471 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 13472 minHeight: minHeight || undefined 13473 }; 13474 const bgStyle = { 13475 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13476 background: customGradient ? customGradient : undefined 13477 }; 13478 const objectPosition = 13479 // prettier-ignore 13480 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 13481 const classes = dist_clsx({ 13482 'is-light': !isDark, 13483 'has-parallax': hasParallax, 13484 'is-repeated': isRepeated, 13485 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13486 }, getPositionClassName(contentPosition)); 13487 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13488 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13489 className: classes, 13490 style 13491 }), 13492 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13493 "aria-hidden": "true", 13494 className: dist_clsx(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, { 13495 'has-background-dim': dimRatio !== undefined, 13496 'has-background-gradient': gradient || customGradient, 13497 [gradientClass]: !url && gradientClass 13498 }), 13499 style: bgStyle 13500 }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13501 className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 13502 alt: alt, 13503 src: url, 13504 style: { 13505 objectPosition 13506 }, 13507 "data-object-fit": "cover", 13508 "data-object-position": objectPosition 13509 }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13510 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13511 autoPlay: true, 13512 muted: true, 13513 loop: true, 13514 playsInline: true, 13515 src: url, 13516 style: { 13517 objectPosition 13518 }, 13519 "data-object-fit": "cover", 13520 "data-object-position": objectPosition 13521 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13522 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 13523 className: 'wp-block-cover__inner-container' 13524 }) 13525 })] 13526 }); 13527 }, 13528 migrate: migrateTag 13529 }; 13530 const v7 = { 13531 attributes: { 13532 ...deprecated_blockAttributes, 13533 isRepeated: { 13534 type: 'boolean', 13535 default: false 13536 }, 13537 minHeight: { 13538 type: 'number' 13539 }, 13540 minHeightUnit: { 13541 type: 'string' 13542 }, 13543 gradient: { 13544 type: 'string' 13545 }, 13546 customGradient: { 13547 type: 'string' 13548 }, 13549 contentPosition: { 13550 type: 'string' 13551 }, 13552 alt: { 13553 type: 'string', 13554 source: 'attribute', 13555 selector: 'img', 13556 attribute: 'alt', 13557 default: '' 13558 } 13559 }, 13560 supports: v7toV11BlockSupports, 13561 save({ 13562 attributes 13563 }) { 13564 const { 13565 backgroundType, 13566 gradient, 13567 contentPosition, 13568 customGradient, 13569 customOverlayColor, 13570 dimRatio, 13571 focalPoint, 13572 hasParallax, 13573 isRepeated, 13574 overlayColor, 13575 url, 13576 alt, 13577 id, 13578 minHeight: minHeightProp, 13579 minHeightUnit 13580 } = attributes; 13581 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13582 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13583 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13584 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13585 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13586 const isImgElement = !(hasParallax || isRepeated); 13587 const style = { 13588 ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), 13589 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 13590 background: customGradient && !url ? customGradient : undefined, 13591 minHeight: minHeight || undefined 13592 }; 13593 const objectPosition = 13594 // prettier-ignore 13595 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : undefined; 13596 const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 13597 'has-background-dim': dimRatio !== 0, 13598 'has-parallax': hasParallax, 13599 'is-repeated': isRepeated, 13600 'has-background-gradient': gradient || customGradient, 13601 [gradientClass]: !url && gradientClass, 13602 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13603 }, getPositionClassName(contentPosition)); 13604 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13605 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13606 className: classes, 13607 style 13608 }), 13609 children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13610 "aria-hidden": "true", 13611 className: dist_clsx('wp-block-cover__gradient-background', gradientClass), 13612 style: customGradient ? { 13613 background: customGradient 13614 } : undefined 13615 }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 13616 className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null), 13617 alt: alt, 13618 src: url, 13619 style: { 13620 objectPosition 13621 }, 13622 "data-object-fit": "cover", 13623 "data-object-position": objectPosition 13624 }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13625 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 13626 autoPlay: true, 13627 muted: true, 13628 loop: true, 13629 playsInline: true, 13630 src: url, 13631 style: { 13632 objectPosition 13633 }, 13634 "data-object-fit": "cover", 13635 "data-object-position": objectPosition 13636 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13637 className: "wp-block-cover__inner-container", 13638 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 13639 })] 13640 }); 13641 }, 13642 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 13643 }; 13644 const v6 = { 13645 attributes: { 13646 ...deprecated_blockAttributes, 13647 isRepeated: { 13648 type: 'boolean', 13649 default: false 13650 }, 13651 minHeight: { 13652 type: 'number' 13653 }, 13654 minHeightUnit: { 13655 type: 'string' 13656 }, 13657 gradient: { 13658 type: 'string' 13659 }, 13660 customGradient: { 13661 type: 'string' 13662 }, 13663 contentPosition: { 13664 type: 'string' 13665 } 13666 }, 13667 supports: { 13668 align: true 13669 }, 13670 save({ 13671 attributes 13672 }) { 13673 const { 13674 backgroundType, 13675 gradient, 13676 contentPosition, 13677 customGradient, 13678 customOverlayColor, 13679 dimRatio, 13680 focalPoint, 13681 hasParallax, 13682 isRepeated, 13683 overlayColor, 13684 url, 13685 minHeight: minHeightProp, 13686 minHeightUnit 13687 } = attributes; 13688 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13689 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13690 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13691 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13692 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13693 const style = isImageBackground ? backgroundImageStyles(url) : {}; 13694 const videoStyle = {}; 13695 if (!overlayColorClass) { 13696 style.backgroundColor = customOverlayColor; 13697 } 13698 if (customGradient && !url) { 13699 style.background = customGradient; 13700 } 13701 style.minHeight = minHeight || undefined; 13702 let positionValue; 13703 if (focalPoint) { 13704 positionValue = `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%`; 13705 if (isImageBackground && !hasParallax) { 13706 style.backgroundPosition = positionValue; 13707 } 13708 if (isVideoBackground) { 13709 videoStyle.objectPosition = positionValue; 13710 } 13711 } 13712 const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 13713 'has-background-dim': dimRatio !== 0, 13714 'has-parallax': hasParallax, 13715 'is-repeated': isRepeated, 13716 'has-background-gradient': gradient || customGradient, 13717 [gradientClass]: !url && gradientClass, 13718 'has-custom-content-position': !isContentPositionCenter(contentPosition) 13719 }, getPositionClassName(contentPosition)); 13720 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13721 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 13722 className: classes, 13723 style 13724 }), 13725 children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13726 "aria-hidden": "true", 13727 className: dist_clsx('wp-block-cover__gradient-background', gradientClass), 13728 style: customGradient ? { 13729 background: customGradient 13730 } : undefined 13731 }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13732 className: "wp-block-cover__video-background", 13733 autoPlay: true, 13734 muted: true, 13735 loop: true, 13736 playsInline: true, 13737 src: url, 13738 style: videoStyle 13739 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13740 className: "wp-block-cover__inner-container", 13741 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 13742 })] 13743 }); 13744 }, 13745 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 13746 }; 13747 const v5 = { 13748 attributes: { 13749 ...deprecated_blockAttributes, 13750 minHeight: { 13751 type: 'number' 13752 }, 13753 gradient: { 13754 type: 'string' 13755 }, 13756 customGradient: { 13757 type: 'string' 13758 } 13759 }, 13760 supports: { 13761 align: true 13762 }, 13763 save({ 13764 attributes 13765 }) { 13766 const { 13767 backgroundType, 13768 gradient, 13769 customGradient, 13770 customOverlayColor, 13771 dimRatio, 13772 focalPoint, 13773 hasParallax, 13774 overlayColor, 13775 url, 13776 minHeight 13777 } = attributes; 13778 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13779 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13780 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 13781 if (!overlayColorClass) { 13782 style.backgroundColor = customOverlayColor; 13783 } 13784 if (focalPoint && !hasParallax) { 13785 style.backgroundPosition = `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%`; 13786 } 13787 if (customGradient && !url) { 13788 style.background = customGradient; 13789 } 13790 style.minHeight = minHeight || undefined; 13791 const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 13792 'has-background-dim': dimRatio !== 0, 13793 'has-parallax': hasParallax, 13794 'has-background-gradient': customGradient, 13795 [gradientClass]: !url && gradientClass 13796 }); 13797 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13798 className: classes, 13799 style: style, 13800 children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13801 "aria-hidden": "true", 13802 className: dist_clsx('wp-block-cover__gradient-background', gradientClass), 13803 style: customGradient ? { 13804 background: customGradient 13805 } : undefined 13806 }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13807 className: "wp-block-cover__video-background", 13808 autoPlay: true, 13809 muted: true, 13810 loop: true, 13811 src: url 13812 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13813 className: "wp-block-cover__inner-container", 13814 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 13815 })] 13816 }); 13817 }, 13818 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 13819 }; 13820 const v4 = { 13821 attributes: { 13822 ...deprecated_blockAttributes, 13823 minHeight: { 13824 type: 'number' 13825 }, 13826 gradient: { 13827 type: 'string' 13828 }, 13829 customGradient: { 13830 type: 'string' 13831 } 13832 }, 13833 supports: { 13834 align: true 13835 }, 13836 save({ 13837 attributes 13838 }) { 13839 const { 13840 backgroundType, 13841 gradient, 13842 customGradient, 13843 customOverlayColor, 13844 dimRatio, 13845 focalPoint, 13846 hasParallax, 13847 overlayColor, 13848 url, 13849 minHeight 13850 } = attributes; 13851 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13852 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 13853 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 13854 if (!overlayColorClass) { 13855 style.backgroundColor = customOverlayColor; 13856 } 13857 if (focalPoint && !hasParallax) { 13858 style.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 13859 } 13860 if (customGradient && !url) { 13861 style.background = customGradient; 13862 } 13863 style.minHeight = minHeight || undefined; 13864 const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 13865 'has-background-dim': dimRatio !== 0, 13866 'has-parallax': hasParallax, 13867 'has-background-gradient': customGradient, 13868 [gradientClass]: !url && gradientClass 13869 }); 13870 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13871 className: classes, 13872 style: style, 13873 children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 13874 "aria-hidden": "true", 13875 className: dist_clsx('wp-block-cover__gradient-background', gradientClass), 13876 style: customGradient ? { 13877 background: customGradient 13878 } : undefined 13879 }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13880 className: "wp-block-cover__video-background", 13881 autoPlay: true, 13882 muted: true, 13883 loop: true, 13884 src: url 13885 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 13886 className: "wp-block-cover__inner-container", 13887 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 13888 })] 13889 }); 13890 }, 13891 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) 13892 }; 13893 const v3 = { 13894 attributes: { 13895 ...deprecated_blockAttributes, 13896 title: { 13897 type: 'string', 13898 source: 'html', 13899 selector: 'p' 13900 }, 13901 contentAlign: { 13902 type: 'string', 13903 default: 'center' 13904 } 13905 }, 13906 supports: { 13907 align: true 13908 }, 13909 save({ 13910 attributes 13911 }) { 13912 const { 13913 backgroundType, 13914 contentAlign, 13915 customOverlayColor, 13916 dimRatio, 13917 focalPoint, 13918 hasParallax, 13919 overlayColor, 13920 title, 13921 url 13922 } = attributes; 13923 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 13924 const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 13925 if (!overlayColorClass) { 13926 style.backgroundColor = customOverlayColor; 13927 } 13928 if (focalPoint && !hasParallax) { 13929 style.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 13930 } 13931 const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 13932 'has-background-dim': dimRatio !== 0, 13933 'has-parallax': hasParallax, 13934 [`has-$contentAlign}-content`]: contentAlign !== 'center' 13935 }); 13936 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 13937 className: classes, 13938 style: style, 13939 children: [VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 13940 className: "wp-block-cover__video-background", 13941 autoPlay: true, 13942 muted: true, 13943 loop: true, 13944 src: url 13945 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 13946 tagName: "p", 13947 className: "wp-block-cover-text", 13948 value: title 13949 })] 13950 }); 13951 }, 13952 migrate(attributes) { 13953 const newAttribs = { 13954 ...attributes, 13955 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 13956 tagName: !attributes.tagName ? 'div' : attributes.tagName 13957 }; 13958 const { 13959 title, 13960 contentAlign, 13961 ...restAttributes 13962 } = newAttribs; 13963 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 13964 content: attributes.title, 13965 align: attributes.contentAlign, 13966 fontSize: 'large', 13967 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 13968 })]]; 13969 } 13970 }; 13971 const v2 = { 13972 attributes: { 13973 ...deprecated_blockAttributes, 13974 title: { 13975 type: 'string', 13976 source: 'html', 13977 selector: 'p' 13978 }, 13979 contentAlign: { 13980 type: 'string', 13981 default: 'center' 13982 }, 13983 align: { 13984 type: 'string' 13985 } 13986 }, 13987 supports: { 13988 className: false 13989 }, 13990 save({ 13991 attributes 13992 }) { 13993 const { 13994 url, 13995 title, 13996 hasParallax, 13997 dimRatio, 13998 align, 13999 contentAlign, 14000 overlayColor, 14001 customOverlayColor 14002 } = attributes; 14003 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 14004 const style = backgroundImageStyles(url); 14005 if (!overlayColorClass) { 14006 style.backgroundColor = customOverlayColor; 14007 } 14008 const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, { 14009 'has-background-dim': dimRatio !== 0, 14010 'has-parallax': hasParallax, 14011 [`has-$contentAlign}-content`]: contentAlign !== 'center' 14012 }, align ? `align$align}` : null); 14013 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 14014 className: classes, 14015 style: style, 14016 children: !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 14017 tagName: "p", 14018 className: "wp-block-cover-image-text", 14019 value: title 14020 }) 14021 }); 14022 }, 14023 migrate(attributes) { 14024 const newAttribs = { 14025 ...attributes, 14026 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 14027 tagName: !attributes.tagName ? 'div' : attributes.tagName 14028 }; 14029 const { 14030 title, 14031 contentAlign, 14032 align, 14033 ...restAttributes 14034 } = newAttribs; 14035 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 14036 content: attributes.title, 14037 align: attributes.contentAlign, 14038 fontSize: 'large', 14039 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 14040 })]]; 14041 } 14042 }; 14043 const cover_deprecated_v1 = { 14044 attributes: { 14045 ...deprecated_blockAttributes, 14046 title: { 14047 type: 'string', 14048 source: 'html', 14049 selector: 'h2' 14050 }, 14051 align: { 14052 type: 'string' 14053 }, 14054 contentAlign: { 14055 type: 'string', 14056 default: 'center' 14057 } 14058 }, 14059 supports: { 14060 className: false 14061 }, 14062 save({ 14063 attributes 14064 }) { 14065 const { 14066 url, 14067 title, 14068 hasParallax, 14069 dimRatio, 14070 align 14071 } = attributes; 14072 const style = backgroundImageStyles(url); 14073 const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), { 14074 'has-background-dim': dimRatio !== 0, 14075 'has-parallax': hasParallax 14076 }, align ? `align$align}` : null); 14077 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("section", { 14078 className: classes, 14079 style: style, 14080 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 14081 tagName: "h2", 14082 value: title 14083 }) 14084 }); 14085 }, 14086 migrate(attributes) { 14087 const newAttribs = { 14088 ...attributes, 14089 dimRatio: !attributes.url ? 100 : attributes.dimRatio, 14090 tagName: !attributes.tagName ? 'div' : attributes.tagName 14091 }; 14092 const { 14093 title, 14094 contentAlign, 14095 align, 14096 ...restAttributes 14097 } = newAttribs; 14098 return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 14099 content: attributes.title, 14100 align: attributes.contentAlign, 14101 fontSize: 'large', 14102 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') 14103 })]]; 14104 } 14105 }; 14106 /* harmony default export */ const cover_deprecated = ([v14, v13, deprecated_v12, deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]); 14107 14108 ;// ./node_modules/@wordpress/block-library/build-module/cover/constants.js 14109 const DEFAULT_MEDIA_SIZE_SLUG = 'full'; 14110 14111 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js 14112 /** 14113 * WordPress dependencies 14114 */ 14115 14116 14117 14118 14119 14120 14121 14122 14123 /** 14124 * Internal dependencies 14125 */ 14126 14127 14128 14129 14130 14131 14132 const { 14133 cleanEmptyObject: inspector_controls_cleanEmptyObject, 14134 ResolutionTool 14135 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 14136 function CoverHeightInput({ 14137 onChange, 14138 onUnitChange, 14139 unit = 'px', 14140 value = '' 14141 }) { 14142 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); 14143 const inputId = `block-cover-height-input-$instanceId}`; 14144 const isPx = unit === 'px'; 14145 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 14146 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 14147 availableUnits: availableUnits || ['px', 'em', 'rem', 'vw', 'vh'], 14148 defaultValues: { 14149 px: 430, 14150 '%': 20, 14151 em: 20, 14152 rem: 20, 14153 vw: 20, 14154 vh: 50 14155 } 14156 }); 14157 const handleOnChange = unprocessedValue => { 14158 const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined; 14159 if (isNaN(inputValue) && inputValue !== undefined) { 14160 return; 14161 } 14162 onChange(inputValue); 14163 }; 14164 const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => { 14165 const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); 14166 return [parsedQuantity, unit].join(''); 14167 }, [unit, value]); 14168 const min = isPx ? COVER_MIN_HEIGHT : 0; 14169 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 14170 __next40pxDefaultSize: true, 14171 label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), 14172 id: inputId, 14173 isResetValueOnUnitChange: true, 14174 min: min, 14175 onChange: handleOnChange, 14176 onUnitChange: onUnitChange, 14177 units: units, 14178 value: computedValue 14179 }); 14180 } 14181 function CoverInspectorControls({ 14182 attributes, 14183 setAttributes, 14184 clientId, 14185 setOverlayColor, 14186 coverRef, 14187 currentSettings, 14188 updateDimRatio, 14189 featuredImage 14190 }) { 14191 const { 14192 useFeaturedImage, 14193 id, 14194 dimRatio, 14195 focalPoint, 14196 hasParallax, 14197 isRepeated, 14198 minHeight, 14199 minHeightUnit, 14200 alt, 14201 tagName 14202 } = attributes; 14203 const { 14204 isVideoBackground, 14205 isImageBackground, 14206 mediaElement, 14207 url, 14208 overlayColor 14209 } = currentSettings; 14210 const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 14211 const { 14212 gradientValue, 14213 setGradient 14214 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 14215 const { 14216 getSettings 14217 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 14218 const imageSizes = getSettings()?.imageSizes; 14219 const image = (0,external_wp_data_namespaceObject.useSelect)(select => id && isImageBackground ? select(external_wp_coreData_namespaceObject.store).getMedia(id, { 14220 context: 'view' 14221 }) : null, [id, isImageBackground]); 14222 const currentBackgroundImage = useFeaturedImage ? featuredImage : image; 14223 function updateImage(newSizeSlug) { 14224 const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url; 14225 if (!newUrl) { 14226 return null; 14227 } 14228 setAttributes({ 14229 url: newUrl, 14230 sizeSlug: newSizeSlug 14231 }); 14232 } 14233 const imageSizeOptions = imageSizes?.filter(({ 14234 slug 14235 }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url)?.map(({ 14236 name, 14237 slug 14238 }) => ({ 14239 value: slug, 14240 label: name 14241 })); 14242 const toggleParallax = () => { 14243 setAttributes({ 14244 hasParallax: !hasParallax, 14245 ...(!hasParallax ? { 14246 focalPoint: undefined 14247 } : {}) 14248 }); 14249 }; 14250 const toggleIsRepeated = () => { 14251 setAttributes({ 14252 isRepeated: !isRepeated 14253 }); 14254 }; 14255 const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); 14256 const imperativeFocalPointPreview = value => { 14257 const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition']; 14258 styleOfRef[property] = mediaPosition(value); 14259 }; 14260 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 14261 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 14262 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 14263 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 14264 children: !!url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 14265 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 14266 resetAll: () => { 14267 setAttributes({ 14268 hasParallax: false, 14269 focalPoint: undefined, 14270 isRepeated: false, 14271 alt: '', 14272 sizeSlug: undefined 14273 }); 14274 }, 14275 dropdownMenuProps: dropdownMenuProps, 14276 children: [isImageBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 14277 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14278 label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), 14279 isShownByDefault: true, 14280 hasValue: () => hasParallax, 14281 onDeselect: () => setAttributes({ 14282 hasParallax: false, 14283 focalPoint: undefined 14284 }), 14285 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 14286 __nextHasNoMarginBottom: true, 14287 label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), 14288 checked: hasParallax, 14289 onChange: toggleParallax 14290 }) 14291 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14292 label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), 14293 isShownByDefault: true, 14294 hasValue: () => isRepeated, 14295 onDeselect: () => setAttributes({ 14296 isRepeated: false 14297 }), 14298 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 14299 __nextHasNoMarginBottom: true, 14300 label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), 14301 checked: isRepeated, 14302 onChange: toggleIsRepeated 14303 }) 14304 })] 14305 }), showFocalPointPicker && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14306 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 14307 isShownByDefault: true, 14308 hasValue: () => !!focalPoint, 14309 onDeselect: () => setAttributes({ 14310 focalPoint: undefined 14311 }), 14312 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { 14313 __nextHasNoMarginBottom: true, 14314 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 14315 url: url, 14316 value: focalPoint, 14317 onDragStart: imperativeFocalPointPreview, 14318 onDrag: imperativeFocalPointPreview, 14319 onChange: newFocalPoint => setAttributes({ 14320 focalPoint: newFocalPoint 14321 }) 14322 }) 14323 }), !useFeaturedImage && url && !isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14324 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 14325 isShownByDefault: true, 14326 hasValue: () => !!alt, 14327 onDeselect: () => setAttributes({ 14328 alt: '' 14329 }), 14330 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 14331 __nextHasNoMarginBottom: true, 14332 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 14333 value: alt, 14334 onChange: newAlt => setAttributes({ 14335 alt: newAlt 14336 }), 14337 help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 14338 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 14339 href: 14340 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 14341 (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), 14342 children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') 14343 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] 14344 }) 14345 }) 14346 }), !!imageSizeOptions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResolutionTool, { 14347 value: sizeSlug, 14348 onChange: updateImage, 14349 options: imageSizeOptions, 14350 defaultValue: DEFAULT_MEDIA_SIZE_SLUG 14351 })] 14352 }) 14353 }), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 14354 group: "color", 14355 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 14356 __experimentalIsRenderedInSidebar: true, 14357 settings: [{ 14358 colorValue: overlayColor.color, 14359 gradientValue, 14360 label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), 14361 onColorChange: setOverlayColor, 14362 onGradientChange: setGradient, 14363 isShownByDefault: true, 14364 resetAllFilter: () => ({ 14365 overlayColor: undefined, 14366 customOverlayColor: undefined, 14367 gradient: undefined, 14368 customGradient: undefined 14369 }), 14370 clearable: true 14371 }], 14372 panelId: clientId, 14373 ...colorGradientSettings 14374 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14375 hasValue: () => { 14376 // If there's a media background the dimRatio will be 14377 // defaulted to 50 whereas it will be 100 for colors. 14378 return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100); 14379 }, 14380 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 14381 onDeselect: () => updateDimRatio(url ? 50 : 100), 14382 resetAllFilter: () => ({ 14383 dimRatio: url ? 50 : 100 14384 }), 14385 isShownByDefault: true, 14386 panelId: clientId, 14387 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 14388 __nextHasNoMarginBottom: true, 14389 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 14390 value: dimRatio, 14391 onChange: newDimRatio => updateDimRatio(newDimRatio), 14392 min: 0, 14393 max: 100, 14394 step: 10, 14395 required: true, 14396 __next40pxDefaultSize: true 14397 }) 14398 })] 14399 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 14400 group: "dimensions", 14401 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 14402 className: "single-column", 14403 hasValue: () => !!minHeight, 14404 label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), 14405 onDeselect: () => setAttributes({ 14406 minHeight: undefined, 14407 minHeightUnit: undefined 14408 }), 14409 resetAllFilter: () => ({ 14410 minHeight: undefined, 14411 minHeightUnit: undefined 14412 }), 14413 isShownByDefault: true, 14414 panelId: clientId, 14415 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverHeightInput, { 14416 value: attributes?.style?.dimensions?.aspectRatio ? '' : minHeight, 14417 unit: minHeightUnit, 14418 onChange: newMinHeight => setAttributes({ 14419 minHeight: newMinHeight, 14420 style: inspector_controls_cleanEmptyObject({ 14421 ...attributes?.style, 14422 dimensions: { 14423 ...attributes?.style?.dimensions, 14424 aspectRatio: undefined // Reset aspect ratio when minHeight is set. 14425 } 14426 }) 14427 }), 14428 onUnitChange: nextUnit => setAttributes({ 14429 minHeightUnit: nextUnit 14430 }) 14431 }) 14432 }) 14433 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 14434 group: "advanced", 14435 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 14436 __nextHasNoMarginBottom: true, 14437 __next40pxDefaultSize: true, 14438 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 14439 options: [{ 14440 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 14441 value: 'div' 14442 }, { 14443 label: '<header>', 14444 value: 'header' 14445 }, { 14446 label: '<main>', 14447 value: 'main' 14448 }, { 14449 label: '<section>', 14450 value: 'section' 14451 }, { 14452 label: '<article>', 14453 value: 'article' 14454 }, { 14455 label: '<aside>', 14456 value: 'aside' 14457 }, { 14458 label: '<footer>', 14459 value: 'footer' 14460 }], 14461 value: tagName, 14462 onChange: value => setAttributes({ 14463 tagName: value 14464 }), 14465 help: htmlElementMessages[tagName] 14466 }) 14467 })] 14468 }); 14469 } 14470 14471 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js 14472 /** 14473 * WordPress dependencies 14474 */ 14475 14476 14477 14478 14479 /** 14480 * Internal dependencies 14481 */ 14482 14483 14484 14485 const { 14486 cleanEmptyObject: block_controls_cleanEmptyObject 14487 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 14488 function CoverBlockControls({ 14489 attributes, 14490 setAttributes, 14491 onSelectMedia, 14492 currentSettings, 14493 toggleUseFeaturedImage, 14494 onClearMedia 14495 }) { 14496 const { 14497 contentPosition, 14498 id, 14499 useFeaturedImage, 14500 minHeight, 14501 minHeightUnit 14502 } = attributes; 14503 const { 14504 hasInnerBlocks, 14505 url 14506 } = currentSettings; 14507 const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight); 14508 const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit); 14509 const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100 && !attributes?.style?.dimensions?.aspectRatio; 14510 const toggleMinFullHeight = () => { 14511 if (isMinFullHeight) { 14512 // If there aren't previous values, take the default ones. 14513 if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) { 14514 return setAttributes({ 14515 minHeight: undefined, 14516 minHeightUnit: undefined 14517 }); 14518 } 14519 14520 // Set the previous values of height. 14521 return setAttributes({ 14522 minHeight: prevMinHeightValue, 14523 minHeightUnit: prevMinHeightUnit 14524 }); 14525 } 14526 setPrevMinHeightValue(minHeight); 14527 setPrevMinHeightUnit(minHeightUnit); 14528 14529 // Set full height, and clear any aspect ratio value. 14530 return setAttributes({ 14531 minHeight: 100, 14532 minHeightUnit: 'vh', 14533 style: block_controls_cleanEmptyObject({ 14534 ...attributes?.style, 14535 dimensions: { 14536 ...attributes?.style?.dimensions, 14537 aspectRatio: undefined // Reset aspect ratio when minHeight is set. 14538 } 14539 }) 14540 }); 14541 }; 14542 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 14543 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 14544 group: "block", 14545 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, { 14546 label: (0,external_wp_i18n_namespaceObject.__)('Change content position'), 14547 value: contentPosition, 14548 onChange: nextPosition => setAttributes({ 14549 contentPosition: nextPosition 14550 }), 14551 isDisabled: !hasInnerBlocks 14552 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, { 14553 isActive: isMinFullHeight, 14554 onToggle: toggleMinFullHeight, 14555 isDisabled: !hasInnerBlocks 14556 })] 14557 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 14558 group: "other", 14559 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 14560 mediaId: id, 14561 mediaURL: url, 14562 allowedTypes: shared_ALLOWED_MEDIA_TYPES, 14563 accept: "image/*,video/*", 14564 onSelect: onSelectMedia, 14565 onToggleFeaturedImage: toggleUseFeaturedImage, 14566 useFeaturedImage: useFeaturedImage, 14567 name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add media') : (0,external_wp_i18n_namespaceObject.__)('Replace'), 14568 onReset: onClearMedia 14569 }) 14570 })] 14571 }); 14572 } 14573 14574 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js 14575 /** 14576 * WordPress dependencies 14577 */ 14578 14579 14580 14581 14582 /** 14583 * Internal dependencies 14584 */ 14585 14586 14587 function CoverPlaceholder({ 14588 disableMediaButtons = false, 14589 children, 14590 onSelectMedia, 14591 onError, 14592 style, 14593 toggleUseFeaturedImage 14594 }) { 14595 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 14596 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 14597 icon: library_cover 14598 }), 14599 labels: { 14600 title: (0,external_wp_i18n_namespaceObject.__)('Cover') 14601 }, 14602 onSelect: onSelectMedia, 14603 accept: "image/*,video/*", 14604 allowedTypes: shared_ALLOWED_MEDIA_TYPES, 14605 disableMediaButtons: disableMediaButtons, 14606 onToggleFeaturedImage: toggleUseFeaturedImage, 14607 onError: onError, 14608 style: style, 14609 children: children 14610 }); 14611 } 14612 14613 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover-popover.js 14614 /** 14615 * External dependencies 14616 */ 14617 14618 14619 /** 14620 * WordPress dependencies 14621 */ 14622 14623 14624 14625 /** 14626 * Internal dependencies 14627 */ 14628 14629 14630 const RESIZABLE_BOX_ENABLE_OPTION = { 14631 top: false, 14632 right: false, 14633 bottom: true, 14634 left: false, 14635 topRight: false, 14636 bottomRight: false, 14637 bottomLeft: false, 14638 topLeft: false 14639 }; 14640 const { 14641 ResizableBoxPopover 14642 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 14643 function ResizableCoverPopover({ 14644 className, 14645 height, 14646 minHeight, 14647 onResize, 14648 onResizeStart, 14649 onResizeStop, 14650 showHandle, 14651 size, 14652 width, 14653 ...props 14654 }) { 14655 const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); 14656 const resizableBoxProps = { 14657 className: dist_clsx(className, { 14658 'is-resizing': isResizing 14659 }), 14660 enable: RESIZABLE_BOX_ENABLE_OPTION, 14661 onResizeStart: (_event, _direction, elt) => { 14662 onResizeStart(elt.clientHeight); 14663 onResize(elt.clientHeight); 14664 }, 14665 onResize: (_event, _direction, elt) => { 14666 onResize(elt.clientHeight); 14667 if (!isResizing) { 14668 setIsResizing(true); 14669 } 14670 }, 14671 onResizeStop: (_event, _direction, elt) => { 14672 onResizeStop(elt.clientHeight); 14673 setIsResizing(false); 14674 }, 14675 showHandle, 14676 size, 14677 __experimentalShowTooltip: true, 14678 __experimentalTooltipProps: { 14679 axis: 'y', 14680 position: 'bottom', 14681 isVisible: isResizing 14682 } 14683 }; 14684 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableBoxPopover, { 14685 className: "block-library-cover__resizable-box-popover", 14686 resizableBoxProps: resizableBoxProps, 14687 ...props 14688 }); 14689 } 14690 14691 ;// ./node_modules/colord/index.mjs 14692 var colord_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)*(colord_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()})}; 14693 14694 ;// ./node_modules/colord/plugins/names.mjs 14695 /* 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"])} 14696 14697 ;// ./node_modules/fast-average-color/dist/index.esm.js 14698 /*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */ 14699 function toHex(num) { 14700 var str = num.toString(16); 14701 return str.length === 1 ? '0' + str : str; 14702 } 14703 function arrayToHex(arr) { 14704 return '#' + arr.map(toHex).join(''); 14705 } 14706 function isDark(color) { 14707 // http://www.w3.org/TR/AERT#color-contrast 14708 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; 14709 return result < 128; 14710 } 14711 function prepareIgnoredColor(color) { 14712 if (!color) { 14713 return []; 14714 } 14715 return isRGBArray(color) ? color : [color]; 14716 } 14717 function isRGBArray(value) { 14718 return Array.isArray(value[0]); 14719 } 14720 function isIgnoredColor(data, index, ignoredColor) { 14721 for (var i = 0; i < ignoredColor.length; i++) { 14722 if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) { 14723 return true; 14724 } 14725 } 14726 return false; 14727 } 14728 function isIgnoredColorAsNumbers(data, index, ignoredColor) { 14729 switch (ignoredColor.length) { 14730 case 3: 14731 // [red, green, blue] 14732 if (isIgnoredRGBColor(data, index, ignoredColor)) { 14733 return true; 14734 } 14735 break; 14736 case 4: 14737 // [red, green, blue, alpha] 14738 if (isIgnoredRGBAColor(data, index, ignoredColor)) { 14739 return true; 14740 } 14741 break; 14742 case 5: 14743 // [red, green, blue, alpha, threshold] 14744 if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { 14745 return true; 14746 } 14747 break; 14748 default: 14749 return false; 14750 } 14751 } 14752 function isIgnoredRGBColor(data, index, ignoredColor) { 14753 // Ignore if the pixel are transparent. 14754 if (data[index + 3] !== 255) { 14755 return true; 14756 } 14757 if (data[index] === ignoredColor[0] && 14758 data[index + 1] === ignoredColor[1] && 14759 data[index + 2] === ignoredColor[2]) { 14760 return true; 14761 } 14762 return false; 14763 } 14764 function isIgnoredRGBAColor(data, index, ignoredColor) { 14765 if (data[index + 3] && ignoredColor[3]) { 14766 return data[index] === ignoredColor[0] && 14767 data[index + 1] === ignoredColor[1] && 14768 data[index + 2] === ignoredColor[2] && 14769 data[index + 3] === ignoredColor[3]; 14770 } 14771 // Ignore rgb components if the pixel are fully transparent. 14772 return data[index + 3] === ignoredColor[3]; 14773 } 14774 function inRange(colorComponent, ignoredColorComponent, value) { 14775 return colorComponent >= (ignoredColorComponent - value) && 14776 colorComponent <= (ignoredColorComponent + value); 14777 } 14778 function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { 14779 var redIgnored = ignoredColor[0]; 14780 var greenIgnored = ignoredColor[1]; 14781 var blueIgnored = ignoredColor[2]; 14782 var alphaIgnored = ignoredColor[3]; 14783 var threshold = ignoredColor[4]; 14784 var alphaData = data[index + 3]; 14785 var alphaInRange = inRange(alphaData, alphaIgnored, threshold); 14786 if (!alphaIgnored) { 14787 return alphaInRange; 14788 } 14789 if (!alphaData && alphaInRange) { 14790 return true; 14791 } 14792 if (inRange(data[index], redIgnored, threshold) && 14793 inRange(data[index + 1], greenIgnored, threshold) && 14794 inRange(data[index + 2], blueIgnored, threshold) && 14795 alphaInRange) { 14796 return true; 14797 } 14798 return false; 14799 } 14800 14801 function dominantAlgorithm(arr, len, options) { 14802 var colorHash = {}; 14803 var divider = 24; 14804 var ignoredColor = options.ignoredColor; 14805 var step = options.step; 14806 var max = [0, 0, 0, 0, 0]; 14807 for (var i = 0; i < len; i += step) { 14808 var red = arr[i]; 14809 var green = arr[i + 1]; 14810 var blue = arr[i + 2]; 14811 var alpha = arr[i + 3]; 14812 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 14813 continue; 14814 } 14815 var key = Math.round(red / divider) + ',' + 14816 Math.round(green / divider) + ',' + 14817 Math.round(blue / divider); 14818 if (colorHash[key]) { 14819 colorHash[key] = [ 14820 colorHash[key][0] + red * alpha, 14821 colorHash[key][1] + green * alpha, 14822 colorHash[key][2] + blue * alpha, 14823 colorHash[key][3] + alpha, 14824 colorHash[key][4] + 1 14825 ]; 14826 } 14827 else { 14828 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 14829 } 14830 if (max[4] < colorHash[key][4]) { 14831 max = colorHash[key]; 14832 } 14833 } 14834 var redTotal = max[0]; 14835 var greenTotal = max[1]; 14836 var blueTotal = max[2]; 14837 var alphaTotal = max[3]; 14838 var count = max[4]; 14839 return alphaTotal ? [ 14840 Math.round(redTotal / alphaTotal), 14841 Math.round(greenTotal / alphaTotal), 14842 Math.round(blueTotal / alphaTotal), 14843 Math.round(alphaTotal / count) 14844 ] : options.defaultColor; 14845 } 14846 14847 function simpleAlgorithm(arr, len, options) { 14848 var redTotal = 0; 14849 var greenTotal = 0; 14850 var blueTotal = 0; 14851 var alphaTotal = 0; 14852 var count = 0; 14853 var ignoredColor = options.ignoredColor; 14854 var step = options.step; 14855 for (var i = 0; i < len; i += step) { 14856 var alpha = arr[i + 3]; 14857 var red = arr[i] * alpha; 14858 var green = arr[i + 1] * alpha; 14859 var blue = arr[i + 2] * alpha; 14860 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 14861 continue; 14862 } 14863 redTotal += red; 14864 greenTotal += green; 14865 blueTotal += blue; 14866 alphaTotal += alpha; 14867 count++; 14868 } 14869 return alphaTotal ? [ 14870 Math.round(redTotal / alphaTotal), 14871 Math.round(greenTotal / alphaTotal), 14872 Math.round(blueTotal / alphaTotal), 14873 Math.round(alphaTotal / count) 14874 ] : options.defaultColor; 14875 } 14876 14877 function sqrtAlgorithm(arr, len, options) { 14878 var redTotal = 0; 14879 var greenTotal = 0; 14880 var blueTotal = 0; 14881 var alphaTotal = 0; 14882 var count = 0; 14883 var ignoredColor = options.ignoredColor; 14884 var step = options.step; 14885 for (var i = 0; i < len; i += step) { 14886 var red = arr[i]; 14887 var green = arr[i + 1]; 14888 var blue = arr[i + 2]; 14889 var alpha = arr[i + 3]; 14890 if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { 14891 continue; 14892 } 14893 redTotal += red * red * alpha; 14894 greenTotal += green * green * alpha; 14895 blueTotal += blue * blue * alpha; 14896 alphaTotal += alpha; 14897 count++; 14898 } 14899 return alphaTotal ? [ 14900 Math.round(Math.sqrt(redTotal / alphaTotal)), 14901 Math.round(Math.sqrt(greenTotal / alphaTotal)), 14902 Math.round(Math.sqrt(blueTotal / alphaTotal)), 14903 Math.round(alphaTotal / count) 14904 ] : options.defaultColor; 14905 } 14906 14907 function getDefaultColor(options) { 14908 return getOption(options, 'defaultColor', [0, 0, 0, 0]); 14909 } 14910 function getOption(options, name, defaultValue) { 14911 return (options[name] === undefined ? defaultValue : options[name]); 14912 } 14913 14914 var MIN_SIZE = 10; 14915 var MAX_SIZE = 100; 14916 function isSvg(filename) { 14917 return filename.search(/\.svg(\?|$)/i) !== -1; 14918 } 14919 function getOriginalSize(resource) { 14920 if (isInstanceOfHTMLImageElement(resource)) { 14921 var width = resource.naturalWidth; 14922 var height = resource.naturalHeight; 14923 // For SVG images with only viewBox attribute 14924 if (!resource.naturalWidth && isSvg(resource.src)) { 14925 width = height = MAX_SIZE; 14926 } 14927 return { 14928 width: width, 14929 height: height, 14930 }; 14931 } 14932 if (isInstanceOfHTMLVideoElement(resource)) { 14933 return { 14934 width: resource.videoWidth, 14935 height: resource.videoHeight 14936 }; 14937 } 14938 return { 14939 width: resource.width, 14940 height: resource.height 14941 }; 14942 } 14943 function getSrc(resource) { 14944 if (isInstanceOfHTMLCanvasElement(resource)) { 14945 return 'canvas'; 14946 } 14947 if (isInstanceOfOffscreenCanvas(resource)) { 14948 return 'offscreencanvas'; 14949 } 14950 if (isInstanceOfImageBitmap(resource)) { 14951 return 'imagebitmap'; 14952 } 14953 return resource.src; 14954 } 14955 function isInstanceOfHTMLImageElement(resource) { 14956 return typeof HTMLImageElement !== 'undefined' && resource instanceof HTMLImageElement; 14957 } 14958 var hasOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'; 14959 function isInstanceOfOffscreenCanvas(resource) { 14960 return hasOffscreenCanvas && resource instanceof OffscreenCanvas; 14961 } 14962 function isInstanceOfHTMLVideoElement(resource) { 14963 return typeof HTMLVideoElement !== 'undefined' && resource instanceof HTMLVideoElement; 14964 } 14965 function isInstanceOfHTMLCanvasElement(resource) { 14966 return typeof HTMLCanvasElement !== 'undefined' && resource instanceof HTMLCanvasElement; 14967 } 14968 function isInstanceOfImageBitmap(resource) { 14969 return typeof ImageBitmap !== 'undefined' && resource instanceof ImageBitmap; 14970 } 14971 function prepareSizeAndPosition(originalSize, options) { 14972 var srcLeft = getOption(options, 'left', 0); 14973 var srcTop = getOption(options, 'top', 0); 14974 var srcWidth = getOption(options, 'width', originalSize.width); 14975 var srcHeight = getOption(options, 'height', originalSize.height); 14976 var destWidth = srcWidth; 14977 var destHeight = srcHeight; 14978 if (options.mode === 'precision') { 14979 return { 14980 srcLeft: srcLeft, 14981 srcTop: srcTop, 14982 srcWidth: srcWidth, 14983 srcHeight: srcHeight, 14984 destWidth: destWidth, 14985 destHeight: destHeight 14986 }; 14987 } 14988 var factor; 14989 if (srcWidth > srcHeight) { 14990 factor = srcWidth / srcHeight; 14991 destWidth = MAX_SIZE; 14992 destHeight = Math.round(destWidth / factor); 14993 } 14994 else { 14995 factor = srcHeight / srcWidth; 14996 destHeight = MAX_SIZE; 14997 destWidth = Math.round(destHeight / factor); 14998 } 14999 if (destWidth > srcWidth || destHeight > srcHeight || 15000 destWidth < MIN_SIZE || destHeight < MIN_SIZE) { 15001 destWidth = srcWidth; 15002 destHeight = srcHeight; 15003 } 15004 return { 15005 srcLeft: srcLeft, 15006 srcTop: srcTop, 15007 srcWidth: srcWidth, 15008 srcHeight: srcHeight, 15009 destWidth: destWidth, 15010 destHeight: destHeight 15011 }; 15012 } 15013 var isWebWorkers = typeof window === 'undefined'; 15014 function makeCanvas() { 15015 if (isWebWorkers) { 15016 return hasOffscreenCanvas ? new OffscreenCanvas(1, 1) : null; 15017 } 15018 return document.createElement('canvas'); 15019 } 15020 15021 var ERROR_PREFIX = 'FastAverageColor: '; 15022 function getError(message) { 15023 return Error(ERROR_PREFIX + message); 15024 } 15025 function outputError(error, silent) { 15026 if (!silent) { 15027 console.error(error); 15028 } 15029 } 15030 15031 var FastAverageColor = /** @class */ (function () { 15032 function FastAverageColor() { 15033 this.canvas = null; 15034 this.ctx = null; 15035 } 15036 /** 15037 * Get asynchronously the average color from not loaded image. 15038 */ 15039 FastAverageColor.prototype.getColorAsync = function (resource, options) { 15040 if (!resource) { 15041 return Promise.reject(getError('call .getColorAsync() without resource.')); 15042 } 15043 if (typeof resource === 'string') { 15044 // Web workers 15045 if (typeof Image === 'undefined') { 15046 return Promise.reject(getError('resource as string is not supported in this environment')); 15047 } 15048 var img = new Image(); 15049 img.crossOrigin = options && options.crossOrigin || ''; 15050 img.src = resource; 15051 return this.bindImageEvents(img, options); 15052 } 15053 else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { 15054 return this.bindImageEvents(resource, options); 15055 } 15056 else { 15057 var result = this.getColor(resource, options); 15058 return result.error ? Promise.reject(result.error) : Promise.resolve(result); 15059 } 15060 }; 15061 /** 15062 * Get the average color from images, videos and canvas. 15063 */ 15064 FastAverageColor.prototype.getColor = function (resource, options) { 15065 options = options || {}; 15066 var defaultColor = getDefaultColor(options); 15067 if (!resource) { 15068 var error = getError('call .getColor(null) without resource'); 15069 outputError(error, options.silent); 15070 return this.prepareResult(defaultColor, error); 15071 } 15072 var originalSize = getOriginalSize(resource); 15073 var size = prepareSizeAndPosition(originalSize, options); 15074 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 15075 var error = getError("incorrect sizes for resource \"".concat(getSrc(resource), "\"")); 15076 outputError(error, options.silent); 15077 return this.prepareResult(defaultColor, error); 15078 } 15079 if (!this.canvas) { 15080 this.canvas = makeCanvas(); 15081 if (!this.canvas) { 15082 var error = getError('OffscreenCanvas is not supported in this browser'); 15083 outputError(error, options.silent); 15084 return this.prepareResult(defaultColor, error); 15085 } 15086 } 15087 if (!this.ctx) { 15088 this.ctx = this.canvas.getContext('2d', { willReadFrequently: true }); 15089 if (!this.ctx) { 15090 var error = getError('Canvas Context 2D is not supported in this browser'); 15091 outputError(error, options.silent); 15092 return this.prepareResult(defaultColor); 15093 } 15094 this.ctx.imageSmoothingEnabled = false; 15095 } 15096 this.canvas.width = size.destWidth; 15097 this.canvas.height = size.destHeight; 15098 try { 15099 this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); 15100 this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 15101 var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 15102 return this.prepareResult(this.getColorFromArray4(bitmapData, options)); 15103 } 15104 catch (originalError) { 15105 var error = getError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image")); 15106 outputError(error, options.silent); 15107 !options.silent && console.error(originalError); 15108 return this.prepareResult(defaultColor, error); 15109 } 15110 }; 15111 /** 15112 * Get the average color from a array when 1 pixel is 4 bytes. 15113 */ 15114 FastAverageColor.prototype.getColorFromArray4 = function (arr, options) { 15115 options = options || {}; 15116 var bytesPerPixel = 4; 15117 var arrLength = arr.length; 15118 var defaultColor = getDefaultColor(options); 15119 if (arrLength < bytesPerPixel) { 15120 return defaultColor; 15121 } 15122 var len = arrLength - arrLength % bytesPerPixel; 15123 var step = (options.step || 1) * bytesPerPixel; 15124 var algorithm; 15125 switch (options.algorithm || 'sqrt') { 15126 case 'simple': 15127 algorithm = simpleAlgorithm; 15128 break; 15129 case 'sqrt': 15130 algorithm = sqrtAlgorithm; 15131 break; 15132 case 'dominant': 15133 algorithm = dominantAlgorithm; 15134 break; 15135 default: 15136 throw getError("".concat(options.algorithm, " is unknown algorithm")); 15137 } 15138 return algorithm(arr, len, { 15139 defaultColor: defaultColor, 15140 ignoredColor: prepareIgnoredColor(options.ignoredColor), 15141 step: step 15142 }); 15143 }; 15144 /** 15145 * Get color data from value ([r, g, b, a]). 15146 */ 15147 FastAverageColor.prototype.prepareResult = function (value, error) { 15148 var rgb = value.slice(0, 3); 15149 var rgba = [value[0], value[1], value[2], value[3] / 255]; 15150 var isDarkColor = isDark(value); 15151 return { 15152 value: [value[0], value[1], value[2], value[3]], 15153 rgb: 'rgb(' + rgb.join(',') + ')', 15154 rgba: 'rgba(' + rgba.join(',') + ')', 15155 hex: arrayToHex(rgb), 15156 hexa: arrayToHex(value), 15157 isDark: isDarkColor, 15158 isLight: !isDarkColor, 15159 error: error, 15160 }; 15161 }; 15162 /** 15163 * Destroy the instance. 15164 */ 15165 FastAverageColor.prototype.destroy = function () { 15166 if (this.canvas) { 15167 this.canvas.width = 1; 15168 this.canvas.height = 1; 15169 this.canvas = null; 15170 } 15171 this.ctx = null; 15172 }; 15173 FastAverageColor.prototype.bindImageEvents = function (resource, options) { 15174 var _this = this; 15175 return new Promise(function (resolve, reject) { 15176 var onload = function () { 15177 unbindEvents(); 15178 var result = _this.getColor(resource, options); 15179 if (result.error) { 15180 reject(result.error); 15181 } 15182 else { 15183 resolve(result); 15184 } 15185 }; 15186 var onerror = function () { 15187 unbindEvents(); 15188 reject(getError("Error loading image \"".concat(resource.src, "\"."))); 15189 }; 15190 var onabort = function () { 15191 unbindEvents(); 15192 reject(getError("Image \"".concat(resource.src, "\" loading aborted"))); 15193 }; 15194 var unbindEvents = function () { 15195 resource.removeEventListener('load', onload); 15196 resource.removeEventListener('error', onerror); 15197 resource.removeEventListener('abort', onabort); 15198 }; 15199 resource.addEventListener('load', onload); 15200 resource.addEventListener('error', onerror); 15201 resource.addEventListener('abort', onabort); 15202 }); 15203 }; 15204 return FastAverageColor; 15205 }()); 15206 15207 15208 15209 ;// external ["wp","hooks"] 15210 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 15211 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/color-utils.js 15212 /** 15213 * External dependencies 15214 */ 15215 15216 15217 15218 15219 15220 /** 15221 * WordPress dependencies 15222 */ 15223 15224 15225 /** 15226 * @typedef {import('colord').RgbaColor} RgbaColor 15227 */ 15228 15229 k([names]); 15230 15231 /** 15232 * Fallback color when the average color can't be computed. The image may be 15233 * rendering as transparent, and most sites have a light color background. 15234 */ 15235 const DEFAULT_BACKGROUND_COLOR = '#FFF'; 15236 15237 /** 15238 * Default dim color specified in style.css. 15239 */ 15240 const DEFAULT_OVERLAY_COLOR = '#000'; 15241 15242 /** 15243 * Performs a Porter Duff composite source over operation on two rgba colors. 15244 * 15245 * @see {@link https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_srcover} 15246 * 15247 * @param {RgbaColor} source Source color. 15248 * @param {RgbaColor} dest Destination color. 15249 * 15250 * @return {RgbaColor} Composite color. 15251 */ 15252 function compositeSourceOver(source, dest) { 15253 return { 15254 r: source.r * source.a + dest.r * dest.a * (1 - source.a), 15255 g: source.g * source.a + dest.g * dest.a * (1 - source.a), 15256 b: source.b * source.a + dest.b * dest.a * (1 - source.a), 15257 a: source.a + dest.a * (1 - source.a) 15258 }; 15259 } 15260 15261 /** 15262 * Retrieves the FastAverageColor singleton. 15263 * 15264 * @return {FastAverageColor} The FastAverageColor singleton. 15265 */ 15266 function retrieveFastAverageColor() { 15267 if (!retrieveFastAverageColor.fastAverageColor) { 15268 retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); 15269 } 15270 return retrieveFastAverageColor.fastAverageColor; 15271 } 15272 15273 /** 15274 * Computes the average color of an image. 15275 * 15276 * @param {string} url The url of the image. 15277 * 15278 * @return {Promise<string>} Promise of an average color as a hex string. 15279 */ 15280 const getMediaColor = memize(async url => { 15281 if (!url) { 15282 return DEFAULT_BACKGROUND_COLOR; 15283 } 15284 15285 // making the default color rgb for compat with FAC 15286 const { 15287 r, 15288 g, 15289 b, 15290 a 15291 } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); 15292 try { 15293 const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); 15294 const color = await retrieveFastAverageColor().getColorAsync(url, { 15295 // The default color is white, which is the color 15296 // that is returned if there's an error. 15297 // colord returns alpga 0-1, FAC needs 0-255 15298 defaultColor: [r, g, b, a * 255], 15299 // Errors that come up don't reject the promise, 15300 // so error logging has to be silenced 15301 // with this option. 15302 silent: "production" === 'production', 15303 crossOrigin: imgCrossOrigin 15304 }); 15305 return color.hex; 15306 } catch (error) { 15307 // If there's an error return the fallback color. 15308 return DEFAULT_BACKGROUND_COLOR; 15309 } 15310 }); 15311 15312 /** 15313 * Computes if the color combination of the overlay and background color is dark. 15314 * 15315 * @param {number} dimRatio Opacity of the overlay between 0 and 100. 15316 * @param {string} overlayColor CSS color string for the overlay. 15317 * @param {string} backgroundColor CSS color string for the background. 15318 * 15319 * @return {boolean} true if the color combination composite result is dark. 15320 */ 15321 function compositeIsDark(dimRatio, overlayColor, backgroundColor) { 15322 // Opacity doesn't matter if you're overlaying the same color on top of itself. 15323 // And background doesn't matter when overlay is fully opaque. 15324 if (overlayColor === backgroundColor || dimRatio === 100) { 15325 return w(overlayColor).isDark(); 15326 } 15327 const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); 15328 const background = w(backgroundColor).toRgb(); 15329 const composite = compositeSourceOver(overlay, background); 15330 return w(composite).isDark(); 15331 } 15332 15333 ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js 15334 /** 15335 * External dependencies 15336 */ 15337 15338 15339 /** 15340 * WordPress dependencies 15341 */ 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 /** 15353 * Internal dependencies 15354 */ 15355 15356 15357 15358 15359 15360 15361 15362 15363 function getInnerBlocksTemplate(attributes) { 15364 return [['core/paragraph', { 15365 align: 'center', 15366 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'), 15367 ...attributes 15368 }]]; 15369 } 15370 15371 /** 15372 * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while 15373 * the media (image or video) is being uploaded and will not have an id allocated yet. 15374 * 15375 * @param {number} id The id of the media. 15376 * @param {string} url The url of the media. 15377 * 15378 * @return {boolean} Is the URL a Blob URL. 15379 */ 15380 const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); 15381 function CoverEdit({ 15382 attributes, 15383 clientId, 15384 isSelected, 15385 overlayColor, 15386 setAttributes, 15387 setOverlayColor, 15388 toggleSelection, 15389 context: { 15390 postId, 15391 postType 15392 } 15393 }) { 15394 var _media$media_details$; 15395 const { 15396 contentPosition, 15397 id, 15398 url: originalUrl, 15399 backgroundType: originalBackgroundType, 15400 useFeaturedImage, 15401 dimRatio, 15402 focalPoint, 15403 hasParallax, 15404 isDark, 15405 isRepeated, 15406 minHeight, 15407 minHeightUnit, 15408 alt, 15409 allowedBlocks, 15410 templateLock, 15411 tagName: TagName = 'div', 15412 isUserOverlayColor, 15413 sizeSlug 15414 } = attributes; 15415 const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); 15416 const { 15417 getSettings 15418 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 15419 const { 15420 __unstableMarkNextChangeAsNotPersistent 15421 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 15422 const { 15423 media 15424 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 15425 return { 15426 media: featuredImage && useFeaturedImage ? select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { 15427 context: 'view' 15428 }) : undefined 15429 }; 15430 }, [featuredImage, useFeaturedImage]); 15431 const mediaUrl = (_media$media_details$ = media?.media_details?.sizes?.[sizeSlug]?.source_url) !== null && _media$media_details$ !== void 0 ? _media$media_details$ : media?.source_url; 15432 15433 // User can change the featured image outside of the block, but we still 15434 // need to update the block when that happens. This effect should only 15435 // run when the featured image changes in that case. All other cases are 15436 // handled in their respective callbacks. 15437 (0,external_wp_element_namespaceObject.useEffect)(() => { 15438 (async () => { 15439 if (!useFeaturedImage) { 15440 return; 15441 } 15442 const averageBackgroundColor = await getMediaColor(mediaUrl); 15443 let newOverlayColor = overlayColor.color; 15444 if (!isUserOverlayColor) { 15445 newOverlayColor = averageBackgroundColor; 15446 __unstableMarkNextChangeAsNotPersistent(); 15447 setOverlayColor(newOverlayColor); 15448 } 15449 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); 15450 __unstableMarkNextChangeAsNotPersistent(); 15451 setAttributes({ 15452 isDark: newIsDark, 15453 isUserOverlayColor: isUserOverlayColor || false 15454 }); 15455 })(); 15456 // Update the block only when the featured image changes. 15457 }, [mediaUrl]); 15458 15459 // instead of destructuring the attributes 15460 // we define the url and background type 15461 // depending on the value of the useFeaturedImage flag 15462 // to preview in edit the dynamic featured image 15463 const url = useFeaturedImage ? mediaUrl : 15464 // Ensure the url is not malformed due to sanitization through `wp_kses`. 15465 originalUrl?.replaceAll('&', '&'); 15466 const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; 15467 const { 15468 createErrorNotice 15469 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 15470 const { 15471 gradientClass, 15472 gradientValue 15473 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 15474 const onSelectMedia = async newMedia => { 15475 const mediaAttributes = attributesFromMedia(newMedia); 15476 const isImage = [newMedia?.type, newMedia?.media_type].includes(IMAGE_BACKGROUND_TYPE); 15477 const averageBackgroundColor = await getMediaColor(isImage ? newMedia?.url : undefined); 15478 let newOverlayColor = overlayColor.color; 15479 if (!isUserOverlayColor) { 15480 newOverlayColor = averageBackgroundColor; 15481 setOverlayColor(newOverlayColor); 15482 15483 // Make undo revert the next setAttributes and the previous setOverlayColor. 15484 __unstableMarkNextChangeAsNotPersistent(); 15485 } 15486 15487 // Only set a new dimRatio if there was no previous media selected 15488 // to avoid resetting to 50 if it has been explicitly set to 100. 15489 // See issue #52835 for context. 15490 const newDimRatio = originalUrl === undefined && dimRatio === 100 ? 50 : dimRatio; 15491 const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); 15492 if (backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id) { 15493 const { 15494 imageDefaultSize 15495 } = getSettings(); 15496 15497 // Try to use the previous selected image size if it's available 15498 // otherwise try the default image size or fallback to full size. 15499 if (sizeSlug && (newMedia?.sizes?.[sizeSlug] || newMedia?.media_details?.sizes?.[sizeSlug])) { 15500 mediaAttributes.sizeSlug = sizeSlug; 15501 mediaAttributes.url = newMedia?.sizes?.[sizeSlug]?.url || newMedia?.media_details?.sizes?.[sizeSlug]?.source_url; 15502 } else if (newMedia?.sizes?.[imageDefaultSize] || newMedia?.media_details?.sizes?.[imageDefaultSize]) { 15503 mediaAttributes.sizeSlug = imageDefaultSize; 15504 mediaAttributes.url = newMedia?.sizes?.[imageDefaultSize]?.url || newMedia?.media_details?.sizes?.[imageDefaultSize]?.source_url; 15505 } else { 15506 mediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG; 15507 } 15508 } 15509 setAttributes({ 15510 ...mediaAttributes, 15511 focalPoint: undefined, 15512 useFeaturedImage: undefined, 15513 dimRatio: newDimRatio, 15514 isDark: newIsDark, 15515 isUserOverlayColor: isUserOverlayColor || false 15516 }); 15517 }; 15518 const onClearMedia = () => { 15519 let newOverlayColor = overlayColor.color; 15520 if (!isUserOverlayColor) { 15521 newOverlayColor = DEFAULT_OVERLAY_COLOR; 15522 setOverlayColor(undefined); 15523 15524 // Make undo revert the next setAttributes and the previous setOverlayColor. 15525 __unstableMarkNextChangeAsNotPersistent(); 15526 } 15527 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, DEFAULT_BACKGROUND_COLOR); 15528 setAttributes({ 15529 url: undefined, 15530 id: undefined, 15531 backgroundType: undefined, 15532 focalPoint: undefined, 15533 hasParallax: undefined, 15534 isRepeated: undefined, 15535 useFeaturedImage: undefined, 15536 isDark: newIsDark 15537 }); 15538 }; 15539 const onSetOverlayColor = async newOverlayColor => { 15540 const averageBackgroundColor = await getMediaColor(url); 15541 const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); 15542 setOverlayColor(newOverlayColor); 15543 15544 // Make undo revert the next setAttributes and the previous setOverlayColor. 15545 __unstableMarkNextChangeAsNotPersistent(); 15546 setAttributes({ 15547 isUserOverlayColor: true, 15548 isDark: newIsDark 15549 }); 15550 }; 15551 const onUpdateDimRatio = async newDimRatio => { 15552 const averageBackgroundColor = await getMediaColor(url); 15553 const newIsDark = compositeIsDark(newDimRatio, overlayColor.color, averageBackgroundColor); 15554 setAttributes({ 15555 dimRatio: newDimRatio, 15556 isDark: newIsDark 15557 }); 15558 }; 15559 const onUploadError = message => { 15560 createErrorNotice(message, { 15561 type: 'snackbar' 15562 }); 15563 }; 15564 const isUploadingMedia = isTemporaryMedia(id, url); 15565 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 15566 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 15567 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 15568 const hasNonContentControls = blockEditingMode === 'default'; 15569 const [resizeListener, { 15570 height, 15571 width 15572 }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 15573 const resizableBoxDimensions = (0,external_wp_element_namespaceObject.useMemo)(() => { 15574 return { 15575 height: minHeightUnit === 'px' ? minHeight : 'auto', 15576 width: 'auto' 15577 }; 15578 }, [minHeight, minHeightUnit]); 15579 const minHeightWithUnit = minHeight && minHeightUnit ? `$minHeight}$minHeightUnit}` : minHeight; 15580 const isImgElement = !(hasParallax || isRepeated); 15581 const style = { 15582 minHeight: minHeightWithUnit || undefined 15583 }; 15584 const backgroundImage = url ? `url($url})` : undefined; 15585 const backgroundPosition = mediaPosition(focalPoint); 15586 const bgStyle = { 15587 backgroundColor: overlayColor.color 15588 }; 15589 const mediaStyle = { 15590 objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined 15591 }; 15592 const hasBackground = !!(url || overlayColor.color || gradientValue); 15593 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]); 15594 const ref = (0,external_wp_element_namespaceObject.useRef)(); 15595 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 15596 ref 15597 }); 15598 15599 // Check for fontSize support before we pass a fontSize attribute to the innerBlocks. 15600 const [fontSizes] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fontSizes'); 15601 const hasFontSizes = fontSizes?.length > 0; 15602 const innerBlocksTemplate = getInnerBlocksTemplate({ 15603 fontSize: hasFontSizes ? 'large' : undefined 15604 }); 15605 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 15606 className: 'wp-block-cover__inner-container' 15607 }, { 15608 // Avoid template sync when the `templateLock` value is `all` or `contentOnly`. 15609 // See: https://github.com/WordPress/gutenberg/pull/45632 15610 template: !hasInnerBlocks ? innerBlocksTemplate : undefined, 15611 templateInsertUpdatesSelection: true, 15612 allowedBlocks, 15613 templateLock, 15614 dropZoneElement: ref.current 15615 }); 15616 const mediaElement = (0,external_wp_element_namespaceObject.useRef)(); 15617 const currentSettings = { 15618 isVideoBackground, 15619 isImageBackground, 15620 mediaElement, 15621 hasInnerBlocks, 15622 url, 15623 isImgElement, 15624 overlayColor 15625 }; 15626 const toggleUseFeaturedImage = async () => { 15627 const newUseFeaturedImage = !useFeaturedImage; 15628 const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; 15629 const newOverlayColor = !isUserOverlayColor ? averageBackgroundColor : overlayColor.color; 15630 if (!isUserOverlayColor) { 15631 if (newUseFeaturedImage) { 15632 setOverlayColor(newOverlayColor); 15633 } else { 15634 setOverlayColor(undefined); 15635 } 15636 15637 // Make undo revert the next setAttributes and the previous setOverlayColor. 15638 __unstableMarkNextChangeAsNotPersistent(); 15639 } 15640 const newDimRatio = dimRatio === 100 ? 50 : dimRatio; 15641 const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); 15642 setAttributes({ 15643 id: undefined, 15644 url: undefined, 15645 useFeaturedImage: newUseFeaturedImage, 15646 dimRatio: newDimRatio, 15647 backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined, 15648 isDark: newIsDark 15649 }); 15650 }; 15651 const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverBlockControls, { 15652 attributes: attributes, 15653 setAttributes: setAttributes, 15654 onSelectMedia: onSelectMedia, 15655 currentSettings: currentSettings, 15656 toggleUseFeaturedImage: toggleUseFeaturedImage, 15657 onClearMedia: onClearMedia 15658 }); 15659 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverInspectorControls, { 15660 attributes: attributes, 15661 setAttributes: setAttributes, 15662 clientId: clientId, 15663 setOverlayColor: onSetOverlayColor, 15664 coverRef: ref, 15665 currentSettings: currentSettings, 15666 toggleUseFeaturedImage: toggleUseFeaturedImage, 15667 updateDimRatio: onUpdateDimRatio, 15668 onClearMedia: onClearMedia, 15669 featuredImage: media 15670 }); 15671 const resizableCoverProps = { 15672 className: 'block-library-cover__resize-container', 15673 clientId, 15674 height, 15675 minHeight: minHeightWithUnit, 15676 onResizeStart: () => { 15677 setAttributes({ 15678 minHeightUnit: 'px' 15679 }); 15680 toggleSelection(false); 15681 }, 15682 onResize: value => { 15683 setAttributes({ 15684 minHeight: value 15685 }); 15686 }, 15687 onResizeStop: newMinHeight => { 15688 toggleSelection(true); 15689 setAttributes({ 15690 minHeight: newMinHeight 15691 }); 15692 }, 15693 // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. 15694 showHandle: !attributes.style?.dimensions?.aspectRatio, 15695 size: resizableBoxDimensions, 15696 width 15697 }; 15698 if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { 15699 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 15700 children: [blockControls, inspectorControls, hasNonContentControls && isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { 15701 ...resizableCoverProps 15702 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 15703 ...blockProps, 15704 className: dist_clsx('is-placeholder', blockProps.className), 15705 style: { 15706 ...blockProps.style, 15707 minHeight: minHeightWithUnit || undefined 15708 }, 15709 children: [resizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { 15710 onSelectMedia: onSelectMedia, 15711 onError: onUploadError, 15712 toggleUseFeaturedImage: toggleUseFeaturedImage, 15713 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 15714 className: "wp-block-cover__placeholder-background-options", 15715 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { 15716 disableCustomColors: true, 15717 value: overlayColor.color, 15718 onChange: onSetOverlayColor, 15719 clearable: false 15720 }) 15721 }) 15722 })] 15723 })] 15724 }); 15725 } 15726 const classes = dist_clsx({ 15727 'is-dark-theme': isDark, 15728 'is-light': !isDark, 15729 'is-transient': isUploadingMedia, 15730 'has-parallax': hasParallax, 15731 'is-repeated': isRepeated, 15732 'has-custom-content-position': !isContentPositionCenter(contentPosition) 15733 }, getPositionClassName(contentPosition)); 15734 const showOverlay = url || !useFeaturedImage || useFeaturedImage && !url; 15735 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 15736 children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 15737 ...blockProps, 15738 className: dist_clsx(classes, blockProps.className), 15739 style: { 15740 ...style, 15741 ...blockProps.style 15742 }, 15743 "data-url": url, 15744 children: [resizeListener, !url && useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 15745 className: "wp-block-cover__image--placeholder-image", 15746 withIllustration: true 15747 }), url && isImageBackground && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 15748 ref: mediaElement, 15749 className: "wp-block-cover__image-background", 15750 alt: alt, 15751 src: url, 15752 style: mediaStyle 15753 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 15754 ref: mediaElement, 15755 role: alt ? 'img' : undefined, 15756 "aria-label": alt ? alt : undefined, 15757 className: dist_clsx(classes, 'wp-block-cover__image-background'), 15758 style: { 15759 backgroundImage, 15760 backgroundPosition 15761 } 15762 })), url && isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 15763 ref: mediaElement, 15764 className: "wp-block-cover__video-background", 15765 autoPlay: true, 15766 muted: true, 15767 loop: true, 15768 src: url, 15769 style: mediaStyle 15770 }), showOverlay && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 15771 "aria-hidden": "true", 15772 className: dist_clsx('wp-block-cover__background', dimRatioToClass(dimRatio), { 15773 [overlayColor.class]: overlayColor.class, 15774 'has-background-dim': dimRatio !== undefined, 15775 // For backwards compatibility. Former versions of the Cover Block applied 15776 // `.wp-block-cover__gradient-background` in the presence of 15777 // media, a gradient and a dim. 15778 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 15779 'has-background-gradient': gradientValue, 15780 [gradientClass]: gradientClass 15781 }), 15782 style: { 15783 backgroundImage: gradientValue, 15784 ...bgStyle 15785 } 15786 }), isUploadingMedia && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { 15787 disableMediaButtons: true, 15788 onSelectMedia: onSelectMedia, 15789 onError: onUploadError, 15790 toggleUseFeaturedImage: toggleUseFeaturedImage 15791 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 15792 ...innerBlocksProps 15793 })] 15794 }), hasNonContentControls && isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { 15795 ...resizableCoverProps 15796 })] 15797 }); 15798 } 15799 /* harmony default export */ const cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ 15800 overlayColor: 'background-color' 15801 })])(CoverEdit)); 15802 15803 ;// ./node_modules/@wordpress/block-library/build-module/cover/save.js 15804 /** 15805 * External dependencies 15806 */ 15807 15808 15809 /** 15810 * WordPress dependencies 15811 */ 15812 15813 15814 /** 15815 * Internal dependencies 15816 */ 15817 15818 15819 function cover_save_save({ 15820 attributes 15821 }) { 15822 const { 15823 backgroundType, 15824 gradient, 15825 contentPosition, 15826 customGradient, 15827 customOverlayColor, 15828 dimRatio, 15829 focalPoint, 15830 useFeaturedImage, 15831 hasParallax, 15832 isDark, 15833 isRepeated, 15834 overlayColor, 15835 url, 15836 alt, 15837 id, 15838 minHeight: minHeightProp, 15839 minHeightUnit, 15840 tagName: Tag, 15841 sizeSlug 15842 } = attributes; 15843 const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); 15844 const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); 15845 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 15846 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 15847 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 15848 const isImgElement = !(hasParallax || isRepeated); 15849 const style = { 15850 minHeight: minHeight || undefined 15851 }; 15852 const bgStyle = { 15853 backgroundColor: !overlayColorClass ? customOverlayColor : undefined, 15854 background: customGradient ? customGradient : undefined 15855 }; 15856 const objectPosition = 15857 // prettier-ignore 15858 focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; 15859 const backgroundImage = url ? `url($url})` : undefined; 15860 const backgroundPosition = mediaPosition(focalPoint); 15861 const classes = dist_clsx({ 15862 'is-light': !isDark, 15863 'has-parallax': hasParallax, 15864 'is-repeated': isRepeated, 15865 'has-custom-content-position': !isContentPositionCenter(contentPosition) 15866 }, getPositionClassName(contentPosition)); 15867 const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-$id}` : null, { 15868 [`size-$sizeSlug}`]: sizeSlug, 15869 'has-parallax': hasParallax, 15870 'is-repeated': isRepeated 15871 }); 15872 const gradientValue = gradient || customGradient; 15873 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { 15874 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 15875 className: classes, 15876 style 15877 }), 15878 children: [!useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 15879 className: imgClasses, 15880 alt: alt, 15881 src: url, 15882 style: { 15883 objectPosition 15884 }, 15885 "data-object-fit": "cover", 15886 "data-object-position": objectPosition 15887 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 15888 role: alt ? 'img' : undefined, 15889 "aria-label": alt ? alt : undefined, 15890 className: imgClasses, 15891 style: { 15892 backgroundPosition, 15893 backgroundImage 15894 } 15895 })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 15896 className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), 15897 autoPlay: true, 15898 muted: true, 15899 loop: true, 15900 playsInline: true, 15901 src: url, 15902 style: { 15903 objectPosition 15904 }, 15905 "data-object-fit": "cover", 15906 "data-object-position": objectPosition 15907 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 15908 "aria-hidden": "true", 15909 className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 15910 'has-background-dim': dimRatio !== undefined, 15911 // For backwards compatibility. Former versions of the Cover Block applied 15912 // `.wp-block-cover__gradient-background` in the presence of 15913 // media, a gradient and a dim. 15914 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 15915 'has-background-gradient': gradientValue, 15916 [gradientClass]: gradientClass 15917 }), 15918 style: bgStyle 15919 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 15920 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 15921 className: 'wp-block-cover__inner-container' 15922 }) 15923 })] 15924 }); 15925 } 15926 15927 ;// ./node_modules/@wordpress/block-library/build-module/cover/transforms.js 15928 /** 15929 * WordPress dependencies 15930 */ 15931 15932 15933 15934 /** 15935 * Internal dependencies 15936 */ 15937 15938 15939 const { 15940 cleanEmptyObject: transforms_cleanEmptyObject 15941 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 15942 const cover_transforms_transforms = { 15943 from: [{ 15944 type: 'block', 15945 blocks: ['core/image'], 15946 transform: ({ 15947 caption, 15948 url, 15949 alt, 15950 align, 15951 id, 15952 anchor, 15953 style 15954 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { 15955 dimRatio: 50, 15956 url, 15957 alt, 15958 align, 15959 id, 15960 anchor, 15961 style: { 15962 color: { 15963 duotone: style?.color?.duotone 15964 } 15965 } 15966 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 15967 content: caption, 15968 fontSize: 'large', 15969 align: 'center' 15970 })]) 15971 }, { 15972 type: 'block', 15973 blocks: ['core/video'], 15974 transform: ({ 15975 caption, 15976 src, 15977 align, 15978 id, 15979 anchor 15980 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { 15981 dimRatio: 50, 15982 url: src, 15983 align, 15984 id, 15985 backgroundType: VIDEO_BACKGROUND_TYPE, 15986 anchor 15987 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 15988 content: caption, 15989 fontSize: 'large', 15990 align: 'center' 15991 })]) 15992 }, { 15993 type: 'block', 15994 blocks: ['core/group'], 15995 transform: (attributes, innerBlocks) => { 15996 const { 15997 align, 15998 anchor, 15999 backgroundColor, 16000 gradient, 16001 style 16002 } = attributes; 16003 16004 // If the Group block being transformed has a Cover block as its 16005 // only child return that Cover block. 16006 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/cover') { 16007 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks); 16008 } 16009 16010 // If no background or gradient color is provided, default to 50% opacity. 16011 // This matches the styling of a Cover block with a background image, 16012 // in the state where a background image has been removed. 16013 const dimRatio = backgroundColor || gradient || style?.color?.background || style?.color?.gradient ? undefined : 50; 16014 16015 // Move the background or gradient color to the parent Cover block. 16016 const parentAttributes = { 16017 align, 16018 anchor, 16019 dimRatio, 16020 overlayColor: backgroundColor, 16021 customOverlayColor: style?.color?.background, 16022 gradient, 16023 customGradient: style?.color?.gradient 16024 }; 16025 const attributesWithoutBackgroundColors = { 16026 ...attributes, 16027 backgroundColor: undefined, 16028 gradient: undefined, 16029 style: transforms_cleanEmptyObject({ 16030 ...attributes?.style, 16031 color: style?.color ? { 16032 ...style?.color, 16033 background: undefined, 16034 gradient: undefined 16035 } : undefined 16036 }) 16037 }; 16038 16039 // Preserve the block by nesting it within the Cover block, 16040 // instead of converting the Group block directly to the Cover block. 16041 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]); 16042 } 16043 }], 16044 to: [{ 16045 type: 'block', 16046 blocks: ['core/image'], 16047 isMatch: ({ 16048 backgroundType, 16049 url, 16050 overlayColor, 16051 customOverlayColor, 16052 gradient, 16053 customGradient 16054 }) => { 16055 if (url) { 16056 // If a url exists the transform could happen if that URL represents an image background. 16057 return backgroundType === IMAGE_BACKGROUND_TYPE; 16058 } 16059 // If a url is not set the transform could happen if the cover has no background color or gradient; 16060 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 16061 }, 16062 transform: ({ 16063 title, 16064 url, 16065 alt, 16066 align, 16067 id, 16068 anchor, 16069 style 16070 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 16071 caption: title, 16072 url, 16073 alt, 16074 align, 16075 id, 16076 anchor, 16077 style: { 16078 color: { 16079 duotone: style?.color?.duotone 16080 } 16081 } 16082 }) 16083 }, { 16084 type: 'block', 16085 blocks: ['core/video'], 16086 isMatch: ({ 16087 backgroundType, 16088 url, 16089 overlayColor, 16090 customOverlayColor, 16091 gradient, 16092 customGradient 16093 }) => { 16094 if (url) { 16095 // If a url exists the transform could happen if that URL represents a video background. 16096 return backgroundType === VIDEO_BACKGROUND_TYPE; 16097 } 16098 // If a url is not set the transform could happen if the cover has no background color or gradient; 16099 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 16100 }, 16101 transform: ({ 16102 title, 16103 url, 16104 align, 16105 id, 16106 anchor 16107 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 16108 caption: title, 16109 src: url, 16110 id, 16111 align, 16112 anchor 16113 }) 16114 }, { 16115 type: 'block', 16116 blocks: ['core/group'], 16117 isMatch: ({ 16118 url, 16119 useFeaturedImage 16120 }) => { 16121 // If the Cover block uses background media, skip this transform, 16122 // and instead use the Group block's default transform. 16123 if (url || useFeaturedImage) { 16124 return false; 16125 } 16126 return true; 16127 }, 16128 transform: (attributes, innerBlocks) => { 16129 // Convert Cover overlay colors to comparable Group background colors. 16130 const transformedColorAttributes = { 16131 backgroundColor: attributes?.overlayColor, 16132 gradient: attributes?.gradient, 16133 style: transforms_cleanEmptyObject({ 16134 ...attributes?.style, 16135 color: attributes?.customOverlayColor || attributes?.customGradient || attributes?.style?.color ? { 16136 background: attributes?.customOverlayColor, 16137 gradient: attributes?.customGradient, 16138 ...attributes?.style?.color 16139 } : undefined 16140 }) 16141 }; 16142 16143 // If the Cover block contains only a single Group block as a direct child, 16144 // then attempt to merge the Cover's background colors with the child Group block, 16145 // and remove the Cover block as the wrapper. 16146 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/group') { 16147 const groupAttributes = transforms_cleanEmptyObject(innerBlocks[0].attributes || {}); 16148 16149 // If the Group block contains any kind of background color or gradient, 16150 // skip merging Cover background colors, and preserve the Group block's colors. 16151 if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { 16152 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, innerBlocks[0]?.innerBlocks); 16153 } 16154 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 16155 ...transformedColorAttributes, 16156 ...groupAttributes, 16157 style: transforms_cleanEmptyObject({ 16158 ...groupAttributes?.style, 16159 color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { 16160 ...transformedColorAttributes?.style?.color, 16161 ...groupAttributes?.style?.color 16162 } : undefined 16163 }) 16164 }, innerBlocks[0]?.innerBlocks); 16165 } 16166 16167 // In all other cases, transform the Cover block directly to a Group block. 16168 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 16169 ...attributes, 16170 ...transformedColorAttributes 16171 }, innerBlocks); 16172 } 16173 }] 16174 }; 16175 /* harmony default export */ const cover_transforms = (cover_transforms_transforms); 16176 16177 ;// ./node_modules/@wordpress/block-library/build-module/cover/variations.js 16178 /** 16179 * WordPress dependencies 16180 */ 16181 16182 16183 const cover_variations_variations = [{ 16184 name: 'cover', 16185 title: (0,external_wp_i18n_namespaceObject.__)('Cover'), 16186 description: (0,external_wp_i18n_namespaceObject.__)('Add an image or video with a text overlay.'), 16187 attributes: { 16188 layout: { 16189 type: 'constrained' 16190 } 16191 }, 16192 isDefault: true, 16193 icon: library_cover 16194 }]; 16195 /* harmony default export */ const cover_variations = (cover_variations_variations); 16196 16197 ;// ./node_modules/@wordpress/block-library/build-module/cover/index.js 16198 /** 16199 * WordPress dependencies 16200 */ 16201 16202 16203 16204 /** 16205 * Internal dependencies 16206 */ 16207 16208 16209 16210 const cover_metadata = { 16211 $schema: "https://schemas.wp.org/trunk/block.json", 16212 apiVersion: 3, 16213 name: "core/cover", 16214 title: "Cover", 16215 category: "media", 16216 description: "Add an image or video with a text overlay.", 16217 textdomain: "default", 16218 attributes: { 16219 url: { 16220 type: "string" 16221 }, 16222 useFeaturedImage: { 16223 type: "boolean", 16224 "default": false 16225 }, 16226 id: { 16227 type: "number" 16228 }, 16229 alt: { 16230 type: "string", 16231 "default": "" 16232 }, 16233 hasParallax: { 16234 type: "boolean", 16235 "default": false 16236 }, 16237 isRepeated: { 16238 type: "boolean", 16239 "default": false 16240 }, 16241 dimRatio: { 16242 type: "number", 16243 "default": 100 16244 }, 16245 overlayColor: { 16246 type: "string" 16247 }, 16248 customOverlayColor: { 16249 type: "string" 16250 }, 16251 isUserOverlayColor: { 16252 type: "boolean" 16253 }, 16254 backgroundType: { 16255 type: "string", 16256 "default": "image" 16257 }, 16258 focalPoint: { 16259 type: "object" 16260 }, 16261 minHeight: { 16262 type: "number" 16263 }, 16264 minHeightUnit: { 16265 type: "string" 16266 }, 16267 gradient: { 16268 type: "string" 16269 }, 16270 customGradient: { 16271 type: "string" 16272 }, 16273 contentPosition: { 16274 type: "string" 16275 }, 16276 isDark: { 16277 type: "boolean", 16278 "default": true 16279 }, 16280 allowedBlocks: { 16281 type: "array" 16282 }, 16283 templateLock: { 16284 type: ["string", "boolean"], 16285 "enum": ["all", "insert", "contentOnly", false] 16286 }, 16287 tagName: { 16288 type: "string", 16289 "default": "div" 16290 }, 16291 sizeSlug: { 16292 type: "string" 16293 } 16294 }, 16295 usesContext: ["postId", "postType"], 16296 supports: { 16297 anchor: true, 16298 align: true, 16299 html: false, 16300 shadow: true, 16301 spacing: { 16302 padding: true, 16303 margin: ["top", "bottom"], 16304 blockGap: true, 16305 __experimentalDefaultControls: { 16306 padding: true, 16307 blockGap: true 16308 } 16309 }, 16310 __experimentalBorder: { 16311 color: true, 16312 radius: true, 16313 style: true, 16314 width: true, 16315 __experimentalDefaultControls: { 16316 color: true, 16317 radius: true, 16318 style: true, 16319 width: true 16320 } 16321 }, 16322 color: { 16323 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 16324 heading: true, 16325 text: true, 16326 background: false, 16327 __experimentalSkipSerialization: ["gradients"], 16328 enableContrastChecker: false 16329 }, 16330 dimensions: { 16331 aspectRatio: true 16332 }, 16333 typography: { 16334 fontSize: true, 16335 lineHeight: true, 16336 __experimentalFontFamily: true, 16337 __experimentalFontWeight: true, 16338 __experimentalFontStyle: true, 16339 __experimentalTextTransform: true, 16340 __experimentalTextDecoration: true, 16341 __experimentalLetterSpacing: true, 16342 __experimentalDefaultControls: { 16343 fontSize: true 16344 } 16345 }, 16346 layout: { 16347 allowJustification: false 16348 }, 16349 interactivity: { 16350 clientNavigation: true 16351 } 16352 }, 16353 editorStyle: "wp-block-cover-editor", 16354 style: "wp-block-cover" 16355 }; 16356 16357 16358 16359 const { 16360 name: cover_name 16361 } = cover_metadata; 16362 16363 const cover_settings = { 16364 icon: library_cover, 16365 example: { 16366 attributes: { 16367 customOverlayColor: '#065174', 16368 dimRatio: 40, 16369 url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg', 16370 style: { 16371 typography: { 16372 fontSize: 48 16373 }, 16374 color: { 16375 text: 'white' 16376 } 16377 } 16378 }, 16379 innerBlocks: [{ 16380 name: 'core/paragraph', 16381 attributes: { 16382 content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'), 16383 align: 'center' 16384 } 16385 }] 16386 }, 16387 transforms: cover_transforms, 16388 save: cover_save_save, 16389 edit: cover_edit, 16390 deprecated: cover_deprecated, 16391 variations: cover_variations 16392 }; 16393 const cover_init = () => initBlock({ 16394 name: cover_name, 16395 metadata: cover_metadata, 16396 settings: cover_settings 16397 }); 16398 16399 ;// ./node_modules/@wordpress/icons/build-module/library/details.js 16400 /** 16401 * WordPress dependencies 16402 */ 16403 16404 16405 const details = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 16406 viewBox: "0 0 24 24", 16407 xmlns: "http://www.w3.org/2000/svg", 16408 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 16409 d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", 16410 fillRule: "evenodd", 16411 clipRule: "evenodd" 16412 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 16413 d: "m4 5.25 4 2.5-4 2.5v-5Z" 16414 })] 16415 }); 16416 /* harmony default export */ const library_details = (details); 16417 16418 ;// ./node_modules/@wordpress/block-library/build-module/details/edit.js 16419 /** 16420 * WordPress dependencies 16421 */ 16422 16423 16424 16425 16426 16427 /** 16428 * Internal dependencies 16429 */ 16430 16431 16432 const details_edit_TEMPLATE = [['core/paragraph', { 16433 placeholder: (0,external_wp_i18n_namespaceObject.__)('Type / to add a hidden block') 16434 }]]; 16435 function DetailsEdit({ 16436 attributes, 16437 setAttributes 16438 }) { 16439 const { 16440 name, 16441 showContent, 16442 summary, 16443 allowedBlocks, 16444 placeholder 16445 } = attributes; 16446 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 16447 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 16448 template: details_edit_TEMPLATE, 16449 __experimentalCaptureToolbars: true, 16450 allowedBlocks 16451 }); 16452 const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(showContent); 16453 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 16454 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 16455 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 16456 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 16457 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 16458 resetAll: () => { 16459 setAttributes({ 16460 showContent: false 16461 }); 16462 }, 16463 dropdownMenuProps: dropdownMenuProps, 16464 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 16465 isShownByDefault: true, 16466 label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), 16467 hasValue: () => showContent, 16468 onDeselect: () => { 16469 setAttributes({ 16470 showContent: false 16471 }); 16472 }, 16473 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 16474 __nextHasNoMarginBottom: true, 16475 label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), 16476 checked: showContent, 16477 onChange: () => setAttributes({ 16478 showContent: !showContent 16479 }) 16480 }) 16481 }) 16482 }) 16483 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 16484 group: "advanced", 16485 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 16486 __next40pxDefaultSize: true, 16487 __nextHasNoMarginBottom: true, 16488 label: (0,external_wp_i18n_namespaceObject.__)('Name attribute'), 16489 value: name || '', 16490 onChange: newName => setAttributes({ 16491 name: newName 16492 }), 16493 help: (0,external_wp_i18n_namespaceObject.__)('Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.') 16494 }) 16495 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { 16496 ...innerBlocksProps, 16497 open: isOpen, 16498 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { 16499 onClick: event => { 16500 event.preventDefault(); 16501 setIsOpen(!isOpen); 16502 }, 16503 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 16504 identifier: "summary", 16505 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Write summary'), 16506 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Write summary…'), 16507 allowedFormats: [], 16508 withoutInteractiveFormatting: true, 16509 value: summary, 16510 onChange: newSummary => setAttributes({ 16511 summary: newSummary 16512 }) 16513 }) 16514 }), innerBlocksProps.children] 16515 })] 16516 }); 16517 } 16518 /* harmony default export */ const details_edit = (DetailsEdit); 16519 16520 ;// ./node_modules/@wordpress/block-library/build-module/details/save.js 16521 /** 16522 * WordPress dependencies 16523 */ 16524 16525 16526 function details_save_save({ 16527 attributes 16528 }) { 16529 const { 16530 name, 16531 showContent 16532 } = attributes; 16533 const summary = attributes.summary ? attributes.summary : 'Details'; 16534 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 16535 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { 16536 ...blockProps, 16537 name: name || undefined, 16538 open: showContent, 16539 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { 16540 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 16541 value: summary 16542 }) 16543 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})] 16544 }); 16545 } 16546 16547 ;// ./node_modules/@wordpress/block-library/build-module/details/transforms.js 16548 /* wp:polyfill */ 16549 /** 16550 * WordPress dependencies 16551 */ 16552 16553 /* harmony default export */ const details_transforms = ({ 16554 from: [{ 16555 type: 'block', 16556 isMultiBlock: true, 16557 blocks: ['*'], 16558 isMatch({}, blocks) { 16559 return !(blocks.length === 1 && blocks[0].name === 'core/details'); 16560 }, 16561 __experimentalConvert(blocks) { 16562 return (0,external_wp_blocks_namespaceObject.createBlock)('core/details', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))); 16563 } 16564 }] 16565 }); 16566 16567 ;// ./node_modules/@wordpress/block-library/build-module/details/index.js 16568 /** 16569 * WordPress dependencies 16570 */ 16571 16572 16573 16574 /** 16575 * Internal dependencies 16576 */ 16577 16578 const details_metadata = { 16579 $schema: "https://schemas.wp.org/trunk/block.json", 16580 apiVersion: 3, 16581 name: "core/details", 16582 title: "Details", 16583 category: "text", 16584 description: "Hide and show additional content.", 16585 keywords: ["accordion", "summary", "toggle", "disclosure"], 16586 textdomain: "default", 16587 attributes: { 16588 showContent: { 16589 type: "boolean", 16590 "default": false 16591 }, 16592 summary: { 16593 type: "rich-text", 16594 source: "rich-text", 16595 selector: "summary" 16596 }, 16597 name: { 16598 type: "string", 16599 source: "attribute", 16600 attribute: "name", 16601 selector: ".wp-block-details" 16602 }, 16603 allowedBlocks: { 16604 type: "array" 16605 }, 16606 placeholder: { 16607 type: "string" 16608 } 16609 }, 16610 supports: { 16611 __experimentalOnEnter: true, 16612 align: ["wide", "full"], 16613 anchor: true, 16614 color: { 16615 gradients: true, 16616 link: true, 16617 __experimentalDefaultControls: { 16618 background: true, 16619 text: true 16620 } 16621 }, 16622 __experimentalBorder: { 16623 color: true, 16624 width: true, 16625 style: true 16626 }, 16627 html: false, 16628 spacing: { 16629 margin: true, 16630 padding: true, 16631 blockGap: true, 16632 __experimentalDefaultControls: { 16633 margin: false, 16634 padding: false 16635 } 16636 }, 16637 typography: { 16638 fontSize: true, 16639 lineHeight: true, 16640 __experimentalFontFamily: true, 16641 __experimentalFontWeight: true, 16642 __experimentalFontStyle: true, 16643 __experimentalTextTransform: true, 16644 __experimentalTextDecoration: true, 16645 __experimentalLetterSpacing: true, 16646 __experimentalDefaultControls: { 16647 fontSize: true 16648 } 16649 }, 16650 layout: { 16651 allowEditing: false 16652 }, 16653 interactivity: { 16654 clientNavigation: true 16655 } 16656 }, 16657 editorStyle: "wp-block-details-editor", 16658 style: "wp-block-details" 16659 }; 16660 16661 16662 16663 const { 16664 name: details_name 16665 } = details_metadata; 16666 16667 const details_settings = { 16668 icon: library_details, 16669 example: { 16670 attributes: { 16671 summary: 'La Mancha', 16672 showContent: true 16673 }, 16674 innerBlocks: [{ 16675 name: 'core/paragraph', 16676 attributes: { 16677 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.') 16678 } 16679 }] 16680 }, 16681 __experimentalLabel(attributes, { 16682 context 16683 }) { 16684 const { 16685 summary 16686 } = attributes; 16687 const customName = attributes?.metadata?.name; 16688 const hasSummary = summary?.trim().length > 0; 16689 16690 // In the list view, use the block's summary as the label. 16691 // If the summary is empty, fall back to the default label. 16692 if (context === 'list-view' && (customName || hasSummary)) { 16693 return customName || summary; 16694 } 16695 if (context === 'accessibility') { 16696 return !hasSummary ? (0,external_wp_i18n_namespaceObject.__)('Details. Empty.') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text; summary title. */ 16697 (0,external_wp_i18n_namespaceObject.__)('Details. %s'), summary); 16698 } 16699 }, 16700 save: details_save_save, 16701 edit: details_edit, 16702 transforms: details_transforms 16703 }; 16704 const details_init = () => initBlock({ 16705 name: details_name, 16706 metadata: details_metadata, 16707 settings: details_settings 16708 }); 16709 16710 ;// ./node_modules/@wordpress/icons/build-module/library/pencil.js 16711 /** 16712 * WordPress dependencies 16713 */ 16714 16715 16716 const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 16717 xmlns: "http://www.w3.org/2000/svg", 16718 viewBox: "0 0 24 24", 16719 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 16720 d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" 16721 }) 16722 }); 16723 /* harmony default export */ const library_pencil = (pencil); 16724 16725 ;// ./node_modules/@wordpress/icons/build-module/library/edit.js 16726 /** 16727 * Internal dependencies 16728 */ 16729 16730 16731 /* harmony default export */ const library_edit = (library_pencil); 16732 16733 ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js 16734 /** 16735 * WordPress dependencies 16736 */ 16737 16738 16739 16740 16741 16742 function getResponsiveHelp(checked) { 16743 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.'); 16744 } 16745 const EmbedControls = ({ 16746 blockSupportsResponsive, 16747 showEditButton, 16748 themeSupportsResponsive, 16749 allowResponsive, 16750 toggleResponsive, 16751 switchBackToURLInput 16752 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 16753 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 16754 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 16755 children: showEditButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 16756 className: "components-toolbar__control", 16757 label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'), 16758 icon: library_edit, 16759 onClick: switchBackToURLInput 16760 }) 16761 }) 16762 }), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 16763 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 16764 title: (0,external_wp_i18n_namespaceObject.__)('Media settings'), 16765 className: "blocks-responsive", 16766 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 16767 __nextHasNoMarginBottom: true, 16768 label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'), 16769 checked: allowResponsive, 16770 help: getResponsiveHelp, 16771 onChange: toggleResponsive 16772 }) 16773 }) 16774 })] 16775 }); 16776 /* harmony default export */ const embed_controls = (EmbedControls); 16777 16778 ;// ./node_modules/@wordpress/block-library/build-module/embed/icons.js 16779 /** 16780 * WordPress dependencies 16781 */ 16782 16783 16784 const embedContentIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16785 viewBox: "0 0 24 24", 16786 xmlns: "http://www.w3.org/2000/svg", 16787 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16788 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" 16789 }) 16790 }); 16791 const embedAudioIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16792 viewBox: "0 0 24 24", 16793 xmlns: "http://www.w3.org/2000/svg", 16794 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16795 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" 16796 }) 16797 }); 16798 const embedPhotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16799 viewBox: "0 0 24 24", 16800 xmlns: "http://www.w3.org/2000/svg", 16801 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16802 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" 16803 }) 16804 }); 16805 const embedVideoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16806 viewBox: "0 0 24 24", 16807 xmlns: "http://www.w3.org/2000/svg", 16808 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16809 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" 16810 }) 16811 }); 16812 const embedTwitterIcon = { 16813 foreground: '#1da1f2', 16814 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16815 xmlns: "http://www.w3.org/2000/svg", 16816 viewBox: "0 0 24 24", 16817 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { 16818 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16819 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" 16820 }) 16821 }) 16822 }) 16823 }; 16824 const embedYouTubeIcon = { 16825 foreground: '#ff0000', 16826 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16827 viewBox: "0 0 24 24", 16828 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16829 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" 16830 }) 16831 }) 16832 }; 16833 const embedFacebookIcon = { 16834 foreground: '#3b5998', 16835 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16836 viewBox: "0 0 24 24", 16837 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16838 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" 16839 }) 16840 }) 16841 }; 16842 const embedInstagramIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16843 viewBox: "0 0 24 24", 16844 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { 16845 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16846 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" 16847 }) 16848 }) 16849 }); 16850 const embedWordPressIcon = { 16851 foreground: '#0073AA', 16852 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16853 viewBox: "0 0 24 24", 16854 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { 16855 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16856 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" 16857 }) 16858 }) 16859 }) 16860 }; 16861 const embedSpotifyIcon = { 16862 foreground: '#1db954', 16863 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16864 viewBox: "0 0 24 24", 16865 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16866 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" 16867 }) 16868 }) 16869 }; 16870 const embedFlickrIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16871 viewBox: "0 0 24 24", 16872 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16873 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" 16874 }) 16875 }); 16876 const embedVimeoIcon = { 16877 foreground: '#1ab7ea', 16878 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16879 xmlns: "http://www.w3.org/2000/svg", 16880 viewBox: "0 0 24 24", 16881 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { 16882 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16883 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" 16884 }) 16885 }) 16886 }) 16887 }; 16888 const embedRedditIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16889 viewBox: "0 0 24 24", 16890 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16891 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" 16892 }) 16893 }); 16894 const embedTumblrIcon = { 16895 foreground: '#35465c', 16896 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16897 viewBox: "0 0 24 24", 16898 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16899 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" 16900 }) 16901 }) 16902 }; 16903 const embedAmazonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 16904 viewBox: "0 0 24 24", 16905 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16906 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" 16907 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16908 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" 16909 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16910 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" 16911 })] 16912 }); 16913 const embedAnimotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 16914 viewBox: "0 0 24 24", 16915 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16916 d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", 16917 fill: "#4bc7ee" 16918 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16919 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", 16920 fill: "#d4cdcb" 16921 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16922 d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", 16923 fill: "#c3d82e" 16924 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16925 d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", 16926 fill: "#e4ecb0" 16927 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16928 d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", 16929 fill: "#209dbd" 16930 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16931 d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", 16932 fill: "#7cb3c9" 16933 })] 16934 }); 16935 const embedDailymotionIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16936 viewBox: "0 0 24 24", 16937 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16938 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", 16939 fill: "#333436" 16940 }) 16941 }); 16942 const embedPinterestIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16943 width: "24", 16944 height: "24", 16945 viewBox: "0 0 24 24", 16946 version: "1.1", 16947 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16948 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" 16949 }) 16950 }); 16951 const embedWolframIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16952 viewBox: "0 0 44 44", 16953 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16954 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" 16955 }) 16956 }); 16957 const embedPocketCastsIcon = { 16958 foreground: '#f43e37', 16959 src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 16960 width: "24", 16961 height: "24", 16962 viewBox: "0 0 24 24", 16963 fill: "none", 16964 xmlns: "http://www.w3.org/2000/svg", 16965 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16966 fillRule: "evenodd", 16967 clipRule: "evenodd", 16968 d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" 16969 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16970 fillRule: "evenodd", 16971 clipRule: "evenodd", 16972 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", 16973 fill: "#fff" 16974 })] 16975 }) 16976 }; 16977 const embedBlueskyIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 16978 viewBox: "0 0 24 24", 16979 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 16980 fill: "#0a7aff", 16981 d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" 16982 }) 16983 }); 16984 16985 ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js 16986 /** 16987 * WordPress dependencies 16988 */ 16989 16990 16991 const EmbedLoading = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 16992 className: "wp-block-embed is-loading", 16993 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 16994 }); 16995 /* harmony default export */ const embed_loading = (EmbedLoading); 16996 16997 ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js 16998 /** 16999 * WordPress dependencies 17000 */ 17001 17002 17003 17004 17005 const EmbedPlaceholder = ({ 17006 icon, 17007 label, 17008 value, 17009 onSubmit, 17010 onChange, 17011 cannotEmbed, 17012 fallback, 17013 tryAgain 17014 }) => { 17015 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 17016 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 17017 icon: icon, 17018 showColors: true 17019 }), 17020 label: label, 17021 className: "wp-block-embed", 17022 instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.'), 17023 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { 17024 onSubmit: onSubmit, 17025 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { 17026 __next40pxDefaultSize: true, 17027 type: "url", 17028 value: value || '', 17029 className: "wp-block-embed__placeholder-input", 17030 label: label, 17031 hideLabelFromVision: true, 17032 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'), 17033 onChange: onChange 17034 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 17035 __next40pxDefaultSize: true, 17036 variant: "primary", 17037 type: "submit", 17038 children: (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label') 17039 })] 17040 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 17041 className: "wp-block-embed__learn-more", 17042 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 17043 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/embeds/'), 17044 children: (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds') 17045 }) 17046 }), cannotEmbed && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 17047 spacing: 3, 17048 className: "components-placeholder__error", 17049 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 17050 className: "components-placeholder__instructions", 17051 children: (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.') 17052 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 17053 expanded: false, 17054 spacing: 3, 17055 justify: "flex-start", 17056 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 17057 __next40pxDefaultSize: true, 17058 variant: "secondary", 17059 onClick: tryAgain, 17060 children: (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label') 17061 }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 17062 __next40pxDefaultSize: true, 17063 variant: "secondary", 17064 onClick: fallback, 17065 children: (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label') 17066 })] 17067 })] 17068 })] 17069 }); 17070 }; 17071 /* harmony default export */ const embed_placeholder = (EmbedPlaceholder); 17072 17073 ;// ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js 17074 /* wp:polyfill */ 17075 /** 17076 * WordPress dependencies 17077 */ 17078 17079 17080 17081 /** @typedef {import('react').SyntheticEvent} SyntheticEvent */ 17082 17083 const attributeMap = { 17084 class: 'className', 17085 frameborder: 'frameBorder', 17086 marginheight: 'marginHeight', 17087 marginwidth: 'marginWidth' 17088 }; 17089 function WpEmbedPreview({ 17090 html 17091 }) { 17092 const ref = (0,external_wp_element_namespaceObject.useRef)(); 17093 const props = (0,external_wp_element_namespaceObject.useMemo)(() => { 17094 const doc = new window.DOMParser().parseFromString(html, 'text/html'); 17095 const iframe = doc.querySelector('iframe'); 17096 const iframeProps = {}; 17097 if (!iframe) { 17098 return iframeProps; 17099 } 17100 Array.from(iframe.attributes).forEach(({ 17101 name, 17102 value 17103 }) => { 17104 if (name === 'style') { 17105 return; 17106 } 17107 iframeProps[attributeMap[name] || name] = value; 17108 }); 17109 return iframeProps; 17110 }, [html]); 17111 (0,external_wp_element_namespaceObject.useEffect)(() => { 17112 const { 17113 ownerDocument 17114 } = ref.current; 17115 const { 17116 defaultView 17117 } = ownerDocument; 17118 17119 /** 17120 * Checks for WordPress embed events signaling the height change when 17121 * iframe content loads or iframe's window is resized. The event is 17122 * sent from WordPress core via the window.postMessage API. 17123 * 17124 * References: 17125 * window.postMessage: 17126 * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage 17127 * WordPress core embed-template on load: 17128 * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143 17129 * WordPress core embed-template on resize: 17130 * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187 17131 * 17132 * @param {MessageEvent} event Message event. 17133 */ 17134 function resizeWPembeds({ 17135 data: { 17136 secret, 17137 message, 17138 value 17139 } = {} 17140 }) { 17141 if (message !== 'height' || secret !== props['data-secret']) { 17142 return; 17143 } 17144 ref.current.height = value; 17145 } 17146 defaultView.addEventListener('message', resizeWPembeds); 17147 return () => { 17148 defaultView.removeEventListener('message', resizeWPembeds); 17149 }; 17150 }, []); 17151 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 17152 className: "wp-block-embed__wrapper", 17153 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { 17154 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), 17155 title: props.title, 17156 ...props 17157 }) 17158 }); 17159 } 17160 17161 ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js 17162 /** 17163 * Internal dependencies 17164 */ 17165 17166 17167 /** 17168 * External dependencies 17169 */ 17170 17171 17172 /** 17173 * WordPress dependencies 17174 */ 17175 17176 17177 17178 17179 17180 17181 /** 17182 * Internal dependencies 17183 */ 17184 17185 17186 function EmbedPreview({ 17187 preview, 17188 previewable, 17189 url, 17190 type, 17191 isSelected, 17192 className, 17193 icon, 17194 label 17195 }) { 17196 const [interactive, setInteractive] = (0,external_wp_element_namespaceObject.useState)(false); 17197 if (!isSelected && interactive) { 17198 // We only want to change this when the block is not selected, because changing it when 17199 // the block becomes selected makes the overlap disappear too early. Hiding the overlay 17200 // happens on mouseup when the overlay is clicked. 17201 setInteractive(false); 17202 } 17203 const hideOverlay = () => { 17204 // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop 17205 // changing, because that happens on mouse down, and the overlay immediately disappears, 17206 // and the mouse event can end up in the preview content. We can't use onClick on 17207 // the overlay to hide it either, because then the editor misses the mouseup event, and 17208 // thinks we're multi-selecting blocks. 17209 setInteractive(true); 17210 }; 17211 const { 17212 scripts 17213 } = preview; 17214 const html = 'photo' === type ? getPhotoHtml(preview) : preview.html; 17215 const embedSourceUrl = (0,external_wp_url_namespaceObject.getAuthority)(url); 17216 const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( 17217 // translators: %s: host providing embed content e.g: www.youtube.com 17218 (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), embedSourceUrl); 17219 const sandboxClassnames = dist_clsx(type, className, 'wp-block-embed__wrapper'); 17220 17221 // Disabled because the overlay div doesn't actually have a role or functionality 17222 // as far as the user is concerned. We're just catching the first click so that 17223 // the block can be selected without interacting with the embed preview that the overlay covers. 17224 /* eslint-disable jsx-a11y/no-static-element-interactions */ 17225 const embedWrapper = 'wp-embed' === type ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WpEmbedPreview, { 17226 html: html 17227 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 17228 className: "wp-block-embed__wrapper", 17229 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SandBox, { 17230 html: html, 17231 scripts: scripts, 17232 title: iframeTitle, 17233 type: sandboxClassnames, 17234 onFocus: hideOverlay 17235 }), !interactive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 17236 className: "block-library-embed__interactive-overlay", 17237 onMouseUp: hideOverlay 17238 })] 17239 }); 17240 /* eslint-enable jsx-a11y/no-static-element-interactions */ 17241 17242 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 17243 children: previewable ? embedWrapper : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 17244 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 17245 icon: icon, 17246 showColors: true 17247 }), 17248 label: label, 17249 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 17250 className: "components-placeholder__error", 17251 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 17252 href: url, 17253 children: url 17254 }) 17255 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 17256 className: "components-placeholder__error", 17257 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: host providing embed content e.g: www.youtube.com */ 17258 (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), embedSourceUrl) 17259 })] 17260 }) 17261 }); 17262 } 17263 17264 ;// ./node_modules/@wordpress/block-library/build-module/embed/edit.js 17265 /* wp:polyfill */ 17266 /** 17267 * Internal dependencies 17268 */ 17269 17270 17271 17272 17273 17274 17275 17276 /** 17277 * External dependencies 17278 */ 17279 17280 17281 /** 17282 * WordPress dependencies 17283 */ 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 const EmbedEdit = props => { 17294 const { 17295 attributes: { 17296 providerNameSlug, 17297 previewable, 17298 responsive, 17299 url: attributesUrl 17300 }, 17301 attributes, 17302 isSelected, 17303 onReplace, 17304 setAttributes, 17305 insertBlocksAfter, 17306 onFocus 17307 } = props; 17308 const defaultEmbedInfo = { 17309 title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'), 17310 icon: embedContentIcon 17311 }; 17312 const { 17313 icon, 17314 title 17315 } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; 17316 const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl); 17317 const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); 17318 const { 17319 invalidateResolution 17320 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 17321 const { 17322 preview, 17323 fetching, 17324 themeSupportsResponsive, 17325 cannotEmbed, 17326 hasResolved 17327 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 17328 const { 17329 getEmbedPreview, 17330 isPreviewEmbedFallback, 17331 isRequestingEmbedPreview, 17332 getThemeSupports, 17333 hasFinishedResolution 17334 } = select(external_wp_coreData_namespaceObject.store); 17335 if (!attributesUrl) { 17336 return { 17337 fetching: false, 17338 cannotEmbed: false 17339 }; 17340 } 17341 const embedPreview = getEmbedPreview(attributesUrl); 17342 const previewIsFallback = isPreviewEmbedFallback(attributesUrl); 17343 17344 // The external oEmbed provider does not exist. We got no type info and no html. 17345 const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === undefined; 17346 // Some WordPress URLs that can't be embedded will cause the API to return 17347 // a valid JSON response with no HTML and `data.status` set to 404, rather 17348 // than generating a fallback response as other embeds do. 17349 const wordpressCantEmbed = embedPreview?.data?.status === 404; 17350 const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; 17351 return { 17352 preview: validPreview ? embedPreview : undefined, 17353 fetching: isRequestingEmbedPreview(attributesUrl), 17354 themeSupportsResponsive: getThemeSupports()['responsive-embeds'], 17355 cannotEmbed: !validPreview || previewIsFallback, 17356 hasResolved: hasFinishedResolution('getEmbedPreview', [attributesUrl]) 17357 }; 17358 }, [attributesUrl]); 17359 17360 /** 17361 * Returns the attributes derived from the preview, merged with the current attributes. 17362 * 17363 * @return {Object} Merged attributes. 17364 */ 17365 const getMergedAttributes = () => getMergedAttributesWithPreview(attributes, preview, title, responsive); 17366 const toggleResponsive = () => { 17367 const { 17368 allowResponsive, 17369 className 17370 } = attributes; 17371 const { 17372 html 17373 } = preview; 17374 const newAllowResponsive = !allowResponsive; 17375 setAttributes({ 17376 allowResponsive: newAllowResponsive, 17377 className: getClassNames(html, className, responsive && newAllowResponsive) 17378 }); 17379 }; 17380 (0,external_wp_element_namespaceObject.useEffect)(() => { 17381 if (preview?.html || !cannotEmbed || !hasResolved) { 17382 return; 17383 } 17384 17385 // At this stage, we're not fetching the preview and know it can't be embedded, 17386 // so try removing any trailing slash, and resubmit. 17387 const newURL = attributesUrl.replace(/\/$/, ''); 17388 setURL(newURL); 17389 setIsEditingURL(false); 17390 setAttributes({ 17391 url: newURL 17392 }); 17393 }, [preview?.html, attributesUrl, cannotEmbed, hasResolved, setAttributes]); 17394 17395 // Try a different provider in case the embed url is not supported. 17396 (0,external_wp_element_namespaceObject.useEffect)(() => { 17397 if (!cannotEmbed || fetching || !url) { 17398 return; 17399 } 17400 17401 // Until X provider is supported in WordPress, as a workaround we use Twitter provider. 17402 if ((0,external_wp_url_namespaceObject.getAuthority)(url) === 'x.com') { 17403 const newURL = new URL(url); 17404 newURL.host = 'twitter.com'; 17405 setAttributes({ 17406 url: newURL.toString() 17407 }); 17408 } 17409 }, [url, cannotEmbed, fetching, setAttributes]); 17410 17411 // Handle incoming preview. 17412 (0,external_wp_element_namespaceObject.useEffect)(() => { 17413 if (preview && !isEditingURL) { 17414 // When obtaining an incoming preview, 17415 // we set the attributes derived from the preview data. 17416 const mergedAttributes = getMergedAttributes(); 17417 setAttributes(mergedAttributes); 17418 if (onReplace) { 17419 const upgradedBlock = createUpgradedEmbedBlock(props, mergedAttributes); 17420 if (upgradedBlock) { 17421 onReplace(upgradedBlock); 17422 } 17423 } 17424 } 17425 }, [preview, isEditingURL]); 17426 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 17427 if (fetching) { 17428 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { 17429 ...blockProps, 17430 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_loading, {}) 17431 }); 17432 } 17433 17434 // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists 17435 const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); 17436 17437 // No preview, or we can't embed the current URL, or we've clicked the edit button. 17438 const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; 17439 if (showEmbedPlaceholder) { 17440 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { 17441 ...blockProps, 17442 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_placeholder, { 17443 icon: icon, 17444 label: label, 17445 onFocus: onFocus, 17446 onSubmit: event => { 17447 if (event) { 17448 event.preventDefault(); 17449 } 17450 17451 // If the embed URL was changed, we need to reset the aspect ratio class. 17452 // To do this we have to remove the existing ratio class so it can be recalculated. 17453 const blockClass = removeAspectRatioClasses(attributes.className); 17454 setIsEditingURL(false); 17455 setAttributes({ 17456 url, 17457 className: blockClass 17458 }); 17459 }, 17460 value: url, 17461 cannotEmbed: cannotEmbed, 17462 onChange: value => setURL(value), 17463 fallback: () => fallback(url, onReplace), 17464 tryAgain: () => { 17465 invalidateResolution('getEmbedPreview', [url]); 17466 } 17467 }) 17468 }); 17469 } 17470 17471 // Even though we set attributes that get derived from the preview, 17472 // we don't access them directly because for the initial render, 17473 // the `setAttributes` call will not have taken effect. If we're 17474 // rendering responsive content, setting the responsive classes 17475 // after the preview has been rendered can result in unwanted 17476 // clipping or scrollbars. The `getAttributesFromPreview` function 17477 // that `getMergedAttributes` uses is memoized so that we're not 17478 // calculating them on every render. 17479 const { 17480 caption, 17481 type, 17482 allowResponsive, 17483 className: classFromPreview 17484 } = getMergedAttributes(); 17485 const className = dist_clsx(classFromPreview, props.className); 17486 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 17487 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_controls, { 17488 showEditButton: preview && !cannotEmbed, 17489 themeSupportsResponsive: themeSupportsResponsive, 17490 blockSupportsResponsive: responsive, 17491 allowResponsive: allowResponsive, 17492 toggleResponsive: toggleResponsive, 17493 switchBackToURLInput: () => setIsEditingURL(true) 17494 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 17495 ...blockProps, 17496 className: dist_clsx(blockProps.className, className, { 17497 [`is-type-$type}`]: type, 17498 [`is-provider-$providerNameSlug}`]: providerNameSlug, 17499 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 17500 }), 17501 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EmbedPreview, { 17502 preview: preview, 17503 previewable: previewable, 17504 className: className, 17505 url: url, 17506 type: type, 17507 caption: caption, 17508 onCaptionChange: value => setAttributes({ 17509 caption: value 17510 }), 17511 isSelected: isSelected, 17512 icon: icon, 17513 label: label, 17514 insertBlocksAfter: insertBlocksAfter, 17515 attributes: attributes, 17516 setAttributes: setAttributes 17517 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 17518 attributes: attributes, 17519 setAttributes: setAttributes, 17520 isSelected: isSelected, 17521 insertBlocksAfter: insertBlocksAfter, 17522 label: (0,external_wp_i18n_namespaceObject.__)('Embed caption text'), 17523 showToolbarButton: isSelected 17524 })] 17525 })] 17526 }); 17527 }; 17528 /* harmony default export */ const embed_edit = (EmbedEdit); 17529 17530 ;// ./node_modules/@wordpress/block-library/build-module/embed/save.js 17531 /** 17532 * External dependencies 17533 */ 17534 17535 17536 /** 17537 * WordPress dependencies 17538 */ 17539 17540 17541 function embed_save_save({ 17542 attributes 17543 }) { 17544 const { 17545 url, 17546 caption, 17547 type, 17548 providerNameSlug 17549 } = attributes; 17550 if (!url) { 17551 return null; 17552 } 17553 const className = dist_clsx('wp-block-embed', { 17554 [`is-type-$type}`]: type, 17555 [`is-provider-$providerNameSlug}`]: providerNameSlug, 17556 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 17557 }); 17558 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 17559 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 17560 className 17561 }), 17562 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 17563 className: "wp-block-embed__wrapper", 17564 children: `\n$url}\n` /* URL needs to be on its own line. */ 17565 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 17566 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 17567 tagName: "figcaption", 17568 value: caption 17569 })] 17570 }); 17571 } 17572 17573 ;// ./node_modules/@wordpress/block-library/build-module/embed/transforms.js 17574 /** 17575 * WordPress dependencies 17576 */ 17577 17578 17579 /** 17580 * Internal dependencies 17581 */ 17582 const transforms_metadata = { 17583 $schema: "https://schemas.wp.org/trunk/block.json", 17584 apiVersion: 3, 17585 name: "core/embed", 17586 title: "Embed", 17587 category: "embed", 17588 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 17589 textdomain: "default", 17590 attributes: { 17591 url: { 17592 type: "string", 17593 role: "content" 17594 }, 17595 caption: { 17596 type: "rich-text", 17597 source: "rich-text", 17598 selector: "figcaption", 17599 role: "content" 17600 }, 17601 type: { 17602 type: "string", 17603 role: "content" 17604 }, 17605 providerNameSlug: { 17606 type: "string", 17607 role: "content" 17608 }, 17609 allowResponsive: { 17610 type: "boolean", 17611 "default": true 17612 }, 17613 responsive: { 17614 type: "boolean", 17615 "default": false, 17616 role: "content" 17617 }, 17618 previewable: { 17619 type: "boolean", 17620 "default": true, 17621 role: "content" 17622 } 17623 }, 17624 supports: { 17625 align: true, 17626 spacing: { 17627 margin: true 17628 }, 17629 interactivity: { 17630 clientNavigation: true 17631 } 17632 }, 17633 editorStyle: "wp-block-embed-editor", 17634 style: "wp-block-embed" 17635 }; 17636 17637 const { 17638 name: EMBED_BLOCK 17639 } = transforms_metadata; 17640 17641 /** 17642 * Default transforms for generic embeds. 17643 */ 17644 const embed_transforms_transforms = { 17645 from: [{ 17646 type: 'raw', 17647 isMatch: node => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1, 17648 transform: node => { 17649 return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, { 17650 url: node.textContent.trim() 17651 }); 17652 } 17653 }], 17654 to: [{ 17655 type: 'block', 17656 blocks: ['core/paragraph'], 17657 isMatch: ({ 17658 url 17659 }) => !!url, 17660 transform: ({ 17661 url, 17662 caption, 17663 className 17664 }) => { 17665 let value = `<a href="$url}">$url}</a>`; 17666 if (caption?.trim()) { 17667 value += `<br />$caption}`; 17668 } 17669 return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 17670 content: value, 17671 className: removeAspectRatioClasses(className) 17672 }); 17673 } 17674 }] 17675 }; 17676 /* harmony default export */ const embed_transforms = (embed_transforms_transforms); 17677 17678 ;// ./node_modules/@wordpress/block-library/build-module/embed/variations.js 17679 /* wp:polyfill */ 17680 /** 17681 * WordPress dependencies 17682 */ 17683 17684 17685 /** 17686 * Internal dependencies 17687 */ 17688 17689 17690 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 17691 17692 function getTitle(providerName) { 17693 return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: provider name */ 17694 (0,external_wp_i18n_namespaceObject.__)('%s Embed'), providerName); 17695 } 17696 17697 /** 17698 * The embed provider services. 17699 * 17700 * @type {WPBlockVariation[]} 17701 */ 17702 const embed_variations_variations = [{ 17703 name: 'twitter', 17704 title: getTitle('Twitter'), 17705 icon: embedTwitterIcon, 17706 keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')], 17707 description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'), 17708 patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], 17709 attributes: { 17710 providerNameSlug: 'twitter', 17711 responsive: true 17712 } 17713 }, { 17714 name: 'youtube', 17715 title: getTitle('YouTube'), 17716 icon: embedYouTubeIcon, 17717 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')], 17718 description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'), 17719 patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i], 17720 attributes: { 17721 providerNameSlug: 'youtube', 17722 responsive: true 17723 } 17724 }, { 17725 // Deprecate Facebook Embed per FB policy 17726 // See: https://developers.facebook.com/docs/plugins/oembed-legacy 17727 name: 'facebook', 17728 title: getTitle('Facebook'), 17729 icon: embedFacebookIcon, 17730 keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], 17731 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'), 17732 scope: ['block'], 17733 patterns: [], 17734 attributes: { 17735 providerNameSlug: 'facebook', 17736 previewable: false, 17737 responsive: true 17738 } 17739 }, { 17740 // Deprecate Instagram per FB policy 17741 // See: https://developers.facebook.com/docs/instagram/oembed-legacy 17742 name: 'instagram', 17743 title: getTitle('Instagram'), 17744 icon: embedInstagramIcon, 17745 keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')], 17746 description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'), 17747 scope: ['block'], 17748 patterns: [], 17749 attributes: { 17750 providerNameSlug: 'instagram', 17751 responsive: true 17752 } 17753 }, { 17754 name: 'wordpress', 17755 title: getTitle('WordPress'), 17756 icon: embedWordPressIcon, 17757 keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')], 17758 description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'), 17759 attributes: { 17760 providerNameSlug: 'wordpress' 17761 } 17762 }, { 17763 name: 'soundcloud', 17764 title: getTitle('SoundCloud'), 17765 icon: embedAudioIcon, 17766 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 17767 description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'), 17768 patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], 17769 attributes: { 17770 providerNameSlug: 'soundcloud', 17771 responsive: true 17772 } 17773 }, { 17774 name: 'spotify', 17775 title: getTitle('Spotify'), 17776 icon: embedSpotifyIcon, 17777 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 17778 description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'), 17779 patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], 17780 attributes: { 17781 providerNameSlug: 'spotify', 17782 responsive: true 17783 } 17784 }, { 17785 name: 'flickr', 17786 title: getTitle('Flickr'), 17787 icon: embedFlickrIcon, 17788 keywords: [(0,external_wp_i18n_namespaceObject.__)('image')], 17789 description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'), 17790 patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i], 17791 attributes: { 17792 providerNameSlug: 'flickr', 17793 responsive: true 17794 } 17795 }, { 17796 name: 'vimeo', 17797 title: getTitle('Vimeo'), 17798 icon: embedVimeoIcon, 17799 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 17800 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'), 17801 patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], 17802 attributes: { 17803 providerNameSlug: 'vimeo', 17804 responsive: true 17805 } 17806 }, { 17807 name: 'animoto', 17808 title: getTitle('Animoto'), 17809 icon: embedAnimotoIcon, 17810 description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'), 17811 patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], 17812 attributes: { 17813 providerNameSlug: 'animoto', 17814 responsive: true 17815 } 17816 }, { 17817 name: 'cloudup', 17818 title: getTitle('Cloudup'), 17819 icon: embedContentIcon, 17820 description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'), 17821 patterns: [/^https?:\/\/cloudup\.com\/.+/i], 17822 attributes: { 17823 providerNameSlug: 'cloudup', 17824 responsive: true 17825 } 17826 }, { 17827 // Deprecated since CollegeHumor content is now powered by YouTube. 17828 name: 'collegehumor', 17829 title: getTitle('CollegeHumor'), 17830 icon: embedVideoIcon, 17831 description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'), 17832 scope: ['block'], 17833 patterns: [], 17834 attributes: { 17835 providerNameSlug: 'collegehumor', 17836 responsive: true 17837 } 17838 }, { 17839 name: 'crowdsignal', 17840 title: getTitle('Crowdsignal'), 17841 icon: embedContentIcon, 17842 keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')], 17843 description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'), 17844 patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i], 17845 attributes: { 17846 providerNameSlug: 'crowdsignal', 17847 responsive: true 17848 } 17849 }, { 17850 name: 'dailymotion', 17851 title: getTitle('Dailymotion'), 17852 icon: embedDailymotionIcon, 17853 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 17854 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'), 17855 patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], 17856 attributes: { 17857 providerNameSlug: 'dailymotion', 17858 responsive: true 17859 } 17860 }, { 17861 name: 'imgur', 17862 title: getTitle('Imgur'), 17863 icon: embedPhotoIcon, 17864 description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'), 17865 patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], 17866 attributes: { 17867 providerNameSlug: 'imgur', 17868 responsive: true 17869 } 17870 }, { 17871 name: 'issuu', 17872 title: getTitle('Issuu'), 17873 icon: embedContentIcon, 17874 description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'), 17875 patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], 17876 attributes: { 17877 providerNameSlug: 'issuu', 17878 responsive: true 17879 } 17880 }, { 17881 name: 'kickstarter', 17882 title: getTitle('Kickstarter'), 17883 icon: embedContentIcon, 17884 description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'), 17885 patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i], 17886 attributes: { 17887 providerNameSlug: 'kickstarter', 17888 responsive: true 17889 } 17890 }, { 17891 name: 'mixcloud', 17892 title: getTitle('Mixcloud'), 17893 icon: embedAudioIcon, 17894 keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], 17895 description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'), 17896 patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], 17897 attributes: { 17898 providerNameSlug: 'mixcloud', 17899 responsive: true 17900 } 17901 }, { 17902 name: 'pocket-casts', 17903 title: getTitle('Pocket Casts'), 17904 icon: embedPocketCastsIcon, 17905 keywords: [(0,external_wp_i18n_namespaceObject.__)('podcast'), (0,external_wp_i18n_namespaceObject.__)('audio')], 17906 description: (0,external_wp_i18n_namespaceObject.__)('Embed a podcast player from Pocket Casts.'), 17907 patterns: [/^https:\/\/pca.st\/\w+/i], 17908 attributes: { 17909 providerNameSlug: 'pocket-casts', 17910 responsive: true 17911 } 17912 }, { 17913 name: 'reddit', 17914 title: getTitle('Reddit'), 17915 icon: embedRedditIcon, 17916 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'), 17917 patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], 17918 attributes: { 17919 providerNameSlug: 'reddit', 17920 responsive: true 17921 } 17922 }, { 17923 name: 'reverbnation', 17924 title: getTitle('ReverbNation'), 17925 icon: embedAudioIcon, 17926 description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'), 17927 patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], 17928 attributes: { 17929 providerNameSlug: 'reverbnation', 17930 responsive: true 17931 } 17932 }, { 17933 name: 'screencast', 17934 title: getTitle('Screencast'), 17935 icon: embedVideoIcon, 17936 description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'), 17937 patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i], 17938 attributes: { 17939 providerNameSlug: 'screencast', 17940 responsive: true 17941 } 17942 }, { 17943 name: 'scribd', 17944 title: getTitle('Scribd'), 17945 icon: embedContentIcon, 17946 description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'), 17947 patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], 17948 attributes: { 17949 providerNameSlug: 'scribd', 17950 responsive: true 17951 } 17952 }, { 17953 name: 'smugmug', 17954 title: getTitle('SmugMug'), 17955 icon: embedPhotoIcon, 17956 description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'), 17957 patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], 17958 attributes: { 17959 providerNameSlug: 'smugmug', 17960 previewable: false, 17961 responsive: true 17962 } 17963 }, { 17964 name: 'speaker-deck', 17965 title: getTitle('Speaker Deck'), 17966 icon: embedContentIcon, 17967 description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'), 17968 patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], 17969 attributes: { 17970 providerNameSlug: 'speaker-deck', 17971 responsive: true 17972 } 17973 }, { 17974 name: 'tiktok', 17975 title: getTitle('TikTok'), 17976 icon: embedVideoIcon, 17977 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 17978 description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'), 17979 patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], 17980 attributes: { 17981 providerNameSlug: 'tiktok', 17982 responsive: true 17983 } 17984 }, { 17985 name: 'ted', 17986 title: getTitle('TED'), 17987 icon: embedVideoIcon, 17988 description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'), 17989 patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], 17990 attributes: { 17991 providerNameSlug: 'ted', 17992 responsive: true 17993 } 17994 }, { 17995 name: 'tumblr', 17996 title: getTitle('Tumblr'), 17997 icon: embedTumblrIcon, 17998 keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], 17999 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'), 18000 patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], 18001 attributes: { 18002 providerNameSlug: 'tumblr', 18003 responsive: true 18004 } 18005 }, { 18006 name: 'videopress', 18007 title: getTitle('VideoPress'), 18008 icon: embedVideoIcon, 18009 keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], 18010 description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'), 18011 patterns: [/^https?:\/\/videopress\.com\/.+/i], 18012 attributes: { 18013 providerNameSlug: 'videopress', 18014 responsive: true 18015 } 18016 }, { 18017 name: 'wordpress-tv', 18018 title: getTitle('WordPress.tv'), 18019 icon: embedVideoIcon, 18020 description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'), 18021 patterns: [/^https?:\/\/wordpress\.tv\/.+/i], 18022 attributes: { 18023 providerNameSlug: 'wordpress-tv', 18024 responsive: true 18025 } 18026 }, { 18027 name: 'amazon-kindle', 18028 title: getTitle('Amazon Kindle'), 18029 icon: embedAmazonIcon, 18030 keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')], 18031 description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'), 18032 patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i], 18033 attributes: { 18034 providerNameSlug: 'amazon-kindle' 18035 } 18036 }, { 18037 name: 'pinterest', 18038 title: getTitle('Pinterest'), 18039 icon: embedPinterestIcon, 18040 keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')], 18041 description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'), 18042 patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i], 18043 attributes: { 18044 providerNameSlug: 'pinterest' 18045 } 18046 }, { 18047 name: 'wolfram-cloud', 18048 title: getTitle('Wolfram'), 18049 icon: embedWolframIcon, 18050 description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'), 18051 patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], 18052 attributes: { 18053 providerNameSlug: 'wolfram-cloud', 18054 responsive: true 18055 } 18056 }, { 18057 name: 'bluesky', 18058 title: getTitle('Bluesky'), 18059 icon: embedBlueskyIcon, 18060 description: (0,external_wp_i18n_namespaceObject.__)('Embed a Bluesky post.'), 18061 patterns: [/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i], 18062 attributes: { 18063 providerNameSlug: 'bluesky' 18064 } 18065 }]; 18066 18067 /** 18068 * Add `isActive` function to all `embed` variations, if not defined. 18069 * `isActive` function is used to find a variation match from a created 18070 * Block by providing its attributes. 18071 */ 18072 embed_variations_variations.forEach(variation => { 18073 if (variation.isActive) { 18074 return; 18075 } 18076 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug; 18077 }); 18078 /* harmony default export */ const embed_variations = (embed_variations_variations); 18079 18080 ;// ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js 18081 /** 18082 * External dependencies 18083 */ 18084 18085 18086 /** 18087 * Internal dependencies 18088 */ 18089 const embed_deprecated_metadata = { 18090 $schema: "https://schemas.wp.org/trunk/block.json", 18091 apiVersion: 3, 18092 name: "core/embed", 18093 title: "Embed", 18094 category: "embed", 18095 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 18096 textdomain: "default", 18097 attributes: { 18098 url: { 18099 type: "string", 18100 role: "content" 18101 }, 18102 caption: { 18103 type: "rich-text", 18104 source: "rich-text", 18105 selector: "figcaption", 18106 role: "content" 18107 }, 18108 type: { 18109 type: "string", 18110 role: "content" 18111 }, 18112 providerNameSlug: { 18113 type: "string", 18114 role: "content" 18115 }, 18116 allowResponsive: { 18117 type: "boolean", 18118 "default": true 18119 }, 18120 responsive: { 18121 type: "boolean", 18122 "default": false, 18123 role: "content" 18124 }, 18125 previewable: { 18126 type: "boolean", 18127 "default": true, 18128 role: "content" 18129 } 18130 }, 18131 supports: { 18132 align: true, 18133 spacing: { 18134 margin: true 18135 }, 18136 interactivity: { 18137 clientNavigation: true 18138 } 18139 }, 18140 editorStyle: "wp-block-embed-editor", 18141 style: "wp-block-embed" 18142 }; 18143 /** 18144 * WordPress dependencies 18145 */ 18146 18147 18148 const { 18149 attributes: embed_deprecated_blockAttributes 18150 } = embed_deprecated_metadata; 18151 18152 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 18153 // to the embed figcaption element. 18154 const deprecated_v2 = { 18155 attributes: embed_deprecated_blockAttributes, 18156 save({ 18157 attributes 18158 }) { 18159 const { 18160 url, 18161 caption, 18162 type, 18163 providerNameSlug 18164 } = attributes; 18165 if (!url) { 18166 return null; 18167 } 18168 const className = dist_clsx('wp-block-embed', { 18169 [`is-type-$type}`]: type, 18170 [`is-provider-$providerNameSlug}`]: providerNameSlug, 18171 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 18172 }); 18173 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 18174 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 18175 className 18176 }), 18177 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 18178 className: "wp-block-embed__wrapper", 18179 children: `\n$url}\n` /* URL needs to be on its own line. */ 18180 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18181 tagName: "figcaption", 18182 value: caption 18183 })] 18184 }); 18185 } 18186 }; 18187 const embed_deprecated_v1 = { 18188 attributes: embed_deprecated_blockAttributes, 18189 save({ 18190 attributes: { 18191 url, 18192 caption, 18193 type, 18194 providerNameSlug 18195 } 18196 }) { 18197 if (!url) { 18198 return null; 18199 } 18200 const embedClassName = dist_clsx('wp-block-embed', { 18201 [`is-type-$type}`]: type, 18202 [`is-provider-$providerNameSlug}`]: providerNameSlug 18203 }); 18204 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 18205 className: embedClassName, 18206 children: [`\n$url}\n` /* URL needs to be on its own line. */, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18207 tagName: "figcaption", 18208 value: caption 18209 })] 18210 }); 18211 } 18212 }; 18213 const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1]; 18214 /* harmony default export */ const embed_deprecated = (embed_deprecated_deprecated); 18215 18216 ;// ./node_modules/@wordpress/block-library/build-module/embed/index.js 18217 /** 18218 * Internal dependencies 18219 */ 18220 18221 18222 18223 const embed_metadata = { 18224 $schema: "https://schemas.wp.org/trunk/block.json", 18225 apiVersion: 3, 18226 name: "core/embed", 18227 title: "Embed", 18228 category: "embed", 18229 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 18230 textdomain: "default", 18231 attributes: { 18232 url: { 18233 type: "string", 18234 role: "content" 18235 }, 18236 caption: { 18237 type: "rich-text", 18238 source: "rich-text", 18239 selector: "figcaption", 18240 role: "content" 18241 }, 18242 type: { 18243 type: "string", 18244 role: "content" 18245 }, 18246 providerNameSlug: { 18247 type: "string", 18248 role: "content" 18249 }, 18250 allowResponsive: { 18251 type: "boolean", 18252 "default": true 18253 }, 18254 responsive: { 18255 type: "boolean", 18256 "default": false, 18257 role: "content" 18258 }, 18259 previewable: { 18260 type: "boolean", 18261 "default": true, 18262 role: "content" 18263 } 18264 }, 18265 supports: { 18266 align: true, 18267 spacing: { 18268 margin: true 18269 }, 18270 interactivity: { 18271 clientNavigation: true 18272 } 18273 }, 18274 editorStyle: "wp-block-embed-editor", 18275 style: "wp-block-embed" 18276 }; 18277 18278 18279 18280 18281 const { 18282 name: embed_name 18283 } = embed_metadata; 18284 18285 const embed_settings = { 18286 icon: embedContentIcon, 18287 edit: embed_edit, 18288 save: embed_save_save, 18289 transforms: embed_transforms, 18290 variations: embed_variations, 18291 deprecated: embed_deprecated 18292 }; 18293 const embed_init = () => initBlock({ 18294 name: embed_name, 18295 metadata: embed_metadata, 18296 settings: embed_settings 18297 }); 18298 18299 ;// ./node_modules/@wordpress/icons/build-module/library/file.js 18300 /** 18301 * WordPress dependencies 18302 */ 18303 18304 18305 const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 18306 viewBox: "0 0 24 24", 18307 xmlns: "http://www.w3.org/2000/svg", 18308 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 18309 fillRule: "evenodd", 18310 clipRule: "evenodd", 18311 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" 18312 }) 18313 }); 18314 /* harmony default export */ const library_file = (file); 18315 18316 ;// ./node_modules/@wordpress/block-library/build-module/file/deprecated.js 18317 /** 18318 * External dependencies 18319 */ 18320 18321 18322 /** 18323 * WordPress dependencies 18324 */ 18325 18326 18327 18328 // Version of the file block without PR#43050 removing the translated aria-label. 18329 18330 const deprecated_v3 = { 18331 attributes: { 18332 id: { 18333 type: 'number' 18334 }, 18335 href: { 18336 type: 'string' 18337 }, 18338 fileId: { 18339 type: 'string', 18340 source: 'attribute', 18341 selector: 'a:not([download])', 18342 attribute: 'id' 18343 }, 18344 fileName: { 18345 type: 'string', 18346 source: 'html', 18347 selector: 'a:not([download])' 18348 }, 18349 textLinkHref: { 18350 type: 'string', 18351 source: 'attribute', 18352 selector: 'a:not([download])', 18353 attribute: 'href' 18354 }, 18355 textLinkTarget: { 18356 type: 'string', 18357 source: 'attribute', 18358 selector: 'a:not([download])', 18359 attribute: 'target' 18360 }, 18361 showDownloadButton: { 18362 type: 'boolean', 18363 default: true 18364 }, 18365 downloadButtonText: { 18366 type: 'string', 18367 source: 'html', 18368 selector: 'a[download]' 18369 }, 18370 displayPreview: { 18371 type: 'boolean' 18372 }, 18373 previewHeight: { 18374 type: 'number', 18375 default: 600 18376 } 18377 }, 18378 supports: { 18379 anchor: true, 18380 align: true 18381 }, 18382 save({ 18383 attributes 18384 }) { 18385 const { 18386 href, 18387 fileId, 18388 fileName, 18389 textLinkHref, 18390 textLinkTarget, 18391 showDownloadButton, 18392 downloadButtonText, 18393 displayPreview, 18394 previewHeight 18395 } = attributes; 18396 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. */ 18397 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 18398 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 18399 18400 // Only output an `aria-describedby` when the element it's referring to is 18401 // actually rendered. 18402 const describedById = hasFilename ? fileId : undefined; 18403 return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 18404 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 18405 children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 18406 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { 18407 className: "wp-block-file__embed", 18408 data: href, 18409 type: "application/pdf", 18410 style: { 18411 width: '100%', 18412 height: `$previewHeight}px` 18413 }, 18414 "aria-label": pdfEmbedLabel 18415 }) 18416 }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18417 id: describedById, 18418 href: textLinkHref, 18419 target: textLinkTarget, 18420 rel: textLinkTarget ? 'noreferrer noopener' : undefined, 18421 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18422 value: fileName 18423 }) 18424 }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18425 href: href, 18426 className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 18427 download: true, 18428 "aria-describedby": describedById, 18429 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18430 value: downloadButtonText 18431 }) 18432 })] 18433 }); 18434 } 18435 }; 18436 18437 // In #41239 the button was made an element button which added a `wp-element-button` classname 18438 // to the download link element. 18439 const file_deprecated_v2 = { 18440 attributes: { 18441 id: { 18442 type: 'number' 18443 }, 18444 href: { 18445 type: 'string' 18446 }, 18447 fileId: { 18448 type: 'string', 18449 source: 'attribute', 18450 selector: 'a:not([download])', 18451 attribute: 'id' 18452 }, 18453 fileName: { 18454 type: 'string', 18455 source: 'html', 18456 selector: 'a:not([download])' 18457 }, 18458 textLinkHref: { 18459 type: 'string', 18460 source: 'attribute', 18461 selector: 'a:not([download])', 18462 attribute: 'href' 18463 }, 18464 textLinkTarget: { 18465 type: 'string', 18466 source: 'attribute', 18467 selector: 'a:not([download])', 18468 attribute: 'target' 18469 }, 18470 showDownloadButton: { 18471 type: 'boolean', 18472 default: true 18473 }, 18474 downloadButtonText: { 18475 type: 'string', 18476 source: 'html', 18477 selector: 'a[download]' 18478 }, 18479 displayPreview: { 18480 type: 'boolean' 18481 }, 18482 previewHeight: { 18483 type: 'number', 18484 default: 600 18485 } 18486 }, 18487 supports: { 18488 anchor: true, 18489 align: true 18490 }, 18491 save({ 18492 attributes 18493 }) { 18494 const { 18495 href, 18496 fileId, 18497 fileName, 18498 textLinkHref, 18499 textLinkTarget, 18500 showDownloadButton, 18501 downloadButtonText, 18502 displayPreview, 18503 previewHeight 18504 } = attributes; 18505 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. */ 18506 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 18507 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 18508 18509 // Only output an `aria-describedby` when the element it's referring to is 18510 // actually rendered. 18511 const describedById = hasFilename ? fileId : undefined; 18512 return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 18513 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 18514 children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 18515 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { 18516 className: "wp-block-file__embed", 18517 data: href, 18518 type: "application/pdf", 18519 style: { 18520 width: '100%', 18521 height: `$previewHeight}px` 18522 }, 18523 "aria-label": pdfEmbedLabel 18524 }) 18525 }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18526 id: describedById, 18527 href: textLinkHref, 18528 target: textLinkTarget, 18529 rel: textLinkTarget ? 'noreferrer noopener' : undefined, 18530 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18531 value: fileName 18532 }) 18533 }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18534 href: href, 18535 className: "wp-block-file__button", 18536 download: true, 18537 "aria-describedby": describedById, 18538 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18539 value: downloadButtonText 18540 }) 18541 })] 18542 }); 18543 } 18544 }; 18545 18546 // Version of the file block without PR#28062 accessibility fix. 18547 const file_deprecated_v1 = { 18548 attributes: { 18549 id: { 18550 type: 'number' 18551 }, 18552 href: { 18553 type: 'string' 18554 }, 18555 fileName: { 18556 type: 'string', 18557 source: 'html', 18558 selector: 'a:not([download])' 18559 }, 18560 textLinkHref: { 18561 type: 'string', 18562 source: 'attribute', 18563 selector: 'a:not([download])', 18564 attribute: 'href' 18565 }, 18566 textLinkTarget: { 18567 type: 'string', 18568 source: 'attribute', 18569 selector: 'a:not([download])', 18570 attribute: 'target' 18571 }, 18572 showDownloadButton: { 18573 type: 'boolean', 18574 default: true 18575 }, 18576 downloadButtonText: { 18577 type: 'string', 18578 source: 'html', 18579 selector: 'a[download]' 18580 }, 18581 displayPreview: { 18582 type: 'boolean' 18583 }, 18584 previewHeight: { 18585 type: 'number', 18586 default: 600 18587 } 18588 }, 18589 supports: { 18590 anchor: true, 18591 align: true 18592 }, 18593 save({ 18594 attributes 18595 }) { 18596 const { 18597 href, 18598 fileName, 18599 textLinkHref, 18600 textLinkTarget, 18601 showDownloadButton, 18602 downloadButtonText, 18603 displayPreview, 18604 previewHeight 18605 } = attributes; 18606 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. */ 18607 (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); 18608 return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 18609 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 18610 children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 18611 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { 18612 className: "wp-block-file__embed", 18613 data: href, 18614 type: "application/pdf", 18615 style: { 18616 width: '100%', 18617 height: `$previewHeight}px` 18618 }, 18619 "aria-label": pdfEmbedLabel 18620 }) 18621 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18622 href: textLinkHref, 18623 target: textLinkTarget, 18624 rel: textLinkTarget ? 'noreferrer noopener' : undefined, 18625 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18626 value: fileName 18627 }) 18628 }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 18629 href: href, 18630 className: "wp-block-file__button", 18631 download: true, 18632 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 18633 value: downloadButtonText 18634 }) 18635 })] 18636 }); 18637 } 18638 }; 18639 const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1]; 18640 /* harmony default export */ const file_deprecated = (file_deprecated_deprecated); 18641 18642 ;// ./node_modules/@wordpress/block-library/build-module/file/inspector.js 18643 /** 18644 * WordPress dependencies 18645 */ 18646 18647 18648 18649 18650 /** 18651 * Internal dependencies 18652 */ 18653 18654 18655 function FileBlockInspector({ 18656 hrefs, 18657 openInNewWindow, 18658 showDownloadButton, 18659 changeLinkDestinationOption, 18660 changeOpenInNewWindow, 18661 changeShowDownloadButton, 18662 displayPreview, 18663 changeDisplayPreview, 18664 previewHeight, 18665 changePreviewHeight 18666 }) { 18667 const { 18668 href, 18669 textLinkHref, 18670 attachmentPage 18671 } = hrefs; 18672 let linkDestinationOptions = [{ 18673 value: href, 18674 label: (0,external_wp_i18n_namespaceObject.__)('URL') 18675 }]; 18676 if (attachmentPage) { 18677 linkDestinationOptions = [{ 18678 value: href, 18679 label: (0,external_wp_i18n_namespaceObject.__)('Media file') 18680 }, { 18681 value: attachmentPage, 18682 label: (0,external_wp_i18n_namespaceObject.__)('Attachment page') 18683 }]; 18684 } 18685 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 18686 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 18687 children: [href.endsWith('.pdf') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 18688 title: (0,external_wp_i18n_namespaceObject.__)('PDF settings'), 18689 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 18690 __nextHasNoMarginBottom: true, 18691 label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'), 18692 help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, 18693 checked: !!displayPreview, 18694 onChange: changeDisplayPreview 18695 }), displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 18696 __nextHasNoMarginBottom: true, 18697 __next40pxDefaultSize: true, 18698 label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'), 18699 min: MIN_PREVIEW_HEIGHT, 18700 max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight), 18701 value: previewHeight, 18702 onChange: changePreviewHeight 18703 })] 18704 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 18705 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 18706 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 18707 __next40pxDefaultSize: true, 18708 __nextHasNoMarginBottom: true, 18709 label: (0,external_wp_i18n_namespaceObject.__)('Link to'), 18710 value: textLinkHref, 18711 options: linkDestinationOptions, 18712 onChange: changeLinkDestinationOption 18713 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 18714 __nextHasNoMarginBottom: true, 18715 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 18716 checked: openInNewWindow, 18717 onChange: changeOpenInNewWindow 18718 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 18719 __nextHasNoMarginBottom: true, 18720 label: (0,external_wp_i18n_namespaceObject.__)('Show download button'), 18721 checked: showDownloadButton, 18722 onChange: changeShowDownloadButton 18723 })] 18724 })] 18725 }) 18726 }); 18727 } 18728 18729 ;// ./node_modules/@wordpress/block-library/build-module/file/utils/index.js 18730 /** 18731 * Uses a combination of user agent matching and feature detection to determine whether 18732 * the current browser supports rendering PDFs inline. 18733 * 18734 * @return {boolean} Whether or not the browser supports inline PDFs. 18735 */ 18736 const browserSupportsPdfs = () => { 18737 // Most mobile devices include "Mobi" in their UA. 18738 if (window.navigator.userAgent.indexOf('Mobi') > -1) { 18739 return false; 18740 } 18741 18742 // Android tablets are the notable exception. 18743 if (window.navigator.userAgent.indexOf('Android') > -1) { 18744 return false; 18745 } 18746 18747 // iPad pretends to be a Mac. 18748 if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { 18749 return false; 18750 } 18751 18752 // IE only supports PDFs when there's an ActiveX object available for it. 18753 if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { 18754 return false; 18755 } 18756 return true; 18757 }; 18758 18759 /** 18760 * Helper function for creating ActiveX objects, catching any errors that are thrown 18761 * when it's generated. 18762 * 18763 * @param {string} type The name of the ActiveX object to create. 18764 * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. 18765 */ 18766 const createActiveXObject = type => { 18767 let ax; 18768 try { 18769 ax = new window.ActiveXObject(type); 18770 } catch (e) { 18771 ax = undefined; 18772 } 18773 return ax; 18774 }; 18775 18776 ;// ./node_modules/@wordpress/block-library/build-module/file/edit.js 18777 /** 18778 * External dependencies 18779 */ 18780 18781 18782 /** 18783 * WordPress dependencies 18784 */ 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 /** 18797 * Internal dependencies 18798 */ 18799 18800 18801 18802 18803 18804 const MIN_PREVIEW_HEIGHT = 200; 18805 const MAX_PREVIEW_HEIGHT = 2000; 18806 function ClipboardToolbarButton({ 18807 text, 18808 disabled 18809 }) { 18810 const { 18811 createNotice 18812 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 18813 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { 18814 createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { 18815 isDismissible: true, 18816 type: 'snackbar' 18817 }); 18818 }); 18819 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 18820 className: "components-clipboard-toolbar-button", 18821 ref: ref, 18822 disabled: disabled, 18823 children: (0,external_wp_i18n_namespaceObject.__)('Copy URL') 18824 }); 18825 } 18826 function FileEdit({ 18827 attributes, 18828 isSelected, 18829 setAttributes, 18830 clientId 18831 }) { 18832 const { 18833 id, 18834 fileName, 18835 href, 18836 textLinkHref, 18837 textLinkTarget, 18838 showDownloadButton, 18839 downloadButtonText, 18840 displayPreview, 18841 previewHeight 18842 } = attributes; 18843 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); 18844 const { 18845 media 18846 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ 18847 media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id) 18848 }), [id]); 18849 const { 18850 createErrorNotice 18851 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 18852 const { 18853 toggleSelection, 18854 __unstableMarkNextChangeAsNotPersistent 18855 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 18856 useUploadMediaFromBlobURL({ 18857 url: temporaryURL, 18858 onChange: onSelectFile, 18859 onError: onUploadError 18860 }); 18861 18862 // Note: Handle setting a default value for `downloadButtonText` via HTML API 18863 // when it supports replacing text content for HTML tags. 18864 (0,external_wp_element_namespaceObject.useEffect)(() => { 18865 if (external_wp_blockEditor_namespaceObject.RichText.isEmpty(downloadButtonText)) { 18866 __unstableMarkNextChangeAsNotPersistent(); 18867 setAttributes({ 18868 downloadButtonText: (0,external_wp_i18n_namespaceObject._x)('Download', 'button label') 18869 }); 18870 } 18871 // This effect should only run on mount. 18872 }, []); 18873 function onSelectFile(newMedia) { 18874 var _attributes$displayPr, _attributes$previewHe; 18875 if (!newMedia || !newMedia.url) { 18876 // Reset attributes. 18877 setAttributes({ 18878 href: undefined, 18879 fileName: undefined, 18880 textLinkHref: undefined, 18881 id: undefined, 18882 fileId: undefined, 18883 displayPreview: undefined, 18884 previewHeight: undefined 18885 }); 18886 setTemporaryURL(); 18887 return; 18888 } 18889 if ((0,external_wp_blob_namespaceObject.isBlobURL)(newMedia.url)) { 18890 setTemporaryURL(newMedia.url); 18891 return; 18892 } 18893 const isPdf = newMedia.url.endsWith('.pdf'); 18894 const pdfAttributes = { 18895 displayPreview: isPdf ? (_attributes$displayPr = attributes.displayPreview) !== null && _attributes$displayPr !== void 0 ? _attributes$displayPr : true : undefined, 18896 previewHeight: isPdf ? (_attributes$previewHe = attributes.previewHeight) !== null && _attributes$previewHe !== void 0 ? _attributes$previewHe : 600 : undefined 18897 }; 18898 setAttributes({ 18899 href: newMedia.url, 18900 fileName: newMedia.title, 18901 textLinkHref: newMedia.url, 18902 id: newMedia.id, 18903 fileId: `wp-block-file--media-$clientId}`, 18904 blob: undefined, 18905 ...pdfAttributes 18906 }); 18907 setTemporaryURL(); 18908 } 18909 function onUploadError(message) { 18910 setAttributes({ 18911 href: undefined 18912 }); 18913 createErrorNotice(message, { 18914 type: 'snackbar' 18915 }); 18916 } 18917 function changeLinkDestinationOption(newHref) { 18918 // Choose Media File or Attachment Page (when file is in Media Library). 18919 setAttributes({ 18920 textLinkHref: newHref 18921 }); 18922 } 18923 function changeOpenInNewWindow(newValue) { 18924 setAttributes({ 18925 textLinkTarget: newValue ? '_blank' : false 18926 }); 18927 } 18928 function changeShowDownloadButton(newValue) { 18929 setAttributes({ 18930 showDownloadButton: newValue 18931 }); 18932 } 18933 function changeDisplayPreview(newValue) { 18934 setAttributes({ 18935 displayPreview: newValue 18936 }); 18937 } 18938 function handleOnResizeStop(event, direction, elt, delta) { 18939 toggleSelection(true); 18940 const newHeight = parseInt(previewHeight + delta.height, 10); 18941 setAttributes({ 18942 previewHeight: newHeight 18943 }); 18944 } 18945 function changePreviewHeight(newValue) { 18946 const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT); 18947 setAttributes({ 18948 previewHeight: newHeight 18949 }); 18950 } 18951 const attachmentPage = media && media.link; 18952 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 18953 className: dist_clsx(!!temporaryURL && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({ 18954 type: 'loading' 18955 }), { 18956 'is-transient': !!temporaryURL 18957 }) 18958 }); 18959 const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; 18960 if (!href && !temporaryURL) { 18961 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 18962 ...blockProps, 18963 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 18964 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 18965 icon: library_file 18966 }), 18967 labels: { 18968 title: (0,external_wp_i18n_namespaceObject.__)('File'), 18969 instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop a file, upload, or choose from your library.') 18970 }, 18971 onSelect: onSelectFile, 18972 onError: onUploadError, 18973 accept: "*" 18974 }) 18975 }); 18976 } 18977 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 18978 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FileBlockInspector, { 18979 hrefs: { 18980 href: href || temporaryURL, 18981 textLinkHref, 18982 attachmentPage 18983 }, 18984 openInNewWindow: !!textLinkTarget, 18985 showDownloadButton, 18986 changeLinkDestinationOption, 18987 changeOpenInNewWindow, 18988 changeShowDownloadButton, 18989 displayPreview, 18990 changeDisplayPreview, 18991 previewHeight, 18992 changePreviewHeight 18993 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 18994 group: "other", 18995 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 18996 mediaId: id, 18997 mediaURL: href, 18998 accept: "*", 18999 onSelect: onSelectFile, 19000 onError: onUploadError, 19001 onReset: () => onSelectFile(undefined) 19002 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClipboardToolbarButton, { 19003 text: href, 19004 disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href) 19005 })] 19006 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 19007 ...blockProps, 19008 children: [displayPreviewInEditor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, { 19009 size: { 19010 height: previewHeight, 19011 width: '100%' 19012 }, 19013 minHeight: MIN_PREVIEW_HEIGHT, 19014 maxHeight: MAX_PREVIEW_HEIGHT 19015 // The horizontal grid value must be 1 or else the width may snap during a 19016 // resize even though only vertical resizing is enabled. 19017 , 19018 grid: [1, 10], 19019 enable: { 19020 top: false, 19021 right: false, 19022 bottom: true, 19023 left: false, 19024 topRight: false, 19025 bottomRight: false, 19026 bottomLeft: false, 19027 topLeft: false 19028 }, 19029 onResizeStart: () => toggleSelection(false), 19030 onResizeStop: handleOnResizeStop, 19031 showHandle: isSelected, 19032 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { 19033 className: "wp-block-file__preview", 19034 data: href, 19035 type: "application/pdf", 19036 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.') 19037 }), !isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 19038 className: "wp-block-file__preview-overlay" 19039 })] 19040 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 19041 className: "wp-block-file__content-wrapper", 19042 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 19043 identifier: "fileName", 19044 tagName: "a", 19045 value: fileName, 19046 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'), 19047 withoutInteractiveFormatting: true, 19048 onChange: text => setAttributes({ 19049 fileName: removeAnchorTag(text) 19050 }), 19051 href: textLinkHref 19052 }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 19053 className: "wp-block-file__button-richtext-wrapper", 19054 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 19055 identifier: "downloadButtonText", 19056 tagName: "div" // Must be block-level or else cursor disappears. 19057 , 19058 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'), 19059 className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 19060 value: downloadButtonText, 19061 withoutInteractiveFormatting: true, 19062 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'), 19063 onChange: text => setAttributes({ 19064 downloadButtonText: removeAnchorTag(text) 19065 }) 19066 }) 19067 })] 19068 })] 19069 })] 19070 }); 19071 } 19072 /* harmony default export */ const file_edit = (FileEdit); 19073 19074 ;// ./node_modules/@wordpress/block-library/build-module/file/save.js 19075 /** 19076 * External dependencies 19077 */ 19078 19079 19080 /** 19081 * WordPress dependencies 19082 */ 19083 19084 19085 function file_save_save({ 19086 attributes 19087 }) { 19088 const { 19089 href, 19090 fileId, 19091 fileName, 19092 textLinkHref, 19093 textLinkTarget, 19094 showDownloadButton, 19095 downloadButtonText, 19096 displayPreview, 19097 previewHeight 19098 } = attributes; 19099 const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF embed' : 19100 // To do: use toPlainText, but we need ensure it's RichTextData. See 19101 // https://github.com/WordPress/gutenberg/pull/56710. 19102 fileName.toString(); 19103 const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); 19104 19105 // Only output an `aria-describedby` when the element it's referring to is 19106 // actually rendered. 19107 const describedById = hasFilename ? fileId : undefined; 19108 return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 19109 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 19110 children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 19111 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { 19112 className: "wp-block-file__embed", 19113 data: href, 19114 type: "application/pdf", 19115 style: { 19116 width: '100%', 19117 height: `$previewHeight}px` 19118 }, 19119 "aria-label": pdfEmbedLabel 19120 }) 19121 }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 19122 id: describedById, 19123 href: textLinkHref, 19124 target: textLinkTarget, 19125 rel: textLinkTarget ? 'noreferrer noopener' : undefined, 19126 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19127 value: fileName 19128 }) 19129 }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 19130 href: href, 19131 className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), 19132 download: true, 19133 "aria-describedby": describedById, 19134 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19135 value: downloadButtonText 19136 }) 19137 })] 19138 }); 19139 } 19140 19141 ;// ./node_modules/@wordpress/block-library/build-module/file/transforms.js 19142 /* wp:polyfill */ 19143 /** 19144 * WordPress dependencies 19145 */ 19146 19147 19148 19149 19150 19151 const file_transforms_transforms = { 19152 from: [{ 19153 type: 'files', 19154 isMatch(files) { 19155 return files.length > 0; 19156 }, 19157 // We define a lower priority (higher number) than the default of 10. This 19158 // ensures that the File block is only created as a fallback. 19159 priority: 15, 19160 transform: files => { 19161 const blocks = []; 19162 files.forEach(file => { 19163 const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); 19164 19165 // File will be uploaded in componentDidMount() 19166 if (file.type.startsWith('video/')) { 19167 blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 19168 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 19169 })); 19170 } else if (file.type.startsWith('image/')) { 19171 blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 19172 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 19173 })); 19174 } else if (file.type.startsWith('audio/')) { 19175 blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { 19176 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 19177 })); 19178 } else { 19179 blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 19180 blob: blobURL, 19181 fileName: file.name 19182 })); 19183 } 19184 }); 19185 return blocks; 19186 } 19187 }, { 19188 type: 'block', 19189 blocks: ['core/audio'], 19190 transform: attributes => { 19191 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 19192 href: attributes.src, 19193 fileName: attributes.caption, 19194 textLinkHref: attributes.src, 19195 id: attributes.id, 19196 anchor: attributes.anchor 19197 }); 19198 } 19199 }, { 19200 type: 'block', 19201 blocks: ['core/video'], 19202 transform: attributes => { 19203 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 19204 href: attributes.src, 19205 fileName: attributes.caption, 19206 textLinkHref: attributes.src, 19207 id: attributes.id, 19208 anchor: attributes.anchor 19209 }); 19210 } 19211 }, { 19212 type: 'block', 19213 blocks: ['core/image'], 19214 transform: attributes => { 19215 return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { 19216 href: attributes.url, 19217 fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url), 19218 textLinkHref: attributes.url, 19219 id: attributes.id, 19220 anchor: attributes.anchor 19221 }); 19222 } 19223 }], 19224 to: [{ 19225 type: 'block', 19226 blocks: ['core/audio'], 19227 isMatch: ({ 19228 id 19229 }) => { 19230 if (!id) { 19231 return false; 19232 } 19233 const { 19234 getMedia 19235 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 19236 const media = getMedia(id); 19237 return !!media && media.mime_type.includes('audio'); 19238 }, 19239 transform: attributes => { 19240 return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { 19241 src: attributes.href, 19242 caption: attributes.fileName, 19243 id: attributes.id, 19244 anchor: attributes.anchor 19245 }); 19246 } 19247 }, { 19248 type: 'block', 19249 blocks: ['core/video'], 19250 isMatch: ({ 19251 id 19252 }) => { 19253 if (!id) { 19254 return false; 19255 } 19256 const { 19257 getMedia 19258 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 19259 const media = getMedia(id); 19260 return !!media && media.mime_type.includes('video'); 19261 }, 19262 transform: attributes => { 19263 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 19264 src: attributes.href, 19265 caption: attributes.fileName, 19266 id: attributes.id, 19267 anchor: attributes.anchor 19268 }); 19269 } 19270 }, { 19271 type: 'block', 19272 blocks: ['core/image'], 19273 isMatch: ({ 19274 id 19275 }) => { 19276 if (!id) { 19277 return false; 19278 } 19279 const { 19280 getMedia 19281 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 19282 const media = getMedia(id); 19283 return !!media && media.mime_type.includes('image'); 19284 }, 19285 transform: attributes => { 19286 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 19287 url: attributes.href, 19288 caption: attributes.fileName, 19289 id: attributes.id, 19290 anchor: attributes.anchor 19291 }); 19292 } 19293 }] 19294 }; 19295 /* harmony default export */ const file_transforms = (file_transforms_transforms); 19296 19297 ;// ./node_modules/@wordpress/block-library/build-module/file/index.js 19298 /** 19299 * WordPress dependencies 19300 */ 19301 19302 19303 19304 /** 19305 * Internal dependencies 19306 */ 19307 19308 19309 19310 const file_metadata = { 19311 $schema: "https://schemas.wp.org/trunk/block.json", 19312 apiVersion: 3, 19313 name: "core/file", 19314 title: "File", 19315 category: "media", 19316 description: "Add a link to a downloadable file.", 19317 keywords: ["document", "pdf", "download"], 19318 textdomain: "default", 19319 attributes: { 19320 id: { 19321 type: "number" 19322 }, 19323 blob: { 19324 type: "string", 19325 role: "local" 19326 }, 19327 href: { 19328 type: "string", 19329 role: "content" 19330 }, 19331 fileId: { 19332 type: "string", 19333 source: "attribute", 19334 selector: "a:not([download])", 19335 attribute: "id" 19336 }, 19337 fileName: { 19338 type: "rich-text", 19339 source: "rich-text", 19340 selector: "a:not([download])", 19341 role: "content" 19342 }, 19343 textLinkHref: { 19344 type: "string", 19345 source: "attribute", 19346 selector: "a:not([download])", 19347 attribute: "href", 19348 role: "content" 19349 }, 19350 textLinkTarget: { 19351 type: "string", 19352 source: "attribute", 19353 selector: "a:not([download])", 19354 attribute: "target" 19355 }, 19356 showDownloadButton: { 19357 type: "boolean", 19358 "default": true 19359 }, 19360 downloadButtonText: { 19361 type: "rich-text", 19362 source: "rich-text", 19363 selector: "a[download]", 19364 role: "content" 19365 }, 19366 displayPreview: { 19367 type: "boolean" 19368 }, 19369 previewHeight: { 19370 type: "number", 19371 "default": 600 19372 } 19373 }, 19374 supports: { 19375 anchor: true, 19376 align: true, 19377 spacing: { 19378 margin: true, 19379 padding: true 19380 }, 19381 color: { 19382 gradients: true, 19383 link: true, 19384 text: false, 19385 __experimentalDefaultControls: { 19386 background: true, 19387 link: true 19388 } 19389 }, 19390 __experimentalBorder: { 19391 radius: true, 19392 color: true, 19393 width: true, 19394 style: true, 19395 __experimentalDefaultControls: { 19396 radius: true, 19397 color: true, 19398 width: true, 19399 style: true 19400 } 19401 }, 19402 interactivity: true 19403 }, 19404 editorStyle: "wp-block-file-editor", 19405 style: "wp-block-file" 19406 }; 19407 19408 19409 const { 19410 name: file_name 19411 } = file_metadata; 19412 19413 const file_settings = { 19414 icon: library_file, 19415 example: { 19416 attributes: { 19417 href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg', 19418 fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file') 19419 } 19420 }, 19421 transforms: file_transforms, 19422 deprecated: file_deprecated, 19423 edit: file_edit, 19424 save: file_save_save 19425 }; 19426 const file_init = () => initBlock({ 19427 name: file_name, 19428 metadata: file_metadata, 19429 settings: file_settings 19430 }); 19431 19432 ;// ./node_modules/@wordpress/block-library/build-module/form/utils.js 19433 /** 19434 * WordPress dependencies 19435 */ 19436 19437 const formSubmissionNotificationSuccess = ['core/form-submission-notification', { 19438 type: 'success' 19439 }, [['core/paragraph', { 19440 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>' 19441 }]]]; 19442 const formSubmissionNotificationError = ['core/form-submission-notification', { 19443 type: 'error' 19444 }, [['core/paragraph', { 19445 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>' 19446 }]]]; 19447 19448 ;// ./node_modules/@wordpress/block-library/build-module/form/edit.js 19449 /** 19450 * WordPress dependencies 19451 */ 19452 19453 19454 19455 19456 19457 /** 19458 * Internal dependencies 19459 */ 19460 19461 19462 const form_edit_TEMPLATE = [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/form-input', { 19463 type: 'text', 19464 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 19465 required: true 19466 }], ['core/form-input', { 19467 type: 'email', 19468 label: (0,external_wp_i18n_namespaceObject.__)('Email'), 19469 required: true 19470 }], ['core/form-input', { 19471 type: 'textarea', 19472 label: (0,external_wp_i18n_namespaceObject.__)('Comment'), 19473 required: true 19474 }], ['core/form-submit-button', {}]]; 19475 const form_edit_Edit = ({ 19476 attributes, 19477 setAttributes, 19478 clientId 19479 }) => { 19480 const { 19481 action, 19482 method, 19483 email, 19484 submissionMethod 19485 } = attributes; 19486 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 19487 const { 19488 hasInnerBlocks 19489 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 19490 const { 19491 getBlock 19492 } = select(external_wp_blockEditor_namespaceObject.store); 19493 const block = getBlock(clientId); 19494 return { 19495 hasInnerBlocks: !!(block && block.innerBlocks.length) 19496 }; 19497 }, [clientId]); 19498 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 19499 template: form_edit_TEMPLATE, 19500 renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 19501 }); 19502 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 19503 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 19504 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 19505 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 19506 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 19507 __nextHasNoMarginBottom: true, 19508 __next40pxDefaultSize: true, 19509 label: (0,external_wp_i18n_namespaceObject.__)('Submissions method'), 19510 options: [ 19511 // TODO: Allow plugins to add their own submission methods. 19512 { 19513 label: (0,external_wp_i18n_namespaceObject.__)('Send email'), 19514 value: 'email' 19515 }, { 19516 label: (0,external_wp_i18n_namespaceObject.__)('- Custom -'), 19517 value: 'custom' 19518 }], 19519 value: submissionMethod, 19520 onChange: value => setAttributes({ 19521 submissionMethod: value 19522 }), 19523 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.') 19524 }), submissionMethod === 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 19525 __nextHasNoMarginBottom: true, 19526 __next40pxDefaultSize: true, 19527 autoComplete: "off", 19528 label: (0,external_wp_i18n_namespaceObject.__)('Email for form submissions'), 19529 value: email, 19530 required: true, 19531 onChange: value => { 19532 setAttributes({ 19533 email: value 19534 }); 19535 setAttributes({ 19536 action: `mailto:$value}` 19537 }); 19538 setAttributes({ 19539 method: 'post' 19540 }); 19541 }, 19542 help: (0,external_wp_i18n_namespaceObject.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.') 19543 })] 19544 }) 19545 }), submissionMethod !== 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 19546 group: "advanced", 19547 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 19548 __next40pxDefaultSize: true, 19549 __nextHasNoMarginBottom: true, 19550 label: (0,external_wp_i18n_namespaceObject.__)('Method'), 19551 options: [{ 19552 label: 'Get', 19553 value: 'get' 19554 }, { 19555 label: 'Post', 19556 value: 'post' 19557 }], 19558 value: method, 19559 onChange: value => setAttributes({ 19560 method: value 19561 }), 19562 help: (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') 19563 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 19564 __next40pxDefaultSize: true, 19565 __nextHasNoMarginBottom: true, 19566 autoComplete: "off", 19567 label: (0,external_wp_i18n_namespaceObject.__)('Form action'), 19568 value: action, 19569 onChange: newVal => { 19570 setAttributes({ 19571 action: newVal 19572 }); 19573 }, 19574 help: (0,external_wp_i18n_namespaceObject.__)('The URL where the form should be submitted.') 19575 })] 19576 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { 19577 ...innerBlocksProps, 19578 className: "wp-block-form", 19579 encType: submissionMethod === 'email' ? 'text/plain' : null 19580 })] 19581 }); 19582 }; 19583 /* harmony default export */ const form_edit = (form_edit_Edit); 19584 19585 ;// ./node_modules/@wordpress/block-library/build-module/form/save.js 19586 /** 19587 * WordPress dependencies 19588 */ 19589 19590 19591 function form_save_save({ 19592 attributes 19593 }) { 19594 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 19595 const { 19596 submissionMethod 19597 } = attributes; 19598 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { 19599 ...blockProps, 19600 className: "wp-block-form", 19601 encType: submissionMethod === 'email' ? 'text/plain' : null, 19602 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 19603 }); 19604 } 19605 19606 ;// ./node_modules/@wordpress/block-library/build-module/form/variations.js 19607 /** 19608 * WordPress dependencies 19609 */ 19610 19611 /** 19612 * Internal dependencies 19613 */ 19614 19615 const form_variations_variations = [{ 19616 name: 'comment-form', 19617 title: (0,external_wp_i18n_namespaceObject.__)('Experimental Comment form'), 19618 description: (0,external_wp_i18n_namespaceObject.__)('A comment form for posts and pages.'), 19619 attributes: { 19620 submissionMethod: 'custom', 19621 action: '{SITE_URL}/wp-comments-post.php', 19622 method: 'post', 19623 anchor: 'comment-form' 19624 }, 19625 isDefault: false, 19626 innerBlocks: [['core/form-input', { 19627 type: 'text', 19628 name: 'author', 19629 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 19630 required: true, 19631 visibilityPermissions: 'logged-out' 19632 }], ['core/form-input', { 19633 type: 'email', 19634 name: 'email', 19635 label: (0,external_wp_i18n_namespaceObject.__)('Email'), 19636 required: true, 19637 visibilityPermissions: 'logged-out' 19638 }], ['core/form-input', { 19639 type: 'textarea', 19640 name: 'comment', 19641 label: (0,external_wp_i18n_namespaceObject.__)('Comment'), 19642 required: true, 19643 visibilityPermissions: 'all' 19644 }], ['core/form-submit-button', {}]], 19645 scope: ['inserter', 'transform'], 19646 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 19647 }, { 19648 name: 'wp-privacy-form', 19649 title: (0,external_wp_i18n_namespaceObject.__)('Experimental Privacy Request Form'), 19650 keywords: ['GDPR'], 19651 description: (0,external_wp_i18n_namespaceObject.__)('A form to request data exports and/or deletion.'), 19652 attributes: { 19653 submissionMethod: 'custom', 19654 action: '', 19655 method: 'post', 19656 anchor: 'gdpr-form' 19657 }, 19658 isDefault: false, 19659 innerBlocks: [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/paragraph', { 19660 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.') 19661 }], ['core/form-input', { 19662 type: 'email', 19663 name: 'email', 19664 label: (0,external_wp_i18n_namespaceObject.__)('Enter your email address.'), 19665 required: true, 19666 visibilityPermissions: 'all' 19667 }], ['core/form-input', { 19668 type: 'checkbox', 19669 name: 'export_personal_data', 19670 label: (0,external_wp_i18n_namespaceObject.__)('Request data export'), 19671 required: false, 19672 visibilityPermissions: 'all' 19673 }], ['core/form-input', { 19674 type: 'checkbox', 19675 name: 'remove_personal_data', 19676 label: (0,external_wp_i18n_namespaceObject.__)('Request data deletion'), 19677 required: false, 19678 visibilityPermissions: 'all' 19679 }], ['core/form-submit-button', {}], ['core/form-input', { 19680 type: 'hidden', 19681 name: 'wp-action', 19682 value: 'wp_privacy_send_request' 19683 }], ['core/form-input', { 19684 type: 'hidden', 19685 name: 'wp-privacy-request', 19686 value: '1' 19687 }]], 19688 scope: ['inserter', 'transform'], 19689 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 19690 }]; 19691 /* harmony default export */ const form_variations = (form_variations_variations); 19692 19693 ;// ./node_modules/@wordpress/block-library/build-module/form/index.js 19694 /** 19695 * Internal dependencies 19696 */ 19697 19698 19699 const form_metadata = { 19700 $schema: "https://schemas.wp.org/trunk/block.json", 19701 apiVersion: 3, 19702 __experimental: true, 19703 name: "core/form", 19704 title: "Form", 19705 category: "common", 19706 allowedBlocks: ["core/paragraph", "core/heading", "core/form-input", "core/form-submit-button", "core/form-submission-notification", "core/group", "core/columns"], 19707 description: "A form.", 19708 keywords: ["container", "wrapper", "row", "section"], 19709 textdomain: "default", 19710 icon: "feedback", 19711 attributes: { 19712 submissionMethod: { 19713 type: "string", 19714 "default": "email" 19715 }, 19716 method: { 19717 type: "string", 19718 "default": "post" 19719 }, 19720 action: { 19721 type: "string" 19722 }, 19723 email: { 19724 type: "string" 19725 } 19726 }, 19727 supports: { 19728 anchor: true, 19729 className: false, 19730 color: { 19731 gradients: true, 19732 link: true, 19733 __experimentalDefaultControls: { 19734 background: true, 19735 text: true, 19736 link: true 19737 } 19738 }, 19739 spacing: { 19740 margin: true, 19741 padding: true 19742 }, 19743 typography: { 19744 fontSize: true, 19745 lineHeight: true, 19746 __experimentalFontFamily: true, 19747 __experimentalTextDecoration: true, 19748 __experimentalFontStyle: true, 19749 __experimentalFontWeight: true, 19750 __experimentalLetterSpacing: true, 19751 __experimentalTextTransform: true, 19752 __experimentalDefaultControls: { 19753 fontSize: true 19754 } 19755 }, 19756 __experimentalSelector: "form" 19757 } 19758 }; 19759 19760 19761 19762 /** 19763 * WordPress dependencies 19764 */ 19765 19766 const { 19767 name: form_name 19768 } = form_metadata; 19769 19770 const form_settings = { 19771 edit: form_edit, 19772 save: form_save_save, 19773 variations: form_variations 19774 }; 19775 const form_init = () => { 19776 // Prevent adding forms inside forms. 19777 const DISALLOWED_PARENTS = ['core/form']; 19778 (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/preventInsertingFormIntoAnotherForm', (canInsert, blockType, rootClientId, { 19779 getBlock, 19780 getBlockParentsByBlockName 19781 }) => { 19782 if (blockType.name !== 'core/form') { 19783 return canInsert; 19784 } 19785 for (const disallowedParentType of DISALLOWED_PARENTS) { 19786 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; 19787 if (hasDisallowedParent) { 19788 return false; 19789 } 19790 } 19791 return true; 19792 }); 19793 return initBlock({ 19794 name: form_name, 19795 metadata: form_metadata, 19796 settings: form_settings 19797 }); 19798 }; 19799 19800 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js 19801 var remove_accents = __webpack_require__(9681); 19802 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); 19803 ;// external ["wp","dom"] 19804 const external_wp_dom_namespaceObject = window["wp"]["dom"]; 19805 ;// ./node_modules/@wordpress/block-library/build-module/form-input/deprecated.js 19806 /** 19807 * External dependencies 19808 */ 19809 19810 19811 19812 /** 19813 * WordPress dependencies 19814 */ 19815 19816 19817 19818 const getNameFromLabelV1 = content => { 19819 return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) 19820 // Convert anything that's not a letter or number to a hyphen. 19821 .replace(/[^\p{L}\p{N}]+/gu, '-') 19822 // Convert to lowercase 19823 .toLowerCase() 19824 // Remove any remaining leading or trailing hyphens. 19825 .replace(/(^-+)|(-+$)/g, ''); 19826 }; 19827 const form_input_deprecated_v2 = { 19828 attributes: { 19829 type: { 19830 type: 'string', 19831 default: 'text' 19832 }, 19833 name: { 19834 type: 'string' 19835 }, 19836 label: { 19837 type: 'string', 19838 default: 'Label', 19839 selector: '.wp-block-form-input__label-content', 19840 source: 'html', 19841 role: 'content' 19842 }, 19843 inlineLabel: { 19844 type: 'boolean', 19845 default: false 19846 }, 19847 required: { 19848 type: 'boolean', 19849 default: false, 19850 selector: '.wp-block-form-input__input', 19851 source: 'attribute', 19852 attribute: 'required' 19853 }, 19854 placeholder: { 19855 type: 'string', 19856 selector: '.wp-block-form-input__input', 19857 source: 'attribute', 19858 attribute: 'placeholder', 19859 role: 'content' 19860 }, 19861 value: { 19862 type: 'string', 19863 default: '', 19864 selector: 'input', 19865 source: 'attribute', 19866 attribute: 'value' 19867 }, 19868 visibilityPermissions: { 19869 type: 'string', 19870 default: 'all' 19871 } 19872 }, 19873 supports: { 19874 anchor: true, 19875 reusable: false, 19876 spacing: { 19877 margin: ['top', 'bottom'] 19878 }, 19879 __experimentalBorder: { 19880 radius: true, 19881 __experimentalSkipSerialization: true, 19882 __experimentalDefaultControls: { 19883 radius: true 19884 } 19885 } 19886 }, 19887 save({ 19888 attributes 19889 }) { 19890 const { 19891 type, 19892 name, 19893 label, 19894 inlineLabel, 19895 required, 19896 placeholder, 19897 value 19898 } = attributes; 19899 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 19900 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 19901 const inputStyle = { 19902 ...borderProps.style, 19903 ...colorProps.style 19904 }; 19905 const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); 19906 const TagName = type === 'textarea' ? 'textarea' : 'input'; 19907 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 19908 if ('hidden' === type) { 19909 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 19910 type: type, 19911 name: name, 19912 value: value 19913 }); 19914 } 19915 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 19916 ...blockProps, 19917 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { 19918 className: dist_clsx('wp-block-form-input__label', { 19919 'is-label-inline': inlineLabel 19920 }), 19921 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 19922 className: "wp-block-form-input__label-content", 19923 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 19924 value: label 19925 }) 19926 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 19927 className: inputClasses, 19928 type: 'textarea' === type ? undefined : type, 19929 name: name || getNameFromLabelV1(label), 19930 required: required, 19931 "aria-required": required, 19932 placeholder: placeholder || undefined, 19933 style: inputStyle 19934 })] 19935 }) 19936 }); 19937 } 19938 }; 19939 19940 // Version without wrapper div in saved markup 19941 // See: https://github.com/WordPress/gutenberg/pull/56507 19942 const form_input_deprecated_v1 = { 19943 attributes: { 19944 type: { 19945 type: 'string', 19946 default: 'text' 19947 }, 19948 name: { 19949 type: 'string' 19950 }, 19951 label: { 19952 type: 'string', 19953 default: 'Label', 19954 selector: '.wp-block-form-input__label-content', 19955 source: 'html', 19956 role: 'content' 19957 }, 19958 inlineLabel: { 19959 type: 'boolean', 19960 default: false 19961 }, 19962 required: { 19963 type: 'boolean', 19964 default: false, 19965 selector: '.wp-block-form-input__input', 19966 source: 'attribute', 19967 attribute: 'required' 19968 }, 19969 placeholder: { 19970 type: 'string', 19971 selector: '.wp-block-form-input__input', 19972 source: 'attribute', 19973 attribute: 'placeholder', 19974 role: 'content' 19975 }, 19976 value: { 19977 type: 'string', 19978 default: '', 19979 selector: 'input', 19980 source: 'attribute', 19981 attribute: 'value' 19982 }, 19983 visibilityPermissions: { 19984 type: 'string', 19985 default: 'all' 19986 } 19987 }, 19988 supports: { 19989 className: false, 19990 anchor: true, 19991 reusable: false, 19992 spacing: { 19993 margin: ['top', 'bottom'] 19994 }, 19995 __experimentalBorder: { 19996 radius: true, 19997 __experimentalSkipSerialization: true, 19998 __experimentalDefaultControls: { 19999 radius: true 20000 } 20001 } 20002 }, 20003 save({ 20004 attributes 20005 }) { 20006 const { 20007 type, 20008 name, 20009 label, 20010 inlineLabel, 20011 required, 20012 placeholder, 20013 value 20014 } = attributes; 20015 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 20016 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 20017 const inputStyle = { 20018 ...borderProps.style, 20019 ...colorProps.style 20020 }; 20021 const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); 20022 const TagName = type === 'textarea' ? 'textarea' : 'input'; 20023 if ('hidden' === type) { 20024 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 20025 type: type, 20026 name: name, 20027 value: value 20028 }); 20029 } 20030 20031 /* eslint-disable jsx-a11y/label-has-associated-control */ 20032 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { 20033 className: dist_clsx('wp-block-form-input__label', { 20034 'is-label-inline': inlineLabel 20035 }), 20036 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 20037 className: "wp-block-form-input__label-content", 20038 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 20039 value: label 20040 }) 20041 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 20042 className: inputClasses, 20043 type: 'textarea' === type ? undefined : type, 20044 name: name || getNameFromLabelV1(label), 20045 required: required, 20046 "aria-required": required, 20047 placeholder: placeholder || undefined, 20048 style: inputStyle 20049 })] 20050 }); 20051 /* eslint-enable jsx-a11y/label-has-associated-control */ 20052 } 20053 }; 20054 const form_input_deprecated_deprecated = [form_input_deprecated_v2, form_input_deprecated_v1]; 20055 /* harmony default export */ const form_input_deprecated = (form_input_deprecated_deprecated); 20056 20057 ;// ./node_modules/@wordpress/block-library/build-module/form-input/edit.js 20058 /** 20059 * External dependencies 20060 */ 20061 20062 20063 /** 20064 * WordPress dependencies 20065 */ 20066 20067 20068 20069 20070 20071 function InputFieldBlock({ 20072 attributes, 20073 setAttributes, 20074 className 20075 }) { 20076 const { 20077 type, 20078 name, 20079 label, 20080 inlineLabel, 20081 required, 20082 placeholder, 20083 value 20084 } = attributes; 20085 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 20086 const ref = (0,external_wp_element_namespaceObject.useRef)(); 20087 const TagName = type === 'textarea' ? 'textarea' : 'input'; 20088 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 20089 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 20090 if (ref.current) { 20091 ref.current.focus(); 20092 } 20093 20094 // Note: radio inputs aren't implemented yet. 20095 const isCheckboxOrRadio = type === 'checkbox' || type === 'radio'; 20096 const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 20097 children: ['hidden' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 20098 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 20099 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 20100 children: ['checkbox' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { 20101 __nextHasNoMarginBottom: true, 20102 label: (0,external_wp_i18n_namespaceObject.__)('Inline label'), 20103 checked: inlineLabel, 20104 onChange: newVal => { 20105 setAttributes({ 20106 inlineLabel: newVal 20107 }); 20108 } 20109 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { 20110 __nextHasNoMarginBottom: true, 20111 label: (0,external_wp_i18n_namespaceObject.__)('Required'), 20112 checked: required, 20113 onChange: newVal => { 20114 setAttributes({ 20115 required: newVal 20116 }); 20117 } 20118 })] 20119 }) 20120 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 20121 group: "advanced", 20122 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 20123 __next40pxDefaultSize: true, 20124 __nextHasNoMarginBottom: true, 20125 autoComplete: "off", 20126 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 20127 value: name, 20128 onChange: newVal => { 20129 setAttributes({ 20130 name: newVal 20131 }); 20132 }, 20133 help: (0,external_wp_i18n_namespaceObject.__)('Affects the "name" attribute of the input element, and is used as a name for the form submission results.') 20134 }) 20135 })] 20136 }); 20137 const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 20138 tagName: "span", 20139 className: "wp-block-form-input__label-content", 20140 value: label, 20141 onChange: newLabel => setAttributes({ 20142 label: newLabel 20143 }), 20144 "aria-label": label ? (0,external_wp_i18n_namespaceObject.__)('Label') : (0,external_wp_i18n_namespaceObject.__)('Empty label'), 20145 "data-empty": !label, 20146 placeholder: (0,external_wp_i18n_namespaceObject.__)('Type the label for this input') 20147 }); 20148 if ('hidden' === type) { 20149 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 20150 children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 20151 type: "hidden", 20152 className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), 20153 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Value'), 20154 value: value, 20155 onChange: event => setAttributes({ 20156 value: event.target.value 20157 }) 20158 })] 20159 }); 20160 } 20161 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 20162 ...blockProps, 20163 children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { 20164 className: dist_clsx('wp-block-form-input__label', { 20165 'is-label-inline': inlineLabel || 'checkbox' === type 20166 }), 20167 children: [!isCheckboxOrRadio && content, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 20168 type: 'textarea' === type ? undefined : type, 20169 className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), 20170 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') 20171 // We hide the placeholder field's placeholder when there is a value. This 20172 // stops screen readers from reading the placeholder field's placeholder 20173 // which is confusing. 20174 , 20175 placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), 20176 value: placeholder, 20177 onChange: event => setAttributes({ 20178 placeholder: event.target.value 20179 }), 20180 "aria-required": required, 20181 style: { 20182 ...borderProps.style, 20183 ...colorProps.style 20184 } 20185 }), isCheckboxOrRadio && content] 20186 })] 20187 }); 20188 } 20189 /* harmony default export */ const form_input_edit = (InputFieldBlock); 20190 20191 ;// ./node_modules/@wordpress/block-library/build-module/form-input/save.js 20192 /** 20193 * External dependencies 20194 */ 20195 20196 20197 20198 /** 20199 * WordPress dependencies 20200 */ 20201 20202 20203 20204 /** 20205 * Get the name attribute from a content string. 20206 * 20207 * @param {string} content The block content. 20208 * 20209 * @return {string} Returns the slug. 20210 */ 20211 20212 const getNameFromLabel = content => { 20213 return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) 20214 // Convert anything that's not a letter or number to a hyphen. 20215 .replace(/[^\p{L}\p{N}]+/gu, '-') 20216 // Convert to lowercase 20217 .toLowerCase() 20218 // Remove any remaining leading or trailing hyphens. 20219 .replace(/(^-+)|(-+$)/g, ''); 20220 }; 20221 function form_input_save_save({ 20222 attributes 20223 }) { 20224 const { 20225 type, 20226 name, 20227 label, 20228 inlineLabel, 20229 required, 20230 placeholder, 20231 value 20232 } = attributes; 20233 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 20234 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 20235 const inputStyle = { 20236 ...borderProps.style, 20237 ...colorProps.style 20238 }; 20239 const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); 20240 const TagName = type === 'textarea' ? 'textarea' : 'input'; 20241 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 20242 20243 // Note: radio inputs aren't implemented yet. 20244 const isCheckboxOrRadio = type === 'checkbox' || type === 'radio'; 20245 if ('hidden' === type) { 20246 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 20247 type: type, 20248 name: name, 20249 value: value 20250 }); 20251 } 20252 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 20253 ...blockProps, 20254 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { 20255 className: dist_clsx('wp-block-form-input__label', { 20256 'is-label-inline': inlineLabel 20257 }), 20258 children: [!isCheckboxOrRadio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 20259 className: "wp-block-form-input__label-content", 20260 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 20261 value: label 20262 }) 20263 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 20264 className: inputClasses, 20265 type: 'textarea' === type ? undefined : type, 20266 name: name || getNameFromLabel(label), 20267 required: required, 20268 "aria-required": required, 20269 placeholder: placeholder || undefined, 20270 style: inputStyle 20271 }), isCheckboxOrRadio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 20272 className: "wp-block-form-input__label-content", 20273 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 20274 value: label 20275 }) 20276 })] 20277 }) 20278 }); 20279 } 20280 20281 ;// ./node_modules/@wordpress/block-library/build-module/form-input/variations.js 20282 /** 20283 * WordPress dependencies 20284 */ 20285 20286 const form_input_variations_variations = [{ 20287 name: 'text', 20288 title: (0,external_wp_i18n_namespaceObject.__)('Text Input'), 20289 icon: 'edit-page', 20290 description: (0,external_wp_i18n_namespaceObject.__)('A generic text input.'), 20291 attributes: { 20292 type: 'text' 20293 }, 20294 isDefault: true, 20295 scope: ['inserter', 'transform'], 20296 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' 20297 }, { 20298 name: 'textarea', 20299 title: (0,external_wp_i18n_namespaceObject.__)('Textarea Input'), 20300 icon: 'testimonial', 20301 description: (0,external_wp_i18n_namespaceObject.__)('A textarea input to allow entering multiple lines of text.'), 20302 attributes: { 20303 type: 'textarea' 20304 }, 20305 isDefault: true, 20306 scope: ['inserter', 'transform'], 20307 isActive: blockAttributes => blockAttributes?.type === 'textarea' 20308 }, { 20309 name: 'checkbox', 20310 title: (0,external_wp_i18n_namespaceObject.__)('Checkbox Input'), 20311 description: (0,external_wp_i18n_namespaceObject.__)('A simple checkbox input.'), 20312 icon: 'forms', 20313 attributes: { 20314 type: 'checkbox', 20315 inlineLabel: true 20316 }, 20317 isDefault: true, 20318 scope: ['inserter', 'transform'], 20319 isActive: blockAttributes => blockAttributes?.type === 'checkbox' 20320 }, { 20321 name: 'email', 20322 title: (0,external_wp_i18n_namespaceObject.__)('Email Input'), 20323 icon: 'email', 20324 description: (0,external_wp_i18n_namespaceObject.__)('Used for email addresses.'), 20325 attributes: { 20326 type: 'email' 20327 }, 20328 isDefault: true, 20329 scope: ['inserter', 'transform'], 20330 isActive: blockAttributes => blockAttributes?.type === 'email' 20331 }, { 20332 name: 'url', 20333 title: (0,external_wp_i18n_namespaceObject.__)('URL Input'), 20334 icon: 'admin-site', 20335 description: (0,external_wp_i18n_namespaceObject.__)('Used for URLs.'), 20336 attributes: { 20337 type: 'url' 20338 }, 20339 isDefault: true, 20340 scope: ['inserter', 'transform'], 20341 isActive: blockAttributes => blockAttributes?.type === 'url' 20342 }, { 20343 name: 'tel', 20344 title: (0,external_wp_i18n_namespaceObject.__)('Telephone Input'), 20345 icon: 'phone', 20346 description: (0,external_wp_i18n_namespaceObject.__)('Used for phone numbers.'), 20347 attributes: { 20348 type: 'tel' 20349 }, 20350 isDefault: true, 20351 scope: ['inserter', 'transform'], 20352 isActive: blockAttributes => blockAttributes?.type === 'tel' 20353 }, { 20354 name: 'number', 20355 title: (0,external_wp_i18n_namespaceObject.__)('Number Input'), 20356 icon: 'edit-page', 20357 description: (0,external_wp_i18n_namespaceObject.__)('A numeric input.'), 20358 attributes: { 20359 type: 'number' 20360 }, 20361 isDefault: true, 20362 scope: ['inserter', 'transform'], 20363 isActive: blockAttributes => blockAttributes?.type === 'number' 20364 }]; 20365 /* harmony default export */ const form_input_variations = (form_input_variations_variations); 20366 20367 ;// ./node_modules/@wordpress/block-library/build-module/form-input/index.js 20368 /** 20369 * Internal dependencies 20370 */ 20371 20372 20373 20374 const form_input_metadata = { 20375 $schema: "https://schemas.wp.org/trunk/block.json", 20376 apiVersion: 3, 20377 __experimental: true, 20378 name: "core/form-input", 20379 title: "Input Field", 20380 category: "common", 20381 ancestor: ["core/form"], 20382 description: "The basic building block for forms.", 20383 keywords: ["input", "form"], 20384 textdomain: "default", 20385 icon: "forms", 20386 attributes: { 20387 type: { 20388 type: "string", 20389 "default": "text" 20390 }, 20391 name: { 20392 type: "string" 20393 }, 20394 label: { 20395 type: "rich-text", 20396 "default": "Label", 20397 selector: ".wp-block-form-input__label-content", 20398 source: "rich-text", 20399 role: "content" 20400 }, 20401 inlineLabel: { 20402 type: "boolean", 20403 "default": false 20404 }, 20405 required: { 20406 type: "boolean", 20407 "default": false, 20408 selector: ".wp-block-form-input__input", 20409 source: "attribute", 20410 attribute: "required" 20411 }, 20412 placeholder: { 20413 type: "string", 20414 selector: ".wp-block-form-input__input", 20415 source: "attribute", 20416 attribute: "placeholder", 20417 role: "content" 20418 }, 20419 value: { 20420 type: "string", 20421 "default": "", 20422 selector: "input", 20423 source: "attribute", 20424 attribute: "value" 20425 }, 20426 visibilityPermissions: { 20427 type: "string", 20428 "default": "all" 20429 } 20430 }, 20431 supports: { 20432 anchor: true, 20433 reusable: false, 20434 spacing: { 20435 margin: ["top", "bottom"] 20436 }, 20437 __experimentalBorder: { 20438 radius: true, 20439 __experimentalSkipSerialization: true, 20440 __experimentalDefaultControls: { 20441 radius: true 20442 } 20443 } 20444 }, 20445 style: ["wp-block-form-input"] 20446 }; 20447 20448 20449 const { 20450 name: form_input_name 20451 } = form_input_metadata; 20452 20453 const form_input_settings = { 20454 deprecated: form_input_deprecated, 20455 edit: form_input_edit, 20456 save: form_input_save_save, 20457 variations: form_input_variations 20458 }; 20459 const form_input_init = () => initBlock({ 20460 name: form_input_name, 20461 metadata: form_input_metadata, 20462 settings: form_input_settings 20463 }); 20464 20465 ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/edit.js 20466 /** 20467 * WordPress dependencies 20468 */ 20469 20470 20471 20472 const form_submit_button_edit_TEMPLATE = [['core/buttons', {}, [['core/button', { 20473 text: (0,external_wp_i18n_namespaceObject.__)('Submit'), 20474 tagName: 'button', 20475 type: 'submit' 20476 }]]]]; 20477 const form_submit_button_edit_Edit = () => { 20478 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 20479 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 20480 template: form_submit_button_edit_TEMPLATE, 20481 templateLock: 'all' 20482 }); 20483 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 20484 className: "wp-block-form-submit-wrapper", 20485 ...innerBlocksProps 20486 }); 20487 }; 20488 /* harmony default export */ const form_submit_button_edit = (form_submit_button_edit_Edit); 20489 20490 ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/save.js 20491 /** 20492 * WordPress dependencies 20493 */ 20494 20495 20496 function form_submit_button_save_save() { 20497 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 20498 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 20499 className: "wp-block-form-submit-wrapper", 20500 ...blockProps, 20501 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 20502 }); 20503 } 20504 20505 ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js 20506 /** 20507 * Internal dependencies 20508 */ 20509 20510 20511 const form_submit_button_metadata = { 20512 $schema: "https://schemas.wp.org/trunk/block.json", 20513 apiVersion: 3, 20514 __experimental: true, 20515 name: "core/form-submit-button", 20516 title: "Form Submit Button", 20517 category: "common", 20518 icon: "button", 20519 ancestor: ["core/form"], 20520 allowedBlocks: ["core/buttons", "core/button"], 20521 description: "A submission button for forms.", 20522 keywords: ["submit", "button", "form"], 20523 textdomain: "default", 20524 style: ["wp-block-form-submit-button"] 20525 }; 20526 20527 const { 20528 name: form_submit_button_name 20529 } = form_submit_button_metadata; 20530 20531 const form_submit_button_settings = { 20532 edit: form_submit_button_edit, 20533 save: form_submit_button_save_save 20534 }; 20535 const form_submit_button_init = () => initBlock({ 20536 name: form_submit_button_name, 20537 metadata: form_submit_button_metadata, 20538 settings: form_submit_button_settings 20539 }); 20540 20541 ;// ./node_modules/@wordpress/icons/build-module/library/group.js 20542 /** 20543 * WordPress dependencies 20544 */ 20545 20546 20547 const group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 20548 viewBox: "0 0 24 24", 20549 xmlns: "http://www.w3.org/2000/svg", 20550 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 20551 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" 20552 }) 20553 }); 20554 /* harmony default export */ const library_group = (group); 20555 20556 ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/edit.js 20557 /** 20558 * WordPress dependencies 20559 */ 20560 20561 20562 20563 20564 /** 20565 * External dependencies 20566 */ 20567 20568 20569 const form_submission_notification_edit_TEMPLATE = [['core/paragraph', { 20570 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.") 20571 }]]; 20572 const form_submission_notification_edit_Edit = ({ 20573 attributes, 20574 clientId 20575 }) => { 20576 const { 20577 type 20578 } = attributes; 20579 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 20580 className: dist_clsx('wp-block-form-submission-notification', { 20581 [`form-notification-type-$type}`]: type 20582 }) 20583 }); 20584 const { 20585 hasInnerBlocks 20586 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 20587 const { 20588 getBlock 20589 } = select(external_wp_blockEditor_namespaceObject.store); 20590 const block = getBlock(clientId); 20591 return { 20592 hasInnerBlocks: !!(block && block.innerBlocks.length) 20593 }; 20594 }, [clientId]); 20595 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 20596 template: form_submission_notification_edit_TEMPLATE, 20597 renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 20598 }); 20599 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 20600 ...innerBlocksProps, 20601 "data-message-success": (0,external_wp_i18n_namespaceObject.__)('Submission success notification'), 20602 "data-message-error": (0,external_wp_i18n_namespaceObject.__)('Submission error notification') 20603 }); 20604 }; 20605 /* harmony default export */ const form_submission_notification_edit = (form_submission_notification_edit_Edit); 20606 20607 ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/save.js 20608 /** 20609 * WordPress dependencies 20610 */ 20611 20612 20613 /** 20614 * External dependencies 20615 */ 20616 20617 20618 function form_submission_notification_save_save({ 20619 attributes 20620 }) { 20621 const { 20622 type 20623 } = attributes; 20624 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 20625 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save({ 20626 className: dist_clsx('wp-block-form-submission-notification', { 20627 [`form-notification-type-$type}`]: type 20628 }) 20629 })) 20630 }); 20631 } 20632 20633 ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/variations.js 20634 /** 20635 * WordPress dependencies 20636 */ 20637 20638 const form_submission_notification_variations_variations = [{ 20639 name: 'form-submission-success', 20640 title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Success'), 20641 description: (0,external_wp_i18n_namespaceObject.__)('Success message for form submissions.'), 20642 attributes: { 20643 type: 'success' 20644 }, 20645 isDefault: true, 20646 innerBlocks: [['core/paragraph', { 20647 content: (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully.'), 20648 backgroundColor: '#00D084', 20649 textColor: '#000000', 20650 style: { 20651 elements: { 20652 link: { 20653 color: { 20654 text: '#000000' 20655 } 20656 } 20657 } 20658 } 20659 }]], 20660 scope: ['inserter', 'transform'], 20661 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'success' 20662 }, { 20663 name: 'form-submission-error', 20664 title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Error'), 20665 description: (0,external_wp_i18n_namespaceObject.__)('Error/failure message for form submissions.'), 20666 attributes: { 20667 type: 'error' 20668 }, 20669 isDefault: false, 20670 innerBlocks: [['core/paragraph', { 20671 content: (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.'), 20672 backgroundColor: '#CF2E2E', 20673 textColor: '#FFFFFF', 20674 style: { 20675 elements: { 20676 link: { 20677 color: { 20678 text: '#FFFFFF' 20679 } 20680 } 20681 } 20682 } 20683 }]], 20684 scope: ['inserter', 'transform'], 20685 isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'error' 20686 }]; 20687 /* harmony default export */ const form_submission_notification_variations = (form_submission_notification_variations_variations); 20688 20689 ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js 20690 /** 20691 * WordPress dependencies 20692 */ 20693 20694 20695 /** 20696 * Internal dependencies 20697 */ 20698 20699 20700 const form_submission_notification_metadata = { 20701 $schema: "https://schemas.wp.org/trunk/block.json", 20702 apiVersion: 3, 20703 __experimental: true, 20704 name: "core/form-submission-notification", 20705 title: "Form Submission Notification", 20706 category: "common", 20707 ancestor: ["core/form"], 20708 description: "Provide a notification message after the form has been submitted.", 20709 keywords: ["form", "feedback", "notification", "message"], 20710 textdomain: "default", 20711 icon: "feedback", 20712 attributes: { 20713 type: { 20714 type: "string", 20715 "default": "success" 20716 } 20717 } 20718 }; 20719 20720 20721 const { 20722 name: form_submission_notification_name 20723 } = form_submission_notification_metadata; 20724 20725 const form_submission_notification_settings = { 20726 icon: library_group, 20727 edit: form_submission_notification_edit, 20728 save: form_submission_notification_save_save, 20729 variations: form_submission_notification_variations 20730 }; 20731 const form_submission_notification_init = () => initBlock({ 20732 name: form_submission_notification_name, 20733 metadata: form_submission_notification_metadata, 20734 settings: form_submission_notification_settings 20735 }); 20736 20737 ;// ./node_modules/@wordpress/icons/build-module/library/gallery.js 20738 /** 20739 * WordPress dependencies 20740 */ 20741 20742 20743 const gallery = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 20744 viewBox: "0 0 24 24", 20745 xmlns: "http://www.w3.org/2000/svg", 20746 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 20747 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", 20748 fillRule: "evenodd", 20749 clipRule: "evenodd" 20750 }) 20751 }); 20752 /* harmony default export */ const library_gallery = (gallery); 20753 20754 ;// ./node_modules/@wordpress/block-library/build-module/gallery/constants.js 20755 const LINK_DESTINATION_NONE = 'none'; 20756 const LINK_DESTINATION_MEDIA = 'media'; 20757 const LINK_DESTINATION_LIGHTBOX = 'lightbox'; 20758 const LINK_DESTINATION_ATTACHMENT = 'attachment'; 20759 const LINK_DESTINATION_MEDIA_WP_CORE = 'file'; 20760 const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post'; 20761 20762 ;// ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js 20763 /* wp:polyfill */ 20764 /** 20765 * External dependencies 20766 */ 20767 20768 20769 /** 20770 * WordPress dependencies 20771 */ 20772 20773 20774 20775 /** 20776 * Internal dependencies 20777 */ 20778 20779 20780 const DEPRECATED_LINK_DESTINATION_MEDIA = 'file'; 20781 const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post'; 20782 20783 /** 20784 * Original function to determine default number of columns from a block's 20785 * attributes. 20786 * 20787 * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks. 20788 * 20789 * @param {Object} attributes Block attributes. 20790 * @return {number} Default number of columns for the gallery. 20791 */ 20792 function defaultColumnsNumberV1(attributes) { 20793 return Math.min(3, attributes?.images?.length); 20794 } 20795 20796 /** 20797 * Original function to determine new href and linkDestination values for an image block from the 20798 * supplied Gallery link destination. 20799 * 20800 * Used in deprecations: v1-6. 20801 * 20802 * @param {Object} image Gallery image. 20803 * @param {string} destination Gallery's selected link destination. 20804 * @return {Object} New attributes to assign to image block. 20805 */ 20806 function getHrefAndDestination(image, destination) { 20807 // Need to determine the URL that the selected destination maps to. 20808 // Gutenberg and WordPress use different constants so the new link 20809 // destination also needs to be tweaked. 20810 switch (destination) { 20811 case DEPRECATED_LINK_DESTINATION_MEDIA: 20812 return { 20813 href: image?.source_url || image?.url, 20814 // eslint-disable-line camelcase 20815 linkDestination: LINK_DESTINATION_MEDIA 20816 }; 20817 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 20818 return { 20819 href: image?.link, 20820 linkDestination: LINK_DESTINATION_ATTACHMENT 20821 }; 20822 case LINK_DESTINATION_MEDIA: 20823 return { 20824 href: image?.source_url || image?.url, 20825 // eslint-disable-line camelcase 20826 linkDestination: LINK_DESTINATION_MEDIA 20827 }; 20828 case LINK_DESTINATION_ATTACHMENT: 20829 return { 20830 href: image?.link, 20831 linkDestination: LINK_DESTINATION_ATTACHMENT 20832 }; 20833 case LINK_DESTINATION_NONE: 20834 return { 20835 href: undefined, 20836 linkDestination: LINK_DESTINATION_NONE 20837 }; 20838 } 20839 return {}; 20840 } 20841 function runV2Migration(attributes) { 20842 let linkTo = attributes.linkTo ? attributes.linkTo : 'none'; 20843 if (linkTo === 'post') { 20844 linkTo = 'attachment'; 20845 } else if (linkTo === 'file') { 20846 linkTo = 'media'; 20847 } 20848 const imageBlocks = attributes.images.map(image => { 20849 return getImageBlock(image, attributes.sizeSlug, linkTo); 20850 }); 20851 const { 20852 images, 20853 ids, 20854 ...restAttributes 20855 } = attributes; 20856 return [{ 20857 ...restAttributes, 20858 linkTo, 20859 allowResize: false 20860 }, imageBlocks]; 20861 } 20862 /** 20863 * Gets an Image block from gallery image data 20864 * 20865 * Used to migrate Galleries to nested Image InnerBlocks. 20866 * 20867 * @param {Object} image Image properties. 20868 * @param {string} sizeSlug Gallery sizeSlug attribute. 20869 * @param {string} linkTo Gallery linkTo attribute. 20870 * @return {Object} Image block. 20871 */ 20872 function getImageBlock(image, sizeSlug, linkTo) { 20873 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 20874 ...(image.id && { 20875 id: parseInt(image.id) 20876 }), 20877 url: image.url, 20878 alt: image.alt, 20879 caption: image.caption, 20880 sizeSlug, 20881 ...getHrefAndDestination(image, linkTo) 20882 }); 20883 } 20884 20885 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 20886 // to the gallery figcaption element. 20887 const deprecated_v7 = { 20888 attributes: { 20889 images: { 20890 type: 'array', 20891 default: [], 20892 source: 'query', 20893 selector: '.blocks-gallery-item', 20894 query: { 20895 url: { 20896 type: 'string', 20897 source: 'attribute', 20898 selector: 'img', 20899 attribute: 'src' 20900 }, 20901 fullUrl: { 20902 type: 'string', 20903 source: 'attribute', 20904 selector: 'img', 20905 attribute: 'data-full-url' 20906 }, 20907 link: { 20908 type: 'string', 20909 source: 'attribute', 20910 selector: 'img', 20911 attribute: 'data-link' 20912 }, 20913 alt: { 20914 type: 'string', 20915 source: 'attribute', 20916 selector: 'img', 20917 attribute: 'alt', 20918 default: '' 20919 }, 20920 id: { 20921 type: 'string', 20922 source: 'attribute', 20923 selector: 'img', 20924 attribute: 'data-id' 20925 }, 20926 caption: { 20927 type: 'string', 20928 source: 'html', 20929 selector: '.blocks-gallery-item__caption' 20930 } 20931 } 20932 }, 20933 ids: { 20934 type: 'array', 20935 items: { 20936 type: 'number' 20937 }, 20938 default: [] 20939 }, 20940 shortCodeTransforms: { 20941 type: 'array', 20942 default: [], 20943 items: { 20944 type: 'object' 20945 } 20946 }, 20947 columns: { 20948 type: 'number', 20949 minimum: 1, 20950 maximum: 8 20951 }, 20952 caption: { 20953 type: 'string', 20954 source: 'html', 20955 selector: '.blocks-gallery-caption' 20956 }, 20957 imageCrop: { 20958 type: 'boolean', 20959 default: true 20960 }, 20961 fixedHeight: { 20962 type: 'boolean', 20963 default: true 20964 }, 20965 linkTarget: { 20966 type: 'string' 20967 }, 20968 linkTo: { 20969 type: 'string' 20970 }, 20971 sizeSlug: { 20972 type: 'string', 20973 default: 'large' 20974 }, 20975 allowResize: { 20976 type: 'boolean', 20977 default: false 20978 } 20979 }, 20980 save({ 20981 attributes 20982 }) { 20983 const { 20984 caption, 20985 columns, 20986 imageCrop 20987 } = attributes; 20988 const className = dist_clsx('has-nested-images', { 20989 [`columns-$columns}`]: columns !== undefined, 20990 [`columns-default`]: columns === undefined, 20991 'is-cropped': imageCrop 20992 }); 20993 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 20994 className 20995 }); 20996 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 20997 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 20998 ...innerBlocksProps, 20999 children: [innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21000 tagName: "figcaption", 21001 className: "blocks-gallery-caption", 21002 value: caption 21003 })] 21004 }); 21005 } 21006 }; 21007 const deprecated_v6 = { 21008 attributes: { 21009 images: { 21010 type: 'array', 21011 default: [], 21012 source: 'query', 21013 selector: '.blocks-gallery-item', 21014 query: { 21015 url: { 21016 type: 'string', 21017 source: 'attribute', 21018 selector: 'img', 21019 attribute: 'src' 21020 }, 21021 fullUrl: { 21022 type: 'string', 21023 source: 'attribute', 21024 selector: 'img', 21025 attribute: 'data-full-url' 21026 }, 21027 link: { 21028 type: 'string', 21029 source: 'attribute', 21030 selector: 'img', 21031 attribute: 'data-link' 21032 }, 21033 alt: { 21034 type: 'string', 21035 source: 'attribute', 21036 selector: 'img', 21037 attribute: 'alt', 21038 default: '' 21039 }, 21040 id: { 21041 type: 'string', 21042 source: 'attribute', 21043 selector: 'img', 21044 attribute: 'data-id' 21045 }, 21046 caption: { 21047 type: 'string', 21048 source: 'html', 21049 selector: '.blocks-gallery-item__caption' 21050 } 21051 } 21052 }, 21053 ids: { 21054 type: 'array', 21055 items: { 21056 type: 'number' 21057 }, 21058 default: [] 21059 }, 21060 columns: { 21061 type: 'number', 21062 minimum: 1, 21063 maximum: 8 21064 }, 21065 caption: { 21066 type: 'string', 21067 source: 'html', 21068 selector: '.blocks-gallery-caption' 21069 }, 21070 imageCrop: { 21071 type: 'boolean', 21072 default: true 21073 }, 21074 fixedHeight: { 21075 type: 'boolean', 21076 default: true 21077 }, 21078 linkTo: { 21079 type: 'string' 21080 }, 21081 sizeSlug: { 21082 type: 'string', 21083 default: 'large' 21084 } 21085 }, 21086 supports: { 21087 anchor: true, 21088 align: true 21089 }, 21090 save({ 21091 attributes 21092 }) { 21093 const { 21094 images, 21095 columns = defaultColumnsNumberV1(attributes), 21096 imageCrop, 21097 caption, 21098 linkTo 21099 } = attributes; 21100 const className = `columns-$columns} $imageCrop ? 'is-cropped' : ''}`; 21101 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21102 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 21103 className 21104 }), 21105 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 21106 className: "blocks-gallery-grid", 21107 children: images.map(image => { 21108 let href; 21109 switch (linkTo) { 21110 case DEPRECATED_LINK_DESTINATION_MEDIA: 21111 href = image.fullUrl || image.url; 21112 break; 21113 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 21114 href = image.link; 21115 break; 21116 } 21117 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21118 src: image.url, 21119 alt: image.alt, 21120 "data-id": image.id, 21121 "data-full-url": image.fullUrl, 21122 "data-link": image.link, 21123 className: image.id ? `wp-image-$image.id}` : null 21124 }); 21125 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 21126 className: "blocks-gallery-item", 21127 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21128 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21129 href: href, 21130 children: img 21131 }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21132 tagName: "figcaption", 21133 className: "blocks-gallery-item__caption", 21134 value: image.caption 21135 })] 21136 }) 21137 }, image.id || image.url); 21138 }) 21139 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21140 tagName: "figcaption", 21141 className: "blocks-gallery-caption", 21142 value: caption 21143 })] 21144 }); 21145 }, 21146 migrate(attributes) { 21147 return runV2Migration(attributes); 21148 } 21149 }; 21150 const deprecated_v5 = { 21151 attributes: { 21152 images: { 21153 type: 'array', 21154 default: [], 21155 source: 'query', 21156 selector: '.blocks-gallery-item', 21157 query: { 21158 url: { 21159 type: 'string', 21160 source: 'attribute', 21161 selector: 'img', 21162 attribute: 'src' 21163 }, 21164 fullUrl: { 21165 type: 'string', 21166 source: 'attribute', 21167 selector: 'img', 21168 attribute: 'data-full-url' 21169 }, 21170 link: { 21171 type: 'string', 21172 source: 'attribute', 21173 selector: 'img', 21174 attribute: 'data-link' 21175 }, 21176 alt: { 21177 type: 'string', 21178 source: 'attribute', 21179 selector: 'img', 21180 attribute: 'alt', 21181 default: '' 21182 }, 21183 id: { 21184 type: 'string', 21185 source: 'attribute', 21186 selector: 'img', 21187 attribute: 'data-id' 21188 }, 21189 caption: { 21190 type: 'string', 21191 source: 'html', 21192 selector: '.blocks-gallery-item__caption' 21193 } 21194 } 21195 }, 21196 ids: { 21197 type: 'array', 21198 items: { 21199 type: 'number' 21200 }, 21201 default: [] 21202 }, 21203 columns: { 21204 type: 'number', 21205 minimum: 1, 21206 maximum: 8 21207 }, 21208 caption: { 21209 type: 'string', 21210 source: 'html', 21211 selector: '.blocks-gallery-caption' 21212 }, 21213 imageCrop: { 21214 type: 'boolean', 21215 default: true 21216 }, 21217 linkTo: { 21218 type: 'string', 21219 default: 'none' 21220 }, 21221 sizeSlug: { 21222 type: 'string', 21223 default: 'large' 21224 } 21225 }, 21226 supports: { 21227 align: true 21228 }, 21229 isEligible({ 21230 linkTo 21231 }) { 21232 return !linkTo || linkTo === 'attachment' || linkTo === 'media'; 21233 }, 21234 migrate(attributes) { 21235 return runV2Migration(attributes); 21236 }, 21237 save({ 21238 attributes 21239 }) { 21240 const { 21241 images, 21242 columns = defaultColumnsNumberV1(attributes), 21243 imageCrop, 21244 caption, 21245 linkTo 21246 } = attributes; 21247 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21248 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}`, 21249 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 21250 className: "blocks-gallery-grid", 21251 children: images.map(image => { 21252 let href; 21253 switch (linkTo) { 21254 case 'media': 21255 href = image.fullUrl || image.url; 21256 break; 21257 case 'attachment': 21258 href = image.link; 21259 break; 21260 } 21261 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21262 src: image.url, 21263 alt: image.alt, 21264 "data-id": image.id, 21265 "data-full-url": image.fullUrl, 21266 "data-link": image.link, 21267 className: image.id ? `wp-image-$image.id}` : null 21268 }); 21269 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 21270 className: "blocks-gallery-item", 21271 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21272 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21273 href: href, 21274 children: img 21275 }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21276 tagName: "figcaption", 21277 className: "blocks-gallery-item__caption", 21278 value: image.caption 21279 })] 21280 }) 21281 }, image.id || image.url); 21282 }) 21283 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21284 tagName: "figcaption", 21285 className: "blocks-gallery-caption", 21286 value: caption 21287 })] 21288 }); 21289 } 21290 }; 21291 const deprecated_v4 = { 21292 attributes: { 21293 images: { 21294 type: 'array', 21295 default: [], 21296 source: 'query', 21297 selector: '.blocks-gallery-item', 21298 query: { 21299 url: { 21300 source: 'attribute', 21301 selector: 'img', 21302 attribute: 'src' 21303 }, 21304 fullUrl: { 21305 source: 'attribute', 21306 selector: 'img', 21307 attribute: 'data-full-url' 21308 }, 21309 link: { 21310 source: 'attribute', 21311 selector: 'img', 21312 attribute: 'data-link' 21313 }, 21314 alt: { 21315 source: 'attribute', 21316 selector: 'img', 21317 attribute: 'alt', 21318 default: '' 21319 }, 21320 id: { 21321 source: 'attribute', 21322 selector: 'img', 21323 attribute: 'data-id' 21324 }, 21325 caption: { 21326 type: 'string', 21327 source: 'html', 21328 selector: '.blocks-gallery-item__caption' 21329 } 21330 } 21331 }, 21332 ids: { 21333 type: 'array', 21334 default: [] 21335 }, 21336 columns: { 21337 type: 'number' 21338 }, 21339 caption: { 21340 type: 'string', 21341 source: 'html', 21342 selector: '.blocks-gallery-caption' 21343 }, 21344 imageCrop: { 21345 type: 'boolean', 21346 default: true 21347 }, 21348 linkTo: { 21349 type: 'string', 21350 default: 'none' 21351 } 21352 }, 21353 supports: { 21354 align: true 21355 }, 21356 isEligible({ 21357 ids 21358 }) { 21359 return ids && ids.some(id => typeof id === 'string'); 21360 }, 21361 migrate(attributes) { 21362 return runV2Migration(attributes); 21363 }, 21364 save({ 21365 attributes 21366 }) { 21367 const { 21368 images, 21369 columns = defaultColumnsNumberV1(attributes), 21370 imageCrop, 21371 caption, 21372 linkTo 21373 } = attributes; 21374 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21375 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}`, 21376 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 21377 className: "blocks-gallery-grid", 21378 children: images.map(image => { 21379 let href; 21380 switch (linkTo) { 21381 case 'media': 21382 href = image.fullUrl || image.url; 21383 break; 21384 case 'attachment': 21385 href = image.link; 21386 break; 21387 } 21388 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21389 src: image.url, 21390 alt: image.alt, 21391 "data-id": image.id, 21392 "data-full-url": image.fullUrl, 21393 "data-link": image.link, 21394 className: image.id ? `wp-image-$image.id}` : null 21395 }); 21396 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 21397 className: "blocks-gallery-item", 21398 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21399 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21400 href: href, 21401 children: img 21402 }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21403 tagName: "figcaption", 21404 className: "blocks-gallery-item__caption", 21405 value: image.caption 21406 })] 21407 }) 21408 }, image.id || image.url); 21409 }) 21410 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21411 tagName: "figcaption", 21412 className: "blocks-gallery-caption", 21413 value: caption 21414 })] 21415 }); 21416 } 21417 }; 21418 const gallery_deprecated_v3 = { 21419 attributes: { 21420 images: { 21421 type: 'array', 21422 default: [], 21423 source: 'query', 21424 selector: 'ul.wp-block-gallery .blocks-gallery-item', 21425 query: { 21426 url: { 21427 source: 'attribute', 21428 selector: 'img', 21429 attribute: 'src' 21430 }, 21431 fullUrl: { 21432 source: 'attribute', 21433 selector: 'img', 21434 attribute: 'data-full-url' 21435 }, 21436 alt: { 21437 source: 'attribute', 21438 selector: 'img', 21439 attribute: 'alt', 21440 default: '' 21441 }, 21442 id: { 21443 source: 'attribute', 21444 selector: 'img', 21445 attribute: 'data-id' 21446 }, 21447 link: { 21448 source: 'attribute', 21449 selector: 'img', 21450 attribute: 'data-link' 21451 }, 21452 caption: { 21453 type: 'string', 21454 source: 'html', 21455 selector: 'figcaption' 21456 } 21457 } 21458 }, 21459 ids: { 21460 type: 'array', 21461 default: [] 21462 }, 21463 columns: { 21464 type: 'number' 21465 }, 21466 imageCrop: { 21467 type: 'boolean', 21468 default: true 21469 }, 21470 linkTo: { 21471 type: 'string', 21472 default: 'none' 21473 } 21474 }, 21475 supports: { 21476 align: true 21477 }, 21478 save({ 21479 attributes 21480 }) { 21481 const { 21482 images, 21483 columns = defaultColumnsNumberV1(attributes), 21484 imageCrop, 21485 linkTo 21486 } = attributes; 21487 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 21488 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}`, 21489 children: images.map(image => { 21490 let href; 21491 switch (linkTo) { 21492 case 'media': 21493 href = image.fullUrl || image.url; 21494 break; 21495 case 'attachment': 21496 href = image.link; 21497 break; 21498 } 21499 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21500 src: image.url, 21501 alt: image.alt, 21502 "data-id": image.id, 21503 "data-full-url": image.fullUrl, 21504 "data-link": image.link, 21505 className: image.id ? `wp-image-$image.id}` : null 21506 }); 21507 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 21508 className: "blocks-gallery-item", 21509 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21510 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21511 href: href, 21512 children: img 21513 }) : img, image.caption && image.caption.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21514 tagName: "figcaption", 21515 value: image.caption 21516 })] 21517 }) 21518 }, image.id || image.url); 21519 }) 21520 }); 21521 }, 21522 migrate(attributes) { 21523 return runV2Migration(attributes); 21524 } 21525 }; 21526 const gallery_deprecated_v2 = { 21527 attributes: { 21528 images: { 21529 type: 'array', 21530 default: [], 21531 source: 'query', 21532 selector: 'ul.wp-block-gallery .blocks-gallery-item', 21533 query: { 21534 url: { 21535 source: 'attribute', 21536 selector: 'img', 21537 attribute: 'src' 21538 }, 21539 alt: { 21540 source: 'attribute', 21541 selector: 'img', 21542 attribute: 'alt', 21543 default: '' 21544 }, 21545 id: { 21546 source: 'attribute', 21547 selector: 'img', 21548 attribute: 'data-id' 21549 }, 21550 link: { 21551 source: 'attribute', 21552 selector: 'img', 21553 attribute: 'data-link' 21554 }, 21555 caption: { 21556 type: 'string', 21557 source: 'html', 21558 selector: 'figcaption' 21559 } 21560 } 21561 }, 21562 columns: { 21563 type: 'number' 21564 }, 21565 imageCrop: { 21566 type: 'boolean', 21567 default: true 21568 }, 21569 linkTo: { 21570 type: 'string', 21571 default: 'none' 21572 } 21573 }, 21574 isEligible({ 21575 images, 21576 ids 21577 }) { 21578 return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || images.some((id, index) => { 21579 if (!id && ids[index] !== null) { 21580 return true; 21581 } 21582 return parseInt(id, 10) !== ids[index]; 21583 })); 21584 }, 21585 migrate(attributes) { 21586 return runV2Migration(attributes); 21587 }, 21588 supports: { 21589 align: true 21590 }, 21591 save({ 21592 attributes 21593 }) { 21594 const { 21595 images, 21596 columns = defaultColumnsNumberV1(attributes), 21597 imageCrop, 21598 linkTo 21599 } = attributes; 21600 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 21601 className: `columns-$columns} $imageCrop ? 'is-cropped' : ''}`, 21602 children: images.map(image => { 21603 let href; 21604 switch (linkTo) { 21605 case 'media': 21606 href = image.url; 21607 break; 21608 case 'attachment': 21609 href = image.link; 21610 break; 21611 } 21612 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21613 src: image.url, 21614 alt: image.alt, 21615 "data-id": image.id, 21616 "data-link": image.link, 21617 className: image.id ? `wp-image-$image.id}` : null 21618 }); 21619 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 21620 className: "blocks-gallery-item", 21621 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21622 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21623 href: href, 21624 children: img 21625 }) : img, image.caption && image.caption.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 21626 tagName: "figcaption", 21627 value: image.caption 21628 })] 21629 }) 21630 }, image.id || image.url); 21631 }) 21632 }); 21633 } 21634 }; 21635 const gallery_deprecated_v1 = { 21636 attributes: { 21637 images: { 21638 type: 'array', 21639 default: [], 21640 source: 'query', 21641 selector: 'div.wp-block-gallery figure.blocks-gallery-image img', 21642 query: { 21643 url: { 21644 source: 'attribute', 21645 attribute: 'src' 21646 }, 21647 alt: { 21648 source: 'attribute', 21649 attribute: 'alt', 21650 default: '' 21651 }, 21652 id: { 21653 source: 'attribute', 21654 attribute: 'data-id' 21655 } 21656 } 21657 }, 21658 columns: { 21659 type: 'number' 21660 }, 21661 imageCrop: { 21662 type: 'boolean', 21663 default: true 21664 }, 21665 linkTo: { 21666 type: 'string', 21667 default: 'none' 21668 }, 21669 align: { 21670 type: 'string', 21671 default: 'none' 21672 } 21673 }, 21674 supports: { 21675 align: true 21676 }, 21677 save({ 21678 attributes 21679 }) { 21680 const { 21681 images, 21682 columns = defaultColumnsNumberV1(attributes), 21683 align, 21684 imageCrop, 21685 linkTo 21686 } = attributes; 21687 const className = dist_clsx(`columns-$columns}`, { 21688 alignnone: align === 'none', 21689 'is-cropped': imageCrop 21690 }); 21691 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 21692 className: className, 21693 children: images.map(image => { 21694 let href; 21695 switch (linkTo) { 21696 case 'media': 21697 href = image.url; 21698 break; 21699 case 'attachment': 21700 href = image.link; 21701 break; 21702 } 21703 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 21704 src: image.url, 21705 alt: image.alt, 21706 "data-id": image.id 21707 }); 21708 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 21709 className: "blocks-gallery-image", 21710 children: href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 21711 href: href, 21712 children: img 21713 }) : img 21714 }, image.id || image.url); 21715 }) 21716 }); 21717 }, 21718 migrate(attributes) { 21719 return runV2Migration(attributes); 21720 } 21721 }; 21722 /* harmony default export */ const gallery_deprecated = ([deprecated_v7, deprecated_v6, deprecated_v5, deprecated_v4, gallery_deprecated_v3, gallery_deprecated_v2, gallery_deprecated_v1]); 21723 21724 ;// ./node_modules/@wordpress/icons/build-module/library/custom-link.js 21725 /** 21726 * WordPress dependencies 21727 */ 21728 21729 21730 const customLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 21731 xmlns: "http://www.w3.org/2000/svg", 21732 viewBox: "0 0 24 24", 21733 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 21734 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" 21735 }) 21736 }); 21737 /* harmony default export */ const custom_link = (customLink); 21738 21739 ;// ./node_modules/@wordpress/icons/build-module/library/image.js 21740 /** 21741 * WordPress dependencies 21742 */ 21743 21744 21745 const image_image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 21746 viewBox: "0 0 24 24", 21747 xmlns: "http://www.w3.org/2000/svg", 21748 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 21749 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" 21750 }) 21751 }); 21752 /* harmony default export */ const library_image = (image_image); 21753 21754 ;// ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js 21755 /** 21756 * WordPress dependencies 21757 */ 21758 21759 21760 21761 const sharedIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 21762 icon: library_gallery 21763 }); 21764 21765 ;// ./node_modules/@wordpress/block-library/build-module/gallery/shared.js 21766 /* wp:polyfill */ 21767 function defaultColumnsNumber(imageCount) { 21768 return imageCount ? Math.min(3, imageCount) : 3; 21769 } 21770 const pickRelevantMediaFiles = (image, sizeSlug = 'large') => { 21771 const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link'].includes(key))); 21772 imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; 21773 const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; 21774 if (fullUrl) { 21775 imageProps.fullUrl = fullUrl; 21776 } 21777 return imageProps; 21778 }; 21779 21780 ;// ./node_modules/@wordpress/block-library/build-module/image/constants.js 21781 const constants_MIN_SIZE = 20; 21782 const constants_LINK_DESTINATION_NONE = 'none'; 21783 const constants_LINK_DESTINATION_MEDIA = 'media'; 21784 const constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; 21785 const LINK_DESTINATION_CUSTOM = 'custom'; 21786 const constants_NEW_TAB_REL = ['noreferrer', 'noopener']; 21787 const constants_ALLOWED_MEDIA_TYPES = ['image']; 21788 const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0; 21789 21790 ;// ./node_modules/@wordpress/block-library/build-module/gallery/utils.js 21791 /** 21792 * Internal dependencies 21793 */ 21794 21795 21796 21797 /** 21798 * Determines new href and linkDestination values for an Image block from the 21799 * supplied Gallery link destination, or falls back to the Image blocks link. 21800 * 21801 * @param {Object} image Gallery image. 21802 * @param {string} galleryDestination Gallery's selected link destination. 21803 * @param {Object} imageDestination Image block link destination attribute. 21804 * @param {Object} attributes Block attributes. 21805 * @param {Object} lightboxSetting Lightbox setting. 21806 * 21807 * @return {Object} New attributes to assign to image block. 21808 */ 21809 function utils_getHrefAndDestination(image, galleryDestination, imageDestination, attributes, lightboxSetting) { 21810 // Gutenberg and WordPress use different constants so if image_default_link_type 21811 // option is set we need to map from the WP Core values. 21812 switch (imageDestination ? imageDestination : galleryDestination) { 21813 case LINK_DESTINATION_MEDIA_WP_CORE: 21814 case LINK_DESTINATION_MEDIA: 21815 return { 21816 href: image?.source_url || image?.url, 21817 // eslint-disable-line camelcase 21818 linkDestination: constants_LINK_DESTINATION_MEDIA, 21819 lightbox: lightboxSetting?.enabled ? { 21820 ...attributes?.lightbox, 21821 enabled: false 21822 } : undefined 21823 }; 21824 case LINK_DESTINATION_ATTACHMENT_WP_CORE: 21825 case LINK_DESTINATION_ATTACHMENT: 21826 return { 21827 href: image?.link, 21828 linkDestination: constants_LINK_DESTINATION_ATTACHMENT, 21829 lightbox: lightboxSetting?.enabled ? { 21830 ...attributes?.lightbox, 21831 enabled: false 21832 } : undefined 21833 }; 21834 case LINK_DESTINATION_LIGHTBOX: 21835 return { 21836 href: undefined, 21837 lightbox: !lightboxSetting?.enabled ? { 21838 ...attributes?.lightbox, 21839 enabled: true 21840 } : undefined, 21841 linkDestination: constants_LINK_DESTINATION_NONE 21842 }; 21843 case LINK_DESTINATION_NONE: 21844 return { 21845 href: undefined, 21846 linkDestination: constants_LINK_DESTINATION_NONE, 21847 lightbox: undefined 21848 }; 21849 } 21850 return {}; 21851 } 21852 21853 ;// ./node_modules/@wordpress/block-library/build-module/image/utils.js 21854 /* wp:polyfill */ 21855 /** 21856 * Internal dependencies 21857 */ 21858 21859 21860 /** 21861 * Evaluates a CSS aspect-ratio property value as a number. 21862 * 21863 * Degenerate or invalid ratios behave as 'auto'. And 'auto' ratios return NaN. 21864 * 21865 * @see https://drafts.csswg.org/css-sizing-4/#aspect-ratio 21866 * 21867 * @param {string} value CSS aspect-ratio property value. 21868 * @return {number} Numerical aspect ratio or NaN if invalid. 21869 */ 21870 function evalAspectRatio(value) { 21871 const [width, height = 1] = value.split('/').map(Number); 21872 const aspectRatio = width / height; 21873 return aspectRatio === Infinity || aspectRatio === 0 ? NaN : aspectRatio; 21874 } 21875 function removeNewTabRel(currentRel) { 21876 let newRel = currentRel; 21877 if (currentRel !== undefined && newRel) { 21878 constants_NEW_TAB_REL.forEach(relVal => { 21879 const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); 21880 newRel = newRel.replace(regExp, ''); 21881 }); 21882 21883 // Only trim if NEW_TAB_REL values was replaced. 21884 if (newRel !== currentRel) { 21885 newRel = newRel.trim(); 21886 } 21887 if (!newRel) { 21888 newRel = undefined; 21889 } 21890 } 21891 return newRel; 21892 } 21893 21894 /** 21895 * Helper to get the link target settings to be stored. 21896 * 21897 * @param {boolean} value The new link target value. 21898 * @param {Object} attributes Block attributes. 21899 * @param {Object} attributes.rel Image block's rel attribute. 21900 * 21901 * @return {Object} Updated link target settings. 21902 */ 21903 function getUpdatedLinkTargetSettings(value, { 21904 rel 21905 }) { 21906 const linkTarget = value ? '_blank' : undefined; 21907 let updatedRel; 21908 if (!linkTarget && !rel) { 21909 updatedRel = undefined; 21910 } else { 21911 updatedRel = removeNewTabRel(rel); 21912 } 21913 return { 21914 linkTarget, 21915 rel: updatedRel 21916 }; 21917 } 21918 21919 /** 21920 * Determines new Image block attributes size selection. 21921 * 21922 * @param {Object} image Media file object for gallery image. 21923 * @param {string} size Selected size slug to apply. 21924 */ 21925 function getImageSizeAttributes(image, size) { 21926 const url = image?.media_details?.sizes?.[size]?.source_url; 21927 if (url) { 21928 return { 21929 url, 21930 width: undefined, 21931 height: undefined, 21932 sizeSlug: size 21933 }; 21934 } 21935 return {}; 21936 } 21937 21938 /** 21939 * Checks if the file has a valid file type. 21940 * 21941 * @param {File} file - The file to check. 21942 * @return {boolean} - Returns true if the file has a valid file type, otherwise false. 21943 */ 21944 function isValidFileType(file) { 21945 return constants_ALLOWED_MEDIA_TYPES.some(mediaType => file.type.indexOf(mediaType) === 0); 21946 } 21947 21948 ;// ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js 21949 /** 21950 * External dependencies 21951 */ 21952 21953 21954 /** 21955 * WordPress dependencies 21956 */ 21957 21958 21959 21960 /** 21961 * Internal dependencies 21962 */ 21963 21964 21965 function Gallery(props) { 21966 const { 21967 attributes, 21968 isSelected, 21969 setAttributes, 21970 mediaPlaceholder, 21971 insertBlocksAfter, 21972 blockProps, 21973 __unstableLayoutClassNames: layoutClassNames, 21974 isContentLocked, 21975 multiGallerySelection 21976 } = props; 21977 const { 21978 align, 21979 columns, 21980 imageCrop 21981 } = attributes; 21982 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 21983 ...blockProps, 21984 className: dist_clsx(blockProps.className, layoutClassNames, 'blocks-gallery-grid', { 21985 [`align$align}`]: align, 21986 [`columns-$columns}`]: columns !== undefined, 21987 [`columns-default`]: columns === undefined, 21988 'is-cropped': imageCrop 21989 }), 21990 children: [blockProps.children, isSelected && !blockProps.children && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { 21991 className: "blocks-gallery-media-placeholder-wrapper", 21992 children: mediaPlaceholder 21993 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 21994 attributes: attributes, 21995 setAttributes: setAttributes, 21996 isSelected: isSelected, 21997 insertBlocksAfter: insertBlocksAfter, 21998 showToolbarButton: !multiGallerySelection && !isContentLocked, 21999 className: "blocks-gallery-caption", 22000 label: (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), 22001 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add gallery caption') 22002 })] 22003 }); 22004 } 22005 22006 ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js 22007 /* wp:polyfill */ 22008 /** 22009 * WordPress dependencies 22010 */ 22011 22012 22013 /** 22014 * Calculates the image sizes that are available for the current gallery images in order to 22015 * populate the 'Resolution' selector. 22016 * 22017 * @param {Array} images Basic image block data taken from current gallery innerBlock. 22018 * @param {boolean} isSelected Is the block currently selected in the editor. 22019 * @param {Function} getSettings Block editor store selector. 22020 * 22021 * @return {Array} An array of image size options. 22022 */ 22023 function useImageSizes(images, isSelected, getSettings) { 22024 return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]); 22025 function getImageSizing() { 22026 if (!images || images.length === 0) { 22027 return; 22028 } 22029 const { 22030 imageSizes 22031 } = getSettings(); 22032 let resizedImages = {}; 22033 if (isSelected) { 22034 resizedImages = images.reduce((currentResizedImages, img) => { 22035 if (!img.id) { 22036 return currentResizedImages; 22037 } 22038 const sizes = imageSizes.reduce((currentSizes, size) => { 22039 const defaultUrl = img.sizes?.[size.slug]?.url; 22040 const mediaDetailsUrl = img.media_details?.sizes?.[size.slug]?.source_url; 22041 return { 22042 ...currentSizes, 22043 [size.slug]: defaultUrl || mediaDetailsUrl 22044 }; 22045 }, {}); 22046 return { 22047 ...currentResizedImages, 22048 [parseInt(img.id, 10)]: sizes 22049 }; 22050 }, {}); 22051 } 22052 const resizedImageSizes = Object.values(resizedImages); 22053 return imageSizes.filter(({ 22054 slug 22055 }) => resizedImageSizes.some(sizes => sizes[slug])).map(({ 22056 name, 22057 slug 22058 }) => ({ 22059 value: slug, 22060 label: name 22061 })); 22062 } 22063 } 22064 22065 ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js 22066 /* wp:polyfill */ 22067 /** 22068 * WordPress dependencies 22069 */ 22070 22071 22072 /** 22073 * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This 22074 * is required so default gallery attributes can be applied without overwriting any custom 22075 * attributes applied to existing images. 22076 * 22077 * @param {Array} images Basic image block data taken from current gallery innerBlock 22078 * @param {Array} imageData The related image data for each of the current gallery images. 22079 * 22080 * @return {Array} An array of any new images that have been added to the gallery. 22081 */ 22082 function useGetNewImages(images, imageData) { 22083 const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]); 22084 return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]); 22085 function getNewImages() { 22086 let imagesUpdated = false; 22087 22088 // First lets check if any images have been deleted. 22089 const newCurrentImages = currentImages.filter(currentImg => images.find(img => { 22090 return currentImg.clientId === img.clientId; 22091 })); 22092 if (newCurrentImages.length < currentImages.length) { 22093 imagesUpdated = true; 22094 } 22095 22096 // Now lets see if we have any images hydrated from saved content and if so 22097 // add them to currentImages state. 22098 images.forEach(image => { 22099 if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) { 22100 imagesUpdated = true; 22101 newCurrentImages.push(image); 22102 } 22103 }); 22104 22105 // Now check for any new images that have been added to InnerBlocks and for which 22106 // we have the imageData we need for setting default block attributes. 22107 const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && imageData?.find(img => img.id === image.id) && !image.fromSavedContent); 22108 if (imagesUpdated || newImages?.length > 0) { 22109 setCurrentImages([...newCurrentImages, ...newImages]); 22110 } 22111 return newImages.length > 0 ? newImages : null; 22112 } 22113 } 22114 22115 ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js 22116 /* wp:polyfill */ 22117 /** 22118 * WordPress dependencies 22119 */ 22120 22121 22122 const EMPTY_IMAGE_MEDIA = []; 22123 22124 /** 22125 * Retrieves the extended media info for each gallery image from the store. This is used to 22126 * determine which image size options are available for the current gallery. 22127 * 22128 * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery. 22129 * 22130 * @return {Array} An array of media info options for each gallery image. 22131 */ 22132 function useGetMedia(innerBlockImages) { 22133 return (0,external_wp_data_namespaceObject.useSelect)(select => { 22134 var _select$getMediaItems; 22135 const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined); 22136 if (imageIds.length === 0) { 22137 return EMPTY_IMAGE_MEDIA; 22138 } 22139 return (_select$getMediaItems = select(external_wp_coreData_namespaceObject.store).getMediaItems({ 22140 include: imageIds.join(','), 22141 per_page: -1, 22142 orderby: 'include' 22143 })) !== null && _select$getMediaItems !== void 0 ? _select$getMediaItems : EMPTY_IMAGE_MEDIA; 22144 }, [innerBlockImages]); 22145 } 22146 22147 ;// ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js 22148 /** 22149 * WordPress dependencies 22150 */ 22151 22152 function GapStyles({ 22153 blockGap, 22154 clientId 22155 }) { 22156 // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default 22157 // gap on the gallery. 22158 const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`; 22159 let gapValue = fallbackValue; 22160 let column = fallbackValue; 22161 let row; 22162 22163 // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736 22164 if (!!blockGap) { 22165 row = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue; 22166 column = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.left) || fallbackValue; 22167 gapValue = row === column ? row : `$row} $column}`; 22168 } 22169 22170 // The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`. 22171 const gap = `#block-$clientId} { 22172 --wp--style--unstable-gallery-gap: $column === '0' ? '0px' : column}; 22173 gap: $gapValue} 22174 }`; 22175 (0,external_wp_blockEditor_namespaceObject.useStyleOverride)({ 22176 css: gap 22177 }); 22178 return null; 22179 } 22180 22181 ;// ./node_modules/@wordpress/block-library/build-module/gallery/edit.js 22182 /* wp:polyfill */ 22183 /** 22184 * External dependencies 22185 */ 22186 22187 22188 /** 22189 * WordPress dependencies 22190 */ 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 /** 22203 * Internal dependencies 22204 */ 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 const MAX_COLUMNS = 8; 22217 const LINK_OPTIONS = [{ 22218 icon: custom_link, 22219 label: (0,external_wp_i18n_namespaceObject.__)('Link images to attachment pages'), 22220 value: LINK_DESTINATION_ATTACHMENT, 22221 noticeText: (0,external_wp_i18n_namespaceObject.__)('Attachment Pages') 22222 }, { 22223 icon: library_image, 22224 label: (0,external_wp_i18n_namespaceObject.__)('Link images to media files'), 22225 value: LINK_DESTINATION_MEDIA, 22226 noticeText: (0,external_wp_i18n_namespaceObject.__)('Media Files') 22227 }, { 22228 icon: library_fullscreen, 22229 label: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click'), 22230 value: LINK_DESTINATION_LIGHTBOX, 22231 noticeText: (0,external_wp_i18n_namespaceObject.__)('Lightbox effect'), 22232 infoText: (0,external_wp_i18n_namespaceObject.__)('Scale images with a lightbox effect') 22233 }, { 22234 icon: link_off, 22235 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option'), 22236 value: LINK_DESTINATION_NONE, 22237 noticeText: (0,external_wp_i18n_namespaceObject.__)('None') 22238 }]; 22239 const edit_ALLOWED_MEDIA_TYPES = ['image']; 22240 const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('Add media') : (0,external_wp_i18n_namespaceObject.__)('Drag and drop images, upload, or choose from your library.'); 22241 const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? { 22242 type: 'stepper' 22243 } : {}; 22244 const gallery_edit_DEFAULT_BLOCK = { 22245 name: 'core/image' 22246 }; 22247 const EMPTY_ARRAY = []; 22248 function GalleryEdit(props) { 22249 const { 22250 setAttributes, 22251 attributes, 22252 className, 22253 clientId, 22254 isSelected, 22255 insertBlocksAfter, 22256 isContentLocked, 22257 onFocus 22258 } = props; 22259 const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('blocks.core/image.lightbox'); 22260 const linkOptions = !lightboxSetting?.allowEditing ? LINK_OPTIONS.filter(option => option.value !== LINK_DESTINATION_LIGHTBOX) : LINK_OPTIONS; 22261 const { 22262 columns, 22263 imageCrop, 22264 randomOrder, 22265 linkTarget, 22266 linkTo, 22267 sizeSlug 22268 } = attributes; 22269 const { 22270 __unstableMarkNextChangeAsNotPersistent, 22271 replaceInnerBlocks, 22272 updateBlockAttributes, 22273 selectBlock 22274 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 22275 const { 22276 createSuccessNotice, 22277 createErrorNotice 22278 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 22279 const { 22280 getBlock, 22281 getSettings, 22282 innerBlockImages, 22283 blockWasJustInserted, 22284 multiGallerySelection 22285 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 22286 var _getBlock$innerBlocks; 22287 const { 22288 getBlockName, 22289 getMultiSelectedBlockClientIds, 22290 getSettings: _getSettings, 22291 getBlock: _getBlock, 22292 wasBlockJustInserted 22293 } = select(external_wp_blockEditor_namespaceObject.store); 22294 const multiSelectedClientIds = getMultiSelectedBlockClientIds(); 22295 return { 22296 getBlock: _getBlock, 22297 getSettings: _getSettings, 22298 innerBlockImages: (_getBlock$innerBlocks = _getBlock(clientId)?.innerBlocks) !== null && _getBlock$innerBlocks !== void 0 ? _getBlock$innerBlocks : EMPTY_ARRAY, 22299 blockWasJustInserted: wasBlockJustInserted(clientId, 'inserter_menu'), 22300 multiGallerySelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/gallery') 22301 }; 22302 }, [clientId]); 22303 const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages?.map(block => ({ 22304 clientId: block.clientId, 22305 id: block.attributes.id, 22306 url: block.attributes.url, 22307 attributes: block.attributes, 22308 fromSavedContent: Boolean(block.originalContent) 22309 })), [innerBlockImages]); 22310 const imageData = useGetMedia(innerBlockImages); 22311 const newImages = useGetNewImages(images, imageData); 22312 (0,external_wp_element_namespaceObject.useEffect)(() => { 22313 newImages?.forEach(newImage => { 22314 // Update the images data without creating new undo levels. 22315 __unstableMarkNextChangeAsNotPersistent(); 22316 updateBlockAttributes(newImage.clientId, { 22317 ...buildImageAttributes(newImage.attributes), 22318 id: newImage.id, 22319 align: undefined 22320 }); 22321 }); 22322 }, [newImages]); 22323 const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings); 22324 22325 /** 22326 * Determines the image attributes that should be applied to an image block 22327 * after the gallery updates. 22328 * 22329 * The gallery will receive the full collection of images when a new image 22330 * is added. As a result we need to reapply the image's original settings if 22331 * it already existed in the gallery. If the image is in fact new, we need 22332 * to apply the gallery's current settings to the image. 22333 * 22334 * @param {Object} imageAttributes Media object for the actual image. 22335 * @return {Object} Attributes to set on the new image block. 22336 */ 22337 function buildImageAttributes(imageAttributes) { 22338 const image = imageAttributes.id ? imageData.find(({ 22339 id 22340 }) => id === imageAttributes.id) : null; 22341 let newClassName; 22342 if (imageAttributes.className && imageAttributes.className !== '') { 22343 newClassName = imageAttributes.className; 22344 } 22345 let newLinkTarget; 22346 if (imageAttributes.linkTarget || imageAttributes.rel) { 22347 // When transformed from image blocks, the link destination and rel attributes are inherited. 22348 newLinkTarget = { 22349 linkTarget: imageAttributes.linkTarget, 22350 rel: imageAttributes.rel 22351 }; 22352 } else { 22353 // When an image is added, update the link destination and rel attributes according to the gallery settings 22354 newLinkTarget = getUpdatedLinkTargetSettings(linkTarget, attributes); 22355 } 22356 return { 22357 ...pickRelevantMediaFiles(image, sizeSlug), 22358 ...utils_getHrefAndDestination(image, linkTo, imageAttributes?.linkDestination), 22359 ...newLinkTarget, 22360 className: newClassName, 22361 sizeSlug, 22362 caption: imageAttributes.caption || image.caption?.raw, 22363 alt: imageAttributes.alt || image.alt_text 22364 }; 22365 } 22366 function isValidFileType(file) { 22367 // It's necessary to retrieve the media type from the raw image data for already-uploaded images on native. 22368 const nativeFileData = external_wp_element_namespaceObject.Platform.isNative && file.id ? imageData.find(({ 22369 id 22370 }) => id === file.id) : null; 22371 const mediaTypeSelector = nativeFileData ? nativeFileData?.media_type : file.type; 22372 return edit_ALLOWED_MEDIA_TYPES.some(mediaType => mediaTypeSelector?.indexOf(mediaType) === 0) || file.blob; 22373 } 22374 function updateImages(selectedImages) { 22375 const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]'; 22376 const imageArray = newFileUploads ? Array.from(selectedImages).map(file => { 22377 if (!file.url) { 22378 return { 22379 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 22380 }; 22381 } 22382 return file; 22383 }) : selectedImages; 22384 if (!imageArray.every(isValidFileType)) { 22385 createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { 22386 id: 'gallery-upload-invalid-file', 22387 type: 'snackbar' 22388 }); 22389 } 22390 const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => { 22391 if (!file.url) { 22392 return { 22393 blob: file.blob || (0,external_wp_blob_namespaceObject.createBlobURL)(file) 22394 }; 22395 } 22396 return file; 22397 }); 22398 22399 // Because we are reusing existing innerImage blocks any reordering 22400 // done in the media library will be lost so we need to reapply that ordering 22401 // once the new image blocks are merged in with existing. 22402 const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {}); 22403 const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages; 22404 const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id)); 22405 const newBlocks = newImageList.map(image => { 22406 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22407 id: image.id, 22408 blob: image.blob, 22409 url: image.url, 22410 caption: image.caption, 22411 alt: image.alt 22412 }); 22413 }); 22414 replaceInnerBlocks(clientId, existingImageBlocks.concat(newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id])); 22415 22416 // Select the first block to scroll into view when new blocks are added. 22417 if (newBlocks?.length > 0) { 22418 selectBlock(newBlocks[0].clientId); 22419 } 22420 } 22421 function onUploadError(message) { 22422 createErrorNotice(message, { 22423 type: 'snackbar' 22424 }); 22425 } 22426 function setLinkTo(value) { 22427 setAttributes({ 22428 linkTo: value 22429 }); 22430 const changedAttributes = {}; 22431 const blocks = []; 22432 getBlock(clientId).innerBlocks.forEach(block => { 22433 blocks.push(block.clientId); 22434 const image = block.attributes.id ? imageData.find(({ 22435 id 22436 }) => id === block.attributes.id) : null; 22437 changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value, false, block.attributes, lightboxSetting); 22438 }); 22439 updateBlockAttributes(blocks, changedAttributes, true); 22440 const linkToText = [...linkOptions].find(linkType => linkType.value === value); 22441 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: image size settings */ 22442 (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.noticeText), { 22443 id: 'gallery-attributes-linkTo', 22444 type: 'snackbar' 22445 }); 22446 } 22447 function setColumnsNumber(value) { 22448 setAttributes({ 22449 columns: value 22450 }); 22451 } 22452 function toggleImageCrop() { 22453 setAttributes({ 22454 imageCrop: !imageCrop 22455 }); 22456 } 22457 function toggleRandomOrder() { 22458 setAttributes({ 22459 randomOrder: !randomOrder 22460 }); 22461 } 22462 function toggleOpenInNewTab(openInNewTab) { 22463 const newLinkTarget = openInNewTab ? '_blank' : undefined; 22464 setAttributes({ 22465 linkTarget: newLinkTarget 22466 }); 22467 const changedAttributes = {}; 22468 const blocks = []; 22469 getBlock(clientId).innerBlocks.forEach(block => { 22470 blocks.push(block.clientId); 22471 changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes); 22472 }); 22473 updateBlockAttributes(blocks, changedAttributes, true); 22474 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'); 22475 createSuccessNotice(noticeText, { 22476 id: 'gallery-attributes-openInNewTab', 22477 type: 'snackbar' 22478 }); 22479 } 22480 function updateImagesSize(newSizeSlug) { 22481 setAttributes({ 22482 sizeSlug: newSizeSlug 22483 }); 22484 const changedAttributes = {}; 22485 const blocks = []; 22486 getBlock(clientId).innerBlocks.forEach(block => { 22487 blocks.push(block.clientId); 22488 const image = block.attributes.id ? imageData.find(({ 22489 id 22490 }) => id === block.attributes.id) : null; 22491 changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug); 22492 }); 22493 updateBlockAttributes(blocks, changedAttributes, true); 22494 const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug); 22495 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: image size settings */ 22496 (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), { 22497 id: 'gallery-attributes-sizeSlug', 22498 type: 'snackbar' 22499 }); 22500 } 22501 (0,external_wp_element_namespaceObject.useEffect)(() => { 22502 // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php. 22503 if (!linkTo) { 22504 __unstableMarkNextChangeAsNotPersistent(); 22505 setAttributes({ 22506 linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE 22507 }); 22508 } 22509 }, [linkTo]); 22510 const hasImages = !!images.length; 22511 const hasImageIds = hasImages && images.some(image => !!image.id); 22512 const imagesUploading = images.some(img => !external_wp_element_namespaceObject.Platform.isNative ? !img.id && img.url?.indexOf('blob:') === 0 : img.url?.indexOf('file:') === 0); 22513 22514 // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set. 22515 const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({ 22516 web: { 22517 addToGallery: false, 22518 disableMediaButtons: imagesUploading, 22519 value: {} 22520 }, 22521 native: { 22522 addToGallery: hasImageIds, 22523 isAppender: hasImages, 22524 disableMediaButtons: hasImages && !isSelected || imagesUploading, 22525 value: hasImageIds ? images : {}, 22526 autoOpenMediaUpload: !hasImages && isSelected && blockWasJustInserted, 22527 onFocus 22528 } 22529 }); 22530 const mediaPlaceholder = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 22531 handleUpload: false, 22532 icon: sharedIcon, 22533 labels: { 22534 title: (0,external_wp_i18n_namespaceObject.__)('Gallery'), 22535 instructions: PLACEHOLDER_TEXT 22536 }, 22537 onSelect: updateImages, 22538 accept: "image/*", 22539 allowedTypes: edit_ALLOWED_MEDIA_TYPES, 22540 multiple: true, 22541 onError: onUploadError, 22542 ...mediaPlaceholderProps 22543 }); 22544 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 22545 className: dist_clsx(className, 'has-nested-images') 22546 }); 22547 const nativeInnerBlockProps = external_wp_element_namespaceObject.Platform.isNative && { 22548 marginHorizontal: 0, 22549 marginVertical: 0 22550 }; 22551 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 22552 defaultBlock: gallery_edit_DEFAULT_BLOCK, 22553 directInsert: true, 22554 orientation: 'horizontal', 22555 renderAppender: false, 22556 ...nativeInnerBlockProps 22557 }); 22558 if (!hasImages) { 22559 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { 22560 ...innerBlocksProps, 22561 children: [innerBlocksProps.children, mediaPlaceholder] 22562 }); 22563 } 22564 const hasLinkTo = linkTo && linkTo !== 'none'; 22565 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 22566 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 22567 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 22568 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 22569 children: [images.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 22570 __nextHasNoMarginBottom: true, 22571 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 22572 value: columns ? columns : defaultColumnsNumber(images.length), 22573 onChange: setColumnsNumber, 22574 min: 1, 22575 max: Math.min(MAX_COLUMNS, images.length), 22576 ...MOBILE_CONTROL_PROPS_RANGE_CONTROL, 22577 required: true, 22578 __next40pxDefaultSize: true 22579 }), imageSizeOptions?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 22580 __nextHasNoMarginBottom: true, 22581 label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), 22582 help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source images.'), 22583 value: sizeSlug, 22584 options: imageSizeOptions, 22585 onChange: updateImagesSize, 22586 hideCancelButton: true, 22587 size: "__unstable-large" 22588 }), external_wp_element_namespaceObject.Platform.isNative ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 22589 __nextHasNoMarginBottom: true, 22590 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 22591 value: linkTo, 22592 onChange: setLinkTo, 22593 options: linkOptions, 22594 hideCancelButton: true, 22595 size: "__unstable-large" 22596 }) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 22597 __nextHasNoMarginBottom: true, 22598 label: (0,external_wp_i18n_namespaceObject.__)('Crop images to fit'), 22599 checked: !!imageCrop, 22600 onChange: toggleImageCrop 22601 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 22602 __nextHasNoMarginBottom: true, 22603 label: (0,external_wp_i18n_namespaceObject.__)('Randomize order'), 22604 checked: !!randomOrder, 22605 onChange: toggleRandomOrder 22606 }), hasLinkTo && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 22607 __nextHasNoMarginBottom: true, 22608 label: (0,external_wp_i18n_namespaceObject.__)('Open images in new tab'), 22609 checked: linkTarget === '_blank', 22610 onChange: toggleOpenInNewTab 22611 }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { 22612 className: "gallery-image-sizes", 22613 __nextHasNoMarginBottom: true, 22614 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { 22615 children: (0,external_wp_i18n_namespaceObject.__)('Resolution') 22616 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { 22617 className: "gallery-image-sizes__loading", 22618 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), (0,external_wp_i18n_namespaceObject.__)('Loading options…')] 22619 })] 22620 })] 22621 }) 22622 }), external_wp_element_namespaceObject.Platform.isWeb ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 22623 group: "block", 22624 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 22625 icon: library_link, 22626 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 22627 children: ({ 22628 onClose 22629 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 22630 children: linkOptions.map(linkItem => { 22631 const isOptionSelected = linkTo === linkItem.value; 22632 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 22633 isSelected: isOptionSelected, 22634 className: dist_clsx('components-dropdown-menu__menu-item', { 22635 'is-active': isOptionSelected 22636 }), 22637 iconPosition: "left", 22638 icon: linkItem.icon, 22639 onClick: () => { 22640 setLinkTo(linkItem.value); 22641 onClose(); 22642 }, 22643 role: "menuitemradio", 22644 info: linkItem.infoText, 22645 children: linkItem.label 22646 }, linkItem.value); 22647 }) 22648 }) 22649 }) 22650 }) : null, external_wp_element_namespaceObject.Platform.isWeb && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 22651 children: [!multiGallerySelection && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 22652 group: "other", 22653 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 22654 allowedTypes: edit_ALLOWED_MEDIA_TYPES, 22655 accept: "image/*", 22656 handleUpload: false, 22657 onSelect: updateImages, 22658 name: (0,external_wp_i18n_namespaceObject.__)('Add'), 22659 multiple: true, 22660 mediaIds: images.filter(image => image.id).map(image => image.id), 22661 addToGallery: hasImageIds 22662 }) 22663 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GapStyles, { 22664 blockGap: attributes.style?.spacing?.blockGap, 22665 clientId: clientId 22666 })] 22667 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Gallery, { 22668 ...props, 22669 isContentLocked: isContentLocked, 22670 images: images, 22671 mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined, 22672 blockProps: innerBlocksProps, 22673 insertBlocksAfter: insertBlocksAfter, 22674 multiGallerySelection: multiGallerySelection 22675 })] 22676 }); 22677 } 22678 22679 ;// ./node_modules/@wordpress/block-library/build-module/gallery/save.js 22680 /** 22681 * External dependencies 22682 */ 22683 22684 22685 /** 22686 * WordPress dependencies 22687 */ 22688 22689 22690 function saveWithInnerBlocks({ 22691 attributes 22692 }) { 22693 const { 22694 caption, 22695 columns, 22696 imageCrop 22697 } = attributes; 22698 const className = dist_clsx('has-nested-images', { 22699 [`columns-$columns}`]: columns !== undefined, 22700 [`columns-default`]: columns === undefined, 22701 'is-cropped': imageCrop 22702 }); 22703 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 22704 className 22705 }); 22706 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 22707 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 22708 ...innerBlocksProps, 22709 children: [innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 22710 tagName: "figcaption", 22711 className: dist_clsx('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), 22712 value: caption 22713 })] 22714 }); 22715 } 22716 22717 ;// ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js 22718 /* wp:polyfill */ 22719 /** 22720 * WordPress dependencies 22721 */ 22722 22723 22724 22725 22726 /** 22727 * Internal dependencies 22728 */ 22729 22730 const parseShortcodeIds = ids => { 22731 if (!ids) { 22732 return []; 22733 } 22734 return ids.split(',').map(id => parseInt(id, 10)); 22735 }; 22736 22737 /** 22738 * Third party block plugins don't have an easy way to detect if the 22739 * innerBlocks version of the Gallery is running when they run a 22740 * 3rdPartyBlock -> GalleryBlock transform so this transform filter 22741 * will handle this. Once the innerBlocks version is the default 22742 * in a core release, this could be deprecated and removed after 22743 * plugin authors have been given time to update transforms. 22744 * 22745 * @typedef {Object} Attributes 22746 * @typedef {Object} Block 22747 * @property {Attributes} attributes The attributes of the block. 22748 * @param {Block} block The transformed block. 22749 * @return {Block} The transformed block. 22750 */ 22751 function updateThirdPartyTransformToGallery(block) { 22752 if (block.name === 'core/gallery' && block.attributes?.images.length > 0) { 22753 const innerBlocks = block.attributes.images.map(({ 22754 url, 22755 id, 22756 alt 22757 }) => { 22758 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22759 url, 22760 id: id ? parseInt(id, 10) : null, 22761 alt, 22762 sizeSlug: block.attributes.sizeSlug, 22763 linkDestination: block.attributes.linkDestination 22764 }); 22765 }); 22766 delete block.attributes.ids; 22767 delete block.attributes.images; 22768 block.innerBlocks = innerBlocks; 22769 } 22770 return block; 22771 } 22772 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery); 22773 22774 /** 22775 * Third party block plugins don't have an easy way to detect if the 22776 * innerBlocks version of the Gallery is running when they run a 22777 * GalleryBlock -> 3rdPartyBlock transform so this transform filter 22778 * will handle this. Once the innerBlocks version is the default 22779 * in a core release, this could be deprecated and removed after 22780 * plugin authors have been given time to update transforms. 22781 * 22782 * @typedef {Object} Attributes 22783 * @typedef {Object} Block 22784 * @property {Attributes} attributes The attributes of the block. 22785 * @param {Block} toBlock The block to transform to. 22786 * @param {Block[]} fromBlocks The blocks to transform from. 22787 * @return {Block} The transformed block. 22788 */ 22789 function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { 22790 const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks]; 22791 const galleryBlock = from.find(transformedBlock => transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !transformedBlock.attributes.images?.length > 0 && !toBlock.name.includes('core/')); 22792 if (galleryBlock) { 22793 const images = galleryBlock.innerBlocks.map(({ 22794 attributes: { 22795 url, 22796 id, 22797 alt 22798 } 22799 }) => ({ 22800 url, 22801 id: id ? parseInt(id, 10) : null, 22802 alt 22803 })); 22804 const ids = images.map(({ 22805 id 22806 }) => id); 22807 galleryBlock.attributes.images = images; 22808 galleryBlock.attributes.ids = ids; 22809 } 22810 return toBlock; 22811 } 22812 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery); 22813 const gallery_transforms_transforms = { 22814 from: [{ 22815 type: 'block', 22816 isMultiBlock: true, 22817 blocks: ['core/image'], 22818 transform: attributes => { 22819 // Init the align and size from the first item which may be either the placeholder or an image. 22820 let { 22821 align, 22822 sizeSlug 22823 } = attributes[0]; 22824 // Loop through all the images and check if they have the same align and size. 22825 align = attributes.every(attribute => attribute.align === align) ? align : undefined; 22826 sizeSlug = attributes.every(attribute => attribute.sizeSlug === sizeSlug) ? sizeSlug : undefined; 22827 const validImages = attributes.filter(({ 22828 url 22829 }) => url); 22830 const innerBlocks = validImages.map(image => { 22831 // Gallery images can't currently be resized so make sure height and width are undefined. 22832 image.width = undefined; 22833 image.height = undefined; 22834 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image); 22835 }); 22836 return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22837 align, 22838 sizeSlug 22839 }, innerBlocks); 22840 } 22841 }, { 22842 type: 'shortcode', 22843 tag: 'gallery', 22844 transform({ 22845 named: { 22846 ids, 22847 columns = 3, 22848 link, 22849 orderby 22850 } 22851 }) { 22852 const imageIds = parseShortcodeIds(ids).map(id => parseInt(id, 10)); 22853 let linkTo = LINK_DESTINATION_NONE; 22854 if (link === 'post') { 22855 linkTo = LINK_DESTINATION_ATTACHMENT; 22856 } else if (link === 'file') { 22857 linkTo = LINK_DESTINATION_MEDIA; 22858 } 22859 const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { 22860 columns: parseInt(columns, 10), 22861 linkTo, 22862 randomOrder: orderby === 'rand' 22863 }, imageIds.map(imageId => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22864 id: imageId 22865 }))); 22866 return galleryBlock; 22867 }, 22868 isMatch({ 22869 named 22870 }) { 22871 return undefined !== named.ids; 22872 } 22873 }, { 22874 // When created by drag and dropping multiple files on an insertion point. Because multiple 22875 // files must not be transformed to a gallery when dropped within a gallery there is another transform 22876 // within the image block to handle that case. Therefore this transform has to have priority 1 22877 // set so that it overrides the image block transformation when multiple images are dropped outside 22878 // of a gallery block. 22879 type: 'files', 22880 priority: 1, 22881 isMatch(files) { 22882 return files.length !== 1 && files.every(file => file.type.indexOf('image/') === 0); 22883 }, 22884 transform(files) { 22885 const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22886 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 22887 })); 22888 return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks); 22889 } 22890 }], 22891 to: [{ 22892 type: 'block', 22893 blocks: ['core/image'], 22894 transform: ({ 22895 align 22896 }, innerBlocks) => { 22897 if (innerBlocks.length > 0) { 22898 return innerBlocks.map(({ 22899 attributes: { 22900 url, 22901 alt, 22902 caption, 22903 title, 22904 href, 22905 rel, 22906 linkClass, 22907 id, 22908 sizeSlug: imageSizeSlug, 22909 linkDestination, 22910 linkTarget, 22911 anchor, 22912 className 22913 } 22914 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22915 align, 22916 url, 22917 alt, 22918 caption, 22919 title, 22920 href, 22921 rel, 22922 linkClass, 22923 id, 22924 sizeSlug: imageSizeSlug, 22925 linkDestination, 22926 linkTarget, 22927 anchor, 22928 className 22929 })); 22930 } 22931 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 22932 align 22933 }); 22934 } 22935 }] 22936 }; 22937 /* harmony default export */ const gallery_transforms = (gallery_transforms_transforms); 22938 22939 ;// ./node_modules/@wordpress/block-library/build-module/gallery/index.js 22940 /** 22941 * WordPress dependencies 22942 */ 22943 22944 22945 /** 22946 * Internal dependencies 22947 */ 22948 22949 22950 22951 const gallery_metadata = { 22952 $schema: "https://schemas.wp.org/trunk/block.json", 22953 apiVersion: 3, 22954 name: "core/gallery", 22955 title: "Gallery", 22956 category: "media", 22957 allowedBlocks: ["core/image"], 22958 description: "Display multiple images in a rich gallery.", 22959 keywords: ["images", "photos"], 22960 textdomain: "default", 22961 attributes: { 22962 images: { 22963 type: "array", 22964 "default": [], 22965 source: "query", 22966 selector: ".blocks-gallery-item", 22967 query: { 22968 url: { 22969 type: "string", 22970 source: "attribute", 22971 selector: "img", 22972 attribute: "src" 22973 }, 22974 fullUrl: { 22975 type: "string", 22976 source: "attribute", 22977 selector: "img", 22978 attribute: "data-full-url" 22979 }, 22980 link: { 22981 type: "string", 22982 source: "attribute", 22983 selector: "img", 22984 attribute: "data-link" 22985 }, 22986 alt: { 22987 type: "string", 22988 source: "attribute", 22989 selector: "img", 22990 attribute: "alt", 22991 "default": "" 22992 }, 22993 id: { 22994 type: "string", 22995 source: "attribute", 22996 selector: "img", 22997 attribute: "data-id" 22998 }, 22999 caption: { 23000 type: "rich-text", 23001 source: "rich-text", 23002 selector: ".blocks-gallery-item__caption" 23003 } 23004 } 23005 }, 23006 ids: { 23007 type: "array", 23008 items: { 23009 type: "number" 23010 }, 23011 "default": [] 23012 }, 23013 shortCodeTransforms: { 23014 type: "array", 23015 items: { 23016 type: "object" 23017 }, 23018 "default": [] 23019 }, 23020 columns: { 23021 type: "number", 23022 minimum: 1, 23023 maximum: 8 23024 }, 23025 caption: { 23026 type: "rich-text", 23027 source: "rich-text", 23028 selector: ".blocks-gallery-caption" 23029 }, 23030 imageCrop: { 23031 type: "boolean", 23032 "default": true 23033 }, 23034 randomOrder: { 23035 type: "boolean", 23036 "default": false 23037 }, 23038 fixedHeight: { 23039 type: "boolean", 23040 "default": true 23041 }, 23042 linkTarget: { 23043 type: "string" 23044 }, 23045 linkTo: { 23046 type: "string" 23047 }, 23048 sizeSlug: { 23049 type: "string", 23050 "default": "large" 23051 }, 23052 allowResize: { 23053 type: "boolean", 23054 "default": false 23055 } 23056 }, 23057 providesContext: { 23058 allowResize: "allowResize", 23059 imageCrop: "imageCrop", 23060 fixedHeight: "fixedHeight" 23061 }, 23062 supports: { 23063 anchor: true, 23064 align: true, 23065 __experimentalBorder: { 23066 radius: true, 23067 color: true, 23068 width: true, 23069 style: true, 23070 __experimentalDefaultControls: { 23071 color: true, 23072 radius: true 23073 } 23074 }, 23075 html: false, 23076 units: ["px", "em", "rem", "vh", "vw"], 23077 spacing: { 23078 margin: true, 23079 padding: true, 23080 blockGap: ["horizontal", "vertical"], 23081 __experimentalSkipSerialization: ["blockGap"], 23082 __experimentalDefaultControls: { 23083 blockGap: true, 23084 margin: false, 23085 padding: false 23086 } 23087 }, 23088 color: { 23089 text: false, 23090 background: true, 23091 gradients: true 23092 }, 23093 layout: { 23094 allowSwitching: false, 23095 allowInheriting: false, 23096 allowEditing: false, 23097 "default": { 23098 type: "flex" 23099 } 23100 }, 23101 interactivity: { 23102 clientNavigation: true 23103 } 23104 }, 23105 editorStyle: "wp-block-gallery-editor", 23106 style: "wp-block-gallery" 23107 }; 23108 23109 23110 const { 23111 name: gallery_name 23112 } = gallery_metadata; 23113 23114 const gallery_settings = { 23115 icon: library_gallery, 23116 example: { 23117 attributes: { 23118 columns: 2 23119 }, 23120 innerBlocks: [{ 23121 name: 'core/image', 23122 attributes: { 23123 url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg' 23124 } 23125 }, { 23126 name: 'core/image', 23127 attributes: { 23128 url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg' 23129 } 23130 }] 23131 }, 23132 transforms: gallery_transforms, 23133 edit: GalleryEdit, 23134 save: saveWithInnerBlocks, 23135 deprecated: gallery_deprecated 23136 }; 23137 const gallery_init = () => initBlock({ 23138 name: gallery_name, 23139 metadata: gallery_metadata, 23140 settings: gallery_settings 23141 }); 23142 23143 ;// ./node_modules/@wordpress/block-library/build-module/group/deprecated.js 23144 /** 23145 * External dependencies 23146 */ 23147 23148 23149 /** 23150 * WordPress dependencies 23151 */ 23152 23153 23154 const migrateAttributes = attributes => { 23155 if (!attributes.tagName) { 23156 attributes = { 23157 ...attributes, 23158 tagName: 'div' 23159 }; 23160 } 23161 if (!attributes.customTextColor && !attributes.customBackgroundColor) { 23162 return attributes; 23163 } 23164 const style = { 23165 color: {} 23166 }; 23167 if (attributes.customTextColor) { 23168 style.color.text = attributes.customTextColor; 23169 } 23170 if (attributes.customBackgroundColor) { 23171 style.color.background = attributes.customBackgroundColor; 23172 } 23173 const { 23174 customTextColor, 23175 customBackgroundColor, 23176 ...restAttributes 23177 } = attributes; 23178 return { 23179 ...restAttributes, 23180 style 23181 }; 23182 }; 23183 const group_deprecated_deprecated = [ 23184 // Version with default layout. 23185 { 23186 attributes: { 23187 tagName: { 23188 type: 'string', 23189 default: 'div' 23190 }, 23191 templateLock: { 23192 type: ['string', 'boolean'], 23193 enum: ['all', 'insert', false] 23194 } 23195 }, 23196 supports: { 23197 __experimentalOnEnter: true, 23198 __experimentalSettings: true, 23199 align: ['wide', 'full'], 23200 anchor: true, 23201 ariaLabel: true, 23202 html: false, 23203 color: { 23204 gradients: true, 23205 link: true, 23206 __experimentalDefaultControls: { 23207 background: true, 23208 text: true 23209 } 23210 }, 23211 spacing: { 23212 margin: ['top', 'bottom'], 23213 padding: true, 23214 blockGap: true, 23215 __experimentalDefaultControls: { 23216 padding: true, 23217 blockGap: true 23218 } 23219 }, 23220 __experimentalBorder: { 23221 color: true, 23222 radius: true, 23223 style: true, 23224 width: true, 23225 __experimentalDefaultControls: { 23226 color: true, 23227 radius: true, 23228 style: true, 23229 width: true 23230 } 23231 }, 23232 typography: { 23233 fontSize: true, 23234 lineHeight: true, 23235 __experimentalFontStyle: true, 23236 __experimentalFontWeight: true, 23237 __experimentalLetterSpacing: true, 23238 __experimentalTextTransform: true, 23239 __experimentalDefaultControls: { 23240 fontSize: true 23241 } 23242 }, 23243 layout: true 23244 }, 23245 save({ 23246 attributes: { 23247 tagName: Tag 23248 } 23249 }) { 23250 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 23251 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) 23252 }); 23253 }, 23254 isEligible: ({ 23255 layout 23256 }) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained', 23257 migrate: attributes => { 23258 const { 23259 layout = null 23260 } = attributes; 23261 if (layout?.inherit || layout?.contentSize) { 23262 return { 23263 ...attributes, 23264 layout: { 23265 ...layout, 23266 type: 'constrained' 23267 } 23268 }; 23269 } 23270 } 23271 }, 23272 // Version of the block with the double div. 23273 { 23274 attributes: { 23275 tagName: { 23276 type: 'string', 23277 default: 'div' 23278 }, 23279 templateLock: { 23280 type: ['string', 'boolean'], 23281 enum: ['all', 'insert', false] 23282 } 23283 }, 23284 supports: { 23285 align: ['wide', 'full'], 23286 anchor: true, 23287 color: { 23288 gradients: true, 23289 link: true 23290 }, 23291 spacing: { 23292 padding: true 23293 }, 23294 __experimentalBorder: { 23295 radius: true 23296 } 23297 }, 23298 save({ 23299 attributes 23300 }) { 23301 const { 23302 tagName: Tag 23303 } = attributes; 23304 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 23305 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 23306 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23307 className: "wp-block-group__inner-container", 23308 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 23309 }) 23310 }); 23311 } 23312 }, 23313 // Version of the block without global styles support 23314 { 23315 attributes: { 23316 backgroundColor: { 23317 type: 'string' 23318 }, 23319 customBackgroundColor: { 23320 type: 'string' 23321 }, 23322 textColor: { 23323 type: 'string' 23324 }, 23325 customTextColor: { 23326 type: 'string' 23327 } 23328 }, 23329 supports: { 23330 align: ['wide', 'full'], 23331 anchor: true, 23332 html: false 23333 }, 23334 migrate: migrateAttributes, 23335 save({ 23336 attributes 23337 }) { 23338 const { 23339 backgroundColor, 23340 customBackgroundColor, 23341 textColor, 23342 customTextColor 23343 } = attributes; 23344 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 23345 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 23346 const className = dist_clsx(backgroundClass, textClass, { 23347 'has-text-color': textColor || customTextColor, 23348 'has-background': backgroundColor || customBackgroundColor 23349 }); 23350 const styles = { 23351 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 23352 color: textClass ? undefined : customTextColor 23353 }; 23354 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23355 className: className, 23356 style: styles, 23357 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23358 className: "wp-block-group__inner-container", 23359 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 23360 }) 23361 }); 23362 } 23363 }, 23364 // Version of the group block with a bug that made text color class not applied. 23365 { 23366 attributes: { 23367 backgroundColor: { 23368 type: 'string' 23369 }, 23370 customBackgroundColor: { 23371 type: 'string' 23372 }, 23373 textColor: { 23374 type: 'string' 23375 }, 23376 customTextColor: { 23377 type: 'string' 23378 } 23379 }, 23380 migrate: migrateAttributes, 23381 supports: { 23382 align: ['wide', 'full'], 23383 anchor: true, 23384 html: false 23385 }, 23386 save({ 23387 attributes 23388 }) { 23389 const { 23390 backgroundColor, 23391 customBackgroundColor, 23392 textColor, 23393 customTextColor 23394 } = attributes; 23395 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 23396 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 23397 const className = dist_clsx(backgroundClass, { 23398 'has-text-color': textColor || customTextColor, 23399 'has-background': backgroundColor || customBackgroundColor 23400 }); 23401 const styles = { 23402 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 23403 color: textClass ? undefined : customTextColor 23404 }; 23405 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23406 className: className, 23407 style: styles, 23408 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23409 className: "wp-block-group__inner-container", 23410 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 23411 }) 23412 }); 23413 } 23414 }, 23415 // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. 23416 { 23417 attributes: { 23418 backgroundColor: { 23419 type: 'string' 23420 }, 23421 customBackgroundColor: { 23422 type: 'string' 23423 } 23424 }, 23425 supports: { 23426 align: ['wide', 'full'], 23427 anchor: true, 23428 html: false 23429 }, 23430 migrate: migrateAttributes, 23431 save({ 23432 attributes 23433 }) { 23434 const { 23435 backgroundColor, 23436 customBackgroundColor 23437 } = attributes; 23438 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 23439 const className = dist_clsx(backgroundClass, { 23440 'has-background': backgroundColor || customBackgroundColor 23441 }); 23442 const styles = { 23443 backgroundColor: backgroundClass ? undefined : customBackgroundColor 23444 }; 23445 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23446 className: className, 23447 style: styles, 23448 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 23449 }); 23450 } 23451 }]; 23452 /* harmony default export */ const group_deprecated = (group_deprecated_deprecated); 23453 23454 ;// ./node_modules/@wordpress/block-library/build-module/group/placeholder.js 23455 /* wp:polyfill */ 23456 /** 23457 * WordPress dependencies 23458 */ 23459 23460 23461 23462 23463 23464 23465 23466 /** 23467 * Returns a custom variation icon. 23468 * 23469 * @param {string} name The block variation name. 23470 * 23471 * @return {JSX.Element} The SVG element. 23472 */ 23473 23474 const getGroupPlaceholderIcons = (name = 'group') => { 23475 const icons = { 23476 group: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 23477 xmlns: "http://www.w3.org/2000/svg", 23478 width: "48", 23479 height: "48", 23480 viewBox: "0 0 48 48", 23481 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 23482 d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" 23483 }) 23484 }), 23485 'group-row': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 23486 xmlns: "http://www.w3.org/2000/svg", 23487 width: "48", 23488 height: "48", 23489 viewBox: "0 0 48 48", 23490 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 23491 d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" 23492 }) 23493 }), 23494 'group-stack': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 23495 xmlns: "http://www.w3.org/2000/svg", 23496 width: "48", 23497 height: "48", 23498 viewBox: "0 0 48 48", 23499 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 23500 d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm0 17a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Z" 23501 }) 23502 }), 23503 'group-grid': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 23504 xmlns: "http://www.w3.org/2000/svg", 23505 width: "48", 23506 height: "48", 23507 viewBox: "0 0 48 48", 23508 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 23509 d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10ZM0 27a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V27Z" 23510 }) 23511 }) 23512 }; 23513 return icons?.[name]; 23514 }; 23515 23516 /** 23517 * A custom hook to tell the Group block whether to show the variation placeholder. 23518 * 23519 * @param {Object} props Arguments to pass to hook. 23520 * @param {Object} [props.attributes] The block's attributes. 23521 * @param {string} [props.usedLayoutType] The block's current layout type. 23522 * @param {boolean} [props.hasInnerBlocks] Whether the block has inner blocks. 23523 * 23524 * @return {[boolean, Function]} A state value and setter function. 23525 */ 23526 function useShouldShowPlaceHolder({ 23527 attributes = { 23528 style: undefined, 23529 backgroundColor: undefined, 23530 textColor: undefined, 23531 fontSize: undefined 23532 }, 23533 usedLayoutType = '', 23534 hasInnerBlocks = false 23535 }) { 23536 const { 23537 style, 23538 backgroundColor, 23539 textColor, 23540 fontSize 23541 } = attributes; 23542 /* 23543 * Shows the placeholder when no known styles are set, 23544 * or when a non-default layout has been selected. 23545 * Should the Group block support more style presets in the 23546 * future, e.g., attributes.spacingSize, we can add them to the 23547 * condition. 23548 */ 23549 const [showPlaceholder, setShowPlaceholder] = (0,external_wp_element_namespaceObject.useState)(!hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style && usedLayoutType !== 'flex' && usedLayoutType !== 'grid'); 23550 (0,external_wp_element_namespaceObject.useEffect)(() => { 23551 if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style || usedLayoutType === 'flex') { 23552 setShowPlaceholder(false); 23553 } 23554 }, [backgroundColor, fontSize, textColor, style, usedLayoutType, hasInnerBlocks]); 23555 return [showPlaceholder, setShowPlaceholder]; 23556 } 23557 23558 /** 23559 * Display group variations if none is selected. 23560 * 23561 * @param {Object} props Component props. 23562 * @param {string} props.name The block's name. 23563 * @param {Function} props.onSelect Function to set block's attributes. 23564 * 23565 * @return {JSX.Element} The placeholder. 23566 */ 23567 function GroupPlaceHolder({ 23568 name, 23569 onSelect 23570 }) { 23571 const variations = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockVariations(name, 'block'), [name]); 23572 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 23573 className: 'wp-block-group__placeholder' 23574 }); 23575 (0,external_wp_element_namespaceObject.useEffect)(() => { 23576 if (variations && variations.length === 1) { 23577 onSelect(variations[0]); 23578 } 23579 }, [onSelect, variations]); 23580 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23581 ...blockProps, 23582 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 23583 instructions: (0,external_wp_i18n_namespaceObject.__)('Group blocks together. Select a layout:'), 23584 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 23585 role: "list", 23586 className: "wp-block-group-placeholder__variations", 23587 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block variations'), 23588 children: variations.map(variation => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 23589 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 23590 __next40pxDefaultSize: true, 23591 variant: "tertiary", 23592 icon: getGroupPlaceholderIcons(variation.name), 23593 iconSize: 48, 23594 onClick: () => onSelect(variation), 23595 className: "wp-block-group-placeholder__variation-button", 23596 label: `$variation.title}: $variation.description}` 23597 }) 23598 }, variation.name)) 23599 }) 23600 }) 23601 }); 23602 } 23603 /* harmony default export */ const placeholder = (GroupPlaceHolder); 23604 23605 ;// ./node_modules/@wordpress/block-library/build-module/group/edit.js 23606 /** 23607 * WordPress dependencies 23608 */ 23609 23610 23611 23612 23613 23614 23615 23616 /** 23617 * Internal dependencies 23618 */ 23619 23620 23621 23622 /** 23623 * Render inspector controls for the Group block. 23624 * 23625 * @param {Object} props Component props. 23626 * @param {string} props.tagName The HTML tag name. 23627 * @param {Function} props.onSelectTagName onChange function for the SelectControl. 23628 * 23629 * @return {JSX.Element} The control group. 23630 */ 23631 23632 function GroupEditControls({ 23633 tagName, 23634 onSelectTagName 23635 }) { 23636 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 23637 group: "advanced", 23638 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 23639 __nextHasNoMarginBottom: true, 23640 __next40pxDefaultSize: true, 23641 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 23642 options: [{ 23643 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 23644 value: 'div' 23645 }, { 23646 label: '<header>', 23647 value: 'header' 23648 }, { 23649 label: '<main>', 23650 value: 'main' 23651 }, { 23652 label: '<section>', 23653 value: 'section' 23654 }, { 23655 label: '<article>', 23656 value: 'article' 23657 }, { 23658 label: '<aside>', 23659 value: 'aside' 23660 }, { 23661 label: '<footer>', 23662 value: 'footer' 23663 }], 23664 value: tagName, 23665 onChange: onSelectTagName, 23666 help: htmlElementMessages[tagName] 23667 }) 23668 }); 23669 } 23670 function GroupEdit({ 23671 attributes, 23672 name, 23673 setAttributes, 23674 clientId 23675 }) { 23676 const { 23677 hasInnerBlocks, 23678 themeSupportsLayout 23679 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 23680 const { 23681 getBlock, 23682 getSettings 23683 } = select(external_wp_blockEditor_namespaceObject.store); 23684 const block = getBlock(clientId); 23685 return { 23686 hasInnerBlocks: !!(block && block.innerBlocks.length), 23687 themeSupportsLayout: getSettings()?.supportsLayout 23688 }; 23689 }, [clientId]); 23690 const { 23691 tagName: TagName = 'div', 23692 templateLock, 23693 allowedBlocks, 23694 layout = {} 23695 } = attributes; 23696 23697 // Layout settings. 23698 const { 23699 type = 'default' 23700 } = layout; 23701 const layoutSupportEnabled = themeSupportsLayout || type === 'flex' || type === 'grid'; 23702 23703 // Hooks. 23704 const ref = (0,external_wp_element_namespaceObject.useRef)(); 23705 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 23706 ref 23707 }); 23708 const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({ 23709 attributes, 23710 usedLayoutType: type, 23711 hasInnerBlocks 23712 }); 23713 23714 // Default to the regular appender being rendered. 23715 let renderAppender; 23716 if (showPlaceholder) { 23717 // In the placeholder state, ensure the appender is not rendered. 23718 // This is needed because `...innerBlocksProps` is used in the placeholder 23719 // state so that blocks can dragged onto the placeholder area 23720 // from both the list view and in the editor canvas. 23721 renderAppender = false; 23722 } else if (!hasInnerBlocks) { 23723 // When there is no placeholder, but the block is also empty, 23724 // use the larger button appender. 23725 renderAppender = external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; 23726 } 23727 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : { 23728 className: 'wp-block-group__inner-container' 23729 }, { 23730 dropZoneElement: ref.current, 23731 templateLock, 23732 allowedBlocks, 23733 renderAppender 23734 }); 23735 const { 23736 selectBlock 23737 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 23738 const selectVariation = nextVariation => { 23739 setAttributes(nextVariation.attributes); 23740 selectBlock(clientId, -1); 23741 setShowPlaceholder(false); 23742 }; 23743 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 23744 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupEditControls, { 23745 tagName: TagName, 23746 onSelectTagName: value => setAttributes({ 23747 tagName: value 23748 }) 23749 }), showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { 23750 children: [innerBlocksProps.children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder, { 23751 name: name, 23752 onSelect: selectVariation 23753 })] 23754 }), layoutSupportEnabled && !showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 23755 ...innerBlocksProps 23756 }), !layoutSupportEnabled && !showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 23757 ...blockProps, 23758 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 23759 ...innerBlocksProps 23760 }) 23761 })] 23762 }); 23763 } 23764 /* harmony default export */ const group_edit = (GroupEdit); 23765 23766 ;// ./node_modules/@wordpress/block-library/build-module/group/save.js 23767 /** 23768 * WordPress dependencies 23769 */ 23770 23771 23772 function group_save_save({ 23773 attributes: { 23774 tagName: Tag 23775 } 23776 }) { 23777 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 23778 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) 23779 }); 23780 } 23781 23782 ;// ./node_modules/@wordpress/block-library/build-module/group/transforms.js 23783 /* wp:polyfill */ 23784 /** 23785 * WordPress dependencies 23786 */ 23787 23788 const group_transforms_transforms = { 23789 from: [{ 23790 type: 'block', 23791 isMultiBlock: true, 23792 blocks: ['*'], 23793 __experimentalConvert(blocks) { 23794 const alignments = ['wide', 'full']; 23795 23796 // Determine the widest setting of all the blocks to be grouped 23797 const widestAlignment = blocks.reduce((accumulator, block) => { 23798 const { 23799 align 23800 } = block.attributes; 23801 return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator; 23802 }, undefined); 23803 23804 // Clone the Blocks to be Grouped 23805 // Failing to create new block references causes the original blocks 23806 // to be replaced in the switchToBlockType call thereby meaning they 23807 // are removed both from their original location and within the 23808 // new group block. 23809 const groupInnerBlocks = blocks.map(block => { 23810 return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks); 23811 }); 23812 return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 23813 align: widestAlignment, 23814 layout: { 23815 type: 'constrained' 23816 } 23817 }, groupInnerBlocks); 23818 } 23819 }] 23820 }; 23821 /* harmony default export */ const group_transforms = (group_transforms_transforms); 23822 23823 ;// ./node_modules/@wordpress/icons/build-module/library/row.js 23824 /** 23825 * WordPress dependencies 23826 */ 23827 23828 23829 const row = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 23830 xmlns: "http://www.w3.org/2000/svg", 23831 viewBox: "0 0 24 24", 23832 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 23833 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" 23834 }) 23835 }); 23836 /* harmony default export */ const library_row = (row); 23837 23838 ;// ./node_modules/@wordpress/icons/build-module/library/stack.js 23839 /** 23840 * WordPress dependencies 23841 */ 23842 23843 23844 const stack = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 23845 xmlns: "http://www.w3.org/2000/svg", 23846 viewBox: "0 0 24 24", 23847 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 23848 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" 23849 }) 23850 }); 23851 /* harmony default export */ const library_stack = (stack); 23852 23853 ;// ./node_modules/@wordpress/icons/build-module/library/grid.js 23854 /** 23855 * WordPress dependencies 23856 */ 23857 23858 23859 const grid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 23860 xmlns: "http://www.w3.org/2000/svg", 23861 viewBox: "0 0 24 24", 23862 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 23863 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", 23864 fillRule: "evenodd", 23865 clipRule: "evenodd" 23866 }) 23867 }); 23868 /* harmony default export */ const library_grid = (grid); 23869 23870 ;// ./node_modules/@wordpress/block-library/build-module/group/variations.js 23871 /** 23872 * WordPress dependencies 23873 */ 23874 23875 23876 const example = { 23877 innerBlocks: [{ 23878 name: 'core/paragraph', 23879 attributes: { 23880 customTextColor: '#cf2e2e', 23881 fontSize: 'large', 23882 content: (0,external_wp_i18n_namespaceObject.__)('One.') 23883 } 23884 }, { 23885 name: 'core/paragraph', 23886 attributes: { 23887 customTextColor: '#ff6900', 23888 fontSize: 'large', 23889 content: (0,external_wp_i18n_namespaceObject.__)('Two.') 23890 } 23891 }, { 23892 name: 'core/paragraph', 23893 attributes: { 23894 customTextColor: '#fcb900', 23895 fontSize: 'large', 23896 content: (0,external_wp_i18n_namespaceObject.__)('Three.') 23897 } 23898 }, { 23899 name: 'core/paragraph', 23900 attributes: { 23901 customTextColor: '#00d084', 23902 fontSize: 'large', 23903 content: (0,external_wp_i18n_namespaceObject.__)('Four.') 23904 } 23905 }, { 23906 name: 'core/paragraph', 23907 attributes: { 23908 customTextColor: '#0693e3', 23909 fontSize: 'large', 23910 content: (0,external_wp_i18n_namespaceObject.__)('Five.') 23911 } 23912 }, { 23913 name: 'core/paragraph', 23914 attributes: { 23915 customTextColor: '#9b51e0', 23916 fontSize: 'large', 23917 content: (0,external_wp_i18n_namespaceObject.__)('Six.') 23918 } 23919 }] 23920 }; 23921 const group_variations_variations = [{ 23922 name: 'group', 23923 title: (0,external_wp_i18n_namespaceObject.__)('Group'), 23924 description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a container.'), 23925 attributes: { 23926 layout: { 23927 type: 'constrained' 23928 } 23929 }, 23930 isDefault: true, 23931 scope: ['block', 'inserter', 'transform'], 23932 isActive: blockAttributes => !blockAttributes.layout || !blockAttributes.layout?.type || blockAttributes.layout?.type === 'default' || blockAttributes.layout?.type === 'constrained', 23933 icon: library_group 23934 }, { 23935 name: 'group-row', 23936 title: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'), 23937 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'), 23938 attributes: { 23939 layout: { 23940 type: 'flex', 23941 flexWrap: 'nowrap' 23942 } 23943 }, 23944 scope: ['block', 'inserter', 'transform'], 23945 isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && (!blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal'), 23946 icon: library_row, 23947 example 23948 }, { 23949 name: 'group-stack', 23950 title: (0,external_wp_i18n_namespaceObject.__)('Stack'), 23951 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'), 23952 attributes: { 23953 layout: { 23954 type: 'flex', 23955 orientation: 'vertical' 23956 } 23957 }, 23958 scope: ['block', 'inserter', 'transform'], 23959 isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical', 23960 icon: library_stack, 23961 example 23962 }, { 23963 name: 'group-grid', 23964 title: (0,external_wp_i18n_namespaceObject.__)('Grid'), 23965 description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks in a grid.'), 23966 attributes: { 23967 layout: { 23968 type: 'grid' 23969 } 23970 }, 23971 scope: ['block', 'inserter', 'transform'], 23972 isActive: blockAttributes => blockAttributes.layout?.type === 'grid', 23973 icon: library_grid, 23974 example 23975 }]; 23976 /* harmony default export */ const group_variations = (group_variations_variations); 23977 23978 ;// ./node_modules/@wordpress/block-library/build-module/group/index.js 23979 /** 23980 * WordPress dependencies 23981 */ 23982 23983 23984 23985 /** 23986 * Internal dependencies 23987 */ 23988 23989 23990 23991 const group_metadata = { 23992 $schema: "https://schemas.wp.org/trunk/block.json", 23993 apiVersion: 3, 23994 name: "core/group", 23995 title: "Group", 23996 category: "design", 23997 description: "Gather blocks in a layout container.", 23998 keywords: ["container", "wrapper", "row", "section"], 23999 textdomain: "default", 24000 attributes: { 24001 tagName: { 24002 type: "string", 24003 "default": "div" 24004 }, 24005 templateLock: { 24006 type: ["string", "boolean"], 24007 "enum": ["all", "insert", "contentOnly", false] 24008 }, 24009 allowedBlocks: { 24010 type: "array" 24011 } 24012 }, 24013 supports: { 24014 __experimentalOnEnter: true, 24015 __experimentalOnMerge: true, 24016 __experimentalSettings: true, 24017 align: ["wide", "full"], 24018 anchor: true, 24019 ariaLabel: true, 24020 html: false, 24021 background: { 24022 backgroundImage: true, 24023 backgroundSize: true, 24024 __experimentalDefaultControls: { 24025 backgroundImage: true 24026 } 24027 }, 24028 color: { 24029 gradients: true, 24030 heading: true, 24031 button: true, 24032 link: true, 24033 __experimentalDefaultControls: { 24034 background: true, 24035 text: true 24036 } 24037 }, 24038 shadow: true, 24039 spacing: { 24040 margin: ["top", "bottom"], 24041 padding: true, 24042 blockGap: true, 24043 __experimentalDefaultControls: { 24044 padding: true, 24045 blockGap: true 24046 } 24047 }, 24048 dimensions: { 24049 minHeight: true 24050 }, 24051 __experimentalBorder: { 24052 color: true, 24053 radius: true, 24054 style: true, 24055 width: true, 24056 __experimentalDefaultControls: { 24057 color: true, 24058 radius: true, 24059 style: true, 24060 width: true 24061 } 24062 }, 24063 position: { 24064 sticky: true 24065 }, 24066 typography: { 24067 fontSize: true, 24068 lineHeight: true, 24069 __experimentalFontFamily: true, 24070 __experimentalFontWeight: true, 24071 __experimentalFontStyle: true, 24072 __experimentalTextTransform: true, 24073 __experimentalTextDecoration: true, 24074 __experimentalLetterSpacing: true, 24075 __experimentalDefaultControls: { 24076 fontSize: true 24077 } 24078 }, 24079 layout: { 24080 allowSizingOnChildren: true 24081 }, 24082 interactivity: { 24083 clientNavigation: true 24084 } 24085 }, 24086 editorStyle: "wp-block-group-editor", 24087 style: "wp-block-group" 24088 }; 24089 24090 24091 24092 const { 24093 name: group_name 24094 } = group_metadata; 24095 24096 const group_settings = { 24097 icon: library_group, 24098 example: { 24099 attributes: { 24100 layout: { 24101 type: 'constrained', 24102 justifyContent: 'center' 24103 }, 24104 style: { 24105 spacing: { 24106 padding: { 24107 top: '4em', 24108 right: '3em', 24109 bottom: '4em', 24110 left: '3em' 24111 } 24112 } 24113 } 24114 }, 24115 innerBlocks: [{ 24116 name: 'core/heading', 24117 attributes: { 24118 content: (0,external_wp_i18n_namespaceObject.__)('La Mancha'), 24119 textAlign: 'center' 24120 } 24121 }, { 24122 name: 'core/paragraph', 24123 attributes: { 24124 align: 'center', 24125 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.') 24126 } 24127 }, { 24128 name: 'core/spacer', 24129 attributes: { 24130 height: '10px' 24131 } 24132 }, { 24133 name: 'core/button', 24134 attributes: { 24135 text: (0,external_wp_i18n_namespaceObject.__)('Read more') 24136 } 24137 }], 24138 viewportWidth: 600 24139 }, 24140 transforms: group_transforms, 24141 edit: group_edit, 24142 save: group_save_save, 24143 deprecated: group_deprecated, 24144 variations: group_variations 24145 }; 24146 const group_init = () => initBlock({ 24147 name: group_name, 24148 metadata: group_metadata, 24149 settings: group_settings 24150 }); 24151 24152 ;// ./node_modules/@wordpress/icons/build-module/library/heading.js 24153 /** 24154 * WordPress dependencies 24155 */ 24156 24157 24158 const heading = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 24159 xmlns: "http://www.w3.org/2000/svg", 24160 viewBox: "0 0 24 24", 24161 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 24162 d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z" 24163 }) 24164 }); 24165 /* harmony default export */ const library_heading = (heading); 24166 24167 ;// ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js 24168 /** 24169 * External dependencies 24170 */ 24171 24172 24173 /** 24174 * WordPress dependencies 24175 */ 24176 24177 24178 const blockSupports = { 24179 className: false, 24180 anchor: true 24181 }; 24182 const heading_deprecated_blockAttributes = { 24183 align: { 24184 type: 'string' 24185 }, 24186 content: { 24187 type: 'string', 24188 source: 'html', 24189 selector: 'h1,h2,h3,h4,h5,h6', 24190 default: '' 24191 }, 24192 level: { 24193 type: 'number', 24194 default: 2 24195 }, 24196 placeholder: { 24197 type: 'string' 24198 } 24199 }; 24200 const deprecated_migrateCustomColors = attributes => { 24201 if (!attributes.customTextColor) { 24202 return attributes; 24203 } 24204 const style = { 24205 color: { 24206 text: attributes.customTextColor 24207 } 24208 }; 24209 const { 24210 customTextColor, 24211 ...restAttributes 24212 } = attributes; 24213 return { 24214 ...restAttributes, 24215 style 24216 }; 24217 }; 24218 const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; 24219 const migrateTextAlign = attributes => { 24220 const { 24221 align, 24222 ...rest 24223 } = attributes; 24224 return TEXT_ALIGN_OPTIONS.includes(align) ? { 24225 ...rest, 24226 textAlign: align 24227 } : attributes; 24228 }; 24229 const heading_deprecated_v1 = { 24230 supports: blockSupports, 24231 attributes: { 24232 ...heading_deprecated_blockAttributes, 24233 customTextColor: { 24234 type: 'string' 24235 }, 24236 textColor: { 24237 type: 'string' 24238 } 24239 }, 24240 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 24241 save({ 24242 attributes 24243 }) { 24244 const { 24245 align, 24246 level, 24247 content, 24248 textColor, 24249 customTextColor 24250 } = attributes; 24251 const tagName = 'h' + level; 24252 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 24253 const className = dist_clsx({ 24254 [textClass]: textClass 24255 }); 24256 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24257 className: className ? className : undefined, 24258 tagName: tagName, 24259 style: { 24260 textAlign: align, 24261 color: textClass ? undefined : customTextColor 24262 }, 24263 value: content 24264 }); 24265 } 24266 }; 24267 const heading_deprecated_v2 = { 24268 attributes: { 24269 ...heading_deprecated_blockAttributes, 24270 customTextColor: { 24271 type: 'string' 24272 }, 24273 textColor: { 24274 type: 'string' 24275 } 24276 }, 24277 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 24278 save({ 24279 attributes 24280 }) { 24281 const { 24282 align, 24283 content, 24284 customTextColor, 24285 level, 24286 textColor 24287 } = attributes; 24288 const tagName = 'h' + level; 24289 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 24290 const className = dist_clsx({ 24291 [textClass]: textClass, 24292 [`has-text-align-$align}`]: align 24293 }); 24294 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24295 className: className ? className : undefined, 24296 tagName: tagName, 24297 style: { 24298 color: textClass ? undefined : customTextColor 24299 }, 24300 value: content 24301 }); 24302 }, 24303 supports: blockSupports 24304 }; 24305 const heading_deprecated_v3 = { 24306 supports: blockSupports, 24307 attributes: { 24308 ...heading_deprecated_blockAttributes, 24309 customTextColor: { 24310 type: 'string' 24311 }, 24312 textColor: { 24313 type: 'string' 24314 } 24315 }, 24316 migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), 24317 save({ 24318 attributes 24319 }) { 24320 const { 24321 align, 24322 content, 24323 customTextColor, 24324 level, 24325 textColor 24326 } = attributes; 24327 const tagName = 'h' + level; 24328 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 24329 const className = dist_clsx({ 24330 [textClass]: textClass, 24331 'has-text-color': textColor || customTextColor, 24332 [`has-text-align-$align}`]: align 24333 }); 24334 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24335 className: className ? className : undefined, 24336 tagName: tagName, 24337 style: { 24338 color: textClass ? undefined : customTextColor 24339 }, 24340 value: content 24341 }); 24342 } 24343 }; 24344 const heading_deprecated_v4 = { 24345 supports: { 24346 align: ['wide', 'full'], 24347 anchor: true, 24348 className: false, 24349 color: { 24350 link: true 24351 }, 24352 fontSize: true, 24353 lineHeight: true, 24354 __experimentalSelector: { 24355 'core/heading/h1': 'h1', 24356 'core/heading/h2': 'h2', 24357 'core/heading/h3': 'h3', 24358 'core/heading/h4': 'h4', 24359 'core/heading/h5': 'h5', 24360 'core/heading/h6': 'h6' 24361 }, 24362 __unstablePasteTextInline: true 24363 }, 24364 attributes: heading_deprecated_blockAttributes, 24365 isEligible: ({ 24366 align 24367 }) => TEXT_ALIGN_OPTIONS.includes(align), 24368 migrate: migrateTextAlign, 24369 save({ 24370 attributes 24371 }) { 24372 const { 24373 align, 24374 content, 24375 level 24376 } = attributes; 24377 const TagName = 'h' + level; 24378 const className = dist_clsx({ 24379 [`has-text-align-$align}`]: align 24380 }); 24381 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 24382 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 24383 className 24384 }), 24385 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24386 value: content 24387 }) 24388 }); 24389 } 24390 }; 24391 24392 // This deprecation covers the serialization of the `wp-block-heading` class 24393 // into the block's markup after className support was enabled. 24394 const heading_deprecated_v5 = { 24395 supports: { 24396 align: ['wide', 'full'], 24397 anchor: true, 24398 className: false, 24399 color: { 24400 gradients: true, 24401 link: true, 24402 __experimentalDefaultControls: { 24403 background: true, 24404 text: true 24405 } 24406 }, 24407 spacing: { 24408 margin: true, 24409 padding: true 24410 }, 24411 typography: { 24412 fontSize: true, 24413 lineHeight: true, 24414 __experimentalFontFamily: true, 24415 __experimentalFontStyle: true, 24416 __experimentalFontWeight: true, 24417 __experimentalLetterSpacing: true, 24418 __experimentalTextTransform: true, 24419 __experimentalTextDecoration: true, 24420 __experimentalDefaultControls: { 24421 fontSize: true, 24422 fontAppearance: true, 24423 textTransform: true 24424 } 24425 }, 24426 __experimentalSelector: 'h1,h2,h3,h4,h5,h6', 24427 __unstablePasteTextInline: true, 24428 __experimentalSlashInserter: true 24429 }, 24430 attributes: { 24431 textAlign: { 24432 type: 'string' 24433 }, 24434 content: { 24435 type: 'string', 24436 source: 'html', 24437 selector: 'h1,h2,h3,h4,h5,h6', 24438 default: '', 24439 role: 'content' 24440 }, 24441 level: { 24442 type: 'number', 24443 default: 2 24444 }, 24445 placeholder: { 24446 type: 'string' 24447 } 24448 }, 24449 save({ 24450 attributes 24451 }) { 24452 const { 24453 textAlign, 24454 content, 24455 level 24456 } = attributes; 24457 const TagName = 'h' + level; 24458 const className = dist_clsx({ 24459 [`has-text-align-$textAlign}`]: textAlign 24460 }); 24461 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 24462 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 24463 className 24464 }), 24465 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24466 value: content 24467 }) 24468 }); 24469 } 24470 }; 24471 const heading_deprecated_deprecated = [heading_deprecated_v5, heading_deprecated_v4, heading_deprecated_v3, heading_deprecated_v2, heading_deprecated_v1]; 24472 /* harmony default export */ const heading_deprecated = (heading_deprecated_deprecated); 24473 24474 ;// ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js 24475 /** 24476 * External dependencies 24477 */ 24478 24479 24480 /** 24481 * Object map tracking anchors. 24482 * 24483 * @type {Record<string, string | null>} 24484 */ 24485 const autogenerate_anchors_anchors = {}; 24486 24487 /** 24488 * Returns the text without markup. 24489 * 24490 * @param {string} text The text. 24491 * 24492 * @return {string} The text without markup. 24493 */ 24494 const getTextWithoutMarkup = text => { 24495 const dummyElement = document.createElement('div'); 24496 dummyElement.innerHTML = text; 24497 return dummyElement.innerText; 24498 }; 24499 24500 /** 24501 * Get the slug from the content. 24502 * 24503 * @param {string} content The block content. 24504 * 24505 * @return {string} Returns the slug. 24506 */ 24507 const getSlug = content => { 24508 // Get the slug. 24509 return remove_accents_default()(getTextWithoutMarkup(content)) 24510 // Convert anything that's not a letter or number to a hyphen. 24511 .replace(/[^\p{L}\p{N}]+/gu, '-') 24512 // Convert to lowercase 24513 .toLowerCase() 24514 // Remove any remaining leading or trailing hyphens. 24515 .replace(/(^-+)|(-+$)/g, ''); 24516 }; 24517 24518 /** 24519 * Generate the anchor for a heading. 24520 * 24521 * @param {string} clientId The block ID. 24522 * @param {string} content The block content. 24523 * 24524 * @return {string|null} Return the heading anchor. 24525 */ 24526 const generateAnchor = (clientId, content) => { 24527 const slug = getSlug(content); 24528 // If slug is empty, then return null. 24529 // Returning null instead of an empty string allows us to check again when the content changes. 24530 if ('' === slug) { 24531 return null; 24532 } 24533 delete autogenerate_anchors_anchors[clientId]; 24534 let anchor = slug; 24535 let i = 0; 24536 24537 // If the anchor already exists in another heading, append -i. 24538 while (Object.values(autogenerate_anchors_anchors).includes(anchor)) { 24539 i += 1; 24540 anchor = slug + '-' + i; 24541 } 24542 return anchor; 24543 }; 24544 24545 /** 24546 * Set the anchor for a heading. 24547 * 24548 * @param {string} clientId The block ID. 24549 * @param {string|null} anchor The block anchor. 24550 */ 24551 const setAnchor = (clientId, anchor) => { 24552 autogenerate_anchors_anchors[clientId] = anchor; 24553 }; 24554 24555 ;// ./node_modules/@wordpress/block-library/build-module/heading/edit.js 24556 /** 24557 * External dependencies 24558 */ 24559 24560 24561 /** 24562 * WordPress dependencies 24563 */ 24564 24565 24566 24567 24568 24569 /** 24570 * Internal dependencies 24571 */ 24572 24573 24574 function HeadingEdit({ 24575 attributes, 24576 setAttributes, 24577 mergeBlocks, 24578 onReplace, 24579 style, 24580 clientId 24581 }) { 24582 const { 24583 textAlign, 24584 content, 24585 level, 24586 levelOptions, 24587 placeholder, 24588 anchor 24589 } = attributes; 24590 const tagName = 'h' + level; 24591 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 24592 className: dist_clsx({ 24593 [`has-text-align-$textAlign}`]: textAlign 24594 }), 24595 style 24596 }); 24597 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 24598 const { 24599 canGenerateAnchors 24600 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 24601 const { 24602 getGlobalBlockCount, 24603 getSettings 24604 } = select(external_wp_blockEditor_namespaceObject.store); 24605 const settings = getSettings(); 24606 return { 24607 canGenerateAnchors: !!settings.generateAnchors || getGlobalBlockCount('core/table-of-contents') > 0 24608 }; 24609 }, []); 24610 const { 24611 __unstableMarkNextChangeAsNotPersistent 24612 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 24613 24614 // Initially set anchor for headings that have content but no anchor set. 24615 // This is used when transforming a block to heading, or for legacy anchors. 24616 (0,external_wp_element_namespaceObject.useEffect)(() => { 24617 if (!canGenerateAnchors) { 24618 return; 24619 } 24620 if (!anchor && content) { 24621 // This side-effect should not create an undo level. 24622 __unstableMarkNextChangeAsNotPersistent(); 24623 setAttributes({ 24624 anchor: generateAnchor(clientId, content) 24625 }); 24626 } 24627 setAnchor(clientId, anchor); 24628 24629 // Remove anchor map when block unmounts. 24630 return () => setAnchor(clientId, null); 24631 }, [anchor, content, clientId, canGenerateAnchors]); 24632 const onContentChange = value => { 24633 const newAttrs = { 24634 content: value 24635 }; 24636 if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) { 24637 newAttrs.anchor = generateAnchor(clientId, value); 24638 } 24639 setAttributes(newAttrs); 24640 }; 24641 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 24642 children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 24643 group: "block", 24644 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 24645 value: level, 24646 options: levelOptions, 24647 onChange: newLevel => setAttributes({ 24648 level: newLevel 24649 }) 24650 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 24651 value: textAlign, 24652 onChange: nextAlign => { 24653 setAttributes({ 24654 textAlign: nextAlign 24655 }); 24656 } 24657 })] 24658 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 24659 identifier: "content", 24660 tagName: tagName, 24661 value: content, 24662 onChange: onContentChange, 24663 onMerge: mergeBlocks, 24664 onReplace: onReplace, 24665 onRemove: () => onReplace([]), 24666 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'), 24667 textAlign: textAlign, 24668 ...(external_wp_element_namespaceObject.Platform.isNative && { 24669 deleteEnter: true 24670 }), 24671 ...blockProps 24672 })] 24673 }); 24674 } 24675 /* harmony default export */ const heading_edit = (HeadingEdit); 24676 24677 ;// ./node_modules/@wordpress/block-library/build-module/heading/save.js 24678 /** 24679 * External dependencies 24680 */ 24681 24682 24683 /** 24684 * WordPress dependencies 24685 */ 24686 24687 24688 function heading_save_save({ 24689 attributes 24690 }) { 24691 const { 24692 textAlign, 24693 content, 24694 level 24695 } = attributes; 24696 const TagName = 'h' + level; 24697 const className = dist_clsx({ 24698 [`has-text-align-$textAlign}`]: textAlign 24699 }); 24700 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 24701 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 24702 className 24703 }), 24704 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 24705 value: content 24706 }) 24707 }); 24708 } 24709 24710 ;// ./node_modules/@wordpress/block-library/build-module/heading/shared.js 24711 /** 24712 * Given a node name string for a heading node, returns its numeric level. 24713 * 24714 * @param {string} nodeName Heading node name. 24715 * 24716 * @return {number} Heading level. 24717 */ 24718 function getLevelFromHeadingNodeName(nodeName) { 24719 return Number(nodeName.substr(1)); 24720 } 24721 24722 ;// ./node_modules/@wordpress/block-library/build-module/heading/transforms.js 24723 /* wp:polyfill */ 24724 /** 24725 * WordPress dependencies 24726 */ 24727 24728 24729 /** 24730 * Internal dependencies 24731 */ 24732 24733 24734 const heading_transforms_transforms = { 24735 from: [{ 24736 type: 'block', 24737 isMultiBlock: true, 24738 blocks: ['core/paragraph'], 24739 transform: attributes => attributes.map(({ 24740 content, 24741 anchor, 24742 align: textAlign, 24743 metadata 24744 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 24745 content, 24746 anchor, 24747 textAlign, 24748 metadata: getTransformedMetadata(metadata, 'core/heading', ({ 24749 content: contentBinding 24750 }) => ({ 24751 content: contentBinding 24752 })) 24753 })) 24754 }, { 24755 type: 'raw', 24756 selector: 'h1,h2,h3,h4,h5,h6', 24757 schema: ({ 24758 phrasingContentSchema, 24759 isPaste 24760 }) => { 24761 const schema = { 24762 children: phrasingContentSchema, 24763 attributes: isPaste ? [] : ['style', 'id'] 24764 }; 24765 return { 24766 h1: schema, 24767 h2: schema, 24768 h3: schema, 24769 h4: schema, 24770 h5: schema, 24771 h6: schema 24772 }; 24773 }, 24774 transform(node) { 24775 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/heading', node.outerHTML); 24776 const { 24777 textAlign 24778 } = node.style || {}; 24779 attributes.level = getLevelFromHeadingNodeName(node.nodeName); 24780 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 24781 attributes.align = textAlign; 24782 } 24783 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', attributes); 24784 } 24785 }, ...[1, 2, 3, 4, 5, 6].map(level => ({ 24786 type: 'prefix', 24787 prefix: Array(level + 1).join('#'), 24788 transform(content) { 24789 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 24790 level, 24791 content 24792 }); 24793 } 24794 })), ...[1, 2, 3, 4, 5, 6].map(level => ({ 24795 type: 'enter', 24796 regExp: new RegExp(`^/(h|H)$level}$`), 24797 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 24798 level 24799 }) 24800 }))], 24801 to: [{ 24802 type: 'block', 24803 isMultiBlock: true, 24804 blocks: ['core/paragraph'], 24805 transform: attributes => attributes.map(({ 24806 content, 24807 textAlign: align, 24808 metadata 24809 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 24810 content, 24811 align, 24812 metadata: getTransformedMetadata(metadata, 'core/paragraph', ({ 24813 content: contentBinding 24814 }) => ({ 24815 content: contentBinding 24816 })) 24817 })) 24818 }] 24819 }; 24820 /* harmony default export */ const heading_transforms = (heading_transforms_transforms); 24821 24822 ;// ./node_modules/@wordpress/block-library/build-module/heading/index.js 24823 /** 24824 * WordPress dependencies 24825 */ 24826 24827 24828 24829 /** 24830 * Internal dependencies 24831 */ 24832 24833 24834 24835 const heading_metadata = { 24836 $schema: "https://schemas.wp.org/trunk/block.json", 24837 apiVersion: 3, 24838 name: "core/heading", 24839 title: "Heading", 24840 category: "text", 24841 description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", 24842 keywords: ["title", "subtitle"], 24843 textdomain: "default", 24844 attributes: { 24845 textAlign: { 24846 type: "string" 24847 }, 24848 content: { 24849 type: "rich-text", 24850 source: "rich-text", 24851 selector: "h1,h2,h3,h4,h5,h6", 24852 role: "content" 24853 }, 24854 level: { 24855 type: "number", 24856 "default": 2 24857 }, 24858 levelOptions: { 24859 type: "array" 24860 }, 24861 placeholder: { 24862 type: "string" 24863 } 24864 }, 24865 supports: { 24866 align: ["wide", "full"], 24867 anchor: true, 24868 className: true, 24869 splitting: true, 24870 __experimentalBorder: { 24871 color: true, 24872 radius: true, 24873 style: true, 24874 width: true 24875 }, 24876 color: { 24877 gradients: true, 24878 link: true, 24879 __experimentalDefaultControls: { 24880 background: true, 24881 text: true 24882 } 24883 }, 24884 spacing: { 24885 margin: true, 24886 padding: true, 24887 __experimentalDefaultControls: { 24888 margin: false, 24889 padding: false 24890 } 24891 }, 24892 typography: { 24893 fontSize: true, 24894 lineHeight: true, 24895 __experimentalFontFamily: true, 24896 __experimentalFontStyle: true, 24897 __experimentalFontWeight: true, 24898 __experimentalLetterSpacing: true, 24899 __experimentalTextTransform: true, 24900 __experimentalTextDecoration: true, 24901 __experimentalWritingMode: true, 24902 __experimentalDefaultControls: { 24903 fontSize: true 24904 } 24905 }, 24906 __unstablePasteTextInline: true, 24907 __experimentalSlashInserter: true, 24908 interactivity: { 24909 clientNavigation: true 24910 } 24911 }, 24912 editorStyle: "wp-block-heading-editor", 24913 style: "wp-block-heading" 24914 }; 24915 24916 24917 const { 24918 name: heading_name 24919 } = heading_metadata; 24920 24921 const heading_settings = { 24922 icon: library_heading, 24923 example: { 24924 attributes: { 24925 content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'), 24926 level: 2, 24927 textAlign: 'center' 24928 } 24929 }, 24930 __experimentalLabel(attributes, { 24931 context 24932 }) { 24933 const { 24934 content, 24935 level 24936 } = attributes; 24937 const customName = attributes?.metadata?.name; 24938 const hasContent = content?.trim().length > 0; 24939 24940 // In the list view, use the block's content as the label. 24941 // If the content is empty, fall back to the default label. 24942 if (context === 'list-view' && (customName || hasContent)) { 24943 return customName || content; 24944 } 24945 if (context === 'accessibility') { 24946 return !hasContent ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text. %s: heading level. */ 24947 (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text. 1: heading level. 2: heading content. */ 24948 (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content); 24949 } 24950 }, 24951 transforms: heading_transforms, 24952 deprecated: heading_deprecated, 24953 merge(attributes, attributesToMerge) { 24954 return { 24955 content: (attributes.content || '') + (attributesToMerge.content || '') 24956 }; 24957 }, 24958 edit: heading_edit, 24959 save: heading_save_save 24960 }; 24961 const heading_init = () => initBlock({ 24962 name: heading_name, 24963 metadata: heading_metadata, 24964 settings: heading_settings 24965 }); 24966 24967 ;// ./node_modules/@wordpress/icons/build-module/library/home.js 24968 /** 24969 * WordPress dependencies 24970 */ 24971 24972 24973 const home = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 24974 xmlns: "http://www.w3.org/2000/svg", 24975 viewBox: "0 0 24 24", 24976 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 24977 d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" 24978 }) 24979 }); 24980 /* harmony default export */ const library_home = (home); 24981 24982 ;// ./node_modules/@wordpress/block-library/build-module/home-link/edit.js 24983 /** 24984 * External dependencies 24985 */ 24986 24987 24988 /** 24989 * WordPress dependencies 24990 */ 24991 24992 24993 24994 24995 24996 const preventDefault = event => event.preventDefault(); 24997 function HomeEdit({ 24998 attributes, 24999 setAttributes, 25000 context 25001 }) { 25002 var _attributes$label; 25003 const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { 25004 // Site index. 25005 return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; 25006 }, []); 25007 const { 25008 textColor, 25009 backgroundColor, 25010 style 25011 } = context; 25012 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 25013 className: dist_clsx('wp-block-navigation-item', { 25014 'has-text-color': !!textColor || !!style?.color?.text, 25015 [`has-$textColor}-color`]: !!textColor, 25016 'has-background': !!backgroundColor || !!style?.color?.background, 25017 [`has-$backgroundColor}-background-color`]: !!backgroundColor 25018 }), 25019 style: { 25020 color: style?.color?.text, 25021 backgroundColor: style?.color?.background 25022 } 25023 }); 25024 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 25025 ...blockProps, 25026 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25027 className: "wp-block-home-link__content wp-block-navigation-item__content", 25028 href: homeUrl, 25029 onClick: preventDefault, 25030 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 25031 identifier: "label", 25032 className: "wp-block-home-link__label", 25033 value: (_attributes$label = attributes.label) !== null && _attributes$label !== void 0 ? _attributes$label : (0,external_wp_i18n_namespaceObject.__)('Home'), 25034 onChange: labelValue => { 25035 setAttributes({ 25036 label: labelValue 25037 }); 25038 }, 25039 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'), 25040 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'), 25041 withoutInteractiveFormatting: true 25042 }) 25043 }) 25044 }); 25045 } 25046 25047 ;// ./node_modules/@wordpress/block-library/build-module/home-link/save.js 25048 /** 25049 * WordPress dependencies 25050 */ 25051 25052 25053 function home_link_save_save() { 25054 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 25055 } 25056 25057 ;// ./node_modules/@wordpress/block-library/build-module/home-link/index.js 25058 /** 25059 * WordPress dependencies 25060 */ 25061 25062 25063 25064 /** 25065 * Internal dependencies 25066 */ 25067 25068 const home_link_metadata = { 25069 $schema: "https://schemas.wp.org/trunk/block.json", 25070 apiVersion: 3, 25071 name: "core/home-link", 25072 category: "design", 25073 parent: ["core/navigation"], 25074 title: "Home Link", 25075 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.", 25076 textdomain: "default", 25077 attributes: { 25078 label: { 25079 type: "string" 25080 } 25081 }, 25082 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"], 25083 supports: { 25084 reusable: false, 25085 html: false, 25086 typography: { 25087 fontSize: true, 25088 lineHeight: true, 25089 __experimentalFontFamily: true, 25090 __experimentalFontWeight: true, 25091 __experimentalFontStyle: true, 25092 __experimentalTextTransform: true, 25093 __experimentalTextDecoration: true, 25094 __experimentalLetterSpacing: true, 25095 __experimentalDefaultControls: { 25096 fontSize: true 25097 } 25098 }, 25099 interactivity: { 25100 clientNavigation: true 25101 } 25102 }, 25103 editorStyle: "wp-block-home-link-editor", 25104 style: "wp-block-home-link" 25105 }; 25106 25107 25108 const { 25109 name: home_link_name 25110 } = home_link_metadata; 25111 25112 const home_link_settings = { 25113 icon: library_home, 25114 edit: HomeEdit, 25115 save: home_link_save_save, 25116 example: { 25117 attributes: { 25118 label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example') 25119 } 25120 } 25121 }; 25122 const home_link_init = () => initBlock({ 25123 name: home_link_name, 25124 metadata: home_link_metadata, 25125 settings: home_link_settings 25126 }); 25127 25128 ;// ./node_modules/@wordpress/icons/build-module/library/html.js 25129 /** 25130 * WordPress dependencies 25131 */ 25132 25133 25134 const html = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 25135 viewBox: "0 0 24 24", 25136 xmlns: "http://www.w3.org/2000/svg", 25137 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 25138 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" 25139 }) 25140 }); 25141 /* harmony default export */ const library_html = (html); 25142 25143 ;// ./node_modules/@wordpress/block-library/build-module/html/preview.js 25144 /* wp:polyfill */ 25145 /** 25146 * WordPress dependencies 25147 */ 25148 25149 25150 25151 25152 25153 25154 // Default styles used to unset some of the styles 25155 // that might be inherited from the editor style. 25156 25157 const DEFAULT_STYLES = ` 25158 html,body,:root { 25159 margin: 0 !important; 25160 padding: 0 !important; 25161 overflow: visible !important; 25162 min-height: auto !important; 25163 } 25164 `; 25165 function HTMLEditPreview({ 25166 content, 25167 isSelected 25168 }) { 25169 const settingStyles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles, []); 25170 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [DEFAULT_STYLES, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)((settingStyles !== null && settingStyles !== void 0 ? settingStyles : []).filter(style => style.css))], [settingStyles]); 25171 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 25172 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SandBox, { 25173 html: content, 25174 styles: styles, 25175 title: (0,external_wp_i18n_namespaceObject.__)('Custom HTML Preview'), 25176 tabIndex: -1 25177 }), !isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 25178 className: "block-library-html__preview-overlay" 25179 })] 25180 }); 25181 } 25182 25183 ;// ./node_modules/@wordpress/block-library/build-module/html/edit.js 25184 /** 25185 * WordPress dependencies 25186 */ 25187 25188 25189 25190 25191 25192 25193 25194 /** 25195 * Internal dependencies 25196 */ 25197 25198 25199 function HTMLEdit({ 25200 attributes, 25201 setAttributes, 25202 isSelected 25203 }) { 25204 const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)(); 25205 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 25206 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(HTMLEdit, 'html-edit-desc'); 25207 const isPreviewMode = (0,external_wp_data_namespaceObject.useSelect)(select => { 25208 return select(external_wp_blockEditor_namespaceObject.store).getSettings().isPreviewMode; 25209 }, []); 25210 function switchToPreview() { 25211 setIsPreview(true); 25212 } 25213 function switchToHTML() { 25214 setIsPreview(false); 25215 } 25216 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 25217 className: 'block-library-html__edit', 25218 'aria-describedby': isPreview ? instanceId : undefined 25219 }); 25220 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 25221 ...blockProps, 25222 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 25223 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { 25224 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 25225 isPressed: !isPreview, 25226 onClick: switchToHTML, 25227 children: "HTML" 25228 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 25229 isPressed: isPreview, 25230 onClick: switchToPreview, 25231 children: (0,external_wp_i18n_namespaceObject.__)('Preview') 25232 })] 25233 }) 25234 }), isPreview || isPreviewMode || isDisabled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 25235 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HTMLEditPreview, { 25236 content: attributes.content, 25237 isSelected: isSelected 25238 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { 25239 id: instanceId, 25240 children: (0,external_wp_i18n_namespaceObject.__)('HTML preview is not yet fully accessible. Please switch screen reader to virtualized mode to navigate the below iFrame.') 25241 })] 25242 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 25243 value: attributes.content, 25244 onChange: content => setAttributes({ 25245 content 25246 }), 25247 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'), 25248 "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML') 25249 })] 25250 }); 25251 } 25252 25253 ;// ./node_modules/@wordpress/block-library/build-module/html/save.js 25254 /** 25255 * WordPress dependencies 25256 */ 25257 25258 25259 function html_save_save({ 25260 attributes 25261 }) { 25262 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 25263 children: attributes.content 25264 }); 25265 } 25266 25267 ;// ./node_modules/@wordpress/block-library/build-module/html/transforms.js 25268 /** 25269 * WordPress dependencies 25270 */ 25271 25272 25273 const html_transforms_transforms = { 25274 from: [{ 25275 type: 'block', 25276 blocks: ['core/code'], 25277 transform: ({ 25278 content: html 25279 }) => { 25280 return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { 25281 // The code block may output HTML formatting, so convert it 25282 // to plain text. 25283 content: (0,external_wp_richText_namespaceObject.create)({ 25284 html 25285 }).text 25286 }); 25287 } 25288 }] 25289 }; 25290 /* harmony default export */ const html_transforms = (html_transforms_transforms); 25291 25292 ;// ./node_modules/@wordpress/block-library/build-module/html/index.js 25293 /** 25294 * WordPress dependencies 25295 */ 25296 25297 25298 25299 /** 25300 * Internal dependencies 25301 */ 25302 25303 25304 const html_metadata = { 25305 $schema: "https://schemas.wp.org/trunk/block.json", 25306 apiVersion: 3, 25307 name: "core/html", 25308 title: "Custom HTML", 25309 category: "widgets", 25310 description: "Add custom HTML code and preview it as you edit.", 25311 keywords: ["embed"], 25312 textdomain: "default", 25313 attributes: { 25314 content: { 25315 type: "string", 25316 source: "raw" 25317 } 25318 }, 25319 supports: { 25320 customClassName: false, 25321 className: false, 25322 html: false, 25323 interactivity: { 25324 clientNavigation: true 25325 } 25326 }, 25327 editorStyle: "wp-block-html-editor" 25328 }; 25329 25330 25331 const { 25332 name: html_name 25333 } = html_metadata; 25334 25335 const html_settings = { 25336 icon: library_html, 25337 example: { 25338 attributes: { 25339 content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>' 25340 } 25341 }, 25342 edit: HTMLEdit, 25343 save: html_save_save, 25344 transforms: html_transforms 25345 }; 25346 const html_init = () => initBlock({ 25347 name: html_name, 25348 metadata: html_metadata, 25349 settings: html_settings 25350 }); 25351 25352 ;// ./node_modules/@wordpress/block-library/build-module/image/deprecated.js 25353 /** 25354 * External dependencies 25355 */ 25356 25357 25358 /** 25359 * WordPress dependencies 25360 */ 25361 25362 25363 /** 25364 * Deprecation for adding the `wp-image-${id}` class to the image block for 25365 * responsive images. 25366 * 25367 * @see https://github.com/WordPress/gutenberg/pull/4898 25368 */ 25369 25370 const image_deprecated_v1 = { 25371 attributes: { 25372 url: { 25373 type: 'string', 25374 source: 'attribute', 25375 selector: 'img', 25376 attribute: 'src' 25377 }, 25378 alt: { 25379 type: 'string', 25380 source: 'attribute', 25381 selector: 'img', 25382 attribute: 'alt', 25383 default: '' 25384 }, 25385 caption: { 25386 type: 'array', 25387 source: 'children', 25388 selector: 'figcaption' 25389 }, 25390 href: { 25391 type: 'string', 25392 source: 'attribute', 25393 selector: 'a', 25394 attribute: 'href' 25395 }, 25396 id: { 25397 type: 'number' 25398 }, 25399 align: { 25400 type: 'string' 25401 }, 25402 width: { 25403 type: 'number' 25404 }, 25405 height: { 25406 type: 'number' 25407 } 25408 }, 25409 save({ 25410 attributes 25411 }) { 25412 const { 25413 url, 25414 alt, 25415 caption, 25416 align, 25417 href, 25418 width, 25419 height 25420 } = attributes; 25421 const extraImageProps = width || height ? { 25422 width, 25423 height 25424 } : {}; 25425 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 25426 src: url, 25427 alt: alt, 25428 ...extraImageProps 25429 }); 25430 let figureStyle = {}; 25431 if (width) { 25432 figureStyle = { 25433 width 25434 }; 25435 } else if (align === 'left' || align === 'right') { 25436 figureStyle = { 25437 maxWidth: '50%' 25438 }; 25439 } 25440 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 25441 className: align ? `align$align}` : null, 25442 style: figureStyle, 25443 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25444 href: href, 25445 children: image 25446 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25447 tagName: "figcaption", 25448 value: caption 25449 })] 25450 }); 25451 } 25452 }; 25453 25454 /** 25455 * Deprecation for adding the `is-resized` class to the image block to fix 25456 * captions on resized images. 25457 * 25458 * @see https://github.com/WordPress/gutenberg/pull/6496 25459 */ 25460 const image_deprecated_v2 = { 25461 attributes: { 25462 url: { 25463 type: 'string', 25464 source: 'attribute', 25465 selector: 'img', 25466 attribute: 'src' 25467 }, 25468 alt: { 25469 type: 'string', 25470 source: 'attribute', 25471 selector: 'img', 25472 attribute: 'alt', 25473 default: '' 25474 }, 25475 caption: { 25476 type: 'array', 25477 source: 'children', 25478 selector: 'figcaption' 25479 }, 25480 href: { 25481 type: 'string', 25482 source: 'attribute', 25483 selector: 'a', 25484 attribute: 'href' 25485 }, 25486 id: { 25487 type: 'number' 25488 }, 25489 align: { 25490 type: 'string' 25491 }, 25492 width: { 25493 type: 'number' 25494 }, 25495 height: { 25496 type: 'number' 25497 } 25498 }, 25499 save({ 25500 attributes 25501 }) { 25502 const { 25503 url, 25504 alt, 25505 caption, 25506 align, 25507 href, 25508 width, 25509 height, 25510 id 25511 } = attributes; 25512 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 25513 src: url, 25514 alt: alt, 25515 className: id ? `wp-image-$id}` : null, 25516 width: width, 25517 height: height 25518 }); 25519 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 25520 className: align ? `align$align}` : null, 25521 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25522 href: href, 25523 children: image 25524 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25525 tagName: "figcaption", 25526 value: caption 25527 })] 25528 }); 25529 } 25530 }; 25531 25532 /** 25533 * Deprecation for image floats including a wrapping div. 25534 * 25535 * @see https://github.com/WordPress/gutenberg/pull/7721 25536 */ 25537 const image_deprecated_v3 = { 25538 attributes: { 25539 url: { 25540 type: 'string', 25541 source: 'attribute', 25542 selector: 'img', 25543 attribute: 'src' 25544 }, 25545 alt: { 25546 type: 'string', 25547 source: 'attribute', 25548 selector: 'img', 25549 attribute: 'alt', 25550 default: '' 25551 }, 25552 caption: { 25553 type: 'array', 25554 source: 'children', 25555 selector: 'figcaption' 25556 }, 25557 href: { 25558 type: 'string', 25559 source: 'attribute', 25560 selector: 'figure > a', 25561 attribute: 'href' 25562 }, 25563 id: { 25564 type: 'number' 25565 }, 25566 align: { 25567 type: 'string' 25568 }, 25569 width: { 25570 type: 'number' 25571 }, 25572 height: { 25573 type: 'number' 25574 }, 25575 linkDestination: { 25576 type: 'string', 25577 default: 'none' 25578 } 25579 }, 25580 save({ 25581 attributes 25582 }) { 25583 const { 25584 url, 25585 alt, 25586 caption, 25587 align, 25588 href, 25589 width, 25590 height, 25591 id 25592 } = attributes; 25593 const classes = dist_clsx({ 25594 [`align$align}`]: align, 25595 'is-resized': width || height 25596 }); 25597 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 25598 src: url, 25599 alt: alt, 25600 className: id ? `wp-image-$id}` : null, 25601 width: width, 25602 height: height 25603 }); 25604 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 25605 className: classes, 25606 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25607 href: href, 25608 children: image 25609 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25610 tagName: "figcaption", 25611 value: caption 25612 })] 25613 }); 25614 } 25615 }; 25616 25617 /** 25618 * Deprecation for removing the outer div wrapper around aligned images. 25619 * 25620 * @see https://github.com/WordPress/gutenberg/pull/38657 25621 */ 25622 const image_deprecated_v4 = { 25623 attributes: { 25624 align: { 25625 type: 'string' 25626 }, 25627 url: { 25628 type: 'string', 25629 source: 'attribute', 25630 selector: 'img', 25631 attribute: 'src' 25632 }, 25633 alt: { 25634 type: 'string', 25635 source: 'attribute', 25636 selector: 'img', 25637 attribute: 'alt', 25638 default: '' 25639 }, 25640 caption: { 25641 type: 'string', 25642 source: 'html', 25643 selector: 'figcaption' 25644 }, 25645 title: { 25646 type: 'string', 25647 source: 'attribute', 25648 selector: 'img', 25649 attribute: 'title' 25650 }, 25651 href: { 25652 type: 'string', 25653 source: 'attribute', 25654 selector: 'figure > a', 25655 attribute: 'href' 25656 }, 25657 rel: { 25658 type: 'string', 25659 source: 'attribute', 25660 selector: 'figure > a', 25661 attribute: 'rel' 25662 }, 25663 linkClass: { 25664 type: 'string', 25665 source: 'attribute', 25666 selector: 'figure > a', 25667 attribute: 'class' 25668 }, 25669 id: { 25670 type: 'number' 25671 }, 25672 width: { 25673 type: 'number' 25674 }, 25675 height: { 25676 type: 'number' 25677 }, 25678 sizeSlug: { 25679 type: 'string' 25680 }, 25681 linkDestination: { 25682 type: 'string' 25683 }, 25684 linkTarget: { 25685 type: 'string', 25686 source: 'attribute', 25687 selector: 'figure > a', 25688 attribute: 'target' 25689 } 25690 }, 25691 supports: { 25692 anchor: true 25693 }, 25694 save({ 25695 attributes 25696 }) { 25697 const { 25698 url, 25699 alt, 25700 caption, 25701 align, 25702 href, 25703 rel, 25704 linkClass, 25705 width, 25706 height, 25707 id, 25708 linkTarget, 25709 sizeSlug, 25710 title 25711 } = attributes; 25712 const newRel = !rel ? undefined : rel; 25713 const classes = dist_clsx({ 25714 [`align$align}`]: align, 25715 [`size-$sizeSlug}`]: sizeSlug, 25716 'is-resized': width || height 25717 }); 25718 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 25719 src: url, 25720 alt: alt, 25721 className: id ? `wp-image-$id}` : null, 25722 width: width, 25723 height: height, 25724 title: title 25725 }); 25726 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 25727 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25728 className: linkClass, 25729 href: href, 25730 target: linkTarget, 25731 rel: newRel, 25732 children: image 25733 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25734 tagName: "figcaption", 25735 value: caption 25736 })] 25737 }); 25738 if ('left' === align || 'right' === align || 'center' === align) { 25739 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 25740 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 25741 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 25742 className: classes, 25743 children: figure 25744 }) 25745 }); 25746 } 25747 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 25748 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25749 className: classes 25750 }), 25751 children: figure 25752 }); 25753 } 25754 }; 25755 25756 /** 25757 * Deprecation for moving existing border radius styles onto the inner img 25758 * element where new border block support styles must be applied. 25759 * It will also add a new `.has-custom-border` class for existing blocks 25760 * with border radii set. This class is required to improve caption position 25761 * and styling when an image within a gallery has a custom border or 25762 * rounded corners. 25763 * 25764 * @see https://github.com/WordPress/gutenberg/pull/31366 25765 */ 25766 const image_deprecated_v5 = { 25767 attributes: { 25768 align: { 25769 type: 'string' 25770 }, 25771 url: { 25772 type: 'string', 25773 source: 'attribute', 25774 selector: 'img', 25775 attribute: 'src' 25776 }, 25777 alt: { 25778 type: 'string', 25779 source: 'attribute', 25780 selector: 'img', 25781 attribute: 'alt', 25782 default: '' 25783 }, 25784 caption: { 25785 type: 'string', 25786 source: 'html', 25787 selector: 'figcaption' 25788 }, 25789 title: { 25790 type: 'string', 25791 source: 'attribute', 25792 selector: 'img', 25793 attribute: 'title' 25794 }, 25795 href: { 25796 type: 'string', 25797 source: 'attribute', 25798 selector: 'figure > a', 25799 attribute: 'href' 25800 }, 25801 rel: { 25802 type: 'string', 25803 source: 'attribute', 25804 selector: 'figure > a', 25805 attribute: 'rel' 25806 }, 25807 linkClass: { 25808 type: 'string', 25809 source: 'attribute', 25810 selector: 'figure > a', 25811 attribute: 'class' 25812 }, 25813 id: { 25814 type: 'number' 25815 }, 25816 width: { 25817 type: 'number' 25818 }, 25819 height: { 25820 type: 'number' 25821 }, 25822 sizeSlug: { 25823 type: 'string' 25824 }, 25825 linkDestination: { 25826 type: 'string' 25827 }, 25828 linkTarget: { 25829 type: 'string', 25830 source: 'attribute', 25831 selector: 'figure > a', 25832 attribute: 'target' 25833 } 25834 }, 25835 supports: { 25836 anchor: true, 25837 color: { 25838 __experimentalDuotone: 'img', 25839 text: false, 25840 background: false 25841 }, 25842 __experimentalBorder: { 25843 radius: true, 25844 __experimentalDefaultControls: { 25845 radius: true 25846 } 25847 }, 25848 __experimentalStyle: { 25849 spacing: { 25850 margin: '0 0 1em 0' 25851 } 25852 } 25853 }, 25854 save({ 25855 attributes 25856 }) { 25857 const { 25858 url, 25859 alt, 25860 caption, 25861 align, 25862 href, 25863 rel, 25864 linkClass, 25865 width, 25866 height, 25867 id, 25868 linkTarget, 25869 sizeSlug, 25870 title 25871 } = attributes; 25872 const newRel = !rel ? undefined : rel; 25873 const classes = dist_clsx({ 25874 [`align$align}`]: align, 25875 [`size-$sizeSlug}`]: sizeSlug, 25876 'is-resized': width || height 25877 }); 25878 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 25879 src: url, 25880 alt: alt, 25881 className: id ? `wp-image-$id}` : null, 25882 width: width, 25883 height: height, 25884 title: title 25885 }); 25886 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 25887 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 25888 className: linkClass, 25889 href: href, 25890 target: linkTarget, 25891 rel: newRel, 25892 children: image 25893 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 25894 tagName: "figcaption", 25895 value: caption 25896 })] 25897 }); 25898 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 25899 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 25900 className: classes 25901 }), 25902 children: figure 25903 }); 25904 } 25905 }; 25906 25907 /** 25908 * Deprecation for adding width and height as style rules on the inner img. 25909 * 25910 * @see https://github.com/WordPress/gutenberg/pull/31366 25911 */ 25912 const image_deprecated_v6 = { 25913 attributes: { 25914 align: { 25915 type: 'string' 25916 }, 25917 url: { 25918 type: 'string', 25919 source: 'attribute', 25920 selector: 'img', 25921 attribute: 'src', 25922 role: 'content' 25923 }, 25924 alt: { 25925 type: 'string', 25926 source: 'attribute', 25927 selector: 'img', 25928 attribute: 'alt', 25929 default: '', 25930 role: 'content' 25931 }, 25932 caption: { 25933 type: 'string', 25934 source: 'html', 25935 selector: 'figcaption', 25936 role: 'content' 25937 }, 25938 title: { 25939 type: 'string', 25940 source: 'attribute', 25941 selector: 'img', 25942 attribute: 'title', 25943 role: 'content' 25944 }, 25945 href: { 25946 type: 'string', 25947 source: 'attribute', 25948 selector: 'figure > a', 25949 attribute: 'href', 25950 role: 'content' 25951 }, 25952 rel: { 25953 type: 'string', 25954 source: 'attribute', 25955 selector: 'figure > a', 25956 attribute: 'rel' 25957 }, 25958 linkClass: { 25959 type: 'string', 25960 source: 'attribute', 25961 selector: 'figure > a', 25962 attribute: 'class' 25963 }, 25964 id: { 25965 type: 'number', 25966 role: 'content' 25967 }, 25968 width: { 25969 type: 'number' 25970 }, 25971 height: { 25972 type: 'number' 25973 }, 25974 aspectRatio: { 25975 type: 'string' 25976 }, 25977 scale: { 25978 type: 'string' 25979 }, 25980 sizeSlug: { 25981 type: 'string' 25982 }, 25983 linkDestination: { 25984 type: 'string' 25985 }, 25986 linkTarget: { 25987 type: 'string', 25988 source: 'attribute', 25989 selector: 'figure > a', 25990 attribute: 'target' 25991 } 25992 }, 25993 supports: { 25994 anchor: true, 25995 color: { 25996 text: false, 25997 background: false 25998 }, 25999 filter: { 26000 duotone: true 26001 }, 26002 __experimentalBorder: { 26003 color: true, 26004 radius: true, 26005 width: true, 26006 __experimentalSkipSerialization: true, 26007 __experimentalDefaultControls: { 26008 color: true, 26009 radius: true, 26010 width: true 26011 } 26012 } 26013 }, 26014 migrate(attributes) { 26015 const { 26016 height, 26017 width 26018 } = attributes; 26019 return { 26020 ...attributes, 26021 width: typeof width === 'number' ? `$width}px` : width, 26022 height: typeof height === 'number' ? `$height}px` : height 26023 }; 26024 }, 26025 save({ 26026 attributes 26027 }) { 26028 const { 26029 url, 26030 alt, 26031 caption, 26032 align, 26033 href, 26034 rel, 26035 linkClass, 26036 width, 26037 height, 26038 aspectRatio, 26039 scale, 26040 id, 26041 linkTarget, 26042 sizeSlug, 26043 title 26044 } = attributes; 26045 const newRel = !rel ? undefined : rel; 26046 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 26047 const classes = dist_clsx({ 26048 [`align$align}`]: align, 26049 [`size-$sizeSlug}`]: sizeSlug, 26050 'is-resized': width || height, 26051 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26052 }); 26053 const imageClasses = dist_clsx(borderProps.className, { 26054 [`wp-image-$id}`]: !!id 26055 }); 26056 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 26057 src: url, 26058 alt: alt, 26059 className: imageClasses || undefined, 26060 style: { 26061 ...borderProps.style, 26062 aspectRatio, 26063 objectFit: scale 26064 }, 26065 width: width, 26066 height: height, 26067 title: title 26068 }); 26069 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26070 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 26071 className: linkClass, 26072 href: href, 26073 target: linkTarget, 26074 rel: newRel, 26075 children: image 26076 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 26077 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 26078 tagName: "figcaption", 26079 value: caption 26080 })] 26081 }); 26082 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 26083 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 26084 className: classes 26085 }), 26086 children: figure 26087 }); 26088 } 26089 }; 26090 26091 /** 26092 * Deprecation for converting to string width and height block attributes and 26093 * removing the width and height img element attributes which are not needed 26094 * as they get added by the TODO hook. 26095 * 26096 * @see https://github.com/WordPress/gutenberg/pull/53274 26097 */ 26098 const image_deprecated_v7 = { 26099 attributes: { 26100 align: { 26101 type: 'string' 26102 }, 26103 url: { 26104 type: 'string', 26105 source: 'attribute', 26106 selector: 'img', 26107 attribute: 'src', 26108 role: 'content' 26109 }, 26110 alt: { 26111 type: 'string', 26112 source: 'attribute', 26113 selector: 'img', 26114 attribute: 'alt', 26115 default: '', 26116 role: 'content' 26117 }, 26118 caption: { 26119 type: 'string', 26120 source: 'html', 26121 selector: 'figcaption', 26122 role: 'content' 26123 }, 26124 title: { 26125 type: 'string', 26126 source: 'attribute', 26127 selector: 'img', 26128 attribute: 'title', 26129 role: 'content' 26130 }, 26131 href: { 26132 type: 'string', 26133 source: 'attribute', 26134 selector: 'figure > a', 26135 attribute: 'href', 26136 role: 'content' 26137 }, 26138 rel: { 26139 type: 'string', 26140 source: 'attribute', 26141 selector: 'figure > a', 26142 attribute: 'rel' 26143 }, 26144 linkClass: { 26145 type: 'string', 26146 source: 'attribute', 26147 selector: 'figure > a', 26148 attribute: 'class' 26149 }, 26150 id: { 26151 type: 'number', 26152 role: 'content' 26153 }, 26154 width: { 26155 type: 'number' 26156 }, 26157 height: { 26158 type: 'number' 26159 }, 26160 aspectRatio: { 26161 type: 'string' 26162 }, 26163 scale: { 26164 type: 'string' 26165 }, 26166 sizeSlug: { 26167 type: 'string' 26168 }, 26169 linkDestination: { 26170 type: 'string' 26171 }, 26172 linkTarget: { 26173 type: 'string', 26174 source: 'attribute', 26175 selector: 'figure > a', 26176 attribute: 'target' 26177 } 26178 }, 26179 supports: { 26180 anchor: true, 26181 color: { 26182 text: false, 26183 background: false 26184 }, 26185 filter: { 26186 duotone: true 26187 }, 26188 __experimentalBorder: { 26189 color: true, 26190 radius: true, 26191 width: true, 26192 __experimentalSkipSerialization: true, 26193 __experimentalDefaultControls: { 26194 color: true, 26195 radius: true, 26196 width: true 26197 } 26198 } 26199 }, 26200 migrate({ 26201 width, 26202 height, 26203 ...attributes 26204 }) { 26205 return { 26206 ...attributes, 26207 width: `$width}px`, 26208 height: `$height}px` 26209 }; 26210 }, 26211 save({ 26212 attributes 26213 }) { 26214 const { 26215 url, 26216 alt, 26217 caption, 26218 align, 26219 href, 26220 rel, 26221 linkClass, 26222 width, 26223 height, 26224 aspectRatio, 26225 scale, 26226 id, 26227 linkTarget, 26228 sizeSlug, 26229 title 26230 } = attributes; 26231 const newRel = !rel ? undefined : rel; 26232 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 26233 const classes = dist_clsx({ 26234 [`align$align}`]: align, 26235 [`size-$sizeSlug}`]: sizeSlug, 26236 'is-resized': width || height, 26237 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26238 }); 26239 const imageClasses = dist_clsx(borderProps.className, { 26240 [`wp-image-$id}`]: !!id 26241 }); 26242 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 26243 src: url, 26244 alt: alt, 26245 className: imageClasses || undefined, 26246 style: { 26247 ...borderProps.style, 26248 aspectRatio, 26249 objectFit: scale, 26250 width, 26251 height 26252 }, 26253 width: width, 26254 height: height, 26255 title: title 26256 }); 26257 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26258 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 26259 className: linkClass, 26260 href: href, 26261 target: linkTarget, 26262 rel: newRel, 26263 children: image 26264 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 26265 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 26266 tagName: "figcaption", 26267 value: caption 26268 })] 26269 }); 26270 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 26271 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 26272 className: classes 26273 }), 26274 children: figure 26275 }); 26276 } 26277 }; 26278 const deprecated_v8 = { 26279 attributes: { 26280 align: { 26281 type: 'string' 26282 }, 26283 behaviors: { 26284 type: 'object' 26285 }, 26286 url: { 26287 type: 'string', 26288 source: 'attribute', 26289 selector: 'img', 26290 attribute: 'src', 26291 role: 'content' 26292 }, 26293 alt: { 26294 type: 'string', 26295 source: 'attribute', 26296 selector: 'img', 26297 attribute: 'alt', 26298 default: '', 26299 role: 'content' 26300 }, 26301 caption: { 26302 type: 'string', 26303 source: 'html', 26304 selector: 'figcaption', 26305 role: 'content' 26306 }, 26307 title: { 26308 type: 'string', 26309 source: 'attribute', 26310 selector: 'img', 26311 attribute: 'title', 26312 role: 'content' 26313 }, 26314 href: { 26315 type: 'string', 26316 source: 'attribute', 26317 selector: 'figure > a', 26318 attribute: 'href', 26319 role: 'content' 26320 }, 26321 rel: { 26322 type: 'string', 26323 source: 'attribute', 26324 selector: 'figure > a', 26325 attribute: 'rel' 26326 }, 26327 linkClass: { 26328 type: 'string', 26329 source: 'attribute', 26330 selector: 'figure > a', 26331 attribute: 'class' 26332 }, 26333 id: { 26334 type: 'number', 26335 role: 'content' 26336 }, 26337 width: { 26338 type: 'string' 26339 }, 26340 height: { 26341 type: 'string' 26342 }, 26343 aspectRatio: { 26344 type: 'string' 26345 }, 26346 scale: { 26347 type: 'string' 26348 }, 26349 sizeSlug: { 26350 type: 'string' 26351 }, 26352 linkDestination: { 26353 type: 'string' 26354 }, 26355 linkTarget: { 26356 type: 'string', 26357 source: 'attribute', 26358 selector: 'figure > a', 26359 attribute: 'target' 26360 } 26361 }, 26362 supports: { 26363 anchor: true, 26364 color: { 26365 text: false, 26366 background: false 26367 }, 26368 filter: { 26369 duotone: true 26370 }, 26371 __experimentalBorder: { 26372 color: true, 26373 radius: true, 26374 width: true, 26375 __experimentalSkipSerialization: true, 26376 __experimentalDefaultControls: { 26377 color: true, 26378 radius: true, 26379 width: true 26380 } 26381 } 26382 }, 26383 migrate({ 26384 width, 26385 height, 26386 ...attributes 26387 }) { 26388 // We need to perform a check here because in cases 26389 // where attributes are added dynamically to blocks, 26390 // block invalidation overrides the isEligible() method 26391 // and forces the migration to run, so it's not guaranteed 26392 // that `behaviors` or `behaviors.lightbox` will be defined. 26393 if (!attributes.behaviors?.lightbox) { 26394 return attributes; 26395 } 26396 const { 26397 behaviors: { 26398 lightbox: { 26399 enabled 26400 } 26401 } 26402 } = attributes; 26403 const newAttributes = { 26404 ...attributes, 26405 lightbox: { 26406 enabled 26407 } 26408 }; 26409 delete newAttributes.behaviors; 26410 return newAttributes; 26411 }, 26412 isEligible(attributes) { 26413 return !!attributes.behaviors; 26414 }, 26415 save({ 26416 attributes 26417 }) { 26418 const { 26419 url, 26420 alt, 26421 caption, 26422 align, 26423 href, 26424 rel, 26425 linkClass, 26426 width, 26427 height, 26428 aspectRatio, 26429 scale, 26430 id, 26431 linkTarget, 26432 sizeSlug, 26433 title 26434 } = attributes; 26435 const newRel = !rel ? undefined : rel; 26436 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 26437 const classes = dist_clsx({ 26438 [`align$align}`]: align, 26439 [`size-$sizeSlug}`]: sizeSlug, 26440 'is-resized': width || height, 26441 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26442 }); 26443 const imageClasses = dist_clsx(borderProps.className, { 26444 [`wp-image-$id}`]: !!id 26445 }); 26446 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 26447 src: url, 26448 alt: alt, 26449 className: imageClasses || undefined, 26450 style: { 26451 ...borderProps.style, 26452 aspectRatio, 26453 objectFit: scale, 26454 width, 26455 height 26456 }, 26457 title: title 26458 }); 26459 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26460 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 26461 className: linkClass, 26462 href: href, 26463 target: linkTarget, 26464 rel: newRel, 26465 children: image 26466 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 26467 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 26468 tagName: "figcaption", 26469 value: caption 26470 })] 26471 }); 26472 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 26473 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 26474 className: classes 26475 }), 26476 children: figure 26477 }); 26478 } 26479 }; 26480 /* 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]); 26481 26482 ;// ./node_modules/@wordpress/icons/build-module/library/plugins.js 26483 /** 26484 * WordPress dependencies 26485 */ 26486 26487 26488 const plugins = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 26489 xmlns: "http://www.w3.org/2000/svg", 26490 viewBox: "0 0 24 24", 26491 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 26492 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" 26493 }) 26494 }); 26495 /* harmony default export */ const library_plugins = (plugins); 26496 26497 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js 26498 /** 26499 * WordPress dependencies 26500 */ 26501 26502 26503 const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 26504 viewBox: "0 0 24 24", 26505 xmlns: "http://www.w3.org/2000/svg", 26506 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 26507 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" 26508 }) 26509 }); 26510 /* harmony default export */ const chevron_down = (chevronDown); 26511 26512 ;// ./node_modules/@wordpress/icons/build-module/library/crop.js 26513 /** 26514 * WordPress dependencies 26515 */ 26516 26517 26518 const crop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 26519 xmlns: "http://www.w3.org/2000/svg", 26520 viewBox: "0 0 24 24", 26521 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 26522 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" 26523 }) 26524 }); 26525 /* harmony default export */ const library_crop = (crop); 26526 26527 ;// ./node_modules/@wordpress/icons/build-module/library/overlay-text.js 26528 /** 26529 * WordPress dependencies 26530 */ 26531 26532 26533 const overlayText = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 26534 xmlns: "http://www.w3.org/2000/svg", 26535 viewBox: "0 0 24 24", 26536 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 26537 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" 26538 }) 26539 }); 26540 /* harmony default export */ const overlay_text = (overlayText); 26541 26542 ;// ./node_modules/@wordpress/icons/build-module/library/upload.js 26543 /** 26544 * WordPress dependencies 26545 */ 26546 26547 26548 const upload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 26549 xmlns: "http://www.w3.org/2000/svg", 26550 viewBox: "0 0 24 24", 26551 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 26552 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" 26553 }) 26554 }); 26555 /* harmony default export */ const library_upload = (upload); 26556 26557 ;// ./node_modules/@wordpress/block-library/build-module/image/image.js 26558 /* wp:polyfill */ 26559 /** 26560 * WordPress dependencies 26561 */ 26562 26563 26564 26565 26566 26567 26568 26569 26570 26571 26572 26573 26574 26575 /** 26576 * Internal dependencies 26577 */ 26578 26579 26580 26581 26582 26583 /** 26584 * Module constants 26585 */ 26586 26587 26588 26589 26590 const { 26591 DimensionsTool, 26592 ResolutionTool: image_ResolutionTool 26593 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 26594 const scaleOptions = [{ 26595 value: 'cover', 26596 label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for dimensions control'), 26597 help: (0,external_wp_i18n_namespaceObject.__)('Image covers the space evenly.') 26598 }, { 26599 value: 'contain', 26600 label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'), 26601 help: (0,external_wp_i18n_namespaceObject.__)('Image is contained without distortion.') 26602 }]; 26603 const WRITEMODE_POPOVER_PROPS = { 26604 placement: 'bottom-start' 26605 }; 26606 26607 // If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles. 26608 const ImageWrapper = ({ 26609 href, 26610 children 26611 }) => { 26612 if (!href) { 26613 return children; 26614 } 26615 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 26616 href: href, 26617 onClick: event => event.preventDefault(), 26618 "aria-disabled": true, 26619 style: { 26620 // When the Image block is linked, 26621 // it's wrapped with a disabled <a /> tag. 26622 // Restore cursor style so it doesn't appear 'clickable' 26623 // and remove pointer events. Safari needs the display property. 26624 pointerEvents: 'none', 26625 cursor: 'default', 26626 display: 'inline' 26627 }, 26628 children: children 26629 }); 26630 }; 26631 function ContentOnlyControls({ 26632 attributes, 26633 setAttributes, 26634 lockAltControls, 26635 lockAltControlsMessage, 26636 lockTitleControls, 26637 lockTitleControlsMessage 26638 }) { 26639 // Use internal state instead of a ref to make sure that the component 26640 // re-renders when the popover's anchor updates. 26641 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 26642 const [isAltDialogOpen, setIsAltDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); 26643 const [isTitleDialogOpen, setIsTitleDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); 26644 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26645 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { 26646 ref: setPopoverAnchor, 26647 children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { 26648 icon: chevron_down 26649 /* translators: button label text should, if possible, be under 16 characters. */, 26650 label: (0,external_wp_i18n_namespaceObject.__)('More'), 26651 toggleProps: { 26652 ...toggleProps, 26653 description: (0,external_wp_i18n_namespaceObject.__)('Displays more controls.') 26654 }, 26655 popoverProps: WRITEMODE_POPOVER_PROPS, 26656 children: ({ 26657 onClose 26658 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26659 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 26660 onClick: () => { 26661 setIsAltDialogOpen(true); 26662 onClose(); 26663 }, 26664 "aria-haspopup": "dialog", 26665 children: (0,external_wp_i18n_namespaceObject._x)('Alternative text', 'Alternative text for an image. Block toolbar label, a low character count is preferred.') 26666 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 26667 onClick: () => { 26668 setIsTitleDialogOpen(true); 26669 onClose(); 26670 }, 26671 "aria-haspopup": "dialog", 26672 children: (0,external_wp_i18n_namespaceObject.__)('Title text') 26673 })] 26674 }) 26675 }) 26676 }), isAltDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { 26677 placement: "bottom-start", 26678 anchor: popoverAnchor, 26679 onClose: () => setIsAltDialogOpen(false), 26680 offset: 13, 26681 variant: "toolbar", 26682 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 26683 className: "wp-block-image__toolbar_content_textarea__container", 26684 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 26685 className: "wp-block-image__toolbar_content_textarea", 26686 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 26687 value: attributes.alt || '', 26688 onChange: value => setAttributes({ 26689 alt: value 26690 }), 26691 disabled: lockAltControls, 26692 help: lockAltControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26693 children: lockAltControlsMessage 26694 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26695 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 26696 href: 26697 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 26698 (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), 26699 children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') 26700 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] 26701 }), 26702 __nextHasNoMarginBottom: true 26703 }) 26704 }) 26705 }), isTitleDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { 26706 placement: "bottom-start", 26707 anchor: popoverAnchor, 26708 onClose: () => setIsTitleDialogOpen(false), 26709 offset: 13, 26710 variant: "toolbar", 26711 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 26712 className: "wp-block-image__toolbar_content_textarea__container", 26713 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 26714 __next40pxDefaultSize: true, 26715 className: "wp-block-image__toolbar_content_textarea", 26716 __nextHasNoMarginBottom: true, 26717 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 26718 value: attributes.title || '', 26719 onChange: value => setAttributes({ 26720 title: value 26721 }), 26722 disabled: lockTitleControls, 26723 help: lockTitleControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26724 children: lockTitleControlsMessage 26725 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 26726 children: [(0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 26727 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", 26728 children: (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)') 26729 })] 26730 }) 26731 }) 26732 }) 26733 })] 26734 }); 26735 } 26736 function image_Image({ 26737 temporaryURL, 26738 attributes, 26739 setAttributes, 26740 isSingleSelected, 26741 insertBlocksAfter, 26742 onReplace, 26743 onSelectImage, 26744 onSelectURL, 26745 onUploadError, 26746 context, 26747 clientId, 26748 blockEditingMode, 26749 parentLayoutType, 26750 maxContentWidth 26751 }) { 26752 const { 26753 url = '', 26754 alt, 26755 align, 26756 id, 26757 href, 26758 rel, 26759 linkClass, 26760 linkDestination, 26761 title, 26762 width, 26763 height, 26764 aspectRatio, 26765 scale, 26766 linkTarget, 26767 sizeSlug, 26768 lightbox, 26769 metadata 26770 } = attributes; 26771 26772 // The only supported unit is px, so we can parseInt to strip the px here. 26773 const numericWidth = width ? parseInt(width, 10) : undefined; 26774 const numericHeight = height ? parseInt(height, 10) : undefined; 26775 const imageRef = (0,external_wp_element_namespaceObject.useRef)(); 26776 const { 26777 allowResize = true 26778 } = context; 26779 const { 26780 getBlock, 26781 getSettings 26782 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 26783 const image = (0,external_wp_data_namespaceObject.useSelect)(select => id && isSingleSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(id, { 26784 context: 'view' 26785 }) : null, [id, isSingleSelected]); 26786 const { 26787 canInsertCover, 26788 imageEditing, 26789 imageSizes, 26790 maxWidth 26791 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 26792 const { 26793 getBlockRootClientId, 26794 canInsertBlockType 26795 } = select(external_wp_blockEditor_namespaceObject.store); 26796 const rootClientId = getBlockRootClientId(clientId); 26797 const settings = getSettings(); 26798 return { 26799 imageEditing: settings.imageEditing, 26800 imageSizes: settings.imageSizes, 26801 maxWidth: settings.maxWidth, 26802 canInsertCover: canInsertBlockType('core/cover', rootClientId) 26803 }; 26804 }, [clientId]); 26805 const { 26806 replaceBlocks, 26807 toggleSelection 26808 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 26809 const { 26810 createErrorNotice, 26811 createSuccessNotice 26812 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 26813 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); 26814 const isWideAligned = ['wide', 'full'].includes(align); 26815 const [{ 26816 loadedNaturalWidth, 26817 loadedNaturalHeight 26818 }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); 26819 const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); 26820 const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)(); 26821 const [hasImageErrored, setHasImageErrored] = (0,external_wp_element_namespaceObject.useState)(false); 26822 const hasNonContentControls = blockEditingMode === 'default'; 26823 const isContentOnlyMode = blockEditingMode === 'contentOnly'; 26824 const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport; 26825 const imageSizeOptions = imageSizes.filter(({ 26826 slug 26827 }) => image?.media_details?.sizes?.[slug]?.source_url).map(({ 26828 name, 26829 slug 26830 }) => ({ 26831 value: slug, 26832 label: name 26833 })); 26834 26835 // If an image is externally hosted, try to fetch the image data. This may 26836 // fail if the image host doesn't allow CORS with the domain. If it works, 26837 // we can enable a button in the toolbar to upload the image. 26838 (0,external_wp_element_namespaceObject.useEffect)(() => { 26839 if (!isExternalImage(id, url) || !isSingleSelected || !getSettings().mediaUpload) { 26840 setExternalBlob(); 26841 return; 26842 } 26843 if (externalBlob) { 26844 return; 26845 } 26846 window 26847 // Avoid cache, which seems to help avoid CORS problems. 26848 .fetch(url.includes('?') ? url : url + '?').then(response => response.blob()).then(blob => setExternalBlob(blob)) 26849 // Do nothing, cannot upload. 26850 .catch(() => {}); 26851 }, [id, url, isSingleSelected, externalBlob]); 26852 26853 // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural 26854 // width and height. This resolves an issue in Safari where the loaded natural 26855 // width and height is otherwise lost when switching between alignments. 26856 // See: https://github.com/WordPress/gutenberg/pull/37210. 26857 const { 26858 naturalWidth, 26859 naturalHeight 26860 } = (0,external_wp_element_namespaceObject.useMemo)(() => { 26861 return { 26862 naturalWidth: imageRef.current?.naturalWidth || loadedNaturalWidth || undefined, 26863 naturalHeight: imageRef.current?.naturalHeight || loadedNaturalHeight || undefined 26864 }; 26865 }, [loadedNaturalWidth, loadedNaturalHeight, imageRef.current?.complete]); 26866 function onResizeStart() { 26867 toggleSelection(false); 26868 } 26869 function onResizeStop() { 26870 toggleSelection(true); 26871 } 26872 function onImageError() { 26873 setHasImageErrored(true); 26874 26875 // Check if there's an embed block that handles this URL, e.g., instagram URL. 26876 // See: https://github.com/WordPress/gutenberg/pull/11472 26877 const embedBlock = createUpgradedEmbedBlock({ 26878 attributes: { 26879 url 26880 } 26881 }); 26882 if (undefined !== embedBlock) { 26883 onReplace(embedBlock); 26884 } 26885 } 26886 function onImageLoad(event) { 26887 setHasImageErrored(false); 26888 setLoadedNaturalSize({ 26889 loadedNaturalWidth: event.target?.naturalWidth, 26890 loadedNaturalHeight: event.target?.naturalHeight 26891 }); 26892 } 26893 function onSetHref(props) { 26894 setAttributes(props); 26895 } 26896 function onSetLightbox(enable) { 26897 if (enable && !lightboxSetting?.enabled) { 26898 setAttributes({ 26899 lightbox: { 26900 enabled: true 26901 } 26902 }); 26903 } else if (!enable && lightboxSetting?.enabled) { 26904 setAttributes({ 26905 lightbox: { 26906 enabled: false 26907 } 26908 }); 26909 } else { 26910 setAttributes({ 26911 lightbox: undefined 26912 }); 26913 } 26914 } 26915 function resetLightbox() { 26916 // When deleting a link from an image while lightbox settings 26917 // are enabled by default, we should disable the lightbox, 26918 // otherwise the resulting UX looks like a mistake. 26919 // See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123. 26920 if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) { 26921 setAttributes({ 26922 lightbox: { 26923 enabled: false 26924 } 26925 }); 26926 } else { 26927 setAttributes({ 26928 lightbox: undefined 26929 }); 26930 } 26931 } 26932 function onSetTitle(value) { 26933 // This is the HTML title attribute, separate from the media object 26934 // title. 26935 setAttributes({ 26936 title: value 26937 }); 26938 } 26939 function updateAlt(newAlt) { 26940 setAttributes({ 26941 alt: newAlt 26942 }); 26943 } 26944 function updateImage(newSizeSlug) { 26945 const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url; 26946 if (!newUrl) { 26947 return null; 26948 } 26949 setAttributes({ 26950 url: newUrl, 26951 sizeSlug: newSizeSlug 26952 }); 26953 } 26954 function uploadExternal() { 26955 const { 26956 mediaUpload 26957 } = getSettings(); 26958 if (!mediaUpload) { 26959 return; 26960 } 26961 mediaUpload({ 26962 filesList: [externalBlob], 26963 onFileChange([img]) { 26964 onSelectImage(img); 26965 if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) { 26966 return; 26967 } 26968 setExternalBlob(); 26969 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), { 26970 type: 'snackbar' 26971 }); 26972 }, 26973 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 26974 onError(message) { 26975 createErrorNotice(message, { 26976 type: 'snackbar' 26977 }); 26978 } 26979 }); 26980 } 26981 (0,external_wp_element_namespaceObject.useEffect)(() => { 26982 if (!isSingleSelected) { 26983 setIsEditingImage(false); 26984 } 26985 }, [isSingleSelected]); 26986 const canEditImage = id && naturalWidth && naturalHeight && imageEditing; 26987 const allowCrop = isSingleSelected && canEditImage && !isEditingImage && !isContentOnlyMode; 26988 function switchToCover() { 26989 replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover')); 26990 } 26991 26992 // TODO: Can allow more units after figuring out how they should interact 26993 // with the ResizableBox and ImageEditor components. Calculations later on 26994 // for those components are currently assuming px units. 26995 const dimensionsUnitsOptions = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 26996 availableUnits: ['px'] 26997 }); 26998 const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('lightbox'); 26999 const showLightboxSetting = 27000 // If a block-level override is set, we should give users the option to 27001 // remove that override, even if the lightbox UI is disabled in the settings. 27002 !!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing; 27003 const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled; 27004 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 27005 const dimensionsControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsTool, { 27006 value: { 27007 width, 27008 height, 27009 scale, 27010 aspectRatio 27011 }, 27012 onChange: ({ 27013 width: newWidth, 27014 height: newHeight, 27015 scale: newScale, 27016 aspectRatio: newAspectRatio 27017 }) => { 27018 // Rebuilding the object forces setting `undefined` 27019 // for values that are removed since setAttributes 27020 // doesn't do anything with keys that aren't set. 27021 setAttributes({ 27022 // CSS includes `height: auto`, but we need 27023 // `width: auto` to fix the aspect ratio when 27024 // only height is set due to the width and 27025 // height attributes set via the server. 27026 width: !newWidth && newHeight ? 'auto' : newWidth, 27027 height: newHeight, 27028 scale: newScale, 27029 aspectRatio: newAspectRatio 27030 }); 27031 }, 27032 defaultScale: "cover", 27033 defaultAspectRatio: "auto", 27034 scaleOptions: scaleOptions, 27035 unitsOptions: dimensionsUnitsOptions 27036 }); 27037 const aspectRatioControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsTool, { 27038 value: { 27039 aspectRatio 27040 }, 27041 onChange: ({ 27042 aspectRatio: newAspectRatio 27043 }) => { 27044 setAttributes({ 27045 aspectRatio: newAspectRatio, 27046 scale: 'cover' 27047 }); 27048 }, 27049 defaultAspectRatio: "auto", 27050 tools: ['aspectRatio'] 27051 }); 27052 const resetAll = () => { 27053 setAttributes({ 27054 alt: undefined, 27055 width: undefined, 27056 height: undefined, 27057 scale: undefined, 27058 aspectRatio: undefined, 27059 lightbox: undefined 27060 }); 27061 }; 27062 const sizeControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 27063 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 27064 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 27065 resetAll: resetAll, 27066 dropdownMenuProps: dropdownMenuProps, 27067 children: isResizable && (parentLayoutType === 'grid' ? aspectRatioControl : dimensionsControl) 27068 }) 27069 }); 27070 const arePatternOverridesEnabled = metadata?.bindings?.__default?.source === 'core/pattern-overrides'; 27071 const { 27072 lockUrlControls = false, 27073 lockHrefControls = false, 27074 lockAltControls = false, 27075 lockAltControlsMessage, 27076 lockTitleControls = false, 27077 lockTitleControlsMessage, 27078 lockCaption = false 27079 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 27080 if (!isSingleSelected) { 27081 return {}; 27082 } 27083 const { 27084 url: urlBinding, 27085 alt: altBinding, 27086 title: titleBinding 27087 } = metadata?.bindings || {}; 27088 const hasParentPattern = !!context['pattern/overrides']; 27089 const urlBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(urlBinding?.source); 27090 const altBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(altBinding?.source); 27091 const titleBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(titleBinding?.source); 27092 return { 27093 lockUrlControls: !!urlBinding && !urlBindingSource?.canUserEditValue?.({ 27094 select, 27095 context, 27096 args: urlBinding?.args 27097 }), 27098 lockHrefControls: 27099 // Disable editing the link of the URL if the image is inside a pattern instance. 27100 // This is a temporary solution until we support overriding the link on the frontend. 27101 hasParentPattern || arePatternOverridesEnabled, 27102 lockCaption: 27103 // Disable editing the caption if the image is inside a pattern instance. 27104 // This is a temporary solution until we support overriding the caption on the frontend. 27105 hasParentPattern, 27106 lockAltControls: !!altBinding && !altBindingSource?.canUserEditValue?.({ 27107 select, 27108 context, 27109 args: altBinding?.args 27110 }), 27111 lockAltControlsMessage: altBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ 27112 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), altBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data'), 27113 lockTitleControls: !!titleBinding && !titleBindingSource?.canUserEditValue?.({ 27114 select, 27115 context, 27116 args: titleBinding?.args 27117 }), 27118 lockTitleControlsMessage: titleBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ 27119 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), titleBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') 27120 }; 27121 }, [arePatternOverridesEnabled, context, isSingleSelected, metadata?.bindings]); 27122 const showUrlInput = isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls; 27123 const showCoverControls = isSingleSelected && canInsertCover; 27124 const showBlockControls = showUrlInput || allowCrop || showCoverControls; 27125 const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls && 27126 /*#__PURE__*/ 27127 // For contentOnly mode, put this button in its own area so it has borders around it. 27128 (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 27129 group: isContentOnlyMode ? 'inline' : 'other', 27130 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 27131 mediaId: id, 27132 mediaURL: url, 27133 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 27134 accept: "image/*", 27135 onSelect: onSelectImage, 27136 onSelectURL: onSelectURL, 27137 onError: onUploadError, 27138 name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add image') : (0,external_wp_i18n_namespaceObject.__)('Replace'), 27139 onReset: () => onSelectImage(undefined) 27140 }) 27141 }); 27142 const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27143 children: [showBlockControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 27144 group: "block", 27145 children: [showUrlInput && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { 27146 url: href || '', 27147 onChangeUrl: onSetHref, 27148 linkDestination: linkDestination, 27149 mediaUrl: image && image.source_url || url, 27150 mediaLink: image && image.link, 27151 linkTarget: linkTarget, 27152 linkClass: linkClass, 27153 rel: rel, 27154 showLightboxSetting: showLightboxSetting, 27155 lightboxEnabled: lightboxChecked, 27156 onSetLightbox: onSetLightbox, 27157 resetLightbox: resetLightbox 27158 }), allowCrop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 27159 onClick: () => setIsEditingImage(true), 27160 icon: library_crop, 27161 label: (0,external_wp_i18n_namespaceObject.__)('Crop') 27162 }), showCoverControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 27163 icon: overlay_text, 27164 label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'), 27165 onClick: switchToCover 27166 })] 27167 }), isSingleSelected && externalBlob && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 27168 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 27169 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 27170 onClick: uploadExternal, 27171 icon: library_upload, 27172 label: (0,external_wp_i18n_namespaceObject.__)('Upload to Media Library') 27173 }) 27174 }) 27175 }), isContentOnlyMode && 27176 /*#__PURE__*/ 27177 // Add some extra controls for content attributes when content only mode is active. 27178 // With content only mode active, the inspector is hidden, so users need another way 27179 // to edit these attributes. 27180 (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 27181 group: "block", 27182 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlyControls, { 27183 attributes: attributes, 27184 setAttributes: setAttributes, 27185 lockAltControls: lockAltControls, 27186 lockAltControlsMessage: lockAltControlsMessage, 27187 lockTitleControls: lockTitleControls, 27188 lockTitleControlsMessage: lockTitleControlsMessage 27189 }) 27190 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 27191 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 27192 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 27193 resetAll: resetAll, 27194 dropdownMenuProps: dropdownMenuProps, 27195 children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 27196 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 27197 isShownByDefault: true, 27198 hasValue: () => !!alt, 27199 onDeselect: () => setAttributes({ 27200 alt: undefined 27201 }), 27202 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 27203 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 27204 value: alt || '', 27205 onChange: updateAlt, 27206 readOnly: lockAltControls, 27207 help: lockAltControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27208 children: lockAltControlsMessage 27209 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27210 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 27211 href: 27212 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 27213 (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), 27214 children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') 27215 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] 27216 }), 27217 __nextHasNoMarginBottom: true 27218 }) 27219 }), isResizable && (parentLayoutType === 'grid' ? aspectRatioControl : dimensionsControl), !!imageSizeOptions.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(image_ResolutionTool, { 27220 value: sizeSlug, 27221 onChange: updateImage, 27222 options: imageSizeOptions 27223 })] 27224 }) 27225 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 27226 group: "advanced", 27227 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 27228 __nextHasNoMarginBottom: true, 27229 __next40pxDefaultSize: true, 27230 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 27231 value: title || '', 27232 onChange: onSetTitle, 27233 readOnly: lockTitleControls, 27234 help: lockTitleControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27235 children: lockTitleControlsMessage 27236 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27237 children: [(0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 27238 href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", 27239 children: (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)') 27240 })] 27241 }) 27242 }) 27243 })] 27244 }); 27245 const filename = (0,external_wp_url_namespaceObject.getFilename)(url); 27246 let defaultedAlt; 27247 if (alt) { 27248 defaultedAlt = alt; 27249 } else if (filename) { 27250 defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: file name */ 27251 (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename); 27252 } else { 27253 defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute'); 27254 } 27255 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 27256 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 27257 const isRounded = attributes.className?.includes('is-style-rounded'); 27258 const { 27259 postType, 27260 postId, 27261 queryId 27262 } = context; 27263 const isDescendentOfQueryLoop = Number.isFinite(queryId); 27264 const [, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); 27265 let img = temporaryURL && hasImageErrored ? 27266 /*#__PURE__*/ 27267 // Show a placeholder during upload when the blob URL can't be loaded. This can 27268 // happen when the user uploads a HEIC image in a browser that doesn't support them. 27269 (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 27270 className: "wp-block-image__placeholder", 27271 withIllustration: true, 27272 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 27273 }) : 27274 /*#__PURE__*/ 27275 // Disable reason: Image itself is not meant to be interactive, but 27276 // should direct focus to block. 27277 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 27278 (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27279 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 27280 src: temporaryURL || url, 27281 alt: defaultedAlt, 27282 onError: onImageError, 27283 onLoad: onImageLoad, 27284 ref: imageRef, 27285 className: borderProps.className, 27286 style: { 27287 width: width && height || aspectRatio ? '100%' : undefined, 27288 height: width && height || aspectRatio ? '100%' : undefined, 27289 objectFit: scale, 27290 ...borderProps.style, 27291 ...shadowProps.style 27292 } 27293 }), temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] 27294 }) 27295 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; 27296 if (canEditImage && isEditingImage) { 27297 img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { 27298 href: href, 27299 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { 27300 id: id, 27301 url: url, 27302 width: numericWidth, 27303 height: numericHeight, 27304 naturalHeight: naturalHeight, 27305 naturalWidth: naturalWidth, 27306 onSaveImage: imageAttributes => setAttributes(imageAttributes), 27307 onFinishEditing: () => { 27308 setIsEditingImage(false); 27309 }, 27310 borderProps: isRounded ? undefined : borderProps 27311 }) 27312 }); 27313 } else if (!isResizable || parentLayoutType === 'grid') { 27314 img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 27315 style: { 27316 width, 27317 height, 27318 aspectRatio 27319 }, 27320 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { 27321 href: href, 27322 children: img 27323 }) 27324 }); 27325 } else { 27326 const numericRatio = aspectRatio && evalAspectRatio(aspectRatio); 27327 const customRatio = numericWidth / numericHeight; 27328 const naturalRatio = naturalWidth / naturalHeight; 27329 const ratio = numericRatio || customRatio || naturalRatio || 1; 27330 const currentWidth = !numericWidth && numericHeight ? numericHeight * ratio : numericWidth; 27331 const currentHeight = !numericHeight && numericWidth ? numericWidth / ratio : numericHeight; 27332 const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : constants_MIN_SIZE * ratio; 27333 const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : constants_MIN_SIZE / ratio; 27334 27335 // With the current implementation of ResizableBox, an image needs an 27336 // explicit pixel value for the max-width. In absence of being able to 27337 // set the content-width, this max-width is currently dictated by the 27338 // vanilla editor style. The following variable adds a buffer to this 27339 // vanilla style, so 3rd party themes have some wiggleroom. This does, 27340 // in most cases, allow you to scale the image beyond the width of the 27341 // main column, though not infinitely. 27342 // @todo It would be good to revisit this once a content-width variable 27343 // becomes available. 27344 const maxWidthBuffer = maxWidth * 2.5; 27345 const maxResizeWidth = maxContentWidth || maxWidthBuffer; 27346 let showRightHandle = false; 27347 let showLeftHandle = false; 27348 27349 /* eslint-disable no-lonely-if */ 27350 // See https://github.com/WordPress/gutenberg/issues/7584. 27351 if (align === 'center') { 27352 // When the image is centered, show both handles. 27353 showRightHandle = true; 27354 showLeftHandle = true; 27355 } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { 27356 // In RTL mode the image is on the right by default. 27357 // Show the right handle and hide the left handle only when it is 27358 // aligned left. Otherwise always show the left handle. 27359 if (align === 'left') { 27360 showRightHandle = true; 27361 } else { 27362 showLeftHandle = true; 27363 } 27364 } else { 27365 // Show the left handle and hide the right handle only when the 27366 // image is aligned right. Otherwise always show the right handle. 27367 if (align === 'right') { 27368 showLeftHandle = true; 27369 } else { 27370 showRightHandle = true; 27371 } 27372 } 27373 /* eslint-enable no-lonely-if */ 27374 img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 27375 style: { 27376 display: 'block', 27377 objectFit: scale, 27378 aspectRatio: !width && !height && aspectRatio ? aspectRatio : undefined 27379 }, 27380 size: { 27381 width: currentWidth !== null && currentWidth !== void 0 ? currentWidth : 'auto', 27382 height: currentHeight !== null && currentHeight !== void 0 ? currentHeight : 'auto' 27383 }, 27384 showHandle: isSingleSelected, 27385 minWidth: minWidth, 27386 maxWidth: maxResizeWidth, 27387 minHeight: minHeight, 27388 maxHeight: maxResizeWidth / ratio, 27389 lockAspectRatio: ratio, 27390 enable: { 27391 top: false, 27392 right: showRightHandle, 27393 bottom: true, 27394 left: showLeftHandle 27395 }, 27396 onResizeStart: onResizeStart, 27397 onResizeStop: (event, direction, elt) => { 27398 onResizeStop(); 27399 27400 // Clear hardcoded width if the resized width is close to the max-content width. 27401 if (maxContentWidth && 27402 // Only do this if the image is bigger than the container to prevent it from being squished. 27403 // TODO: Remove this check if the image support setting 100% width. 27404 naturalWidth >= maxContentWidth && Math.abs(elt.offsetWidth - maxContentWidth) < 10) { 27405 setAttributes({ 27406 width: undefined, 27407 height: undefined 27408 }); 27409 return; 27410 } 27411 27412 // Since the aspect ratio is locked when resizing, we can 27413 // use the width of the resized element to calculate the 27414 // height in CSS to prevent stretching when the max-width 27415 // is reached. 27416 setAttributes({ 27417 width: `$elt.offsetWidth}px`, 27418 height: 'auto', 27419 aspectRatio: ratio === naturalRatio ? undefined : String(ratio) 27420 }); 27421 }, 27422 resizeRatio: align === 'center' ? 2 : 1, 27423 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { 27424 href: href, 27425 children: img 27426 }) 27427 }); 27428 } 27429 if (!url && !temporaryURL) { 27430 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27431 children: [mediaReplaceFlow, metadata?.bindings ? controls : sizeControls] 27432 }); 27433 } 27434 27435 /** 27436 * Set the post's featured image with the current image. 27437 */ 27438 const setPostFeatureImage = () => { 27439 setFeaturedImage(id); 27440 createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Post featured image updated.'), { 27441 type: 'snackbar' 27442 }); 27443 }; 27444 const featuredImageControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { 27445 children: ({ 27446 selectedClientIds 27447 }) => selectedClientIds.length === 1 && !isDescendentOfQueryLoop && postId && id && clientId === selectedClientIds[0] && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 27448 onClick: setPostFeatureImage, 27449 children: (0,external_wp_i18n_namespaceObject.__)('Set as featured image') 27450 }) 27451 }); 27452 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27453 children: [mediaReplaceFlow, controls, featuredImageControl, img, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 27454 attributes: attributes, 27455 setAttributes: setAttributes, 27456 isSelected: isSingleSelected, 27457 insertBlocksAfter: insertBlocksAfter, 27458 label: (0,external_wp_i18n_namespaceObject.__)('Image caption text'), 27459 showToolbarButton: isSingleSelected && hasNonContentControls && !arePatternOverridesEnabled, 27460 readOnly: lockCaption 27461 })] 27462 }); 27463 } 27464 27465 ;// ./node_modules/@wordpress/block-library/build-module/image/use-max-width-observer.js 27466 /** 27467 * WordPress dependencies 27468 */ 27469 27470 27471 27472 function useMaxWidthObserver() { 27473 const [contentResizeListener, { 27474 width 27475 }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 27476 const observerRef = (0,external_wp_element_namespaceObject.useRef)(); 27477 const maxWidthObserver = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 27478 // Some themes set max-width on blocks. 27479 className: "wp-block", 27480 "aria-hidden": "true", 27481 style: { 27482 position: 'absolute', 27483 inset: 0, 27484 width: '100%', 27485 height: 0, 27486 margin: 0 27487 }, 27488 ref: observerRef, 27489 children: contentResizeListener 27490 }); 27491 return [maxWidthObserver, width]; 27492 } 27493 27494 27495 ;// ./node_modules/@wordpress/block-library/build-module/image/edit.js 27496 /* wp:polyfill */ 27497 /** 27498 * External dependencies 27499 */ 27500 27501 27502 /** 27503 * WordPress dependencies 27504 */ 27505 27506 27507 27508 27509 27510 27511 27512 27513 27514 27515 27516 /** 27517 * Internal dependencies 27518 */ 27519 27520 27521 27522 27523 27524 /** 27525 * Module constants 27526 */ 27527 27528 27529 const edit_pickRelevantMediaFiles = (image, size) => { 27530 const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link', 'caption'].includes(key))); 27531 imageProps.url = image?.sizes?.[size]?.url || image?.media_details?.sizes?.[size]?.source_url || image.url; 27532 return imageProps; 27533 }; 27534 27535 /** 27536 * Is the url for the image hosted externally. An externally hosted image has no 27537 * id and is not a blob url. 27538 * 27539 * @param {number=} id The id of the image. 27540 * @param {string=} url The url of the image. 27541 * 27542 * @return {boolean} Is the url an externally hosted url? 27543 */ 27544 const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url); 27545 27546 /** 27547 * Checks if WP generated the specified image size. Size generation is skipped 27548 * when the image is smaller than the said size. 27549 * 27550 * @param {Object} image 27551 * @param {string} size 27552 * 27553 * @return {boolean} Whether or not it has default image size. 27554 */ 27555 function hasSize(image, size) { 27556 var _image$sizes$size, _image$media_details$; 27557 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$ : {}); 27558 } 27559 function ImageEdit({ 27560 attributes, 27561 setAttributes, 27562 isSelected: isSingleSelected, 27563 className, 27564 insertBlocksAfter, 27565 onReplace, 27566 context, 27567 clientId, 27568 __unstableParentLayout: parentLayout 27569 }) { 27570 const { 27571 url = '', 27572 alt, 27573 caption, 27574 id, 27575 width, 27576 height, 27577 sizeSlug, 27578 aspectRatio, 27579 scale, 27580 align, 27581 metadata 27582 } = attributes; 27583 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); 27584 const containerRef = (0,external_wp_element_namespaceObject.useRef)(); 27585 // Only observe the max width from the parent container when the parent layout is not flex nor grid. 27586 // This won't work for them because the container width changes with the image. 27587 // TODO: Find a way to observe the container width for flex and grid layouts. 27588 const isMaxWidthContainerWidth = !parentLayout || parentLayout.type !== 'flex' && parentLayout.type !== 'grid'; 27589 const [maxWidthObserver, maxContentWidth] = useMaxWidthObserver(); 27590 const [placeholderResizeListener, { 27591 width: placeholderWidth 27592 }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 27593 const isSmallContainer = placeholderWidth && placeholderWidth < 160; 27594 const altRef = (0,external_wp_element_namespaceObject.useRef)(); 27595 (0,external_wp_element_namespaceObject.useEffect)(() => { 27596 altRef.current = alt; 27597 }, [alt]); 27598 const captionRef = (0,external_wp_element_namespaceObject.useRef)(); 27599 (0,external_wp_element_namespaceObject.useEffect)(() => { 27600 captionRef.current = caption; 27601 }, [caption]); 27602 const { 27603 __unstableMarkNextChangeAsNotPersistent, 27604 replaceBlock 27605 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 27606 (0,external_wp_element_namespaceObject.useEffect)(() => { 27607 if (['wide', 'full'].includes(align)) { 27608 __unstableMarkNextChangeAsNotPersistent(); 27609 setAttributes({ 27610 width: undefined, 27611 height: undefined, 27612 aspectRatio: undefined, 27613 scale: undefined 27614 }); 27615 } 27616 }, [__unstableMarkNextChangeAsNotPersistent, align, setAttributes]); 27617 const { 27618 getSettings, 27619 getBlockRootClientId, 27620 getBlockName, 27621 canInsertBlockType 27622 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 27623 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 27624 const { 27625 createErrorNotice 27626 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 27627 function onUploadError(message) { 27628 createErrorNotice(message, { 27629 type: 'snackbar' 27630 }); 27631 setAttributes({ 27632 src: undefined, 27633 id: undefined, 27634 url: undefined, 27635 blob: undefined 27636 }); 27637 } 27638 function onSelectImagesList(images) { 27639 const win = containerRef.current?.ownerDocument.defaultView; 27640 if (images.every(file => file instanceof win.File)) { 27641 /** @type {File[]} */ 27642 const files = images; 27643 const rootClientId = getBlockRootClientId(clientId); 27644 if (files.some(file => !isValidFileType(file))) { 27645 // Copied from the same notice in the gallery block. 27646 createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { 27647 id: 'gallery-upload-invalid-file', 27648 type: 'snackbar' 27649 }); 27650 } 27651 const imageBlocks = files.filter(file => isValidFileType(file)).map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 27652 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 27653 })); 27654 if (getBlockName(rootClientId) === 'core/gallery') { 27655 replaceBlock(clientId, imageBlocks); 27656 } else if (canInsertBlockType('core/gallery', rootClientId)) { 27657 const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, imageBlocks); 27658 replaceBlock(clientId, galleryBlock); 27659 } 27660 } 27661 } 27662 function onSelectImage(media) { 27663 if (Array.isArray(media)) { 27664 onSelectImagesList(media); 27665 return; 27666 } 27667 if (!media || !media.url) { 27668 setAttributes({ 27669 url: undefined, 27670 alt: undefined, 27671 id: undefined, 27672 title: undefined, 27673 caption: undefined, 27674 blob: undefined 27675 }); 27676 setTemporaryURL(); 27677 return; 27678 } 27679 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 27680 setTemporaryURL(media.url); 27681 return; 27682 } 27683 const { 27684 imageDefaultSize 27685 } = getSettings(); 27686 27687 // Try to use the previous selected image size if its available 27688 // otherwise try the default image size or fallback to "full" 27689 let newSize = 'full'; 27690 if (sizeSlug && hasSize(media, sizeSlug)) { 27691 newSize = sizeSlug; 27692 } else if (hasSize(media, imageDefaultSize)) { 27693 newSize = imageDefaultSize; 27694 } 27695 let mediaAttributes = edit_pickRelevantMediaFiles(media, newSize); 27696 27697 // If a caption text was meanwhile written by the user, 27698 // make sure the text is not overwritten by empty captions. 27699 if (captionRef.current && !mediaAttributes.caption) { 27700 const { 27701 caption: omittedCaption, 27702 ...restMediaAttributes 27703 } = mediaAttributes; 27704 mediaAttributes = restMediaAttributes; 27705 } 27706 let additionalAttributes; 27707 // Reset the dimension attributes if changing to a different image. 27708 if (!media.id || media.id !== id) { 27709 additionalAttributes = { 27710 sizeSlug: newSize 27711 }; 27712 } else { 27713 // Keep the same url when selecting the same file, so "Resolution" 27714 // option is not changed. 27715 additionalAttributes = { 27716 url 27717 }; 27718 } 27719 27720 // Check if default link setting should be used. 27721 let linkDestination = attributes.linkDestination; 27722 if (!linkDestination) { 27723 // Use the WordPress option to determine the proper default. 27724 // The constants used in Gutenberg do not match WP options so a little more complicated than ideal. 27725 // TODO: fix this in a follow up PR, requires updating media-text and ui component. 27726 switch (window?.wp?.media?.view?.settings?.defaultProps?.link || constants_LINK_DESTINATION_NONE) { 27727 case 'file': 27728 case constants_LINK_DESTINATION_MEDIA: 27729 linkDestination = constants_LINK_DESTINATION_MEDIA; 27730 break; 27731 case 'post': 27732 case constants_LINK_DESTINATION_ATTACHMENT: 27733 linkDestination = constants_LINK_DESTINATION_ATTACHMENT; 27734 break; 27735 case LINK_DESTINATION_CUSTOM: 27736 linkDestination = LINK_DESTINATION_CUSTOM; 27737 break; 27738 case constants_LINK_DESTINATION_NONE: 27739 linkDestination = constants_LINK_DESTINATION_NONE; 27740 break; 27741 } 27742 } 27743 27744 // Check if the image is linked to it's media. 27745 let href; 27746 switch (linkDestination) { 27747 case constants_LINK_DESTINATION_MEDIA: 27748 href = media.url; 27749 break; 27750 case constants_LINK_DESTINATION_ATTACHMENT: 27751 href = media.link; 27752 break; 27753 } 27754 mediaAttributes.href = href; 27755 setAttributes({ 27756 blob: undefined, 27757 ...mediaAttributes, 27758 ...additionalAttributes, 27759 linkDestination 27760 }); 27761 setTemporaryURL(); 27762 } 27763 function onSelectURL(newURL) { 27764 if (newURL !== url) { 27765 setAttributes({ 27766 blob: undefined, 27767 url: newURL, 27768 id: undefined, 27769 sizeSlug: getSettings().imageDefaultSize 27770 }); 27771 setTemporaryURL(); 27772 } 27773 } 27774 useUploadMediaFromBlobURL({ 27775 url: temporaryURL, 27776 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 27777 onChange: onSelectImage, 27778 onError: onUploadError 27779 }); 27780 const isExternal = isExternalImage(id, url); 27781 const src = isExternal ? url : undefined; 27782 const mediaPreview = !!url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 27783 alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'), 27784 title: (0,external_wp_i18n_namespaceObject.__)('Edit image'), 27785 className: "edit-image-preview", 27786 src: url 27787 }); 27788 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 27789 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 27790 const classes = dist_clsx(className, { 27791 'is-transient': !!temporaryURL, 27792 'is-resized': !!width || !!height, 27793 [`size-$sizeSlug}`]: sizeSlug, 27794 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 27795 }); 27796 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 27797 ref: containerRef, 27798 className: classes 27799 }); 27800 27801 // Much of this description is duplicated from MediaPlaceholder. 27802 const { 27803 lockUrlControls = false, 27804 lockUrlControlsMessage 27805 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 27806 if (!isSingleSelected) { 27807 return {}; 27808 } 27809 const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(metadata?.bindings?.url?.source); 27810 return { 27811 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 27812 select, 27813 context, 27814 args: metadata?.bindings?.url?.args 27815 }), 27816 lockUrlControlsMessage: blockBindingsSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ 27817 (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), blockBindingsSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') 27818 }; 27819 }, [context, isSingleSelected, metadata?.bindings?.url]); 27820 const placeholder = content => { 27821 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 27822 className: dist_clsx('block-editor-media-placeholder', { 27823 [borderProps.className]: !!borderProps.className && !isSingleSelected 27824 }), 27825 icon: !isSmallContainer && (lockUrlControls ? library_plugins : library_image), 27826 withIllustration: !isSingleSelected || isSmallContainer, 27827 label: !isSmallContainer && (0,external_wp_i18n_namespaceObject.__)('Image'), 27828 instructions: !lockUrlControls && !isSmallContainer && (0,external_wp_i18n_namespaceObject.__)('Drag and drop an image, upload, or choose from your library.'), 27829 style: { 27830 aspectRatio: !(width && height) && aspectRatio ? aspectRatio : undefined, 27831 width: height && aspectRatio ? '100%' : width, 27832 height: width && aspectRatio ? '100%' : height, 27833 objectFit: scale, 27834 ...borderProps.style, 27835 ...shadowProps.style 27836 }, 27837 children: [lockUrlControls && !isSmallContainer && lockUrlControlsMessage, !lockUrlControls && !isSmallContainer && content, placeholderResizeListener] 27838 }); 27839 }; 27840 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27841 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 27842 ...blockProps, 27843 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(image_Image, { 27844 temporaryURL: temporaryURL, 27845 attributes: attributes, 27846 setAttributes: setAttributes, 27847 isSingleSelected: isSingleSelected, 27848 insertBlocksAfter: insertBlocksAfter, 27849 onReplace: onReplace, 27850 onSelectImage: onSelectImage, 27851 onSelectURL: onSelectURL, 27852 onUploadError: onUploadError, 27853 context: context, 27854 clientId: clientId, 27855 blockEditingMode: blockEditingMode, 27856 parentLayoutType: parentLayout?.type, 27857 maxContentWidth: maxContentWidth 27858 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 27859 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 27860 icon: library_image 27861 }), 27862 onSelect: onSelectImage, 27863 onSelectURL: onSelectURL, 27864 onError: onUploadError, 27865 placeholder: placeholder, 27866 accept: "image/*", 27867 allowedTypes: constants_ALLOWED_MEDIA_TYPES, 27868 handleUpload: files => files.length === 1, 27869 value: { 27870 id, 27871 src 27872 }, 27873 mediaPreview: mediaPreview, 27874 disableMediaButtons: temporaryURL || url 27875 })] 27876 }), 27877 // The listener cannot be placed as the first element as it will break the in-between inserter. 27878 // See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120 27879 isSingleSelected && isMaxWidthContainerWidth && maxWidthObserver] 27880 }); 27881 } 27882 /* harmony default export */ const image_edit = (ImageEdit); 27883 27884 ;// ./node_modules/@wordpress/block-library/build-module/image/save.js 27885 /** 27886 * External dependencies 27887 */ 27888 27889 27890 /** 27891 * WordPress dependencies 27892 */ 27893 27894 27895 function image_save_save({ 27896 attributes 27897 }) { 27898 const { 27899 url, 27900 alt, 27901 caption, 27902 align, 27903 href, 27904 rel, 27905 linkClass, 27906 width, 27907 height, 27908 aspectRatio, 27909 scale, 27910 id, 27911 linkTarget, 27912 sizeSlug, 27913 title 27914 } = attributes; 27915 const newRel = !rel ? undefined : rel; 27916 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 27917 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 27918 const classes = dist_clsx({ 27919 // All other align classes are handled by block supports. 27920 // `{ align: 'none' }` is unique to transforms for the image block. 27921 alignnone: 'none' === align, 27922 [`size-$sizeSlug}`]: sizeSlug, 27923 'is-resized': width || height, 27924 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 27925 }); 27926 const imageClasses = dist_clsx(borderProps.className, { 27927 [`wp-image-$id}`]: !!id 27928 }); 27929 const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 27930 src: url, 27931 alt: alt, 27932 className: imageClasses || undefined, 27933 style: { 27934 ...borderProps.style, 27935 ...shadowProps.style, 27936 aspectRatio, 27937 objectFit: scale, 27938 width, 27939 height 27940 }, 27941 title: title 27942 }); 27943 const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 27944 children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 27945 className: linkClass, 27946 href: href, 27947 target: linkTarget, 27948 rel: newRel, 27949 children: image 27950 }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 27951 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 27952 tagName: "figcaption", 27953 value: caption 27954 })] 27955 }); 27956 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 27957 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 27958 className: classes 27959 }), 27960 children: figure 27961 }); 27962 } 27963 27964 ;// ./node_modules/@wordpress/block-library/build-module/image/transforms.js 27965 /* wp:polyfill */ 27966 /** 27967 * WordPress dependencies 27968 */ 27969 27970 27971 function stripFirstImage(attributes, { 27972 shortcode 27973 }) { 27974 const { 27975 body 27976 } = document.implementation.createHTMLDocument(''); 27977 body.innerHTML = shortcode.content; 27978 let nodeToRemove = body.querySelector('img'); 27979 27980 // If an image has parents, find the topmost node to remove. 27981 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 27982 nodeToRemove = nodeToRemove.parentNode; 27983 } 27984 if (nodeToRemove) { 27985 nodeToRemove.parentNode.removeChild(nodeToRemove); 27986 } 27987 return body.innerHTML.trim(); 27988 } 27989 function getFirstAnchorAttributeFormHTML(html, attributeName) { 27990 const { 27991 body 27992 } = document.implementation.createHTMLDocument(''); 27993 body.innerHTML = html; 27994 const { 27995 firstElementChild 27996 } = body; 27997 if (firstElementChild && firstElementChild.nodeName === 'A') { 27998 return firstElementChild.getAttribute(attributeName) || undefined; 27999 } 28000 } 28001 const imageSchema = { 28002 img: { 28003 attributes: ['src', 'alt', 'title'], 28004 classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/] 28005 } 28006 }; 28007 const schema = ({ 28008 phrasingContentSchema 28009 }) => ({ 28010 figure: { 28011 require: ['img'], 28012 children: { 28013 ...imageSchema, 28014 a: { 28015 attributes: ['href', 'rel', 'target'], 28016 classes: ['*'], 28017 children: imageSchema 28018 }, 28019 figcaption: { 28020 children: phrasingContentSchema 28021 } 28022 } 28023 } 28024 }); 28025 const image_transforms_transforms = { 28026 from: [{ 28027 type: 'raw', 28028 isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'), 28029 schema, 28030 transform: node => { 28031 // Search both figure and image classes. Alignment could be 28032 // set on either. ID is set on the image. 28033 const className = node.className + ' ' + node.querySelector('img').className; 28034 const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className); 28035 const anchor = node.id === '' ? undefined : node.id; 28036 const align = alignMatches ? alignMatches[1] : undefined; 28037 const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className); 28038 const id = idMatches ? Number(idMatches[1]) : undefined; 28039 const anchorElement = node.querySelector('a'); 28040 const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined; 28041 const href = anchorElement && anchorElement.href ? anchorElement.href : undefined; 28042 const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined; 28043 const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined; 28044 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, { 28045 align, 28046 id, 28047 linkDestination, 28048 href, 28049 rel, 28050 linkClass, 28051 anchor 28052 }); 28053 if ((0,external_wp_blob_namespaceObject.isBlobURL)(attributes.url)) { 28054 attributes.blob = attributes.url; 28055 delete attributes.url; 28056 } 28057 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes); 28058 } 28059 }, { 28060 // Note: when dragging and dropping multiple files onto a gallery this overrides the 28061 // gallery transform in order to add new images to the gallery instead of 28062 // creating a new gallery. 28063 type: 'files', 28064 isMatch(files) { 28065 return files.every(file => file.type.indexOf('image/') === 0); 28066 }, 28067 transform(files) { 28068 const blocks = files.map(file => { 28069 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 28070 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 28071 }); 28072 }); 28073 return blocks; 28074 } 28075 }, { 28076 type: 'shortcode', 28077 tag: 'caption', 28078 attributes: { 28079 url: { 28080 type: 'string', 28081 source: 'attribute', 28082 attribute: 'src', 28083 selector: 'img' 28084 }, 28085 alt: { 28086 type: 'string', 28087 source: 'attribute', 28088 attribute: 'alt', 28089 selector: 'img' 28090 }, 28091 caption: { 28092 shortcode: stripFirstImage 28093 }, 28094 href: { 28095 shortcode: (attributes, { 28096 shortcode 28097 }) => { 28098 return getFirstAnchorAttributeFormHTML(shortcode.content, 'href'); 28099 } 28100 }, 28101 rel: { 28102 shortcode: (attributes, { 28103 shortcode 28104 }) => { 28105 return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel'); 28106 } 28107 }, 28108 linkClass: { 28109 shortcode: (attributes, { 28110 shortcode 28111 }) => { 28112 return getFirstAnchorAttributeFormHTML(shortcode.content, 'class'); 28113 } 28114 }, 28115 id: { 28116 type: 'number', 28117 shortcode: ({ 28118 named: { 28119 id 28120 } 28121 }) => { 28122 if (!id) { 28123 return; 28124 } 28125 return parseInt(id.replace('attachment_', ''), 10); 28126 } 28127 }, 28128 align: { 28129 type: 'string', 28130 shortcode: ({ 28131 named: { 28132 align = 'alignnone' 28133 } 28134 }) => { 28135 return align.replace('align', ''); 28136 } 28137 } 28138 } 28139 }] 28140 }; 28141 /* harmony default export */ const image_transforms = (image_transforms_transforms); 28142 28143 ;// ./node_modules/@wordpress/block-library/build-module/image/index.js 28144 /** 28145 * WordPress dependencies 28146 */ 28147 28148 28149 28150 /** 28151 * Internal dependencies 28152 */ 28153 28154 28155 28156 const image_metadata = { 28157 $schema: "https://schemas.wp.org/trunk/block.json", 28158 apiVersion: 3, 28159 name: "core/image", 28160 title: "Image", 28161 category: "media", 28162 usesContext: ["allowResize", "imageCrop", "fixedHeight", "postId", "postType", "queryId"], 28163 description: "Insert an image to make a visual statement.", 28164 keywords: ["img", "photo", "picture"], 28165 textdomain: "default", 28166 attributes: { 28167 blob: { 28168 type: "string", 28169 role: "local" 28170 }, 28171 url: { 28172 type: "string", 28173 source: "attribute", 28174 selector: "img", 28175 attribute: "src", 28176 role: "content" 28177 }, 28178 alt: { 28179 type: "string", 28180 source: "attribute", 28181 selector: "img", 28182 attribute: "alt", 28183 "default": "", 28184 role: "content" 28185 }, 28186 caption: { 28187 type: "rich-text", 28188 source: "rich-text", 28189 selector: "figcaption", 28190 role: "content" 28191 }, 28192 lightbox: { 28193 type: "object", 28194 enabled: { 28195 type: "boolean" 28196 } 28197 }, 28198 title: { 28199 type: "string", 28200 source: "attribute", 28201 selector: "img", 28202 attribute: "title", 28203 role: "content" 28204 }, 28205 href: { 28206 type: "string", 28207 source: "attribute", 28208 selector: "figure > a", 28209 attribute: "href", 28210 role: "content" 28211 }, 28212 rel: { 28213 type: "string", 28214 source: "attribute", 28215 selector: "figure > a", 28216 attribute: "rel" 28217 }, 28218 linkClass: { 28219 type: "string", 28220 source: "attribute", 28221 selector: "figure > a", 28222 attribute: "class" 28223 }, 28224 id: { 28225 type: "number", 28226 role: "content" 28227 }, 28228 width: { 28229 type: "string" 28230 }, 28231 height: { 28232 type: "string" 28233 }, 28234 aspectRatio: { 28235 type: "string" 28236 }, 28237 scale: { 28238 type: "string" 28239 }, 28240 sizeSlug: { 28241 type: "string" 28242 }, 28243 linkDestination: { 28244 type: "string" 28245 }, 28246 linkTarget: { 28247 type: "string", 28248 source: "attribute", 28249 selector: "figure > a", 28250 attribute: "target" 28251 } 28252 }, 28253 supports: { 28254 interactivity: true, 28255 align: ["left", "center", "right", "wide", "full"], 28256 anchor: true, 28257 color: { 28258 text: false, 28259 background: false 28260 }, 28261 filter: { 28262 duotone: true 28263 }, 28264 spacing: { 28265 margin: true 28266 }, 28267 __experimentalBorder: { 28268 color: true, 28269 radius: true, 28270 width: true, 28271 __experimentalSkipSerialization: true, 28272 __experimentalDefaultControls: { 28273 color: true, 28274 radius: true, 28275 width: true 28276 } 28277 }, 28278 shadow: { 28279 __experimentalSkipSerialization: true 28280 } 28281 }, 28282 selectors: { 28283 border: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 28284 shadow: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 28285 filter: { 28286 duotone: ".wp-block-image img, .wp-block-image .components-placeholder" 28287 } 28288 }, 28289 styles: [{ 28290 name: "default", 28291 label: "Default", 28292 isDefault: true 28293 }, { 28294 name: "rounded", 28295 label: "Rounded" 28296 }], 28297 editorStyle: "wp-block-image-editor", 28298 style: "wp-block-image" 28299 }; 28300 28301 28302 const { 28303 name: image_name 28304 } = image_metadata; 28305 28306 const image_settings = { 28307 icon: library_image, 28308 example: { 28309 attributes: { 28310 sizeSlug: 'large', 28311 url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg', 28312 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 28313 caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.') 28314 } 28315 }, 28316 __experimentalLabel(attributes, { 28317 context 28318 }) { 28319 const customName = attributes?.metadata?.name; 28320 if (context === 'list-view' && customName) { 28321 return customName; 28322 } 28323 if (context === 'accessibility') { 28324 const { 28325 caption, 28326 alt, 28327 url 28328 } = attributes; 28329 if (!url) { 28330 return (0,external_wp_i18n_namespaceObject.__)('Empty'); 28331 } 28332 if (!alt) { 28333 return caption || ''; 28334 } 28335 28336 // This is intended to be read by a screen reader. 28337 // A period simply means a pause, no need to translate it. 28338 return alt + (caption ? '. ' + caption : ''); 28339 } 28340 }, 28341 getEditWrapperProps(attributes) { 28342 return { 28343 'data-align': attributes.align 28344 }; 28345 }, 28346 transforms: image_transforms, 28347 edit: image_edit, 28348 save: image_save_save, 28349 deprecated: image_deprecated 28350 }; 28351 const image_init = () => initBlock({ 28352 name: image_name, 28353 metadata: image_metadata, 28354 settings: image_settings 28355 }); 28356 28357 ;// ./node_modules/@wordpress/icons/build-module/library/comment.js 28358 /** 28359 * WordPress dependencies 28360 */ 28361 28362 28363 const comment = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28364 viewBox: "0 0 24 24", 28365 xmlns: "http://www.w3.org/2000/svg", 28366 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28367 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" 28368 }) 28369 }); 28370 /* harmony default export */ const library_comment = (comment); 28371 28372 ;// ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js 28373 /** 28374 * WordPress dependencies 28375 */ 28376 28377 28378 28379 28380 28381 /** 28382 * Internal dependencies 28383 */ 28384 28385 28386 /** 28387 * Minimum number of comments a user can show using this block. 28388 * 28389 * @type {number} 28390 */ 28391 28392 const MIN_COMMENTS = 1; 28393 /** 28394 * Maximum number of comments a user can show using this block. 28395 * 28396 * @type {number} 28397 */ 28398 const MAX_COMMENTS = 100; 28399 function LatestComments({ 28400 attributes, 28401 setAttributes 28402 }) { 28403 const { 28404 commentsToShow, 28405 displayAvatar, 28406 displayDate, 28407 displayExcerpt 28408 } = attributes; 28409 const serverSideAttributes = { 28410 ...attributes, 28411 style: { 28412 ...attributes?.style, 28413 spacing: undefined 28414 } 28415 }; 28416 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 28417 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 28418 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 28419 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 28420 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 28421 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 28422 resetAll: () => { 28423 setAttributes({ 28424 commentsToShow: 5, 28425 displayAvatar: true, 28426 displayDate: true, 28427 displayExcerpt: true 28428 }); 28429 }, 28430 dropdownMenuProps: dropdownMenuProps, 28431 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 28432 hasValue: () => !displayAvatar, 28433 label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'), 28434 onDeselect: () => setAttributes({ 28435 displayAvatar: true 28436 }), 28437 isShownByDefault: true, 28438 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 28439 __nextHasNoMarginBottom: true, 28440 label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'), 28441 checked: displayAvatar, 28442 onChange: () => setAttributes({ 28443 displayAvatar: !displayAvatar 28444 }) 28445 }) 28446 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 28447 hasValue: () => !displayDate, 28448 label: (0,external_wp_i18n_namespaceObject.__)('Display date'), 28449 onDeselect: () => setAttributes({ 28450 displayDate: true 28451 }), 28452 isShownByDefault: true, 28453 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 28454 __nextHasNoMarginBottom: true, 28455 label: (0,external_wp_i18n_namespaceObject.__)('Display date'), 28456 checked: displayDate, 28457 onChange: () => setAttributes({ 28458 displayDate: !displayDate 28459 }) 28460 }) 28461 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 28462 hasValue: () => !displayExcerpt, 28463 label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), 28464 onDeselect: () => setAttributes({ 28465 displayExcerpt: true 28466 }), 28467 isShownByDefault: true, 28468 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 28469 __nextHasNoMarginBottom: true, 28470 label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), 28471 checked: displayExcerpt, 28472 onChange: () => setAttributes({ 28473 displayExcerpt: !displayExcerpt 28474 }) 28475 }) 28476 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 28477 hasValue: () => commentsToShow !== 5, 28478 label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'), 28479 onDeselect: () => setAttributes({ 28480 commentsToShow: 5 28481 }), 28482 isShownByDefault: true, 28483 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 28484 __nextHasNoMarginBottom: true, 28485 __next40pxDefaultSize: true, 28486 label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'), 28487 value: commentsToShow, 28488 onChange: value => setAttributes({ 28489 commentsToShow: value 28490 }), 28491 min: MIN_COMMENTS, 28492 max: MAX_COMMENTS, 28493 required: true 28494 }) 28495 })] 28496 }) 28497 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 28498 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { 28499 block: "core/latest-comments", 28500 attributes: serverSideAttributes 28501 // The preview uses the site's locale to make it more true to how 28502 // the block appears on the frontend. Setting the locale 28503 // explicitly prevents any middleware from setting it to 'user'. 28504 , 28505 urlQueryArgs: { 28506 _locale: 'site' 28507 } 28508 }) 28509 })] 28510 }); 28511 } 28512 28513 ;// ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js 28514 /** 28515 * WordPress dependencies 28516 */ 28517 28518 28519 /** 28520 * Internal dependencies 28521 */ 28522 28523 const latest_comments_metadata = { 28524 $schema: "https://schemas.wp.org/trunk/block.json", 28525 apiVersion: 3, 28526 name: "core/latest-comments", 28527 title: "Latest Comments", 28528 category: "widgets", 28529 description: "Display a list of your most recent comments.", 28530 keywords: ["recent comments"], 28531 textdomain: "default", 28532 attributes: { 28533 commentsToShow: { 28534 type: "number", 28535 "default": 5, 28536 minimum: 1, 28537 maximum: 100 28538 }, 28539 displayAvatar: { 28540 type: "boolean", 28541 "default": true 28542 }, 28543 displayDate: { 28544 type: "boolean", 28545 "default": true 28546 }, 28547 displayExcerpt: { 28548 type: "boolean", 28549 "default": true 28550 } 28551 }, 28552 supports: { 28553 align: true, 28554 color: { 28555 gradients: true, 28556 link: true, 28557 __experimentalDefaultControls: { 28558 background: true, 28559 text: true, 28560 link: true 28561 } 28562 }, 28563 html: false, 28564 spacing: { 28565 margin: true, 28566 padding: true 28567 }, 28568 typography: { 28569 fontSize: true, 28570 lineHeight: true, 28571 __experimentalFontFamily: true, 28572 __experimentalFontWeight: true, 28573 __experimentalFontStyle: true, 28574 __experimentalTextTransform: true, 28575 __experimentalTextDecoration: true, 28576 __experimentalLetterSpacing: true, 28577 __experimentalDefaultControls: { 28578 fontSize: true 28579 } 28580 }, 28581 interactivity: { 28582 clientNavigation: true 28583 } 28584 }, 28585 editorStyle: "wp-block-latest-comments-editor", 28586 style: "wp-block-latest-comments" 28587 }; 28588 28589 const { 28590 name: latest_comments_name 28591 } = latest_comments_metadata; 28592 28593 const latest_comments_settings = { 28594 icon: library_comment, 28595 example: {}, 28596 edit: LatestComments 28597 }; 28598 const latest_comments_init = () => initBlock({ 28599 name: latest_comments_name, 28600 metadata: latest_comments_metadata, 28601 settings: latest_comments_settings 28602 }); 28603 28604 ;// ./node_modules/@wordpress/icons/build-module/library/post-list.js 28605 /** 28606 * WordPress dependencies 28607 */ 28608 28609 28610 const postList = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28611 viewBox: "0 0 24 24", 28612 xmlns: "http://www.w3.org/2000/svg", 28613 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28614 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" 28615 }) 28616 }); 28617 /* harmony default export */ const post_list = (postList); 28618 28619 ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js 28620 /** 28621 * Internal dependencies 28622 */ 28623 const latest_posts_deprecated_metadata = { 28624 $schema: "https://schemas.wp.org/trunk/block.json", 28625 apiVersion: 3, 28626 name: "core/latest-posts", 28627 title: "Latest Posts", 28628 category: "widgets", 28629 description: "Display a list of your most recent posts.", 28630 keywords: ["recent posts"], 28631 textdomain: "default", 28632 attributes: { 28633 categories: { 28634 type: "array", 28635 items: { 28636 type: "object" 28637 } 28638 }, 28639 selectedAuthor: { 28640 type: "number" 28641 }, 28642 postsToShow: { 28643 type: "number", 28644 "default": 5 28645 }, 28646 displayPostContent: { 28647 type: "boolean", 28648 "default": false 28649 }, 28650 displayPostContentRadio: { 28651 type: "string", 28652 "default": "excerpt" 28653 }, 28654 excerptLength: { 28655 type: "number", 28656 "default": 55 28657 }, 28658 displayAuthor: { 28659 type: "boolean", 28660 "default": false 28661 }, 28662 displayPostDate: { 28663 type: "boolean", 28664 "default": false 28665 }, 28666 postLayout: { 28667 type: "string", 28668 "default": "list" 28669 }, 28670 columns: { 28671 type: "number", 28672 "default": 3 28673 }, 28674 order: { 28675 type: "string", 28676 "default": "desc" 28677 }, 28678 orderBy: { 28679 type: "string", 28680 "default": "date" 28681 }, 28682 displayFeaturedImage: { 28683 type: "boolean", 28684 "default": false 28685 }, 28686 featuredImageAlign: { 28687 type: "string", 28688 "enum": ["left", "center", "right"] 28689 }, 28690 featuredImageSizeSlug: { 28691 type: "string", 28692 "default": "thumbnail" 28693 }, 28694 featuredImageSizeWidth: { 28695 type: "number", 28696 "default": null 28697 }, 28698 featuredImageSizeHeight: { 28699 type: "number", 28700 "default": null 28701 }, 28702 addLinkToFeaturedImage: { 28703 type: "boolean", 28704 "default": false 28705 } 28706 }, 28707 supports: { 28708 align: true, 28709 html: false, 28710 color: { 28711 gradients: true, 28712 link: true, 28713 __experimentalDefaultControls: { 28714 background: true, 28715 text: true, 28716 link: true 28717 } 28718 }, 28719 spacing: { 28720 margin: true, 28721 padding: true 28722 }, 28723 typography: { 28724 fontSize: true, 28725 lineHeight: true, 28726 __experimentalFontFamily: true, 28727 __experimentalFontWeight: true, 28728 __experimentalFontStyle: true, 28729 __experimentalTextTransform: true, 28730 __experimentalTextDecoration: true, 28731 __experimentalLetterSpacing: true, 28732 __experimentalDefaultControls: { 28733 fontSize: true 28734 } 28735 }, 28736 __experimentalBorder: { 28737 radius: true, 28738 color: true, 28739 width: true, 28740 style: true, 28741 __experimentalDefaultControls: { 28742 radius: true, 28743 color: true, 28744 width: true, 28745 style: true 28746 } 28747 }, 28748 interactivity: { 28749 clientNavigation: true 28750 } 28751 }, 28752 editorStyle: "wp-block-latest-posts-editor", 28753 style: "wp-block-latest-posts" 28754 }; 28755 const { 28756 attributes: deprecated_attributes 28757 } = latest_posts_deprecated_metadata; 28758 /* harmony default export */ const latest_posts_deprecated = ([{ 28759 attributes: { 28760 ...deprecated_attributes, 28761 categories: { 28762 type: 'string' 28763 } 28764 }, 28765 supports: { 28766 align: true, 28767 html: false 28768 }, 28769 migrate: oldAttributes => { 28770 // This needs the full category object, not just the ID. 28771 return { 28772 ...oldAttributes, 28773 categories: [{ 28774 id: Number(oldAttributes.categories) 28775 }] 28776 }; 28777 }, 28778 isEligible: ({ 28779 categories 28780 }) => categories && 'string' === typeof categories, 28781 save: () => null 28782 }]); 28783 28784 ;// ./node_modules/@wordpress/icons/build-module/library/align-none.js 28785 /** 28786 * WordPress dependencies 28787 */ 28788 28789 28790 const alignNone = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28791 xmlns: "http://www.w3.org/2000/svg", 28792 viewBox: "0 0 24 24", 28793 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28794 d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" 28795 }) 28796 }); 28797 /* harmony default export */ const align_none = (alignNone); 28798 28799 ;// ./node_modules/@wordpress/icons/build-module/library/position-left.js 28800 /** 28801 * WordPress dependencies 28802 */ 28803 28804 28805 const positionLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28806 xmlns: "http://www.w3.org/2000/svg", 28807 viewBox: "0 0 24 24", 28808 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28809 d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" 28810 }) 28811 }); 28812 /* harmony default export */ const position_left = (positionLeft); 28813 28814 ;// ./node_modules/@wordpress/icons/build-module/library/position-center.js 28815 /** 28816 * WordPress dependencies 28817 */ 28818 28819 28820 const positionCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28821 xmlns: "http://www.w3.org/2000/svg", 28822 viewBox: "0 0 24 24", 28823 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28824 d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" 28825 }) 28826 }); 28827 /* harmony default export */ const position_center = (positionCenter); 28828 28829 ;// ./node_modules/@wordpress/icons/build-module/library/position-right.js 28830 /** 28831 * WordPress dependencies 28832 */ 28833 28834 28835 const positionRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28836 xmlns: "http://www.w3.org/2000/svg", 28837 viewBox: "0 0 24 24", 28838 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28839 d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" 28840 }) 28841 }); 28842 /* harmony default export */ const position_right = (positionRight); 28843 28844 ;// ./node_modules/@wordpress/icons/build-module/library/list.js 28845 /** 28846 * WordPress dependencies 28847 */ 28848 28849 28850 const list = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 28851 viewBox: "0 0 24 24", 28852 xmlns: "http://www.w3.org/2000/svg", 28853 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 28854 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" 28855 }) 28856 }); 28857 /* harmony default export */ const library_list = (list); 28858 28859 ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js 28860 const MIN_EXCERPT_LENGTH = 10; 28861 const MAX_EXCERPT_LENGTH = 100; 28862 const MAX_POSTS_COLUMNS = 6; 28863 const DEFAULT_EXCERPT_LENGTH = 55; 28864 28865 ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js 28866 /* wp:polyfill */ 28867 /** 28868 * External dependencies 28869 */ 28870 28871 28872 /** 28873 * WordPress dependencies 28874 */ 28875 28876 28877 28878 28879 28880 28881 28882 28883 28884 28885 28886 /** 28887 * Internal dependencies 28888 */ 28889 28890 28891 28892 /** 28893 * Module Constants 28894 */ 28895 28896 const CATEGORIES_LIST_QUERY = { 28897 per_page: -1, 28898 context: 'view' 28899 }; 28900 const USERS_LIST_QUERY = { 28901 per_page: -1, 28902 has_published_posts: ['post'], 28903 context: 'view' 28904 }; 28905 function getFeaturedImageDetails(post, size) { 28906 var _image$media_details$; 28907 const image = post._embedded?.['wp:featuredmedia']?.['0']; 28908 return { 28909 url: (_image$media_details$ = image?.media_details?.sizes?.[size]?.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image?.source_url, 28910 alt: image?.alt_text 28911 }; 28912 } 28913 function LatestPostsEdit({ 28914 attributes, 28915 setAttributes 28916 }) { 28917 var _categoriesList$reduc; 28918 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit); 28919 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 28920 const { 28921 postsToShow, 28922 order, 28923 orderBy, 28924 categories, 28925 selectedAuthor, 28926 displayFeaturedImage, 28927 displayPostContentRadio, 28928 displayPostContent, 28929 displayPostDate, 28930 displayAuthor, 28931 postLayout, 28932 columns, 28933 excerptLength, 28934 featuredImageAlign, 28935 featuredImageSizeSlug, 28936 featuredImageSizeWidth, 28937 featuredImageSizeHeight, 28938 addLinkToFeaturedImage 28939 } = attributes; 28940 const { 28941 imageSizes, 28942 latestPosts, 28943 defaultImageWidth, 28944 defaultImageHeight, 28945 categoriesList, 28946 authorList 28947 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 28948 var _settings$imageDimens, _settings$imageDimens2; 28949 const { 28950 getEntityRecords, 28951 getUsers 28952 } = select(external_wp_coreData_namespaceObject.store); 28953 const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 28954 const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : []; 28955 const latestPostsQuery = Object.fromEntries(Object.entries({ 28956 categories: catIds, 28957 author: selectedAuthor, 28958 order, 28959 orderby: orderBy, 28960 per_page: postsToShow, 28961 _embed: 'wp:featuredmedia' 28962 }).filter(([, value]) => typeof value !== 'undefined')); 28963 return { 28964 defaultImageWidth: (_settings$imageDimens = settings.imageDimensions?.[featuredImageSizeSlug]?.width) !== null && _settings$imageDimens !== void 0 ? _settings$imageDimens : 0, 28965 defaultImageHeight: (_settings$imageDimens2 = settings.imageDimensions?.[featuredImageSizeSlug]?.height) !== null && _settings$imageDimens2 !== void 0 ? _settings$imageDimens2 : 0, 28966 imageSizes: settings.imageSizes, 28967 latestPosts: getEntityRecords('postType', 'post', latestPostsQuery), 28968 categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY), 28969 authorList: getUsers(USERS_LIST_QUERY) 28970 }; 28971 }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); 28972 28973 // If a user clicks to a link prevent redirection and show a warning. 28974 const { 28975 createWarningNotice 28976 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 28977 const showRedirectionPreventedNotice = event => { 28978 event.preventDefault(); 28979 createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { 28980 id: `block-library/core/latest-posts/redirection-prevented/$instanceId}`, 28981 type: 'snackbar' 28982 }); 28983 }; 28984 const imageSizeOptions = imageSizes.filter(({ 28985 slug 28986 }) => slug !== 'full').map(({ 28987 name, 28988 slug 28989 }) => ({ 28990 value: slug, 28991 label: name 28992 })); 28993 const categorySuggestions = (_categoriesList$reduc = categoriesList?.reduce((accumulator, category) => ({ 28994 ...accumulator, 28995 [category.name]: category 28996 }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {}; 28997 const selectCategories = tokens => { 28998 const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]); 28999 if (hasNoSuggestion) { 29000 return; 29001 } 29002 // Categories that are already will be objects, while new additions will be strings (the name). 29003 // allCategories nomalizes the array so that they are all objects. 29004 const allCategories = tokens.map(token => { 29005 return typeof token === 'string' ? categorySuggestions[token] : token; 29006 }); 29007 // We do nothing if the category is not selected 29008 // from suggestions. 29009 if (allCategories.includes(null)) { 29010 return false; 29011 } 29012 setAttributes({ 29013 categories: allCategories 29014 }); 29015 }; 29016 const imageAlignmentOptions = [{ 29017 value: 'none', 29018 icon: align_none, 29019 label: (0,external_wp_i18n_namespaceObject.__)('None') 29020 }, { 29021 value: 'left', 29022 icon: position_left, 29023 label: (0,external_wp_i18n_namespaceObject.__)('Left') 29024 }, { 29025 value: 'center', 29026 icon: position_center, 29027 label: (0,external_wp_i18n_namespaceObject.__)('Center') 29028 }, { 29029 value: 'right', 29030 icon: position_right, 29031 label: (0,external_wp_i18n_namespaceObject.__)('Right') 29032 }]; 29033 const hasPosts = !!latestPosts?.length; 29034 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 29035 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 29036 label: (0,external_wp_i18n_namespaceObject.__)('Post content'), 29037 resetAll: () => setAttributes({ 29038 displayPostContent: false, 29039 displayPostContentRadio: 'excerpt', 29040 excerptLength: DEFAULT_EXCERPT_LENGTH 29041 }), 29042 dropdownMenuProps: dropdownMenuProps, 29043 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 29044 hasValue: () => !!displayPostContent, 29045 label: (0,external_wp_i18n_namespaceObject.__)('Post content'), 29046 onDeselect: () => setAttributes({ 29047 displayPostContent: false 29048 }), 29049 isShownByDefault: true, 29050 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 29051 __nextHasNoMarginBottom: true, 29052 label: (0,external_wp_i18n_namespaceObject.__)('Post content'), 29053 checked: displayPostContent, 29054 onChange: value => setAttributes({ 29055 displayPostContent: value 29056 }) 29057 }) 29058 }), displayPostContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 29059 hasValue: () => displayPostContentRadio !== 'excerpt', 29060 label: (0,external_wp_i18n_namespaceObject.__)('Show'), 29061 onDeselect: () => setAttributes({ 29062 displayPostContentRadio: 'excerpt' 29063 }), 29064 isShownByDefault: true, 29065 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { 29066 label: (0,external_wp_i18n_namespaceObject.__)('Show'), 29067 selected: displayPostContentRadio, 29068 options: [{ 29069 label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'), 29070 value: 'excerpt' 29071 }, { 29072 label: (0,external_wp_i18n_namespaceObject.__)('Full post'), 29073 value: 'full_post' 29074 }], 29075 onChange: value => setAttributes({ 29076 displayPostContentRadio: value 29077 }) 29078 }) 29079 }), displayPostContent && displayPostContentRadio === 'excerpt' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 29080 hasValue: () => excerptLength !== DEFAULT_EXCERPT_LENGTH, 29081 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 29082 onDeselect: () => setAttributes({ 29083 excerptLength: DEFAULT_EXCERPT_LENGTH 29084 }), 29085 isShownByDefault: true, 29086 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 29087 __nextHasNoMarginBottom: true, 29088 __next40pxDefaultSize: true, 29089 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 29090 value: excerptLength, 29091 onChange: value => setAttributes({ 29092 excerptLength: value 29093 }), 29094 min: MIN_EXCERPT_LENGTH, 29095 max: MAX_EXCERPT_LENGTH 29096 }) 29097 })] 29098 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 29099 label: (0,external_wp_i18n_namespaceObject.__)('Post meta'), 29100 resetAll: () => setAttributes({ 29101 displayAuthor: false, 29102 displayPostDate: false 29103 }), 29104 dropdownMenuProps: dropdownMenuProps, 29105 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 29106 hasValue: () => !!displayAuthor, 29107 label: (0,external_wp_i18n_namespaceObject.__)('Display author name'), 29108 onDeselect: () => setAttributes({ 29109 displayAuthor: false 29110 }), 29111 isShownByDefault: true, 29112 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 29113 __nextHasNoMarginBottom: true, 29114 label: (0,external_wp_i18n_namespaceObject.__)('Display author name'), 29115 checked: displayAuthor, 29116 onChange: value => setAttributes({ 29117 displayAuthor: value 29118 }) 29119 }) 29120 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 29121 hasValue: () => !!displayPostDate, 29122 label: (0,external_wp_i18n_namespaceObject.__)('Display post date'), 29123 onDeselect: () => setAttributes({ 29124 displayPostDate: false 29125 }), 29126 isShownByDefault: true, 29127 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 29128 __nextHasNoMarginBottom: true, 29129 label: (0,external_wp_i18n_namespaceObject.__)('Display post date'), 29130 checked: displayPostDate, 29131 onChange: value => setAttributes({ 29132 displayPostDate: value 29133 }) 29134 }) 29135 })] 29136 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 29137 title: (0,external_wp_i18n_namespaceObject.__)('Featured image'), 29138 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 29139 __nextHasNoMarginBottom: true, 29140 label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'), 29141 checked: displayFeaturedImage, 29142 onChange: value => setAttributes({ 29143 displayFeaturedImage: value 29144 }) 29145 }), displayFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 29146 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, { 29147 onChange: value => { 29148 const newAttrs = {}; 29149 if (value.hasOwnProperty('width')) { 29150 newAttrs.featuredImageSizeWidth = value.width; 29151 } 29152 if (value.hasOwnProperty('height')) { 29153 newAttrs.featuredImageSizeHeight = value.height; 29154 } 29155 setAttributes(newAttrs); 29156 }, 29157 slug: featuredImageSizeSlug, 29158 width: featuredImageSizeWidth, 29159 height: featuredImageSizeHeight, 29160 imageWidth: defaultImageWidth, 29161 imageHeight: defaultImageHeight, 29162 imageSizeOptions: imageSizeOptions, 29163 imageSizeHelp: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.'), 29164 onChangeImage: value => setAttributes({ 29165 featuredImageSizeSlug: value, 29166 featuredImageSizeWidth: undefined, 29167 featuredImageSizeHeight: undefined 29168 }) 29169 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 29170 className: "editor-latest-posts-image-alignment-control", 29171 __nextHasNoMarginBottom: true, 29172 __next40pxDefaultSize: true, 29173 label: (0,external_wp_i18n_namespaceObject.__)('Image alignment'), 29174 value: featuredImageAlign || 'none', 29175 onChange: value => setAttributes({ 29176 featuredImageAlign: value !== 'none' ? value : undefined 29177 }), 29178 children: imageAlignmentOptions.map(({ 29179 value, 29180 icon, 29181 label 29182 }) => { 29183 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { 29184 value: value, 29185 icon: icon, 29186 label: label 29187 }, value); 29188 }) 29189 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 29190 __nextHasNoMarginBottom: true, 29191 label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'), 29192 checked: addLinkToFeaturedImage, 29193 onChange: value => setAttributes({ 29194 addLinkToFeaturedImage: value 29195 }) 29196 })] 29197 })] 29198 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 29199 title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering'), 29200 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.QueryControls, { 29201 order, 29202 orderBy, 29203 numberOfItems: postsToShow, 29204 onOrderChange: value => setAttributes({ 29205 order: value 29206 }), 29207 onOrderByChange: value => setAttributes({ 29208 orderBy: value 29209 }), 29210 onNumberOfItemsChange: value => setAttributes({ 29211 postsToShow: value 29212 }), 29213 categorySuggestions: categorySuggestions, 29214 onCategoryChange: selectCategories, 29215 selectedCategories: categories, 29216 onAuthorChange: value => setAttributes({ 29217 selectedAuthor: '' !== value ? Number(value) : undefined 29218 }), 29219 authorList: authorList !== null && authorList !== void 0 ? authorList : [], 29220 selectedAuthorId: selectedAuthor 29221 }), postLayout === 'grid' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 29222 __nextHasNoMarginBottom: true, 29223 __next40pxDefaultSize: true, 29224 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 29225 value: columns, 29226 onChange: value => setAttributes({ 29227 columns: value 29228 }), 29229 min: 2, 29230 max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length), 29231 required: true 29232 })] 29233 })] 29234 }); 29235 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 29236 className: dist_clsx({ 29237 'wp-block-latest-posts__list': true, 29238 'is-grid': postLayout === 'grid', 29239 'has-dates': displayPostDate, 29240 'has-author': displayAuthor, 29241 [`columns-$columns}`]: postLayout === 'grid' 29242 }) 29243 }); 29244 if (!hasPosts) { 29245 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 29246 ...blockProps, 29247 children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 29248 icon: library_pin, 29249 label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts'), 29250 children: !Array.isArray(latestPosts) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No posts found.') 29251 })] 29252 }); 29253 } 29254 29255 // Removing posts from display should be instant. 29256 const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts; 29257 const layoutControls = [{ 29258 icon: library_list, 29259 title: (0,external_wp_i18n_namespaceObject._x)('List view', 'Latest posts block display setting'), 29260 onClick: () => setAttributes({ 29261 postLayout: 'list' 29262 }), 29263 isActive: postLayout === 'list' 29264 }, { 29265 icon: library_grid, 29266 title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'Latest posts block display setting'), 29267 onClick: () => setAttributes({ 29268 postLayout: 'grid' 29269 }), 29270 isActive: postLayout === 'grid' 29271 }]; 29272 const dateFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date; 29273 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 29274 children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 29275 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 29276 controls: layoutControls 29277 }) 29278 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 29279 ...blockProps, 29280 children: displayPosts.map(post => { 29281 const titleTrimmed = post.title.rendered.trim(); 29282 let excerpt = post.excerpt.rendered; 29283 const currentAuthor = authorList?.find(author => author.id === post.author); 29284 const excerptElement = document.createElement('div'); 29285 excerptElement.innerHTML = excerpt; 29286 excerpt = excerptElement.textContent || excerptElement.innerText || ''; 29287 const { 29288 url: imageSourceUrl, 29289 alt: featuredImageAlt 29290 } = getFeaturedImageDetails(post, featuredImageSizeSlug); 29291 const imageClasses = dist_clsx({ 29292 'wp-block-latest-posts__featured-image': true, 29293 [`align$featuredImageAlign}`]: !!featuredImageAlign 29294 }); 29295 const renderFeaturedImage = displayFeaturedImage && imageSourceUrl; 29296 const featuredImage = renderFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 29297 src: imageSourceUrl, 29298 alt: featuredImageAlt, 29299 style: { 29300 maxWidth: featuredImageSizeWidth, 29301 maxHeight: featuredImageSizeHeight 29302 } 29303 }); 29304 const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === ''; 29305 const postExcerpt = needsReadMore ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 29306 children: [excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Hidden accessibility text: Post title */ 29307 (0,external_wp_i18n_namespaceObject.__)('… <a>Read more<span>: %1$s</span></a>'), titleTrimmed || (0,external_wp_i18n_namespaceObject.__)('(no title)')), { 29308 a: 29309 /*#__PURE__*/ 29310 // eslint-disable-next-line jsx-a11y/anchor-has-content 29311 (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 29312 className: "wp-block-latest-posts__read-more", 29313 href: post.link, 29314 rel: "noopener noreferrer", 29315 onClick: showRedirectionPreventedNotice 29316 }), 29317 span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 29318 className: "screen-reader-text" 29319 }) 29320 })] 29321 }) : excerpt; 29322 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 29323 children: [renderFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 29324 className: imageClasses, 29325 children: addLinkToFeaturedImage ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 29326 href: post.link, 29327 rel: "noreferrer noopener", 29328 onClick: showRedirectionPreventedNotice, 29329 children: featuredImage 29330 }) : featuredImage 29331 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 29332 className: "wp-block-latest-posts__post-title", 29333 href: post.link, 29334 rel: "noreferrer noopener", 29335 dangerouslySetInnerHTML: !!titleTrimmed ? { 29336 __html: titleTrimmed 29337 } : undefined, 29338 onClick: showRedirectionPreventedNotice, 29339 children: !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null 29340 }), displayAuthor && currentAuthor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 29341 className: "wp-block-latest-posts__post-author", 29342 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: byline. %s: author. */ 29343 (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name) 29344 }), displayPostDate && post.date_gmt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { 29345 dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt), 29346 className: "wp-block-latest-posts__post-date", 29347 children: (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt) 29348 }), displayPostContent && displayPostContentRadio === 'excerpt' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 29349 className: "wp-block-latest-posts__post-excerpt", 29350 children: postExcerpt 29351 }), displayPostContent && displayPostContentRadio === 'full_post' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 29352 className: "wp-block-latest-posts__post-full-content", 29353 dangerouslySetInnerHTML: { 29354 __html: post.content.raw.trim() 29355 } 29356 })] 29357 }, post.id); 29358 }) 29359 })] 29360 }); 29361 } 29362 29363 ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js 29364 /** 29365 * WordPress dependencies 29366 */ 29367 29368 29369 /** 29370 * Internal dependencies 29371 */ 29372 29373 29374 29375 const latest_posts_metadata = { 29376 $schema: "https://schemas.wp.org/trunk/block.json", 29377 apiVersion: 3, 29378 name: "core/latest-posts", 29379 title: "Latest Posts", 29380 category: "widgets", 29381 description: "Display a list of your most recent posts.", 29382 keywords: ["recent posts"], 29383 textdomain: "default", 29384 attributes: { 29385 categories: { 29386 type: "array", 29387 items: { 29388 type: "object" 29389 } 29390 }, 29391 selectedAuthor: { 29392 type: "number" 29393 }, 29394 postsToShow: { 29395 type: "number", 29396 "default": 5 29397 }, 29398 displayPostContent: { 29399 type: "boolean", 29400 "default": false 29401 }, 29402 displayPostContentRadio: { 29403 type: "string", 29404 "default": "excerpt" 29405 }, 29406 excerptLength: { 29407 type: "number", 29408 "default": 55 29409 }, 29410 displayAuthor: { 29411 type: "boolean", 29412 "default": false 29413 }, 29414 displayPostDate: { 29415 type: "boolean", 29416 "default": false 29417 }, 29418 postLayout: { 29419 type: "string", 29420 "default": "list" 29421 }, 29422 columns: { 29423 type: "number", 29424 "default": 3 29425 }, 29426 order: { 29427 type: "string", 29428 "default": "desc" 29429 }, 29430 orderBy: { 29431 type: "string", 29432 "default": "date" 29433 }, 29434 displayFeaturedImage: { 29435 type: "boolean", 29436 "default": false 29437 }, 29438 featuredImageAlign: { 29439 type: "string", 29440 "enum": ["left", "center", "right"] 29441 }, 29442 featuredImageSizeSlug: { 29443 type: "string", 29444 "default": "thumbnail" 29445 }, 29446 featuredImageSizeWidth: { 29447 type: "number", 29448 "default": null 29449 }, 29450 featuredImageSizeHeight: { 29451 type: "number", 29452 "default": null 29453 }, 29454 addLinkToFeaturedImage: { 29455 type: "boolean", 29456 "default": false 29457 } 29458 }, 29459 supports: { 29460 align: true, 29461 html: false, 29462 color: { 29463 gradients: true, 29464 link: true, 29465 __experimentalDefaultControls: { 29466 background: true, 29467 text: true, 29468 link: true 29469 } 29470 }, 29471 spacing: { 29472 margin: true, 29473 padding: true 29474 }, 29475 typography: { 29476 fontSize: true, 29477 lineHeight: true, 29478 __experimentalFontFamily: true, 29479 __experimentalFontWeight: true, 29480 __experimentalFontStyle: true, 29481 __experimentalTextTransform: true, 29482 __experimentalTextDecoration: true, 29483 __experimentalLetterSpacing: true, 29484 __experimentalDefaultControls: { 29485 fontSize: true 29486 } 29487 }, 29488 __experimentalBorder: { 29489 radius: true, 29490 color: true, 29491 width: true, 29492 style: true, 29493 __experimentalDefaultControls: { 29494 radius: true, 29495 color: true, 29496 width: true, 29497 style: true 29498 } 29499 }, 29500 interactivity: { 29501 clientNavigation: true 29502 } 29503 }, 29504 editorStyle: "wp-block-latest-posts-editor", 29505 style: "wp-block-latest-posts" 29506 }; 29507 const { 29508 name: latest_posts_name 29509 } = latest_posts_metadata; 29510 29511 const latest_posts_settings = { 29512 icon: post_list, 29513 example: {}, 29514 edit: LatestPostsEdit, 29515 deprecated: latest_posts_deprecated 29516 }; 29517 const latest_posts_init = () => initBlock({ 29518 name: latest_posts_name, 29519 metadata: latest_posts_metadata, 29520 settings: latest_posts_settings 29521 }); 29522 29523 ;// ./node_modules/@wordpress/block-library/build-module/list/utils.js 29524 /* wp:polyfill */ 29525 /** 29526 * WordPress dependencies 29527 */ 29528 29529 const LIST_STYLES = { 29530 A: 'upper-alpha', 29531 a: 'lower-alpha', 29532 I: 'upper-roman', 29533 i: 'lower-roman' 29534 }; 29535 function createListBlockFromDOMElement(listElement) { 29536 const type = listElement.getAttribute('type'); 29537 const listAttributes = { 29538 ordered: 'OL' === listElement.tagName, 29539 anchor: listElement.id === '' ? undefined : listElement.id, 29540 start: listElement.getAttribute('start') ? parseInt(listElement.getAttribute('start'), 10) : undefined, 29541 reversed: listElement.hasAttribute('reversed') ? true : undefined, 29542 type: type && LIST_STYLES[type] ? LIST_STYLES[type] : undefined 29543 }; 29544 const innerBlocks = Array.from(listElement.children).map(listItem => { 29545 const children = Array.from(listItem.childNodes).filter(node => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0); 29546 children.reverse(); 29547 const [nestedList, ...nodes] = children; 29548 const hasNestedList = nestedList?.tagName === 'UL' || nestedList?.tagName === 'OL'; 29549 if (!hasNestedList) { 29550 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 29551 content: listItem.innerHTML 29552 }); 29553 } 29554 const htmlNodes = nodes.map(node => { 29555 if (node.nodeType === node.TEXT_NODE) { 29556 return node.textContent; 29557 } 29558 return node.outerHTML; 29559 }); 29560 htmlNodes.reverse(); 29561 const childAttributes = { 29562 content: htmlNodes.join('').trim() 29563 }; 29564 const childInnerBlocks = [createListBlockFromDOMElement(nestedList)]; 29565 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', childAttributes, childInnerBlocks); 29566 }); 29567 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', listAttributes, innerBlocks); 29568 } 29569 function migrateToListV2(attributes) { 29570 const { 29571 values, 29572 start, 29573 reversed, 29574 ordered, 29575 type, 29576 ...otherAttributes 29577 } = attributes; 29578 const list = document.createElement(ordered ? 'ol' : 'ul'); 29579 list.innerHTML = values; 29580 if (start) { 29581 list.setAttribute('start', start); 29582 } 29583 if (reversed) { 29584 list.setAttribute('reversed', true); 29585 } 29586 if (type) { 29587 list.setAttribute('type', type); 29588 } 29589 const [listBlock] = (0,external_wp_blocks_namespaceObject.rawHandler)({ 29590 HTML: list.outerHTML 29591 }); 29592 return [{ 29593 ...otherAttributes, 29594 ...listBlock.attributes 29595 }, listBlock.innerBlocks]; 29596 } 29597 function migrateTypeToInlineStyle(attributes) { 29598 const { 29599 type 29600 } = attributes; 29601 if (type && LIST_STYLES[type]) { 29602 return { 29603 ...attributes, 29604 type: LIST_STYLES[type] 29605 }; 29606 } 29607 return attributes; 29608 } 29609 29610 ;// ./node_modules/@wordpress/block-library/build-module/list/deprecated.js 29611 /** 29612 * WordPress dependencies 29613 */ 29614 29615 29616 /** 29617 * Internal dependencies 29618 */ 29619 29620 29621 29622 const v0 = { 29623 attributes: { 29624 ordered: { 29625 type: 'boolean', 29626 default: false, 29627 role: 'content' 29628 }, 29629 values: { 29630 type: 'string', 29631 source: 'html', 29632 selector: 'ol,ul', 29633 multiline: 'li', 29634 __unstableMultilineWrapperTags: ['ol', 'ul'], 29635 default: '', 29636 role: 'content' 29637 }, 29638 type: { 29639 type: 'string' 29640 }, 29641 start: { 29642 type: 'number' 29643 }, 29644 reversed: { 29645 type: 'boolean' 29646 }, 29647 placeholder: { 29648 type: 'string' 29649 } 29650 }, 29651 supports: { 29652 anchor: true, 29653 className: false, 29654 typography: { 29655 fontSize: true, 29656 __experimentalFontFamily: true 29657 }, 29658 color: { 29659 gradients: true, 29660 link: true 29661 }, 29662 __unstablePasteTextInline: true, 29663 __experimentalSelector: 'ol,ul', 29664 __experimentalSlashInserter: true 29665 }, 29666 save({ 29667 attributes 29668 }) { 29669 const { 29670 ordered, 29671 values, 29672 type, 29673 reversed, 29674 start 29675 } = attributes; 29676 const TagName = ordered ? 'ol' : 'ul'; 29677 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 29678 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 29679 type, 29680 reversed, 29681 start 29682 }), 29683 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 29684 value: values, 29685 multiline: "li" 29686 }) 29687 }); 29688 }, 29689 migrate: migrate_font_family, 29690 isEligible({ 29691 style 29692 }) { 29693 return style?.typography?.fontFamily; 29694 } 29695 }; 29696 const list_deprecated_v1 = { 29697 attributes: { 29698 ordered: { 29699 type: 'boolean', 29700 default: false, 29701 role: 'content' 29702 }, 29703 values: { 29704 type: 'string', 29705 source: 'html', 29706 selector: 'ol,ul', 29707 multiline: 'li', 29708 __unstableMultilineWrapperTags: ['ol', 'ul'], 29709 default: '', 29710 role: 'content' 29711 }, 29712 type: { 29713 type: 'string' 29714 }, 29715 start: { 29716 type: 'number' 29717 }, 29718 reversed: { 29719 type: 'boolean' 29720 }, 29721 placeholder: { 29722 type: 'string' 29723 } 29724 }, 29725 supports: { 29726 anchor: true, 29727 className: false, 29728 typography: { 29729 fontSize: true, 29730 __experimentalFontFamily: true, 29731 lineHeight: true, 29732 __experimentalFontStyle: true, 29733 __experimentalFontWeight: true, 29734 __experimentalLetterSpacing: true, 29735 __experimentalTextTransform: true, 29736 __experimentalDefaultControls: { 29737 fontSize: true 29738 } 29739 }, 29740 color: { 29741 gradients: true, 29742 link: true, 29743 __experimentalDefaultControls: { 29744 background: true, 29745 text: true 29746 } 29747 }, 29748 __unstablePasteTextInline: true, 29749 __experimentalSelector: 'ol,ul', 29750 __experimentalSlashInserter: true 29751 }, 29752 save({ 29753 attributes 29754 }) { 29755 const { 29756 ordered, 29757 values, 29758 type, 29759 reversed, 29760 start 29761 } = attributes; 29762 const TagName = ordered ? 'ol' : 'ul'; 29763 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 29764 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 29765 type, 29766 reversed, 29767 start 29768 }), 29769 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 29770 value: values, 29771 multiline: "li" 29772 }) 29773 }); 29774 }, 29775 migrate: migrateToListV2 29776 }; 29777 29778 // In #53301 changed to use the inline style instead of type attribute. 29779 const list_deprecated_v2 = { 29780 attributes: { 29781 ordered: { 29782 type: 'boolean', 29783 default: false, 29784 role: 'content' 29785 }, 29786 values: { 29787 type: 'string', 29788 source: 'html', 29789 selector: 'ol,ul', 29790 multiline: 'li', 29791 __unstableMultilineWrapperTags: ['ol', 'ul'], 29792 default: '', 29793 role: 'content' 29794 }, 29795 type: { 29796 type: 'string' 29797 }, 29798 start: { 29799 type: 'number' 29800 }, 29801 reversed: { 29802 type: 'boolean' 29803 }, 29804 placeholder: { 29805 type: 'string' 29806 } 29807 }, 29808 supports: { 29809 anchor: true, 29810 className: false, 29811 typography: { 29812 fontSize: true, 29813 lineHeight: true, 29814 __experimentalFontFamily: true, 29815 __experimentalFontWeight: true, 29816 __experimentalFontStyle: true, 29817 __experimentalTextTransform: true, 29818 __experimentalTextDecoration: true, 29819 __experimentalLetterSpacing: true, 29820 __experimentalDefaultControls: { 29821 fontSize: true 29822 } 29823 }, 29824 color: { 29825 gradients: true, 29826 link: true, 29827 __experimentalDefaultControls: { 29828 background: true, 29829 text: true 29830 } 29831 }, 29832 spacing: { 29833 margin: true, 29834 padding: true, 29835 __experimentalDefaultControls: { 29836 margin: false, 29837 padding: false 29838 } 29839 }, 29840 __unstablePasteTextInline: true, 29841 __experimentalSelector: 'ol,ul', 29842 __experimentalSlashInserter: true 29843 }, 29844 isEligible({ 29845 type 29846 }) { 29847 return !!type; 29848 }, 29849 save({ 29850 attributes 29851 }) { 29852 const { 29853 ordered, 29854 type, 29855 reversed, 29856 start 29857 } = attributes; 29858 const TagName = ordered ? 'ol' : 'ul'; 29859 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 29860 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 29861 type, 29862 reversed, 29863 start 29864 }), 29865 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 29866 }); 29867 }, 29868 migrate: migrateTypeToInlineStyle 29869 }; 29870 29871 // Version without block support 'className: true'. 29872 const list_deprecated_v3 = { 29873 attributes: { 29874 ordered: { 29875 type: 'boolean', 29876 default: false, 29877 role: 'content' 29878 }, 29879 values: { 29880 type: 'string', 29881 source: 'html', 29882 selector: 'ol,ul', 29883 multiline: 'li', 29884 __unstableMultilineWrapperTags: ['ol', 'ul'], 29885 default: '', 29886 role: 'content' 29887 }, 29888 type: { 29889 type: 'string' 29890 }, 29891 start: { 29892 type: 'number' 29893 }, 29894 reversed: { 29895 type: 'boolean' 29896 }, 29897 placeholder: { 29898 type: 'string' 29899 } 29900 }, 29901 supports: { 29902 anchor: true, 29903 className: false, 29904 typography: { 29905 fontSize: true, 29906 lineHeight: true, 29907 __experimentalFontFamily: true, 29908 __experimentalFontWeight: true, 29909 __experimentalFontStyle: true, 29910 __experimentalTextTransform: true, 29911 __experimentalTextDecoration: true, 29912 __experimentalLetterSpacing: true, 29913 __experimentalDefaultControls: { 29914 fontSize: true 29915 } 29916 }, 29917 color: { 29918 gradients: true, 29919 link: true, 29920 __experimentalDefaultControls: { 29921 background: true, 29922 text: true 29923 } 29924 }, 29925 spacing: { 29926 margin: true, 29927 padding: true, 29928 __experimentalDefaultControls: { 29929 margin: false, 29930 padding: false 29931 } 29932 }, 29933 __unstablePasteTextInline: true, 29934 __experimentalSelector: 'ol,ul', 29935 __experimentalOnMerge: 'true', 29936 __experimentalSlashInserter: true 29937 }, 29938 save({ 29939 attributes 29940 }) { 29941 const { 29942 ordered, 29943 type, 29944 reversed, 29945 start 29946 } = attributes; 29947 const TagName = ordered ? 'ol' : 'ul'; 29948 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 29949 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 29950 reversed, 29951 start, 29952 style: { 29953 listStyleType: ordered && type !== 'decimal' ? type : undefined 29954 } 29955 }), 29956 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 29957 }); 29958 } 29959 }; 29960 29961 /** 29962 * New deprecations need to be placed first 29963 * for them to have higher priority. 29964 * 29965 * Old deprecations may need to be updated as well. 29966 * 29967 * See block-deprecation.md 29968 */ 29969 /* harmony default export */ const list_deprecated = ([list_deprecated_v3, list_deprecated_v2, list_deprecated_v1, v0]); 29970 29971 ;// ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js 29972 /** 29973 * WordPress dependencies 29974 */ 29975 29976 29977 const formatOutdentRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 29978 xmlns: "http://www.w3.org/2000/svg", 29979 viewBox: "0 0 24 24", 29980 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 29981 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" 29982 }) 29983 }); 29984 /* harmony default export */ const format_outdent_rtl = (formatOutdentRTL); 29985 29986 ;// ./node_modules/@wordpress/icons/build-module/library/format-outdent.js 29987 /** 29988 * WordPress dependencies 29989 */ 29990 29991 29992 const formatOutdent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 29993 xmlns: "http://www.w3.org/2000/svg", 29994 viewBox: "0 0 24 24", 29995 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 29996 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" 29997 }) 29998 }); 29999 /* harmony default export */ const format_outdent = (formatOutdent); 30000 30001 ;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js 30002 /** 30003 * WordPress dependencies 30004 */ 30005 30006 30007 const formatListBulletsRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30008 xmlns: "http://www.w3.org/2000/svg", 30009 viewBox: "0 0 24 24", 30010 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30011 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" 30012 }) 30013 }); 30014 /* harmony default export */ const format_list_bullets_rtl = (formatListBulletsRTL); 30015 30016 ;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js 30017 /** 30018 * WordPress dependencies 30019 */ 30020 30021 30022 const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30023 xmlns: "http://www.w3.org/2000/svg", 30024 viewBox: "0 0 24 24", 30025 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30026 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" 30027 }) 30028 }); 30029 /* harmony default export */ const format_list_bullets = (formatListBullets); 30030 30031 ;// ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js 30032 /** 30033 * WordPress dependencies 30034 */ 30035 30036 30037 const formatListNumberedRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30038 xmlns: "http://www.w3.org/2000/svg", 30039 viewBox: "0 0 24 24", 30040 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30041 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" 30042 }) 30043 }); 30044 /* harmony default export */ const format_list_numbered_rtl = (formatListNumberedRTL); 30045 30046 ;// ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js 30047 /** 30048 * WordPress dependencies 30049 */ 30050 30051 30052 const formatListNumbered = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30053 xmlns: "http://www.w3.org/2000/svg", 30054 viewBox: "0 0 24 24", 30055 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30056 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" 30057 }) 30058 }); 30059 /* harmony default export */ const format_list_numbered = (formatListNumbered); 30060 30061 ;// external ["wp","deprecated"] 30062 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 30063 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 30064 ;// ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js 30065 /** 30066 * WordPress dependencies 30067 */ 30068 30069 30070 30071 30072 const OrderedListSettings = ({ 30073 setAttributes, 30074 reversed, 30075 start, 30076 type 30077 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 30078 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 30079 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 30080 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 30081 __next40pxDefaultSize: true, 30082 __nextHasNoMarginBottom: true, 30083 label: (0,external_wp_i18n_namespaceObject.__)('List style'), 30084 options: [{ 30085 label: (0,external_wp_i18n_namespaceObject.__)('Numbers'), 30086 value: 'decimal' 30087 }, { 30088 label: (0,external_wp_i18n_namespaceObject.__)('Uppercase letters'), 30089 value: 'upper-alpha' 30090 }, { 30091 label: (0,external_wp_i18n_namespaceObject.__)('Lowercase letters'), 30092 value: 'lower-alpha' 30093 }, { 30094 label: (0,external_wp_i18n_namespaceObject.__)('Uppercase Roman numerals'), 30095 value: 'upper-roman' 30096 }, { 30097 label: (0,external_wp_i18n_namespaceObject.__)('Lowercase Roman numerals'), 30098 value: 'lower-roman' 30099 }], 30100 value: type, 30101 onChange: newValue => setAttributes({ 30102 type: newValue 30103 }) 30104 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 30105 __next40pxDefaultSize: true, 30106 __nextHasNoMarginBottom: true, 30107 label: (0,external_wp_i18n_namespaceObject.__)('Start value'), 30108 type: "number", 30109 onChange: value => { 30110 const int = parseInt(value, 10); 30111 setAttributes({ 30112 // It should be possible to unset the value, 30113 // e.g. with an empty string. 30114 start: isNaN(int) ? undefined : int 30115 }); 30116 }, 30117 value: Number.isInteger(start) ? start.toString(10) : '', 30118 step: "1" 30119 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 30120 __nextHasNoMarginBottom: true, 30121 label: (0,external_wp_i18n_namespaceObject.__)('Reverse order'), 30122 checked: reversed || false, 30123 onChange: value => { 30124 setAttributes({ 30125 // Unset the attribute if not reversed. 30126 reversed: value || undefined 30127 }); 30128 } 30129 })] 30130 }) 30131 }); 30132 /* harmony default export */ const ordered_list_settings = (OrderedListSettings); 30133 30134 ;// ./node_modules/@wordpress/block-library/build-module/list/tag-name.js 30135 /** 30136 * WordPress dependencies 30137 */ 30138 30139 30140 function TagName(props, ref) { 30141 const { 30142 ordered, 30143 ...extraProps 30144 } = props; 30145 const Tag = ordered ? 'ol' : 'ul'; 30146 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 30147 ref: ref, 30148 ...extraProps 30149 }); 30150 } 30151 /* harmony default export */ const tag_name = ((0,external_wp_element_namespaceObject.forwardRef)(TagName)); 30152 30153 ;// ./node_modules/@wordpress/block-library/build-module/list/edit.js 30154 /** 30155 * WordPress dependencies 30156 */ 30157 30158 30159 30160 30161 30162 30163 30164 30165 30166 /** 30167 * Internal dependencies 30168 */ 30169 30170 30171 30172 30173 const list_edit_DEFAULT_BLOCK = { 30174 name: 'core/list-item' 30175 }; 30176 const list_edit_TEMPLATE = [['core/list-item']]; 30177 const NATIVE_MARGIN_SPACING = 8; 30178 30179 /** 30180 * At the moment, deprecations don't handle create blocks from attributes 30181 * (like when using CPT templates). For this reason, this hook is necessary 30182 * to avoid breaking templates using the old list block format. 30183 * 30184 * @param {Object} attributes Block attributes. 30185 * @param {string} clientId Block client ID. 30186 */ 30187 function useMigrateOnLoad(attributes, clientId) { 30188 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 30189 const { 30190 updateBlockAttributes, 30191 replaceInnerBlocks 30192 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30193 (0,external_wp_element_namespaceObject.useEffect)(() => { 30194 // As soon as the block is loaded, migrate it to the new version. 30195 30196 if (!attributes.values) { 30197 return; 30198 } 30199 const [newAttributes, newInnerBlocks] = migrateToListV2(attributes); 30200 external_wp_deprecated_default()('Value attribute on the list block', { 30201 since: '6.0', 30202 version: '6.5', 30203 alternative: 'inner blocks' 30204 }); 30205 registry.batch(() => { 30206 updateBlockAttributes(clientId, newAttributes); 30207 replaceInnerBlocks(clientId, newInnerBlocks); 30208 }); 30209 }, [attributes.values]); 30210 } 30211 function useOutdentList(clientId) { 30212 const { 30213 replaceBlocks, 30214 selectionChange 30215 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30216 const { 30217 getBlockRootClientId, 30218 getBlockAttributes, 30219 getBlock 30220 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30221 return (0,external_wp_element_namespaceObject.useCallback)(() => { 30222 const parentBlockId = getBlockRootClientId(clientId); 30223 const parentBlockAttributes = getBlockAttributes(parentBlockId); 30224 // Create a new parent block without the inner blocks. 30225 const newParentBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', parentBlockAttributes); 30226 const { 30227 innerBlocks 30228 } = getBlock(clientId); 30229 // Replace the parent block with a new parent block without inner blocks, 30230 // and make the inner blocks siblings of the parent. 30231 replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); 30232 // Select the last child of the list being outdent. 30233 selectionChange(innerBlocks[innerBlocks.length - 1].clientId); 30234 }, [clientId]); 30235 } 30236 function IndentUI({ 30237 clientId 30238 }) { 30239 const outdentList = useOutdentList(clientId); 30240 const canOutdent = (0,external_wp_data_namespaceObject.useSelect)(select => { 30241 const { 30242 getBlockRootClientId, 30243 getBlockName 30244 } = select(external_wp_blockEditor_namespaceObject.store); 30245 return getBlockName(getBlockRootClientId(clientId)) === 'core/list-item'; 30246 }, [clientId]); 30247 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 30248 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 30249 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, 30250 title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), 30251 description: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), 30252 disabled: !canOutdent, 30253 onClick: outdentList 30254 }) 30255 }); 30256 } 30257 function list_edit_Edit({ 30258 attributes, 30259 setAttributes, 30260 clientId, 30261 style 30262 }) { 30263 const { 30264 ordered, 30265 type, 30266 reversed, 30267 start 30268 } = attributes; 30269 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 30270 style: { 30271 ...(external_wp_element_namespaceObject.Platform.isNative && style), 30272 listStyleType: ordered && type !== 'decimal' ? type : undefined 30273 } 30274 }); 30275 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 30276 defaultBlock: list_edit_DEFAULT_BLOCK, 30277 directInsert: true, 30278 template: list_edit_TEMPLATE, 30279 templateLock: false, 30280 templateInsertUpdatesSelection: true, 30281 ...(external_wp_element_namespaceObject.Platform.isNative && { 30282 marginVertical: NATIVE_MARGIN_SPACING, 30283 marginHorizontal: NATIVE_MARGIN_SPACING, 30284 renderAppender: false 30285 }), 30286 __experimentalCaptureToolbars: true 30287 }); 30288 useMigrateOnLoad(attributes, clientId); 30289 const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 30290 group: "block", 30291 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 30292 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets, 30293 title: (0,external_wp_i18n_namespaceObject.__)('Unordered'), 30294 description: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'), 30295 isActive: ordered === false, 30296 onClick: () => { 30297 setAttributes({ 30298 ordered: false 30299 }); 30300 } 30301 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 30302 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered, 30303 title: (0,external_wp_i18n_namespaceObject.__)('Ordered'), 30304 description: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'), 30305 isActive: ordered === true, 30306 onClick: () => { 30307 setAttributes({ 30308 ordered: true 30309 }); 30310 } 30311 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IndentUI, { 30312 clientId: clientId 30313 })] 30314 }); 30315 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 30316 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tag_name, { 30317 ordered: ordered, 30318 reversed: reversed, 30319 start: start, 30320 ...innerBlocksProps 30321 }), controls, ordered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ordered_list_settings, { 30322 setAttributes, 30323 reversed, 30324 start, 30325 type 30326 })] 30327 }); 30328 } 30329 30330 ;// ./node_modules/@wordpress/block-library/build-module/list/save.js 30331 /** 30332 * WordPress dependencies 30333 */ 30334 30335 30336 function list_save_save({ 30337 attributes 30338 }) { 30339 const { 30340 ordered, 30341 type, 30342 reversed, 30343 start 30344 } = attributes; 30345 const TagName = ordered ? 'ol' : 'ul'; 30346 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 30347 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 30348 reversed, 30349 start, 30350 style: { 30351 listStyleType: ordered && type !== 'decimal' ? type : undefined 30352 } 30353 }), 30354 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 30355 }); 30356 } 30357 30358 ;// ./node_modules/@wordpress/block-library/build-module/list/transforms.js 30359 /* wp:polyfill */ 30360 /** 30361 * WordPress dependencies 30362 */ 30363 30364 30365 30366 /** 30367 * Internal dependencies 30368 */ 30369 30370 function getListContentSchema({ 30371 phrasingContentSchema 30372 }) { 30373 const listContentSchema = { 30374 ...phrasingContentSchema, 30375 ul: {}, 30376 ol: { 30377 attributes: ['type', 'start', 'reversed'] 30378 } 30379 }; 30380 30381 // Recursion is needed. 30382 // Possible: ul > li > ul. 30383 // Impossible: ul > ul. 30384 ['ul', 'ol'].forEach(tag => { 30385 listContentSchema[tag].children = { 30386 li: { 30387 children: listContentSchema 30388 } 30389 }; 30390 }); 30391 return listContentSchema; 30392 } 30393 function getListContentFlat(blocks) { 30394 return blocks.flatMap(({ 30395 name, 30396 attributes, 30397 innerBlocks = [] 30398 }) => { 30399 if (name === 'core/list-item') { 30400 return [attributes.content, ...getListContentFlat(innerBlocks)]; 30401 } 30402 return getListContentFlat(innerBlocks); 30403 }); 30404 } 30405 const list_transforms_transforms = { 30406 from: [{ 30407 type: 'block', 30408 isMultiBlock: true, 30409 blocks: ['core/paragraph', 'core/heading'], 30410 transform: blockAttributes => { 30411 let childBlocks = []; 30412 if (blockAttributes.length > 1) { 30413 childBlocks = blockAttributes.map(({ 30414 content 30415 }) => { 30416 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 30417 content 30418 }); 30419 }); 30420 } else if (blockAttributes.length === 1) { 30421 const value = (0,external_wp_richText_namespaceObject.create)({ 30422 html: blockAttributes[0].content 30423 }); 30424 childBlocks = (0,external_wp_richText_namespaceObject.split)(value, '\n').map(result => { 30425 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 30426 content: (0,external_wp_richText_namespaceObject.toHTMLString)({ 30427 value: result 30428 }) 30429 }); 30430 }); 30431 } 30432 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 30433 anchor: blockAttributes.anchor 30434 }, childBlocks); 30435 } 30436 }, { 30437 type: 'raw', 30438 selector: 'ol,ul', 30439 schema: args => ({ 30440 ol: getListContentSchema(args).ol, 30441 ul: getListContentSchema(args).ul 30442 }), 30443 transform: createListBlockFromDOMElement 30444 }, ...['*', '-'].map(prefix => ({ 30445 type: 'prefix', 30446 prefix, 30447 transform(content) { 30448 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 30449 content 30450 })]); 30451 } 30452 })), ...['1.', '1)'].map(prefix => ({ 30453 type: 'prefix', 30454 prefix, 30455 transform(content) { 30456 return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 30457 ordered: true 30458 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { 30459 content 30460 })]); 30461 } 30462 }))], 30463 to: [...['core/paragraph', 'core/heading'].map(block => ({ 30464 type: 'block', 30465 blocks: [block], 30466 transform: (_attributes, childBlocks) => { 30467 return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)(block, { 30468 content 30469 })); 30470 } 30471 }))] 30472 }; 30473 /* harmony default export */ const list_transforms = (list_transforms_transforms); 30474 30475 ;// ./node_modules/@wordpress/block-library/build-module/list/index.js 30476 /** 30477 * WordPress dependencies 30478 */ 30479 30480 30481 30482 /** 30483 * Internal dependencies 30484 */ 30485 30486 30487 30488 const list_metadata = { 30489 $schema: "https://schemas.wp.org/trunk/block.json", 30490 apiVersion: 3, 30491 name: "core/list", 30492 title: "List", 30493 category: "text", 30494 allowedBlocks: ["core/list-item"], 30495 description: "An organized collection of items displayed in a specific order.", 30496 keywords: ["bullet list", "ordered list", "numbered list"], 30497 textdomain: "default", 30498 attributes: { 30499 ordered: { 30500 type: "boolean", 30501 "default": false, 30502 role: "content" 30503 }, 30504 values: { 30505 type: "string", 30506 source: "html", 30507 selector: "ol,ul", 30508 multiline: "li", 30509 __unstableMultilineWrapperTags: ["ol", "ul"], 30510 "default": "", 30511 role: "content" 30512 }, 30513 type: { 30514 type: "string" 30515 }, 30516 start: { 30517 type: "number" 30518 }, 30519 reversed: { 30520 type: "boolean" 30521 }, 30522 placeholder: { 30523 type: "string" 30524 } 30525 }, 30526 supports: { 30527 anchor: true, 30528 html: false, 30529 __experimentalBorder: { 30530 color: true, 30531 radius: true, 30532 style: true, 30533 width: true 30534 }, 30535 typography: { 30536 fontSize: true, 30537 lineHeight: true, 30538 __experimentalFontFamily: true, 30539 __experimentalFontWeight: true, 30540 __experimentalFontStyle: true, 30541 __experimentalTextTransform: true, 30542 __experimentalTextDecoration: true, 30543 __experimentalLetterSpacing: true, 30544 __experimentalDefaultControls: { 30545 fontSize: true 30546 } 30547 }, 30548 color: { 30549 gradients: true, 30550 link: true, 30551 __experimentalDefaultControls: { 30552 background: true, 30553 text: true 30554 } 30555 }, 30556 spacing: { 30557 margin: true, 30558 padding: true, 30559 __experimentalDefaultControls: { 30560 margin: false, 30561 padding: false 30562 } 30563 }, 30564 __unstablePasteTextInline: true, 30565 __experimentalOnMerge: true, 30566 __experimentalSlashInserter: true, 30567 interactivity: { 30568 clientNavigation: true 30569 } 30570 }, 30571 selectors: { 30572 border: ".wp-block-list:not(.wp-block-list .wp-block-list)" 30573 }, 30574 editorStyle: "wp-block-list-editor", 30575 style: "wp-block-list" 30576 }; 30577 30578 30579 const { 30580 name: list_name 30581 } = list_metadata; 30582 30583 const list_settings = { 30584 icon: library_list, 30585 example: { 30586 innerBlocks: [{ 30587 name: 'core/list-item', 30588 attributes: { 30589 content: (0,external_wp_i18n_namespaceObject.__)('Alice.') 30590 } 30591 }, { 30592 name: 'core/list-item', 30593 attributes: { 30594 content: (0,external_wp_i18n_namespaceObject.__)('The White Rabbit.') 30595 } 30596 }, { 30597 name: 'core/list-item', 30598 attributes: { 30599 content: (0,external_wp_i18n_namespaceObject.__)('The Cheshire Cat.') 30600 } 30601 }, { 30602 name: 'core/list-item', 30603 attributes: { 30604 content: (0,external_wp_i18n_namespaceObject.__)('The Mad Hatter.') 30605 } 30606 }, { 30607 name: 'core/list-item', 30608 attributes: { 30609 content: (0,external_wp_i18n_namespaceObject.__)('The Queen of Hearts.') 30610 } 30611 }] 30612 }, 30613 transforms: list_transforms, 30614 edit: list_edit_Edit, 30615 save: list_save_save, 30616 deprecated: list_deprecated 30617 }; 30618 30619 const list_init = () => initBlock({ 30620 name: list_name, 30621 metadata: list_metadata, 30622 settings: list_settings 30623 }); 30624 30625 ;// ./node_modules/@wordpress/icons/build-module/library/list-item.js 30626 /** 30627 * WordPress dependencies 30628 */ 30629 30630 30631 const listItem = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30632 xmlns: "http://www.w3.org/2000/svg", 30633 viewBox: "0 0 24 24", 30634 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30635 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" 30636 }) 30637 }); 30638 /* harmony default export */ const list_item = (listItem); 30639 30640 ;// ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js 30641 /** 30642 * WordPress dependencies 30643 */ 30644 30645 30646 const formatIndentRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30647 xmlns: "http://www.w3.org/2000/svg", 30648 viewBox: "0 0 24 24", 30649 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30650 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" 30651 }) 30652 }); 30653 /* harmony default export */ const format_indent_rtl = (formatIndentRTL); 30654 30655 ;// ./node_modules/@wordpress/icons/build-module/library/format-indent.js 30656 /** 30657 * WordPress dependencies 30658 */ 30659 30660 30661 const formatIndent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 30662 xmlns: "http://www.w3.org/2000/svg", 30663 viewBox: "0 0 24 24", 30664 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 30665 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" 30666 }) 30667 }); 30668 /* harmony default export */ const format_indent = (formatIndent); 30669 30670 ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-indent-list-item.js 30671 /* wp:polyfill */ 30672 /** 30673 * WordPress dependencies 30674 */ 30675 30676 30677 30678 30679 function useIndentListItem(clientId) { 30680 const { 30681 replaceBlocks, 30682 selectionChange, 30683 multiSelect 30684 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30685 const { 30686 getBlock, 30687 getPreviousBlockClientId, 30688 getSelectionStart, 30689 getSelectionEnd, 30690 hasMultiSelection, 30691 getMultiSelectedBlockClientIds 30692 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30693 return (0,external_wp_element_namespaceObject.useCallback)(() => { 30694 const _hasMultiSelection = hasMultiSelection(); 30695 const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId]; 30696 const clonedBlocks = clientIds.map(_clientId => (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(_clientId))); 30697 const previousSiblingId = getPreviousBlockClientId(clientId); 30698 const newListItem = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(previousSiblingId)); 30699 // If the sibling has no innerBlocks, create a new `list` block. 30700 if (!newListItem.innerBlocks?.length) { 30701 newListItem.innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/list')]; 30702 } 30703 // A list item usually has one `list`, but it's possible to have 30704 // more. So we need to preserve the previous `list` blocks and 30705 // merge the new blocks to the last `list`. 30706 newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks); 30707 30708 // We get the selection start/end here, because when 30709 // we replace blocks, the selection is updated too. 30710 const selectionStart = getSelectionStart(); 30711 const selectionEnd = getSelectionEnd(); 30712 // Replace the previous sibling of the block being indented and the indented blocks, 30713 // with a new block whose attributes are equal to the ones of the previous sibling and 30714 // whose descendants are the children of the previous sibling, followed by the indented blocks. 30715 replaceBlocks([previousSiblingId, ...clientIds], [newListItem]); 30716 if (!_hasMultiSelection) { 30717 selectionChange(clonedBlocks[0].clientId, selectionEnd.attributeKey, selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, selectionEnd.offset); 30718 } else { 30719 multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId); 30720 } 30721 return true; 30722 }, [clientId]); 30723 } 30724 30725 ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-outdent-list-item.js 30726 /** 30727 * WordPress dependencies 30728 */ 30729 30730 30731 30732 30733 function useOutdentListItem() { 30734 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 30735 const { 30736 moveBlocksToPosition, 30737 removeBlock, 30738 insertBlock, 30739 updateBlockListSettings 30740 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30741 const { 30742 getBlockRootClientId, 30743 getBlockName, 30744 getBlockOrder, 30745 getBlockIndex, 30746 getSelectedBlockClientIds, 30747 getBlock, 30748 getBlockListSettings 30749 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30750 function getParentListItemId(id) { 30751 const listId = getBlockRootClientId(id); 30752 const parentListItemId = getBlockRootClientId(listId); 30753 if (!parentListItemId) { 30754 return; 30755 } 30756 if (getBlockName(parentListItemId) !== 'core/list-item') { 30757 return; 30758 } 30759 return parentListItemId; 30760 } 30761 return (0,external_wp_element_namespaceObject.useCallback)((clientIds = getSelectedBlockClientIds()) => { 30762 if (!Array.isArray(clientIds)) { 30763 clientIds = [clientIds]; 30764 } 30765 if (!clientIds.length) { 30766 return; 30767 } 30768 const firstClientId = clientIds[0]; 30769 30770 // Can't outdent if it's not a list item. 30771 if (getBlockName(firstClientId) !== 'core/list-item') { 30772 return; 30773 } 30774 const parentListItemId = getParentListItemId(firstClientId); 30775 30776 // Can't outdent if it's at the top level. 30777 if (!parentListItemId) { 30778 return; 30779 } 30780 const parentListId = getBlockRootClientId(firstClientId); 30781 const lastClientId = clientIds[clientIds.length - 1]; 30782 const order = getBlockOrder(parentListId); 30783 const followingListItems = order.slice(getBlockIndex(lastClientId) + 1); 30784 registry.batch(() => { 30785 if (followingListItems.length) { 30786 let nestedListId = getBlockOrder(firstClientId)[0]; 30787 if (!nestedListId) { 30788 const nestedListBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(parentListId), {}, []); 30789 nestedListId = nestedListBlock.clientId; 30790 insertBlock(nestedListBlock, 0, firstClientId, false); 30791 // Immediately update the block list settings, otherwise 30792 // blocks can't be moved here due to canInsert checks. 30793 updateBlockListSettings(nestedListId, getBlockListSettings(parentListId)); 30794 } 30795 moveBlocksToPosition(followingListItems, parentListId, nestedListId); 30796 } 30797 moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1); 30798 if (!getBlockOrder(parentListId).length) { 30799 const shouldSelectParent = false; 30800 removeBlock(parentListId, shouldSelectParent); 30801 } 30802 }); 30803 return true; 30804 }, []); 30805 } 30806 30807 ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-enter.js 30808 /** 30809 * WordPress dependencies 30810 */ 30811 30812 30813 30814 30815 30816 30817 30818 /** 30819 * Internal dependencies 30820 */ 30821 30822 function use_enter_useEnter(props) { 30823 const { 30824 replaceBlocks, 30825 selectionChange 30826 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30827 const { 30828 getBlock, 30829 getBlockRootClientId, 30830 getBlockIndex, 30831 getBlockName 30832 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30833 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 30834 propsRef.current = props; 30835 const outdentListItem = useOutdentListItem(); 30836 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 30837 function onKeyDown(event) { 30838 if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 30839 return; 30840 } 30841 const { 30842 content, 30843 clientId 30844 } = propsRef.current; 30845 if (content.length) { 30846 return; 30847 } 30848 event.preventDefault(); 30849 const canOutdent = getBlockName(getBlockRootClientId(getBlockRootClientId(propsRef.current.clientId))) === 'core/list-item'; 30850 if (canOutdent) { 30851 outdentListItem(); 30852 return; 30853 } 30854 // Here we are in top level list so we need to split. 30855 const topParentListBlock = getBlock(getBlockRootClientId(clientId)); 30856 const blockIndex = getBlockIndex(clientId); 30857 const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ 30858 ...topParentListBlock, 30859 innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) 30860 }); 30861 const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); 30862 // Last list item might contain a `list` block innerBlock 30863 // In that case append remaining innerBlocks blocks. 30864 const after = [...(topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]?.innerBlocks || []), ...topParentListBlock.innerBlocks.slice(blockIndex + 1)]; 30865 const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ 30866 ...topParentListBlock, 30867 innerBlocks: after 30868 })] : []; 30869 replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); 30870 // We manually change the selection here because we are replacing 30871 // a different block than the selected one. 30872 selectionChange(middle.clientId); 30873 } 30874 element.addEventListener('keydown', onKeyDown); 30875 return () => { 30876 element.removeEventListener('keydown', onKeyDown); 30877 }; 30878 }, []); 30879 } 30880 30881 ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-space.js 30882 /** 30883 * WordPress dependencies 30884 */ 30885 30886 30887 30888 30889 30890 /** 30891 * Internal dependencies 30892 */ 30893 30894 30895 function useSpace(clientId) { 30896 const { 30897 getSelectionStart, 30898 getSelectionEnd, 30899 getBlockIndex 30900 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30901 const indentListItem = useIndentListItem(clientId); 30902 const outdentListItem = useOutdentListItem(); 30903 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 30904 function onKeyDown(event) { 30905 const { 30906 keyCode, 30907 shiftKey, 30908 altKey, 30909 metaKey, 30910 ctrlKey 30911 } = event; 30912 if (event.defaultPrevented || keyCode !== external_wp_keycodes_namespaceObject.SPACE && keyCode !== external_wp_keycodes_namespaceObject.TAB || 30913 // Only override when no modifiers are pressed. 30914 altKey || metaKey || ctrlKey) { 30915 return; 30916 } 30917 const selectionStart = getSelectionStart(); 30918 const selectionEnd = getSelectionEnd(); 30919 if (selectionStart.offset === 0 && selectionEnd.offset === 0) { 30920 if (shiftKey) { 30921 // Note that backspace behaviour in defined in onMerge. 30922 if (keyCode === external_wp_keycodes_namespaceObject.TAB) { 30923 if (outdentListItem()) { 30924 event.preventDefault(); 30925 } 30926 } 30927 } else if (getBlockIndex(clientId) !== 0) { 30928 if (indentListItem()) { 30929 event.preventDefault(); 30930 } 30931 } 30932 } 30933 } 30934 element.addEventListener('keydown', onKeyDown); 30935 return () => { 30936 element.removeEventListener('keydown', onKeyDown); 30937 }; 30938 }, [clientId, indentListItem]); 30939 } 30940 30941 ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-merge.js 30942 /** 30943 * WordPress dependencies 30944 */ 30945 30946 30947 30948 /** 30949 * Internal dependencies 30950 */ 30951 30952 function useMerge(clientId, onMerge) { 30953 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 30954 const { 30955 getPreviousBlockClientId, 30956 getNextBlockClientId, 30957 getBlockOrder, 30958 getBlockRootClientId, 30959 getBlockName 30960 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 30961 const { 30962 mergeBlocks, 30963 moveBlocksToPosition 30964 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 30965 const outdentListItem = useOutdentListItem(); 30966 function getTrailingId(id) { 30967 const order = getBlockOrder(id); 30968 if (!order.length) { 30969 return id; 30970 } 30971 return getTrailingId(order[order.length - 1]); 30972 } 30973 function getParentListItemId(id) { 30974 const listId = getBlockRootClientId(id); 30975 const parentListItemId = getBlockRootClientId(listId); 30976 if (!parentListItemId) { 30977 return; 30978 } 30979 if (getBlockName(parentListItemId) !== 'core/list-item') { 30980 return; 30981 } 30982 return parentListItemId; 30983 } 30984 30985 /** 30986 * Return the next list item with respect to the given list item. If none, 30987 * return the next list item of the parent list item if it exists. 30988 * 30989 * @param {string} id A list item client ID. 30990 * @return {?string} The client ID of the next list item. 30991 */ 30992 function _getNextId(id) { 30993 const next = getNextBlockClientId(id); 30994 if (next) { 30995 return next; 30996 } 30997 const parentListItemId = getParentListItemId(id); 30998 if (!parentListItemId) { 30999 return; 31000 } 31001 return _getNextId(parentListItemId); 31002 } 31003 31004 /** 31005 * Given a client ID, return the client ID of the list item on the next 31006 * line, regardless of indentation level. 31007 * 31008 * @param {string} id The client ID of the current list item. 31009 * @return {?string} The client ID of the next list item. 31010 */ 31011 function getNextId(id) { 31012 const order = getBlockOrder(id); 31013 31014 // If the list item does not have a nested list, return the next list 31015 // item. 31016 if (!order.length) { 31017 return _getNextId(id); 31018 } 31019 31020 // Get the first list item in the nested list. 31021 return getBlockOrder(order[0])[0]; 31022 } 31023 return forward => { 31024 function mergeWithNested(clientIdA, clientIdB) { 31025 registry.batch(() => { 31026 // When merging a sub list item with a higher next list item, we 31027 // also need to move any nested list items. Check if there's a 31028 // listed list, and append its nested list items to the current 31029 // list. 31030 const [nestedListClientId] = getBlockOrder(clientIdB); 31031 if (nestedListClientId) { 31032 // If we are merging with the previous list item, and the 31033 // previous list item does not have nested list, move the 31034 // nested list to the previous list item. 31035 if (getPreviousBlockClientId(clientIdB) === clientIdA && !getBlockOrder(clientIdA).length) { 31036 moveBlocksToPosition([nestedListClientId], clientIdB, clientIdA); 31037 } else { 31038 moveBlocksToPosition(getBlockOrder(nestedListClientId), nestedListClientId, getBlockRootClientId(clientIdA)); 31039 } 31040 } 31041 mergeBlocks(clientIdA, clientIdB); 31042 }); 31043 } 31044 if (forward) { 31045 const nextBlockClientId = getNextId(clientId); 31046 if (!nextBlockClientId) { 31047 onMerge(forward); 31048 return; 31049 } 31050 if (getParentListItemId(nextBlockClientId)) { 31051 outdentListItem(nextBlockClientId); 31052 } else { 31053 mergeWithNested(clientId, nextBlockClientId); 31054 } 31055 } else { 31056 // Merging is only done from the top level. For lowel levels, the 31057 // list item is outdented instead. 31058 const previousBlockClientId = getPreviousBlockClientId(clientId); 31059 if (getParentListItemId(clientId)) { 31060 outdentListItem(clientId); 31061 } else if (previousBlockClientId) { 31062 const trailingId = getTrailingId(previousBlockClientId); 31063 mergeWithNested(trailingId, clientId); 31064 } else { 31065 onMerge(forward); 31066 } 31067 } 31068 }; 31069 } 31070 31071 ;// ./node_modules/@wordpress/block-library/build-module/list-item/edit.js 31072 /** 31073 * WordPress dependencies 31074 */ 31075 31076 31077 31078 31079 31080 31081 31082 /** 31083 * Internal dependencies 31084 */ 31085 31086 31087 function edit_IndentUI({ 31088 clientId 31089 }) { 31090 const indentListItem = useIndentListItem(clientId); 31091 const outdentListItem = useOutdentListItem(); 31092 const { 31093 canIndent, 31094 canOutdent 31095 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 31096 const { 31097 getBlockIndex, 31098 getBlockRootClientId, 31099 getBlockName 31100 } = select(external_wp_blockEditor_namespaceObject.store); 31101 return { 31102 canIndent: getBlockIndex(clientId) > 0, 31103 canOutdent: getBlockName(getBlockRootClientId(getBlockRootClientId(clientId))) === 'core/list-item' 31104 }; 31105 }, [clientId]); 31106 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 31107 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 31108 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, 31109 title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), 31110 description: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), 31111 disabled: !canOutdent, 31112 onClick: () => outdentListItem() 31113 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 31114 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent, 31115 title: (0,external_wp_i18n_namespaceObject.__)('Indent'), 31116 description: (0,external_wp_i18n_namespaceObject.__)('Indent list item'), 31117 disabled: !canIndent, 31118 onClick: () => indentListItem() 31119 })] 31120 }); 31121 } 31122 function ListItemEdit({ 31123 attributes, 31124 setAttributes, 31125 clientId, 31126 mergeBlocks 31127 }) { 31128 const { 31129 placeholder, 31130 content 31131 } = attributes; 31132 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 31133 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 31134 renderAppender: false, 31135 __unstableDisableDropZone: true 31136 }); 31137 const useEnterRef = use_enter_useEnter({ 31138 content, 31139 clientId 31140 }); 31141 const useSpaceRef = useSpace(clientId); 31142 const onMerge = useMerge(clientId, mergeBlocks); 31143 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 31144 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 31145 ...innerBlocksProps, 31146 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 31147 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]), 31148 identifier: "content", 31149 tagName: "div", 31150 onChange: nextContent => setAttributes({ 31151 content: nextContent 31152 }), 31153 value: content, 31154 "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'), 31155 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'), 31156 onMerge: onMerge 31157 }), innerBlocksProps.children] 31158 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 31159 group: "block", 31160 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_IndentUI, { 31161 clientId: clientId 31162 }) 31163 })] 31164 }); 31165 } 31166 31167 ;// ./node_modules/@wordpress/block-library/build-module/list-item/save.js 31168 /** 31169 * WordPress dependencies 31170 */ 31171 31172 31173 function list_item_save_save({ 31174 attributes 31175 }) { 31176 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 31177 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 31178 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 31179 value: attributes.content 31180 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})] 31181 }); 31182 } 31183 31184 ;// ./node_modules/@wordpress/block-library/build-module/list-item/transforms.js 31185 /* wp:polyfill */ 31186 /** 31187 * WordPress dependencies 31188 */ 31189 31190 const list_item_transforms_transforms = { 31191 to: [{ 31192 type: 'block', 31193 blocks: ['core/paragraph'], 31194 transform: (attributes, innerBlocks = []) => [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes), ...innerBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))] 31195 }] 31196 }; 31197 /* harmony default export */ const list_item_transforms = (list_item_transforms_transforms); 31198 31199 ;// ./node_modules/@wordpress/block-library/build-module/list-item/index.js 31200 /** 31201 * WordPress dependencies 31202 */ 31203 31204 31205 31206 /** 31207 * Internal dependencies 31208 */ 31209 31210 const list_item_metadata = { 31211 $schema: "https://schemas.wp.org/trunk/block.json", 31212 apiVersion: 3, 31213 name: "core/list-item", 31214 title: "List Item", 31215 category: "text", 31216 parent: ["core/list"], 31217 allowedBlocks: ["core/list"], 31218 description: "An individual item within a list.", 31219 textdomain: "default", 31220 attributes: { 31221 placeholder: { 31222 type: "string" 31223 }, 31224 content: { 31225 type: "rich-text", 31226 source: "rich-text", 31227 selector: "li", 31228 role: "content" 31229 } 31230 }, 31231 supports: { 31232 anchor: true, 31233 className: false, 31234 splitting: true, 31235 __experimentalBorder: { 31236 color: true, 31237 radius: true, 31238 style: true, 31239 width: true 31240 }, 31241 color: { 31242 gradients: true, 31243 link: true, 31244 background: true, 31245 __experimentalDefaultControls: { 31246 text: true 31247 } 31248 }, 31249 spacing: { 31250 margin: true, 31251 padding: true, 31252 __experimentalDefaultControls: { 31253 margin: false, 31254 padding: false 31255 } 31256 }, 31257 typography: { 31258 fontSize: true, 31259 lineHeight: true, 31260 __experimentalFontFamily: true, 31261 __experimentalFontWeight: true, 31262 __experimentalFontStyle: true, 31263 __experimentalTextTransform: true, 31264 __experimentalTextDecoration: true, 31265 __experimentalLetterSpacing: true, 31266 __experimentalDefaultControls: { 31267 fontSize: true 31268 } 31269 }, 31270 interactivity: { 31271 clientNavigation: true 31272 } 31273 }, 31274 selectors: { 31275 root: ".wp-block-list > li", 31276 border: ".wp-block-list:not(.wp-block-list .wp-block-list) > li" 31277 } 31278 }; 31279 31280 31281 31282 31283 const { 31284 name: list_item_name 31285 } = list_item_metadata; 31286 31287 const list_item_settings = { 31288 icon: list_item, 31289 edit: ListItemEdit, 31290 save: list_item_save_save, 31291 merge(attributes, attributesToMerge) { 31292 return { 31293 ...attributes, 31294 content: attributes.content + attributesToMerge.content 31295 }; 31296 }, 31297 transforms: list_item_transforms, 31298 [unlock(external_wp_blockEditor_namespaceObject.privateApis).requiresWrapperOnCopy]: true 31299 }; 31300 const list_item_init = () => initBlock({ 31301 name: list_item_name, 31302 metadata: list_item_metadata, 31303 settings: list_item_settings 31304 }); 31305 31306 ;// ./node_modules/@wordpress/icons/build-module/library/login.js 31307 /** 31308 * WordPress dependencies 31309 */ 31310 31311 31312 const login = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 31313 xmlns: "http://www.w3.org/2000/svg", 31314 viewBox: "0 0 24 24", 31315 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 31316 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" 31317 }) 31318 }); 31319 /* harmony default export */ const library_login = (login); 31320 31321 ;// ./node_modules/@wordpress/block-library/build-module/loginout/edit.js 31322 /** 31323 * WordPress dependencies 31324 */ 31325 31326 31327 31328 /** 31329 * Internal dependencies 31330 */ 31331 31332 31333 function LoginOutEdit({ 31334 attributes, 31335 setAttributes 31336 }) { 31337 const { 31338 displayLoginAsForm, 31339 redirectToCurrent 31340 } = attributes; 31341 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 31342 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 31343 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 31344 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 31345 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 31346 resetAll: () => { 31347 setAttributes({ 31348 displayLoginAsForm: false, 31349 redirectToCurrent: true 31350 }); 31351 }, 31352 dropdownMenuProps: dropdownMenuProps, 31353 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 31354 label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'), 31355 isShownByDefault: true, 31356 hasValue: () => displayLoginAsForm, 31357 onDeselect: () => setAttributes({ 31358 displayLoginAsForm: false 31359 }), 31360 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 31361 __nextHasNoMarginBottom: true, 31362 label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'), 31363 checked: displayLoginAsForm, 31364 onChange: () => setAttributes({ 31365 displayLoginAsForm: !displayLoginAsForm 31366 }) 31367 }) 31368 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 31369 label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'), 31370 isShownByDefault: true, 31371 hasValue: () => !redirectToCurrent, 31372 onDeselect: () => setAttributes({ 31373 redirectToCurrent: true 31374 }), 31375 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 31376 __nextHasNoMarginBottom: true, 31377 label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'), 31378 checked: redirectToCurrent, 31379 onChange: () => setAttributes({ 31380 redirectToCurrent: !redirectToCurrent 31381 }) 31382 }) 31383 })] 31384 }) 31385 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 31386 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 31387 className: 'logged-in' 31388 }), 31389 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 31390 href: "#login-pseudo-link", 31391 children: (0,external_wp_i18n_namespaceObject.__)('Log out') 31392 }) 31393 })] 31394 }); 31395 } 31396 31397 ;// ./node_modules/@wordpress/block-library/build-module/loginout/index.js 31398 /** 31399 * WordPress dependencies 31400 */ 31401 31402 31403 /** 31404 * Internal dependencies 31405 */ 31406 31407 31408 const loginout_metadata = { 31409 $schema: "https://schemas.wp.org/trunk/block.json", 31410 apiVersion: 3, 31411 name: "core/loginout", 31412 title: "Login/out", 31413 category: "theme", 31414 description: "Show login & logout links.", 31415 keywords: ["login", "logout", "form"], 31416 textdomain: "default", 31417 attributes: { 31418 displayLoginAsForm: { 31419 type: "boolean", 31420 "default": false 31421 }, 31422 redirectToCurrent: { 31423 type: "boolean", 31424 "default": true 31425 } 31426 }, 31427 example: { 31428 viewportWidth: 350 31429 }, 31430 supports: { 31431 className: true, 31432 color: { 31433 background: true, 31434 text: false, 31435 gradients: true, 31436 link: true 31437 }, 31438 spacing: { 31439 margin: true, 31440 padding: true, 31441 __experimentalDefaultControls: { 31442 margin: false, 31443 padding: false 31444 } 31445 }, 31446 typography: { 31447 fontSize: true, 31448 lineHeight: true, 31449 __experimentalFontFamily: true, 31450 __experimentalFontWeight: true, 31451 __experimentalFontStyle: true, 31452 __experimentalTextTransform: true, 31453 __experimentalTextDecoration: true, 31454 __experimentalLetterSpacing: true, 31455 __experimentalDefaultControls: { 31456 fontSize: true 31457 } 31458 }, 31459 __experimentalBorder: { 31460 radius: true, 31461 color: true, 31462 width: true, 31463 style: true 31464 }, 31465 interactivity: { 31466 clientNavigation: true 31467 } 31468 }, 31469 style: "wp-block-loginout" 31470 }; 31471 const { 31472 name: loginout_name 31473 } = loginout_metadata; 31474 31475 const loginout_settings = { 31476 icon: library_login, 31477 edit: LoginOutEdit 31478 }; 31479 const loginout_init = () => initBlock({ 31480 name: loginout_name, 31481 metadata: loginout_metadata, 31482 settings: loginout_settings 31483 }); 31484 31485 ;// ./node_modules/@wordpress/icons/build-module/library/media-and-text.js 31486 /** 31487 * WordPress dependencies 31488 */ 31489 31490 31491 const mediaAndText = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 31492 xmlns: "http://www.w3.org/2000/svg", 31493 viewBox: "0 0 24 24", 31494 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 31495 d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z" 31496 }) 31497 }); 31498 /* harmony default export */ const media_and_text = (mediaAndText); 31499 31500 ;// ./node_modules/@wordpress/block-library/build-module/media-text/constants.js 31501 /** 31502 * WordPress dependencies 31503 */ 31504 31505 const constants_DEFAULT_MEDIA_SIZE_SLUG = 'full'; 31506 const WIDTH_CONSTRAINT_PERCENTAGE = 15; 31507 const media_text_constants_LINK_DESTINATION_MEDIA = 'media'; 31508 const media_text_constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; 31509 const constants_TEMPLATE = [['core/paragraph', { 31510 placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder') 31511 }]]; 31512 31513 ;// ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js 31514 /** 31515 * External dependencies 31516 */ 31517 31518 31519 /** 31520 * WordPress dependencies 31521 */ 31522 31523 31524 31525 /** 31526 * Internal dependencies 31527 */ 31528 31529 31530 const v1ToV5ImageFillStyles = (url, focalPoint) => { 31531 return url ? { 31532 backgroundImage: `url($url})`, 31533 backgroundPosition: focalPoint ? `$focalPoint.x * 100}% $focalPoint.y * 100}%` : `50% 50%` 31534 } : {}; 31535 }; 31536 const v6ToV7ImageFillStyles = (url, focalPoint) => { 31537 return url ? { 31538 backgroundImage: `url($url})`, 31539 backgroundPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : `50% 50%` 31540 } : {}; 31541 }; 31542 const DEFAULT_MEDIA_WIDTH = 50; 31543 const noop = () => {}; 31544 const media_text_deprecated_migrateCustomColors = attributes => { 31545 if (!attributes.customBackgroundColor) { 31546 return attributes; 31547 } 31548 const style = { 31549 color: { 31550 background: attributes.customBackgroundColor 31551 } 31552 }; 31553 const { 31554 customBackgroundColor, 31555 ...restAttributes 31556 } = attributes; 31557 return { 31558 ...restAttributes, 31559 style 31560 }; 31561 }; 31562 31563 // After align attribute's default was updated this function explicitly sets 31564 // the align value for deprecated blocks to the `wide` value which was default 31565 // for their versions of this block. 31566 const migrateDefaultAlign = attributes => { 31567 if (attributes.align) { 31568 return attributes; 31569 } 31570 return { 31571 ...attributes, 31572 align: 'wide' 31573 }; 31574 }; 31575 const v0Attributes = { 31576 align: { 31577 type: 'string', 31578 default: 'wide' 31579 }, 31580 mediaAlt: { 31581 type: 'string', 31582 source: 'attribute', 31583 selector: 'figure img', 31584 attribute: 'alt', 31585 default: '' 31586 }, 31587 mediaPosition: { 31588 type: 'string', 31589 default: 'left' 31590 }, 31591 mediaId: { 31592 type: 'number' 31593 }, 31594 mediaType: { 31595 type: 'string' 31596 }, 31597 mediaWidth: { 31598 type: 'number', 31599 default: 50 31600 }, 31601 isStackedOnMobile: { 31602 type: 'boolean', 31603 default: false 31604 } 31605 }; 31606 const v4ToV5BlockAttributes = { 31607 ...v0Attributes, 31608 isStackedOnMobile: { 31609 type: 'boolean', 31610 default: true 31611 }, 31612 mediaUrl: { 31613 type: 'string', 31614 source: 'attribute', 31615 selector: 'figure video,figure img', 31616 attribute: 'src' 31617 }, 31618 mediaLink: { 31619 type: 'string' 31620 }, 31621 linkDestination: { 31622 type: 'string' 31623 }, 31624 linkTarget: { 31625 type: 'string', 31626 source: 'attribute', 31627 selector: 'figure a', 31628 attribute: 'target' 31629 }, 31630 href: { 31631 type: 'string', 31632 source: 'attribute', 31633 selector: 'figure a', 31634 attribute: 'href' 31635 }, 31636 rel: { 31637 type: 'string', 31638 source: 'attribute', 31639 selector: 'figure a', 31640 attribute: 'rel' 31641 }, 31642 linkClass: { 31643 type: 'string', 31644 source: 'attribute', 31645 selector: 'figure a', 31646 attribute: 'class' 31647 }, 31648 mediaSizeSlug: { 31649 type: 'string' 31650 }, 31651 verticalAlignment: { 31652 type: 'string' 31653 }, 31654 imageFill: { 31655 type: 'boolean' 31656 }, 31657 focalPoint: { 31658 type: 'object' 31659 } 31660 }; 31661 const v6Attributes = { 31662 ...v4ToV5BlockAttributes, 31663 mediaAlt: { 31664 type: 'string', 31665 source: 'attribute', 31666 selector: 'figure img', 31667 attribute: 'alt', 31668 default: '', 31669 role: 'content' 31670 }, 31671 mediaId: { 31672 type: 'number', 31673 role: 'content' 31674 }, 31675 mediaUrl: { 31676 type: 'string', 31677 source: 'attribute', 31678 selector: 'figure video,figure img', 31679 attribute: 'src', 31680 role: 'content' 31681 }, 31682 href: { 31683 type: 'string', 31684 source: 'attribute', 31685 selector: 'figure a', 31686 attribute: 'href', 31687 role: 'content' 31688 }, 31689 mediaType: { 31690 type: 'string', 31691 role: 'content' 31692 } 31693 }; 31694 const v7Attributes = { 31695 ...v6Attributes, 31696 align: { 31697 type: 'string', 31698 // v7 changed the default for the `align` attribute. 31699 default: 'none' 31700 }, 31701 // New attribute. 31702 useFeaturedImage: { 31703 type: 'boolean', 31704 default: false 31705 } 31706 }; 31707 const v4ToV5Supports = { 31708 anchor: true, 31709 align: ['wide', 'full'], 31710 html: false, 31711 color: { 31712 gradients: true, 31713 link: true 31714 } 31715 }; 31716 const v6Supports = { 31717 ...v4ToV5Supports, 31718 color: { 31719 gradients: true, 31720 link: true, 31721 __experimentalDefaultControls: { 31722 background: true, 31723 text: true 31724 } 31725 }, 31726 spacing: { 31727 margin: true, 31728 padding: true 31729 }, 31730 typography: { 31731 fontSize: true, 31732 lineHeight: true, 31733 __experimentalFontFamily: true, 31734 __experimentalFontWeight: true, 31735 __experimentalFontStyle: true, 31736 __experimentalTextTransform: true, 31737 __experimentalTextDecoration: true, 31738 __experimentalLetterSpacing: true, 31739 __experimentalDefaultControls: { 31740 fontSize: true 31741 } 31742 } 31743 }; 31744 const v7Supports = { 31745 ...v6Supports, 31746 __experimentalBorder: { 31747 color: true, 31748 radius: true, 31749 style: true, 31750 width: true, 31751 __experimentalDefaultControls: { 31752 color: true, 31753 radius: true, 31754 style: true, 31755 width: true 31756 } 31757 }, 31758 color: { 31759 gradients: true, 31760 heading: true, 31761 link: true, 31762 __experimentalDefaultControls: { 31763 background: true, 31764 text: true 31765 } 31766 }, 31767 interactivity: { 31768 clientNavigation: true 31769 } 31770 }; 31771 31772 // Version with 'none' as the default alignment. 31773 // See: https://github.com/WordPress/gutenberg/pull/64981 31774 const media_text_deprecated_v7 = { 31775 attributes: v7Attributes, 31776 supports: v7Supports, 31777 usesContext: ['postId', 'postType'], 31778 save({ 31779 attributes 31780 }) { 31781 const { 31782 isStackedOnMobile, 31783 mediaAlt, 31784 mediaPosition, 31785 mediaType, 31786 mediaUrl, 31787 mediaWidth, 31788 mediaId, 31789 verticalAlignment, 31790 imageFill, 31791 focalPoint, 31792 linkClass, 31793 href, 31794 linkTarget, 31795 rel 31796 } = attributes; 31797 const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; 31798 const newRel = !rel ? undefined : rel; 31799 const imageClasses = dist_clsx({ 31800 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 31801 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 31802 }); 31803 let image = mediaUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 31804 src: mediaUrl, 31805 alt: mediaAlt, 31806 className: imageClasses || null 31807 }) : null; 31808 if (href) { 31809 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 31810 className: linkClass, 31811 href: href, 31812 target: linkTarget, 31813 rel: newRel, 31814 children: image 31815 }); 31816 } 31817 const mediaTypeRenders = { 31818 image: () => image, 31819 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 31820 controls: true, 31821 src: mediaUrl 31822 }) 31823 }; 31824 const className = dist_clsx({ 31825 'has-media-on-the-right': 'right' === mediaPosition, 31826 'is-stacked-on-mobile': isStackedOnMobile, 31827 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31828 'is-image-fill': imageFill 31829 }); 31830 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 31831 let gridTemplateColumns; 31832 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31833 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31834 } 31835 const style = { 31836 gridTemplateColumns 31837 }; 31838 if ('right' === mediaPosition) { 31839 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 31840 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31841 className, 31842 style 31843 }), 31844 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 31845 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31846 className: 'wp-block-media-text__content' 31847 }) 31848 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 31849 className: "wp-block-media-text__media", 31850 style: backgroundStyles, 31851 children: (mediaTypeRenders[mediaType] || noop)() 31852 })] 31853 }); 31854 } 31855 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 31856 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31857 className, 31858 style 31859 }), 31860 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 31861 className: "wp-block-media-text__media", 31862 style: backgroundStyles, 31863 children: (mediaTypeRenders[mediaType] || noop)() 31864 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 31865 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31866 className: 'wp-block-media-text__content' 31867 }) 31868 })] 31869 }); 31870 } 31871 }; 31872 31873 // Version with wide as the default alignment. 31874 // See: https://github.com/WordPress/gutenberg/pull/48404 31875 const media_text_deprecated_v6 = { 31876 attributes: v6Attributes, 31877 supports: v6Supports, 31878 save({ 31879 attributes 31880 }) { 31881 const { 31882 isStackedOnMobile, 31883 mediaAlt, 31884 mediaPosition, 31885 mediaType, 31886 mediaUrl, 31887 mediaWidth, 31888 mediaId, 31889 verticalAlignment, 31890 imageFill, 31891 focalPoint, 31892 linkClass, 31893 href, 31894 linkTarget, 31895 rel 31896 } = attributes; 31897 const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; 31898 const newRel = !rel ? undefined : rel; 31899 const imageClasses = dist_clsx({ 31900 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 31901 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 31902 }); 31903 let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 31904 src: mediaUrl, 31905 alt: mediaAlt, 31906 className: imageClasses || null 31907 }); 31908 if (href) { 31909 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 31910 className: linkClass, 31911 href: href, 31912 target: linkTarget, 31913 rel: newRel, 31914 children: image 31915 }); 31916 } 31917 const mediaTypeRenders = { 31918 image: () => image, 31919 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 31920 controls: true, 31921 src: mediaUrl 31922 }) 31923 }; 31924 const className = dist_clsx({ 31925 'has-media-on-the-right': 'right' === mediaPosition, 31926 'is-stacked-on-mobile': isStackedOnMobile, 31927 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31928 'is-image-fill': imageFill 31929 }); 31930 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 31931 let gridTemplateColumns; 31932 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31933 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31934 } 31935 const style = { 31936 gridTemplateColumns 31937 }; 31938 if ('right' === mediaPosition) { 31939 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 31940 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31941 className, 31942 style 31943 }), 31944 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 31945 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31946 className: 'wp-block-media-text__content' 31947 }) 31948 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 31949 className: "wp-block-media-text__media", 31950 style: backgroundStyles, 31951 children: (mediaTypeRenders[mediaType] || noop)() 31952 })] 31953 }); 31954 } 31955 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 31956 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 31957 className, 31958 style 31959 }), 31960 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 31961 className: "wp-block-media-text__media", 31962 style: backgroundStyles, 31963 children: (mediaTypeRenders[mediaType] || noop)() 31964 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 31965 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 31966 className: 'wp-block-media-text__content' 31967 }) 31968 })] 31969 }); 31970 }, 31971 migrate: migrateDefaultAlign, 31972 isEligible(attributes, innerBlocks, { 31973 block 31974 }) { 31975 const { 31976 attributes: finalizedAttributes 31977 } = block; 31978 // When the align attribute defaults to none, valid block markup should 31979 // not contain any alignment CSS class. Unfortunately, this 31980 // deprecation's version of the block won't be invalidated due to the 31981 // alignwide class still being in the markup. That is because the custom 31982 // CSS classname support picks it up and adds it to the className 31983 // attribute. At the time of parsing, the className attribute won't 31984 // contain the alignwide class, hence the need to check the finalized 31985 // block attributes. 31986 return attributes.align === undefined && !!finalizedAttributes.className?.includes('alignwide'); 31987 } 31988 }; 31989 31990 // Version with non-rounded background position attribute for focal point. 31991 // See: https://github.com/WordPress/gutenberg/pull/33915 31992 const media_text_deprecated_v5 = { 31993 attributes: v4ToV5BlockAttributes, 31994 supports: v4ToV5Supports, 31995 save({ 31996 attributes 31997 }) { 31998 const { 31999 isStackedOnMobile, 32000 mediaAlt, 32001 mediaPosition, 32002 mediaType, 32003 mediaUrl, 32004 mediaWidth, 32005 mediaId, 32006 verticalAlignment, 32007 imageFill, 32008 focalPoint, 32009 linkClass, 32010 href, 32011 linkTarget, 32012 rel 32013 } = attributes; 32014 const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; 32015 const newRel = !rel ? undefined : rel; 32016 const imageClasses = dist_clsx({ 32017 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 32018 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 32019 }); 32020 let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32021 src: mediaUrl, 32022 alt: mediaAlt, 32023 className: imageClasses || null 32024 }); 32025 if (href) { 32026 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 32027 className: linkClass, 32028 href: href, 32029 target: linkTarget, 32030 rel: newRel, 32031 children: image 32032 }); 32033 } 32034 const mediaTypeRenders = { 32035 image: () => image, 32036 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32037 controls: true, 32038 src: mediaUrl 32039 }) 32040 }; 32041 const className = dist_clsx({ 32042 'has-media-on-the-right': 'right' === mediaPosition, 32043 'is-stacked-on-mobile': isStackedOnMobile, 32044 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32045 'is-image-fill': imageFill 32046 }); 32047 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32048 let gridTemplateColumns; 32049 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32050 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32051 } 32052 const style = { 32053 gridTemplateColumns 32054 }; 32055 if ('right' === mediaPosition) { 32056 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32057 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 32058 className, 32059 style 32060 }), 32061 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32062 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 32063 className: 'wp-block-media-text__content' 32064 }) 32065 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32066 className: "wp-block-media-text__media", 32067 style: backgroundStyles, 32068 children: (mediaTypeRenders[mediaType] || noop)() 32069 })] 32070 }); 32071 } 32072 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32073 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 32074 className, 32075 style 32076 }), 32077 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32078 className: "wp-block-media-text__media", 32079 style: backgroundStyles, 32080 children: (mediaTypeRenders[mediaType] || noop)() 32081 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32082 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 32083 className: 'wp-block-media-text__content' 32084 }) 32085 })] 32086 }); 32087 }, 32088 migrate: migrateDefaultAlign 32089 }; 32090 32091 // Version with CSS grid 32092 // See: https://github.com/WordPress/gutenberg/pull/40806 32093 const media_text_deprecated_v4 = { 32094 attributes: v4ToV5BlockAttributes, 32095 supports: v4ToV5Supports, 32096 save({ 32097 attributes 32098 }) { 32099 const { 32100 isStackedOnMobile, 32101 mediaAlt, 32102 mediaPosition, 32103 mediaType, 32104 mediaUrl, 32105 mediaWidth, 32106 mediaId, 32107 verticalAlignment, 32108 imageFill, 32109 focalPoint, 32110 linkClass, 32111 href, 32112 linkTarget, 32113 rel 32114 } = attributes; 32115 const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; 32116 const newRel = !rel ? undefined : rel; 32117 const imageClasses = dist_clsx({ 32118 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 32119 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 32120 }); 32121 let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32122 src: mediaUrl, 32123 alt: mediaAlt, 32124 className: imageClasses || null 32125 }); 32126 if (href) { 32127 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 32128 className: linkClass, 32129 href: href, 32130 target: linkTarget, 32131 rel: newRel, 32132 children: image 32133 }); 32134 } 32135 const mediaTypeRenders = { 32136 image: () => image, 32137 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32138 controls: true, 32139 src: mediaUrl 32140 }) 32141 }; 32142 const className = dist_clsx({ 32143 'has-media-on-the-right': 'right' === mediaPosition, 32144 'is-stacked-on-mobile': isStackedOnMobile, 32145 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32146 'is-image-fill': imageFill 32147 }); 32148 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32149 let gridTemplateColumns; 32150 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32151 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32152 } 32153 const style = { 32154 gridTemplateColumns 32155 }; 32156 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32157 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 32158 className, 32159 style 32160 }), 32161 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32162 className: "wp-block-media-text__media", 32163 style: backgroundStyles, 32164 children: (mediaTypeRenders[mediaType] || noop)() 32165 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32166 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 32167 className: 'wp-block-media-text__content' 32168 }) 32169 })] 32170 }); 32171 }, 32172 migrate: migrateDefaultAlign 32173 }; 32174 32175 // Version with ad-hoc color attributes 32176 // See: https://github.com/WordPress/gutenberg/pull/21169 32177 const media_text_deprecated_v3 = { 32178 attributes: { 32179 ...v0Attributes, 32180 isStackedOnMobile: { 32181 type: 'boolean', 32182 default: true 32183 }, 32184 backgroundColor: { 32185 type: 'string' 32186 }, 32187 customBackgroundColor: { 32188 type: 'string' 32189 }, 32190 mediaLink: { 32191 type: 'string' 32192 }, 32193 linkDestination: { 32194 type: 'string' 32195 }, 32196 linkTarget: { 32197 type: 'string', 32198 source: 'attribute', 32199 selector: 'figure a', 32200 attribute: 'target' 32201 }, 32202 href: { 32203 type: 'string', 32204 source: 'attribute', 32205 selector: 'figure a', 32206 attribute: 'href' 32207 }, 32208 rel: { 32209 type: 'string', 32210 source: 'attribute', 32211 selector: 'figure a', 32212 attribute: 'rel' 32213 }, 32214 linkClass: { 32215 type: 'string', 32216 source: 'attribute', 32217 selector: 'figure a', 32218 attribute: 'class' 32219 }, 32220 verticalAlignment: { 32221 type: 'string' 32222 }, 32223 imageFill: { 32224 type: 'boolean' 32225 }, 32226 focalPoint: { 32227 type: 'object' 32228 } 32229 }, 32230 migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), 32231 save({ 32232 attributes 32233 }) { 32234 const { 32235 backgroundColor, 32236 customBackgroundColor, 32237 isStackedOnMobile, 32238 mediaAlt, 32239 mediaPosition, 32240 mediaType, 32241 mediaUrl, 32242 mediaWidth, 32243 mediaId, 32244 verticalAlignment, 32245 imageFill, 32246 focalPoint, 32247 linkClass, 32248 href, 32249 linkTarget, 32250 rel 32251 } = attributes; 32252 const newRel = !rel ? undefined : rel; 32253 let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32254 src: mediaUrl, 32255 alt: mediaAlt, 32256 className: mediaId && mediaType === 'image' ? `wp-image-$mediaId}` : null 32257 }); 32258 if (href) { 32259 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 32260 className: linkClass, 32261 href: href, 32262 target: linkTarget, 32263 rel: newRel, 32264 children: image 32265 }); 32266 } 32267 const mediaTypeRenders = { 32268 image: () => image, 32269 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32270 controls: true, 32271 src: mediaUrl 32272 }) 32273 }; 32274 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 32275 const className = dist_clsx({ 32276 'has-media-on-the-right': 'right' === mediaPosition, 32277 'has-background': backgroundClass || customBackgroundColor, 32278 [backgroundClass]: backgroundClass, 32279 'is-stacked-on-mobile': isStackedOnMobile, 32280 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32281 'is-image-fill': imageFill 32282 }); 32283 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32284 let gridTemplateColumns; 32285 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32286 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32287 } 32288 const style = { 32289 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 32290 gridTemplateColumns 32291 }; 32292 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32293 className: className, 32294 style: style, 32295 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32296 className: "wp-block-media-text__media", 32297 style: backgroundStyles, 32298 children: (mediaTypeRenders[mediaType] || noop)() 32299 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32300 className: "wp-block-media-text__content", 32301 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 32302 })] 32303 }); 32304 } 32305 }; 32306 32307 // Version with stack on mobile off by default 32308 // See: https://github.com/WordPress/gutenberg/pull/14364 32309 const media_text_deprecated_v2 = { 32310 attributes: { 32311 ...v0Attributes, 32312 backgroundColor: { 32313 type: 'string' 32314 }, 32315 customBackgroundColor: { 32316 type: 'string' 32317 }, 32318 mediaUrl: { 32319 type: 'string', 32320 source: 'attribute', 32321 selector: 'figure video,figure img', 32322 attribute: 'src' 32323 }, 32324 verticalAlignment: { 32325 type: 'string' 32326 }, 32327 imageFill: { 32328 type: 'boolean' 32329 }, 32330 focalPoint: { 32331 type: 'object' 32332 } 32333 }, 32334 migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), 32335 save({ 32336 attributes 32337 }) { 32338 const { 32339 backgroundColor, 32340 customBackgroundColor, 32341 isStackedOnMobile, 32342 mediaAlt, 32343 mediaPosition, 32344 mediaType, 32345 mediaUrl, 32346 mediaWidth, 32347 mediaId, 32348 verticalAlignment, 32349 imageFill, 32350 focalPoint 32351 } = attributes; 32352 const mediaTypeRenders = { 32353 image: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32354 src: mediaUrl, 32355 alt: mediaAlt, 32356 className: mediaId && mediaType === 'image' ? `wp-image-$mediaId}` : null 32357 }), 32358 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32359 controls: true, 32360 src: mediaUrl 32361 }) 32362 }; 32363 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 32364 const className = dist_clsx({ 32365 'has-media-on-the-right': 'right' === mediaPosition, 32366 [backgroundClass]: backgroundClass, 32367 'is-stacked-on-mobile': isStackedOnMobile, 32368 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32369 'is-image-fill': imageFill 32370 }); 32371 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32372 let gridTemplateColumns; 32373 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32374 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32375 } 32376 const style = { 32377 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 32378 gridTemplateColumns 32379 }; 32380 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32381 className: className, 32382 style: style, 32383 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32384 className: "wp-block-media-text__media", 32385 style: backgroundStyles, 32386 children: (mediaTypeRenders[mediaType] || noop)() 32387 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32388 className: "wp-block-media-text__content", 32389 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 32390 })] 32391 }); 32392 } 32393 }; 32394 32395 // Version without the wp-image-#### class on image 32396 // See: https://github.com/WordPress/gutenberg/pull/11922 32397 const media_text_deprecated_v1 = { 32398 attributes: { 32399 ...v0Attributes, 32400 backgroundColor: { 32401 type: 'string' 32402 }, 32403 customBackgroundColor: { 32404 type: 'string' 32405 }, 32406 mediaUrl: { 32407 type: 'string', 32408 source: 'attribute', 32409 selector: 'figure video,figure img', 32410 attribute: 'src' 32411 } 32412 }, 32413 migrate: migrateDefaultAlign, 32414 save({ 32415 attributes 32416 }) { 32417 const { 32418 backgroundColor, 32419 customBackgroundColor, 32420 isStackedOnMobile, 32421 mediaAlt, 32422 mediaPosition, 32423 mediaType, 32424 mediaUrl, 32425 mediaWidth 32426 } = attributes; 32427 const mediaTypeRenders = { 32428 image: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32429 src: mediaUrl, 32430 alt: mediaAlt 32431 }), 32432 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32433 controls: true, 32434 src: mediaUrl 32435 }) 32436 }; 32437 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 32438 const className = dist_clsx({ 32439 'has-media-on-the-right': 'right' === mediaPosition, 32440 [backgroundClass]: backgroundClass, 32441 'is-stacked-on-mobile': isStackedOnMobile 32442 }); 32443 let gridTemplateColumns; 32444 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32445 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32446 } 32447 const style = { 32448 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 32449 gridTemplateColumns 32450 }; 32451 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 32452 className: className, 32453 style: style, 32454 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 32455 className: "wp-block-media-text__media", 32456 children: (mediaTypeRenders[mediaType] || noop)() 32457 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 32458 className: "wp-block-media-text__content", 32459 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 32460 })] 32461 }); 32462 } 32463 }; 32464 /* harmony default export */ const media_text_deprecated = ([media_text_deprecated_v7, media_text_deprecated_v6, media_text_deprecated_v5, media_text_deprecated_v4, media_text_deprecated_v3, media_text_deprecated_v2, media_text_deprecated_v1]); 32465 32466 ;// ./node_modules/@wordpress/icons/build-module/library/pull-left.js 32467 /** 32468 * WordPress dependencies 32469 */ 32470 32471 32472 const pullLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 32473 xmlns: "http://www.w3.org/2000/svg", 32474 viewBox: "0 0 24 24", 32475 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 32476 d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z" 32477 }) 32478 }); 32479 /* harmony default export */ const pull_left = (pullLeft); 32480 32481 ;// ./node_modules/@wordpress/icons/build-module/library/pull-right.js 32482 /** 32483 * WordPress dependencies 32484 */ 32485 32486 32487 const pullRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 32488 xmlns: "http://www.w3.org/2000/svg", 32489 viewBox: "0 0 24 24", 32490 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 32491 d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z" 32492 }) 32493 }); 32494 /* harmony default export */ const pull_right = (pullRight); 32495 32496 ;// ./node_modules/@wordpress/icons/build-module/library/media.js 32497 /** 32498 * WordPress dependencies 32499 */ 32500 32501 32502 const media = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 32503 xmlns: "http://www.w3.org/2000/svg", 32504 viewBox: "0 0 24 24", 32505 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 32506 d: "m7 6.5 4 2.5-4 2.5z" 32507 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 32508 fillRule: "evenodd", 32509 clipRule: "evenodd", 32510 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" 32511 })] 32512 }); 32513 /* harmony default export */ const library_media = (media); 32514 32515 ;// ./node_modules/@wordpress/block-library/build-module/media-text/image-fill.js 32516 function imageFillStyles(url, focalPoint) { 32517 return url ? { 32518 objectPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : `50% 50%` 32519 } : {}; 32520 } 32521 32522 ;// ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js 32523 /** 32524 * External dependencies 32525 */ 32526 32527 32528 /** 32529 * WordPress dependencies 32530 */ 32531 32532 32533 32534 32535 32536 32537 32538 32539 32540 32541 /** 32542 * Internal dependencies 32543 */ 32544 32545 32546 /** 32547 * Constants 32548 */ 32549 32550 const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video']; 32551 const media_container_noop = () => {}; 32552 const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)(({ 32553 isSelected, 32554 isStackedOnMobile, 32555 ...props 32556 }, ref) => { 32557 const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); 32558 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 32559 ref: ref, 32560 showHandle: isSelected && (!isMobile || !isStackedOnMobile), 32561 ...props 32562 }); 32563 }); 32564 function ToolbarEditButton({ 32565 mediaId, 32566 mediaUrl, 32567 onSelectMedia, 32568 toggleUseFeaturedImage, 32569 useFeaturedImage 32570 }) { 32571 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 32572 group: "other", 32573 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 32574 mediaId: mediaId, 32575 mediaURL: mediaUrl, 32576 allowedTypes: media_container_ALLOWED_MEDIA_TYPES, 32577 accept: "image/*,video/*", 32578 onSelect: onSelectMedia, 32579 onToggleFeaturedImage: toggleUseFeaturedImage, 32580 useFeaturedImage: useFeaturedImage, 32581 onReset: () => onSelectMedia(undefined) 32582 }) 32583 }); 32584 } 32585 function PlaceholderContainer({ 32586 className, 32587 mediaUrl, 32588 onSelectMedia, 32589 toggleUseFeaturedImage 32590 }) { 32591 const { 32592 createErrorNotice 32593 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 32594 const onUploadError = message => { 32595 createErrorNotice(message, { 32596 type: 'snackbar' 32597 }); 32598 }; 32599 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 32600 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 32601 icon: library_media 32602 }), 32603 labels: { 32604 title: (0,external_wp_i18n_namespaceObject.__)('Media area') 32605 }, 32606 className: className, 32607 onSelect: onSelectMedia, 32608 accept: "image/*,video/*", 32609 onToggleFeaturedImage: toggleUseFeaturedImage, 32610 allowedTypes: media_container_ALLOWED_MEDIA_TYPES, 32611 onError: onUploadError, 32612 disableMediaButtons: mediaUrl 32613 }); 32614 } 32615 function MediaContainer(props, ref) { 32616 const { 32617 className, 32618 commitWidthChange, 32619 focalPoint, 32620 imageFill, 32621 isSelected, 32622 isStackedOnMobile, 32623 mediaAlt, 32624 mediaId, 32625 mediaPosition, 32626 mediaType, 32627 mediaUrl, 32628 mediaWidth, 32629 onSelectMedia, 32630 onWidthChange, 32631 enableResize, 32632 toggleUseFeaturedImage, 32633 useFeaturedImage, 32634 featuredImageURL, 32635 featuredImageAlt, 32636 refMedia 32637 } = props; 32638 const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl); 32639 const { 32640 toggleSelection 32641 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 32642 if (mediaUrl || featuredImageURL || useFeaturedImage) { 32643 const onResizeStart = () => { 32644 toggleSelection(false); 32645 }; 32646 const onResize = (event, direction, elt) => { 32647 onWidthChange(parseInt(elt.style.width)); 32648 }; 32649 const onResizeStop = (event, direction, elt) => { 32650 toggleSelection(true); 32651 commitWidthChange(parseInt(elt.style.width)); 32652 }; 32653 const enablePositions = { 32654 right: enableResize && mediaPosition === 'left', 32655 left: enableResize && mediaPosition === 'right' 32656 }; 32657 const positionStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl || featuredImageURL, focalPoint) : {}; 32658 const mediaTypeRenderers = { 32659 image: () => useFeaturedImage && featuredImageURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32660 ref: refMedia, 32661 src: featuredImageURL, 32662 alt: featuredImageAlt, 32663 style: positionStyles 32664 }) : mediaUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 32665 ref: refMedia, 32666 src: mediaUrl, 32667 alt: mediaAlt, 32668 style: positionStyles 32669 }), 32670 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 32671 controls: true, 32672 ref: refMedia, 32673 src: mediaUrl 32674 }) 32675 }; 32676 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ResizableBoxContainer, { 32677 as: "figure", 32678 className: dist_clsx(className, 'editor-media-container__resizer', { 32679 'is-transient': isTemporaryMedia 32680 }), 32681 size: { 32682 width: mediaWidth + '%' 32683 }, 32684 minWidth: "10%", 32685 maxWidth: "100%", 32686 enable: enablePositions, 32687 onResizeStart: onResizeStart, 32688 onResize: onResize, 32689 onResizeStop: onResizeStop, 32690 axis: "x", 32691 isSelected: isSelected, 32692 isStackedOnMobile: isStackedOnMobile, 32693 ref: ref, 32694 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarEditButton, { 32695 onSelectMedia: onSelectMedia, 32696 mediaUrl: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 32697 mediaId: mediaId, 32698 toggleUseFeaturedImage: toggleUseFeaturedImage 32699 }), (mediaTypeRenderers[mediaType] || media_container_noop)(), isTemporaryMedia && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContainer, { 32700 ...props 32701 }), !featuredImageURL && useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 32702 className: "wp-block-media-text--placeholder-image", 32703 style: positionStyles, 32704 withIllustration: true 32705 })] 32706 }); 32707 } 32708 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContainer, { 32709 ...props 32710 }); 32711 } 32712 /* harmony default export */ const media_container = ((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)); 32713 32714 ;// ./node_modules/@wordpress/block-library/build-module/media-text/edit.js 32715 /* wp:polyfill */ 32716 /** 32717 * External dependencies 32718 */ 32719 32720 32721 /** 32722 * WordPress dependencies 32723 */ 32724 32725 32726 32727 32728 32729 32730 32731 32732 32733 /** 32734 * Internal dependencies 32735 */ 32736 32737 32738 32739 32740 32741 const { 32742 ResolutionTool: edit_ResolutionTool 32743 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 32744 32745 // this limits the resize to a safe zone to avoid making broken layouts 32746 const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE)); 32747 function getImageSourceUrlBySizeSlug(image, slug) { 32748 // eslint-disable-next-line camelcase 32749 return image?.media_details?.sizes?.[slug]?.source_url; 32750 } 32751 function edit_attributesFromMedia({ 32752 attributes: { 32753 linkDestination, 32754 href 32755 }, 32756 setAttributes 32757 }) { 32758 return media => { 32759 if (!media || !media.url) { 32760 setAttributes({ 32761 mediaAlt: undefined, 32762 mediaId: undefined, 32763 mediaType: undefined, 32764 mediaUrl: undefined, 32765 mediaLink: undefined, 32766 href: undefined, 32767 focalPoint: undefined, 32768 useFeaturedImage: false 32769 }); 32770 return; 32771 } 32772 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 32773 media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); 32774 } 32775 let mediaType; 32776 let src; 32777 // For media selections originated from a file upload. 32778 if (media.media_type) { 32779 if (media.media_type === 'image') { 32780 mediaType = 'image'; 32781 } else { 32782 // only images and videos are accepted so if the media_type is not an image we can assume it is a video. 32783 // video contain the media type of 'file' in the object returned from the rest api. 32784 mediaType = 'video'; 32785 } 32786 } else { 32787 // For media selections originated from existing files in the media library. 32788 mediaType = media.type; 32789 } 32790 if (mediaType === 'image') { 32791 // Try the "large" size URL, falling back to the "full" size URL below. 32792 src = media.sizes?.large?.url || 32793 // eslint-disable-next-line camelcase 32794 media.media_details?.sizes?.large?.source_url; 32795 } 32796 let newHref = href; 32797 if (linkDestination === media_text_constants_LINK_DESTINATION_MEDIA) { 32798 // Update the media link. 32799 newHref = media.url; 32800 } 32801 32802 // Check if the image is linked to the attachment page. 32803 if (linkDestination === media_text_constants_LINK_DESTINATION_ATTACHMENT) { 32804 // Update the media link. 32805 newHref = media.link; 32806 } 32807 setAttributes({ 32808 mediaAlt: media.alt, 32809 mediaId: media.id, 32810 mediaType, 32811 mediaUrl: src || media.url, 32812 mediaLink: media.link || undefined, 32813 href: newHref, 32814 focalPoint: undefined, 32815 useFeaturedImage: false 32816 }); 32817 }; 32818 } 32819 function MediaTextResolutionTool({ 32820 image, 32821 value, 32822 onChange 32823 }) { 32824 const { 32825 imageSizes 32826 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32827 const { 32828 getSettings 32829 } = select(external_wp_blockEditor_namespaceObject.store); 32830 return { 32831 imageSizes: getSettings().imageSizes 32832 }; 32833 }, []); 32834 if (!imageSizes?.length) { 32835 return null; 32836 } 32837 const imageSizeOptions = imageSizes.filter(({ 32838 slug 32839 }) => getImageSourceUrlBySizeSlug(image, slug)).map(({ 32840 name, 32841 slug 32842 }) => ({ 32843 value: slug, 32844 label: name 32845 })); 32846 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ResolutionTool, { 32847 value: value, 32848 defaultValue: constants_DEFAULT_MEDIA_SIZE_SLUG, 32849 options: imageSizeOptions, 32850 onChange: onChange 32851 }); 32852 } 32853 function MediaTextEdit({ 32854 attributes, 32855 isSelected, 32856 setAttributes, 32857 context: { 32858 postId, 32859 postType 32860 } 32861 }) { 32862 const { 32863 focalPoint, 32864 href, 32865 imageFill, 32866 isStackedOnMobile, 32867 linkClass, 32868 linkDestination, 32869 linkTarget, 32870 mediaAlt, 32871 mediaId, 32872 mediaPosition, 32873 mediaType, 32874 mediaUrl, 32875 mediaWidth, 32876 mediaSizeSlug, 32877 rel, 32878 verticalAlignment, 32879 allowedBlocks, 32880 useFeaturedImage 32881 } = attributes; 32882 const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); 32883 const { 32884 featuredImageMedia 32885 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32886 return { 32887 featuredImageMedia: featuredImage && useFeaturedImage ? select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { 32888 context: 'view' 32889 }) : undefined 32890 }; 32891 }, [featuredImage, useFeaturedImage]); 32892 const { 32893 image 32894 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 32895 return { 32896 image: mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, { 32897 context: 'view' 32898 }) : null 32899 }; 32900 }, [isSelected, mediaId]); 32901 const featuredImageURL = useFeaturedImage ? featuredImageMedia?.source_url : ''; 32902 const featuredImageAlt = useFeaturedImage ? featuredImageMedia?.alt_text : ''; 32903 const toggleUseFeaturedImage = () => { 32904 setAttributes({ 32905 imageFill: false, 32906 mediaType: 'image', 32907 mediaId: undefined, 32908 mediaUrl: undefined, 32909 mediaAlt: undefined, 32910 mediaLink: undefined, 32911 linkDestination: undefined, 32912 linkTarget: undefined, 32913 linkClass: undefined, 32914 rel: undefined, 32915 href: undefined, 32916 useFeaturedImage: !useFeaturedImage 32917 }); 32918 }; 32919 const refMedia = (0,external_wp_element_namespaceObject.useRef)(); 32920 const imperativeFocalPointPreview = value => { 32921 const { 32922 style 32923 } = refMedia.current; 32924 const { 32925 x, 32926 y 32927 } = value; 32928 style.objectPosition = `$x * 100}% $y * 100}%`; 32929 }; 32930 const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null); 32931 const onSelectMedia = edit_attributesFromMedia({ 32932 attributes, 32933 setAttributes 32934 }); 32935 const onSetHref = props => { 32936 setAttributes(props); 32937 }; 32938 const onWidthChange = width => { 32939 setTemporaryMediaWidth(applyWidthConstraints(width)); 32940 }; 32941 const commitWidthChange = width => { 32942 setAttributes({ 32943 mediaWidth: applyWidthConstraints(width) 32944 }); 32945 setTemporaryMediaWidth(null); 32946 }; 32947 const classNames = dist_clsx({ 32948 'has-media-on-the-right': 'right' === mediaPosition, 32949 'is-selected': isSelected, 32950 'is-stacked-on-mobile': isStackedOnMobile, 32951 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32952 'is-image-fill-element': imageFill 32953 }); 32954 const widthString = `$temporaryMediaWidth || mediaWidth}%`; 32955 const gridTemplateColumns = 'right' === mediaPosition ? `1fr $widthString}` : `$widthString} 1fr`; 32956 const style = { 32957 gridTemplateColumns, 32958 msGridColumns: gridTemplateColumns 32959 }; 32960 const onMediaAltChange = newMediaAlt => { 32961 setAttributes({ 32962 mediaAlt: newMediaAlt 32963 }); 32964 }; 32965 const onVerticalAlignmentChange = alignment => { 32966 setAttributes({ 32967 verticalAlignment: alignment 32968 }); 32969 }; 32970 const updateImage = newMediaSizeSlug => { 32971 const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug); 32972 if (!newUrl) { 32973 return null; 32974 } 32975 setAttributes({ 32976 mediaUrl: newUrl, 32977 mediaSizeSlug: newMediaSizeSlug 32978 }); 32979 }; 32980 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 32981 const mediaTextGeneralSettings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 32982 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 32983 resetAll: () => { 32984 setAttributes({ 32985 isStackedOnMobile: true, 32986 imageFill: false, 32987 mediaAlt: '', 32988 focalPoint: undefined, 32989 mediaWidth: 50, 32990 mediaSizeSlug: undefined 32991 }); 32992 }, 32993 dropdownMenuProps: dropdownMenuProps, 32994 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 32995 label: (0,external_wp_i18n_namespaceObject.__)('Media width'), 32996 isShownByDefault: true, 32997 hasValue: () => mediaWidth !== 50, 32998 onDeselect: () => setAttributes({ 32999 mediaWidth: 50 33000 }), 33001 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 33002 __nextHasNoMarginBottom: true, 33003 __next40pxDefaultSize: true, 33004 label: (0,external_wp_i18n_namespaceObject.__)('Media width'), 33005 value: temporaryMediaWidth || mediaWidth, 33006 onChange: commitWidthChange, 33007 min: WIDTH_CONSTRAINT_PERCENTAGE, 33008 max: 100 - WIDTH_CONSTRAINT_PERCENTAGE 33009 }) 33010 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 33011 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 33012 isShownByDefault: true, 33013 hasValue: () => !isStackedOnMobile, 33014 onDeselect: () => setAttributes({ 33015 isStackedOnMobile: true 33016 }), 33017 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 33018 __nextHasNoMarginBottom: true, 33019 label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), 33020 checked: isStackedOnMobile, 33021 onChange: () => setAttributes({ 33022 isStackedOnMobile: !isStackedOnMobile 33023 }) 33024 }) 33025 }), mediaType === 'image' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 33026 label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill'), 33027 isShownByDefault: true, 33028 hasValue: () => !!imageFill, 33029 onDeselect: () => setAttributes({ 33030 imageFill: false 33031 }), 33032 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 33033 __nextHasNoMarginBottom: true, 33034 label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill'), 33035 checked: !!imageFill, 33036 onChange: () => setAttributes({ 33037 imageFill: !imageFill 33038 }) 33039 }) 33040 }), imageFill && (mediaUrl || featuredImageURL) && mediaType === 'image' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 33041 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 33042 isShownByDefault: true, 33043 hasValue: () => !!focalPoint, 33044 onDeselect: () => setAttributes({ 33045 focalPoint: undefined 33046 }), 33047 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { 33048 __nextHasNoMarginBottom: true, 33049 label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), 33050 url: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 33051 value: focalPoint, 33052 onChange: value => setAttributes({ 33053 focalPoint: value 33054 }), 33055 onDragStart: imperativeFocalPointPreview, 33056 onDrag: imperativeFocalPointPreview 33057 }) 33058 }), mediaType === 'image' && mediaUrl && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 33059 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 33060 isShownByDefault: true, 33061 hasValue: () => !!mediaAlt, 33062 onDeselect: () => setAttributes({ 33063 mediaAlt: '' 33064 }), 33065 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 33066 __nextHasNoMarginBottom: true, 33067 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), 33068 value: mediaAlt, 33069 onChange: onMediaAltChange, 33070 help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 33071 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { 33072 href: 33073 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 33074 (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), 33075 children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') 33076 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] 33077 }) 33078 }) 33079 }), mediaType === 'image' && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaTextResolutionTool, { 33080 image: image, 33081 value: mediaSizeSlug, 33082 onChange: updateImage 33083 })] 33084 }); 33085 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 33086 className: classNames, 33087 style 33088 }); 33089 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 33090 className: 'wp-block-media-text__content' 33091 }, { 33092 template: constants_TEMPLATE, 33093 allowedBlocks 33094 }); 33095 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 33096 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 33097 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 33098 children: mediaTextGeneralSettings 33099 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 33100 group: "block", 33101 children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 33102 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, { 33103 onChange: onVerticalAlignmentChange, 33104 value: verticalAlignment 33105 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 33106 icon: pull_left, 33107 title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'), 33108 isActive: mediaPosition === 'left', 33109 onClick: () => setAttributes({ 33110 mediaPosition: 'left' 33111 }) 33112 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 33113 icon: pull_right, 33114 title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'), 33115 isActive: mediaPosition === 'right', 33116 onClick: () => setAttributes({ 33117 mediaPosition: 'right' 33118 }) 33119 })] 33120 }), mediaType === 'image' && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { 33121 url: href || '', 33122 onChangeUrl: onSetHref, 33123 linkDestination: linkDestination, 33124 mediaType: mediaType, 33125 mediaUrl: image && image.source_url, 33126 mediaLink: image && image.link, 33127 linkTarget: linkTarget, 33128 linkClass: linkClass, 33129 rel: rel 33130 })] 33131 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 33132 ...blockProps, 33133 children: [mediaPosition === 'right' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 33134 ...innerBlocksProps 33135 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_container, { 33136 className: "wp-block-media-text__media", 33137 onSelectMedia: onSelectMedia, 33138 onWidthChange: onWidthChange, 33139 commitWidthChange: commitWidthChange, 33140 refMedia: refMedia, 33141 enableResize: blockEditingMode === 'default', 33142 toggleUseFeaturedImage: toggleUseFeaturedImage, 33143 focalPoint, 33144 imageFill, 33145 isSelected, 33146 isStackedOnMobile, 33147 mediaAlt, 33148 mediaId, 33149 mediaPosition, 33150 mediaType, 33151 mediaUrl, 33152 mediaWidth, 33153 useFeaturedImage, 33154 featuredImageURL, 33155 featuredImageAlt 33156 }), mediaPosition !== 'right' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 33157 ...innerBlocksProps 33158 })] 33159 })] 33160 }); 33161 } 33162 /* harmony default export */ const media_text_edit = (MediaTextEdit); 33163 33164 ;// ./node_modules/@wordpress/block-library/build-module/media-text/save.js 33165 /** 33166 * External dependencies 33167 */ 33168 33169 33170 /** 33171 * WordPress dependencies 33172 */ 33173 33174 33175 /** 33176 * Internal dependencies 33177 */ 33178 33179 33180 33181 const save_DEFAULT_MEDIA_WIDTH = 50; 33182 const save_noop = () => {}; 33183 function media_text_save_save({ 33184 attributes 33185 }) { 33186 const { 33187 isStackedOnMobile, 33188 mediaAlt, 33189 mediaPosition, 33190 mediaType, 33191 mediaUrl, 33192 mediaWidth, 33193 mediaId, 33194 verticalAlignment, 33195 imageFill, 33196 focalPoint, 33197 linkClass, 33198 href, 33199 linkTarget, 33200 rel 33201 } = attributes; 33202 const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; 33203 const newRel = !rel ? undefined : rel; 33204 const imageClasses = dist_clsx({ 33205 [`wp-image-$mediaId}`]: mediaId && mediaType === 'image', 33206 [`size-$mediaSizeSlug}`]: mediaId && mediaType === 'image' 33207 }); 33208 const positionStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; 33209 let image = mediaUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 33210 src: mediaUrl, 33211 alt: mediaAlt, 33212 className: imageClasses || null, 33213 style: positionStyles 33214 }) : null; 33215 if (href) { 33216 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 33217 className: linkClass, 33218 href: href, 33219 target: linkTarget, 33220 rel: newRel, 33221 children: image 33222 }); 33223 } 33224 const mediaTypeRenders = { 33225 image: () => image, 33226 video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 33227 controls: true, 33228 src: mediaUrl 33229 }) 33230 }; 33231 const className = dist_clsx({ 33232 'has-media-on-the-right': 'right' === mediaPosition, 33233 'is-stacked-on-mobile': isStackedOnMobile, 33234 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 33235 'is-image-fill-element': imageFill 33236 }); 33237 let gridTemplateColumns; 33238 if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) { 33239 gridTemplateColumns = 'right' === mediaPosition ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 33240 } 33241 const style = { 33242 gridTemplateColumns 33243 }; 33244 if ('right' === mediaPosition) { 33245 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 33246 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 33247 className, 33248 style 33249 }), 33250 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 33251 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 33252 className: 'wp-block-media-text__content' 33253 }) 33254 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 33255 className: "wp-block-media-text__media", 33256 children: (mediaTypeRenders[mediaType] || save_noop)() 33257 })] 33258 }); 33259 } 33260 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 33261 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 33262 className, 33263 style 33264 }), 33265 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 33266 className: "wp-block-media-text__media", 33267 children: (mediaTypeRenders[mediaType] || save_noop)() 33268 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 33269 ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ 33270 className: 'wp-block-media-text__content' 33271 }) 33272 })] 33273 }); 33274 } 33275 33276 ;// ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js 33277 /** 33278 * WordPress dependencies 33279 */ 33280 33281 const media_text_transforms_transforms = { 33282 from: [{ 33283 type: 'block', 33284 blocks: ['core/image'], 33285 transform: ({ 33286 alt, 33287 url, 33288 id, 33289 anchor 33290 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 33291 mediaAlt: alt, 33292 mediaId: id, 33293 mediaUrl: url, 33294 mediaType: 'image', 33295 anchor 33296 }) 33297 }, { 33298 type: 'block', 33299 blocks: ['core/video'], 33300 transform: ({ 33301 src, 33302 id, 33303 anchor 33304 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 33305 mediaId: id, 33306 mediaUrl: src, 33307 mediaType: 'video', 33308 anchor 33309 }) 33310 }, { 33311 type: 'block', 33312 blocks: ['core/cover'], 33313 transform: ({ 33314 align, 33315 alt, 33316 anchor, 33317 backgroundType, 33318 customGradient, 33319 customOverlayColor, 33320 gradient, 33321 id, 33322 overlayColor, 33323 style, 33324 textColor, 33325 url 33326 }, innerBlocks) => { 33327 let additionalAttributes = {}; 33328 if (customGradient) { 33329 additionalAttributes = { 33330 style: { 33331 color: { 33332 gradient: customGradient 33333 } 33334 } 33335 }; 33336 } else if (customOverlayColor) { 33337 additionalAttributes = { 33338 style: { 33339 color: { 33340 background: customOverlayColor 33341 } 33342 } 33343 }; 33344 } 33345 33346 // Maintain custom text color block support value. 33347 if (style?.color?.text) { 33348 additionalAttributes.style = { 33349 color: { 33350 ...additionalAttributes.style?.color, 33351 text: style.color.text 33352 } 33353 }; 33354 } 33355 return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { 33356 align, 33357 anchor, 33358 backgroundColor: overlayColor, 33359 gradient, 33360 mediaAlt: alt, 33361 mediaId: id, 33362 mediaType: backgroundType, 33363 mediaUrl: url, 33364 textColor, 33365 ...additionalAttributes 33366 }, innerBlocks); 33367 } 33368 }], 33369 to: [{ 33370 type: 'block', 33371 blocks: ['core/image'], 33372 isMatch: ({ 33373 mediaType, 33374 mediaUrl 33375 }) => { 33376 return !mediaUrl || mediaType === 'image'; 33377 }, 33378 transform: ({ 33379 mediaAlt, 33380 mediaId, 33381 mediaUrl, 33382 anchor 33383 }) => { 33384 return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { 33385 alt: mediaAlt, 33386 id: mediaId, 33387 url: mediaUrl, 33388 anchor 33389 }); 33390 } 33391 }, { 33392 type: 'block', 33393 blocks: ['core/video'], 33394 isMatch: ({ 33395 mediaType, 33396 mediaUrl 33397 }) => { 33398 return !mediaUrl || mediaType === 'video'; 33399 }, 33400 transform: ({ 33401 mediaId, 33402 mediaUrl, 33403 anchor 33404 }) => { 33405 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 33406 id: mediaId, 33407 src: mediaUrl, 33408 anchor 33409 }); 33410 } 33411 }, { 33412 type: 'block', 33413 blocks: ['core/cover'], 33414 transform: ({ 33415 align, 33416 anchor, 33417 backgroundColor, 33418 focalPoint, 33419 gradient, 33420 mediaAlt, 33421 mediaId, 33422 mediaType, 33423 mediaUrl, 33424 style, 33425 textColor 33426 }, innerBlocks) => { 33427 const additionalAttributes = {}; 33428 33429 // Migrate the background styles or gradient to Cover's custom 33430 // gradient and overlay properties. 33431 if (style?.color?.gradient) { 33432 additionalAttributes.customGradient = style.color.gradient; 33433 } else if (style?.color?.background) { 33434 additionalAttributes.customOverlayColor = style.color.background; 33435 } 33436 33437 // Maintain custom text color support style. 33438 if (style?.color?.text) { 33439 additionalAttributes.style = { 33440 color: { 33441 text: style.color.text 33442 } 33443 }; 33444 } 33445 const coverAttributes = { 33446 align, 33447 alt: mediaAlt, 33448 anchor, 33449 backgroundType: mediaType, 33450 dimRatio: !!mediaUrl ? 50 : 100, 33451 focalPoint, 33452 gradient, 33453 id: mediaId, 33454 overlayColor: backgroundColor, 33455 textColor, 33456 url: mediaUrl, 33457 ...additionalAttributes 33458 }; 33459 return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, innerBlocks); 33460 } 33461 }] 33462 }; 33463 /* harmony default export */ const media_text_transforms = (media_text_transforms_transforms); 33464 33465 ;// ./node_modules/@wordpress/block-library/build-module/media-text/index.js 33466 /** 33467 * WordPress dependencies 33468 */ 33469 33470 33471 33472 /** 33473 * Internal dependencies 33474 */ 33475 33476 33477 33478 const media_text_metadata = { 33479 $schema: "https://schemas.wp.org/trunk/block.json", 33480 apiVersion: 3, 33481 name: "core/media-text", 33482 title: "Media & Text", 33483 category: "media", 33484 description: "Set media and words side-by-side for a richer layout.", 33485 keywords: ["image", "video"], 33486 textdomain: "default", 33487 attributes: { 33488 align: { 33489 type: "string", 33490 "default": "none" 33491 }, 33492 mediaAlt: { 33493 type: "string", 33494 source: "attribute", 33495 selector: "figure img", 33496 attribute: "alt", 33497 "default": "", 33498 role: "content" 33499 }, 33500 mediaPosition: { 33501 type: "string", 33502 "default": "left" 33503 }, 33504 mediaId: { 33505 type: "number", 33506 role: "content" 33507 }, 33508 mediaUrl: { 33509 type: "string", 33510 source: "attribute", 33511 selector: "figure video,figure img", 33512 attribute: "src", 33513 role: "content" 33514 }, 33515 mediaLink: { 33516 type: "string" 33517 }, 33518 linkDestination: { 33519 type: "string" 33520 }, 33521 linkTarget: { 33522 type: "string", 33523 source: "attribute", 33524 selector: "figure a", 33525 attribute: "target" 33526 }, 33527 href: { 33528 type: "string", 33529 source: "attribute", 33530 selector: "figure a", 33531 attribute: "href", 33532 role: "content" 33533 }, 33534 rel: { 33535 type: "string", 33536 source: "attribute", 33537 selector: "figure a", 33538 attribute: "rel" 33539 }, 33540 linkClass: { 33541 type: "string", 33542 source: "attribute", 33543 selector: "figure a", 33544 attribute: "class" 33545 }, 33546 mediaType: { 33547 type: "string", 33548 role: "content" 33549 }, 33550 mediaWidth: { 33551 type: "number", 33552 "default": 50 33553 }, 33554 mediaSizeSlug: { 33555 type: "string" 33556 }, 33557 isStackedOnMobile: { 33558 type: "boolean", 33559 "default": true 33560 }, 33561 verticalAlignment: { 33562 type: "string" 33563 }, 33564 imageFill: { 33565 type: "boolean" 33566 }, 33567 focalPoint: { 33568 type: "object" 33569 }, 33570 allowedBlocks: { 33571 type: "array" 33572 }, 33573 useFeaturedImage: { 33574 type: "boolean", 33575 "default": false 33576 } 33577 }, 33578 usesContext: ["postId", "postType"], 33579 supports: { 33580 anchor: true, 33581 align: ["wide", "full"], 33582 html: false, 33583 __experimentalBorder: { 33584 color: true, 33585 radius: true, 33586 style: true, 33587 width: true, 33588 __experimentalDefaultControls: { 33589 color: true, 33590 radius: true, 33591 style: true, 33592 width: true 33593 } 33594 }, 33595 color: { 33596 gradients: true, 33597 heading: true, 33598 link: true, 33599 __experimentalDefaultControls: { 33600 background: true, 33601 text: true 33602 } 33603 }, 33604 spacing: { 33605 margin: true, 33606 padding: true 33607 }, 33608 typography: { 33609 fontSize: true, 33610 lineHeight: true, 33611 __experimentalFontFamily: true, 33612 __experimentalFontWeight: true, 33613 __experimentalFontStyle: true, 33614 __experimentalTextTransform: true, 33615 __experimentalTextDecoration: true, 33616 __experimentalLetterSpacing: true, 33617 __experimentalDefaultControls: { 33618 fontSize: true 33619 } 33620 }, 33621 interactivity: { 33622 clientNavigation: true 33623 } 33624 }, 33625 editorStyle: "wp-block-media-text-editor", 33626 style: "wp-block-media-text" 33627 }; 33628 33629 33630 const { 33631 name: media_text_name 33632 } = media_text_metadata; 33633 33634 const media_text_settings = { 33635 icon: media_and_text, 33636 example: { 33637 viewportWidth: 601, 33638 // Columns collapse "@media (max-width: 600px)". 33639 attributes: { 33640 mediaType: 'image', 33641 mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg' 33642 }, 33643 innerBlocks: [{ 33644 name: 'core/paragraph', 33645 attributes: { 33646 content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.') 33647 } 33648 }, { 33649 name: 'core/paragraph', 33650 attributes: { 33651 content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)') 33652 } 33653 }] 33654 }, 33655 transforms: media_text_transforms, 33656 edit: media_text_edit, 33657 save: media_text_save_save, 33658 deprecated: media_text_deprecated 33659 }; 33660 const media_text_init = () => initBlock({ 33661 name: media_text_name, 33662 metadata: media_text_metadata, 33663 settings: media_text_settings 33664 }); 33665 33666 ;// ./node_modules/@wordpress/block-library/build-module/missing/edit.js 33667 /** 33668 * WordPress dependencies 33669 */ 33670 33671 33672 33673 33674 33675 33676 33677 33678 function MissingEdit({ 33679 attributes, 33680 clientId 33681 }) { 33682 const { 33683 originalName, 33684 originalUndelimitedContent 33685 } = attributes; 33686 const hasContent = !!originalUndelimitedContent; 33687 const { 33688 hasFreeformBlock, 33689 hasHTMLBlock 33690 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 33691 const { 33692 canInsertBlockType, 33693 getBlockRootClientId 33694 } = select(external_wp_blockEditor_namespaceObject.store); 33695 return { 33696 hasFreeformBlock: canInsertBlockType('core/freeform', getBlockRootClientId(clientId)), 33697 hasHTMLBlock: canInsertBlockType('core/html', getBlockRootClientId(clientId)) 33698 }; 33699 }, [clientId]); 33700 const { 33701 replaceBlock 33702 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 33703 function convertToHTML() { 33704 replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { 33705 content: originalUndelimitedContent 33706 })); 33707 } 33708 const actions = []; 33709 let messageHTML; 33710 const convertToHtmlButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 33711 __next40pxDefaultSize: true, 33712 onClick: convertToHTML, 33713 variant: "primary", 33714 children: (0,external_wp_i18n_namespaceObject.__)('Keep as HTML') 33715 }, "convert"); 33716 if (hasContent && !hasFreeformBlock && !originalName) { 33717 if (hasHTMLBlock) { 33718 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.'); 33719 actions.push(convertToHtmlButton); 33720 } else { 33721 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.'); 33722 } 33723 } else if (hasContent && hasHTMLBlock) { 33724 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ 33725 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is, convert it to custom HTML, or remove it.'), originalName); 33726 actions.push(convertToHtmlButton); 33727 } else { 33728 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ 33729 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is or remove it.'), originalName); 33730 } 33731 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 33732 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 33733 className: 'has-warning' 33734 }), 33735 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 33736 actions: actions, 33737 children: messageHTML 33738 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 33739 children: (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent) 33740 })] 33741 }); 33742 } 33743 33744 ;// ./node_modules/@wordpress/block-library/build-module/missing/save.js 33745 /** 33746 * WordPress dependencies 33747 */ 33748 33749 33750 function missing_save_save({ 33751 attributes 33752 }) { 33753 // Preserve the missing block's content. 33754 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 33755 children: attributes.originalContent 33756 }); 33757 } 33758 33759 ;// ./node_modules/@wordpress/block-library/build-module/missing/index.js 33760 /** 33761 * WordPress dependencies 33762 */ 33763 33764 33765 /** 33766 * Internal dependencies 33767 */ 33768 33769 33770 const missing_metadata = { 33771 $schema: "https://schemas.wp.org/trunk/block.json", 33772 apiVersion: 3, 33773 name: "core/missing", 33774 title: "Unsupported", 33775 category: "text", 33776 description: "Your site doesn\u2019t include support for this block.", 33777 textdomain: "default", 33778 attributes: { 33779 originalName: { 33780 type: "string" 33781 }, 33782 originalUndelimitedContent: { 33783 type: "string" 33784 }, 33785 originalContent: { 33786 type: "string", 33787 source: "raw" 33788 } 33789 }, 33790 supports: { 33791 className: false, 33792 customClassName: false, 33793 inserter: false, 33794 html: false, 33795 reusable: false, 33796 interactivity: { 33797 clientNavigation: true 33798 } 33799 } 33800 }; 33801 33802 const { 33803 name: missing_name 33804 } = missing_metadata; 33805 33806 const missing_settings = { 33807 name: missing_name, 33808 __experimentalLabel(attributes, { 33809 context 33810 }) { 33811 if (context === 'accessibility') { 33812 const { 33813 originalName 33814 } = attributes; 33815 const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined; 33816 if (originalBlockType) { 33817 return originalBlockType.settings.title || originalName; 33818 } 33819 return ''; 33820 } 33821 }, 33822 edit: MissingEdit, 33823 save: missing_save_save 33824 }; 33825 const missing_init = () => initBlock({ 33826 name: missing_name, 33827 metadata: missing_metadata, 33828 settings: missing_settings 33829 }); 33830 33831 ;// ./node_modules/@wordpress/icons/build-module/library/more.js 33832 /** 33833 * WordPress dependencies 33834 */ 33835 33836 33837 const more = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 33838 viewBox: "0 0 24 24", 33839 xmlns: "http://www.w3.org/2000/svg", 33840 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 33841 d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z" 33842 }) 33843 }); 33844 /* harmony default export */ const library_more = (more); 33845 33846 ;// ./node_modules/@wordpress/block-library/build-module/more/edit.js 33847 /** 33848 * WordPress dependencies 33849 */ 33850 33851 33852 33853 33854 33855 /** 33856 * Internal dependencies 33857 */ 33858 33859 33860 const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more'); 33861 function MoreEdit({ 33862 attributes: { 33863 customText, 33864 noTeaser 33865 }, 33866 insertBlocksAfter, 33867 setAttributes 33868 }) { 33869 const onChangeInput = event => { 33870 setAttributes({ 33871 customText: event.target.value 33872 }); 33873 }; 33874 const onKeyDown = ({ 33875 keyCode 33876 }) => { 33877 if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { 33878 insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]); 33879 } 33880 }; 33881 const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.'); 33882 const toggleHideExcerpt = () => setAttributes({ 33883 noTeaser: !noTeaser 33884 }); 33885 const style = { 33886 width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em` 33887 }; 33888 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 33889 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 33890 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 33891 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 33892 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 33893 resetAll: () => { 33894 setAttributes({ 33895 noTeaser: false 33896 }); 33897 }, 33898 dropdownMenuProps: dropdownMenuProps, 33899 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 33900 label: (0,external_wp_i18n_namespaceObject.__)('Hide excerpt'), 33901 isShownByDefault: true, 33902 hasValue: () => noTeaser, 33903 onDeselect: () => setAttributes({ 33904 noTeaser: false 33905 }), 33906 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 33907 __nextHasNoMarginBottom: true, 33908 label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'), 33909 checked: !!noTeaser, 33910 onChange: toggleHideExcerpt, 33911 help: getHideExcerptHelp 33912 }) 33913 }) 33914 }) 33915 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 33916 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 33917 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 33918 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 33919 type: "text", 33920 value: customText, 33921 placeholder: DEFAULT_TEXT, 33922 onChange: onChangeInput, 33923 onKeyDown: onKeyDown, 33924 style: style 33925 }) 33926 })] 33927 }); 33928 } 33929 33930 ;// ./node_modules/@wordpress/block-library/build-module/more/save.js 33931 /* wp:polyfill */ 33932 /** 33933 * WordPress dependencies 33934 */ 33935 33936 33937 function more_save_save({ 33938 attributes: { 33939 customText, 33940 noTeaser 33941 } 33942 }) { 33943 const moreTag = customText ? `<!--more $customText}-->` : '<!--more-->'; 33944 const noTeaserTag = noTeaser ? '<!--noteaser-->' : ''; 33945 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 33946 children: [moreTag, noTeaserTag].filter(Boolean).join('\n') 33947 }); 33948 } 33949 33950 ;// ./node_modules/@wordpress/block-library/build-module/more/transforms.js 33951 /** 33952 * WordPress dependencies 33953 */ 33954 33955 const more_transforms_transforms = { 33956 from: [{ 33957 type: 'raw', 33958 schema: { 33959 'wp-block': { 33960 attributes: ['data-block'] 33961 } 33962 }, 33963 isMatch: node => node.dataset && node.dataset.block === 'core/more', 33964 transform(node) { 33965 const { 33966 customText, 33967 noTeaser 33968 } = node.dataset; 33969 const attrs = {}; 33970 // Don't copy unless defined and not an empty string. 33971 if (customText) { 33972 attrs.customText = customText; 33973 } 33974 // Special handling for boolean. 33975 if (noTeaser === '') { 33976 attrs.noTeaser = true; 33977 } 33978 return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs); 33979 } 33980 }] 33981 }; 33982 /* harmony default export */ const more_transforms = (more_transforms_transforms); 33983 33984 ;// ./node_modules/@wordpress/block-library/build-module/more/index.js 33985 /** 33986 * WordPress dependencies 33987 */ 33988 33989 33990 /** 33991 * Internal dependencies 33992 */ 33993 33994 33995 const more_metadata = { 33996 $schema: "https://schemas.wp.org/trunk/block.json", 33997 apiVersion: 3, 33998 name: "core/more", 33999 title: "More", 34000 category: "design", 34001 description: "Content before this block will be shown in the excerpt on your archives page.", 34002 keywords: ["read more"], 34003 textdomain: "default", 34004 attributes: { 34005 customText: { 34006 type: "string", 34007 "default": "" 34008 }, 34009 noTeaser: { 34010 type: "boolean", 34011 "default": false 34012 } 34013 }, 34014 supports: { 34015 customClassName: false, 34016 className: false, 34017 html: false, 34018 multiple: false, 34019 interactivity: { 34020 clientNavigation: true 34021 } 34022 }, 34023 editorStyle: "wp-block-more-editor" 34024 }; 34025 34026 34027 const { 34028 name: more_name 34029 } = more_metadata; 34030 34031 const more_settings = { 34032 icon: library_more, 34033 example: {}, 34034 __experimentalLabel(attributes, { 34035 context 34036 }) { 34037 const customName = attributes?.metadata?.name; 34038 if (context === 'list-view' && customName) { 34039 return customName; 34040 } 34041 if (context === 'accessibility') { 34042 return attributes.customText; 34043 } 34044 }, 34045 transforms: more_transforms, 34046 edit: MoreEdit, 34047 save: more_save_save 34048 }; 34049 const more_init = () => initBlock({ 34050 name: more_name, 34051 metadata: more_metadata, 34052 settings: more_settings 34053 }); 34054 34055 ;// ./node_modules/@wordpress/icons/build-module/library/navigation.js 34056 /** 34057 * WordPress dependencies 34058 */ 34059 34060 34061 const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 34062 viewBox: "0 0 24 24", 34063 xmlns: "http://www.w3.org/2000/svg", 34064 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 34065 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" 34066 }) 34067 }); 34068 /* harmony default export */ const library_navigation = (navigation); 34069 34070 ;// external ["wp","a11y"] 34071 const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; 34072 ;// ./node_modules/@wordpress/icons/build-module/icon/index.js 34073 /** 34074 * WordPress dependencies 34075 */ 34076 34077 34078 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 34079 34080 /** 34081 * Return an SVG icon. 34082 * 34083 * @param {IconProps} props icon is the SVG component to render 34084 * size is a number specifying the icon size in pixels 34085 * Other props will be passed to wrapped SVG component 34086 * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. 34087 * 34088 * @return {JSX.Element} Icon component 34089 */ 34090 function Icon({ 34091 icon, 34092 size = 24, 34093 ...props 34094 }, ref) { 34095 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { 34096 width: size, 34097 height: size, 34098 ...props, 34099 ref 34100 }); 34101 } 34102 /* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); 34103 34104 ;// ./node_modules/@wordpress/icons/build-module/library/close.js 34105 /** 34106 * WordPress dependencies 34107 */ 34108 34109 34110 const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 34111 xmlns: "http://www.w3.org/2000/svg", 34112 viewBox: "0 0 24 24", 34113 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 34114 d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" 34115 }) 34116 }); 34117 /* harmony default export */ const library_close = (close_close); 34118 34119 ;// ./node_modules/@wordpress/block-library/build-module/navigation/constants.js 34120 const constants_DEFAULT_BLOCK = { 34121 name: 'core/navigation-link' 34122 }; 34123 const PRIORITIZED_INSERTER_BLOCKS = ['core/navigation-link/page', 'core/navigation-link']; 34124 34125 // These parameters must be kept aligned with those in 34126 // lib/compat/wordpress-6.3/navigation-block-preloading.php 34127 // and 34128 // edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js 34129 const PRELOADED_NAVIGATION_MENUS_QUERY = { 34130 per_page: 100, 34131 status: ['publish', 'draft'], 34132 order: 'desc', 34133 orderby: 'date' 34134 }; 34135 const SELECT_NAVIGATION_MENUS_ARGS = ['postType', 'wp_navigation', PRELOADED_NAVIGATION_MENUS_QUERY]; 34136 34137 ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js 34138 /** 34139 * WordPress dependencies 34140 */ 34141 34142 34143 34144 /** 34145 * Internal dependencies 34146 */ 34147 34148 function useNavigationMenu(ref) { 34149 const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)({ 34150 kind: 'postType', 34151 name: 'wp_navigation', 34152 id: ref 34153 }); 34154 const { 34155 navigationMenu, 34156 isNavigationMenuResolved, 34157 isNavigationMenuMissing 34158 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 34159 return selectExistingMenu(select, ref); 34160 }, [ref]); 34161 const { 34162 // Can the user create navigation menus? 34163 canCreate: canCreateNavigationMenus, 34164 // Can the user update the specific navigation menu with the given post ID? 34165 canUpdate: canUpdateNavigationMenu, 34166 // Can the user delete the specific navigation menu with the given post ID? 34167 canDelete: canDeleteNavigationMenu, 34168 isResolving: isResolvingPermissions, 34169 hasResolved: hasResolvedPermissions 34170 } = permissions; 34171 const { 34172 records: navigationMenus, 34173 isResolving: isResolvingNavigationMenus, 34174 hasResolved: hasResolvedNavigationMenus 34175 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY); 34176 const canSwitchNavigationMenu = ref ? navigationMenus?.length > 1 : navigationMenus?.length > 0; 34177 return { 34178 navigationMenu, 34179 isNavigationMenuResolved, 34180 isNavigationMenuMissing, 34181 navigationMenus, 34182 isResolvingNavigationMenus, 34183 hasResolvedNavigationMenus, 34184 canSwitchNavigationMenu, 34185 canUserCreateNavigationMenus: canCreateNavigationMenus, 34186 isResolvingCanUserCreateNavigationMenus: isResolvingPermissions, 34187 hasResolvedCanUserCreateNavigationMenus: hasResolvedPermissions, 34188 canUserUpdateNavigationMenu: canUpdateNavigationMenu, 34189 hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolvedPermissions : undefined, 34190 canUserDeleteNavigationMenu: canDeleteNavigationMenu, 34191 hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolvedPermissions : undefined 34192 }; 34193 } 34194 function selectExistingMenu(select, ref) { 34195 if (!ref) { 34196 return { 34197 isNavigationMenuResolved: false, 34198 isNavigationMenuMissing: true 34199 }; 34200 } 34201 const { 34202 getEntityRecord, 34203 getEditedEntityRecord, 34204 hasFinishedResolution 34205 } = select(external_wp_coreData_namespaceObject.store); 34206 const args = ['postType', 'wp_navigation', ref]; 34207 const navigationMenu = getEntityRecord(...args); 34208 const editedNavigationMenu = getEditedEntityRecord(...args); 34209 const hasResolvedNavigationMenu = hasFinishedResolution('getEditedEntityRecord', args); 34210 34211 // Only published Navigation posts are considered valid. 34212 // Draft Navigation posts are valid only on the editor, 34213 // requiring a post update to publish to show in frontend. 34214 // To achieve that, index.php must reflect this validation only for published. 34215 const isNavigationMenuPublishedOrDraft = editedNavigationMenu.status === 'publish' || editedNavigationMenu.status === 'draft'; 34216 return { 34217 isNavigationMenuResolved: hasResolvedNavigationMenu, 34218 isNavigationMenuMissing: hasResolvedNavigationMenu && (!navigationMenu || !isNavigationMenuPublishedOrDraft), 34219 // getEditedEntityRecord will return the post regardless of status. 34220 // Therefore if the found post is not published then we should ignore it. 34221 navigationMenu: isNavigationMenuPublishedOrDraft ? editedNavigationMenu : null 34222 }; 34223 } 34224 34225 ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js 34226 /** 34227 * WordPress dependencies 34228 */ 34229 34230 34231 /** 34232 * @typedef {Object} NavigationEntitiesData 34233 * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page". 34234 * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving. 34235 * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving. 34236 * @property {Array|undefined} menus - a collection of Menu entity objects. 34237 * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving. 34238 * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving. 34239 * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId. 34240 * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving. 34241 * @property {boolean} hasPages - indicates whether there is currently any data for pages. 34242 * @property {boolean} hasMenus - indicates whether there is currently any data for menus. 34243 */ 34244 34245 /** 34246 * Manages fetching and resolution state for all entities required 34247 * for the Navigation block. 34248 * 34249 * @param {number} menuId the menu for which to retrieve menuItem data. 34250 * @return { NavigationEntitiesData } the entity data. 34251 */ 34252 function useNavigationEntities(menuId) { 34253 const { 34254 records: menus, 34255 isResolving: isResolvingMenus, 34256 hasResolved: hasResolvedMenus 34257 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menu', { 34258 per_page: -1, 34259 context: 'view' 34260 }); 34261 const { 34262 records: pages, 34263 isResolving: isResolvingPages, 34264 hasResolved: hasResolvedPages 34265 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { 34266 parent: 0, 34267 order: 'asc', 34268 orderby: 'id', 34269 per_page: -1, 34270 context: 'view' 34271 }); 34272 const { 34273 records: menuItems, 34274 hasResolved: hasResolvedMenuItems 34275 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menuItem', { 34276 menus: menuId, 34277 per_page: -1, 34278 context: 'view' 34279 }, { 34280 enabled: !!menuId 34281 }); 34282 return { 34283 pages, 34284 isResolvingPages, 34285 hasResolvedPages, 34286 hasPages: !!(hasResolvedPages && pages?.length), 34287 menus, 34288 isResolvingMenus, 34289 hasResolvedMenus, 34290 hasMenus: !!(hasResolvedMenus && menus?.length), 34291 menuItems, 34292 hasResolvedMenuItems 34293 }; 34294 } 34295 34296 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js 34297 /** 34298 * WordPress dependencies 34299 */ 34300 34301 34302 34303 const PlaceholderPreview = ({ 34304 isVisible = true 34305 }) => { 34306 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34307 "aria-hidden": !isVisible ? true : undefined, 34308 className: "wp-block-navigation-placeholder__preview", 34309 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 34310 className: "wp-block-navigation-placeholder__actions__indicator", 34311 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 34312 icon: library_navigation 34313 }), (0,external_wp_i18n_namespaceObject.__)('Navigation')] 34314 }) 34315 }); 34316 }; 34317 /* harmony default export */ const placeholder_preview = (PlaceholderPreview); 34318 34319 ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js 34320 /** 34321 * WordPress dependencies 34322 */ 34323 34324 34325 const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 34326 xmlns: "http://www.w3.org/2000/svg", 34327 viewBox: "0 0 24 24", 34328 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 34329 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" 34330 }) 34331 }); 34332 /* harmony default export */ const more_vertical = (moreVertical); 34333 34334 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js 34335 /** 34336 * WordPress dependencies 34337 */ 34338 34339 34340 34341 34342 34343 34344 34345 /** 34346 * Internal dependencies 34347 */ 34348 34349 34350 34351 function buildMenuLabel(title, id, status) { 34352 if (!title) { 34353 /* translators: %s: the index of the menu in the list of menus. */ 34354 return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); 34355 } 34356 if (status === 'publish') { 34357 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); 34358 } 34359 return (0,external_wp_i18n_namespaceObject.sprintf)( 34360 // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). 34361 (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); 34362 } 34363 function NavigationMenuSelector({ 34364 currentMenuId, 34365 onSelectNavigationMenu, 34366 onSelectClassicMenu, 34367 onCreateNew, 34368 actionLabel, 34369 createNavigationMenuIsSuccess, 34370 createNavigationMenuIsError 34371 }) { 34372 /* translators: %s: The name of a menu. */ 34373 const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'"); 34374 const [isUpdatingMenuRef, setIsUpdatingMenuRef] = (0,external_wp_element_namespaceObject.useState)(false); 34375 actionLabel = actionLabel || createActionLabel; 34376 const { 34377 menus: classicMenus 34378 } = useNavigationEntities(); 34379 const { 34380 navigationMenus, 34381 isResolvingNavigationMenus, 34382 hasResolvedNavigationMenus, 34383 canUserCreateNavigationMenus, 34384 canSwitchNavigationMenu, 34385 isNavigationMenuMissing 34386 } = useNavigationMenu(currentMenuId); 34387 const [currentTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 34388 const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => { 34389 return navigationMenus?.map(({ 34390 id, 34391 title, 34392 status 34393 }, index) => { 34394 const label = buildMenuLabel(title?.rendered, index + 1, status); 34395 return { 34396 value: id, 34397 label, 34398 ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label), 34399 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus 34400 }; 34401 }) || []; 34402 }, [navigationMenus, actionLabel, isResolvingNavigationMenus, hasResolvedNavigationMenus, isUpdatingMenuRef]); 34403 const hasNavigationMenus = !!navigationMenus?.length; 34404 const hasClassicMenus = !!classicMenus?.length; 34405 const showNavigationMenus = !!canSwitchNavigationMenu; 34406 const showClassicMenus = !!canUserCreateNavigationMenus; 34407 const noMenuSelected = hasNavigationMenus && !currentMenuId; 34408 const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus; 34409 const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null; 34410 const navMenuHasBeenDeleted = currentMenuId && isNavigationMenuMissing; 34411 let selectorLabel = ''; 34412 if (isResolvingNavigationMenus) { 34413 selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Loading…'); 34414 } else if (noMenuSelected || noBlockMenus || menuUnavailable || navMenuHasBeenDeleted) { 34415 // Note: classic Menus may be available. 34416 selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Choose or create a Navigation Menu'); 34417 } else { 34418 // Current Menu's title. 34419 selectorLabel = currentTitle; 34420 } 34421 (0,external_wp_element_namespaceObject.useEffect)(() => { 34422 if (isUpdatingMenuRef && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) { 34423 setIsUpdatingMenuRef(false); 34424 } 34425 }, [hasResolvedNavigationMenus, createNavigationMenuIsSuccess, canUserCreateNavigationMenus, createNavigationMenuIsError, isUpdatingMenuRef, menuUnavailable, noBlockMenus, noMenuSelected]); 34426 const NavigationMenuSelectorDropdown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { 34427 label: selectorLabel, 34428 icon: more_vertical, 34429 toggleProps: { 34430 size: 'small' 34431 }, 34432 children: ({ 34433 onClose 34434 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 34435 children: [showNavigationMenus && hasNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 34436 label: (0,external_wp_i18n_namespaceObject.__)('Menus'), 34437 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { 34438 value: currentMenuId, 34439 onSelect: menuId => { 34440 onSelectNavigationMenu(menuId); 34441 onClose(); 34442 }, 34443 choices: menuChoices 34444 }) 34445 }), showClassicMenus && hasClassicMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 34446 label: (0,external_wp_i18n_namespaceObject.__)('Import Classic Menus'), 34447 children: classicMenus?.map(menu => { 34448 const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name); 34449 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 34450 onClick: async () => { 34451 setIsUpdatingMenuRef(true); 34452 await onSelectClassicMenu(menu); 34453 setIsUpdatingMenuRef(false); 34454 onClose(); 34455 }, 34456 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label), 34457 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, 34458 children: label 34459 }, menu.id); 34460 }) 34461 }), canUserCreateNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 34462 label: (0,external_wp_i18n_namespaceObject.__)('Tools'), 34463 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 34464 onClick: async () => { 34465 setIsUpdatingMenuRef(true); 34466 await onCreateNew(); 34467 setIsUpdatingMenuRef(false); 34468 onClose(); 34469 }, 34470 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, 34471 children: (0,external_wp_i18n_namespaceObject.__)('Create new Menu') 34472 }) 34473 })] 34474 }) 34475 }); 34476 return NavigationMenuSelectorDropdown; 34477 } 34478 /* harmony default export */ const navigation_menu_selector = (NavigationMenuSelector); 34479 34480 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js 34481 /** 34482 * WordPress dependencies 34483 */ 34484 34485 34486 34487 34488 34489 34490 /** 34491 * Internal dependencies 34492 */ 34493 34494 34495 34496 34497 function NavigationPlaceholder({ 34498 isSelected, 34499 currentMenuId, 34500 clientId, 34501 canUserCreateNavigationMenus = false, 34502 isResolvingCanUserCreateNavigationMenus, 34503 onSelectNavigationMenu, 34504 onSelectClassicMenu, 34505 onCreateEmpty 34506 }) { 34507 const { 34508 isResolvingMenus, 34509 hasResolvedMenus 34510 } = useNavigationEntities(); 34511 (0,external_wp_element_namespaceObject.useEffect)(() => { 34512 if (!isSelected) { 34513 return; 34514 } 34515 if (isResolvingMenus) { 34516 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading navigation block setup options…')); 34517 } 34518 if (hasResolvedMenus) { 34519 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.')); 34520 } 34521 }, [hasResolvedMenus, isResolvingMenus, isSelected]); 34522 const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenus; 34523 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 34524 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 34525 className: "wp-block-navigation-placeholder", 34526 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder_preview, { 34527 isVisible: !isSelected 34528 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34529 "aria-hidden": !isSelected ? true : undefined, 34530 className: "wp-block-navigation-placeholder__controls", 34531 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 34532 className: "wp-block-navigation-placeholder__actions", 34533 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 34534 className: "wp-block-navigation-placeholder__actions__indicator", 34535 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 34536 icon: library_navigation 34537 }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')] 34538 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}), isResolvingActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigation_menu_selector, { 34539 currentMenuId: currentMenuId, 34540 clientId: clientId, 34541 onSelectNavigationMenu: onSelectNavigationMenu, 34542 onSelectClassicMenu: onSelectClassicMenu 34543 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}), canUserCreateNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 34544 __next40pxDefaultSize: true, 34545 variant: "tertiary", 34546 onClick: onCreateEmpty, 34547 children: (0,external_wp_i18n_namespaceObject.__)('Start empty') 34548 })] 34549 }) 34550 })] 34551 }) 34552 }); 34553 } 34554 34555 ;// ./node_modules/@wordpress/icons/build-module/library/menu.js 34556 /** 34557 * WordPress dependencies 34558 */ 34559 34560 34561 const menu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 34562 xmlns: "http://www.w3.org/2000/svg", 34563 viewBox: "0 0 24 24", 34564 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 34565 d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" 34566 }) 34567 }); 34568 /* harmony default export */ const library_menu = (menu); 34569 34570 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js 34571 /** 34572 * WordPress dependencies 34573 */ 34574 34575 34576 34577 function OverlayMenuIcon({ 34578 icon 34579 }) { 34580 if (icon === 'menu') { 34581 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 34582 icon: library_menu 34583 }); 34584 } 34585 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 34586 xmlns: "http://www.w3.org/2000/svg", 34587 viewBox: "0 0 24 24", 34588 width: "24", 34589 height: "24", 34590 "aria-hidden": "true", 34591 focusable: "false", 34592 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, { 34593 x: "4", 34594 y: "7.5", 34595 width: "16", 34596 height: "1.5" 34597 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, { 34598 x: "4", 34599 y: "15", 34600 width: "16", 34601 height: "1.5" 34602 })] 34603 }); 34604 } 34605 34606 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js 34607 /** 34608 * External dependencies 34609 */ 34610 34611 34612 /** 34613 * WordPress dependencies 34614 */ 34615 34616 34617 34618 34619 34620 /** 34621 * Internal dependencies 34622 */ 34623 34624 34625 function ResponsiveWrapper({ 34626 children, 34627 id, 34628 isOpen, 34629 isResponsive, 34630 onToggle, 34631 isHiddenByDefault, 34632 overlayBackgroundColor, 34633 overlayTextColor, 34634 hasIcon, 34635 icon 34636 }) { 34637 if (!isResponsive) { 34638 return children; 34639 } 34640 const responsiveContainerClasses = dist_clsx('wp-block-navigation__responsive-container', { 34641 'has-text-color': !!overlayTextColor.color || !!overlayTextColor?.class, 34642 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor?.slug)]: !!overlayTextColor?.slug, 34643 'has-background': !!overlayBackgroundColor.color || overlayBackgroundColor?.class, 34644 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor?.slug)]: !!overlayBackgroundColor?.slug, 34645 'is-menu-open': isOpen, 34646 'hidden-by-default': isHiddenByDefault 34647 }); 34648 const styles = { 34649 color: !overlayTextColor?.slug && overlayTextColor?.color, 34650 backgroundColor: !overlayBackgroundColor?.slug && overlayBackgroundColor?.color && overlayBackgroundColor.color 34651 }; 34652 const openButtonClasses = dist_clsx('wp-block-navigation__responsive-container-open', { 34653 'always-shown': isHiddenByDefault 34654 }); 34655 const modalId = `$id}-modal`; 34656 const dialogProps = { 34657 className: 'wp-block-navigation__responsive-dialog', 34658 ...(isOpen && { 34659 role: 'dialog', 34660 'aria-modal': true, 34661 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu') 34662 }) 34663 }; 34664 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 34665 children: [!isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { 34666 __next40pxDefaultSize: true, 34667 "aria-haspopup": "true", 34668 "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Open menu'), 34669 className: openButtonClasses, 34670 onClick: () => onToggle(true), 34671 children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { 34672 icon: icon 34673 }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Menu')] 34674 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34675 className: responsiveContainerClasses, 34676 style: styles, 34677 id: modalId, 34678 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34679 className: "wp-block-navigation__responsive-close", 34680 tabIndex: "-1", 34681 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 34682 ...dialogProps, 34683 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { 34684 __next40pxDefaultSize: true, 34685 className: "wp-block-navigation__responsive-container-close", 34686 "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close menu'), 34687 onClick: () => onToggle(false), 34688 children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 34689 icon: library_close 34690 }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close')] 34691 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34692 className: "wp-block-navigation__responsive-container-content", 34693 id: `$modalId}-content`, 34694 children: children 34695 })] 34696 }) 34697 }) 34698 })] 34699 }); 34700 } 34701 34702 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js 34703 /** 34704 * WordPress dependencies 34705 */ 34706 34707 34708 34709 34710 34711 /** 34712 * Internal dependencies 34713 */ 34714 34715 34716 34717 function NavigationInnerBlocks({ 34718 clientId, 34719 hasCustomPlaceholder, 34720 orientation, 34721 templateLock 34722 }) { 34723 const { 34724 isImmediateParentOfSelectedBlock, 34725 selectedBlockHasChildren, 34726 isSelected 34727 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 34728 const { 34729 getBlockCount, 34730 hasSelectedInnerBlock, 34731 getSelectedBlockClientId 34732 } = select(external_wp_blockEditor_namespaceObject.store); 34733 const selectedBlockId = getSelectedBlockClientId(); 34734 return { 34735 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), 34736 selectedBlockHasChildren: !!getBlockCount(selectedBlockId), 34737 // This prop is already available but computing it here ensures it's 34738 // fresh compared to isImmediateParentOfSelectedBlock. 34739 isSelected: selectedBlockId === clientId 34740 }; 34741 }, [clientId]); 34742 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation'); 34743 34744 // When the block is selected itself or has a top level item selected that 34745 // doesn't itself have children, show the standard appender. Else show no 34746 // appender. 34747 const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren; 34748 const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder_preview, {}), []); 34749 const hasMenuItems = !!blocks?.length; 34750 34751 // If there is a `ref` attribute pointing to a `wp_navigation` but 34752 // that menu has no **items** (i.e. empty) then show a placeholder. 34753 // The block must also be selected else the placeholder will display 34754 // alongside the appender. 34755 const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected; 34756 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 34757 className: 'wp-block-navigation__container' 34758 }, { 34759 value: blocks, 34760 onInput, 34761 onChange, 34762 prioritizedInserterBlocks: PRIORITIZED_INSERTER_BLOCKS, 34763 defaultBlock: constants_DEFAULT_BLOCK, 34764 directInsert: true, 34765 orientation, 34766 templateLock, 34767 // As an exception to other blocks which feature nesting, show 34768 // the block appender even when a child block is selected. 34769 // This should be a temporary fix, to be replaced by improvements to 34770 // the sibling inserter. 34771 // See https://github.com/WordPress/gutenberg/issues/37572. 34772 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || 34773 // Show the appender while dragging to allow inserting element between item and the appender. 34774 parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false, 34775 placeholder: showPlaceholder ? placeholder : undefined, 34776 __experimentalCaptureToolbars: true, 34777 __unstableDisableLayoutClassNames: true 34778 }); 34779 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 34780 ...innerBlocksProps 34781 }); 34782 } 34783 34784 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js 34785 /** 34786 * WordPress dependencies 34787 */ 34788 34789 34790 34791 34792 function NavigationMenuNameControl() { 34793 const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 34794 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 34795 __next40pxDefaultSize: true, 34796 __nextHasNoMarginBottom: true, 34797 label: (0,external_wp_i18n_namespaceObject.__)('Menu name'), 34798 value: title, 34799 onChange: updateTitle 34800 }); 34801 } 34802 34803 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/are-blocks-dirty.js 34804 function areBlocksDirty(originalBlocks, blocks) { 34805 return !isDeepEqual(originalBlocks, blocks, (prop, x) => { 34806 // Skip inner blocks of page list during comparison as they 34807 // are **always** controlled and may be updated async due to 34808 // syncing with entity records. Left unchecked this would 34809 // inadvertently trigger the dirty state. 34810 if (x?.name === 'core/page-list' && prop === 'innerBlocks') { 34811 return true; 34812 } 34813 }); 34814 } 34815 34816 /** 34817 * Conditionally compares two candidates for deep equality. 34818 * Provides an option to skip a given property of an object during comparison. 34819 * 34820 * @param {*} x 1st candidate for comparison 34821 * @param {*} y 2nd candidate for comparison 34822 * @param {Function|undefined} shouldSkip a function which can be used to skip a given property of an object. 34823 * @return {boolean} whether the two candidates are deeply equal. 34824 */ 34825 const isDeepEqual = (x, y, shouldSkip) => { 34826 if (x === y) { 34827 return true; 34828 } else if (typeof x === 'object' && x !== null && x !== undefined && typeof y === 'object' && y !== null && y !== undefined) { 34829 if (Object.keys(x).length !== Object.keys(y).length) { 34830 return false; 34831 } 34832 for (const prop in x) { 34833 if (y.hasOwnProperty(prop)) { 34834 // Afford skipping a given property of an object. 34835 if (shouldSkip && shouldSkip(prop, x)) { 34836 return true; 34837 } 34838 if (!isDeepEqual(x[prop], y[prop], shouldSkip)) { 34839 return false; 34840 } 34841 } else { 34842 return false; 34843 } 34844 } 34845 return true; 34846 } 34847 return false; 34848 }; 34849 34850 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js 34851 /** 34852 * WordPress dependencies 34853 */ 34854 34855 34856 34857 34858 34859 34860 /** 34861 * Internal dependencies 34862 */ 34863 34864 34865 34866 const EMPTY_OBJECT = {}; 34867 function UnsavedInnerBlocks({ 34868 blocks, 34869 createNavigationMenu, 34870 hasSelection 34871 }) { 34872 const originalBlocksRef = (0,external_wp_element_namespaceObject.useRef)(); 34873 (0,external_wp_element_namespaceObject.useEffect)(() => { 34874 // Initially store the uncontrolled inner blocks for 34875 // dirty state comparison. 34876 if (!originalBlocksRef?.current) { 34877 originalBlocksRef.current = blocks; 34878 } 34879 }, [blocks]); 34880 34881 // If the current inner blocks are different from the original inner blocks 34882 // from the post content then the user has made changes to the inner blocks. 34883 // At this point the inner blocks can be considered "dirty". 34884 // Note: referential equality is not sufficient for comparison as the inner blocks 34885 // of the page list are controlled and may be updated async due to syncing with 34886 // entity records. As a result we need to perform a deep equality check skipping 34887 // the page list's inner blocks. 34888 const innerBlocksAreDirty = areBlocksDirty(originalBlocksRef?.current, blocks); 34889 34890 // The block will be disabled in a block preview, use this as a way of 34891 // avoiding the side-effects of this component for block previews. 34892 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 34893 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 34894 className: 'wp-block-navigation__container' 34895 }, { 34896 renderAppender: hasSelection ? undefined : false, 34897 defaultBlock: constants_DEFAULT_BLOCK, 34898 directInsert: true 34899 }); 34900 const { 34901 isSaving, 34902 hasResolvedAllNavigationMenus 34903 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 34904 if (isDisabled) { 34905 return EMPTY_OBJECT; 34906 } 34907 const { 34908 hasFinishedResolution, 34909 isSavingEntityRecord 34910 } = select(external_wp_coreData_namespaceObject.store); 34911 return { 34912 isSaving: isSavingEntityRecord('postType', 'wp_navigation'), 34913 hasResolvedAllNavigationMenus: hasFinishedResolution('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS) 34914 }; 34915 }, [isDisabled]); 34916 34917 // Automatically save the uncontrolled blocks. 34918 (0,external_wp_element_namespaceObject.useEffect)(() => { 34919 // The block will be disabled when used in a BlockPreview. 34920 // In this case avoid automatic creation of a wp_navigation post. 34921 // Otherwise the user will be spammed with lots of menus! 34922 // 34923 // Also ensure other navigation menus have loaded so an 34924 // accurate name can be created. 34925 // 34926 // Don't try saving when another save is already 34927 // in progress. 34928 // 34929 // And finally only create the menu when the block is selected, 34930 // which is an indication they want to start editing. 34931 if (isDisabled || isSaving || !hasResolvedAllNavigationMenus || !hasSelection || !innerBlocksAreDirty) { 34932 return; 34933 } 34934 createNavigationMenu(null, blocks); 34935 }, [blocks, createNavigationMenu, isDisabled, isSaving, hasResolvedAllNavigationMenus, innerBlocksAreDirty, hasSelection]); 34936 const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div'; 34937 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { 34938 ...innerBlocksProps 34939 }); 34940 } 34941 34942 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js 34943 /** 34944 * WordPress dependencies 34945 */ 34946 34947 34948 34949 34950 34951 34952 function NavigationMenuDeleteControl({ 34953 onDelete 34954 }) { 34955 const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0,external_wp_element_namespaceObject.useState)(false); 34956 const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation'); 34957 const { 34958 deleteEntityRecord 34959 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 34960 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 34961 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 34962 __next40pxDefaultSize: true, 34963 className: "wp-block-navigation-delete-menu-button", 34964 variant: "secondary", 34965 isDestructive: true, 34966 onClick: () => { 34967 setIsConfirmDialogVisible(true); 34968 }, 34969 children: (0,external_wp_i18n_namespaceObject.__)('Delete menu') 34970 }), isConfirmDialogVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { 34971 isOpen: true, 34972 onConfirm: () => { 34973 deleteEntityRecord('postType', 'wp_navigation', id, { 34974 force: true 34975 }); 34976 onDelete(); 34977 }, 34978 onCancel: () => { 34979 setIsConfirmDialogVisible(false); 34980 }, 34981 confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), 34982 size: "medium", 34983 children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') 34984 })] 34985 }); 34986 } 34987 34988 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js 34989 /** 34990 * WordPress dependencies 34991 */ 34992 34993 34994 34995 function useNavigationNotice({ 34996 name, 34997 message = '' 34998 } = {}) { 34999 const noticeRef = (0,external_wp_element_namespaceObject.useRef)(); 35000 const { 35001 createWarningNotice, 35002 removeNotice 35003 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 35004 const showNotice = (0,external_wp_element_namespaceObject.useCallback)(customMsg => { 35005 if (noticeRef.current) { 35006 return; 35007 } 35008 noticeRef.current = name; 35009 createWarningNotice(customMsg || message, { 35010 id: noticeRef.current, 35011 type: 'snackbar' 35012 }); 35013 }, [noticeRef, createWarningNotice, message, name]); 35014 const hideNotice = (0,external_wp_element_namespaceObject.useCallback)(() => { 35015 if (!noticeRef.current) { 35016 return; 35017 } 35018 removeNotice(noticeRef.current); 35019 noticeRef.current = null; 35020 }, [noticeRef, removeNotice]); 35021 return [showNotice, hideNotice]; 35022 } 35023 /* harmony default export */ const use_navigation_notice = (useNavigationNotice); 35024 35025 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-preview.js 35026 /** 35027 * WordPress dependencies 35028 */ 35029 35030 35031 35032 /** 35033 * Internal dependencies 35034 */ 35035 35036 35037 function OverlayMenuPreview({ 35038 setAttributes, 35039 hasIcon, 35040 icon 35041 }) { 35042 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 35043 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 35044 __nextHasNoMarginBottom: true, 35045 label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'), 35046 help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button that toggles the overlay menu.'), 35047 onChange: value => setAttributes({ 35048 hasIcon: value 35049 }), 35050 checked: hasIcon 35051 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 35052 __next40pxDefaultSize: true, 35053 __nextHasNoMarginBottom: true, 35054 className: "wp-block-navigation__overlay-menu-icon-toggle-group", 35055 label: (0,external_wp_i18n_namespaceObject.__)('Icon'), 35056 value: icon, 35057 onChange: value => setAttributes({ 35058 icon: value 35059 }), 35060 isBlock: true, 35061 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 35062 value: "handle", 35063 "aria-label": (0,external_wp_i18n_namespaceObject.__)('handle'), 35064 label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { 35065 icon: "handle" 35066 }) 35067 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 35068 value: "menu", 35069 "aria-label": (0,external_wp_i18n_namespaceObject.__)('menu'), 35070 label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { 35071 icon: "menu" 35072 }) 35073 })] 35074 })] 35075 }); 35076 } 35077 35078 ;// ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js 35079 /* wp:polyfill */ 35080 /** 35081 * WordPress dependencies 35082 */ 35083 35084 35085 35086 /** 35087 * Convert a flat menu item structure to a nested blocks structure. 35088 * 35089 * @param {Object[]} menuItems An array of menu items. 35090 * 35091 * @return {WPBlock[]} An array of blocks. 35092 */ 35093 function menuItemsToBlocks(menuItems) { 35094 if (!menuItems) { 35095 return null; 35096 } 35097 const menuTree = createDataTree(menuItems); 35098 const blocks = mapMenuItemsToBlocks(menuTree); 35099 return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems); 35100 } 35101 35102 /** 35103 * A recursive function that maps menu item nodes to blocks. 35104 * 35105 * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items. 35106 * @param {number} level An integer representing the nesting level. 35107 * @return {Object} Object containing innerBlocks and mapping. 35108 */ 35109 function mapMenuItemsToBlocks(menuItems, level = 0) { 35110 let mapping = {}; 35111 35112 // The menuItem should be in menu_order sort order. 35113 const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order); 35114 const innerBlocks = sortedItems.map(menuItem => { 35115 if (menuItem.type === 'block') { 35116 const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw); 35117 if (!block) { 35118 return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', { 35119 content: menuItem.content 35120 }); 35121 } 35122 return block; 35123 } 35124 const blockType = menuItem.children?.length ? 'core/navigation-submenu' : 'core/navigation-link'; 35125 const attributes = menuItemToBlockAttributes(menuItem, blockType, level); 35126 35127 // If there are children recurse to build those nested blocks. 35128 const { 35129 innerBlocks: nestedBlocks = [], 35130 // alias to avoid shadowing 35131 mapping: nestedMapping = {} // alias to avoid shadowing 35132 } = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; 35133 35134 // Update parent mapping with nested mapping. 35135 mapping = { 35136 ...mapping, 35137 ...nestedMapping 35138 }; 35139 35140 // Create block with nested "innerBlocks". 35141 const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); 35142 35143 // Create mapping for menuItem -> block. 35144 mapping[menuItem.id] = block.clientId; 35145 return block; 35146 }); 35147 return { 35148 innerBlocks, 35149 mapping 35150 }; 35151 } 35152 35153 /** 35154 * A WP nav_menu_item object. 35155 * For more documentation on the individual fields present on a menu item please see: 35156 * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789 35157 * 35158 * @typedef WPNavMenuItem 35159 * 35160 * @property {Object} title stores the raw and rendered versions of the title/label for this menu item. 35161 * @property {Array} xfn the XFN relationships expressed in the link of this menu item. 35162 * @property {Array} classes the HTML class attributes for this menu item. 35163 * @property {string} attr_title the HTML title attribute for this menu item. 35164 * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'. 35165 * @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. 35166 * @property {string} description The description of this menu item. 35167 * @property {string} url The URL to which this menu item points. 35168 * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'. 35169 * @property {string} target The target attribute of the link element for this menu item. 35170 */ 35171 35172 /** 35173 * Convert block attributes to menu item. 35174 * 35175 * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes. 35176 * @param {string} blockType The block type. 35177 * @param {number} level An integer representing the nesting level. 35178 * @return {Object} the block attributes converted from the WPNavMenuItem item. 35179 */ 35180 function menuItemToBlockAttributes({ 35181 title: menuItemTitleField, 35182 xfn, 35183 classes, 35184 // eslint-disable-next-line camelcase 35185 attr_title, 35186 object, 35187 // eslint-disable-next-line camelcase 35188 object_id, 35189 description, 35190 url, 35191 type: menuItemTypeField, 35192 target 35193 }, blockType, level) { 35194 // For historical reasons, the `core/navigation-link` variation type is `tag` 35195 // whereas WP Core expects `post_tag` as the `object` type. 35196 // To avoid writing a block migration we perform a conversion here. 35197 // See also inverse equivalent in `blockAttributesToMenuItem`. 35198 if (object && object === 'post_tag') { 35199 object = 'tag'; 35200 } 35201 return { 35202 label: menuItemTitleField?.rendered || '', 35203 ...(object?.length && { 35204 type: object 35205 }), 35206 kind: menuItemTypeField?.replace('_', '-') || 'custom', 35207 url: url || '', 35208 ...(xfn?.length && xfn.join(' ').trim() && { 35209 rel: xfn.join(' ').trim() 35210 }), 35211 ...(classes?.length && classes.join(' ').trim() && { 35212 className: classes.join(' ').trim() 35213 }), 35214 /* eslint-disable camelcase */ 35215 ...(attr_title?.length && { 35216 title: attr_title 35217 }), 35218 ...(object_id && 'custom' !== object && { 35219 id: object_id 35220 }), 35221 /* eslint-enable camelcase */ 35222 ...(description?.length && { 35223 description 35224 }), 35225 ...(target === '_blank' && { 35226 opensInNewTab: true 35227 }), 35228 ...(blockType === 'core/navigation-submenu' && { 35229 isTopLevelItem: level === 0 35230 }), 35231 ...(blockType === 'core/navigation-link' && { 35232 isTopLevelLink: level === 0 35233 }) 35234 }; 35235 } 35236 35237 /** 35238 * Creates a nested, hierarchical tree representation from unstructured data that 35239 * has an inherent relationship defined between individual items. 35240 * 35241 * For example, by default, each element in the dataset should have an `id` and 35242 * `parent` property where the `parent` property indicates a relationship between 35243 * the current item and another item with a matching `id` properties. 35244 * 35245 * This is useful for building linked lists of data from flat data structures. 35246 * 35247 * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields. 35248 * @param {string} id the property which uniquely identifies each entry within the array. 35249 * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all). 35250 * @return {Array} a nested array of parent/child relationships 35251 */ 35252 function createDataTree(dataset, id = 'id', relation = 'parent') { 35253 const hashTable = Object.create(null); 35254 const dataTree = []; 35255 for (const data of dataset) { 35256 hashTable[data[id]] = { 35257 ...data, 35258 children: [] 35259 }; 35260 if (data[relation]) { 35261 hashTable[data[relation]] = hashTable[data[relation]] || {}; 35262 hashTable[data[relation]].children = hashTable[data[relation]].children || []; 35263 hashTable[data[relation]].children.push(hashTable[data[id]]); 35264 } else { 35265 dataTree.push(hashTable[data[id]]); 35266 } 35267 } 35268 return dataTree; 35269 } 35270 35271 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js 35272 /** 35273 * WordPress dependencies 35274 */ 35275 35276 35277 35278 35279 35280 /** 35281 * Internal dependencies 35282 */ 35283 35284 const CLASSIC_MENU_CONVERSION_SUCCESS = 'success'; 35285 const CLASSIC_MENU_CONVERSION_ERROR = 'error'; 35286 const CLASSIC_MENU_CONVERSION_PENDING = 'pending'; 35287 const CLASSIC_MENU_CONVERSION_IDLE = 'idle'; 35288 35289 // This is needed to ensure that multiple components using this hook 35290 // do not import the same classic menu twice. 35291 let classicMenuBeingConvertedId = null; 35292 function useConvertClassicToBlockMenu(createNavigationMenu, { 35293 throwOnError = false 35294 } = {}) { 35295 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 35296 const { 35297 editEntityRecord 35298 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 35299 const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE); 35300 const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); 35301 const convertClassicMenuToBlockMenu = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => { 35302 let navigationMenu; 35303 let classicMenuItems; 35304 35305 // 1. Fetch the classic Menu items. 35306 try { 35307 classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({ 35308 menus: menuId, 35309 per_page: -1, 35310 context: 'view' 35311 }); 35312 } catch (err) { 35313 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 35314 // translators: %s: The name of a menu (e.g. Header menu). 35315 (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), { 35316 cause: err 35317 }); 35318 } 35319 35320 // Handle offline response which resolves to `null`. 35321 if (classicMenuItems === null) { 35322 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 35323 // translators: %s: The name of a menu (e.g. Header menu). 35324 (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName)); 35325 } 35326 35327 // 2. Convert the classic items into blocks. 35328 const { 35329 innerBlocks 35330 } = menuItemsToBlocks(classicMenuItems); 35331 35332 // 3. Create the `wp_navigation` Post with the blocks. 35333 try { 35334 navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus); 35335 35336 /** 35337 * Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'. 35338 * This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty". 35339 * The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_, 35340 * without user interaction. 35341 * If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft. 35342 */ 35343 await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, { 35344 status: 'publish' 35345 }, { 35346 throwOnError: true 35347 }); 35348 } catch (err) { 35349 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 35350 // translators: %s: The name of a menu (e.g. Header menu). 35351 (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { 35352 cause: err 35353 }); 35354 } 35355 return navigationMenu; 35356 }, [createNavigationMenu, editEntityRecord, registry]); 35357 const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus) => { 35358 // Check whether this classic menu is being imported already. 35359 if (classicMenuBeingConvertedId === menuId) { 35360 return; 35361 } 35362 35363 // Set the ID for the currently importing classic menu. 35364 classicMenuBeingConvertedId = menuId; 35365 if (!menuId || !menuName) { 35366 setError('Unable to convert menu. Missing menu details.'); 35367 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 35368 return; 35369 } 35370 setStatus(CLASSIC_MENU_CONVERSION_PENDING); 35371 setError(null); 35372 return await convertClassicMenuToBlockMenu(menuId, menuName, postStatus).then(navigationMenu => { 35373 setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); 35374 // Reset the ID for the currently importing classic menu. 35375 classicMenuBeingConvertedId = null; 35376 return navigationMenu; 35377 }).catch(err => { 35378 setError(err?.message); 35379 // Reset the ID for the currently importing classic menu. 35380 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 35381 35382 // Reset the ID for the currently importing classic menu. 35383 classicMenuBeingConvertedId = null; 35384 35385 // Rethrow error for debugging. 35386 if (throwOnError) { 35387 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( 35388 // translators: %s: The name of a menu (e.g. Header menu). 35389 (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { 35390 cause: err 35391 }); 35392 } 35393 }); 35394 }, [convertClassicMenuToBlockMenu, throwOnError]); 35395 return { 35396 convert, 35397 status, 35398 error 35399 }; 35400 } 35401 /* harmony default export */ const use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu); 35402 35403 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js 35404 /** 35405 * Generates a template part Id based on slug and theme inputs. 35406 * 35407 * @param {string} theme the template part's theme. 35408 * @param {string} slug the template part's slug 35409 * @return {string|null} the template part's Id. 35410 */ 35411 function createTemplatePartId(theme, slug) { 35412 return theme && slug ? theme + '//' + slug : null; 35413 } 35414 35415 ;// ./node_modules/@wordpress/icons/build-module/library/header.js 35416 /** 35417 * WordPress dependencies 35418 */ 35419 35420 35421 const header = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35422 xmlns: "http://www.w3.org/2000/svg", 35423 viewBox: "0 0 24 24", 35424 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35425 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" 35426 }) 35427 }); 35428 /* harmony default export */ const library_header = (header); 35429 35430 ;// ./node_modules/@wordpress/icons/build-module/library/footer.js 35431 /** 35432 * WordPress dependencies 35433 */ 35434 35435 35436 const footer = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35437 xmlns: "http://www.w3.org/2000/svg", 35438 viewBox: "0 0 24 24", 35439 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35440 fillRule: "evenodd", 35441 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" 35442 }) 35443 }); 35444 /* harmony default export */ const library_footer = (footer); 35445 35446 ;// ./node_modules/@wordpress/icons/build-module/library/sidebar.js 35447 /** 35448 * WordPress dependencies 35449 */ 35450 35451 35452 const sidebar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35453 xmlns: "http://www.w3.org/2000/svg", 35454 viewBox: "0 0 24 24", 35455 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35456 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" 35457 }) 35458 }); 35459 /* harmony default export */ const library_sidebar = (sidebar); 35460 35461 ;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js 35462 /** 35463 * WordPress dependencies 35464 */ 35465 35466 35467 const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35468 xmlns: "http://www.w3.org/2000/svg", 35469 viewBox: "0 0 24 24", 35470 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35471 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" 35472 }) 35473 }); 35474 /* harmony default export */ const symbol_filled = (symbolFilled); 35475 35476 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/get-template-part-icon.js 35477 /** 35478 * WordPress dependencies 35479 */ 35480 35481 const getTemplatePartIcon = iconName => { 35482 if ('header' === iconName) { 35483 return library_header; 35484 } else if ('footer' === iconName) { 35485 return library_footer; 35486 } else if ('sidebar' === iconName) { 35487 return library_sidebar; 35488 } 35489 return symbol_filled; 35490 }; 35491 35492 ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js 35493 /* wp:polyfill */ 35494 /** 35495 * WordPress dependencies 35496 */ 35497 35498 35499 35500 35501 /** 35502 * Internal dependencies 35503 */ 35504 35505 // TODO: this util should perhaps be refactored somewhere like core-data. 35506 35507 35508 function useTemplatePartAreaLabel(clientId) { 35509 return (0,external_wp_data_namespaceObject.useSelect)(select => { 35510 // Use the lack of a clientId as an opportunity to bypass the rest 35511 // of this hook. 35512 if (!clientId) { 35513 return; 35514 } 35515 const { 35516 getBlock, 35517 getBlockParentsByBlockName 35518 } = select(external_wp_blockEditor_namespaceObject.store); 35519 const withAscendingResults = true; 35520 const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults); 35521 if (!parentTemplatePartClientIds?.length) { 35522 return; 35523 } 35524 const defaultTemplatePartAreas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; 35525 const definedAreas = defaultTemplatePartAreas.map(item => ({ 35526 ...item, 35527 icon: getTemplatePartIcon(item.icon) 35528 })); 35529 const { 35530 getCurrentTheme, 35531 getEditedEntityRecord 35532 } = select(external_wp_coreData_namespaceObject.store); 35533 for (const templatePartClientId of parentTemplatePartClientIds) { 35534 const templatePartBlock = getBlock(templatePartClientId); 35535 35536 // The 'area' usually isn't stored on the block, but instead 35537 // on the entity. 35538 const { 35539 theme = getCurrentTheme()?.stylesheet, 35540 slug 35541 } = templatePartBlock.attributes; 35542 const templatePartEntityId = createTemplatePartId(theme, slug); 35543 const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); 35544 35545 // Look up the `label` for the area in the defined areas so 35546 // that an internationalized label can be used. 35547 if (templatePartEntity?.area) { 35548 return definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)?.label; 35549 } 35550 } 35551 }, [clientId]); 35552 } 35553 35554 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js 35555 /* wp:polyfill */ 35556 /** 35557 * WordPress dependencies 35558 */ 35559 35560 35561 35562 35563 35564 35565 /** 35566 * Internal dependencies 35567 */ 35568 35569 const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', { 35570 status: 'draft', 35571 per_page: -1 35572 }]; 35573 const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', { 35574 per_page: -1, 35575 status: 'publish' 35576 }]; 35577 function useGenerateDefaultNavigationTitle(clientId) { 35578 // The block will be disabled in a block preview, use this as a way of 35579 // avoiding the side-effects of this component for block previews. 35580 const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); 35581 35582 // Because we can't conditionally call hooks, pass an undefined client id 35583 // arg to bypass the expensive `useTemplateArea` code. The hook will return 35584 // early. 35585 const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId); 35586 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 35587 return (0,external_wp_element_namespaceObject.useCallback)(async () => { 35588 // Ensure other navigation menus have loaded so an 35589 // accurate name can be created. 35590 if (isDisabled) { 35591 return ''; 35592 } 35593 const { 35594 getEntityRecords 35595 } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); 35596 const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]); 35597 const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( 35598 // translators: %s: the name of a menu (e.g. Header menu). 35599 (0,external_wp_i18n_namespaceObject.__)('%s menu'), area) : 35600 // translators: 'menu' as in website navigation menu. 35601 (0,external_wp_i18n_namespaceObject.__)('Menu'); 35602 35603 // Determine how many menus start with the automatic title. 35604 const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => menu?.title?.raw?.startsWith(title) ? count + 1 : count, 0); 35605 35606 // Append a number to the end of the title if a menu with 35607 // the same name exists. 35608 const titleWithCount = matchingMenuTitleCount > 0 ? `$title} $matchingMenuTitleCount + 1}` : title; 35609 return titleWithCount || ''; 35610 }, [isDisabled, area, registry]); 35611 } 35612 35613 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js 35614 /** 35615 * WordPress dependencies 35616 */ 35617 35618 35619 35620 35621 35622 /** 35623 * Internal dependencies 35624 */ 35625 35626 const CREATE_NAVIGATION_MENU_SUCCESS = 'success'; 35627 const CREATE_NAVIGATION_MENU_ERROR = 'error'; 35628 const CREATE_NAVIGATION_MENU_PENDING = 'pending'; 35629 const CREATE_NAVIGATION_MENU_IDLE = 'idle'; 35630 function useCreateNavigationMenu(clientId) { 35631 const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE); 35632 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null); 35633 const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); 35634 const { 35635 saveEntityRecord, 35636 editEntityRecord 35637 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 35638 const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); 35639 35640 // This callback uses data from the two placeholder steps and only creates 35641 // a new navigation menu when the user completes the final step. 35642 const create = (0,external_wp_element_namespaceObject.useCallback)(async (title = null, blocks = [], postStatus) => { 35643 // Guard against creating Navigations without a title. 35644 // Note you can pass no title, but if one is passed it must be 35645 // a string otherwise the title may end up being empty. 35646 if (title && typeof title !== 'string') { 35647 setError('Invalid title supplied when creating Navigation Menu.'); 35648 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35649 throw new Error(`Value of supplied title argument was not a string.`); 35650 } 35651 setStatus(CREATE_NAVIGATION_MENU_PENDING); 35652 setValue(null); 35653 setError(null); 35654 if (!title) { 35655 title = await generateDefaultTitle().catch(err => { 35656 setError(err?.message); 35657 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35658 throw new Error('Failed to create title when saving new Navigation Menu.', { 35659 cause: err 35660 }); 35661 }); 35662 } 35663 const record = { 35664 title, 35665 content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), 35666 status: postStatus 35667 }; 35668 35669 // Return affords ability to await on this function directly 35670 return saveEntityRecord('postType', 'wp_navigation', record).then(response => { 35671 setValue(response); 35672 setStatus(CREATE_NAVIGATION_MENU_SUCCESS); 35673 35674 // Set the status to publish so that the Navigation block 35675 // shows up in the multi entity save flow. 35676 if (postStatus !== 'publish') { 35677 editEntityRecord('postType', 'wp_navigation', response.id, { 35678 status: 'publish' 35679 }); 35680 } 35681 return response; 35682 }).catch(err => { 35683 setError(err?.message); 35684 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35685 throw new Error('Unable to save new Navigation Menu', { 35686 cause: err 35687 }); 35688 }); 35689 }, [saveEntityRecord, editEntityRecord, generateDefaultTitle]); 35690 return { 35691 create, 35692 status, 35693 value, 35694 error, 35695 isIdle: status === CREATE_NAVIGATION_MENU_IDLE, 35696 isPending: status === CREATE_NAVIGATION_MENU_PENDING, 35697 isSuccess: status === CREATE_NAVIGATION_MENU_SUCCESS, 35698 isError: status === CREATE_NAVIGATION_MENU_ERROR 35699 }; 35700 } 35701 35702 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js 35703 /** 35704 * WordPress dependencies 35705 */ 35706 35707 35708 const use_inner_blocks_EMPTY_ARRAY = []; 35709 function useInnerBlocks(clientId) { 35710 return (0,external_wp_data_namespaceObject.useSelect)(select => { 35711 const { 35712 getBlock, 35713 getBlocks, 35714 hasSelectedInnerBlock 35715 } = select(external_wp_blockEditor_namespaceObject.store); 35716 35717 // This relies on the fact that `getBlock` won't return controlled 35718 // inner blocks, while `getBlocks` does. It might be more stable to 35719 // introduce a selector like `getUncontrolledInnerBlocks`, just in 35720 // case `getBlock` is fixed. 35721 const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks; 35722 const _hasUncontrolledInnerBlocks = !!_uncontrolledInnerBlocks?.length; 35723 const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? use_inner_blocks_EMPTY_ARRAY : getBlocks(clientId); 35724 return { 35725 innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks, 35726 hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks, 35727 uncontrolledInnerBlocks: _uncontrolledInnerBlocks, 35728 controlledInnerBlocks: _controlledInnerBlocks, 35729 isInnerBlockSelected: hasSelectedInnerBlock(clientId, true) 35730 }; 35731 }, [clientId]); 35732 } 35733 35734 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/utils.js 35735 /** 35736 * External dependencies 35737 */ 35738 35739 function getComputedStyle(node) { 35740 return node.ownerDocument.defaultView.getComputedStyle(node); 35741 } 35742 function detectColors(colorsDetectionElement, setColor, setBackground) { 35743 if (!colorsDetectionElement) { 35744 return; 35745 } 35746 setColor(getComputedStyle(colorsDetectionElement).color); 35747 let backgroundColorNode = colorsDetectionElement; 35748 let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 35749 while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { 35750 backgroundColorNode = backgroundColorNode.parentNode; 35751 backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 35752 } 35753 setBackground(backgroundColor); 35754 } 35755 35756 /** 35757 * Determine the colors for a menu. 35758 * 35759 * Order of priority is: 35760 * 1: Overlay custom colors (if submenu) 35761 * 2: Overlay theme colors (if submenu) 35762 * 3: Custom colors 35763 * 4: Theme colors 35764 * 5: Global styles 35765 * 35766 * @param {Object} context 35767 * @param {boolean} isSubMenu 35768 */ 35769 function getColors(context, isSubMenu) { 35770 const { 35771 textColor, 35772 customTextColor, 35773 backgroundColor, 35774 customBackgroundColor, 35775 overlayTextColor, 35776 customOverlayTextColor, 35777 overlayBackgroundColor, 35778 customOverlayBackgroundColor, 35779 style 35780 } = context; 35781 const colors = {}; 35782 if (isSubMenu && !!customOverlayTextColor) { 35783 colors.customTextColor = customOverlayTextColor; 35784 } else if (isSubMenu && !!overlayTextColor) { 35785 colors.textColor = overlayTextColor; 35786 } else if (!!customTextColor) { 35787 colors.customTextColor = customTextColor; 35788 } else if (!!textColor) { 35789 colors.textColor = textColor; 35790 } else if (!!style?.color?.text) { 35791 colors.customTextColor = style.color.text; 35792 } 35793 if (isSubMenu && !!customOverlayBackgroundColor) { 35794 colors.customBackgroundColor = customOverlayBackgroundColor; 35795 } else if (isSubMenu && !!overlayBackgroundColor) { 35796 colors.backgroundColor = overlayBackgroundColor; 35797 } else if (!!customBackgroundColor) { 35798 colors.customBackgroundColor = customBackgroundColor; 35799 } else if (!!backgroundColor) { 35800 colors.backgroundColor = backgroundColor; 35801 } else if (!!style?.color?.background) { 35802 colors.customTextColor = style.color.background; 35803 } 35804 return colors; 35805 } 35806 function getNavigationChildBlockProps(innerBlocksColors) { 35807 return { 35808 className: dist_clsx('wp-block-navigation__submenu-container', { 35809 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor), 35810 [`has-$innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor, 35811 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor), 35812 [`has-$innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor 35813 }), 35814 style: { 35815 color: innerBlocksColors.customTextColor, 35816 backgroundColor: innerBlocksColors.customBackgroundColor 35817 } 35818 }; 35819 } 35820 35821 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/manage-menus-button.js 35822 /** 35823 * WordPress dependencies 35824 */ 35825 35826 35827 35828 35829 const ManageMenusButton = ({ 35830 className = '', 35831 disabled, 35832 isMenuItem = false 35833 }) => { 35834 let ComponentName = external_wp_components_namespaceObject.Button; 35835 if (isMenuItem) { 35836 ComponentName = external_wp_components_namespaceObject.MenuItem; 35837 } 35838 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentName, { 35839 variant: "link", 35840 disabled: disabled, 35841 className: className, 35842 href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { 35843 post_type: 'wp_navigation' 35844 }), 35845 children: (0,external_wp_i18n_namespaceObject.__)('Manage menus') 35846 }); 35847 }; 35848 /* harmony default export */ const manage_menus_button = (ManageMenusButton); 35849 35850 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/deleted-navigation-warning.js 35851 /** 35852 * WordPress dependencies 35853 */ 35854 35855 35856 35857 35858 35859 function DeletedNavigationWarning({ 35860 onCreateNew, 35861 isNotice = false 35862 }) { 35863 const [isButtonDisabled, setIsButtonDisabled] = (0,external_wp_element_namespaceObject.useState)(false); 35864 const handleButtonClick = () => { 35865 setIsButtonDisabled(true); 35866 onCreateNew(); 35867 }; 35868 const message = (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>'), { 35869 button: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 35870 __next40pxDefaultSize: true, 35871 onClick: handleButtonClick, 35872 variant: "link", 35873 disabled: isButtonDisabled, 35874 accessibleWhenDisabled: true 35875 }) 35876 }); 35877 return isNotice ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 35878 status: "warning", 35879 isDismissible: false, 35880 children: message 35881 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 35882 children: message 35883 }); 35884 } 35885 /* harmony default export */ const deleted_navigation_warning = (DeletedNavigationWarning); 35886 35887 ;// ./node_modules/@wordpress/icons/build-module/library/add-submenu.js 35888 /** 35889 * WordPress dependencies 35890 */ 35891 35892 35893 const addSubmenu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35894 xmlns: "http://www.w3.org/2000/svg", 35895 viewBox: "0 0 24 24", 35896 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35897 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" 35898 }) 35899 }); 35900 /* harmony default export */ const add_submenu = (addSubmenu); 35901 35902 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js 35903 /** 35904 * WordPress dependencies 35905 */ 35906 35907 35908 const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 35909 viewBox: "0 0 24 24", 35910 xmlns: "http://www.w3.org/2000/svg", 35911 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 35912 d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" 35913 }) 35914 }); 35915 /* harmony default export */ const chevron_up = (chevronUp); 35916 35917 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/leaf-more-menu.js 35918 /** 35919 * WordPress dependencies 35920 */ 35921 35922 35923 35924 35925 35926 35927 35928 const POPOVER_PROPS = { 35929 className: 'block-editor-block-settings-menu__popover', 35930 placement: 'bottom-start' 35931 }; 35932 const BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU = ['core/navigation-link', 'core/navigation-submenu']; 35933 function AddSubmenuItem({ 35934 block, 35935 onClose, 35936 expandedState, 35937 expand, 35938 setInsertedBlock 35939 }) { 35940 const { 35941 insertBlock, 35942 replaceBlock, 35943 replaceInnerBlocks 35944 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 35945 const clientId = block.clientId; 35946 const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes(block.name); 35947 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 35948 icon: add_submenu, 35949 disabled: isDisabled, 35950 onClick: () => { 35951 const updateSelectionOnInsert = false; 35952 const newLink = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 35953 if (block.name === 'core/navigation-submenu') { 35954 insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert); 35955 } else { 35956 // Convert to a submenu if the block currently isn't one. 35957 const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); 35958 35959 // The following must happen as two independent actions. 35960 // Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds 35961 // selector to determine which block is "active". As the UX needs the newLink to be 35962 // the "active" block it must be the last block to be inserted. 35963 // Therefore the Submenu is first created and **then** the newLink is inserted 35964 // thus ensuring it is the last inserted block. 35965 replaceBlock(clientId, newSubmenu); 35966 replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert); 35967 } 35968 35969 // This call sets the local List View state for the "last inserted block". 35970 // This is required for the Nav Block to determine whether or not to display 35971 // the Link UI for this new block. 35972 setInsertedBlock(newLink); 35973 if (!expandedState[block.clientId]) { 35974 expand(block.clientId); 35975 } 35976 onClose(); 35977 }, 35978 children: (0,external_wp_i18n_namespaceObject.__)('Add submenu link') 35979 }); 35980 } 35981 function LeafMoreMenu(props) { 35982 const { 35983 block 35984 } = props; 35985 const { 35986 clientId 35987 } = block; 35988 const { 35989 moveBlocksDown, 35990 moveBlocksUp, 35991 removeBlocks 35992 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 35993 const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ 35994 (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ 35995 clientId, 35996 maximumLength: 25 35997 })); 35998 const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { 35999 const { 36000 getBlockRootClientId 36001 } = select(external_wp_blockEditor_namespaceObject.store); 36002 return getBlockRootClientId(clientId); 36003 }, [clientId]); 36004 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { 36005 icon: more_vertical, 36006 label: (0,external_wp_i18n_namespaceObject.__)('Options'), 36007 className: "block-editor-block-settings-menu", 36008 popoverProps: POPOVER_PROPS, 36009 noIcons: true, 36010 ...props, 36011 children: ({ 36012 onClose 36013 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 36014 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { 36015 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 36016 icon: chevron_up, 36017 onClick: () => { 36018 moveBlocksUp([clientId], rootClientId); 36019 onClose(); 36020 }, 36021 children: (0,external_wp_i18n_namespaceObject.__)('Move up') 36022 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 36023 icon: chevron_down, 36024 onClick: () => { 36025 moveBlocksDown([clientId], rootClientId); 36026 onClose(); 36027 }, 36028 children: (0,external_wp_i18n_namespaceObject.__)('Move down') 36029 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddSubmenuItem, { 36030 block: block, 36031 onClose: onClose, 36032 expanded: true, 36033 expandedState: props.expandedState, 36034 expand: props.expand, 36035 setInsertedBlock: props.setInsertedBlock 36036 })] 36037 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 36038 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 36039 onClick: () => { 36040 removeBlocks([clientId], false); 36041 onClose(); 36042 }, 36043 children: removeLabel 36044 }) 36045 })] 36046 }) 36047 }); 36048 } 36049 36050 ;// external ["wp","escapeHtml"] 36051 const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; 36052 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/update-attributes.js 36053 /** 36054 * WordPress dependencies 36055 */ 36056 36057 36058 36059 /** 36060 * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind 36061 */ 36062 /** 36063 * Navigation Link Block Attributes 36064 * 36065 * @typedef {Object} WPNavigationLinkBlockAttributes 36066 * 36067 * @property {string} [label] Link text. 36068 * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. 36069 * @property {string} [type] The type such as post, page, tag, category and other custom types. 36070 * @property {string} [rel] The relationship of the linked URL. 36071 * @property {number} [id] A post or term id. 36072 * @property {boolean} [opensInNewTab] Sets link target to _blank when true. 36073 * @property {string} [url] Link href. 36074 * @property {string} [title] Link title attribute. 36075 */ 36076 /** 36077 * Link Control onChange handler that updates block attributes when a setting is changed. 36078 * 36079 * @param {Object} updatedValue New block attributes to update. 36080 * @param {Function} setAttributes Block attribute update function. 36081 * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes. 36082 */ 36083 36084 const updateAttributes = (updatedValue = {}, setAttributes, blockAttributes = {}) => { 36085 const { 36086 label: originalLabel = '', 36087 kind: originalKind = '', 36088 type: originalType = '' 36089 } = blockAttributes; 36090 const { 36091 title: newLabel = '', 36092 // the title of any provided Post. 36093 url: newUrl = '', 36094 opensInNewTab, 36095 id, 36096 kind: newKind = originalKind, 36097 type: newType = originalType 36098 } = updatedValue; 36099 const newLabelWithoutHttp = newLabel.replace(/http(s?):\/\//gi, ''); 36100 const newUrlWithoutHttp = newUrl.replace(/http(s?):\/\//gi, ''); 36101 const useNewLabel = newLabel && newLabel !== originalLabel && 36102 // LinkControl without the title field relies 36103 // on the check below. Specifically, it assumes that 36104 // the URL is the same as a title. 36105 // This logic a) looks suspicious and b) should really 36106 // live in the LinkControl and not here. It's a great 36107 // candidate for future refactoring. 36108 newLabelWithoutHttp !== newUrlWithoutHttp; 36109 36110 // Unfortunately this causes the escaping model to be inverted. 36111 // The escaped content is stored in the block attributes (and ultimately in the database), 36112 // and then the raw data is "recovered" when outputting into the DOM. 36113 // It would be preferable to store the **raw** data in the block attributes and escape it in JS. 36114 // Why? Because there isn't one way to escape data. Depending on the context, you need to do 36115 // different transforms. It doesn't make sense to me to choose one of them for the purposes of storage. 36116 // See also: 36117 // - https://github.com/WordPress/gutenberg/pull/41063 36118 // - https://github.com/WordPress/gutenberg/pull/18617. 36119 const label = useNewLabel ? (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newLabel) : originalLabel || (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newUrlWithoutHttp); 36120 36121 // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag" 36122 const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_'); 36123 const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1; 36124 const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom'; 36125 const kind = isCustomLink ? 'custom' : newKind; 36126 setAttributes({ 36127 // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string. 36128 ...(newUrl && { 36129 url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(newUrl)) 36130 }), 36131 ...(label && { 36132 label 36133 }), 36134 ...(undefined !== opensInNewTab && { 36135 opensInNewTab 36136 }), 36137 ...(id && Number.isInteger(id) && { 36138 id 36139 }), 36140 ...(kind && { 36141 kind 36142 }), 36143 ...(type && type !== 'URL' && { 36144 type 36145 }) 36146 }); 36147 }; 36148 36149 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js 36150 /** 36151 * WordPress dependencies 36152 */ 36153 36154 36155 const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 36156 xmlns: "http://www.w3.org/2000/svg", 36157 viewBox: "0 0 24 24", 36158 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 36159 d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" 36160 }) 36161 }); 36162 /* harmony default export */ const chevron_right_small = (chevronRightSmall); 36163 36164 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js 36165 /** 36166 * WordPress dependencies 36167 */ 36168 36169 36170 const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 36171 xmlns: "http://www.w3.org/2000/svg", 36172 viewBox: "0 0 24 24", 36173 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 36174 d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" 36175 }) 36176 }); 36177 /* harmony default export */ const chevron_left_small = (chevronLeftSmall); 36178 36179 ;// ./node_modules/@wordpress/icons/build-module/library/plus.js 36180 /** 36181 * WordPress dependencies 36182 */ 36183 36184 36185 const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 36186 xmlns: "http://www.w3.org/2000/svg", 36187 viewBox: "0 0 24 24", 36188 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 36189 d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" 36190 }) 36191 }); 36192 /* harmony default export */ const library_plus = (plus); 36193 36194 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/link-ui.js 36195 /** 36196 * WordPress dependencies 36197 */ 36198 36199 36200 36201 36202 36203 36204 36205 36206 36207 36208 36209 /** 36210 * Internal dependencies 36211 */ 36212 36213 36214 const { 36215 PrivateQuickInserter: QuickInserter 36216 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 36217 36218 /** 36219 * Given the Link block's type attribute, return the query params to give to 36220 * /wp/v2/search. 36221 * 36222 * @param {string} type Link block's type attribute. 36223 * @param {string} kind Link block's entity of kind (post-type|taxonomy) 36224 * @return {{ type?: string, subtype?: string }} Search query params. 36225 */ 36226 function getSuggestionsQuery(type, kind) { 36227 switch (type) { 36228 case 'post': 36229 case 'page': 36230 return { 36231 type: 'post', 36232 subtype: type 36233 }; 36234 case 'category': 36235 return { 36236 type: 'term', 36237 subtype: 'category' 36238 }; 36239 case 'tag': 36240 return { 36241 type: 'term', 36242 subtype: 'post_tag' 36243 }; 36244 case 'post_format': 36245 return { 36246 type: 'post-format' 36247 }; 36248 default: 36249 if (kind === 'taxonomy') { 36250 return { 36251 type: 'term', 36252 subtype: type 36253 }; 36254 } 36255 if (kind === 'post-type') { 36256 return { 36257 type: 'post', 36258 subtype: type 36259 }; 36260 } 36261 return { 36262 // for custom link which has no type 36263 // always show pages as initial suggestions 36264 initialSuggestionsSearchOptions: { 36265 type: 'post', 36266 subtype: 'page', 36267 perPage: 20 36268 } 36269 }; 36270 } 36271 } 36272 function LinkUIBlockInserter({ 36273 clientId, 36274 onBack 36275 }) { 36276 const { 36277 rootBlockClientId 36278 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 36279 const { 36280 getBlockRootClientId 36281 } = select(external_wp_blockEditor_namespaceObject.store); 36282 return { 36283 rootBlockClientId: getBlockRootClientId(clientId) 36284 }; 36285 }, [clientId]); 36286 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); 36287 const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.LinkControl, `link-ui-block-inserter__title`); 36288 const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.LinkControl, `link-ui-block-inserter__description`); 36289 if (!clientId) { 36290 return null; 36291 } 36292 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 36293 className: "link-ui-block-inserter", 36294 role: "dialog", 36295 "aria-labelledby": dialogTitleId, 36296 "aria-describedby": dialogDescriptionId, 36297 ref: focusOnMountRef, 36298 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.VisuallyHidden, { 36299 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { 36300 id: dialogTitleId, 36301 children: (0,external_wp_i18n_namespaceObject.__)('Add block') 36302 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 36303 id: dialogDescriptionId, 36304 children: (0,external_wp_i18n_namespaceObject.__)('Choose a block to add to your Navigation.') 36305 })] 36306 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 36307 className: "link-ui-block-inserter__back", 36308 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_small : chevron_left_small, 36309 onClick: e => { 36310 e.preventDefault(); 36311 onBack(); 36312 }, 36313 size: "small", 36314 children: (0,external_wp_i18n_namespaceObject.__)('Back') 36315 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QuickInserter, { 36316 rootClientId: rootBlockClientId, 36317 clientId: clientId, 36318 isAppender: false, 36319 prioritizePatterns: false, 36320 selectBlockOnInsert: true, 36321 hasSearch: false 36322 })] 36323 }); 36324 } 36325 function UnforwardedLinkUI(props, ref) { 36326 const { 36327 label, 36328 url, 36329 opensInNewTab, 36330 type, 36331 kind 36332 } = props.link; 36333 const postType = type || 'page'; 36334 const [addingBlock, setAddingBlock] = (0,external_wp_element_namespaceObject.useState)(false); 36335 const [focusAddBlockButton, setFocusAddBlockButton] = (0,external_wp_element_namespaceObject.useState)(false); 36336 const { 36337 saveEntityRecord 36338 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 36339 const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)({ 36340 kind: 'postType', 36341 name: postType 36342 }); 36343 async function handleCreate(pageTitle) { 36344 const page = await saveEntityRecord('postType', postType, { 36345 title: pageTitle, 36346 status: 'draft' 36347 }); 36348 return { 36349 id: page.id, 36350 type: postType, 36351 // Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities) 36352 // is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code. 36353 // Ideally in the future we will update both APIs to utilise the "raw" form of the title which is better suited to edit contexts. 36354 // e.g. 36355 // - title.raw = "Yes & No" 36356 // - title.rendered = "Yes & No" 36357 // - decodeEntities( title.rendered ) = "Yes & No" 36358 // See: 36359 // - https://github.com/WordPress/gutenberg/pull/41063 36360 // - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218 36361 title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered), 36362 url: page.link, 36363 kind: 'post-type' 36364 }; 36365 } 36366 36367 // Memoize link value to avoid overriding the LinkControl's internal state. 36368 // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407. 36369 const link = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 36370 url, 36371 opensInNewTab, 36372 title: label && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) 36373 }), [label, opensInNewTab, url]); 36374 const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__title`); 36375 const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__description`); 36376 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, { 36377 ref: ref, 36378 placement: "bottom", 36379 onClose: props.onClose, 36380 anchor: props.anchor, 36381 shift: true, 36382 children: [!addingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 36383 role: "dialog", 36384 "aria-labelledby": dialogTitleId, 36385 "aria-describedby": dialogDescriptionId, 36386 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.VisuallyHidden, { 36387 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { 36388 id: dialogTitleId, 36389 children: (0,external_wp_i18n_namespaceObject.__)('Add link') 36390 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 36391 id: dialogDescriptionId, 36392 children: (0,external_wp_i18n_namespaceObject.__)('Search for and add a link to your Navigation.') 36393 })] 36394 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { 36395 hasTextControl: true, 36396 hasRichPreviews: true, 36397 value: link, 36398 showInitialSuggestions: true, 36399 withCreateSuggestion: permissions.canCreate, 36400 createSuggestion: handleCreate, 36401 createSuggestionButtonText: searchTerm => { 36402 let format; 36403 if (type === 'post') { 36404 /* translators: %s: search term. */ 36405 format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>'); 36406 } else { 36407 /* translators: %s: search term. */ 36408 format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>'); 36409 } 36410 return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), { 36411 mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) 36412 }); 36413 }, 36414 noDirectEntry: !!type, 36415 noURLSuggestion: !!type, 36416 suggestionsQuery: getSuggestionsQuery(type, kind), 36417 onChange: props.onChange, 36418 onRemove: props.onRemove, 36419 onCancel: props.onCancel, 36420 renderControlBottom: () => !link?.url?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUITools, { 36421 focusAddBlockButton: focusAddBlockButton, 36422 setAddingBlock: () => { 36423 setAddingBlock(true); 36424 setFocusAddBlockButton(false); 36425 } 36426 }) 36427 })] 36428 }), addingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUIBlockInserter, { 36429 clientId: props.clientId, 36430 onBack: () => { 36431 setAddingBlock(false); 36432 setFocusAddBlockButton(true); 36433 } 36434 })] 36435 }); 36436 } 36437 const LinkUI = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedLinkUI); 36438 const LinkUITools = ({ 36439 setAddingBlock, 36440 focusAddBlockButton 36441 }) => { 36442 const blockInserterAriaRole = 'listbox'; 36443 const addBlockButtonRef = (0,external_wp_element_namespaceObject.useRef)(); 36444 36445 // Focus the add block button when the popover is opened. 36446 (0,external_wp_element_namespaceObject.useEffect)(() => { 36447 if (focusAddBlockButton) { 36448 addBlockButtonRef.current?.focus(); 36449 } 36450 }, [focusAddBlockButton]); 36451 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { 36452 className: "link-ui-tools", 36453 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 36454 __next40pxDefaultSize: true, 36455 ref: addBlockButtonRef, 36456 icon: library_plus, 36457 onClick: e => { 36458 e.preventDefault(); 36459 setAddingBlock(true); 36460 }, 36461 "aria-haspopup": blockInserterAriaRole, 36462 children: (0,external_wp_i18n_namespaceObject.__)('Add block') 36463 }) 36464 }); 36465 }; 36466 /* harmony default export */ const link_ui = ((/* unused pure expression or super */ null && (LinkUITools))); 36467 36468 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/menu-inspector-controls.js 36469 /** 36470 * WordPress dependencies 36471 */ 36472 36473 36474 36475 36476 36477 /** 36478 * Internal dependencies 36479 */ 36480 36481 36482 36483 36484 36485 36486 36487 36488 const actionLabel = /* translators: %s: The name of a menu. */(0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"); 36489 const BLOCKS_WITH_LINK_UI_SUPPORT = ['core/navigation-link', 'core/navigation-submenu']; 36490 const { 36491 PrivateListView 36492 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 36493 function AdditionalBlockContent({ 36494 block, 36495 insertedBlock, 36496 setInsertedBlock 36497 }) { 36498 const { 36499 updateBlockAttributes 36500 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 36501 const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(insertedBlock?.name); 36502 const blockWasJustInserted = insertedBlock?.clientId === block.clientId; 36503 const showLinkControls = supportsLinkControls && blockWasJustInserted; 36504 if (!showLinkControls) { 36505 return null; 36506 } 36507 const setInsertedBlockAttributes = _insertedBlockClientId => _updatedAttributes => { 36508 if (!_insertedBlockClientId) { 36509 return; 36510 } 36511 updateBlockAttributes(_insertedBlockClientId, _updatedAttributes); 36512 }; 36513 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { 36514 clientId: insertedBlock?.clientId, 36515 link: insertedBlock?.attributes, 36516 onClose: () => { 36517 setInsertedBlock(null); 36518 }, 36519 onChange: updatedValue => { 36520 updateAttributes(updatedValue, setInsertedBlockAttributes(insertedBlock?.clientId), insertedBlock?.attributes); 36521 setInsertedBlock(null); 36522 }, 36523 onCancel: () => { 36524 setInsertedBlock(null); 36525 } 36526 }); 36527 } 36528 const MainContent = ({ 36529 clientId, 36530 currentMenuId, 36531 isLoading, 36532 isNavigationMenuMissing, 36533 onCreateNew 36534 }) => { 36535 const hasChildren = (0,external_wp_data_namespaceObject.useSelect)(select => { 36536 return !!select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId); 36537 }, [clientId]); 36538 const { 36539 navigationMenu 36540 } = useNavigationMenu(currentMenuId); 36541 if (currentMenuId && isNavigationMenuMissing) { 36542 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(deleted_navigation_warning, { 36543 onCreateNew: onCreateNew, 36544 isNotice: true 36545 }); 36546 } 36547 if (isLoading) { 36548 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}); 36549 } 36550 const description = navigationMenu ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of a menu. */ 36551 (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'); 36552 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 36553 className: "wp-block-navigation__menu-inspector-controls", 36554 children: [!hasChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 36555 className: "wp-block-navigation__menu-inspector-controls__empty-message", 36556 children: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') 36557 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { 36558 rootClientId: clientId, 36559 isExpanded: true, 36560 description: description, 36561 showAppender: true, 36562 blockSettingsMenu: LeafMoreMenu, 36563 additionalBlockContent: AdditionalBlockContent 36564 })] 36565 }); 36566 }; 36567 const MenuInspectorControls = props => { 36568 const { 36569 createNavigationMenuIsSuccess, 36570 createNavigationMenuIsError, 36571 currentMenuId = null, 36572 onCreateNew, 36573 onSelectClassicMenu, 36574 onSelectNavigationMenu, 36575 isManageMenusButtonDisabled, 36576 blockEditingMode 36577 } = props; 36578 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 36579 group: "list", 36580 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 36581 title: null, 36582 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 36583 className: "wp-block-navigation-off-canvas-editor__header", 36584 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { 36585 className: "wp-block-navigation-off-canvas-editor__title", 36586 level: 2, 36587 children: (0,external_wp_i18n_namespaceObject.__)('Menu') 36588 }), blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigation_menu_selector, { 36589 currentMenuId: currentMenuId, 36590 onSelectClassicMenu: onSelectClassicMenu, 36591 onSelectNavigationMenu: onSelectNavigationMenu, 36592 onCreateNew: onCreateNew, 36593 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 36594 createNavigationMenuIsError: createNavigationMenuIsError, 36595 actionLabel: actionLabel, 36596 isManageMenusButtonDisabled: isManageMenusButtonDisabled 36597 })] 36598 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainContent, { 36599 ...props 36600 })] 36601 }) 36602 }); 36603 }; 36604 /* harmony default export */ const menu_inspector_controls = (MenuInspectorControls); 36605 36606 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-description.js 36607 /** 36608 * WordPress dependencies 36609 */ 36610 36611 36612 function AccessibleDescription({ 36613 id, 36614 children 36615 }) { 36616 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { 36617 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 36618 id: id, 36619 className: "wp-block-navigation__description", 36620 children: children 36621 }) 36622 }); 36623 } 36624 36625 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-menu-description.js 36626 /** 36627 * WordPress dependencies 36628 */ 36629 36630 36631 36632 /** 36633 * Internal dependencies 36634 */ 36635 36636 36637 function AccessibleMenuDescription({ 36638 id 36639 }) { 36640 const [menuTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); 36641 /* translators: %s: Title of a Navigation Menu post. */ 36642 const description = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu: "%s"`), menuTitle); 36643 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleDescription, { 36644 id: id, 36645 children: description 36646 }); 36647 } 36648 36649 ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js 36650 /* wp:polyfill */ 36651 /** 36652 * External dependencies 36653 */ 36654 36655 36656 /** 36657 * WordPress dependencies 36658 */ 36659 36660 36661 36662 36663 36664 36665 36666 36667 36668 36669 /** 36670 * Internal dependencies 36671 */ 36672 36673 36674 36675 36676 36677 36678 36679 36680 36681 36682 36683 36684 36685 36686 36687 36688 36689 36690 36691 36692 36693 36694 function ColorTools({ 36695 textColor, 36696 setTextColor, 36697 backgroundColor, 36698 setBackgroundColor, 36699 overlayTextColor, 36700 setOverlayTextColor, 36701 overlayBackgroundColor, 36702 setOverlayBackgroundColor, 36703 clientId, 36704 navRef 36705 }) { 36706 const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); 36707 const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)(); 36708 const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); 36709 const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)(); 36710 // Turn on contrast checker for web only since it's not supported on mobile yet. 36711 const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web'; 36712 (0,external_wp_element_namespaceObject.useEffect)(() => { 36713 if (!enableContrastChecking) { 36714 return; 36715 } 36716 detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor); 36717 const subMenuElement = navRef.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]'); 36718 if (!subMenuElement) { 36719 return; 36720 } 36721 36722 // Only detect submenu overlay colors if they have previously been explicitly set. 36723 // This avoids the contrast checker from reporting on inherited submenu colors and 36724 // showing the contrast warning twice. 36725 if (overlayTextColor.color || overlayBackgroundColor.color) { 36726 detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor); 36727 } 36728 }, [enableContrastChecking, overlayTextColor.color, overlayBackgroundColor.color, navRef]); 36729 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 36730 if (!colorGradientSettings.hasColorsOrGradients) { 36731 return null; 36732 } 36733 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 36734 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 36735 __experimentalIsRenderedInSidebar: true, 36736 settings: [{ 36737 colorValue: textColor.color, 36738 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 36739 onColorChange: setTextColor, 36740 resetAllFilter: () => setTextColor(), 36741 clearable: true 36742 }, { 36743 colorValue: backgroundColor.color, 36744 label: (0,external_wp_i18n_namespaceObject.__)('Background'), 36745 onColorChange: setBackgroundColor, 36746 resetAllFilter: () => setBackgroundColor(), 36747 clearable: true 36748 }, { 36749 colorValue: overlayTextColor.color, 36750 label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text'), 36751 onColorChange: setOverlayTextColor, 36752 resetAllFilter: () => setOverlayTextColor(), 36753 clearable: true 36754 }, { 36755 colorValue: overlayBackgroundColor.color, 36756 label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background'), 36757 onColorChange: setOverlayBackgroundColor, 36758 resetAllFilter: () => setOverlayBackgroundColor(), 36759 clearable: true 36760 }], 36761 panelId: clientId, 36762 ...colorGradientSettings, 36763 gradients: [], 36764 disableCustomGradients: true 36765 }), enableContrastChecking && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 36766 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 36767 backgroundColor: detectedBackgroundColor, 36768 textColor: detectedColor 36769 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 36770 backgroundColor: detectedOverlayBackgroundColor, 36771 textColor: detectedOverlayColor 36772 })] 36773 })] 36774 }); 36775 } 36776 function Navigation({ 36777 attributes, 36778 setAttributes, 36779 clientId, 36780 isSelected, 36781 className, 36782 backgroundColor, 36783 setBackgroundColor, 36784 textColor, 36785 setTextColor, 36786 overlayBackgroundColor, 36787 setOverlayBackgroundColor, 36788 overlayTextColor, 36789 setOverlayTextColor, 36790 // These props are used by the navigation editor to override specific 36791 // navigation block settings. 36792 hasSubmenuIndicatorSetting = true, 36793 customPlaceholder: CustomPlaceholder = null, 36794 __unstableLayoutClassNames: layoutClassNames 36795 }) { 36796 const { 36797 openSubmenusOnClick, 36798 overlayMenu, 36799 showSubmenuIcon, 36800 templateLock, 36801 layout: { 36802 justifyContent, 36803 orientation = 'horizontal', 36804 flexWrap = 'wrap' 36805 } = {}, 36806 hasIcon, 36807 icon = 'handle' 36808 } = attributes; 36809 const ref = attributes.ref; 36810 const setRef = (0,external_wp_element_namespaceObject.useCallback)(postId => { 36811 setAttributes({ 36812 ref: postId 36813 }); 36814 }, [setAttributes]); 36815 const recursionId = `navigationMenu/$ref}`; 36816 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(recursionId); 36817 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 36818 36819 // Preload classic menus, so that they don't suddenly pop-in when viewing 36820 // the Select Menu dropdown. 36821 const { 36822 menus: classicMenus 36823 } = useNavigationEntities(); 36824 const [showNavigationMenuStatusNotice, hideNavigationMenuStatusNotice] = use_navigation_notice({ 36825 name: 'block-library/core/navigation/status' 36826 }); 36827 const [showClassicMenuConversionNotice, hideClassicMenuConversionNotice] = use_navigation_notice({ 36828 name: 'block-library/core/navigation/classic-menu-conversion' 36829 }); 36830 const [showNavigationMenuPermissionsNotice, hideNavigationMenuPermissionsNotice] = use_navigation_notice({ 36831 name: 'block-library/core/navigation/permissions/update' 36832 }); 36833 const { 36834 create: createNavigationMenu, 36835 status: createNavigationMenuStatus, 36836 error: createNavigationMenuError, 36837 value: createNavigationMenuPost, 36838 isPending: isCreatingNavigationMenu, 36839 isSuccess: createNavigationMenuIsSuccess, 36840 isError: createNavigationMenuIsError 36841 } = useCreateNavigationMenu(clientId); 36842 const createUntitledEmptyNavigationMenu = async () => { 36843 await createNavigationMenu(''); 36844 }; 36845 const { 36846 hasUncontrolledInnerBlocks, 36847 uncontrolledInnerBlocks, 36848 isInnerBlockSelected, 36849 innerBlocks 36850 } = useInnerBlocks(clientId); 36851 const hasSubmenus = !!innerBlocks.find(block => block.name === 'core/navigation-submenu'); 36852 const { 36853 replaceInnerBlocks, 36854 selectBlock, 36855 __unstableMarkNextChangeAsNotPersistent 36856 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 36857 const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false); 36858 const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false); 36859 const { 36860 hasResolvedNavigationMenus, 36861 isNavigationMenuResolved, 36862 isNavigationMenuMissing, 36863 canUserUpdateNavigationMenu, 36864 hasResolvedCanUserUpdateNavigationMenu, 36865 canUserDeleteNavigationMenu, 36866 hasResolvedCanUserDeleteNavigationMenu, 36867 canUserCreateNavigationMenus, 36868 isResolvingCanUserCreateNavigationMenus, 36869 hasResolvedCanUserCreateNavigationMenus 36870 } = useNavigationMenu(ref); 36871 const navMenuResolvedButMissing = hasResolvedNavigationMenus && isNavigationMenuMissing; 36872 const { 36873 convert: convertClassicMenu, 36874 status: classicMenuConversionStatus, 36875 error: classicMenuConversionError 36876 } = use_convert_classic_menu_to_block_menu(createNavigationMenu); 36877 const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; 36878 const handleUpdateMenu = (0,external_wp_element_namespaceObject.useCallback)((menuId, options = { 36879 focusNavigationBlock: false 36880 }) => { 36881 const { 36882 focusNavigationBlock 36883 } = options; 36884 setRef(menuId); 36885 if (focusNavigationBlock) { 36886 selectBlock(clientId); 36887 } 36888 }, [selectBlock, clientId, setRef]); 36889 const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; 36890 36891 // If the block has inner blocks, but no menu id, then these blocks are either: 36892 // - inserted via a pattern. 36893 // - inserted directly via Code View (or otherwise). 36894 // - from an older version of navigation block added before the block used a wp_navigation entity. 36895 // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks, 36896 // that automatically saves the menu as an entity when changes are made to the inner blocks. 36897 const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable; 36898 const { 36899 getNavigationFallbackId 36900 } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); 36901 const navigationFallbackId = !(ref || hasUnsavedBlocks) ? getNavigationFallbackId() : null; 36902 (0,external_wp_element_namespaceObject.useEffect)(() => { 36903 // If: 36904 // - there is an existing menu, OR 36905 // - there are existing (uncontrolled) inner blocks 36906 // ...then don't request a fallback menu. 36907 if (ref || hasUnsavedBlocks || !navigationFallbackId) { 36908 return; 36909 } 36910 36911 /** 36912 * This fallback displays (both in editor and on front) 36913 * The fallback should not request a save (entity dirty state) 36914 * nor to be undoable, hence why it is marked as non persistent 36915 */ 36916 36917 __unstableMarkNextChangeAsNotPersistent(); 36918 setRef(navigationFallbackId); 36919 }, [ref, setRef, hasUnsavedBlocks, navigationFallbackId, __unstableMarkNextChangeAsNotPersistent]); 36920 const navRef = (0,external_wp_element_namespaceObject.useRef)(); 36921 36922 // The standard HTML5 tag for the block wrapper. 36923 const TagName = 'nav'; 36924 36925 // "placeholder" shown if: 36926 // - there is no ref attribute pointing to a Navigation Post. 36927 // - there is no classic menu conversion process in progress. 36928 // - there is no menu creation process in progress. 36929 // - there are no uncontrolled blocks. 36930 const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && classicMenus?.length === 0 && !hasUncontrolledInnerBlocks; 36931 36932 // "loading" state: 36933 // - there is a menu creation process in progress. 36934 // - there is a classic menu conversion process in progress. 36935 // OR: 36936 // - there is a ref attribute pointing to a Navigation Post 36937 // - the Navigation Post isn't available (hasn't resolved) yet. 36938 const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu); 36939 const textDecoration = attributes.style?.typography?.textDecoration; 36940 const hasBlockOverlay = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__unstableHasActiveBlockOverlayActive(clientId), [clientId]); 36941 const isResponsive = 'never' !== overlayMenu; 36942 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 36943 ref: navRef, 36944 className: dist_clsx(className, { 36945 'items-justified-right': justifyContent === 'right', 36946 'items-justified-space-between': justifyContent === 'space-between', 36947 'items-justified-left': justifyContent === 'left', 36948 'items-justified-center': justifyContent === 'center', 36949 'is-vertical': orientation === 'vertical', 36950 'no-wrap': flexWrap === 'nowrap', 36951 'is-responsive': isResponsive, 36952 'has-text-color': !!textColor.color || !!textColor?.class, 36953 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor?.slug)]: !!textColor?.slug, 36954 'has-background': !!backgroundColor.color || backgroundColor.class, 36955 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor?.slug)]: !!backgroundColor?.slug, 36956 [`has-text-decoration-$textDecoration}`]: textDecoration, 36957 'block-editor-block-content-overlay': hasBlockOverlay 36958 }, layoutClassNames), 36959 style: { 36960 color: !textColor?.slug && textColor?.color, 36961 backgroundColor: !backgroundColor?.slug && backgroundColor?.color 36962 } 36963 }); 36964 const onSelectClassicMenu = async classicMenu => { 36965 return convertClassicMenu(classicMenu.id, classicMenu.name, 'draft'); 36966 }; 36967 const onSelectNavigationMenu = menuId => { 36968 handleUpdateMenu(menuId); 36969 }; 36970 (0,external_wp_element_namespaceObject.useEffect)(() => { 36971 hideNavigationMenuStatusNotice(); 36972 if (isCreatingNavigationMenu) { 36973 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`)); 36974 } 36975 if (createNavigationMenuIsSuccess) { 36976 handleUpdateMenu(createNavigationMenuPost?.id, { 36977 focusNavigationBlock: true 36978 }); 36979 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`)); 36980 } 36981 if (createNavigationMenuIsError) { 36982 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.')); 36983 } 36984 }, [createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost?.id, createNavigationMenuIsError, createNavigationMenuIsSuccess, isCreatingNavigationMenu, handleUpdateMenu, hideNavigationMenuStatusNotice, showNavigationMenuStatusNotice]); 36985 (0,external_wp_element_namespaceObject.useEffect)(() => { 36986 hideClassicMenuConversionNotice(); 36987 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) { 36988 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.')); 36989 } 36990 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) { 36991 showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.')); 36992 handleUpdateMenu(createNavigationMenuPost?.id, { 36993 focusNavigationBlock: true 36994 }); 36995 } 36996 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) { 36997 showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.')); 36998 } 36999 }, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice, createNavigationMenuPost?.id, handleUpdateMenu]); 37000 (0,external_wp_element_namespaceObject.useEffect)(() => { 37001 if (!isSelected && !isInnerBlockSelected) { 37002 hideNavigationMenuPermissionsNotice(); 37003 } 37004 if (isSelected || isInnerBlockSelected) { 37005 if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) { 37006 showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')); 37007 } 37008 if (!ref && hasResolvedCanUserCreateNavigationMenus && !canUserCreateNavigationMenus) { 37009 showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')); 37010 } 37011 } 37012 }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenus, hasResolvedCanUserCreateNavigationMenus, ref, hideNavigationMenuPermissionsNotice, showNavigationMenuPermissionsNotice, navMenuResolvedButMissing]); 37013 const hasManagePermissions = canUserCreateNavigationMenus || canUserUpdateNavigationMenu; 37014 const overlayMenuPreviewClasses = dist_clsx('wp-block-navigation__overlay-menu-preview', { 37015 open: overlayMenuPreview 37016 }); 37017 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.') : ''; 37018 const isFirstRender = (0,external_wp_element_namespaceObject.useRef)(true); // Don't speak on first render. 37019 (0,external_wp_element_namespaceObject.useEffect)(() => { 37020 if (!isFirstRender.current && submenuAccessibilityNotice) { 37021 (0,external_wp_a11y_namespaceObject.speak)(submenuAccessibilityNotice); 37022 } 37023 isFirstRender.current = false; 37024 }, [submenuAccessibilityNotice]); 37025 const overlayMenuPreviewId = (0,external_wp_compose_namespaceObject.useInstanceId)(OverlayMenuPreview, `overlay-menu-preview`); 37026 const stylingInspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37027 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 37028 children: hasSubmenuIndicatorSetting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 37029 title: (0,external_wp_i18n_namespaceObject.__)('Display'), 37030 children: [isResponsive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37031 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { 37032 __next40pxDefaultSize: true, 37033 className: overlayMenuPreviewClasses, 37034 onClick: () => { 37035 setOverlayMenuPreview(!overlayMenuPreview); 37036 }, 37037 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Overlay menu controls'), 37038 "aria-controls": overlayMenuPreviewId, 37039 "aria-expanded": overlayMenuPreview, 37040 children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37041 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { 37042 icon: icon 37043 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 37044 icon: library_close 37045 })] 37046 }), !hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37047 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 37048 children: (0,external_wp_i18n_namespaceObject.__)('Menu') 37049 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 37050 children: (0,external_wp_i18n_namespaceObject.__)('Close') 37051 })] 37052 })] 37053 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 37054 id: overlayMenuPreviewId, 37055 children: overlayMenuPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuPreview, { 37056 setAttributes: setAttributes, 37057 hasIcon: hasIcon, 37058 icon: icon, 37059 hidden: !overlayMenuPreview 37060 }) 37061 })] 37062 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 37063 __next40pxDefaultSize: true, 37064 __nextHasNoMarginBottom: true, 37065 label: (0,external_wp_i18n_namespaceObject.__)('Overlay Menu'), 37066 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'), 37067 value: overlayMenu, 37068 help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'), 37069 onChange: value => setAttributes({ 37070 overlayMenu: value 37071 }), 37072 isBlock: true, 37073 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 37074 value: "never", 37075 label: (0,external_wp_i18n_namespaceObject.__)('Off') 37076 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 37077 value: "mobile", 37078 label: (0,external_wp_i18n_namespaceObject.__)('Mobile') 37079 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 37080 value: "always", 37081 label: (0,external_wp_i18n_namespaceObject.__)('Always') 37082 })] 37083 }), hasSubmenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37084 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { 37085 children: (0,external_wp_i18n_namespaceObject.__)('Submenus') 37086 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 37087 __nextHasNoMarginBottom: true, 37088 checked: openSubmenusOnClick, 37089 onChange: value => { 37090 setAttributes({ 37091 openSubmenusOnClick: value, 37092 ...(value && { 37093 showSubmenuIcon: true 37094 }) // Make sure arrows are shown when we toggle this on. 37095 }); 37096 }, 37097 label: (0,external_wp_i18n_namespaceObject.__)('Open on click') 37098 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 37099 __nextHasNoMarginBottom: true, 37100 checked: showSubmenuIcon, 37101 onChange: value => { 37102 setAttributes({ 37103 showSubmenuIcon: value 37104 }); 37105 }, 37106 disabled: attributes.openSubmenusOnClick, 37107 label: (0,external_wp_i18n_namespaceObject.__)('Show arrow') 37108 }), submenuAccessibilityNotice && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 37109 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 37110 spokenMessage: null, 37111 status: "warning", 37112 isDismissible: false, 37113 children: submenuAccessibilityNotice 37114 }) 37115 })] 37116 })] 37117 }) 37118 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 37119 group: "color", 37120 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorTools, { 37121 textColor: textColor, 37122 setTextColor: setTextColor, 37123 backgroundColor: backgroundColor, 37124 setBackgroundColor: setBackgroundColor, 37125 overlayTextColor: overlayTextColor, 37126 setOverlayTextColor: setOverlayTextColor, 37127 overlayBackgroundColor: overlayBackgroundColor, 37128 setOverlayBackgroundColor: setOverlayBackgroundColor, 37129 clientId: clientId, 37130 navRef: navRef 37131 }) 37132 })] 37133 }); 37134 const accessibleDescriptionId = `$clientId}-desc`; 37135 const isHiddenByDefault = 'always' === overlayMenu; 37136 const isManageMenusButtonDisabled = !hasManagePermissions || !hasResolvedNavigationMenus; 37137 if (hasUnsavedBlocks && !isCreatingNavigationMenu) { 37138 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 37139 ...blockProps, 37140 "aria-describedby": !isPlaceholder ? accessibleDescriptionId : undefined, 37141 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleDescription, { 37142 id: accessibleDescriptionId, 37143 children: (0,external_wp_i18n_namespaceObject.__)('Unsaved Navigation Menu.') 37144 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { 37145 clientId: clientId, 37146 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 37147 createNavigationMenuIsError: createNavigationMenuIsError, 37148 currentMenuId: ref, 37149 isNavigationMenuMissing: isNavigationMenuMissing, 37150 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 37151 onCreateNew: createUntitledEmptyNavigationMenu, 37152 onSelectClassicMenu: onSelectClassicMenu, 37153 onSelectNavigationMenu: onSelectNavigationMenu, 37154 isLoading: isLoading, 37155 blockEditingMode: blockEditingMode 37156 }), blockEditingMode === 'default' && stylingInspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveWrapper, { 37157 id: clientId, 37158 onToggle: setResponsiveMenuVisibility, 37159 isOpen: isResponsiveMenuOpen, 37160 hasIcon: hasIcon, 37161 icon: icon, 37162 isResponsive: isResponsive, 37163 isHiddenByDefault: isHiddenByDefault, 37164 overlayBackgroundColor: overlayBackgroundColor, 37165 overlayTextColor: overlayTextColor, 37166 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UnsavedInnerBlocks, { 37167 createNavigationMenu: createNavigationMenu, 37168 blocks: uncontrolledInnerBlocks, 37169 hasSelection: isSelected || isInnerBlockSelected 37170 }) 37171 })] 37172 }); 37173 } 37174 37175 // Show a warning if the selected menu is no longer available. 37176 // TODO - the user should be able to select a new one? 37177 if (ref && isNavigationMenuMissing) { 37178 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 37179 ...blockProps, 37180 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { 37181 clientId: clientId, 37182 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 37183 createNavigationMenuIsError: createNavigationMenuIsError, 37184 currentMenuId: ref, 37185 isNavigationMenuMissing: isNavigationMenuMissing, 37186 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 37187 onCreateNew: createUntitledEmptyNavigationMenu, 37188 onSelectClassicMenu: onSelectClassicMenu, 37189 onSelectNavigationMenu: onSelectNavigationMenu, 37190 isLoading: isLoading, 37191 blockEditingMode: blockEditingMode 37192 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(deleted_navigation_warning, { 37193 onCreateNew: createUntitledEmptyNavigationMenu 37194 })] 37195 }); 37196 } 37197 if (isEntityAvailable && hasAlreadyRendered) { 37198 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 37199 ...blockProps, 37200 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 37201 children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') 37202 }) 37203 }); 37204 } 37205 const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder; 37206 37207 /** 37208 * Historically the navigation block has supported custom placeholders. 37209 * Even though the current UX tries as hard as possible not to 37210 * end up in a placeholder state, the block continues to support 37211 * this extensibility point, via a CustomPlaceholder. 37212 * When CustomPlaceholder is present it becomes the default fallback 37213 * for an empty navigation block, instead of the default fallbacks. 37214 * 37215 */ 37216 37217 if (isPlaceholder && CustomPlaceholder) { 37218 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 37219 ...blockProps, 37220 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderComponent, { 37221 isSelected: isSelected, 37222 currentMenuId: ref, 37223 clientId: clientId, 37224 canUserCreateNavigationMenus: canUserCreateNavigationMenus, 37225 isResolvingCanUserCreateNavigationMenus: isResolvingCanUserCreateNavigationMenus, 37226 onSelectNavigationMenu: onSelectNavigationMenu, 37227 onSelectClassicMenu: onSelectClassicMenu, 37228 onCreateEmpty: createUntitledEmptyNavigationMenu 37229 }) 37230 }); 37231 } 37232 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { 37233 kind: "postType", 37234 type: "wp_navigation", 37235 id: ref, 37236 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 37237 uniqueId: recursionId, 37238 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { 37239 clientId: clientId, 37240 createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, 37241 createNavigationMenuIsError: createNavigationMenuIsError, 37242 currentMenuId: ref, 37243 isNavigationMenuMissing: isNavigationMenuMissing, 37244 isManageMenusButtonDisabled: isManageMenusButtonDisabled, 37245 onCreateNew: createUntitledEmptyNavigationMenu, 37246 onSelectClassicMenu: onSelectClassicMenu, 37247 onSelectNavigationMenu: onSelectNavigationMenu, 37248 isLoading: isLoading, 37249 blockEditingMode: blockEditingMode 37250 }), blockEditingMode === 'default' && stylingInspectorControls, blockEditingMode === 'default' && isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 37251 group: "advanced", 37252 children: [hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuNameControl, {}), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuDeleteControl, { 37253 onDelete: () => { 37254 replaceInnerBlocks(clientId, []); 37255 showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.')); 37256 } 37257 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_menus_button, { 37258 disabled: isManageMenusButtonDisabled, 37259 className: "wp-block-navigation-manage-menus-button" 37260 })] 37261 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { 37262 ...blockProps, 37263 "aria-describedby": !isPlaceholder && !isLoading ? accessibleDescriptionId : undefined, 37264 children: [isLoading && !isHiddenByDefault && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 37265 className: "wp-block-navigation__loading-indicator-container", 37266 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { 37267 className: "wp-block-navigation__loading-indicator" 37268 }) 37269 }), (!isLoading || isHiddenByDefault) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 37270 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleMenuDescription, { 37271 id: accessibleDescriptionId 37272 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveWrapper, { 37273 id: clientId, 37274 onToggle: setResponsiveMenuVisibility, 37275 hasIcon: hasIcon, 37276 icon: icon, 37277 isOpen: isResponsiveMenuOpen, 37278 isResponsive: isResponsive, 37279 isHiddenByDefault: isHiddenByDefault, 37280 overlayBackgroundColor: overlayBackgroundColor, 37281 overlayTextColor: overlayTextColor, 37282 children: isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationInnerBlocks, { 37283 clientId: clientId, 37284 hasCustomPlaceholder: !!CustomPlaceholder, 37285 templateLock: templateLock, 37286 orientation: orientation 37287 }) 37288 })] 37289 })] 37290 })] 37291 }) 37292 }); 37293 } 37294 /* harmony default export */ const navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({ 37295 textColor: 'color' 37296 }, { 37297 backgroundColor: 'color' 37298 }, { 37299 overlayBackgroundColor: 'color' 37300 }, { 37301 overlayTextColor: 'color' 37302 })(Navigation)); 37303 37304 ;// ./node_modules/@wordpress/block-library/build-module/navigation/save.js 37305 /** 37306 * WordPress dependencies 37307 */ 37308 37309 37310 function navigation_save_save({ 37311 attributes 37312 }) { 37313 if (attributes.ref) { 37314 // Avoid rendering inner blocks when a ref is defined. 37315 // When this id is defined the inner blocks are loaded from the 37316 // `wp_navigation` entity rather than the hard-coded block html. 37317 return; 37318 } 37319 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37320 } 37321 37322 ;// ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js 37323 /* wp:polyfill */ 37324 /** 37325 * WordPress dependencies 37326 */ 37327 37328 37329 37330 /** 37331 * Internal dependencies 37332 */ 37333 37334 37335 const TYPOGRAPHY_PRESET_DEPRECATION_MAP = { 37336 fontStyle: 'var:preset|font-style|', 37337 fontWeight: 'var:preset|font-weight|', 37338 textDecoration: 'var:preset|text-decoration|', 37339 textTransform: 'var:preset|text-transform|' 37340 }; 37341 const migrateIdToRef = ({ 37342 navigationMenuId, 37343 ...attributes 37344 }) => { 37345 return { 37346 ...attributes, 37347 ref: navigationMenuId 37348 }; 37349 }; 37350 const deprecated_migrateWithLayout = attributes => { 37351 if (!!attributes.layout) { 37352 return attributes; 37353 } 37354 const { 37355 itemsJustification, 37356 orientation, 37357 ...updatedAttributes 37358 } = attributes; 37359 if (itemsJustification || orientation) { 37360 Object.assign(updatedAttributes, { 37361 layout: { 37362 type: 'flex', 37363 ...(itemsJustification && { 37364 justifyContent: itemsJustification 37365 }), 37366 ...(orientation && { 37367 orientation 37368 }) 37369 } 37370 }); 37371 } 37372 return updatedAttributes; 37373 }; 37374 const navigation_deprecated_v6 = { 37375 attributes: { 37376 navigationMenuId: { 37377 type: 'number' 37378 }, 37379 textColor: { 37380 type: 'string' 37381 }, 37382 customTextColor: { 37383 type: 'string' 37384 }, 37385 rgbTextColor: { 37386 type: 'string' 37387 }, 37388 backgroundColor: { 37389 type: 'string' 37390 }, 37391 customBackgroundColor: { 37392 type: 'string' 37393 }, 37394 rgbBackgroundColor: { 37395 type: 'string' 37396 }, 37397 showSubmenuIcon: { 37398 type: 'boolean', 37399 default: true 37400 }, 37401 openSubmenusOnClick: { 37402 type: 'boolean', 37403 default: false 37404 }, 37405 overlayMenu: { 37406 type: 'string', 37407 default: 'mobile' 37408 }, 37409 __unstableLocation: { 37410 type: 'string' 37411 }, 37412 overlayBackgroundColor: { 37413 type: 'string' 37414 }, 37415 customOverlayBackgroundColor: { 37416 type: 'string' 37417 }, 37418 overlayTextColor: { 37419 type: 'string' 37420 }, 37421 customOverlayTextColor: { 37422 type: 'string' 37423 } 37424 }, 37425 supports: { 37426 align: ['wide', 'full'], 37427 anchor: true, 37428 html: false, 37429 inserter: true, 37430 typography: { 37431 fontSize: true, 37432 lineHeight: true, 37433 __experimentalFontStyle: true, 37434 __experimentalFontWeight: true, 37435 __experimentalTextTransform: true, 37436 __experimentalFontFamily: true, 37437 __experimentalTextDecoration: true, 37438 __experimentalDefaultControls: { 37439 fontSize: true 37440 } 37441 }, 37442 spacing: { 37443 blockGap: true, 37444 units: ['px', 'em', 'rem', 'vh', 'vw'], 37445 __experimentalDefaultControls: { 37446 blockGap: true 37447 } 37448 }, 37449 layout: { 37450 allowSwitching: false, 37451 allowInheriting: false, 37452 default: { 37453 type: 'flex' 37454 } 37455 } 37456 }, 37457 save() { 37458 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37459 }, 37460 isEligible: ({ 37461 navigationMenuId 37462 }) => !!navigationMenuId, 37463 migrate: migrateIdToRef 37464 }; 37465 const navigation_deprecated_v5 = { 37466 attributes: { 37467 navigationMenuId: { 37468 type: 'number' 37469 }, 37470 orientation: { 37471 type: 'string', 37472 default: 'horizontal' 37473 }, 37474 textColor: { 37475 type: 'string' 37476 }, 37477 customTextColor: { 37478 type: 'string' 37479 }, 37480 rgbTextColor: { 37481 type: 'string' 37482 }, 37483 backgroundColor: { 37484 type: 'string' 37485 }, 37486 customBackgroundColor: { 37487 type: 'string' 37488 }, 37489 rgbBackgroundColor: { 37490 type: 'string' 37491 }, 37492 itemsJustification: { 37493 type: 'string' 37494 }, 37495 showSubmenuIcon: { 37496 type: 'boolean', 37497 default: true 37498 }, 37499 openSubmenusOnClick: { 37500 type: 'boolean', 37501 default: false 37502 }, 37503 overlayMenu: { 37504 type: 'string', 37505 default: 'never' 37506 }, 37507 __unstableLocation: { 37508 type: 'string' 37509 }, 37510 overlayBackgroundColor: { 37511 type: 'string' 37512 }, 37513 customOverlayBackgroundColor: { 37514 type: 'string' 37515 }, 37516 overlayTextColor: { 37517 type: 'string' 37518 }, 37519 customOverlayTextColor: { 37520 type: 'string' 37521 } 37522 }, 37523 supports: { 37524 align: ['wide', 'full'], 37525 anchor: true, 37526 html: false, 37527 inserter: true, 37528 typography: { 37529 fontSize: true, 37530 lineHeight: true, 37531 __experimentalFontStyle: true, 37532 __experimentalFontWeight: true, 37533 __experimentalTextTransform: true, 37534 __experimentalFontFamily: true, 37535 __experimentalTextDecoration: true, 37536 __experimentalDefaultControls: { 37537 fontSize: true 37538 } 37539 }, 37540 spacing: { 37541 blockGap: true, 37542 units: ['px', 'em', 'rem', 'vh', 'vw'], 37543 __experimentalDefaultControls: { 37544 blockGap: true 37545 } 37546 } 37547 }, 37548 save() { 37549 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37550 }, 37551 isEligible: ({ 37552 itemsJustification, 37553 orientation 37554 }) => !!itemsJustification || !!orientation, 37555 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout) 37556 }; 37557 const navigation_deprecated_v4 = { 37558 attributes: { 37559 orientation: { 37560 type: 'string', 37561 default: 'horizontal' 37562 }, 37563 textColor: { 37564 type: 'string' 37565 }, 37566 customTextColor: { 37567 type: 'string' 37568 }, 37569 rgbTextColor: { 37570 type: 'string' 37571 }, 37572 backgroundColor: { 37573 type: 'string' 37574 }, 37575 customBackgroundColor: { 37576 type: 'string' 37577 }, 37578 rgbBackgroundColor: { 37579 type: 'string' 37580 }, 37581 itemsJustification: { 37582 type: 'string' 37583 }, 37584 showSubmenuIcon: { 37585 type: 'boolean', 37586 default: true 37587 }, 37588 openSubmenusOnClick: { 37589 type: 'boolean', 37590 default: false 37591 }, 37592 overlayMenu: { 37593 type: 'string', 37594 default: 'never' 37595 }, 37596 __unstableLocation: { 37597 type: 'string' 37598 }, 37599 overlayBackgroundColor: { 37600 type: 'string' 37601 }, 37602 customOverlayBackgroundColor: { 37603 type: 'string' 37604 }, 37605 overlayTextColor: { 37606 type: 'string' 37607 }, 37608 customOverlayTextColor: { 37609 type: 'string' 37610 } 37611 }, 37612 supports: { 37613 align: ['wide', 'full'], 37614 anchor: true, 37615 html: false, 37616 inserter: true, 37617 typography: { 37618 fontSize: true, 37619 lineHeight: true, 37620 __experimentalFontStyle: true, 37621 __experimentalFontWeight: true, 37622 __experimentalTextTransform: true, 37623 __experimentalFontFamily: true, 37624 __experimentalTextDecoration: true 37625 }, 37626 spacing: { 37627 blockGap: true, 37628 units: ['px', 'em', 'rem', 'vh', 'vw'], 37629 __experimentalDefaultControls: { 37630 blockGap: true 37631 } 37632 } 37633 }, 37634 save() { 37635 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37636 }, 37637 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family), 37638 isEligible({ 37639 style 37640 }) { 37641 return style?.typography?.fontFamily; 37642 } 37643 }; 37644 const migrateIsResponsive = function (attributes) { 37645 delete attributes.isResponsive; 37646 return { 37647 ...attributes, 37648 overlayMenu: 'mobile' 37649 }; 37650 }; 37651 const migrateTypographyPresets = function (attributes) { 37652 var _attributes$style$typ; 37653 return { 37654 ...attributes, 37655 style: { 37656 ...attributes.style, 37657 typography: Object.fromEntries(Object.entries((_attributes$style$typ = attributes.style.typography) !== null && _attributes$style$typ !== void 0 ? _attributes$style$typ : {}).map(([key, value]) => { 37658 const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key]; 37659 if (prefix && value.startsWith(prefix)) { 37660 const newValue = value.slice(prefix.length); 37661 if ('textDecoration' === key && 'strikethrough' === newValue) { 37662 return [key, 'line-through']; 37663 } 37664 return [key, newValue]; 37665 } 37666 return [key, value]; 37667 })) 37668 } 37669 }; 37670 }; 37671 const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, 37672 // Remove `isResponsive` attribute. 37673 { 37674 attributes: { 37675 orientation: { 37676 type: 'string', 37677 default: 'horizontal' 37678 }, 37679 textColor: { 37680 type: 'string' 37681 }, 37682 customTextColor: { 37683 type: 'string' 37684 }, 37685 rgbTextColor: { 37686 type: 'string' 37687 }, 37688 backgroundColor: { 37689 type: 'string' 37690 }, 37691 customBackgroundColor: { 37692 type: 'string' 37693 }, 37694 rgbBackgroundColor: { 37695 type: 'string' 37696 }, 37697 itemsJustification: { 37698 type: 'string' 37699 }, 37700 showSubmenuIcon: { 37701 type: 'boolean', 37702 default: true 37703 }, 37704 openSubmenusOnClick: { 37705 type: 'boolean', 37706 default: false 37707 }, 37708 isResponsive: { 37709 type: 'boolean', 37710 default: 'false' 37711 }, 37712 __unstableLocation: { 37713 type: 'string' 37714 }, 37715 overlayBackgroundColor: { 37716 type: 'string' 37717 }, 37718 customOverlayBackgroundColor: { 37719 type: 'string' 37720 }, 37721 overlayTextColor: { 37722 type: 'string' 37723 }, 37724 customOverlayTextColor: { 37725 type: 'string' 37726 } 37727 }, 37728 supports: { 37729 align: ['wide', 'full'], 37730 anchor: true, 37731 html: false, 37732 inserter: true, 37733 typography: { 37734 fontSize: true, 37735 lineHeight: true, 37736 __experimentalFontStyle: true, 37737 __experimentalFontWeight: true, 37738 __experimentalTextTransform: true, 37739 __experimentalFontFamily: true, 37740 __experimentalTextDecoration: true 37741 } 37742 }, 37743 isEligible(attributes) { 37744 return attributes.isResponsive; 37745 }, 37746 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive), 37747 save() { 37748 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37749 } 37750 }, { 37751 attributes: { 37752 orientation: { 37753 type: 'string' 37754 }, 37755 textColor: { 37756 type: 'string' 37757 }, 37758 customTextColor: { 37759 type: 'string' 37760 }, 37761 rgbTextColor: { 37762 type: 'string' 37763 }, 37764 backgroundColor: { 37765 type: 'string' 37766 }, 37767 customBackgroundColor: { 37768 type: 'string' 37769 }, 37770 rgbBackgroundColor: { 37771 type: 'string' 37772 }, 37773 itemsJustification: { 37774 type: 'string' 37775 }, 37776 showSubmenuIcon: { 37777 type: 'boolean', 37778 default: true 37779 } 37780 }, 37781 supports: { 37782 align: ['wide', 'full'], 37783 anchor: true, 37784 html: false, 37785 inserter: true, 37786 fontSize: true, 37787 __experimentalFontStyle: true, 37788 __experimentalFontWeight: true, 37789 __experimentalTextTransform: true, 37790 color: true, 37791 __experimentalFontFamily: true, 37792 __experimentalTextDecoration: true 37793 }, 37794 save() { 37795 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37796 }, 37797 isEligible(attributes) { 37798 if (!attributes.style || !attributes.style.typography) { 37799 return false; 37800 } 37801 for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) { 37802 const attributeValue = attributes.style.typography[styleAttribute]; 37803 if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) { 37804 return true; 37805 } 37806 } 37807 return false; 37808 }, 37809 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets) 37810 }, { 37811 attributes: { 37812 className: { 37813 type: 'string' 37814 }, 37815 textColor: { 37816 type: 'string' 37817 }, 37818 rgbTextColor: { 37819 type: 'string' 37820 }, 37821 backgroundColor: { 37822 type: 'string' 37823 }, 37824 rgbBackgroundColor: { 37825 type: 'string' 37826 }, 37827 fontSize: { 37828 type: 'string' 37829 }, 37830 customFontSize: { 37831 type: 'number' 37832 }, 37833 itemsJustification: { 37834 type: 'string' 37835 }, 37836 showSubmenuIcon: { 37837 type: 'boolean' 37838 } 37839 }, 37840 isEligible(attribute) { 37841 return attribute.rgbTextColor || attribute.rgbBackgroundColor; 37842 }, 37843 supports: { 37844 align: ['wide', 'full'], 37845 anchor: true, 37846 html: false, 37847 inserter: true 37848 }, 37849 migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => { 37850 const { 37851 rgbTextColor, 37852 rgbBackgroundColor, 37853 ...restAttributes 37854 } = attributes; 37855 return { 37856 ...restAttributes, 37857 customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor, 37858 customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor 37859 }; 37860 }), 37861 save() { 37862 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 37863 } 37864 }]; 37865 /* harmony default export */ const navigation_deprecated = (navigation_deprecated_deprecated); 37866 37867 ;// ./node_modules/@wordpress/block-library/build-module/navigation/index.js 37868 /** 37869 * WordPress dependencies 37870 */ 37871 37872 37873 37874 37875 37876 37877 /** 37878 * Internal dependencies 37879 */ 37880 37881 const navigation_metadata = { 37882 $schema: "https://schemas.wp.org/trunk/block.json", 37883 apiVersion: 3, 37884 name: "core/navigation", 37885 title: "Navigation", 37886 category: "theme", 37887 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"], 37888 description: "A collection of blocks that allow visitors to get around your site.", 37889 keywords: ["menu", "navigation", "links"], 37890 textdomain: "default", 37891 attributes: { 37892 ref: { 37893 type: "number" 37894 }, 37895 textColor: { 37896 type: "string" 37897 }, 37898 customTextColor: { 37899 type: "string" 37900 }, 37901 rgbTextColor: { 37902 type: "string" 37903 }, 37904 backgroundColor: { 37905 type: "string" 37906 }, 37907 customBackgroundColor: { 37908 type: "string" 37909 }, 37910 rgbBackgroundColor: { 37911 type: "string" 37912 }, 37913 showSubmenuIcon: { 37914 type: "boolean", 37915 "default": true 37916 }, 37917 openSubmenusOnClick: { 37918 type: "boolean", 37919 "default": false 37920 }, 37921 overlayMenu: { 37922 type: "string", 37923 "default": "mobile" 37924 }, 37925 icon: { 37926 type: "string", 37927 "default": "handle" 37928 }, 37929 hasIcon: { 37930 type: "boolean", 37931 "default": true 37932 }, 37933 __unstableLocation: { 37934 type: "string" 37935 }, 37936 overlayBackgroundColor: { 37937 type: "string" 37938 }, 37939 customOverlayBackgroundColor: { 37940 type: "string" 37941 }, 37942 overlayTextColor: { 37943 type: "string" 37944 }, 37945 customOverlayTextColor: { 37946 type: "string" 37947 }, 37948 maxNestingLevel: { 37949 type: "number", 37950 "default": 5 37951 }, 37952 templateLock: { 37953 type: ["string", "boolean"], 37954 "enum": ["all", "insert", "contentOnly", false] 37955 } 37956 }, 37957 providesContext: { 37958 textColor: "textColor", 37959 customTextColor: "customTextColor", 37960 backgroundColor: "backgroundColor", 37961 customBackgroundColor: "customBackgroundColor", 37962 overlayTextColor: "overlayTextColor", 37963 customOverlayTextColor: "customOverlayTextColor", 37964 overlayBackgroundColor: "overlayBackgroundColor", 37965 customOverlayBackgroundColor: "customOverlayBackgroundColor", 37966 fontSize: "fontSize", 37967 customFontSize: "customFontSize", 37968 showSubmenuIcon: "showSubmenuIcon", 37969 openSubmenusOnClick: "openSubmenusOnClick", 37970 style: "style", 37971 maxNestingLevel: "maxNestingLevel" 37972 }, 37973 supports: { 37974 align: ["wide", "full"], 37975 ariaLabel: true, 37976 html: false, 37977 inserter: true, 37978 typography: { 37979 fontSize: true, 37980 lineHeight: true, 37981 __experimentalFontStyle: true, 37982 __experimentalFontWeight: true, 37983 __experimentalTextTransform: true, 37984 __experimentalFontFamily: true, 37985 __experimentalLetterSpacing: true, 37986 __experimentalTextDecoration: true, 37987 __experimentalSkipSerialization: ["textDecoration"], 37988 __experimentalDefaultControls: { 37989 fontSize: true 37990 } 37991 }, 37992 spacing: { 37993 blockGap: true, 37994 units: ["px", "em", "rem", "vh", "vw"], 37995 __experimentalDefaultControls: { 37996 blockGap: true 37997 } 37998 }, 37999 layout: { 38000 allowSwitching: false, 38001 allowInheriting: false, 38002 allowVerticalAlignment: false, 38003 allowSizingOnChildren: true, 38004 "default": { 38005 type: "flex" 38006 } 38007 }, 38008 interactivity: true, 38009 renaming: false 38010 }, 38011 editorStyle: "wp-block-navigation-editor", 38012 style: "wp-block-navigation" 38013 }; 38014 38015 38016 38017 const { 38018 name: navigation_name 38019 } = navigation_metadata; 38020 38021 const navigation_settings = { 38022 icon: library_navigation, 38023 example: { 38024 attributes: { 38025 overlayMenu: 'never' 38026 }, 38027 innerBlocks: [{ 38028 name: 'core/navigation-link', 38029 attributes: { 38030 // translators: 'Home' as in a website's home page. 38031 label: (0,external_wp_i18n_namespaceObject.__)('Home'), 38032 url: 'https://make.wordpress.org/' 38033 } 38034 }, { 38035 name: 'core/navigation-link', 38036 attributes: { 38037 // translators: 'About' as in a website's about page. 38038 label: (0,external_wp_i18n_namespaceObject.__)('About'), 38039 url: 'https://make.wordpress.org/' 38040 } 38041 }, { 38042 name: 'core/navigation-link', 38043 attributes: { 38044 // translators: 'Contact' as in a website's contact page. 38045 label: (0,external_wp_i18n_namespaceObject.__)('Contact'), 38046 url: 'https://make.wordpress.org/' 38047 } 38048 }] 38049 }, 38050 edit: navigation_edit, 38051 save: navigation_save_save, 38052 __experimentalLabel: ({ 38053 ref 38054 }) => { 38055 if (!ref) { 38056 return; 38057 } 38058 const navigation = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_navigation', ref); 38059 if (!navigation?.title) { 38060 return; 38061 } 38062 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(navigation.title); 38063 }, 38064 deprecated: navigation_deprecated 38065 }; 38066 const navigation_init = () => initBlock({ 38067 name: navigation_name, 38068 metadata: navigation_metadata, 38069 settings: navigation_settings 38070 }); 38071 38072 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js 38073 /** 38074 * External dependencies 38075 */ 38076 38077 38078 /** 38079 * WordPress dependencies 38080 */ 38081 38082 38083 38084 38085 38086 38087 38088 38089 38090 38091 38092 38093 38094 38095 /** 38096 * Internal dependencies 38097 */ 38098 38099 38100 38101 38102 const navigation_link_edit_DEFAULT_BLOCK = { 38103 name: 'core/navigation-link' 38104 }; 38105 38106 /** 38107 * A React hook to determine if it's dragging within the target element. 38108 * 38109 * @typedef {import('@wordpress/element').RefObject} RefObject 38110 * 38111 * @param {RefObject<HTMLElement>} elementRef The target elementRef object. 38112 * 38113 * @return {boolean} Is dragging within the target element. 38114 */ 38115 const useIsDraggingWithin = elementRef => { 38116 const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); 38117 (0,external_wp_element_namespaceObject.useEffect)(() => { 38118 const { 38119 ownerDocument 38120 } = elementRef.current; 38121 function handleDragStart(event) { 38122 // Check the first time when the dragging starts. 38123 handleDragEnter(event); 38124 } 38125 38126 // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. 38127 function handleDragEnd() { 38128 setIsDraggingWithin(false); 38129 } 38130 function handleDragEnter(event) { 38131 // Check if the current target is inside the item element. 38132 if (elementRef.current.contains(event.target)) { 38133 setIsDraggingWithin(true); 38134 } else { 38135 setIsDraggingWithin(false); 38136 } 38137 } 38138 38139 // Bind these events to the document to catch all drag events. 38140 // Ideally, we can also use `event.relatedTarget`, but sadly that 38141 // doesn't work in Safari. 38142 ownerDocument.addEventListener('dragstart', handleDragStart); 38143 ownerDocument.addEventListener('dragend', handleDragEnd); 38144 ownerDocument.addEventListener('dragenter', handleDragEnter); 38145 return () => { 38146 ownerDocument.removeEventListener('dragstart', handleDragStart); 38147 ownerDocument.removeEventListener('dragend', handleDragEnd); 38148 ownerDocument.removeEventListener('dragenter', handleDragEnter); 38149 }; 38150 }, [elementRef]); 38151 return isDraggingWithin; 38152 }; 38153 const useIsInvalidLink = (kind, type, id) => { 38154 const isPostType = kind === 'post-type' || type === 'post' || type === 'page'; 38155 const hasId = Number.isInteger(id); 38156 const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => { 38157 if (!isPostType) { 38158 return null; 38159 } 38160 const { 38161 getEntityRecord 38162 } = select(external_wp_coreData_namespaceObject.store); 38163 return getEntityRecord('postType', type, id)?.status; 38164 }, [isPostType, type, id]); 38165 38166 // Check Navigation Link validity if: 38167 // 1. Link is 'post-type'. 38168 // 2. It has an id. 38169 // 3. It's neither null, nor undefined, as valid items might be either of those while loading. 38170 // If those conditions are met, check if 38171 // 1. The post status is published. 38172 // 2. The Navigation Link item has no label. 38173 // If either of those is true, invalidate. 38174 const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus; 38175 const isDraft = 'draft' === postStatus; 38176 return [isInvalid, isDraft]; 38177 }; 38178 function getMissingText(type) { 38179 let missingText = ''; 38180 switch (type) { 38181 case 'post': 38182 /* translators: label for missing post in navigation link block */ 38183 missingText = (0,external_wp_i18n_namespaceObject.__)('Select post'); 38184 break; 38185 case 'page': 38186 /* translators: label for missing page in navigation link block */ 38187 missingText = (0,external_wp_i18n_namespaceObject.__)('Select page'); 38188 break; 38189 case 'category': 38190 /* translators: label for missing category in navigation link block */ 38191 missingText = (0,external_wp_i18n_namespaceObject.__)('Select category'); 38192 break; 38193 case 'tag': 38194 /* translators: label for missing tag in navigation link block */ 38195 missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag'); 38196 break; 38197 default: 38198 /* translators: label for missing values in navigation link block */ 38199 missingText = (0,external_wp_i18n_namespaceObject.__)('Add link'); 38200 } 38201 return missingText; 38202 } 38203 38204 /* 38205 * Warning, this duplicated in 38206 * packages/block-library/src/navigation-submenu/edit.js 38207 * Consider reusing this components for both blocks. 38208 */ 38209 function Controls({ 38210 attributes, 38211 setAttributes, 38212 setIsLabelFieldFocused 38213 }) { 38214 const { 38215 label, 38216 url, 38217 description, 38218 title, 38219 rel 38220 } = attributes; 38221 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 38222 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 38223 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 38224 hasValue: () => !!label, 38225 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 38226 onDeselect: () => setAttributes({ 38227 label: '' 38228 }), 38229 isShownByDefault: true, 38230 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 38231 __nextHasNoMarginBottom: true, 38232 __next40pxDefaultSize: true, 38233 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 38234 value: label ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) : '', 38235 onChange: labelValue => { 38236 setAttributes({ 38237 label: labelValue 38238 }); 38239 }, 38240 autoComplete: "off", 38241 onFocus: () => setIsLabelFieldFocused(true), 38242 onBlur: () => setIsLabelFieldFocused(false) 38243 }) 38244 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 38245 hasValue: () => !!url, 38246 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 38247 onDeselect: () => setAttributes({ 38248 url: '' 38249 }), 38250 isShownByDefault: true, 38251 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 38252 __nextHasNoMarginBottom: true, 38253 __next40pxDefaultSize: true, 38254 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 38255 value: url ? (0,external_wp_url_namespaceObject.safeDecodeURI)(url) : '', 38256 onChange: urlValue => { 38257 updateAttributes({ 38258 url: urlValue 38259 }, setAttributes, attributes); 38260 }, 38261 autoComplete: "off" 38262 }) 38263 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 38264 hasValue: () => !!description, 38265 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 38266 onDeselect: () => setAttributes({ 38267 description: '' 38268 }), 38269 isShownByDefault: true, 38270 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 38271 __nextHasNoMarginBottom: true, 38272 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 38273 value: description || '', 38274 onChange: descriptionValue => { 38275 setAttributes({ 38276 description: descriptionValue 38277 }); 38278 }, 38279 help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') 38280 }) 38281 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 38282 hasValue: () => !!title, 38283 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 38284 onDeselect: () => setAttributes({ 38285 title: '' 38286 }), 38287 isShownByDefault: true, 38288 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 38289 __nextHasNoMarginBottom: true, 38290 __next40pxDefaultSize: true, 38291 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 38292 value: title || '', 38293 onChange: titleValue => { 38294 setAttributes({ 38295 title: titleValue 38296 }); 38297 }, 38298 autoComplete: "off", 38299 help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') 38300 }) 38301 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 38302 hasValue: () => !!rel, 38303 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 38304 onDeselect: () => setAttributes({ 38305 rel: '' 38306 }), 38307 isShownByDefault: true, 38308 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 38309 __nextHasNoMarginBottom: true, 38310 __next40pxDefaultSize: true, 38311 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 38312 value: rel || '', 38313 onChange: relValue => { 38314 setAttributes({ 38315 rel: relValue 38316 }); 38317 }, 38318 autoComplete: "off", 38319 help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') 38320 }) 38321 })] 38322 }); 38323 } 38324 function NavigationLinkEdit({ 38325 attributes, 38326 isSelected, 38327 setAttributes, 38328 insertBlocksAfter, 38329 mergeBlocks, 38330 onReplace, 38331 context, 38332 clientId 38333 }) { 38334 const { 38335 id, 38336 label, 38337 type, 38338 url, 38339 description, 38340 kind 38341 } = attributes; 38342 const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id); 38343 const { 38344 maxNestingLevel 38345 } = context; 38346 const { 38347 replaceBlock, 38348 __unstableMarkNextChangeAsNotPersistent, 38349 selectBlock, 38350 selectPreviousBlock 38351 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 38352 // Have the link editing ui open on mount when lacking a url and selected. 38353 const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(isSelected && !url); 38354 // Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text) 38355 const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null); 38356 // Use internal state instead of a ref to make sure that the component 38357 // re-renders when the popover's anchor updates. 38358 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 38359 const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); 38360 const isDraggingWithin = useIsDraggingWithin(listItemRef); 38361 const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add label…'); 38362 const ref = (0,external_wp_element_namespaceObject.useRef)(); 38363 const linkUIref = (0,external_wp_element_namespaceObject.useRef)(); 38364 const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url); 38365 38366 // Change the label using inspector causes rich text to change focus on firefox. 38367 // This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text. 38368 const [isLabelFieldFocused, setIsLabelFieldFocused] = (0,external_wp_element_namespaceObject.useState)(false); 38369 const { 38370 isAtMaxNesting, 38371 isTopLevelLink, 38372 isParentOfSelectedBlock, 38373 hasChildren 38374 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 38375 const { 38376 getBlockCount, 38377 getBlockName, 38378 getBlockRootClientId, 38379 hasSelectedInnerBlock, 38380 getBlockParentsByBlockName 38381 } = select(external_wp_blockEditor_namespaceObject.store); 38382 return { 38383 isAtMaxNesting: getBlockParentsByBlockName(clientId, ['core/navigation-link', 'core/navigation-submenu']).length >= maxNestingLevel, 38384 isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation', 38385 isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), 38386 hasChildren: !!getBlockCount(clientId) 38387 }; 38388 }, [clientId, maxNestingLevel]); 38389 const { 38390 getBlocks 38391 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 38392 38393 /** 38394 * Transform to submenu block. 38395 */ 38396 const transformToSubmenu = () => { 38397 let innerBlocks = getBlocks(clientId); 38398 if (innerBlocks.length === 0) { 38399 innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')]; 38400 selectBlock(innerBlocks[0].clientId); 38401 } 38402 const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks); 38403 replaceBlock(clientId, newSubmenu); 38404 }; 38405 (0,external_wp_element_namespaceObject.useEffect)(() => { 38406 // If block has inner blocks, transform to Submenu. 38407 if (hasChildren) { 38408 // This side-effect should not create an undo level as those should 38409 // only be created via user interactions. 38410 __unstableMarkNextChangeAsNotPersistent(); 38411 transformToSubmenu(); 38412 } 38413 }, [hasChildren]); 38414 38415 // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. 38416 (0,external_wp_element_namespaceObject.useEffect)(() => { 38417 // We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL 38418 if (!prevUrl && url && isLinkOpen && (0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 38419 // Focus and select the label text. 38420 selectLabelText(); 38421 } 38422 }, [prevUrl, url, isLinkOpen, label]); 38423 38424 /** 38425 * Focus the Link label text and select it. 38426 */ 38427 function selectLabelText() { 38428 ref.current.focus(); 38429 const { 38430 ownerDocument 38431 } = ref.current; 38432 const { 38433 defaultView 38434 } = ownerDocument; 38435 const selection = defaultView.getSelection(); 38436 const range = ownerDocument.createRange(); 38437 // Get the range of the current ref contents so we can add this range to the selection. 38438 range.selectNodeContents(ref.current); 38439 selection.removeAllRanges(); 38440 selection.addRange(range); 38441 } 38442 38443 /** 38444 * Removes the current link if set. 38445 */ 38446 function removeLink() { 38447 // Reset all attributes that comprise the link. 38448 // It is critical that all attributes are reset 38449 // to their default values otherwise this may 38450 // in advertently trigger side effects because 38451 // the values will have "changed". 38452 setAttributes({ 38453 url: undefined, 38454 label: undefined, 38455 id: undefined, 38456 kind: undefined, 38457 type: undefined, 38458 opensInNewTab: false 38459 }); 38460 38461 // Close the link editing UI. 38462 setIsLinkOpen(false); 38463 } 38464 const { 38465 textColor, 38466 customTextColor, 38467 backgroundColor, 38468 customBackgroundColor 38469 } = getColors(context, !isTopLevelLink); 38470 function onKeyDown(event) { 38471 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { 38472 // Required to prevent the command center from opening, 38473 // as it shares the CMD+K shortcut. 38474 // See https://github.com/WordPress/gutenberg/pull/59845. 38475 event.preventDefault(); 38476 // If this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover 38477 event.stopPropagation(); 38478 setIsLinkOpen(true); 38479 setOpenedBy(ref.current); 38480 } 38481 } 38482 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 38483 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), 38484 className: dist_clsx('wp-block-navigation-item', { 38485 'is-editing': isSelected || isParentOfSelectedBlock, 38486 'is-dragging-within': isDraggingWithin, 38487 'has-link': !!url, 38488 'has-child': hasChildren, 38489 'has-text-color': !!textColor || !!customTextColor, 38490 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 38491 'has-background': !!backgroundColor || customBackgroundColor, 38492 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor 38493 }), 38494 style: { 38495 color: !textColor && customTextColor, 38496 backgroundColor: !backgroundColor && customBackgroundColor 38497 }, 38498 onKeyDown 38499 }); 38500 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 38501 ...blockProps, 38502 className: 'remove-outline' // Remove the outline from the inner blocks container. 38503 }, { 38504 defaultBlock: navigation_link_edit_DEFAULT_BLOCK, 38505 directInsert: true, 38506 renderAppender: false 38507 }); 38508 if (!url || isInvalid || isDraft) { 38509 blockProps.onClick = () => { 38510 setIsLinkOpen(true); 38511 setOpenedBy(ref.current); 38512 }; 38513 } 38514 const classes = dist_clsx('wp-block-navigation-item__content', { 38515 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft 38516 }); 38517 const missingText = getMissingText(type); 38518 /* translators: Whether the navigation link is Invalid or a Draft. */ 38519 const placeholderText = `($isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`; 38520 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 38521 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 38522 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { 38523 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 38524 name: "link", 38525 icon: library_link, 38526 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 38527 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 38528 onClick: event => { 38529 setIsLinkOpen(true); 38530 setOpenedBy(event.currentTarget); 38531 } 38532 }), !isAtMaxNesting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 38533 name: "submenu", 38534 icon: add_submenu, 38535 title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'), 38536 onClick: transformToSubmenu 38537 })] 38538 }) 38539 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 38540 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Controls, { 38541 attributes: attributes, 38542 setAttributes: setAttributes, 38543 setIsLabelFieldFocused: setIsLabelFieldFocused 38544 }) 38545 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 38546 ...blockProps, 38547 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 38548 className: classes, 38549 children: [!url ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 38550 className: "wp-block-navigation-link__placeholder-text", 38551 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 38552 children: missingText 38553 }) 38554 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 38555 children: [!isInvalid && !isDraft && !isLabelFieldFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 38556 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 38557 ref: ref, 38558 identifier: "label", 38559 className: "wp-block-navigation-item__label", 38560 value: label, 38561 onChange: labelValue => setAttributes({ 38562 label: labelValue 38563 }), 38564 onMerge: mergeBlocks, 38565 onReplace: onReplace, 38566 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')), 38567 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), 38568 placeholder: itemLabelPlaceholder, 38569 withoutInteractiveFormatting: true 38570 }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 38571 className: "wp-block-navigation-item__description", 38572 children: description 38573 })] 38574 }), (isInvalid || isDraft || isLabelFieldFocused) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 38575 className: dist_clsx('wp-block-navigation-link__placeholder-text', 'wp-block-navigation-link__label', { 38576 'is-invalid': isInvalid, 38577 'is-draft': isDraft 38578 }), 38579 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 38580 children: 38581 // Some attributes are stored in an escaped form. It's a legacy issue. 38582 // Ideally they would be stored in a raw, unescaped form. 38583 // Unescape is used here to "recover" the escaped characters 38584 // so they display without encoding. 38585 // See `updateAttributes` for more details. 38586 `${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label)} $isInvalid || isDraft ? placeholderText : ''}`.trim() 38587 }) 38588 })] 38589 }), isLinkOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { 38590 ref: linkUIref, 38591 clientId: clientId, 38592 link: attributes, 38593 onClose: () => { 38594 // If there is no link then remove the auto-inserted block. 38595 // This avoids empty blocks which can provided a poor UX. 38596 if (!url) { 38597 // Fixes https://github.com/WordPress/gutenberg/issues/61361 38598 // There's a chance we're closing due to the user selecting the browse all button. 38599 // Only move focus if the focus is still within the popover ui. If it's not within 38600 // the popover, it's because something has taken the focus from the popover, and 38601 // we don't want to steal it back. 38602 if (linkUIref.current.contains(window.document.activeElement)) { 38603 // Select the previous block to keep focus nearby 38604 selectPreviousBlock(clientId, true); 38605 } 38606 38607 // Remove the link. 38608 onReplace([]); 38609 return; 38610 } 38611 setIsLinkOpen(false); 38612 if (openedBy) { 38613 openedBy.focus(); 38614 setOpenedBy(null); 38615 } else if (ref.current) { 38616 // select the ref when adding a new link 38617 ref.current.focus(); 38618 } else { 38619 // Fallback 38620 selectPreviousBlock(clientId, true); 38621 } 38622 }, 38623 anchor: popoverAnchor, 38624 onRemove: removeLink, 38625 onChange: updatedValue => { 38626 updateAttributes(updatedValue, setAttributes, attributes); 38627 } 38628 })] 38629 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 38630 ...innerBlocksProps 38631 })] 38632 })] 38633 }); 38634 } 38635 38636 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js 38637 /** 38638 * WordPress dependencies 38639 */ 38640 38641 38642 function navigation_link_save_save() { 38643 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 38644 } 38645 38646 ;// ./node_modules/@wordpress/icons/build-module/library/page.js 38647 /** 38648 * WordPress dependencies 38649 */ 38650 38651 38652 const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 38653 xmlns: "http://www.w3.org/2000/svg", 38654 viewBox: "0 0 24 24", 38655 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 38656 d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" 38657 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 38658 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" 38659 })] 38660 }); 38661 /* harmony default export */ const library_page = (page); 38662 38663 ;// ./node_modules/@wordpress/icons/build-module/library/tag.js 38664 /** 38665 * WordPress dependencies 38666 */ 38667 38668 38669 const tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 38670 xmlns: "http://www.w3.org/2000/svg", 38671 viewBox: "0 0 24 24", 38672 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 38673 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" 38674 }) 38675 }); 38676 /* harmony default export */ const library_tag = (tag); 38677 38678 ;// ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js 38679 /** 38680 * WordPress dependencies 38681 */ 38682 38683 38684 const customPostType = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 38685 xmlns: "http://www.w3.org/2000/svg", 38686 viewBox: "0 0 24 24", 38687 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 38688 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" 38689 }) 38690 }); 38691 /* harmony default export */ const custom_post_type = (customPostType); 38692 38693 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js 38694 /* wp:polyfill */ 38695 /** 38696 * WordPress dependencies 38697 */ 38698 38699 function getIcon(variationName) { 38700 switch (variationName) { 38701 case 'post': 38702 return post_list; 38703 case 'page': 38704 return library_page; 38705 case 'tag': 38706 return library_tag; 38707 case 'category': 38708 return library_category; 38709 default: 38710 return custom_post_type; 38711 } 38712 } 38713 function enhanceNavigationLinkVariations(settings, name) { 38714 if (name !== 'core/navigation-link') { 38715 return settings; 38716 } 38717 38718 // Otherwise decorate server passed variations with an icon and isActive function. 38719 if (settings.variations) { 38720 const isActive = (blockAttributes, variationAttributes) => { 38721 return blockAttributes.type === variationAttributes.type; 38722 }; 38723 const variations = settings.variations.map(variation => { 38724 return { 38725 ...variation, 38726 ...(!variation.icon && { 38727 icon: getIcon(variation.name) 38728 }), 38729 ...(!variation.isActive && { 38730 isActive 38731 }) 38732 }; 38733 }); 38734 return { 38735 ...settings, 38736 variations 38737 }; 38738 } 38739 return settings; 38740 } 38741 38742 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js 38743 /** 38744 * WordPress dependencies 38745 */ 38746 38747 const navigation_link_transforms_transforms = { 38748 from: [{ 38749 type: 'block', 38750 blocks: ['core/site-logo'], 38751 transform: () => { 38752 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38753 } 38754 }, { 38755 type: 'block', 38756 blocks: ['core/spacer'], 38757 transform: () => { 38758 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38759 } 38760 }, { 38761 type: 'block', 38762 blocks: ['core/home-link'], 38763 transform: () => { 38764 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38765 } 38766 }, { 38767 type: 'block', 38768 blocks: ['core/social-links'], 38769 transform: () => { 38770 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38771 } 38772 }, { 38773 type: 'block', 38774 blocks: ['core/search'], 38775 transform: () => { 38776 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38777 } 38778 }, { 38779 type: 'block', 38780 blocks: ['core/page-list'], 38781 transform: () => { 38782 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38783 } 38784 }, { 38785 type: 'block', 38786 blocks: ['core/buttons'], 38787 transform: () => { 38788 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); 38789 } 38790 }], 38791 to: [{ 38792 type: 'block', 38793 blocks: ['core/navigation-submenu'], 38794 transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks) 38795 }, { 38796 type: 'block', 38797 blocks: ['core/spacer'], 38798 transform: () => { 38799 return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); 38800 } 38801 }, { 38802 type: 'block', 38803 blocks: ['core/site-logo'], 38804 transform: () => { 38805 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); 38806 } 38807 }, { 38808 type: 'block', 38809 blocks: ['core/home-link'], 38810 transform: () => { 38811 return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); 38812 } 38813 }, { 38814 type: 'block', 38815 blocks: ['core/social-links'], 38816 transform: () => { 38817 return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); 38818 } 38819 }, { 38820 type: 'block', 38821 blocks: ['core/search'], 38822 transform: () => { 38823 return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', { 38824 showLabel: false, 38825 buttonUseIcon: true, 38826 buttonPosition: 'button-inside' 38827 }); 38828 } 38829 }, { 38830 type: 'block', 38831 blocks: ['core/page-list'], 38832 transform: () => { 38833 return (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list'); 38834 } 38835 }, { 38836 type: 'block', 38837 blocks: ['core/buttons'], 38838 transform: ({ 38839 label, 38840 url, 38841 rel, 38842 title, 38843 opensInNewTab 38844 }) => { 38845 return (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/button', { 38846 text: label, 38847 url, 38848 rel, 38849 title, 38850 linkTarget: opensInNewTab ? '_blank' : undefined 38851 })]); 38852 } 38853 }] 38854 }; 38855 /* harmony default export */ const navigation_link_transforms = (navigation_link_transforms_transforms); 38856 38857 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js 38858 /** 38859 * WordPress dependencies 38860 */ 38861 38862 38863 38864 38865 38866 /** 38867 * Internal dependencies 38868 */ 38869 38870 const navigation_link_metadata = { 38871 $schema: "https://schemas.wp.org/trunk/block.json", 38872 apiVersion: 3, 38873 name: "core/navigation-link", 38874 title: "Custom Link", 38875 category: "design", 38876 parent: ["core/navigation"], 38877 allowedBlocks: ["core/navigation-link", "core/navigation-submenu", "core/page-list"], 38878 description: "Add a page, link, or another item to your navigation.", 38879 textdomain: "default", 38880 attributes: { 38881 label: { 38882 type: "string" 38883 }, 38884 type: { 38885 type: "string" 38886 }, 38887 description: { 38888 type: "string" 38889 }, 38890 rel: { 38891 type: "string" 38892 }, 38893 id: { 38894 type: "number" 38895 }, 38896 opensInNewTab: { 38897 type: "boolean", 38898 "default": false 38899 }, 38900 url: { 38901 type: "string" 38902 }, 38903 title: { 38904 type: "string" 38905 }, 38906 kind: { 38907 type: "string" 38908 }, 38909 isTopLevelLink: { 38910 type: "boolean" 38911 } 38912 }, 38913 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"], 38914 supports: { 38915 reusable: false, 38916 html: false, 38917 __experimentalSlashInserter: true, 38918 typography: { 38919 fontSize: true, 38920 lineHeight: true, 38921 __experimentalFontFamily: true, 38922 __experimentalFontWeight: true, 38923 __experimentalFontStyle: true, 38924 __experimentalTextTransform: true, 38925 __experimentalTextDecoration: true, 38926 __experimentalLetterSpacing: true, 38927 __experimentalDefaultControls: { 38928 fontSize: true 38929 } 38930 }, 38931 renaming: false, 38932 interactivity: { 38933 clientNavigation: true 38934 } 38935 }, 38936 editorStyle: "wp-block-navigation-link-editor", 38937 style: "wp-block-navigation-link" 38938 }; 38939 38940 38941 38942 38943 38944 const { 38945 name: navigation_link_name 38946 } = navigation_link_metadata; 38947 38948 const navigation_link_settings = { 38949 icon: custom_link, 38950 __experimentalLabel: ({ 38951 label 38952 }) => label, 38953 merge(leftAttributes, { 38954 label: rightLabel = '' 38955 }) { 38956 return { 38957 ...leftAttributes, 38958 label: leftAttributes.label + rightLabel 38959 }; 38960 }, 38961 edit: NavigationLinkEdit, 38962 save: navigation_link_save_save, 38963 example: { 38964 attributes: { 38965 label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'), 38966 url: 'https://example.com' 38967 } 38968 }, 38969 deprecated: [{ 38970 isEligible(attributes) { 38971 return attributes.nofollow; 38972 }, 38973 attributes: { 38974 label: { 38975 type: 'string' 38976 }, 38977 type: { 38978 type: 'string' 38979 }, 38980 nofollow: { 38981 type: 'boolean' 38982 }, 38983 description: { 38984 type: 'string' 38985 }, 38986 id: { 38987 type: 'number' 38988 }, 38989 opensInNewTab: { 38990 type: 'boolean', 38991 default: false 38992 }, 38993 url: { 38994 type: 'string' 38995 } 38996 }, 38997 migrate({ 38998 nofollow, 38999 ...rest 39000 }) { 39001 return { 39002 rel: nofollow ? 'nofollow' : '', 39003 ...rest 39004 }; 39005 }, 39006 save() { 39007 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 39008 } 39009 }], 39010 transforms: navigation_link_transforms 39011 }; 39012 const navigation_link_init = () => { 39013 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations); 39014 return initBlock({ 39015 name: navigation_link_name, 39016 metadata: navigation_link_metadata, 39017 settings: navigation_link_settings 39018 }); 39019 }; 39020 39021 ;// ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js 39022 /** 39023 * WordPress dependencies 39024 */ 39025 39026 39027 const removeSubmenu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 39028 xmlns: "http://www.w3.org/2000/svg", 39029 viewBox: "0 0 24 24", 39030 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 39031 fillRule: "evenodd", 39032 clipRule: "evenodd", 39033 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" 39034 }) 39035 }); 39036 /* harmony default export */ const remove_submenu = (removeSubmenu); 39037 39038 ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js 39039 /** 39040 * WordPress dependencies 39041 */ 39042 39043 39044 const ItemSubmenuIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 39045 xmlns: "http://www.w3.org/2000/svg", 39046 width: "12", 39047 height: "12", 39048 viewBox: "0 0 12 12", 39049 fill: "none", 39050 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 39051 d: "M1.50002 4L6.00002 8L10.5 4", 39052 strokeWidth: "1.5" 39053 }) 39054 }); 39055 39056 ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js 39057 /** 39058 * External dependencies 39059 */ 39060 39061 39062 /** 39063 * WordPress dependencies 39064 */ 39065 39066 39067 39068 39069 39070 39071 39072 39073 39074 39075 39076 39077 /** 39078 * Internal dependencies 39079 */ 39080 39081 39082 39083 39084 39085 39086 const ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list']; 39087 const navigation_submenu_edit_DEFAULT_BLOCK = { 39088 name: 'core/navigation-link' 39089 }; 39090 39091 /** 39092 * A React hook to determine if it's dragging within the target element. 39093 * 39094 * @typedef {import('@wordpress/element').RefObject} RefObject 39095 * 39096 * @param {RefObject<HTMLElement>} elementRef The target elementRef object. 39097 * 39098 * @return {boolean} Is dragging within the target element. 39099 */ 39100 const edit_useIsDraggingWithin = elementRef => { 39101 const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); 39102 (0,external_wp_element_namespaceObject.useEffect)(() => { 39103 const { 39104 ownerDocument 39105 } = elementRef.current; 39106 function handleDragStart(event) { 39107 // Check the first time when the dragging starts. 39108 handleDragEnter(event); 39109 } 39110 39111 // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. 39112 function handleDragEnd() { 39113 setIsDraggingWithin(false); 39114 } 39115 function handleDragEnter(event) { 39116 // Check if the current target is inside the item element. 39117 if (elementRef.current.contains(event.target)) { 39118 setIsDraggingWithin(true); 39119 } else { 39120 setIsDraggingWithin(false); 39121 } 39122 } 39123 39124 // Bind these events to the document to catch all drag events. 39125 // Ideally, we can also use `event.relatedTarget`, but sadly that 39126 // doesn't work in Safari. 39127 ownerDocument.addEventListener('dragstart', handleDragStart); 39128 ownerDocument.addEventListener('dragend', handleDragEnd); 39129 ownerDocument.addEventListener('dragenter', handleDragEnter); 39130 return () => { 39131 ownerDocument.removeEventListener('dragstart', handleDragStart); 39132 ownerDocument.removeEventListener('dragend', handleDragEnd); 39133 ownerDocument.removeEventListener('dragenter', handleDragEnter); 39134 }; 39135 }, []); 39136 return isDraggingWithin; 39137 }; 39138 39139 /** 39140 * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind 39141 */ 39142 39143 /** 39144 * Navigation Link Block Attributes 39145 * 39146 * @typedef {Object} WPNavigationLinkBlockAttributes 39147 * 39148 * @property {string} [label] Link text. 39149 * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. 39150 * @property {string} [type] The type such as post, page, tag, category and other custom types. 39151 * @property {string} [rel] The relationship of the linked URL. 39152 * @property {number} [id] A post or term id. 39153 * @property {boolean} [opensInNewTab] Sets link target to _blank when true. 39154 * @property {string} [url] Link href. 39155 * @property {string} [title] Link title attribute. 39156 */ 39157 39158 function NavigationSubmenuEdit({ 39159 attributes, 39160 isSelected, 39161 setAttributes, 39162 mergeBlocks, 39163 onReplace, 39164 context, 39165 clientId 39166 }) { 39167 const { 39168 label, 39169 url, 39170 description, 39171 rel, 39172 title 39173 } = attributes; 39174 const { 39175 showSubmenuIcon, 39176 maxNestingLevel, 39177 openSubmenusOnClick 39178 } = context; 39179 const { 39180 __unstableMarkNextChangeAsNotPersistent, 39181 replaceBlock, 39182 selectBlock 39183 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 39184 const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); 39185 // Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text) 39186 const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null); 39187 // Use internal state instead of a ref to make sure that the component 39188 // re-renders when the popover's anchor updates. 39189 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 39190 const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); 39191 const isDraggingWithin = edit_useIsDraggingWithin(listItemRef); 39192 const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…'); 39193 const ref = (0,external_wp_element_namespaceObject.useRef)(); 39194 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 39195 const { 39196 parentCount, 39197 isParentOfSelectedBlock, 39198 isImmediateParentOfSelectedBlock, 39199 hasChildren, 39200 selectedBlockHasChildren, 39201 onlyDescendantIsEmptyLink 39202 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 39203 const { 39204 hasSelectedInnerBlock, 39205 getSelectedBlockClientId, 39206 getBlockParentsByBlockName, 39207 getBlock, 39208 getBlockCount, 39209 getBlockOrder 39210 } = select(external_wp_blockEditor_namespaceObject.store); 39211 let _onlyDescendantIsEmptyLink; 39212 const selectedBlockId = getSelectedBlockClientId(); 39213 const selectedBlockChildren = getBlockOrder(selectedBlockId); 39214 39215 // Check for a single descendant in the submenu. If that block 39216 // is a link block in a "placeholder" state with no label then 39217 // we can consider as an "empty" link. 39218 if (selectedBlockChildren?.length === 1) { 39219 const singleBlock = getBlock(selectedBlockChildren[0]); 39220 _onlyDescendantIsEmptyLink = singleBlock?.name === 'core/navigation-link' && !singleBlock?.attributes?.label; 39221 } 39222 return { 39223 parentCount: getBlockParentsByBlockName(clientId, 'core/navigation-submenu').length, 39224 isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), 39225 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), 39226 hasChildren: !!getBlockCount(clientId), 39227 selectedBlockHasChildren: !!selectedBlockChildren?.length, 39228 onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink 39229 }; 39230 }, [clientId]); 39231 const prevHasChildren = (0,external_wp_compose_namespaceObject.usePrevious)(hasChildren); 39232 39233 // Show the LinkControl on mount if the URL is empty 39234 // ( When adding a new menu item) 39235 // This can't be done in the useState call because it conflicts 39236 // with the autofocus behavior of the BlockListBlock component. 39237 (0,external_wp_element_namespaceObject.useEffect)(() => { 39238 if (!openSubmenusOnClick && !url) { 39239 setIsLinkOpen(true); 39240 } 39241 }, []); 39242 39243 /** 39244 * The hook shouldn't be necessary but due to a focus loss happening 39245 * when selecting a suggestion in the link popover, we force close on block unselection. 39246 */ 39247 (0,external_wp_element_namespaceObject.useEffect)(() => { 39248 if (!isSelected) { 39249 setIsLinkOpen(false); 39250 } 39251 }, [isSelected]); 39252 39253 // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. 39254 (0,external_wp_element_namespaceObject.useEffect)(() => { 39255 if (isLinkOpen && url) { 39256 // Does this look like a URL and have something TLD-ish? 39257 if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 39258 // Focus and select the label text. 39259 selectLabelText(); 39260 } 39261 } 39262 }, [url]); 39263 39264 /** 39265 * Focus the Link label text and select it. 39266 */ 39267 function selectLabelText() { 39268 ref.current.focus(); 39269 const { 39270 ownerDocument 39271 } = ref.current; 39272 const { 39273 defaultView 39274 } = ownerDocument; 39275 const selection = defaultView.getSelection(); 39276 const range = ownerDocument.createRange(); 39277 // Get the range of the current ref contents so we can add this range to the selection. 39278 range.selectNodeContents(ref.current); 39279 selection.removeAllRanges(); 39280 selection.addRange(range); 39281 } 39282 const { 39283 textColor, 39284 customTextColor, 39285 backgroundColor, 39286 customBackgroundColor 39287 } = getColors(context, parentCount > 0); 39288 function onKeyDown(event) { 39289 if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { 39290 // Required to prevent the command center from opening, 39291 // as it shares the CMD+K shortcut. 39292 // See https://github.com/WordPress/gutenberg/pull/59845. 39293 event.preventDefault(); 39294 // If we don't stop propagation, this event bubbles up to the parent submenu item 39295 event.stopPropagation(); 39296 setIsLinkOpen(true); 39297 setOpenedBy(ref.current); 39298 } 39299 } 39300 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 39301 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), 39302 className: dist_clsx('wp-block-navigation-item', { 39303 'is-editing': isSelected || isParentOfSelectedBlock, 39304 'is-dragging-within': isDraggingWithin, 39305 'has-link': !!url, 39306 'has-child': hasChildren, 39307 'has-text-color': !!textColor || !!customTextColor, 39308 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 39309 'has-background': !!backgroundColor || customBackgroundColor, 39310 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor, 39311 'open-on-click': openSubmenusOnClick 39312 }), 39313 style: { 39314 color: !textColor && customTextColor, 39315 backgroundColor: !backgroundColor && customBackgroundColor 39316 }, 39317 onKeyDown 39318 }); 39319 39320 // Always use overlay colors for submenus. 39321 const innerBlocksColors = getColors(context, true); 39322 const allowedBlocks = parentCount >= maxNestingLevel ? ALLOWED_BLOCKS.filter(blockName => blockName !== 'core/navigation-submenu') : ALLOWED_BLOCKS; 39323 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 39324 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(navigationChildBlockProps, { 39325 allowedBlocks, 39326 defaultBlock: navigation_submenu_edit_DEFAULT_BLOCK, 39327 directInsert: true, 39328 // Ensure block toolbar is not too far removed from item 39329 // being edited. 39330 // see: https://github.com/WordPress/gutenberg/pull/34615. 39331 __experimentalCaptureToolbars: true, 39332 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || 39333 // Show the appender while dragging to allow inserting element between item and the appender. 39334 hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false 39335 }); 39336 const ParentElement = openSubmenusOnClick ? 'button' : 'a'; 39337 function transformToLink() { 39338 const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes); 39339 replaceBlock(clientId, newLinkBlock); 39340 } 39341 (0,external_wp_element_namespaceObject.useEffect)(() => { 39342 // If block becomes empty, transform to Navigation Link. 39343 if (!hasChildren && prevHasChildren) { 39344 // This side-effect should not create an undo level as those should 39345 // only be created via user interactions. 39346 __unstableMarkNextChangeAsNotPersistent(); 39347 transformToLink(); 39348 } 39349 }, [hasChildren, prevHasChildren]); 39350 const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink; 39351 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 39352 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 39353 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { 39354 children: [!openSubmenusOnClick && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 39355 name: "link", 39356 icon: library_link, 39357 title: (0,external_wp_i18n_namespaceObject.__)('Link'), 39358 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), 39359 onClick: event => { 39360 setIsLinkOpen(true); 39361 setOpenedBy(event.currentTarget); 39362 } 39363 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 39364 name: "revert", 39365 icon: remove_submenu, 39366 title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'), 39367 onClick: transformToLink, 39368 className: "wp-block-navigation__submenu__revert", 39369 disabled: !canConvertToLink 39370 })] 39371 }) 39372 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 39373 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 39374 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 39375 resetAll: () => { 39376 setAttributes({ 39377 label: '', 39378 url: '', 39379 description: '', 39380 title: '', 39381 rel: '' 39382 }); 39383 }, 39384 dropdownMenuProps: dropdownMenuProps, 39385 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39386 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 39387 isShownByDefault: true, 39388 hasValue: () => !!label, 39389 onDeselect: () => setAttributes({ 39390 label: '' 39391 }), 39392 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 39393 __nextHasNoMarginBottom: true, 39394 __next40pxDefaultSize: true, 39395 value: label || '', 39396 onChange: labelValue => { 39397 setAttributes({ 39398 label: labelValue 39399 }); 39400 }, 39401 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 39402 autoComplete: "off" 39403 }) 39404 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39405 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 39406 isShownByDefault: true, 39407 hasValue: () => !!url, 39408 onDeselect: () => setAttributes({ 39409 url: '' 39410 }), 39411 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 39412 __nextHasNoMarginBottom: true, 39413 __next40pxDefaultSize: true, 39414 value: url || '', 39415 onChange: urlValue => { 39416 setAttributes({ 39417 url: urlValue 39418 }); 39419 }, 39420 label: (0,external_wp_i18n_namespaceObject.__)('Link'), 39421 autoComplete: "off" 39422 }) 39423 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39424 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 39425 isShownByDefault: true, 39426 hasValue: () => !!description, 39427 onDeselect: () => setAttributes({ 39428 description: '' 39429 }), 39430 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { 39431 __nextHasNoMarginBottom: true, 39432 value: description || '', 39433 onChange: descriptionValue => { 39434 setAttributes({ 39435 description: descriptionValue 39436 }); 39437 }, 39438 label: (0,external_wp_i18n_namespaceObject.__)('Description'), 39439 help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') 39440 }) 39441 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39442 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 39443 isShownByDefault: true, 39444 hasValue: () => !!title, 39445 onDeselect: () => setAttributes({ 39446 title: '' 39447 }), 39448 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 39449 __nextHasNoMarginBottom: true, 39450 __next40pxDefaultSize: true, 39451 value: title || '', 39452 onChange: titleValue => { 39453 setAttributes({ 39454 title: titleValue 39455 }); 39456 }, 39457 label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), 39458 autoComplete: "off", 39459 help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') 39460 }) 39461 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 39462 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 39463 isShownByDefault: true, 39464 hasValue: () => !!rel, 39465 onDeselect: () => setAttributes({ 39466 rel: '' 39467 }), 39468 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 39469 __nextHasNoMarginBottom: true, 39470 __next40pxDefaultSize: true, 39471 value: rel || '', 39472 onChange: relValue => { 39473 setAttributes({ 39474 rel: relValue 39475 }); 39476 }, 39477 label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), 39478 autoComplete: "off", 39479 help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') 39480 }) 39481 })] 39482 }) 39483 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 39484 ...blockProps, 39485 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ParentElement, { 39486 className: "wp-block-navigation-item__content", 39487 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 39488 ref: ref, 39489 identifier: "label", 39490 className: "wp-block-navigation-item__label", 39491 value: label, 39492 onChange: labelValue => setAttributes({ 39493 label: labelValue 39494 }), 39495 onMerge: mergeBlocks, 39496 onReplace: onReplace, 39497 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), 39498 placeholder: itemLabelPlaceholder, 39499 withoutInteractiveFormatting: true, 39500 onClick: () => { 39501 if (!openSubmenusOnClick && !url) { 39502 setIsLinkOpen(true); 39503 setOpenedBy(ref.current); 39504 } 39505 } 39506 }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 39507 className: "wp-block-navigation-item__description", 39508 children: description 39509 }), !openSubmenusOnClick && isLinkOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { 39510 clientId: clientId, 39511 link: attributes, 39512 onClose: () => { 39513 setIsLinkOpen(false); 39514 if (openedBy) { 39515 openedBy.focus(); 39516 setOpenedBy(null); 39517 } else { 39518 selectBlock(clientId); 39519 } 39520 }, 39521 anchor: popoverAnchor, 39522 onRemove: () => { 39523 setAttributes({ 39524 url: '' 39525 }); 39526 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); 39527 }, 39528 onChange: updatedValue => { 39529 updateAttributes(updatedValue, setAttributes, attributes); 39530 } 39531 })] 39532 }), (showSubmenuIcon || openSubmenusOnClick) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 39533 className: "wp-block-navigation__submenu-icon", 39534 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSubmenuIcon, {}) 39535 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 39536 ...innerBlocksProps 39537 })] 39538 })] 39539 }); 39540 } 39541 39542 ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js 39543 /** 39544 * WordPress dependencies 39545 */ 39546 39547 39548 function navigation_submenu_save_save() { 39549 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 39550 } 39551 39552 ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js 39553 /** 39554 * WordPress dependencies 39555 */ 39556 39557 const navigation_submenu_transforms_transforms = { 39558 to: [{ 39559 type: 'block', 39560 blocks: ['core/navigation-link'], 39561 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39562 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes) 39563 }, { 39564 type: 'block', 39565 blocks: ['core/spacer'], 39566 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39567 transform: () => { 39568 return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); 39569 } 39570 }, { 39571 type: 'block', 39572 blocks: ['core/site-logo'], 39573 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39574 transform: () => { 39575 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); 39576 } 39577 }, { 39578 type: 'block', 39579 blocks: ['core/home-link'], 39580 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39581 transform: () => { 39582 return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); 39583 } 39584 }, { 39585 type: 'block', 39586 blocks: ['core/social-links'], 39587 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39588 transform: () => { 39589 return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); 39590 } 39591 }, { 39592 type: 'block', 39593 blocks: ['core/search'], 39594 isMatch: (attributes, block) => block?.innerBlocks?.length === 0, 39595 transform: () => { 39596 return (0,external_wp_blocks_namespaceObject.createBlock)('core/search'); 39597 } 39598 }] 39599 }; 39600 /* harmony default export */ const navigation_submenu_transforms = (navigation_submenu_transforms_transforms); 39601 39602 ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js 39603 /** 39604 * WordPress dependencies 39605 */ 39606 39607 39608 39609 /** 39610 * Internal dependencies 39611 */ 39612 39613 const navigation_submenu_metadata = { 39614 $schema: "https://schemas.wp.org/trunk/block.json", 39615 apiVersion: 3, 39616 name: "core/navigation-submenu", 39617 title: "Submenu", 39618 category: "design", 39619 parent: ["core/navigation"], 39620 description: "Add a submenu to your navigation.", 39621 textdomain: "default", 39622 attributes: { 39623 label: { 39624 type: "string" 39625 }, 39626 type: { 39627 type: "string" 39628 }, 39629 description: { 39630 type: "string" 39631 }, 39632 rel: { 39633 type: "string" 39634 }, 39635 id: { 39636 type: "number" 39637 }, 39638 opensInNewTab: { 39639 type: "boolean", 39640 "default": false 39641 }, 39642 url: { 39643 type: "string" 39644 }, 39645 title: { 39646 type: "string" 39647 }, 39648 kind: { 39649 type: "string" 39650 }, 39651 isTopLevelItem: { 39652 type: "boolean" 39653 } 39654 }, 39655 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"], 39656 supports: { 39657 reusable: false, 39658 html: false, 39659 typography: { 39660 fontSize: true, 39661 lineHeight: true, 39662 __experimentalFontFamily: true, 39663 __experimentalFontWeight: true, 39664 __experimentalFontStyle: true, 39665 __experimentalTextTransform: true, 39666 __experimentalTextDecoration: true, 39667 __experimentalLetterSpacing: true, 39668 __experimentalDefaultControls: { 39669 fontSize: true 39670 } 39671 }, 39672 interactivity: { 39673 clientNavigation: true 39674 } 39675 }, 39676 editorStyle: "wp-block-navigation-submenu-editor", 39677 style: "wp-block-navigation-submenu" 39678 }; 39679 39680 39681 39682 const { 39683 name: navigation_submenu_name 39684 } = navigation_submenu_metadata; 39685 39686 const navigation_submenu_settings = { 39687 icon: ({ 39688 context 39689 }) => { 39690 if (context === 'list-view') { 39691 return library_page; 39692 } 39693 return add_submenu; 39694 }, 39695 __experimentalLabel(attributes, { 39696 context 39697 }) { 39698 const { 39699 label 39700 } = attributes; 39701 const customName = attributes?.metadata?.name; 39702 39703 // In the list view, use the block's menu label as the label. 39704 // If the menu label is empty, fall back to the default label. 39705 if (context === 'list-view' && (customName || label)) { 39706 return attributes?.metadata?.name || label; 39707 } 39708 return label; 39709 }, 39710 edit: NavigationSubmenuEdit, 39711 example: { 39712 attributes: { 39713 label: (0,external_wp_i18n_namespaceObject._x)('About', 'Example link text for Navigation Submenu'), 39714 type: 'page' 39715 } 39716 }, 39717 save: navigation_submenu_save_save, 39718 transforms: navigation_submenu_transforms 39719 }; 39720 const navigation_submenu_init = () => initBlock({ 39721 name: navigation_submenu_name, 39722 metadata: navigation_submenu_metadata, 39723 settings: navigation_submenu_settings 39724 }); 39725 39726 ;// ./node_modules/@wordpress/icons/build-module/library/page-break.js 39727 /** 39728 * WordPress dependencies 39729 */ 39730 39731 39732 const pageBreak = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 39733 xmlns: "http://www.w3.org/2000/svg", 39734 viewBox: "0 0 24 24", 39735 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 39736 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" 39737 }) 39738 }); 39739 /* harmony default export */ const page_break = (pageBreak); 39740 39741 ;// ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js 39742 /** 39743 * WordPress dependencies 39744 */ 39745 39746 39747 39748 function NextPageEdit() { 39749 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 39750 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 39751 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 39752 children: (0,external_wp_i18n_namespaceObject.__)('Page break') 39753 }) 39754 }); 39755 } 39756 39757 ;// ./node_modules/@wordpress/block-library/build-module/nextpage/save.js 39758 /** 39759 * WordPress dependencies 39760 */ 39761 39762 39763 function nextpage_save_save() { 39764 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 39765 children: '<!--nextpage-->' 39766 }); 39767 } 39768 39769 ;// ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js 39770 /** 39771 * WordPress dependencies 39772 */ 39773 39774 const nextpage_transforms_transforms = { 39775 from: [{ 39776 type: 'raw', 39777 schema: { 39778 'wp-block': { 39779 attributes: ['data-block'] 39780 } 39781 }, 39782 isMatch: node => node.dataset && node.dataset.block === 'core/nextpage', 39783 transform() { 39784 return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {}); 39785 } 39786 }] 39787 }; 39788 /* harmony default export */ const nextpage_transforms = (nextpage_transforms_transforms); 39789 39790 ;// ./node_modules/@wordpress/block-library/build-module/nextpage/index.js 39791 /** 39792 * WordPress dependencies 39793 */ 39794 39795 39796 /** 39797 * Internal dependencies 39798 */ 39799 39800 39801 const nextpage_metadata = { 39802 $schema: "https://schemas.wp.org/trunk/block.json", 39803 apiVersion: 3, 39804 name: "core/nextpage", 39805 title: "Page Break", 39806 category: "design", 39807 description: "Separate your content into a multi-page experience.", 39808 keywords: ["next page", "pagination"], 39809 parent: ["core/post-content"], 39810 textdomain: "default", 39811 supports: { 39812 customClassName: false, 39813 className: false, 39814 html: false, 39815 interactivity: { 39816 clientNavigation: true 39817 } 39818 }, 39819 editorStyle: "wp-block-nextpage-editor" 39820 }; 39821 39822 39823 const { 39824 name: nextpage_name 39825 } = nextpage_metadata; 39826 39827 const nextpage_settings = { 39828 icon: page_break, 39829 example: {}, 39830 transforms: nextpage_transforms, 39831 edit: NextPageEdit, 39832 save: nextpage_save_save 39833 }; 39834 const nextpage_init = () => initBlock({ 39835 name: nextpage_name, 39836 metadata: nextpage_metadata, 39837 settings: nextpage_settings 39838 }); 39839 39840 ;// ./node_modules/@wordpress/block-library/build-module/pattern/recursion-detector.js 39841 /** 39842 * THIS MODULE IS INTENTIONALLY KEPT WITHIN THE PATTERN BLOCK'S SOURCE. 39843 * 39844 * This is because this approach for preventing infinite loops due to 39845 * recursively rendering blocks is specific to the way that the `core/pattern` 39846 * block behaves in the editor. Any other block types that deal with recursion 39847 * SHOULD USE THE STANDARD METHOD for avoiding loops: 39848 * 39849 * @see https://github.com/WordPress/gutenberg/pull/31455 39850 * @see packages/block-editor/src/components/recursion-provider/README.md 39851 */ 39852 39853 /** 39854 * WordPress dependencies 39855 */ 39856 39857 39858 /** 39859 * Naming is hard. 39860 * 39861 * @see useParsePatternDependencies 39862 * 39863 * @type {WeakMap<Object, Function>} 39864 */ 39865 const cachedParsers = new WeakMap(); 39866 39867 /** 39868 * Hook used by PatternEdit to parse block patterns. It returns a function that 39869 * takes a pattern and returns nothing but throws an error if the pattern is 39870 * recursive. 39871 * 39872 * @example 39873 * ```js 39874 * const parsePatternDependencies = useParsePatternDependencies(); 39875 * parsePatternDependencies( selectedPattern ); 39876 * ``` 39877 * 39878 * @see parsePatternDependencies 39879 * 39880 * @return {Function} A function to parse block patterns. 39881 */ 39882 function useParsePatternDependencies() { 39883 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 39884 39885 // Instead of caching maps, go straight to the point and cache bound 39886 // functions. Each of those functions is bound to a different Map that will 39887 // keep track of patterns in the context of the given registry. 39888 if (!cachedParsers.has(registry)) { 39889 const deps = new Map(); 39890 cachedParsers.set(registry, parsePatternDependencies.bind(null, deps)); 39891 } 39892 return cachedParsers.get(registry); 39893 } 39894 39895 /** 39896 * Parse a given pattern and traverse its contents to detect any subsequent 39897 * patterns on which it may depend. Such occurrences will be added to an 39898 * internal dependency graph. If a circular dependency is detected, an 39899 * error will be thrown. 39900 * 39901 * EXPORTED FOR TESTING PURPOSES ONLY. 39902 * 39903 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 39904 * @param {Object} pattern Pattern. 39905 * @param {string} pattern.name Pattern name. 39906 * @param {Array} pattern.blocks Pattern's block list. 39907 * 39908 * @throws {Error} If a circular dependency is detected. 39909 */ 39910 function parsePatternDependencies(deps, { 39911 name, 39912 blocks 39913 }) { 39914 const queue = [...blocks]; 39915 while (queue.length) { 39916 const block = queue.shift(); 39917 for (const innerBlock of (_block$innerBlocks = block.innerBlocks) !== null && _block$innerBlocks !== void 0 ? _block$innerBlocks : []) { 39918 var _block$innerBlocks; 39919 queue.unshift(innerBlock); 39920 } 39921 if (block.name === 'core/pattern') { 39922 registerDependency(deps, name, block.attributes.slug); 39923 } 39924 } 39925 } 39926 39927 /** 39928 * Declare that pattern `a` depends on pattern `b`. If a circular 39929 * dependency is detected, an error will be thrown. 39930 * 39931 * EXPORTED FOR TESTING PURPOSES ONLY. 39932 * 39933 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 39934 * @param {string} a Slug for pattern A. 39935 * @param {string} b Slug for pattern B. 39936 * 39937 * @throws {Error} If a circular dependency is detected. 39938 */ 39939 function registerDependency(deps, a, b) { 39940 if (!deps.has(a)) { 39941 deps.set(a, new Set()); 39942 } 39943 deps.get(a).add(b); 39944 if (hasCycle(deps, a)) { 39945 throw new TypeError(`Pattern $a} has a circular dependency and cannot be rendered.`); 39946 } 39947 } 39948 39949 /** 39950 * Determine if a given pattern has circular dependencies on other patterns. 39951 * This will be determined by running a depth-first search on the current state 39952 * of the graph represented by `patternDependencies`. 39953 * 39954 * @param {Map<string, Set<string>>} deps Map of pattern dependencies. 39955 * @param {string} slug Pattern slug. 39956 * @param {Set<string>} [visitedNodes] Set to track visited nodes in the graph. 39957 * @param {Set<string>} [currentPath] Set to track and backtrack graph paths. 39958 * @return {boolean} Whether any cycle was found. 39959 */ 39960 function hasCycle(deps, slug, visitedNodes = new Set(), currentPath = new Set()) { 39961 var _deps$get; 39962 visitedNodes.add(slug); 39963 currentPath.add(slug); 39964 const dependencies = (_deps$get = deps.get(slug)) !== null && _deps$get !== void 0 ? _deps$get : new Set(); 39965 for (const dependency of dependencies) { 39966 if (!visitedNodes.has(dependency)) { 39967 if (hasCycle(deps, dependency, visitedNodes, currentPath)) { 39968 return true; 39969 } 39970 } else if (currentPath.has(dependency)) { 39971 return true; 39972 } 39973 } 39974 39975 // Remove the current node from the current path when backtracking 39976 currentPath.delete(slug); 39977 return false; 39978 } 39979 39980 ;// ./node_modules/@wordpress/block-library/build-module/pattern/edit.js 39981 /* wp:polyfill */ 39982 /** 39983 * WordPress dependencies 39984 */ 39985 39986 39987 39988 39989 39990 39991 39992 /** 39993 * Internal dependencies 39994 */ 39995 39996 39997 const PatternEdit = ({ 39998 attributes, 39999 clientId 40000 }) => { 40001 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 40002 const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]); 40003 const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); 40004 const { 40005 replaceBlocks, 40006 setBlockEditingMode, 40007 __unstableMarkNextChangeAsNotPersistent 40008 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 40009 const { 40010 getBlockRootClientId, 40011 getBlockEditingMode 40012 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 40013 const [hasRecursionError, setHasRecursionError] = (0,external_wp_element_namespaceObject.useState)(false); 40014 const parsePatternDependencies = useParsePatternDependencies(); 40015 40016 // Duplicated in packages/editor/src/components/start-template-options/index.js. 40017 function injectThemeAttributeInBlockTemplateContent(block) { 40018 if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { 40019 block.innerBlocks = block.innerBlocks.map(innerBlock => { 40020 if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { 40021 innerBlock.attributes.theme = currentThemeStylesheet; 40022 } 40023 return innerBlock; 40024 }); 40025 } 40026 if (block.name === 'core/template-part' && block.attributes.theme === undefined) { 40027 block.attributes.theme = currentThemeStylesheet; 40028 } 40029 return block; 40030 } 40031 40032 // Run this effect when the component loads. 40033 // This adds the Pattern's contents to the post. 40034 // This change won't be saved. 40035 // It will continue to pull from the pattern file unless changes are made to its respective template part. 40036 (0,external_wp_element_namespaceObject.useEffect)(() => { 40037 if (!hasRecursionError && selectedPattern?.blocks) { 40038 try { 40039 parsePatternDependencies(selectedPattern); 40040 } catch (error) { 40041 setHasRecursionError(true); 40042 return; 40043 } 40044 40045 // We batch updates to block list settings to avoid triggering cascading renders 40046 // for each container block included in a tree and optimize initial render. 40047 // Since the above uses microtasks, we need to use a microtask here as well, 40048 // because nested pattern blocks cannot be inserted if the parent block supports 40049 // inner blocks but doesn't have blockSettings in the state. 40050 window.queueMicrotask(() => { 40051 const rootClientId = getBlockRootClientId(clientId); 40052 // Clone blocks from the pattern before insertion to ensure they receive 40053 // distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628. 40054 const clonedBlocks = selectedPattern.blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(injectThemeAttributeInBlockTemplateContent(block))); 40055 // If the pattern has a single block and categories, we should add the 40056 // categories of the pattern to the block's metadata. 40057 if (clonedBlocks.length === 1 && selectedPattern.categories?.length > 0) { 40058 clonedBlocks[0].attributes = { 40059 ...clonedBlocks[0].attributes, 40060 metadata: { 40061 ...clonedBlocks[0].attributes.metadata, 40062 categories: selectedPattern.categories, 40063 patternName: selectedPattern.name, 40064 name: clonedBlocks[0].attributes.metadata.name || selectedPattern.title 40065 } 40066 }; 40067 } 40068 const rootEditingMode = getBlockEditingMode(rootClientId); 40069 registry.batch(() => { 40070 // Temporarily set the root block to default mode to allow replacing the pattern. 40071 // This could happen when the page is disabling edits of non-content blocks. 40072 __unstableMarkNextChangeAsNotPersistent(); 40073 setBlockEditingMode(rootClientId, 'default'); 40074 __unstableMarkNextChangeAsNotPersistent(); 40075 replaceBlocks(clientId, clonedBlocks); 40076 // Restore the root block's original mode. 40077 __unstableMarkNextChangeAsNotPersistent(); 40078 setBlockEditingMode(rootClientId, rootEditingMode); 40079 }); 40080 }); 40081 } 40082 }, [clientId, hasRecursionError, selectedPattern, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]); 40083 const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 40084 if (hasRecursionError) { 40085 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40086 ...props, 40087 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 40088 children: (0,external_wp_i18n_namespaceObject.sprintf)( 40089 // translators: A warning in which %s is the name of a pattern. 40090 (0,external_wp_i18n_namespaceObject.__)('Pattern "%s" cannot be rendered inside itself.'), selectedPattern?.name) 40091 }) 40092 }); 40093 } 40094 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40095 ...props 40096 }); 40097 }; 40098 /* harmony default export */ const pattern_edit = (PatternEdit); 40099 40100 ;// ./node_modules/@wordpress/block-library/build-module/pattern/index.js 40101 /** 40102 * Internal dependencies 40103 */ 40104 40105 const pattern_metadata = { 40106 $schema: "https://schemas.wp.org/trunk/block.json", 40107 apiVersion: 3, 40108 name: "core/pattern", 40109 title: "Pattern Placeholder", 40110 category: "theme", 40111 description: "Show a block pattern.", 40112 supports: { 40113 html: false, 40114 inserter: false, 40115 renaming: false, 40116 interactivity: { 40117 clientNavigation: true 40118 } 40119 }, 40120 textdomain: "default", 40121 attributes: { 40122 slug: { 40123 type: "string" 40124 } 40125 } 40126 }; 40127 40128 const { 40129 name: pattern_name 40130 } = pattern_metadata; 40131 40132 const pattern_settings = { 40133 edit: pattern_edit 40134 }; 40135 const pattern_init = () => initBlock({ 40136 name: pattern_name, 40137 metadata: pattern_metadata, 40138 settings: pattern_settings 40139 }); 40140 40141 ;// ./node_modules/@wordpress/icons/build-module/library/pages.js 40142 /** 40143 * WordPress dependencies 40144 */ 40145 40146 40147 const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 40148 xmlns: "http://www.w3.org/2000/svg", 40149 viewBox: "0 0 24 24", 40150 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 40151 d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" 40152 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 40153 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" 40154 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 40155 d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" 40156 })] 40157 }); 40158 /* harmony default export */ const library_pages = (pages); 40159 40160 ;// ./node_modules/@wordpress/block-library/build-module/page-list/use-convert-to-navigation-links.js 40161 /* wp:polyfill */ 40162 /** 40163 * WordPress dependencies 40164 */ 40165 40166 40167 40168 40169 /** 40170 * Converts an array of pages into a nested array of navigation link blocks. 40171 * 40172 * @param {Array} pages An array of pages. 40173 * 40174 * @return {Array} A nested array of navigation link blocks. 40175 */ 40176 function createNavigationLinks(pages = []) { 40177 const linkMap = {}; 40178 const navigationLinks = []; 40179 pages.forEach(({ 40180 id, 40181 title, 40182 link: url, 40183 type, 40184 parent 40185 }) => { 40186 var _linkMap$id$innerBloc; 40187 // See if a placeholder exists. This is created if children appear before parents in list. 40188 const innerBlocks = (_linkMap$id$innerBloc = linkMap[id]?.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : []; 40189 linkMap[id] = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', { 40190 id, 40191 label: title.rendered, 40192 url, 40193 type, 40194 kind: 'post-type' 40195 }, innerBlocks); 40196 if (!parent) { 40197 navigationLinks.push(linkMap[id]); 40198 } else { 40199 if (!linkMap[parent]) { 40200 // Use a placeholder if the child appears before parent in list. 40201 linkMap[parent] = { 40202 innerBlocks: [] 40203 }; 40204 } 40205 // Although these variables are not referenced, they are needed to store the innerBlocks in memory. 40206 const parentLinkInnerBlocks = linkMap[parent].innerBlocks; 40207 parentLinkInnerBlocks.push(linkMap[id]); 40208 } 40209 }); 40210 return navigationLinks; 40211 } 40212 40213 /** 40214 * Finds a navigation link block by id, recursively. 40215 * It might be possible to make this a more generic helper function. 40216 * 40217 * @param {Array} navigationLinks An array of navigation link blocks. 40218 * @param {number} id The id of the navigation link to find. 40219 * 40220 * @return {Object|null} The navigation link block with the given id. 40221 */ 40222 function findNavigationLinkById(navigationLinks, id) { 40223 for (const navigationLink of navigationLinks) { 40224 // Is this the link we're looking for? 40225 if (navigationLink.attributes.id === id) { 40226 return navigationLink; 40227 } 40228 40229 // If not does it have innerBlocks? 40230 if (navigationLink.innerBlocks && navigationLink.innerBlocks.length) { 40231 const foundNavigationLink = findNavigationLinkById(navigationLink.innerBlocks, id); 40232 if (foundNavigationLink) { 40233 return foundNavigationLink; 40234 } 40235 } 40236 } 40237 return null; 40238 } 40239 function convertToNavigationLinks(pages = [], parentPageID = null) { 40240 let navigationLinks = createNavigationLinks(pages); 40241 40242 // If a parent page ID is provided, only return the children of that page. 40243 if (parentPageID) { 40244 const parentPage = findNavigationLinkById(navigationLinks, parentPageID); 40245 if (parentPage && parentPage.innerBlocks) { 40246 navigationLinks = parentPage.innerBlocks; 40247 } 40248 } 40249 40250 // Transform all links with innerBlocks into Submenus. This can't be done 40251 // sooner because page objects have no information on their children. 40252 const transformSubmenus = listOfLinks => { 40253 listOfLinks.forEach((block, index, listOfLinksArray) => { 40254 const { 40255 attributes, 40256 innerBlocks 40257 } = block; 40258 if (innerBlocks.length !== 0) { 40259 transformSubmenus(innerBlocks); 40260 const transformedBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks); 40261 listOfLinksArray[index] = transformedBlock; 40262 } 40263 }); 40264 }; 40265 transformSubmenus(navigationLinks); 40266 return navigationLinks; 40267 } 40268 function useConvertToNavigationLinks({ 40269 clientId, 40270 pages, 40271 parentClientId, 40272 parentPageID 40273 }) { 40274 const { 40275 replaceBlock, 40276 selectBlock 40277 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 40278 return () => { 40279 const navigationLinks = convertToNavigationLinks(pages, parentPageID); 40280 40281 // Replace the Page List block with the Navigation Links. 40282 replaceBlock(clientId, navigationLinks); 40283 40284 // Select the Navigation block to reveal the changes. 40285 selectBlock(parentClientId); 40286 }; 40287 } 40288 40289 ;// ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js 40290 /** 40291 * WordPress dependencies 40292 */ 40293 40294 40295 40296 40297 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."); 40298 function ConvertToLinksModal({ 40299 onClick, 40300 onClose, 40301 disabled 40302 }) { 40303 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { 40304 onRequestClose: onClose, 40305 title: (0,external_wp_i18n_namespaceObject.__)('Edit Page List'), 40306 className: "wp-block-page-list-modal", 40307 aria: { 40308 describedby: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description') 40309 }, 40310 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 40311 id: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description'), 40312 children: convertDescription 40313 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 40314 className: "wp-block-page-list-modal-buttons", 40315 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 40316 __next40pxDefaultSize: true, 40317 variant: "tertiary", 40318 onClick: onClose, 40319 children: (0,external_wp_i18n_namespaceObject.__)('Cancel') 40320 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 40321 __next40pxDefaultSize: true, 40322 variant: "primary", 40323 accessibleWhenDisabled: true, 40324 disabled: disabled, 40325 onClick: onClick, 40326 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 40327 })] 40328 })] 40329 }); 40330 } 40331 40332 ;// ./node_modules/@wordpress/block-library/build-module/page-list/edit.js 40333 /* wp:polyfill */ 40334 /** 40335 * External dependencies 40336 */ 40337 40338 40339 /** 40340 * WordPress dependencies 40341 */ 40342 40343 40344 40345 40346 40347 40348 40349 40350 /** 40351 * Internal dependencies 40352 */ 40353 40354 40355 40356 40357 // We only show the edit option when page count is <= MAX_PAGE_COUNT 40358 // Performance of Navigation Links is not good past this value. 40359 40360 const MAX_PAGE_COUNT = 100; 40361 const NOOP = () => {}; 40362 function BlockContent({ 40363 blockProps, 40364 innerBlocksProps, 40365 hasResolvedPages, 40366 blockList, 40367 pages, 40368 parentPageID 40369 }) { 40370 if (!hasResolvedPages) { 40371 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40372 ...blockProps, 40373 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40374 className: "wp-block-page-list__loading-indicator-container", 40375 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { 40376 className: "wp-block-page-list__loading-indicator" 40377 }) 40378 }) 40379 }); 40380 } 40381 if (pages === null) { 40382 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40383 ...blockProps, 40384 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 40385 status: "warning", 40386 isDismissible: false, 40387 children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') 40388 }) 40389 }); 40390 } 40391 if (pages.length === 0) { 40392 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40393 ...blockProps, 40394 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 40395 status: "info", 40396 isDismissible: false, 40397 children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') 40398 }) 40399 }); 40400 } 40401 if (blockList.length === 0) { 40402 const parentPageDetails = pages.find(page => page.id === parentPageID); 40403 if (parentPageDetails?.title?.rendered) { 40404 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40405 ...blockProps, 40406 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 40407 children: (0,external_wp_i18n_namespaceObject.sprintf)( 40408 // translators: %s: Page title. 40409 (0,external_wp_i18n_namespaceObject.__)('Page List: "%s" page has no children.'), parentPageDetails.title.rendered) 40410 }) 40411 }); 40412 } 40413 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 40414 ...blockProps, 40415 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 40416 status: "warning", 40417 isDismissible: false, 40418 children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') 40419 }) 40420 }); 40421 } 40422 if (pages.length > 0) { 40423 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 40424 ...innerBlocksProps 40425 }); 40426 } 40427 } 40428 function PageListEdit({ 40429 context, 40430 clientId, 40431 attributes, 40432 setAttributes 40433 }) { 40434 const { 40435 parentPageID 40436 } = attributes; 40437 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 40438 const openModal = (0,external_wp_element_namespaceObject.useCallback)(() => setOpen(true), []); 40439 const closeModal = () => setOpen(false); 40440 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 40441 const { 40442 records: pages, 40443 hasResolved: hasResolvedPages 40444 } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { 40445 per_page: MAX_PAGE_COUNT, 40446 _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], 40447 // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby 40448 // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent 40449 // sort. 40450 orderby: 'menu_order', 40451 order: 'asc' 40452 }); 40453 const allowConvertToLinks = 'showSubmenuIcon' in context && pages?.length > 0 && pages?.length <= MAX_PAGE_COUNT; 40454 const pagesByParentId = (0,external_wp_element_namespaceObject.useMemo)(() => { 40455 if (pages === null) { 40456 return new Map(); 40457 } 40458 40459 // TODO: Once the REST API supports passing multiple values to 40460 // 'orderby', this can be removed. 40461 // https://core.trac.wordpress.org/ticket/39037 40462 const sortedPages = pages.sort((a, b) => { 40463 if (a.menu_order === b.menu_order) { 40464 return a.title.rendered.localeCompare(b.title.rendered); 40465 } 40466 return a.menu_order - b.menu_order; 40467 }); 40468 return sortedPages.reduce((accumulator, page) => { 40469 const { 40470 parent 40471 } = page; 40472 if (accumulator.has(parent)) { 40473 accumulator.get(parent).push(page); 40474 } else { 40475 accumulator.set(parent, [page]); 40476 } 40477 return accumulator; 40478 }, new Map()); 40479 }, [pages]); 40480 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 40481 className: dist_clsx('wp-block-page-list', { 40482 'has-text-color': !!context.textColor, 40483 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor, 40484 'has-background': !!context.backgroundColor, 40485 [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor 40486 }), 40487 style: { 40488 ...context.style?.color 40489 } 40490 }); 40491 const pagesTree = (0,external_wp_element_namespaceObject.useMemo)(function makePagesTree(parentId = 0, level = 0) { 40492 const childPages = pagesByParentId.get(parentId); 40493 if (!childPages?.length) { 40494 return []; 40495 } 40496 return childPages.reduce((tree, page) => { 40497 const hasChildren = pagesByParentId.has(page.id); 40498 const item = { 40499 value: page.id, 40500 label: '— '.repeat(level) + page.title.rendered, 40501 rawName: page.title.rendered 40502 }; 40503 tree.push(item); 40504 if (hasChildren) { 40505 tree.push(...makePagesTree(page.id, level + 1)); 40506 } 40507 return tree; 40508 }, []); 40509 }, [pagesByParentId]); 40510 const blockList = (0,external_wp_element_namespaceObject.useMemo)(function getBlockList(parentId = parentPageID) { 40511 const childPages = pagesByParentId.get(parentId); 40512 if (!childPages?.length) { 40513 return []; 40514 } 40515 return childPages.reduce((template, page) => { 40516 const hasChildren = pagesByParentId.has(page.id); 40517 const pageProps = { 40518 id: page.id, 40519 label: 40520 // translators: displayed when a page has an empty title. 40521 page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'), 40522 title: 40523 // translators: displayed when a page has an empty title. 40524 page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'), 40525 link: page.url, 40526 hasChildren 40527 }; 40528 let item = null; 40529 const children = getBlockList(page.id); 40530 item = (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list-item', pageProps, children); 40531 template.push(item); 40532 return template; 40533 }, []); 40534 }, [pagesByParentId, parentPageID]); 40535 const { 40536 isNested, 40537 hasSelectedChild, 40538 parentClientId, 40539 hasDraggedChild, 40540 isChildOfNavigation 40541 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 40542 const { 40543 getBlockParentsByBlockName, 40544 hasSelectedInnerBlock, 40545 hasDraggedInnerBlock 40546 } = select(external_wp_blockEditor_namespaceObject.store); 40547 const blockParents = getBlockParentsByBlockName(clientId, 'core/navigation-submenu', true); 40548 const navigationBlockParents = getBlockParentsByBlockName(clientId, 'core/navigation', true); 40549 return { 40550 isNested: blockParents.length > 0, 40551 isChildOfNavigation: navigationBlockParents.length > 0, 40552 hasSelectedChild: hasSelectedInnerBlock(clientId, true), 40553 hasDraggedChild: hasDraggedInnerBlock(clientId, true), 40554 parentClientId: navigationBlockParents[0] 40555 }; 40556 }, [clientId]); 40557 const convertToNavigationLinks = useConvertToNavigationLinks({ 40558 clientId, 40559 pages, 40560 parentClientId, 40561 parentPageID 40562 }); 40563 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 40564 renderAppender: false, 40565 __unstableDisableDropZone: true, 40566 templateLock: isChildOfNavigation ? false : 'all', 40567 onInput: NOOP, 40568 onChange: NOOP, 40569 value: blockList 40570 }); 40571 const { 40572 selectBlock 40573 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 40574 (0,external_wp_element_namespaceObject.useEffect)(() => { 40575 if (hasSelectedChild || hasDraggedChild) { 40576 openModal(); 40577 selectBlock(parentClientId); 40578 } 40579 }, [hasSelectedChild, hasDraggedChild, parentClientId, selectBlock, openModal]); 40580 (0,external_wp_element_namespaceObject.useEffect)(() => { 40581 setAttributes({ 40582 isNested 40583 }); 40584 }, [isNested, setAttributes]); 40585 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 40586 children: [(pagesTree.length > 0 || allowConvertToLinks) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 40587 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 40588 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 40589 resetAll: () => { 40590 setAttributes({ 40591 parentPageID: 0 40592 }); 40593 }, 40594 dropdownMenuProps: dropdownMenuProps, 40595 children: [pagesTree.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 40596 label: (0,external_wp_i18n_namespaceObject.__)('Parent Page'), 40597 hasValue: () => parentPageID !== 0, 40598 onDeselect: () => setAttributes({ 40599 parentPageID: 0 40600 }), 40601 isShownByDefault: true, 40602 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { 40603 __nextHasNoMarginBottom: true, 40604 __next40pxDefaultSize: true, 40605 className: "editor-page-attributes__parent", 40606 label: (0,external_wp_i18n_namespaceObject.__)('Parent'), 40607 value: parentPageID, 40608 options: pagesTree, 40609 onChange: value => setAttributes({ 40610 parentPageID: value !== null && value !== void 0 ? value : 0 40611 }), 40612 help: (0,external_wp_i18n_namespaceObject.__)('Choose a page to show only its subpages.') 40613 }) 40614 }), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 40615 style: { 40616 gridColumn: '1 / -1' 40617 }, 40618 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 40619 children: convertDescription 40620 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 40621 __next40pxDefaultSize: true, 40622 variant: "primary", 40623 accessibleWhenDisabled: true, 40624 disabled: !hasResolvedPages, 40625 onClick: convertToNavigationLinks, 40626 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 40627 })] 40628 })] 40629 }) 40630 }), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 40631 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 40632 group: "other", 40633 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 40634 title: (0,external_wp_i18n_namespaceObject.__)('Edit'), 40635 onClick: openModal, 40636 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 40637 }) 40638 }), isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToLinksModal, { 40639 onClick: convertToNavigationLinks, 40640 onClose: closeModal, 40641 disabled: !hasResolvedPages 40642 })] 40643 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContent, { 40644 blockProps: blockProps, 40645 innerBlocksProps: innerBlocksProps, 40646 hasResolvedPages: hasResolvedPages, 40647 blockList: blockList, 40648 pages: pages, 40649 parentPageID: parentPageID 40650 })] 40651 }); 40652 } 40653 40654 ;// ./node_modules/@wordpress/block-library/build-module/page-list/index.js 40655 /** 40656 * WordPress dependencies 40657 */ 40658 40659 40660 /** 40661 * Internal dependencies 40662 */ 40663 40664 const page_list_metadata = { 40665 $schema: "https://schemas.wp.org/trunk/block.json", 40666 apiVersion: 3, 40667 name: "core/page-list", 40668 title: "Page List", 40669 category: "widgets", 40670 allowedBlocks: ["core/page-list-item"], 40671 description: "Display a list of all pages.", 40672 keywords: ["menu", "navigation"], 40673 textdomain: "default", 40674 attributes: { 40675 parentPageID: { 40676 type: "integer", 40677 "default": 0 40678 }, 40679 isNested: { 40680 type: "boolean", 40681 "default": false 40682 } 40683 }, 40684 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], 40685 supports: { 40686 reusable: false, 40687 html: false, 40688 typography: { 40689 fontSize: true, 40690 lineHeight: true, 40691 __experimentalFontFamily: true, 40692 __experimentalFontWeight: true, 40693 __experimentalFontStyle: true, 40694 __experimentalTextTransform: true, 40695 __experimentalTextDecoration: true, 40696 __experimentalLetterSpacing: true, 40697 __experimentalDefaultControls: { 40698 fontSize: true 40699 } 40700 }, 40701 interactivity: { 40702 clientNavigation: true 40703 }, 40704 color: { 40705 text: true, 40706 background: true, 40707 link: true, 40708 gradients: true, 40709 __experimentalDefaultControls: { 40710 background: true, 40711 text: true, 40712 link: true 40713 } 40714 }, 40715 __experimentalBorder: { 40716 radius: true, 40717 color: true, 40718 width: true, 40719 style: true 40720 }, 40721 spacing: { 40722 padding: true, 40723 margin: true, 40724 __experimentalDefaultControls: { 40725 padding: false, 40726 margin: false 40727 } 40728 } 40729 }, 40730 editorStyle: "wp-block-page-list-editor", 40731 style: "wp-block-page-list" 40732 }; 40733 40734 const { 40735 name: page_list_name 40736 } = page_list_metadata; 40737 40738 const page_list_settings = { 40739 icon: library_pages, 40740 example: {}, 40741 edit: PageListEdit 40742 }; 40743 const page_list_init = () => initBlock({ 40744 name: page_list_name, 40745 metadata: page_list_metadata, 40746 settings: page_list_settings 40747 }); 40748 40749 ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js 40750 /** 40751 * WordPress dependencies 40752 */ 40753 40754 40755 const icons_ItemSubmenuIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 40756 xmlns: "http://www.w3.org/2000/svg", 40757 width: "12", 40758 height: "12", 40759 viewBox: "0 0 12 12", 40760 fill: "none", 40761 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 40762 d: "M1.50002 4L6.00002 8L10.5 4", 40763 strokeWidth: "1.5" 40764 }) 40765 }); 40766 40767 ;// ./node_modules/@wordpress/block-library/build-module/page-list-item/edit.js 40768 /** 40769 * External dependencies 40770 */ 40771 40772 /** 40773 * WordPress dependencies 40774 */ 40775 40776 40777 40778 40779 40780 /** 40781 * Internal dependencies 40782 */ 40783 40784 40785 40786 function useFrontPageId() { 40787 return (0,external_wp_data_namespaceObject.useSelect)(select => { 40788 const canReadSettings = select(external_wp_coreData_namespaceObject.store).canUser('read', { 40789 kind: 'root', 40790 name: 'site' 40791 }); 40792 if (!canReadSettings) { 40793 return undefined; 40794 } 40795 const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site'); 40796 return site?.show_on_front === 'page' && site?.page_on_front; 40797 }, []); 40798 } 40799 function PageListItemEdit({ 40800 context, 40801 attributes 40802 }) { 40803 const { 40804 id, 40805 label, 40806 link, 40807 hasChildren, 40808 title 40809 } = attributes; 40810 const isNavigationChild = 'showSubmenuIcon' in context; 40811 const frontPageId = useFrontPageId(); 40812 const innerBlocksColors = getColors(context, true); 40813 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 40814 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(navigationChildBlockProps, { 40815 className: 'wp-block-pages-list__item' 40816 }); 40817 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps); 40818 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 40819 className: dist_clsx('wp-block-pages-list__item', { 40820 'has-child': hasChildren, 40821 'wp-block-navigation-item': isNavigationChild, 40822 'open-on-click': context.openSubmenusOnClick, 40823 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon, 40824 'menu-item-home': id === frontPageId 40825 }), 40826 children: [hasChildren && context.openSubmenusOnClick ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 40827 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { 40828 type: "button", 40829 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle", 40830 "aria-expanded": "false", 40831 children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label) 40832 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 40833 className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", 40834 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {}) 40835 })] 40836 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 40837 className: dist_clsx('wp-block-pages-list__item__link', { 40838 'wp-block-navigation-item__content': isNavigationChild 40839 }), 40840 href: link, 40841 children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) 40842 }), hasChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 40843 children: [!context.openSubmenusOnClick && context.showSubmenuIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { 40844 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", 40845 "aria-expanded": "false", 40846 type: "button", 40847 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {}) 40848 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 40849 ...innerBlocksProps 40850 })] 40851 })] 40852 }, id); 40853 } 40854 40855 ;// ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js 40856 /** 40857 * WordPress dependencies 40858 */ 40859 40860 40861 /** 40862 * Internal dependencies 40863 */ 40864 40865 const page_list_item_metadata = { 40866 $schema: "https://schemas.wp.org/trunk/block.json", 40867 apiVersion: 3, 40868 name: "core/page-list-item", 40869 title: "Page List Item", 40870 category: "widgets", 40871 parent: ["core/page-list"], 40872 description: "Displays a page inside a list of all pages.", 40873 keywords: ["page", "menu", "navigation"], 40874 textdomain: "default", 40875 attributes: { 40876 id: { 40877 type: "number" 40878 }, 40879 label: { 40880 type: "string" 40881 }, 40882 title: { 40883 type: "string" 40884 }, 40885 link: { 40886 type: "string" 40887 }, 40888 hasChildren: { 40889 type: "boolean" 40890 } 40891 }, 40892 usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], 40893 supports: { 40894 reusable: false, 40895 html: false, 40896 lock: false, 40897 inserter: false, 40898 __experimentalToolbar: false, 40899 interactivity: { 40900 clientNavigation: true 40901 } 40902 }, 40903 editorStyle: "wp-block-page-list-editor", 40904 style: "wp-block-page-list" 40905 }; 40906 40907 const { 40908 name: page_list_item_name 40909 } = page_list_item_metadata; 40910 40911 const page_list_item_settings = { 40912 __experimentalLabel: ({ 40913 label 40914 }) => label, 40915 icon: library_page, 40916 example: {}, 40917 edit: PageListItemEdit 40918 }; 40919 const page_list_item_init = () => initBlock({ 40920 name: page_list_item_name, 40921 metadata: page_list_item_metadata, 40922 settings: page_list_item_settings 40923 }); 40924 40925 ;// ./node_modules/@wordpress/icons/build-module/library/paragraph.js 40926 /** 40927 * WordPress dependencies 40928 */ 40929 40930 40931 const paragraph = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 40932 xmlns: "http://www.w3.org/2000/svg", 40933 viewBox: "0 0 24 24", 40934 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 40935 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" 40936 }) 40937 }); 40938 /* harmony default export */ const library_paragraph = (paragraph); 40939 40940 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js 40941 /** 40942 * External dependencies 40943 */ 40944 40945 40946 /** 40947 * WordPress dependencies 40948 */ 40949 40950 40951 40952 40953 const deprecated_supports = { 40954 className: false 40955 }; 40956 const paragraph_deprecated_blockAttributes = { 40957 align: { 40958 type: 'string' 40959 }, 40960 content: { 40961 type: 'string', 40962 source: 'html', 40963 selector: 'p', 40964 default: '' 40965 }, 40966 dropCap: { 40967 type: 'boolean', 40968 default: false 40969 }, 40970 placeholder: { 40971 type: 'string' 40972 }, 40973 textColor: { 40974 type: 'string' 40975 }, 40976 backgroundColor: { 40977 type: 'string' 40978 }, 40979 fontSize: { 40980 type: 'string' 40981 }, 40982 direction: { 40983 type: 'string', 40984 enum: ['ltr', 'rtl'] 40985 }, 40986 style: { 40987 type: 'object' 40988 } 40989 }; 40990 const migrateCustomColorsAndFontSizes = attributes => { 40991 if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) { 40992 return attributes; 40993 } 40994 const style = {}; 40995 if (attributes.customTextColor || attributes.customBackgroundColor) { 40996 style.color = {}; 40997 } 40998 if (attributes.customTextColor) { 40999 style.color.text = attributes.customTextColor; 41000 } 41001 if (attributes.customBackgroundColor) { 41002 style.color.background = attributes.customBackgroundColor; 41003 } 41004 if (attributes.customFontSize) { 41005 style.typography = { 41006 fontSize: attributes.customFontSize 41007 }; 41008 } 41009 const { 41010 customTextColor, 41011 customBackgroundColor, 41012 customFontSize, 41013 ...restAttributes 41014 } = attributes; 41015 return { 41016 ...restAttributes, 41017 style 41018 }; 41019 }; 41020 const { 41021 style, 41022 ...restBlockAttributes 41023 } = paragraph_deprecated_blockAttributes; 41024 const paragraph_deprecated_deprecated = [ 41025 // Version without drop cap on aligned text. 41026 { 41027 supports: deprecated_supports, 41028 attributes: { 41029 ...restBlockAttributes, 41030 customTextColor: { 41031 type: 'string' 41032 }, 41033 customBackgroundColor: { 41034 type: 'string' 41035 }, 41036 customFontSize: { 41037 type: 'number' 41038 } 41039 }, 41040 save({ 41041 attributes 41042 }) { 41043 const { 41044 align, 41045 content, 41046 dropCap, 41047 direction 41048 } = attributes; 41049 const className = dist_clsx({ 41050 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, 41051 [`has-text-align-$align}`]: align 41052 }); 41053 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 41054 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 41055 className, 41056 dir: direction 41057 }), 41058 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 41059 value: content 41060 }) 41061 }); 41062 } 41063 }, { 41064 supports: deprecated_supports, 41065 attributes: { 41066 ...restBlockAttributes, 41067 customTextColor: { 41068 type: 'string' 41069 }, 41070 customBackgroundColor: { 41071 type: 'string' 41072 }, 41073 customFontSize: { 41074 type: 'number' 41075 } 41076 }, 41077 migrate: migrateCustomColorsAndFontSizes, 41078 save({ 41079 attributes 41080 }) { 41081 const { 41082 align, 41083 content, 41084 dropCap, 41085 backgroundColor, 41086 textColor, 41087 customBackgroundColor, 41088 customTextColor, 41089 fontSize, 41090 customFontSize, 41091 direction 41092 } = attributes; 41093 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 41094 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 41095 const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); 41096 const className = dist_clsx({ 41097 'has-text-color': textColor || customTextColor, 41098 'has-background': backgroundColor || customBackgroundColor, 41099 'has-drop-cap': dropCap, 41100 [`has-text-align-$align}`]: align, 41101 [fontSizeClass]: fontSizeClass, 41102 [textClass]: textClass, 41103 [backgroundClass]: backgroundClass 41104 }); 41105 const styles = { 41106 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 41107 color: textClass ? undefined : customTextColor, 41108 fontSize: fontSizeClass ? undefined : customFontSize 41109 }; 41110 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 41111 tagName: "p", 41112 style: styles, 41113 className: className ? className : undefined, 41114 value: content, 41115 dir: direction 41116 }); 41117 } 41118 }, { 41119 supports: deprecated_supports, 41120 attributes: { 41121 ...restBlockAttributes, 41122 customTextColor: { 41123 type: 'string' 41124 }, 41125 customBackgroundColor: { 41126 type: 'string' 41127 }, 41128 customFontSize: { 41129 type: 'number' 41130 } 41131 }, 41132 migrate: migrateCustomColorsAndFontSizes, 41133 save({ 41134 attributes 41135 }) { 41136 const { 41137 align, 41138 content, 41139 dropCap, 41140 backgroundColor, 41141 textColor, 41142 customBackgroundColor, 41143 customTextColor, 41144 fontSize, 41145 customFontSize, 41146 direction 41147 } = attributes; 41148 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 41149 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 41150 const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); 41151 const className = dist_clsx({ 41152 'has-text-color': textColor || customTextColor, 41153 'has-background': backgroundColor || customBackgroundColor, 41154 'has-drop-cap': dropCap, 41155 [fontSizeClass]: fontSizeClass, 41156 [textClass]: textClass, 41157 [backgroundClass]: backgroundClass 41158 }); 41159 const styles = { 41160 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 41161 color: textClass ? undefined : customTextColor, 41162 fontSize: fontSizeClass ? undefined : customFontSize, 41163 textAlign: align 41164 }; 41165 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 41166 tagName: "p", 41167 style: styles, 41168 className: className ? className : undefined, 41169 value: content, 41170 dir: direction 41171 }); 41172 } 41173 }, { 41174 supports: deprecated_supports, 41175 attributes: { 41176 ...restBlockAttributes, 41177 customTextColor: { 41178 type: 'string' 41179 }, 41180 customBackgroundColor: { 41181 type: 'string' 41182 }, 41183 customFontSize: { 41184 type: 'number' 41185 }, 41186 width: { 41187 type: 'string' 41188 } 41189 }, 41190 migrate: migrateCustomColorsAndFontSizes, 41191 save({ 41192 attributes 41193 }) { 41194 const { 41195 width, 41196 align, 41197 content, 41198 dropCap, 41199 backgroundColor, 41200 textColor, 41201 customBackgroundColor, 41202 customTextColor, 41203 fontSize, 41204 customFontSize 41205 } = attributes; 41206 const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 41207 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 41208 const fontSizeClass = fontSize && `is-$fontSize}-text`; 41209 const className = dist_clsx({ 41210 [`align$width}`]: width, 41211 'has-background': backgroundColor || customBackgroundColor, 41212 'has-drop-cap': dropCap, 41213 [fontSizeClass]: fontSizeClass, 41214 [textClass]: textClass, 41215 [backgroundClass]: backgroundClass 41216 }); 41217 const styles = { 41218 backgroundColor: backgroundClass ? undefined : customBackgroundColor, 41219 color: textClass ? undefined : customTextColor, 41220 fontSize: fontSizeClass ? undefined : customFontSize, 41221 textAlign: align 41222 }; 41223 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 41224 tagName: "p", 41225 style: styles, 41226 className: className ? className : undefined, 41227 value: content 41228 }); 41229 } 41230 }, { 41231 supports: deprecated_supports, 41232 attributes: { 41233 ...restBlockAttributes, 41234 fontSize: { 41235 type: 'number' 41236 } 41237 }, 41238 save({ 41239 attributes 41240 }) { 41241 const { 41242 width, 41243 align, 41244 content, 41245 dropCap, 41246 backgroundColor, 41247 textColor, 41248 fontSize 41249 } = attributes; 41250 const className = dist_clsx({ 41251 [`align$width}`]: width, 41252 'has-background': backgroundColor, 41253 'has-drop-cap': dropCap 41254 }); 41255 const styles = { 41256 backgroundColor, 41257 color: textColor, 41258 fontSize, 41259 textAlign: align 41260 }; 41261 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 41262 style: styles, 41263 className: className ? className : undefined, 41264 children: content 41265 }); 41266 }, 41267 migrate(attributes) { 41268 return migrateCustomColorsAndFontSizes({ 41269 ...attributes, 41270 customFontSize: Number.isFinite(attributes.fontSize) ? attributes.fontSize : undefined, 41271 customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, 41272 customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined 41273 }); 41274 } 41275 }, { 41276 supports: deprecated_supports, 41277 attributes: { 41278 ...paragraph_deprecated_blockAttributes, 41279 content: { 41280 type: 'string', 41281 source: 'html', 41282 default: '' 41283 } 41284 }, 41285 save({ 41286 attributes 41287 }) { 41288 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 41289 children: attributes.content 41290 }); 41291 }, 41292 migrate(attributes) { 41293 return attributes; 41294 } 41295 }]; 41296 /* harmony default export */ const paragraph_deprecated = (paragraph_deprecated_deprecated); 41297 41298 ;// ./node_modules/@wordpress/icons/build-module/library/format-ltr.js 41299 /** 41300 * WordPress dependencies 41301 */ 41302 41303 41304 const formatLtr = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 41305 xmlns: "http://www.w3.org/2000/svg", 41306 viewBox: "-2 -2 24 24", 41307 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 41308 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" 41309 }) 41310 }); 41311 /* harmony default export */ const format_ltr = (formatLtr); 41312 41313 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/use-enter.js 41314 /** 41315 * WordPress dependencies 41316 */ 41317 41318 41319 41320 41321 41322 41323 function useOnEnter(props) { 41324 const { 41325 batch 41326 } = (0,external_wp_data_namespaceObject.useRegistry)(); 41327 const { 41328 moveBlocksToPosition, 41329 replaceInnerBlocks, 41330 duplicateBlocks, 41331 insertBlock 41332 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 41333 const { 41334 getBlockRootClientId, 41335 getBlockIndex, 41336 getBlockOrder, 41337 getBlockName, 41338 getBlock, 41339 getNextBlockClientId, 41340 canInsertBlockType 41341 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 41342 const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); 41343 propsRef.current = props; 41344 return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { 41345 function onKeyDown(event) { 41346 if (event.defaultPrevented) { 41347 return; 41348 } 41349 if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { 41350 return; 41351 } 41352 const { 41353 content, 41354 clientId 41355 } = propsRef.current; 41356 41357 // The paragraph should be empty. 41358 if (content.length) { 41359 return; 41360 } 41361 const wrapperClientId = getBlockRootClientId(clientId); 41362 if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) { 41363 return; 41364 } 41365 const order = getBlockOrder(wrapperClientId); 41366 const position = order.indexOf(clientId); 41367 41368 // If it is the last block, exit. 41369 if (position === order.length - 1) { 41370 let newWrapperClientId = wrapperClientId; 41371 while (!canInsertBlockType(getBlockName(clientId), getBlockRootClientId(newWrapperClientId))) { 41372 newWrapperClientId = getBlockRootClientId(newWrapperClientId); 41373 } 41374 if (typeof newWrapperClientId === 'string') { 41375 event.preventDefault(); 41376 moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(newWrapperClientId), getBlockIndex(newWrapperClientId) + 1); 41377 } 41378 return; 41379 } 41380 const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); 41381 if (!canInsertBlockType(defaultBlockName, getBlockRootClientId(wrapperClientId))) { 41382 return; 41383 } 41384 event.preventDefault(); 41385 41386 // If it is in the middle, split the block in two. 41387 const wrapperBlock = getBlock(wrapperClientId); 41388 batch(() => { 41389 duplicateBlocks([wrapperClientId]); 41390 const blockIndex = getBlockIndex(wrapperClientId); 41391 replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position)); 41392 replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1)); 41393 insertBlock((0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName), blockIndex + 1, getBlockRootClientId(wrapperClientId), true); 41394 }); 41395 } 41396 element.addEventListener('keydown', onKeyDown); 41397 return () => { 41398 element.removeEventListener('keydown', onKeyDown); 41399 }; 41400 }, []); 41401 } 41402 41403 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js 41404 /** 41405 * External dependencies 41406 */ 41407 41408 41409 /** 41410 * WordPress dependencies 41411 */ 41412 41413 41414 41415 41416 41417 /** 41418 * Internal dependencies 41419 */ 41420 41421 41422 function ParagraphRTLControl({ 41423 direction, 41424 setDirection 41425 }) { 41426 return (0,external_wp_i18n_namespaceObject.isRTL)() && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 41427 icon: format_ltr, 41428 title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'), 41429 isActive: direction === 'ltr', 41430 onClick: () => { 41431 setDirection(direction === 'ltr' ? undefined : 'ltr'); 41432 } 41433 }); 41434 } 41435 function hasDropCapDisabled(align) { 41436 return align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center'; 41437 } 41438 function DropCapControl({ 41439 clientId, 41440 attributes, 41441 setAttributes, 41442 name 41443 }) { 41444 // Please do not add a useSelect call to the paragraph block unconditionally. 41445 // Every useSelect added to a (frequently used) block will degrade load 41446 // and type performance. By moving it within InspectorControls, the subscription is 41447 // now only added for the selected block(s). 41448 const [isDropCapFeatureEnabled] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.dropCap'); 41449 if (!isDropCapFeatureEnabled) { 41450 return null; 41451 } 41452 const { 41453 align, 41454 dropCap 41455 } = attributes; 41456 let helpText; 41457 if (hasDropCapDisabled(align)) { 41458 helpText = (0,external_wp_i18n_namespaceObject.__)('Not available for aligned text.'); 41459 } else if (dropCap) { 41460 helpText = (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.'); 41461 } else { 41462 helpText = (0,external_wp_i18n_namespaceObject.__)('Show a large initial letter.'); 41463 } 41464 const isDropCapControlEnabledByDefault = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'typography.defaultControls.dropCap', false); 41465 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 41466 group: "typography", 41467 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 41468 hasValue: () => !!dropCap, 41469 label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), 41470 isShownByDefault: isDropCapControlEnabledByDefault, 41471 onDeselect: () => setAttributes({ 41472 dropCap: undefined 41473 }), 41474 resetAllFilter: () => ({ 41475 dropCap: undefined 41476 }), 41477 panelId: clientId, 41478 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 41479 __nextHasNoMarginBottom: true, 41480 label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), 41481 checked: !!dropCap, 41482 onChange: () => setAttributes({ 41483 dropCap: !dropCap 41484 }), 41485 help: helpText, 41486 disabled: hasDropCapDisabled(align) 41487 }) 41488 }) 41489 }); 41490 } 41491 function ParagraphBlock({ 41492 attributes, 41493 mergeBlocks, 41494 onReplace, 41495 onRemove, 41496 setAttributes, 41497 clientId, 41498 isSelected: isSingleSelected, 41499 name 41500 }) { 41501 const { 41502 align, 41503 content, 41504 direction, 41505 dropCap, 41506 placeholder 41507 } = attributes; 41508 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 41509 ref: useOnEnter({ 41510 clientId, 41511 content 41512 }), 41513 className: dist_clsx({ 41514 'has-drop-cap': hasDropCapDisabled(align) ? false : dropCap, 41515 [`has-text-align-$align}`]: align 41516 }), 41517 style: { 41518 direction 41519 } 41520 }); 41521 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 41522 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 41523 children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 41524 group: "block", 41525 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 41526 value: align, 41527 onChange: newAlign => setAttributes({ 41528 align: newAlign, 41529 dropCap: hasDropCapDisabled(newAlign) ? false : dropCap 41530 }) 41531 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ParagraphRTLControl, { 41532 direction: direction, 41533 setDirection: newDirection => setAttributes({ 41534 direction: newDirection 41535 }) 41536 })] 41537 }), isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropCapControl, { 41538 name: name, 41539 clientId: clientId, 41540 attributes: attributes, 41541 setAttributes: setAttributes 41542 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 41543 identifier: "content", 41544 tagName: "p", 41545 ...blockProps, 41546 value: content, 41547 onChange: newContent => setAttributes({ 41548 content: newContent 41549 }), 41550 onMerge: mergeBlocks, 41551 onReplace: onReplace, 41552 onRemove: onRemove, 41553 "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'), 41554 "data-empty": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content), 41555 placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'), 41556 "data-custom-placeholder": placeholder ? true : undefined, 41557 __unstableEmbedURLOnPaste: true, 41558 __unstableAllowPrefixTransformations: true 41559 })] 41560 }); 41561 } 41562 /* harmony default export */ const paragraph_edit = (ParagraphBlock); 41563 41564 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/save.js 41565 /** 41566 * External dependencies 41567 */ 41568 41569 41570 /** 41571 * WordPress dependencies 41572 */ 41573 41574 41575 41576 function paragraph_save_save({ 41577 attributes 41578 }) { 41579 const { 41580 align, 41581 content, 41582 dropCap, 41583 direction 41584 } = attributes; 41585 const className = dist_clsx({ 41586 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, 41587 [`has-text-align-$align}`]: align 41588 }); 41589 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 41590 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 41591 className, 41592 dir: direction 41593 }), 41594 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 41595 value: content 41596 }) 41597 }); 41598 } 41599 41600 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js 41601 /** 41602 * WordPress dependencies 41603 */ 41604 41605 41606 /** 41607 * Internal dependencies 41608 */ 41609 const { 41610 name: transforms_name 41611 } = { 41612 $schema: "https://schemas.wp.org/trunk/block.json", 41613 apiVersion: 3, 41614 name: "core/paragraph", 41615 title: "Paragraph", 41616 category: "text", 41617 description: "Start with the basic building block of all narrative.", 41618 keywords: ["text"], 41619 textdomain: "default", 41620 attributes: { 41621 align: { 41622 type: "string" 41623 }, 41624 content: { 41625 type: "rich-text", 41626 source: "rich-text", 41627 selector: "p", 41628 role: "content" 41629 }, 41630 dropCap: { 41631 type: "boolean", 41632 "default": false 41633 }, 41634 placeholder: { 41635 type: "string" 41636 }, 41637 direction: { 41638 type: "string", 41639 "enum": ["ltr", "rtl"] 41640 } 41641 }, 41642 supports: { 41643 splitting: true, 41644 anchor: true, 41645 className: false, 41646 __experimentalBorder: { 41647 color: true, 41648 radius: true, 41649 style: true, 41650 width: true 41651 }, 41652 color: { 41653 gradients: true, 41654 link: true, 41655 __experimentalDefaultControls: { 41656 background: true, 41657 text: true 41658 } 41659 }, 41660 spacing: { 41661 margin: true, 41662 padding: true, 41663 __experimentalDefaultControls: { 41664 margin: false, 41665 padding: false 41666 } 41667 }, 41668 typography: { 41669 fontSize: true, 41670 lineHeight: true, 41671 __experimentalFontFamily: true, 41672 __experimentalTextDecoration: true, 41673 __experimentalFontStyle: true, 41674 __experimentalFontWeight: true, 41675 __experimentalLetterSpacing: true, 41676 __experimentalTextTransform: true, 41677 __experimentalWritingMode: true, 41678 __experimentalDefaultControls: { 41679 fontSize: true 41680 } 41681 }, 41682 __experimentalSelector: "p", 41683 __unstablePasteTextInline: true, 41684 interactivity: { 41685 clientNavigation: true 41686 } 41687 }, 41688 editorStyle: "wp-block-paragraph-editor", 41689 style: "wp-block-paragraph" 41690 }; 41691 const paragraph_transforms_transforms = { 41692 from: [{ 41693 type: 'raw', 41694 // Paragraph is a fallback and should be matched last. 41695 priority: 20, 41696 selector: 'p', 41697 schema: ({ 41698 phrasingContentSchema, 41699 isPaste 41700 }) => ({ 41701 p: { 41702 children: phrasingContentSchema, 41703 attributes: isPaste ? [] : ['style', 'id'] 41704 } 41705 }), 41706 transform(node) { 41707 const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(transforms_name, node.outerHTML); 41708 const { 41709 textAlign 41710 } = node.style || {}; 41711 if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { 41712 attributes.align = textAlign; 41713 } 41714 return (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, attributes); 41715 } 41716 }] 41717 }; 41718 /* harmony default export */ const paragraph_transforms = (paragraph_transforms_transforms); 41719 41720 ;// ./node_modules/@wordpress/block-library/build-module/paragraph/index.js 41721 /** 41722 * WordPress dependencies 41723 */ 41724 41725 41726 41727 /** 41728 * Internal dependencies 41729 */ 41730 41731 41732 41733 const paragraph_metadata = { 41734 $schema: "https://schemas.wp.org/trunk/block.json", 41735 apiVersion: 3, 41736 name: "core/paragraph", 41737 title: "Paragraph", 41738 category: "text", 41739 description: "Start with the basic building block of all narrative.", 41740 keywords: ["text"], 41741 textdomain: "default", 41742 attributes: { 41743 align: { 41744 type: "string" 41745 }, 41746 content: { 41747 type: "rich-text", 41748 source: "rich-text", 41749 selector: "p", 41750 role: "content" 41751 }, 41752 dropCap: { 41753 type: "boolean", 41754 "default": false 41755 }, 41756 placeholder: { 41757 type: "string" 41758 }, 41759 direction: { 41760 type: "string", 41761 "enum": ["ltr", "rtl"] 41762 } 41763 }, 41764 supports: { 41765 splitting: true, 41766 anchor: true, 41767 className: false, 41768 __experimentalBorder: { 41769 color: true, 41770 radius: true, 41771 style: true, 41772 width: true 41773 }, 41774 color: { 41775 gradients: true, 41776 link: true, 41777 __experimentalDefaultControls: { 41778 background: true, 41779 text: true 41780 } 41781 }, 41782 spacing: { 41783 margin: true, 41784 padding: true, 41785 __experimentalDefaultControls: { 41786 margin: false, 41787 padding: false 41788 } 41789 }, 41790 typography: { 41791 fontSize: true, 41792 lineHeight: true, 41793 __experimentalFontFamily: true, 41794 __experimentalTextDecoration: true, 41795 __experimentalFontStyle: true, 41796 __experimentalFontWeight: true, 41797 __experimentalLetterSpacing: true, 41798 __experimentalTextTransform: true, 41799 __experimentalWritingMode: true, 41800 __experimentalDefaultControls: { 41801 fontSize: true 41802 } 41803 }, 41804 __experimentalSelector: "p", 41805 __unstablePasteTextInline: true, 41806 interactivity: { 41807 clientNavigation: true 41808 } 41809 }, 41810 editorStyle: "wp-block-paragraph-editor", 41811 style: "wp-block-paragraph" 41812 }; 41813 41814 41815 const { 41816 name: paragraph_name 41817 } = paragraph_metadata; 41818 41819 const paragraph_settings = { 41820 icon: library_paragraph, 41821 example: { 41822 attributes: { 41823 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.') 41824 } 41825 }, 41826 __experimentalLabel(attributes, { 41827 context 41828 }) { 41829 const customName = attributes?.metadata?.name; 41830 if (context === 'list-view' && customName) { 41831 return customName; 41832 } 41833 if (context === 'accessibility') { 41834 if (customName) { 41835 return customName; 41836 } 41837 const { 41838 content 41839 } = attributes; 41840 return !content || content.length === 0 ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content; 41841 } 41842 }, 41843 transforms: paragraph_transforms, 41844 deprecated: paragraph_deprecated, 41845 merge(attributes, attributesToMerge) { 41846 return { 41847 content: (attributes.content || '') + (attributesToMerge.content || '') 41848 }; 41849 }, 41850 edit: paragraph_edit, 41851 save: paragraph_save_save 41852 }; 41853 const paragraph_init = () => initBlock({ 41854 name: paragraph_name, 41855 metadata: paragraph_metadata, 41856 settings: paragraph_settings 41857 }); 41858 41859 ;// ./node_modules/@wordpress/icons/build-module/library/post-author.js 41860 /** 41861 * WordPress dependencies 41862 */ 41863 41864 41865 const postAuthor = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 41866 viewBox: "0 0 24 24", 41867 xmlns: "http://www.w3.org/2000/svg", 41868 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 41869 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", 41870 fillRule: "evenodd", 41871 clipRule: "evenodd" 41872 }) 41873 }); 41874 /* harmony default export */ const post_author = (postAuthor); 41875 41876 ;// ./node_modules/@wordpress/block-library/build-module/post-author/edit.js 41877 /* wp:polyfill */ 41878 /** 41879 * External dependencies 41880 */ 41881 41882 41883 /** 41884 * WordPress dependencies 41885 */ 41886 41887 41888 41889 41890 41891 41892 const minimumUsersForCombobox = 25; 41893 const edit_AUTHORS_QUERY = { 41894 who: 'authors', 41895 per_page: 100 41896 }; 41897 function PostAuthorEdit({ 41898 isSelected, 41899 context: { 41900 postType, 41901 postId, 41902 queryId 41903 }, 41904 attributes, 41905 setAttributes 41906 }) { 41907 const isDescendentOfQueryLoop = Number.isFinite(queryId); 41908 const { 41909 authorId, 41910 authorDetails, 41911 authors, 41912 supportsAuthor 41913 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 41914 var _getPostType$supports; 41915 const { 41916 getEditedEntityRecord, 41917 getUser, 41918 getUsers, 41919 getPostType 41920 } = select(external_wp_coreData_namespaceObject.store); 41921 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 41922 return { 41923 authorId: _authorId, 41924 authorDetails: _authorId ? getUser(_authorId) : null, 41925 authors: getUsers(edit_AUTHORS_QUERY), 41926 supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false 41927 }; 41928 }, [postType, postId]); 41929 const { 41930 editEntityRecord 41931 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 41932 const { 41933 textAlign, 41934 showAvatar, 41935 showBio, 41936 byline, 41937 isLink, 41938 linkTarget 41939 } = attributes; 41940 const avatarSizes = []; 41941 const authorName = authorDetails?.name || (0,external_wp_i18n_namespaceObject.__)('Post Author'); 41942 if (authorDetails?.avatar_urls) { 41943 Object.keys(authorDetails.avatar_urls).forEach(size => { 41944 avatarSizes.push({ 41945 value: size, 41946 label: `$size} x $size}` 41947 }); 41948 }); 41949 } 41950 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 41951 className: dist_clsx({ 41952 [`has-text-align-$textAlign}`]: textAlign 41953 }) 41954 }); 41955 const authorOptions = authors?.length ? authors.map(({ 41956 id, 41957 name 41958 }) => { 41959 return { 41960 value: id, 41961 label: name 41962 }; 41963 }) : []; 41964 const handleSelect = nextAuthorId => { 41965 editEntityRecord('postType', postType, postId, { 41966 author: nextAuthorId 41967 }); 41968 }; 41969 const showCombobox = authorOptions.length >= minimumUsersForCombobox; 41970 const showAuthorControl = !!postId && !isDescendentOfQueryLoop && authorOptions.length > 0; 41971 if (!supportsAuthor) { 41972 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 41973 ...blockProps, 41974 children: (0,external_wp_i18n_namespaceObject.sprintf)( 41975 // translators: %s: Name of the post type e.g: "post". 41976 (0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType) 41977 }); 41978 } 41979 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 41980 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 41981 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 41982 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 41983 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 41984 spacing: 4, 41985 className: "wp-block-post-author__inspector-settings", 41986 children: [showAuthorControl && (showCombobox && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { 41987 __next40pxDefaultSize: true, 41988 __nextHasNoMarginBottom: true, 41989 label: (0,external_wp_i18n_namespaceObject.__)('Author'), 41990 options: authorOptions, 41991 value: authorId, 41992 onChange: handleSelect, 41993 allowReset: false 41994 }) || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 41995 __next40pxDefaultSize: true, 41996 __nextHasNoMarginBottom: true, 41997 label: (0,external_wp_i18n_namespaceObject.__)('Author'), 41998 value: authorId, 41999 options: authorOptions, 42000 onChange: handleSelect 42001 })), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42002 __nextHasNoMarginBottom: true, 42003 label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'), 42004 checked: showAvatar, 42005 onChange: () => setAttributes({ 42006 showAvatar: !showAvatar 42007 }) 42008 }), showAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 42009 __next40pxDefaultSize: true, 42010 __nextHasNoMarginBottom: true, 42011 label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'), 42012 value: attributes.avatarSize, 42013 options: avatarSizes, 42014 onChange: size => { 42015 setAttributes({ 42016 avatarSize: Number(size) 42017 }); 42018 } 42019 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42020 __nextHasNoMarginBottom: true, 42021 label: (0,external_wp_i18n_namespaceObject.__)('Show bio'), 42022 checked: showBio, 42023 onChange: () => setAttributes({ 42024 showBio: !showBio 42025 }) 42026 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42027 __nextHasNoMarginBottom: true, 42028 label: (0,external_wp_i18n_namespaceObject.__)('Link author name to author page'), 42029 checked: isLink, 42030 onChange: () => setAttributes({ 42031 isLink: !isLink 42032 }) 42033 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42034 __nextHasNoMarginBottom: true, 42035 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 42036 onChange: value => setAttributes({ 42037 linkTarget: value ? '_blank' : '_self' 42038 }), 42039 checked: linkTarget === '_blank' 42040 })] 42041 }) 42042 }) 42043 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 42044 group: "block", 42045 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 42046 value: textAlign, 42047 onChange: nextAlign => { 42048 setAttributes({ 42049 textAlign: nextAlign 42050 }); 42051 } 42052 }) 42053 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 42054 ...blockProps, 42055 children: [showAvatar && authorDetails?.avatar_urls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42056 className: "wp-block-post-author__avatar", 42057 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 42058 width: attributes.avatarSize, 42059 src: authorDetails.avatar_urls[attributes.avatarSize], 42060 alt: authorDetails.name 42061 }) 42062 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 42063 className: "wp-block-post-author__content", 42064 children: [(!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 42065 identifier: "byline", 42066 className: "wp-block-post-author__byline", 42067 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'), 42068 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'), 42069 value: byline, 42070 onChange: value => setAttributes({ 42071 byline: value 42072 }) 42073 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 42074 className: "wp-block-post-author__name", 42075 children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 42076 href: "#post-author-pseudo-link", 42077 onClick: event => event.preventDefault(), 42078 children: authorName 42079 }) : authorName 42080 }), showBio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 42081 className: "wp-block-post-author__bio", 42082 dangerouslySetInnerHTML: { 42083 __html: authorDetails?.description 42084 } 42085 })] 42086 })] 42087 })] 42088 }); 42089 } 42090 /* harmony default export */ const post_author_edit = (PostAuthorEdit); 42091 42092 ;// ./node_modules/@wordpress/block-library/build-module/post-author/index.js 42093 /** 42094 * WordPress dependencies 42095 */ 42096 42097 42098 42099 /** 42100 * Internal dependencies 42101 */ 42102 42103 const post_author_metadata = { 42104 $schema: "https://schemas.wp.org/trunk/block.json", 42105 apiVersion: 3, 42106 name: "core/post-author", 42107 title: "Author", 42108 category: "theme", 42109 description: "Display post author details such as name, avatar, and bio.", 42110 textdomain: "default", 42111 attributes: { 42112 textAlign: { 42113 type: "string" 42114 }, 42115 avatarSize: { 42116 type: "number", 42117 "default": 48 42118 }, 42119 showAvatar: { 42120 type: "boolean", 42121 "default": true 42122 }, 42123 showBio: { 42124 type: "boolean" 42125 }, 42126 byline: { 42127 type: "string" 42128 }, 42129 isLink: { 42130 type: "boolean", 42131 "default": false, 42132 role: "content" 42133 }, 42134 linkTarget: { 42135 type: "string", 42136 "default": "_self", 42137 role: "content" 42138 } 42139 }, 42140 usesContext: ["postType", "postId", "queryId"], 42141 supports: { 42142 html: false, 42143 spacing: { 42144 margin: true, 42145 padding: true 42146 }, 42147 typography: { 42148 fontSize: true, 42149 lineHeight: true, 42150 __experimentalFontFamily: true, 42151 __experimentalFontWeight: true, 42152 __experimentalFontStyle: true, 42153 __experimentalTextTransform: true, 42154 __experimentalTextDecoration: true, 42155 __experimentalLetterSpacing: true, 42156 __experimentalDefaultControls: { 42157 fontSize: true 42158 } 42159 }, 42160 color: { 42161 gradients: true, 42162 link: true, 42163 __experimentalDuotone: ".wp-block-post-author__avatar img", 42164 __experimentalDefaultControls: { 42165 background: true, 42166 text: true 42167 } 42168 }, 42169 interactivity: { 42170 clientNavigation: true 42171 }, 42172 __experimentalBorder: { 42173 radius: true, 42174 color: true, 42175 width: true, 42176 style: true, 42177 __experimentalDefaultControls: { 42178 radius: true, 42179 color: true, 42180 width: true, 42181 style: true 42182 } 42183 } 42184 }, 42185 editorStyle: "wp-block-post-author-editor", 42186 style: "wp-block-post-author" 42187 }; 42188 42189 const { 42190 name: post_author_name 42191 } = post_author_metadata; 42192 42193 const post_author_settings = { 42194 icon: post_author, 42195 example: { 42196 viewportWidth: 350, 42197 attributes: { 42198 showBio: true, 42199 byline: (0,external_wp_i18n_namespaceObject.__)('Posted by') 42200 } 42201 }, 42202 edit: post_author_edit 42203 }; 42204 const post_author_init = () => initBlock({ 42205 name: post_author_name, 42206 metadata: post_author_metadata, 42207 settings: post_author_settings 42208 }); 42209 42210 ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/edit.js 42211 /** 42212 * External dependencies 42213 */ 42214 42215 42216 /** 42217 * WordPress dependencies 42218 */ 42219 42220 42221 42222 42223 42224 42225 /** 42226 * Internal dependencies 42227 */ 42228 42229 42230 function PostAuthorNameEdit({ 42231 context: { 42232 postType, 42233 postId 42234 }, 42235 attributes: { 42236 textAlign, 42237 isLink, 42238 linkTarget 42239 }, 42240 setAttributes 42241 }) { 42242 const { 42243 authorName, 42244 supportsAuthor 42245 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 42246 var _getPostType$supports; 42247 const { 42248 getEditedEntityRecord, 42249 getUser, 42250 getPostType 42251 } = select(external_wp_coreData_namespaceObject.store); 42252 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 42253 return { 42254 authorName: _authorId ? getUser(_authorId) : null, 42255 supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false 42256 }; 42257 }, [postType, postId]); 42258 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42259 className: dist_clsx({ 42260 [`has-text-align-$textAlign}`]: textAlign 42261 }) 42262 }); 42263 const displayName = authorName?.name || (0,external_wp_i18n_namespaceObject.__)('Author Name'); 42264 const displayAuthor = isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 42265 href: "#author-pseudo-link", 42266 onClick: event => event.preventDefault(), 42267 className: "wp-block-post-author-name__link", 42268 children: displayName 42269 }) : displayName; 42270 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 42271 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 42272 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 42273 group: "block", 42274 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 42275 value: textAlign, 42276 onChange: nextAlign => { 42277 setAttributes({ 42278 textAlign: nextAlign 42279 }); 42280 } 42281 }) 42282 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 42283 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 42284 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 42285 resetAll: () => { 42286 setAttributes({ 42287 isLink: false, 42288 linkTarget: '_self' 42289 }); 42290 }, 42291 dropdownMenuProps: dropdownMenuProps, 42292 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 42293 label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'), 42294 isShownByDefault: true, 42295 hasValue: () => isLink, 42296 onDeselect: () => setAttributes({ 42297 isLink: false 42298 }), 42299 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42300 __nextHasNoMarginBottom: true, 42301 label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'), 42302 onChange: () => setAttributes({ 42303 isLink: !isLink 42304 }), 42305 checked: isLink 42306 }) 42307 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 42308 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 42309 isShownByDefault: true, 42310 hasValue: () => linkTarget !== '_self', 42311 onDeselect: () => setAttributes({ 42312 linkTarget: '_self' 42313 }), 42314 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 42315 __nextHasNoMarginBottom: true, 42316 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 42317 onChange: value => setAttributes({ 42318 linkTarget: value ? '_blank' : '_self' 42319 }), 42320 checked: linkTarget === '_blank' 42321 }) 42322 })] 42323 }) 42324 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42325 ...blockProps, 42326 children: supportsAuthor ? displayAuthor : (0,external_wp_i18n_namespaceObject.sprintf)( 42327 // translators: %s: Name of the post type e.g: "post". 42328 (0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType) 42329 })] 42330 }); 42331 } 42332 /* harmony default export */ const post_author_name_edit = (PostAuthorNameEdit); 42333 42334 ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/transforms.js 42335 /** 42336 * WordPress dependencies 42337 */ 42338 42339 const post_author_name_transforms_transforms = { 42340 from: [{ 42341 type: 'block', 42342 blocks: ['core/post-author'], 42343 transform: ({ 42344 textAlign 42345 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author-name', { 42346 textAlign 42347 }) 42348 }], 42349 to: [{ 42350 type: 'block', 42351 blocks: ['core/post-author'], 42352 transform: ({ 42353 textAlign 42354 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author', { 42355 textAlign 42356 }) 42357 }] 42358 }; 42359 /* harmony default export */ const post_author_name_transforms = (post_author_name_transforms_transforms); 42360 42361 ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js 42362 /** 42363 * WordPress dependencies 42364 */ 42365 42366 42367 /** 42368 * Internal dependencies 42369 */ 42370 42371 const post_author_name_metadata = { 42372 $schema: "https://schemas.wp.org/trunk/block.json", 42373 apiVersion: 3, 42374 name: "core/post-author-name", 42375 title: "Author Name", 42376 category: "theme", 42377 description: "The author name.", 42378 textdomain: "default", 42379 attributes: { 42380 textAlign: { 42381 type: "string" 42382 }, 42383 isLink: { 42384 type: "boolean", 42385 "default": false, 42386 role: "content" 42387 }, 42388 linkTarget: { 42389 type: "string", 42390 "default": "_self", 42391 role: "content" 42392 } 42393 }, 42394 usesContext: ["postType", "postId"], 42395 example: { 42396 viewportWidth: 350 42397 }, 42398 supports: { 42399 html: false, 42400 spacing: { 42401 margin: true, 42402 padding: true 42403 }, 42404 color: { 42405 gradients: true, 42406 link: true, 42407 __experimentalDefaultControls: { 42408 background: true, 42409 text: true, 42410 link: true 42411 } 42412 }, 42413 typography: { 42414 fontSize: true, 42415 lineHeight: true, 42416 __experimentalFontFamily: true, 42417 __experimentalFontWeight: true, 42418 __experimentalFontStyle: true, 42419 __experimentalTextTransform: true, 42420 __experimentalTextDecoration: true, 42421 __experimentalLetterSpacing: true, 42422 __experimentalDefaultControls: { 42423 fontSize: true 42424 } 42425 }, 42426 interactivity: { 42427 clientNavigation: true 42428 }, 42429 __experimentalBorder: { 42430 radius: true, 42431 color: true, 42432 width: true, 42433 style: true, 42434 __experimentalDefaultControls: { 42435 radius: true, 42436 color: true, 42437 width: true, 42438 style: true 42439 } 42440 } 42441 }, 42442 style: "wp-block-post-author-name" 42443 }; 42444 42445 42446 const { 42447 name: post_author_name_name 42448 } = post_author_name_metadata; 42449 42450 const post_author_name_settings = { 42451 icon: post_author, 42452 transforms: post_author_name_transforms, 42453 edit: post_author_name_edit 42454 }; 42455 const post_author_name_init = () => initBlock({ 42456 name: post_author_name_name, 42457 metadata: post_author_name_metadata, 42458 settings: post_author_name_settings 42459 }); 42460 42461 ;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js 42462 /** 42463 * External dependencies 42464 */ 42465 42466 42467 /** 42468 * WordPress dependencies 42469 */ 42470 42471 42472 42473 42474 42475 function PostAuthorBiographyEdit({ 42476 context: { 42477 postType, 42478 postId 42479 }, 42480 attributes: { 42481 textAlign 42482 }, 42483 setAttributes 42484 }) { 42485 const { 42486 authorDetails 42487 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 42488 const { 42489 getEditedEntityRecord, 42490 getUser 42491 } = select(external_wp_coreData_namespaceObject.store); 42492 const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; 42493 return { 42494 authorDetails: _authorId ? getUser(_authorId) : null 42495 }; 42496 }, [postType, postId]); 42497 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42498 className: dist_clsx({ 42499 [`has-text-align-$textAlign}`]: textAlign 42500 }) 42501 }); 42502 const displayAuthorBiography = authorDetails?.description || (0,external_wp_i18n_namespaceObject.__)('Author Biography'); 42503 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 42504 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 42505 group: "block", 42506 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 42507 value: textAlign, 42508 onChange: nextAlign => { 42509 setAttributes({ 42510 textAlign: nextAlign 42511 }); 42512 } 42513 }) 42514 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42515 ...blockProps, 42516 dangerouslySetInnerHTML: { 42517 __html: displayAuthorBiography 42518 } 42519 })] 42520 }); 42521 } 42522 /* harmony default export */ const post_author_biography_edit = (PostAuthorBiographyEdit); 42523 42524 ;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js 42525 /** 42526 * WordPress dependencies 42527 */ 42528 42529 42530 /** 42531 * Internal dependencies 42532 */ 42533 42534 const post_author_biography_metadata = { 42535 $schema: "https://schemas.wp.org/trunk/block.json", 42536 apiVersion: 3, 42537 name: "core/post-author-biography", 42538 title: "Author Biography", 42539 category: "theme", 42540 description: "The author biography.", 42541 textdomain: "default", 42542 attributes: { 42543 textAlign: { 42544 type: "string" 42545 } 42546 }, 42547 usesContext: ["postType", "postId"], 42548 example: { 42549 viewportWidth: 350 42550 }, 42551 supports: { 42552 spacing: { 42553 margin: true, 42554 padding: true 42555 }, 42556 color: { 42557 gradients: true, 42558 link: true, 42559 __experimentalDefaultControls: { 42560 background: true, 42561 text: true 42562 } 42563 }, 42564 typography: { 42565 fontSize: true, 42566 lineHeight: true, 42567 __experimentalFontFamily: true, 42568 __experimentalFontWeight: true, 42569 __experimentalFontStyle: true, 42570 __experimentalTextTransform: true, 42571 __experimentalTextDecoration: true, 42572 __experimentalLetterSpacing: true, 42573 __experimentalDefaultControls: { 42574 fontSize: true 42575 } 42576 }, 42577 interactivity: { 42578 clientNavigation: true 42579 }, 42580 __experimentalBorder: { 42581 radius: true, 42582 color: true, 42583 width: true, 42584 style: true, 42585 __experimentalDefaultControls: { 42586 radius: true, 42587 color: true, 42588 width: true, 42589 style: true 42590 } 42591 } 42592 }, 42593 style: "wp-block-post-author-biography" 42594 }; 42595 42596 const { 42597 name: post_author_biography_name 42598 } = post_author_biography_metadata; 42599 42600 const post_author_biography_settings = { 42601 icon: post_author, 42602 edit: post_author_biography_edit 42603 }; 42604 const post_author_biography_init = () => initBlock({ 42605 name: post_author_biography_name, 42606 metadata: post_author_biography_metadata, 42607 settings: post_author_biography_settings 42608 }); 42609 42610 ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js 42611 /** 42612 * WordPress dependencies 42613 */ 42614 42615 42616 const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 42617 xmlns: "http://www.w3.org/2000/svg", 42618 viewBox: "0 0 24 24", 42619 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 42620 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" 42621 }) 42622 }); 42623 /* harmony default export */ const block_default = (blockDefault); 42624 42625 ;// ./node_modules/@wordpress/block-library/build-module/post-comment/edit.js 42626 /** 42627 * WordPress dependencies 42628 */ 42629 42630 42631 42632 42633 42634 42635 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']]; 42636 function post_comment_edit_Edit({ 42637 attributes: { 42638 commentId 42639 }, 42640 setAttributes 42641 }) { 42642 const [commentIdInput, setCommentIdInput] = (0,external_wp_element_namespaceObject.useState)(commentId); 42643 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 42644 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 42645 template: post_comment_edit_TEMPLATE 42646 }); 42647 if (!commentId) { 42648 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42649 ...blockProps, 42650 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 42651 icon: block_default, 42652 label: (0,external_wp_i18n_namespaceObject._x)('Post Comment', 'block title'), 42653 instructions: (0,external_wp_i18n_namespaceObject.__)('To show a comment, input the comment ID.'), 42654 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 42655 __next40pxDefaultSize: true, 42656 __nextHasNoMarginBottom: true, 42657 value: commentId, 42658 onChange: val => setCommentIdInput(parseInt(val)) 42659 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 42660 __next40pxDefaultSize: true, 42661 variant: "primary", 42662 onClick: () => { 42663 setAttributes({ 42664 commentId: commentIdInput 42665 }); 42666 }, 42667 children: (0,external_wp_i18n_namespaceObject.__)('Save') 42668 })] 42669 }) 42670 }); 42671 } 42672 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42673 ...innerBlocksProps 42674 }); 42675 } 42676 42677 ;// ./node_modules/@wordpress/block-library/build-module/post-comment/save.js 42678 /** 42679 * WordPress dependencies 42680 */ 42681 42682 42683 function post_comment_save_save() { 42684 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 42685 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 42686 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42687 ...innerBlocksProps 42688 }); 42689 } 42690 42691 ;// ./node_modules/@wordpress/block-library/build-module/post-comment/index.js 42692 /** 42693 * WordPress dependencies 42694 */ 42695 42696 42697 /** 42698 * Internal dependencies 42699 */ 42700 42701 const post_comment_metadata = { 42702 $schema: "https://schemas.wp.org/trunk/block.json", 42703 apiVersion: 3, 42704 __experimental: "fse", 42705 name: "core/post-comment", 42706 title: "Comment (deprecated)", 42707 category: "theme", 42708 allowedBlocks: ["core/avatar", "core/comment-author-name", "core/comment-content", "core/comment-date", "core/comment-edit-link", "core/comment-reply-link"], 42709 description: "This block is deprecated. Please use the Comments block instead.", 42710 textdomain: "default", 42711 attributes: { 42712 commentId: { 42713 type: "number" 42714 } 42715 }, 42716 providesContext: { 42717 commentId: "commentId" 42718 }, 42719 supports: { 42720 html: false, 42721 inserter: false, 42722 interactivity: { 42723 clientNavigation: true 42724 } 42725 } 42726 }; 42727 42728 42729 const { 42730 name: post_comment_name 42731 } = post_comment_metadata; 42732 42733 const post_comment_settings = { 42734 icon: library_comment, 42735 edit: post_comment_edit_Edit, 42736 save: post_comment_save_save 42737 }; 42738 const post_comment_init = () => initBlock({ 42739 name: post_comment_name, 42740 metadata: post_comment_metadata, 42741 settings: post_comment_settings 42742 }); 42743 42744 ;// ./node_modules/@wordpress/icons/build-module/library/post-comments-count.js 42745 /** 42746 * WordPress dependencies 42747 */ 42748 42749 42750 const postCommentsCount = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 42751 xmlns: "http://www.w3.org/2000/svg", 42752 viewBox: "0 0 24 24", 42753 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 42754 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" 42755 }) 42756 }); 42757 /* harmony default export */ const post_comments_count = (postCommentsCount); 42758 42759 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/edit.js 42760 /** 42761 * External dependencies 42762 */ 42763 42764 42765 /** 42766 * WordPress dependencies 42767 */ 42768 42769 42770 42771 42772 42773 42774 function PostCommentsCountEdit({ 42775 attributes, 42776 context, 42777 setAttributes 42778 }) { 42779 const { 42780 textAlign 42781 } = attributes; 42782 const { 42783 postId 42784 } = context; 42785 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 42786 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42787 className: dist_clsx({ 42788 [`has-text-align-$textAlign}`]: textAlign 42789 }) 42790 }); 42791 (0,external_wp_element_namespaceObject.useEffect)(() => { 42792 if (!postId) { 42793 return; 42794 } 42795 const currentPostId = postId; 42796 external_wp_apiFetch_default()({ 42797 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 42798 post: postId 42799 }), 42800 parse: false 42801 }).then(res => { 42802 // Stale requests will have the `currentPostId` of an older closure. 42803 if (currentPostId === postId) { 42804 setCommentsCount(res.headers.get('X-WP-Total')); 42805 } 42806 }); 42807 }, [postId]); 42808 const hasPostAndComments = postId && commentsCount !== undefined; 42809 const blockStyles = { 42810 ...blockProps.style, 42811 textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : undefined 42812 }; 42813 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 42814 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 42815 group: "block", 42816 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 42817 value: textAlign, 42818 onChange: nextAlign => { 42819 setAttributes({ 42820 textAlign: nextAlign 42821 }); 42822 } 42823 }) 42824 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 42825 ...blockProps, 42826 style: blockStyles, 42827 children: hasPostAndComments ? commentsCount : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 42828 children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Count block: post not found.') 42829 }) 42830 })] 42831 }); 42832 } 42833 42834 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js 42835 /** 42836 * WordPress dependencies 42837 */ 42838 42839 42840 /** 42841 * Internal dependencies 42842 */ 42843 42844 const post_comments_count_metadata = { 42845 $schema: "https://schemas.wp.org/trunk/block.json", 42846 apiVersion: 3, 42847 __experimental: "fse", 42848 name: "core/post-comments-count", 42849 title: "Comments Count", 42850 category: "theme", 42851 description: "Display a post's comments count.", 42852 textdomain: "default", 42853 attributes: { 42854 textAlign: { 42855 type: "string" 42856 } 42857 }, 42858 usesContext: ["postId"], 42859 supports: { 42860 html: false, 42861 color: { 42862 gradients: true, 42863 __experimentalDefaultControls: { 42864 background: true, 42865 text: true 42866 } 42867 }, 42868 spacing: { 42869 margin: true, 42870 padding: true 42871 }, 42872 typography: { 42873 fontSize: true, 42874 lineHeight: true, 42875 __experimentalFontFamily: true, 42876 __experimentalFontWeight: true, 42877 __experimentalFontStyle: true, 42878 __experimentalTextTransform: true, 42879 __experimentalTextDecoration: true, 42880 __experimentalLetterSpacing: true, 42881 __experimentalDefaultControls: { 42882 fontSize: true 42883 } 42884 }, 42885 interactivity: { 42886 clientNavigation: true 42887 } 42888 } 42889 }; 42890 42891 const { 42892 name: post_comments_count_name 42893 } = post_comments_count_metadata; 42894 42895 const post_comments_count_settings = { 42896 icon: post_comments_count, 42897 edit: PostCommentsCountEdit 42898 }; 42899 const post_comments_count_init = () => initBlock({ 42900 name: post_comments_count_name, 42901 metadata: post_comments_count_metadata, 42902 settings: post_comments_count_settings 42903 }); 42904 42905 ;// ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js 42906 /** 42907 * WordPress dependencies 42908 */ 42909 42910 42911 const postCommentsForm = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 42912 xmlns: "http://www.w3.org/2000/svg", 42913 viewBox: "0 0 24 24", 42914 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 42915 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" 42916 }) 42917 }); 42918 /* harmony default export */ const post_comments_form = (postCommentsForm); 42919 42920 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js 42921 /** 42922 * External dependencies 42923 */ 42924 42925 42926 /** 42927 * WordPress dependencies 42928 */ 42929 42930 42931 42932 42933 42934 /** 42935 * Internal dependencies 42936 */ 42937 42938 42939 function PostCommentsFormEdit({ 42940 attributes, 42941 context, 42942 setAttributes 42943 }) { 42944 const { 42945 textAlign 42946 } = attributes; 42947 const { 42948 postId, 42949 postType 42950 } = context; 42951 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsFormEdit); 42952 const instanceIdDesc = (0,external_wp_i18n_namespaceObject.sprintf)('comments-form-edit-%d-desc', instanceId); 42953 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 42954 className: dist_clsx({ 42955 [`has-text-align-$textAlign}`]: textAlign 42956 }), 42957 'aria-describedby': instanceIdDesc 42958 }); 42959 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 42960 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 42961 group: "block", 42962 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 42963 value: textAlign, 42964 onChange: nextAlign => { 42965 setAttributes({ 42966 textAlign: nextAlign 42967 }); 42968 } 42969 }) 42970 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 42971 ...blockProps, 42972 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_form_form, { 42973 postId: postId, 42974 postType: postType 42975 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { 42976 id: instanceIdDesc, 42977 children: (0,external_wp_i18n_namespaceObject.__)('Comments form disabled in editor.') 42978 })] 42979 })] 42980 }); 42981 } 42982 42983 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js 42984 /** 42985 * WordPress dependencies 42986 */ 42987 42988 42989 /** 42990 * Internal dependencies 42991 */ 42992 42993 const post_comments_form_metadata = { 42994 $schema: "https://schemas.wp.org/trunk/block.json", 42995 apiVersion: 3, 42996 name: "core/post-comments-form", 42997 title: "Comments Form", 42998 category: "theme", 42999 description: "Display a post's comments form.", 43000 textdomain: "default", 43001 attributes: { 43002 textAlign: { 43003 type: "string" 43004 } 43005 }, 43006 usesContext: ["postId", "postType"], 43007 supports: { 43008 html: false, 43009 color: { 43010 gradients: true, 43011 heading: true, 43012 link: true, 43013 __experimentalDefaultControls: { 43014 background: true, 43015 text: true 43016 } 43017 }, 43018 spacing: { 43019 margin: true, 43020 padding: true 43021 }, 43022 typography: { 43023 fontSize: true, 43024 lineHeight: true, 43025 __experimentalFontStyle: true, 43026 __experimentalFontWeight: true, 43027 __experimentalLetterSpacing: true, 43028 __experimentalTextTransform: true, 43029 __experimentalDefaultControls: { 43030 fontSize: true 43031 } 43032 }, 43033 __experimentalBorder: { 43034 radius: true, 43035 color: true, 43036 width: true, 43037 style: true, 43038 __experimentalDefaultControls: { 43039 radius: true, 43040 color: true, 43041 width: true, 43042 style: true 43043 } 43044 } 43045 }, 43046 editorStyle: "wp-block-post-comments-form-editor", 43047 style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"], 43048 example: { 43049 attributes: { 43050 textAlign: "center" 43051 } 43052 } 43053 }; 43054 43055 const { 43056 name: post_comments_form_name 43057 } = post_comments_form_metadata; 43058 43059 const post_comments_form_settings = { 43060 icon: post_comments_form, 43061 edit: PostCommentsFormEdit 43062 }; 43063 const post_comments_form_init = () => initBlock({ 43064 name: post_comments_form_name, 43065 metadata: post_comments_form_metadata, 43066 settings: post_comments_form_settings 43067 }); 43068 43069 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/edit.js 43070 /** 43071 * External dependencies 43072 */ 43073 43074 43075 /** 43076 * WordPress dependencies 43077 */ 43078 43079 43080 43081 43082 43083 43084 43085 43086 function PostCommentsLinkEdit({ 43087 context, 43088 attributes, 43089 setAttributes 43090 }) { 43091 const { 43092 textAlign 43093 } = attributes; 43094 const { 43095 postType, 43096 postId 43097 } = context; 43098 const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); 43099 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43100 className: dist_clsx({ 43101 [`has-text-align-$textAlign}`]: textAlign 43102 }) 43103 }); 43104 (0,external_wp_element_namespaceObject.useEffect)(() => { 43105 if (!postId) { 43106 return; 43107 } 43108 const currentPostId = postId; 43109 external_wp_apiFetch_default()({ 43110 path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { 43111 post: postId 43112 }), 43113 parse: false 43114 }).then(res => { 43115 // Stale requests will have the `currentPostId` of an older closure. 43116 if (currentPostId === postId) { 43117 setCommentsCount(res.headers.get('X-WP-Total')); 43118 } 43119 }); 43120 }, [postId]); 43121 const post = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId), [postType, postId]); 43122 if (!post) { 43123 return null; 43124 } 43125 const { 43126 link 43127 } = post; 43128 let commentsText; 43129 if (commentsCount !== undefined) { 43130 const commentsNumber = parseInt(commentsCount); 43131 if (commentsNumber === 0) { 43132 commentsText = (0,external_wp_i18n_namespaceObject.__)('No comments'); 43133 } else { 43134 commentsText = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Number of comments */ 43135 (0,external_wp_i18n_namespaceObject._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString()); 43136 } 43137 } 43138 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 43139 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 43140 group: "block", 43141 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 43142 value: textAlign, 43143 onChange: nextAlign => { 43144 setAttributes({ 43145 textAlign: nextAlign 43146 }); 43147 } 43148 }) 43149 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43150 ...blockProps, 43151 children: link && commentsText !== undefined ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 43152 href: link + '#comments', 43153 onClick: event => event.preventDefault(), 43154 children: commentsText 43155 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 43156 children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Link block: post not found.') 43157 }) 43158 })] 43159 }); 43160 } 43161 /* harmony default export */ const post_comments_link_edit = (PostCommentsLinkEdit); 43162 43163 ;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js 43164 /** 43165 * WordPress dependencies 43166 */ 43167 43168 43169 /** 43170 * Internal dependencies 43171 */ 43172 43173 const post_comments_link_metadata = { 43174 $schema: "https://schemas.wp.org/trunk/block.json", 43175 apiVersion: 3, 43176 __experimental: "fse", 43177 name: "core/post-comments-link", 43178 title: "Comments Link", 43179 category: "theme", 43180 description: "Displays the link to the current post comments.", 43181 textdomain: "default", 43182 usesContext: ["postType", "postId"], 43183 attributes: { 43184 textAlign: { 43185 type: "string" 43186 } 43187 }, 43188 supports: { 43189 html: false, 43190 color: { 43191 link: true, 43192 text: false, 43193 __experimentalDefaultControls: { 43194 background: true, 43195 link: true 43196 } 43197 }, 43198 spacing: { 43199 margin: true, 43200 padding: true 43201 }, 43202 typography: { 43203 fontSize: true, 43204 lineHeight: true, 43205 __experimentalFontFamily: true, 43206 __experimentalFontWeight: true, 43207 __experimentalFontStyle: true, 43208 __experimentalTextTransform: true, 43209 __experimentalTextDecoration: true, 43210 __experimentalLetterSpacing: true, 43211 __experimentalDefaultControls: { 43212 fontSize: true 43213 } 43214 }, 43215 interactivity: { 43216 clientNavigation: true 43217 }, 43218 __experimentalBorder: { 43219 radius: true, 43220 color: true, 43221 width: true, 43222 style: true, 43223 __experimentalDefaultControls: { 43224 radius: true, 43225 color: true, 43226 width: true, 43227 style: true 43228 } 43229 } 43230 }, 43231 style: "wp-block-post-comments-link" 43232 }; 43233 43234 const { 43235 name: post_comments_link_name 43236 } = post_comments_link_metadata; 43237 43238 const post_comments_link_settings = { 43239 edit: post_comments_link_edit, 43240 icon: post_comments_count 43241 }; 43242 const post_comments_link_init = () => initBlock({ 43243 name: post_comments_link_name, 43244 metadata: post_comments_link_metadata, 43245 settings: post_comments_link_settings 43246 }); 43247 43248 ;// ./node_modules/@wordpress/icons/build-module/library/post-content.js 43249 /** 43250 * WordPress dependencies 43251 */ 43252 43253 43254 const postContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 43255 xmlns: "http://www.w3.org/2000/svg", 43256 viewBox: "0 0 24 24", 43257 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 43258 d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z" 43259 }) 43260 }); 43261 /* harmony default export */ const post_content = (postContent); 43262 43263 ;// ./node_modules/@wordpress/block-library/build-module/post-content/edit.js 43264 /** 43265 * WordPress dependencies 43266 */ 43267 43268 43269 43270 43271 43272 43273 43274 /** 43275 * Internal dependencies 43276 */ 43277 43278 43279 function ReadOnlyContent({ 43280 parentLayout, 43281 layoutClassNames, 43282 userCanEdit, 43283 postType, 43284 postId 43285 }) { 43286 const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); 43287 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43288 className: layoutClassNames 43289 }); 43290 const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { 43291 return content?.raw ? (0,external_wp_blocks_namespaceObject.parse)(content.raw) : []; 43292 }, [content?.raw]); 43293 const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ 43294 blocks, 43295 props: blockProps, 43296 layout: parentLayout 43297 }); 43298 if (userCanEdit) { 43299 /* 43300 * Rendering the block preview using the raw content blocks allows for 43301 * block support styles to be generated and applied by the editor. 43302 * 43303 * The preview using the raw blocks can only be presented to users with 43304 * edit permissions for the post to prevent potential exposure of private 43305 * block content. 43306 */ 43307 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43308 ...blockPreviewProps 43309 }); 43310 } 43311 return content?.protected ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43312 ...blockProps, 43313 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 43314 children: (0,external_wp_i18n_namespaceObject.__)('This content is password protected.') 43315 }) 43316 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43317 ...blockProps, 43318 dangerouslySetInnerHTML: { 43319 __html: content?.rendered 43320 } 43321 }); 43322 } 43323 function EditableContent({ 43324 context = {} 43325 }) { 43326 const { 43327 postType, 43328 postId 43329 } = context; 43330 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { 43331 id: postId 43332 }); 43333 const entityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { 43334 return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); 43335 }, [postType, postId]); 43336 const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length; 43337 const initialInnerBlocks = [['core/paragraph']]; 43338 const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43339 className: 'entry-content' 43340 }), { 43341 value: blocks, 43342 onInput, 43343 onChange, 43344 template: !hasInnerBlocks ? initialInnerBlocks : undefined 43345 }); 43346 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43347 ...props 43348 }); 43349 } 43350 function Content(props) { 43351 const { 43352 context: { 43353 queryId, 43354 postType, 43355 postId 43356 } = {}, 43357 layoutClassNames 43358 } = props; 43359 const userCanEdit = useCanEditEntity('postType', postType, postId); 43360 if (userCanEdit === undefined) { 43361 return null; 43362 } 43363 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43364 const isEditable = userCanEdit && !isDescendentOfQueryLoop; 43365 return isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditableContent, { 43366 ...props 43367 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReadOnlyContent, { 43368 parentLayout: props.parentLayout, 43369 layoutClassNames: layoutClassNames, 43370 userCanEdit: userCanEdit, 43371 postType: postType, 43372 postId: postId 43373 }); 43374 } 43375 function edit_Placeholder({ 43376 layoutClassNames 43377 }) { 43378 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43379 className: layoutClassNames 43380 }); 43381 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 43382 ...blockProps, 43383 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 43384 children: (0,external_wp_i18n_namespaceObject.__)('This is the Content block, it will display all the blocks in any single post or page.') 43385 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 43386 children: (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.') 43387 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 43388 children: (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.') 43389 })] 43390 }); 43391 } 43392 function RecursionError() { 43393 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 43394 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43395 ...blockProps, 43396 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 43397 children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') 43398 }) 43399 }); 43400 } 43401 function PostContentEdit({ 43402 context, 43403 __unstableLayoutClassNames: layoutClassNames, 43404 __unstableParentLayout: parentLayout 43405 }) { 43406 const { 43407 postId: contextPostId, 43408 postType: contextPostType 43409 } = context; 43410 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(contextPostId); 43411 if (contextPostId && contextPostType && hasAlreadyRendered) { 43412 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionError, {}); 43413 } 43414 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 43415 uniqueId: contextPostId, 43416 children: contextPostId && contextPostType ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Content, { 43417 context: context, 43418 parentLayout: parentLayout, 43419 layoutClassNames: layoutClassNames 43420 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_Placeholder, { 43421 layoutClassNames: layoutClassNames 43422 }) 43423 }); 43424 } 43425 43426 ;// ./node_modules/@wordpress/block-library/build-module/post-content/index.js 43427 /** 43428 * WordPress dependencies 43429 */ 43430 43431 43432 /** 43433 * Internal dependencies 43434 */ 43435 43436 const post_content_metadata = { 43437 $schema: "https://schemas.wp.org/trunk/block.json", 43438 apiVersion: 3, 43439 name: "core/post-content", 43440 title: "Content", 43441 category: "theme", 43442 description: "Displays the contents of a post or page.", 43443 textdomain: "default", 43444 usesContext: ["postId", "postType", "queryId"], 43445 example: { 43446 viewportWidth: 350 43447 }, 43448 supports: { 43449 align: ["wide", "full"], 43450 html: false, 43451 layout: true, 43452 background: { 43453 backgroundImage: true, 43454 backgroundSize: true, 43455 __experimentalDefaultControls: { 43456 backgroundImage: true 43457 } 43458 }, 43459 dimensions: { 43460 minHeight: true 43461 }, 43462 spacing: { 43463 blockGap: true, 43464 padding: true, 43465 margin: true, 43466 __experimentalDefaultControls: { 43467 margin: false, 43468 padding: false 43469 } 43470 }, 43471 color: { 43472 gradients: true, 43473 heading: true, 43474 link: true, 43475 __experimentalDefaultControls: { 43476 background: false, 43477 text: false 43478 } 43479 }, 43480 typography: { 43481 fontSize: true, 43482 lineHeight: true, 43483 __experimentalFontFamily: true, 43484 __experimentalFontWeight: true, 43485 __experimentalFontStyle: true, 43486 __experimentalTextTransform: true, 43487 __experimentalTextDecoration: true, 43488 __experimentalLetterSpacing: true, 43489 __experimentalDefaultControls: { 43490 fontSize: true 43491 } 43492 }, 43493 __experimentalBorder: { 43494 radius: true, 43495 color: true, 43496 width: true, 43497 style: true, 43498 __experimentalDefaultControls: { 43499 radius: true, 43500 color: true, 43501 width: true, 43502 style: true 43503 } 43504 } 43505 }, 43506 style: "wp-block-post-content", 43507 editorStyle: "wp-block-post-content-editor" 43508 }; 43509 43510 const { 43511 name: post_content_name 43512 } = post_content_metadata; 43513 43514 const post_content_settings = { 43515 icon: post_content, 43516 edit: PostContentEdit 43517 }; 43518 const post_content_init = () => initBlock({ 43519 name: post_content_name, 43520 metadata: post_content_metadata, 43521 settings: post_content_settings 43522 }); 43523 43524 ;// ./node_modules/@wordpress/block-library/build-module/post-date/edit.js 43525 /** 43526 * External dependencies 43527 */ 43528 43529 43530 /** 43531 * WordPress dependencies 43532 */ 43533 43534 43535 43536 43537 43538 43539 43540 43541 43542 43543 /** 43544 * Internal dependencies 43545 */ 43546 43547 43548 function PostDateEdit({ 43549 attributes: { 43550 textAlign, 43551 format, 43552 isLink, 43553 displayType 43554 }, 43555 context: { 43556 postId, 43557 postType: postTypeSlug, 43558 queryId 43559 }, 43560 setAttributes 43561 }) { 43562 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43563 className: dist_clsx({ 43564 [`has-text-align-$textAlign}`]: textAlign, 43565 [`wp-block-post-date__modified-date`]: displayType === 'modified' 43566 }) 43567 }); 43568 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 43569 43570 // Use internal state instead of a ref to make sure that the component 43571 // re-renders when the popover's anchor updates. 43572 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 43573 // Memoize popoverProps to avoid returning a new object every time. 43574 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 43575 anchor: popoverAnchor 43576 }), [popoverAnchor]); 43577 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43578 const dateSettings = (0,external_wp_date_namespaceObject.getSettings)(); 43579 const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); 43580 const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format'); 43581 const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId); 43582 const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]); 43583 const dateLabel = displayType === 'date' ? (0,external_wp_i18n_namespaceObject.__)('Post Date') : (0,external_wp_i18n_namespaceObject.__)('Post Modified Date'); 43584 let postDate = date ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { 43585 dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date), 43586 ref: setPopoverAnchor, 43587 children: format === 'human-diff' ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date) 43588 }) : dateLabel; 43589 if (isLink && date) { 43590 postDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 43591 href: "#post-date-pseudo-link", 43592 onClick: event => event.preventDefault(), 43593 children: postDate 43594 }); 43595 } 43596 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 43597 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 43598 group: "block", 43599 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 43600 value: textAlign, 43601 onChange: nextAlign => { 43602 setAttributes({ 43603 textAlign: nextAlign 43604 }); 43605 } 43606 }), date && displayType === 'date' && !isDescendentOfQueryLoop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 43607 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { 43608 popoverProps: popoverProps, 43609 renderContent: ({ 43610 onClose 43611 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, { 43612 currentDate: date, 43613 onChange: setDate, 43614 is12Hour: is12HourFormat(siteTimeFormat), 43615 onClose: onClose, 43616 dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */ 43617 (0,external_wp_i18n_namespaceObject._x)('dmy', 'date order') 43618 }), 43619 renderToggle: ({ 43620 isOpen, 43621 onToggle 43622 }) => { 43623 const openOnArrowDown = event => { 43624 if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { 43625 event.preventDefault(); 43626 onToggle(); 43627 } 43628 }; 43629 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 43630 "aria-expanded": isOpen, 43631 icon: library_edit, 43632 title: (0,external_wp_i18n_namespaceObject.__)('Change Date'), 43633 onClick: onToggle, 43634 onKeyDown: openOnArrowDown 43635 }); 43636 } 43637 }) 43638 })] 43639 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 43640 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 43641 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 43642 resetAll: () => { 43643 setAttributes({ 43644 format: undefined, 43645 isLink: false, 43646 displayType: 'date' 43647 }); 43648 }, 43649 dropdownMenuProps: dropdownMenuProps, 43650 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 43651 hasValue: () => !!format, 43652 label: (0,external_wp_i18n_namespaceObject.__)('Date Format'), 43653 onDeselect: () => setAttributes({ 43654 format: undefined 43655 }), 43656 isShownByDefault: true, 43657 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { 43658 format: format, 43659 defaultFormat: siteFormat, 43660 onChange: nextFormat => setAttributes({ 43661 format: nextFormat 43662 }) 43663 }) 43664 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 43665 hasValue: () => isLink !== false, 43666 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 43667 // translators: %s: Name of the post type e.g: "post". 43668 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 43669 onDeselect: () => setAttributes({ 43670 isLink: false 43671 }), 43672 isShownByDefault: true, 43673 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 43674 __nextHasNoMarginBottom: true, 43675 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 43676 // translators: %s: Name of the post type e.g: "post". 43677 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 43678 onChange: () => setAttributes({ 43679 isLink: !isLink 43680 }), 43681 checked: isLink 43682 }) 43683 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 43684 hasValue: () => displayType !== 'date', 43685 label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'), 43686 onDeselect: () => setAttributes({ 43687 displayType: 'date' 43688 }), 43689 isShownByDefault: true, 43690 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 43691 __nextHasNoMarginBottom: true, 43692 label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'), 43693 onChange: value => setAttributes({ 43694 displayType: value ? 'modified' : 'date' 43695 }), 43696 checked: displayType === 'modified', 43697 help: (0,external_wp_i18n_namespaceObject.__)('Only shows if the post has been modified') 43698 }) 43699 })] 43700 }) 43701 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 43702 ...blockProps, 43703 children: postDate 43704 })] 43705 }); 43706 } 43707 function is12HourFormat(format) { 43708 // To know if the time format is a 12 hour time, look for any of the 12 hour 43709 // format characters: 'a', 'A', 'g', and 'h'. The character must be 43710 // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I 43711 // feel when working with regular expressions. 43712 // https://www.php.net/manual/en/datetime.format.php 43713 return /(?:^|[^\\])[aAgh]/.test(format); 43714 } 43715 43716 ;// ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js 43717 /** 43718 * Internal dependencies 43719 */ 43720 43721 const post_date_deprecated_v1 = { 43722 attributes: { 43723 textAlign: { 43724 type: 'string' 43725 }, 43726 format: { 43727 type: 'string' 43728 }, 43729 isLink: { 43730 type: 'boolean', 43731 default: false 43732 } 43733 }, 43734 supports: { 43735 html: false, 43736 color: { 43737 gradients: true, 43738 link: true 43739 }, 43740 typography: { 43741 fontSize: true, 43742 lineHeight: true, 43743 __experimentalFontFamily: true, 43744 __experimentalFontWeight: true, 43745 __experimentalFontStyle: true, 43746 __experimentalTextTransform: true, 43747 __experimentalLetterSpacing: true 43748 } 43749 }, 43750 save() { 43751 return null; 43752 }, 43753 migrate: migrate_font_family, 43754 isEligible({ 43755 style 43756 }) { 43757 return style?.typography?.fontFamily; 43758 } 43759 }; 43760 43761 /** 43762 * New deprecations need to be placed first 43763 * for them to have higher priority. 43764 * 43765 * Old deprecations may need to be updated as well. 43766 * 43767 * See block-deprecation.md 43768 */ 43769 /* harmony default export */ const post_date_deprecated = ([post_date_deprecated_v1]); 43770 43771 ;// ./node_modules/@wordpress/block-library/build-module/post-date/variations.js 43772 /** 43773 * WordPress dependencies 43774 */ 43775 43776 43777 const post_date_variations_variations = [{ 43778 name: 'post-date-modified', 43779 title: (0,external_wp_i18n_namespaceObject.__)('Modified Date'), 43780 description: (0,external_wp_i18n_namespaceObject.__)("Display a post's last updated date."), 43781 attributes: { 43782 displayType: 'modified' 43783 }, 43784 scope: ['block', 'inserter'], 43785 isActive: blockAttributes => blockAttributes.displayType === 'modified', 43786 icon: post_date 43787 }]; 43788 /* harmony default export */ const post_date_variations = (post_date_variations_variations); 43789 43790 ;// ./node_modules/@wordpress/block-library/build-module/post-date/index.js 43791 /** 43792 * WordPress dependencies 43793 */ 43794 43795 43796 /** 43797 * Internal dependencies 43798 */ 43799 43800 const post_date_metadata = { 43801 $schema: "https://schemas.wp.org/trunk/block.json", 43802 apiVersion: 3, 43803 name: "core/post-date", 43804 title: "Date", 43805 category: "theme", 43806 description: "Display the publish date for an entry such as a post or page.", 43807 textdomain: "default", 43808 attributes: { 43809 textAlign: { 43810 type: "string" 43811 }, 43812 format: { 43813 type: "string" 43814 }, 43815 isLink: { 43816 type: "boolean", 43817 "default": false, 43818 role: "content" 43819 }, 43820 displayType: { 43821 type: "string", 43822 "default": "date" 43823 } 43824 }, 43825 usesContext: ["postId", "postType", "queryId"], 43826 example: { 43827 viewportWidth: 350 43828 }, 43829 supports: { 43830 html: false, 43831 color: { 43832 gradients: true, 43833 link: true, 43834 __experimentalDefaultControls: { 43835 background: true, 43836 text: true, 43837 link: true 43838 } 43839 }, 43840 spacing: { 43841 margin: true, 43842 padding: true 43843 }, 43844 typography: { 43845 fontSize: true, 43846 lineHeight: true, 43847 __experimentalFontFamily: true, 43848 __experimentalFontWeight: true, 43849 __experimentalFontStyle: true, 43850 __experimentalTextTransform: true, 43851 __experimentalTextDecoration: true, 43852 __experimentalLetterSpacing: true, 43853 __experimentalDefaultControls: { 43854 fontSize: true 43855 } 43856 }, 43857 interactivity: { 43858 clientNavigation: true 43859 }, 43860 __experimentalBorder: { 43861 radius: true, 43862 color: true, 43863 width: true, 43864 style: true, 43865 __experimentalDefaultControls: { 43866 radius: true, 43867 color: true, 43868 width: true, 43869 style: true 43870 } 43871 } 43872 } 43873 }; 43874 43875 43876 43877 const { 43878 name: post_date_name 43879 } = post_date_metadata; 43880 43881 const post_date_settings = { 43882 icon: post_date, 43883 edit: PostDateEdit, 43884 deprecated: post_date_deprecated, 43885 variations: post_date_variations 43886 }; 43887 const post_date_init = () => initBlock({ 43888 name: post_date_name, 43889 metadata: post_date_metadata, 43890 settings: post_date_settings 43891 }); 43892 43893 ;// ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js 43894 /** 43895 * WordPress dependencies 43896 */ 43897 43898 43899 const postExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 43900 xmlns: "http://www.w3.org/2000/svg", 43901 viewBox: "0 0 24 24", 43902 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 43903 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" 43904 }) 43905 }); 43906 /* harmony default export */ const post_excerpt = (postExcerpt); 43907 43908 ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js 43909 /** 43910 * External dependencies 43911 */ 43912 43913 43914 /** 43915 * WordPress dependencies 43916 */ 43917 43918 43919 43920 43921 43922 43923 43924 /** 43925 * Internal dependencies 43926 */ 43927 43928 43929 const ELLIPSIS = '…'; 43930 function PostExcerptEditor({ 43931 attributes: { 43932 textAlign, 43933 moreText, 43934 showMoreOnNewLine, 43935 excerptLength 43936 }, 43937 setAttributes, 43938 isSelected, 43939 context: { 43940 postId, 43941 postType, 43942 queryId 43943 } 43944 }) { 43945 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43946 const userCanEdit = useCanEditEntity('postType', postType, postId); 43947 const [rawExcerpt, setExcerpt, { 43948 rendered: renderedExcerpt, 43949 protected: isProtected 43950 } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId); 43951 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 43952 43953 /** 43954 * Check if the post type supports excerpts. 43955 * Add an exception and return early for the "page" post type, 43956 * which is registered without support for the excerpt UI, 43957 * but supports saving the excerpt to the database. 43958 * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65 43959 * Without this exception, users that have excerpts saved to the database will 43960 * not be able to edit the excerpts. 43961 */ 43962 const postTypeSupportsExcerpts = (0,external_wp_data_namespaceObject.useSelect)(select => { 43963 if (postType === 'page') { 43964 return true; 43965 } 43966 return !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports?.excerpt; 43967 }, [postType]); 43968 43969 /** 43970 * The excerpt is editable if: 43971 * - The user can edit the post 43972 * - It is not a descendent of a Query Loop block 43973 * - The post type supports excerpts 43974 */ 43975 const isEditable = userCanEdit && !isDescendentOfQueryLoop && postTypeSupportsExcerpts; 43976 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 43977 className: dist_clsx({ 43978 [`has-text-align-$textAlign}`]: textAlign 43979 }) 43980 }); 43981 43982 /** 43983 * translators: If your word count is based on single characters (e.g. East Asian characters), 43984 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 43985 * Do not translate into your own language. 43986 */ 43987 const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); 43988 43989 /** 43990 * When excerpt is editable, strip the html tags from 43991 * rendered excerpt. This will be used if the entity's 43992 * excerpt has been produced from the content. 43993 */ 43994 const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => { 43995 if (!renderedExcerpt) { 43996 return ''; 43997 } 43998 const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html'); 43999 return document.body.textContent || document.body.innerText || ''; 44000 }, [renderedExcerpt]); 44001 if (!postType || !postId) { 44002 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44003 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 44004 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 44005 value: textAlign, 44006 onChange: newAlign => setAttributes({ 44007 textAlign: newAlign 44008 }) 44009 }) 44010 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 44011 ...blockProps, 44012 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 44013 children: (0,external_wp_i18n_namespaceObject.__)('This block will display the excerpt.') 44014 }) 44015 })] 44016 }); 44017 } 44018 if (isProtected && !userCanEdit) { 44019 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 44020 ...blockProps, 44021 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 44022 children: (0,external_wp_i18n_namespaceObject.__)('The content is currently protected and does not have the available excerpt.') 44023 }) 44024 }); 44025 } 44026 const readMoreLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 44027 identifier: "moreText", 44028 className: "wp-block-post-excerpt__more-link", 44029 tagName: "a", 44030 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 44031 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'), 44032 value: moreText, 44033 onChange: newMoreText => setAttributes({ 44034 moreText: newMoreText 44035 }), 44036 withoutInteractiveFormatting: true 44037 }); 44038 const excerptClassName = dist_clsx('wp-block-post-excerpt__excerpt', { 44039 'is-inline': !showMoreOnNewLine 44040 }); 44041 44042 /** 44043 * The excerpt length setting needs to be applied to both 44044 * the raw and the rendered excerpt depending on which is being used. 44045 */ 44046 const rawOrRenderedExcerpt = (rawExcerpt || strippedRenderedExcerpt).trim(); 44047 let trimmedExcerpt = ''; 44048 if (wordCountType === 'words') { 44049 trimmedExcerpt = rawOrRenderedExcerpt.split(' ', excerptLength).join(' '); 44050 } else if (wordCountType === 'characters_excluding_spaces') { 44051 /* 44052 * 1. Split the excerpt at the character limit, 44053 * then join the substrings back into one string. 44054 * 2. Count the number of spaces in the excerpt 44055 * by comparing the lengths of the string with and without spaces. 44056 * 3. Add the number to the length of the visible excerpt, 44057 * so that the spaces are excluded from the word count. 44058 */ 44059 const excerptWithSpaces = rawOrRenderedExcerpt.split('', excerptLength).join(''); 44060 const numberOfSpaces = excerptWithSpaces.length - excerptWithSpaces.replaceAll(' ', '').length; 44061 trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength + numberOfSpaces).join(''); 44062 } else if (wordCountType === 'characters_including_spaces') { 44063 trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength).join(''); 44064 } 44065 const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt; 44066 const excerptContent = isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 44067 className: excerptClassName, 44068 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Excerpt text'), 44069 value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0,external_wp_i18n_namespaceObject.__)('No excerpt found'), 44070 onChange: setExcerpt, 44071 tagName: "p" 44072 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 44073 className: excerptClassName, 44074 children: !isTrimmed ? rawOrRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No excerpt found') : trimmedExcerpt + ELLIPSIS 44075 }); 44076 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44077 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 44078 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 44079 value: textAlign, 44080 onChange: newAlign => setAttributes({ 44081 textAlign: newAlign 44082 }) 44083 }) 44084 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 44085 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 44086 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 44087 resetAll: () => { 44088 setAttributes({ 44089 showMoreOnNewLine: true, 44090 excerptLength: 55 44091 }); 44092 }, 44093 dropdownMenuProps: dropdownMenuProps, 44094 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44095 hasValue: () => showMoreOnNewLine !== true, 44096 label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'), 44097 onDeselect: () => setAttributes({ 44098 showMoreOnNewLine: true 44099 }), 44100 isShownByDefault: true, 44101 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 44102 __nextHasNoMarginBottom: true, 44103 label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'), 44104 checked: showMoreOnNewLine, 44105 onChange: newShowMoreOnNewLine => setAttributes({ 44106 showMoreOnNewLine: newShowMoreOnNewLine 44107 }) 44108 }) 44109 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44110 hasValue: () => excerptLength !== 55, 44111 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 44112 onDeselect: () => setAttributes({ 44113 excerptLength: 55 44114 }), 44115 isShownByDefault: true, 44116 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 44117 __next40pxDefaultSize: true, 44118 __nextHasNoMarginBottom: true, 44119 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), 44120 value: excerptLength, 44121 onChange: value => { 44122 setAttributes({ 44123 excerptLength: value 44124 }); 44125 }, 44126 min: "10", 44127 max: "100" 44128 }) 44129 })] 44130 }) 44131 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 44132 ...blockProps, 44133 children: [excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 44134 className: "wp-block-post-excerpt__more-text", 44135 children: readMoreLink 44136 }) : readMoreLink] 44137 })] 44138 }); 44139 } 44140 44141 ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js 44142 /** 44143 * WordPress dependencies 44144 */ 44145 44146 const post_excerpt_transforms_transforms = { 44147 from: [{ 44148 type: 'block', 44149 blocks: ['core/post-content'], 44150 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt') 44151 }], 44152 to: [{ 44153 type: 'block', 44154 blocks: ['core/post-content'], 44155 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content') 44156 }] 44157 }; 44158 /* harmony default export */ const post_excerpt_transforms = (post_excerpt_transforms_transforms); 44159 44160 ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js 44161 /** 44162 * WordPress dependencies 44163 */ 44164 44165 44166 /** 44167 * Internal dependencies 44168 */ 44169 44170 const post_excerpt_metadata = { 44171 $schema: "https://schemas.wp.org/trunk/block.json", 44172 apiVersion: 3, 44173 name: "core/post-excerpt", 44174 title: "Excerpt", 44175 category: "theme", 44176 description: "Display the excerpt.", 44177 textdomain: "default", 44178 attributes: { 44179 textAlign: { 44180 type: "string" 44181 }, 44182 moreText: { 44183 type: "string" 44184 }, 44185 showMoreOnNewLine: { 44186 type: "boolean", 44187 "default": true 44188 }, 44189 excerptLength: { 44190 type: "number", 44191 "default": 55 44192 } 44193 }, 44194 usesContext: ["postId", "postType", "queryId"], 44195 example: { 44196 viewportWidth: 350 44197 }, 44198 supports: { 44199 html: false, 44200 color: { 44201 gradients: true, 44202 link: true, 44203 __experimentalDefaultControls: { 44204 background: true, 44205 text: true, 44206 link: true 44207 } 44208 }, 44209 spacing: { 44210 margin: true, 44211 padding: true 44212 }, 44213 typography: { 44214 fontSize: true, 44215 lineHeight: true, 44216 __experimentalFontFamily: true, 44217 __experimentalFontWeight: true, 44218 __experimentalFontStyle: true, 44219 __experimentalTextTransform: true, 44220 __experimentalTextDecoration: true, 44221 __experimentalLetterSpacing: true, 44222 __experimentalDefaultControls: { 44223 fontSize: true 44224 } 44225 }, 44226 interactivity: { 44227 clientNavigation: true 44228 }, 44229 __experimentalBorder: { 44230 radius: true, 44231 color: true, 44232 width: true, 44233 style: true, 44234 __experimentalDefaultControls: { 44235 radius: true, 44236 color: true, 44237 width: true, 44238 style: true 44239 } 44240 } 44241 }, 44242 editorStyle: "wp-block-post-excerpt-editor", 44243 style: "wp-block-post-excerpt" 44244 }; 44245 44246 44247 const { 44248 name: post_excerpt_name 44249 } = post_excerpt_metadata; 44250 44251 const post_excerpt_settings = { 44252 icon: post_excerpt, 44253 transforms: post_excerpt_transforms, 44254 edit: PostExcerptEditor 44255 }; 44256 const post_excerpt_init = () => initBlock({ 44257 name: post_excerpt_name, 44258 metadata: post_excerpt_metadata, 44259 settings: post_excerpt_settings 44260 }); 44261 44262 ;// ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js 44263 /** 44264 * WordPress dependencies 44265 */ 44266 44267 44268 const postFeaturedImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 44269 xmlns: "http://www.w3.org/2000/svg", 44270 viewBox: "0 0 24 24", 44271 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 44272 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" 44273 }) 44274 }); 44275 /* harmony default export */ const post_featured_image = (postFeaturedImage); 44276 44277 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js 44278 /* wp:polyfill */ 44279 /** 44280 * WordPress dependencies 44281 */ 44282 44283 44284 44285 44286 44287 /** 44288 * Internal dependencies 44289 */ 44290 44291 44292 const { 44293 ResolutionTool: dimension_controls_ResolutionTool 44294 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 44295 const SCALE_OPTIONS = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44296 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 44297 value: "cover", 44298 label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control') 44299 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 44300 value: "contain", 44301 label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control') 44302 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 44303 value: "fill", 44304 label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control') 44305 })] 44306 }); 44307 const DEFAULT_SCALE = 'cover'; 44308 const DEFAULT_SIZE = 'full'; 44309 const scaleHelp = { 44310 cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'), 44311 contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'), 44312 fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.') 44313 }; 44314 const DimensionControls = ({ 44315 clientId, 44316 attributes: { 44317 aspectRatio, 44318 width, 44319 height, 44320 scale, 44321 sizeSlug 44322 }, 44323 setAttributes, 44324 media 44325 }) => { 44326 const [availableUnits, defaultRatios, themeRatios, showDefaultRatios] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units', 'dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios'); 44327 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 44328 availableUnits: availableUnits || ['px', '%', 'vw', 'em', 'rem'] 44329 }); 44330 const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []); 44331 const imageSizeOptions = imageSizes.filter(({ 44332 slug 44333 }) => { 44334 return media?.media_details?.sizes?.[slug]?.source_url; 44335 }).map(({ 44336 name, 44337 slug 44338 }) => ({ 44339 value: slug, 44340 label: name 44341 })); 44342 const onDimensionChange = (dimension, nextValue) => { 44343 const parsedValue = parseFloat(nextValue); 44344 /** 44345 * If we have no value set and we change the unit, 44346 * we don't want to set the attribute, as it would 44347 * end up having the unit as value without any number. 44348 */ 44349 if (isNaN(parsedValue) && nextValue) { 44350 return; 44351 } 44352 setAttributes({ 44353 [dimension]: parsedValue < 0 ? '0' : nextValue 44354 }); 44355 }; 44356 const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options'); 44357 const showScaleControl = height || aspectRatio && aspectRatio !== 'auto'; 44358 const themeOptions = themeRatios?.map(({ 44359 name, 44360 ratio 44361 }) => ({ 44362 label: name, 44363 value: ratio 44364 })); 44365 const defaultOptions = defaultRatios?.map(({ 44366 name, 44367 ratio 44368 }) => ({ 44369 label: name, 44370 value: ratio 44371 })); 44372 const aspectRatioOptions = [{ 44373 label: (0,external_wp_i18n_namespaceObject._x)('Original', 'Aspect ratio option for dimensions control'), 44374 value: 'auto' 44375 }, ...(showDefaultRatios ? defaultOptions : []), ...(themeOptions ? themeOptions : [])]; 44376 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44377 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44378 hasValue: () => !!aspectRatio, 44379 label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), 44380 onDeselect: () => setAttributes({ 44381 aspectRatio: undefined 44382 }), 44383 resetAllFilter: () => ({ 44384 aspectRatio: undefined 44385 }), 44386 isShownByDefault: true, 44387 panelId: clientId, 44388 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 44389 __next40pxDefaultSize: true, 44390 __nextHasNoMarginBottom: true, 44391 label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), 44392 value: aspectRatio, 44393 options: aspectRatioOptions, 44394 onChange: nextAspectRatio => setAttributes({ 44395 aspectRatio: nextAspectRatio 44396 }) 44397 }) 44398 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44399 className: "single-column", 44400 hasValue: () => !!height, 44401 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 44402 onDeselect: () => setAttributes({ 44403 height: undefined 44404 }), 44405 resetAllFilter: () => ({ 44406 height: undefined 44407 }), 44408 isShownByDefault: true, 44409 panelId: clientId, 44410 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 44411 __next40pxDefaultSize: true, 44412 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 44413 labelPosition: "top", 44414 value: height || '', 44415 min: 0, 44416 onChange: nextHeight => onDimensionChange('height', nextHeight), 44417 units: units 44418 }) 44419 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44420 className: "single-column", 44421 hasValue: () => !!width, 44422 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 44423 onDeselect: () => setAttributes({ 44424 width: undefined 44425 }), 44426 resetAllFilter: () => ({ 44427 width: undefined 44428 }), 44429 isShownByDefault: true, 44430 panelId: clientId, 44431 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 44432 __next40pxDefaultSize: true, 44433 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 44434 labelPosition: "top", 44435 value: width || '', 44436 min: 0, 44437 onChange: nextWidth => onDimensionChange('width', nextWidth), 44438 units: units 44439 }) 44440 }), showScaleControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44441 hasValue: () => !!scale && scale !== DEFAULT_SCALE, 44442 label: scaleLabel, 44443 onDeselect: () => setAttributes({ 44444 scale: DEFAULT_SCALE 44445 }), 44446 resetAllFilter: () => ({ 44447 scale: DEFAULT_SCALE 44448 }), 44449 isShownByDefault: true, 44450 panelId: clientId, 44451 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 44452 __next40pxDefaultSize: true, 44453 __nextHasNoMarginBottom: true, 44454 label: scaleLabel, 44455 value: scale, 44456 help: scaleHelp[scale], 44457 onChange: value => setAttributes({ 44458 scale: value 44459 }), 44460 isBlock: true, 44461 children: SCALE_OPTIONS 44462 }) 44463 }), !!imageSizeOptions.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dimension_controls_ResolutionTool, { 44464 panelId: clientId, 44465 value: sizeSlug, 44466 defaultValue: DEFAULT_SIZE, 44467 options: imageSizeOptions, 44468 onChange: nextSizeSlug => setAttributes({ 44469 sizeSlug: nextSizeSlug 44470 }), 44471 isShownByDefault: false, 44472 resetAllFilter: () => ({ 44473 sizeSlug: DEFAULT_SIZE 44474 }) 44475 })] 44476 }); 44477 }; 44478 /* harmony default export */ const dimension_controls = (DimensionControls); 44479 44480 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay-controls.js 44481 /** 44482 * WordPress dependencies 44483 */ 44484 44485 44486 44487 44488 44489 const Overlay = ({ 44490 clientId, 44491 attributes, 44492 setAttributes, 44493 overlayColor, 44494 setOverlayColor 44495 }) => { 44496 const { 44497 dimRatio 44498 } = attributes; 44499 const { 44500 gradientValue, 44501 setGradient 44502 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 44503 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 44504 if (!colorGradientSettings.hasColorsOrGradients) { 44505 return null; 44506 } 44507 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44508 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 44509 __experimentalIsRenderedInSidebar: true, 44510 settings: [{ 44511 colorValue: overlayColor.color, 44512 gradientValue, 44513 label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), 44514 onColorChange: setOverlayColor, 44515 onGradientChange: setGradient, 44516 isShownByDefault: true, 44517 resetAllFilter: () => ({ 44518 overlayColor: undefined, 44519 customOverlayColor: undefined, 44520 gradient: undefined, 44521 customGradient: undefined 44522 }), 44523 clearable: true 44524 }], 44525 panelId: clientId, 44526 ...colorGradientSettings 44527 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44528 hasValue: () => dimRatio !== undefined, 44529 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 44530 onDeselect: () => setAttributes({ 44531 dimRatio: 0 44532 }), 44533 resetAllFilter: () => ({ 44534 dimRatio: 0 44535 }), 44536 isShownByDefault: true, 44537 panelId: clientId, 44538 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 44539 __nextHasNoMarginBottom: true, 44540 label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), 44541 value: dimRatio, 44542 onChange: newDimRatio => setAttributes({ 44543 dimRatio: newDimRatio 44544 }), 44545 min: 0, 44546 max: 100, 44547 step: 10, 44548 required: true, 44549 __next40pxDefaultSize: true 44550 }) 44551 })] 44552 }); 44553 }; 44554 /* harmony default export */ const overlay_controls = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ 44555 overlayColor: 'background-color' 44556 })])(Overlay)); 44557 44558 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/utils.js 44559 /** 44560 * Generates the opacity/dim class based on given number. 44561 * 44562 * @param {number} ratio Dim/opacity number. 44563 * 44564 * @return {string} Generated class. 44565 */ 44566 function utils_dimRatioToClass(ratio) { 44567 return ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); 44568 } 44569 44570 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay.js 44571 /** 44572 * External dependencies 44573 */ 44574 44575 44576 /** 44577 * WordPress dependencies 44578 */ 44579 44580 44581 44582 /** 44583 * Internal dependencies 44584 */ 44585 44586 44587 const overlay_Overlay = ({ 44588 attributes, 44589 overlayColor 44590 }) => { 44591 const { 44592 dimRatio 44593 } = attributes; 44594 const { 44595 gradientClass, 44596 gradientValue 44597 } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); 44598 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 44599 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 44600 const overlayStyles = { 44601 backgroundColor: overlayColor.color, 44602 backgroundImage: gradientValue, 44603 ...borderProps.style 44604 }; 44605 if (!colorGradientSettings.hasColorsOrGradients || !dimRatio) { 44606 return null; 44607 } 44608 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 44609 "aria-hidden": "true", 44610 className: dist_clsx('wp-block-post-featured-image__overlay', utils_dimRatioToClass(dimRatio), { 44611 [overlayColor.class]: overlayColor.class, 44612 'has-background-dim': dimRatio !== undefined, 44613 'has-background-gradient': gradientValue, 44614 [gradientClass]: gradientClass 44615 }, borderProps.className), 44616 style: overlayStyles 44617 }); 44618 }; 44619 /* harmony default export */ const overlay = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ 44620 overlayColor: 'background-color' 44621 })])(overlay_Overlay)); 44622 44623 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js 44624 /** 44625 * External dependencies 44626 */ 44627 44628 44629 /** 44630 * WordPress dependencies 44631 */ 44632 44633 44634 44635 44636 44637 44638 44639 44640 44641 44642 /** 44643 * Internal dependencies 44644 */ 44645 44646 44647 44648 44649 44650 const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image']; 44651 function getMediaSourceUrlBySizeSlug(media, slug) { 44652 return media?.media_details?.sizes?.[slug]?.source_url || media?.source_url; 44653 } 44654 function PostFeaturedImageEdit({ 44655 clientId, 44656 attributes, 44657 setAttributes, 44658 context: { 44659 postId, 44660 postType: postTypeSlug, 44661 queryId 44662 } 44663 }) { 44664 const isDescendentOfQueryLoop = Number.isFinite(queryId); 44665 const { 44666 isLink, 44667 aspectRatio, 44668 height, 44669 width, 44670 scale, 44671 sizeSlug, 44672 rel, 44673 linkTarget, 44674 useFirstImageFromPost 44675 } = attributes; 44676 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(); 44677 const [storedFeaturedImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId); 44678 44679 // Fallback to post content if no featured image is set. 44680 // This is needed for the "Use first image from post" option. 44681 const [postContent] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'content', postId); 44682 const featuredImage = (0,external_wp_element_namespaceObject.useMemo)(() => { 44683 if (storedFeaturedImage) { 44684 return storedFeaturedImage; 44685 } 44686 if (!useFirstImageFromPost) { 44687 return; 44688 } 44689 const imageOpener = /<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec(postContent); 44690 const imageId = imageOpener?.groups?.attrs && JSON.parse(imageOpener.groups.attrs)?.id; 44691 return imageId; 44692 }, [storedFeaturedImage, useFirstImageFromPost, postContent]); 44693 const { 44694 media, 44695 postType, 44696 postPermalink 44697 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 44698 const { 44699 getMedia, 44700 getPostType, 44701 getEditedEntityRecord 44702 } = select(external_wp_coreData_namespaceObject.store); 44703 return { 44704 media: featuredImage && getMedia(featuredImage, { 44705 context: 'view' 44706 }), 44707 postType: postTypeSlug && getPostType(postTypeSlug), 44708 postPermalink: getEditedEntityRecord('postType', postTypeSlug, postId)?.link 44709 }; 44710 }, [featuredImage, postTypeSlug, postId]); 44711 const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug); 44712 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 44713 style: { 44714 width, 44715 height, 44716 aspectRatio 44717 }, 44718 className: dist_clsx({ 44719 'is-transient': temporaryURL 44720 }) 44721 }); 44722 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 44723 const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); 44724 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 44725 const placeholder = content => { 44726 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 44727 className: dist_clsx('block-editor-media-placeholder', borderProps.className), 44728 withIllustration: true, 44729 style: { 44730 height: !!aspectRatio && '100%', 44731 width: !!aspectRatio && '100%', 44732 ...borderProps.style, 44733 ...shadowProps.style 44734 }, 44735 children: content 44736 }); 44737 }; 44738 const onSelectImage = value => { 44739 if (value?.id) { 44740 setFeaturedImage(value.id); 44741 } 44742 if (value?.url && (0,external_wp_blob_namespaceObject.isBlobURL)(value.url)) { 44743 setTemporaryURL(value.url); 44744 } 44745 }; 44746 44747 // Reset temporary url when media is available. 44748 (0,external_wp_element_namespaceObject.useEffect)(() => { 44749 if (mediaUrl && temporaryURL) { 44750 setTemporaryURL(); 44751 } 44752 }, [mediaUrl, temporaryURL]); 44753 const { 44754 createErrorNotice 44755 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 44756 const onUploadError = message => { 44757 createErrorNotice(message, { 44758 type: 'snackbar' 44759 }); 44760 setTemporaryURL(); 44761 }; 44762 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 44763 const controls = blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44764 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 44765 group: "color", 44766 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay_controls, { 44767 attributes: attributes, 44768 setAttributes: setAttributes, 44769 clientId: clientId 44770 }) 44771 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 44772 group: "dimensions", 44773 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dimension_controls, { 44774 clientId: clientId, 44775 attributes: attributes, 44776 setAttributes: setAttributes, 44777 media: media 44778 }) 44779 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 44780 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 44781 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 44782 resetAll: () => { 44783 setAttributes({ 44784 isLink: false, 44785 linkTarget: '_self', 44786 rel: '' 44787 }); 44788 }, 44789 dropdownMenuProps: dropdownMenuProps, 44790 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44791 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 44792 // translators: %s: Name of the post type e.g: "post". 44793 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 44794 isShownByDefault: true, 44795 hasValue: () => !!isLink, 44796 onDeselect: () => setAttributes({ 44797 isLink: false 44798 }), 44799 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 44800 __nextHasNoMarginBottom: true, 44801 label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( 44802 // translators: %s: Name of the post type e.g: "post". 44803 (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), 44804 onChange: () => setAttributes({ 44805 isLink: !isLink 44806 }), 44807 checked: isLink 44808 }) 44809 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44810 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 44811 isShownByDefault: true, 44812 hasValue: () => '_self' !== linkTarget, 44813 onDeselect: () => setAttributes({ 44814 linkTarget: '_self' 44815 }), 44816 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 44817 __nextHasNoMarginBottom: true, 44818 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 44819 onChange: value => setAttributes({ 44820 linkTarget: value ? '_blank' : '_self' 44821 }), 44822 checked: linkTarget === '_blank' 44823 }) 44824 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 44825 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 44826 isShownByDefault: true, 44827 hasValue: () => !!rel, 44828 onDeselect: () => setAttributes({ 44829 rel: '' 44830 }), 44831 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 44832 __next40pxDefaultSize: true, 44833 __nextHasNoMarginBottom: true, 44834 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 44835 value: rel, 44836 onChange: newRel => setAttributes({ 44837 rel: newRel 44838 }) 44839 }) 44840 })] 44841 }) 44842 })] 44843 }); 44844 let image; 44845 44846 /** 44847 * A Post Featured Image block should not have image replacement 44848 * or upload options in the following cases: 44849 * - Is placed in a Query Loop. This is a conscious decision to 44850 * prevent content editing of different posts in Query Loop, and 44851 * this could change in the future. 44852 * - Is in a context where it does not have a postId (for example 44853 * in a template or template part). 44854 */ 44855 if (!featuredImage && (isDescendentOfQueryLoop || !postId)) { 44856 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44857 children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 44858 ...blockProps, 44859 children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 44860 href: postPermalink, 44861 target: linkTarget, 44862 children: placeholder() 44863 }) : placeholder(), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, { 44864 attributes: attributes, 44865 setAttributes: setAttributes, 44866 clientId: clientId 44867 })] 44868 })] 44869 }); 44870 } 44871 const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image'); 44872 const imageStyles = { 44873 ...borderProps.style, 44874 ...shadowProps.style, 44875 height: aspectRatio ? '100%' : height, 44876 width: !!aspectRatio && '100%', 44877 objectFit: !!(height || aspectRatio) && scale 44878 }; 44879 44880 /** 44881 * When the post featured image block is placed in a context where: 44882 * - It has a postId (for example in a single post) 44883 * - It is not inside a query loop 44884 * - It has no image assigned yet 44885 * Then display the placeholder with the image upload option. 44886 */ 44887 if (!featuredImage && !temporaryURL) { 44888 image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 44889 onSelect: onSelectImage, 44890 accept: "image/*", 44891 allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, 44892 onError: onUploadError, 44893 placeholder: placeholder, 44894 mediaLibraryButton: ({ 44895 open 44896 }) => { 44897 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 44898 __next40pxDefaultSize: true, 44899 icon: library_upload, 44900 variant: "primary", 44901 label: label, 44902 showTooltip: true, 44903 tooltipPosition: "top center", 44904 onClick: () => { 44905 open(); 44906 } 44907 }); 44908 } 44909 }); 44910 } else { 44911 // We have a Featured image so show a Placeholder if is loading. 44912 image = !media && !temporaryURL ? placeholder() : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44913 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 44914 className: borderProps.className, 44915 src: temporaryURL || mediaUrl, 44916 alt: media && media?.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( 44917 // translators: %s: The image's alt text. 44918 (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'), 44919 style: imageStyles 44920 }), temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] 44921 }); 44922 } 44923 44924 /** 44925 * When the post featured image block: 44926 * - Has an image assigned 44927 * - Is not inside a query loop 44928 * Then display the image and the image replacement option. 44929 */ 44930 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 44931 children: [!temporaryURL && controls, !!media && !isDescendentOfQueryLoop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 44932 group: "other", 44933 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 44934 mediaId: featuredImage, 44935 mediaURL: mediaUrl, 44936 allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, 44937 accept: "image/*", 44938 onSelect: onSelectImage, 44939 onError: onUploadError, 44940 onReset: () => setFeaturedImage(0) 44941 }) 44942 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 44943 ...blockProps, 44944 children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 44945 href: postPermalink, 44946 target: linkTarget, 44947 children: image 44948 }) : image, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, { 44949 attributes: attributes, 44950 setAttributes: setAttributes, 44951 clientId: clientId 44952 })] 44953 })] 44954 }); 44955 } 44956 44957 ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js 44958 /** 44959 * WordPress dependencies 44960 */ 44961 44962 44963 /** 44964 * Internal dependencies 44965 */ 44966 44967 const post_featured_image_metadata = { 44968 $schema: "https://schemas.wp.org/trunk/block.json", 44969 apiVersion: 3, 44970 name: "core/post-featured-image", 44971 title: "Featured Image", 44972 category: "theme", 44973 description: "Display a post's featured image.", 44974 textdomain: "default", 44975 attributes: { 44976 isLink: { 44977 type: "boolean", 44978 "default": false, 44979 role: "content" 44980 }, 44981 aspectRatio: { 44982 type: "string" 44983 }, 44984 width: { 44985 type: "string" 44986 }, 44987 height: { 44988 type: "string" 44989 }, 44990 scale: { 44991 type: "string", 44992 "default": "cover" 44993 }, 44994 sizeSlug: { 44995 type: "string" 44996 }, 44997 rel: { 44998 type: "string", 44999 attribute: "rel", 45000 "default": "", 45001 role: "content" 45002 }, 45003 linkTarget: { 45004 type: "string", 45005 "default": "_self", 45006 role: "content" 45007 }, 45008 overlayColor: { 45009 type: "string" 45010 }, 45011 customOverlayColor: { 45012 type: "string" 45013 }, 45014 dimRatio: { 45015 type: "number", 45016 "default": 0 45017 }, 45018 gradient: { 45019 type: "string" 45020 }, 45021 customGradient: { 45022 type: "string" 45023 }, 45024 useFirstImageFromPost: { 45025 type: "boolean", 45026 "default": false 45027 } 45028 }, 45029 usesContext: ["postId", "postType", "queryId"], 45030 example: { 45031 viewportWidth: 350 45032 }, 45033 supports: { 45034 align: ["left", "right", "center", "wide", "full"], 45035 color: { 45036 text: false, 45037 background: false 45038 }, 45039 __experimentalBorder: { 45040 color: true, 45041 radius: true, 45042 width: true, 45043 __experimentalSkipSerialization: true, 45044 __experimentalDefaultControls: { 45045 color: true, 45046 radius: true, 45047 width: true 45048 } 45049 }, 45050 filter: { 45051 duotone: true 45052 }, 45053 shadow: { 45054 __experimentalSkipSerialization: true 45055 }, 45056 html: false, 45057 spacing: { 45058 margin: true, 45059 padding: true 45060 }, 45061 interactivity: { 45062 clientNavigation: true 45063 } 45064 }, 45065 selectors: { 45066 border: ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay", 45067 shadow: ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder", 45068 filter: { 45069 duotone: ".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before" 45070 } 45071 }, 45072 editorStyle: "wp-block-post-featured-image-editor", 45073 style: "wp-block-post-featured-image" 45074 }; 45075 45076 const { 45077 name: post_featured_image_name 45078 } = post_featured_image_metadata; 45079 45080 const post_featured_image_settings = { 45081 icon: post_featured_image, 45082 edit: PostFeaturedImageEdit 45083 }; 45084 const post_featured_image_init = () => initBlock({ 45085 name: post_featured_image_name, 45086 metadata: post_featured_image_metadata, 45087 settings: post_featured_image_settings 45088 }); 45089 45090 ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js 45091 /* wp:polyfill */ 45092 /** 45093 * External dependencies 45094 */ 45095 45096 45097 /** 45098 * WordPress dependencies 45099 */ 45100 45101 45102 45103 45104 45105 45106 function PostNavigationLinkEdit({ 45107 context: { 45108 postType 45109 }, 45110 attributes: { 45111 type, 45112 label, 45113 showTitle, 45114 textAlign, 45115 linkLabel, 45116 arrow, 45117 taxonomy 45118 }, 45119 setAttributes 45120 }) { 45121 const isNext = type === 'next'; 45122 let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous'); 45123 const arrowMap = { 45124 none: '', 45125 arrow: isNext ? '→' : '←', 45126 chevron: isNext ? '»' : '«' 45127 }; 45128 const displayArrow = arrowMap[arrow]; 45129 if (showTitle) { 45130 placeholder = isNext ? /* translators: Label before for next and previous post. There is a space after the colon. */ 45131 (0,external_wp_i18n_namespaceObject.__)('Next: ') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace 45132 : /* translators: Label before for next and previous post. There is a space after the colon. */ 45133 (0,external_wp_i18n_namespaceObject.__)('Previous: '); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace 45134 } 45135 const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post'); 45136 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 45137 className: dist_clsx({ 45138 [`has-text-align-$textAlign}`]: textAlign 45139 }) 45140 }); 45141 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { 45142 const { 45143 getTaxonomies 45144 } = select(external_wp_coreData_namespaceObject.store); 45145 const filteredTaxonomies = getTaxonomies({ 45146 type: postType, 45147 per_page: -1 45148 }); 45149 return filteredTaxonomies; 45150 }, [postType]); 45151 const getTaxonomyOptions = () => { 45152 const selectOption = { 45153 label: (0,external_wp_i18n_namespaceObject.__)('Unfiltered'), 45154 value: '' 45155 }; 45156 const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(({ 45157 visibility 45158 }) => !!visibility?.publicly_queryable).map(item => { 45159 return { 45160 value: item.slug, 45161 label: item.name 45162 }; 45163 }); 45164 return [selectOption, ...taxonomyOptions]; 45165 }; 45166 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 45167 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 45168 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 45169 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 45170 __nextHasNoMarginBottom: true, 45171 label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'), 45172 help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'), 45173 checked: !!showTitle, 45174 onChange: () => setAttributes({ 45175 showTitle: !showTitle 45176 }) 45177 }), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 45178 __nextHasNoMarginBottom: true, 45179 label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'), 45180 checked: !!linkLabel, 45181 onChange: () => setAttributes({ 45182 linkLabel: !linkLabel 45183 }) 45184 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 45185 __next40pxDefaultSize: true, 45186 __nextHasNoMarginBottom: true, 45187 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 45188 value: arrow, 45189 onChange: value => { 45190 setAttributes({ 45191 arrow: value 45192 }); 45193 }, 45194 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow for the next and previous link.'), 45195 isBlock: true, 45196 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 45197 value: "none", 45198 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Next/Previous link') 45199 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 45200 value: "arrow", 45201 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Next/Previous link') 45202 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 45203 value: "chevron", 45204 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Next/Previous link') 45205 })] 45206 })] 45207 }) 45208 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 45209 group: "advanced", 45210 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 45211 __next40pxDefaultSize: true, 45212 __nextHasNoMarginBottom: true, 45213 label: (0,external_wp_i18n_namespaceObject.__)('Filter by taxonomy'), 45214 value: taxonomy, 45215 options: getTaxonomyOptions(), 45216 onChange: value => setAttributes({ 45217 taxonomy: value 45218 }), 45219 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.') 45220 }) 45221 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 45222 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 45223 value: textAlign, 45224 onChange: nextAlign => { 45225 setAttributes({ 45226 textAlign: nextAlign 45227 }); 45228 } 45229 }) 45230 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 45231 ...blockProps, 45232 children: [!isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 45233 className: `wp-block-post-navigation-link__arrow-previous is-arrow-$arrow}`, 45234 children: displayArrow 45235 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 45236 tagName: "a", 45237 identifier: "label", 45238 "aria-label": ariaLabel, 45239 placeholder: placeholder, 45240 value: label, 45241 allowedFormats: ['core/bold', 'core/italic'], 45242 onChange: newLabel => setAttributes({ 45243 label: newLabel 45244 }) 45245 }), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 45246 href: "#post-navigation-pseudo-link", 45247 onClick: event => event.preventDefault(), 45248 children: (0,external_wp_i18n_namespaceObject.__)('An example title') 45249 }), isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 45250 className: `wp-block-post-navigation-link__arrow-next is-arrow-$arrow}`, 45251 "aria-hidden": true, 45252 children: displayArrow 45253 })] 45254 })] 45255 }); 45256 } 45257 45258 ;// ./node_modules/@wordpress/icons/build-module/library/next.js 45259 /** 45260 * WordPress dependencies 45261 */ 45262 45263 45264 const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 45265 xmlns: "http://www.w3.org/2000/svg", 45266 viewBox: "0 0 24 24", 45267 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 45268 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" 45269 }) 45270 }); 45271 /* harmony default export */ const library_next = (next); 45272 45273 ;// ./node_modules/@wordpress/icons/build-module/library/previous.js 45274 /** 45275 * WordPress dependencies 45276 */ 45277 45278 45279 const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 45280 xmlns: "http://www.w3.org/2000/svg", 45281 viewBox: "0 0 24 24", 45282 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 45283 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" 45284 }) 45285 }); 45286 /* harmony default export */ const library_previous = (previous); 45287 45288 ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js 45289 /* wp:polyfill */ 45290 /** 45291 * WordPress dependencies 45292 */ 45293 45294 45295 const post_navigation_link_variations_variations = [{ 45296 isDefault: true, 45297 name: 'post-next', 45298 title: (0,external_wp_i18n_namespaceObject.__)('Next Post'), 45299 description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'), 45300 icon: library_next, 45301 attributes: { 45302 type: 'next' 45303 }, 45304 scope: ['inserter', 'transform'], 45305 example: { 45306 attributes: { 45307 label: (0,external_wp_i18n_namespaceObject.__)('Next post'), 45308 arrow: 'arrow' 45309 } 45310 } 45311 }, { 45312 name: 'post-previous', 45313 title: (0,external_wp_i18n_namespaceObject.__)('Previous Post'), 45314 description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'), 45315 icon: library_previous, 45316 attributes: { 45317 type: 'previous' 45318 }, 45319 scope: ['inserter', 'transform'], 45320 example: { 45321 attributes: { 45322 label: (0,external_wp_i18n_namespaceObject.__)('Previous post'), 45323 arrow: 'arrow' 45324 } 45325 } 45326 }]; 45327 45328 /** 45329 * Add `isActive` function to all `post-navigation-link` variations, if not defined. 45330 * `isActive` function is used to find a variation match from a created 45331 * Block by providing its attributes. 45332 */ 45333 post_navigation_link_variations_variations.forEach(variation => { 45334 if (variation.isActive) { 45335 return; 45336 } 45337 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; 45338 }); 45339 /* harmony default export */ const post_navigation_link_variations = (post_navigation_link_variations_variations); 45340 45341 ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js 45342 /** 45343 * WordPress dependencies 45344 */ 45345 45346 45347 /** 45348 * Internal dependencies 45349 */ 45350 45351 const post_navigation_link_metadata = { 45352 $schema: "https://schemas.wp.org/trunk/block.json", 45353 apiVersion: 3, 45354 name: "core/post-navigation-link", 45355 title: "Post Navigation Link", 45356 category: "theme", 45357 description: "Displays the next or previous post link that is adjacent to the current post.", 45358 textdomain: "default", 45359 attributes: { 45360 textAlign: { 45361 type: "string" 45362 }, 45363 type: { 45364 type: "string", 45365 "default": "next" 45366 }, 45367 label: { 45368 type: "string" 45369 }, 45370 showTitle: { 45371 type: "boolean", 45372 "default": false 45373 }, 45374 linkLabel: { 45375 type: "boolean", 45376 "default": false 45377 }, 45378 arrow: { 45379 type: "string", 45380 "default": "none" 45381 }, 45382 taxonomy: { 45383 type: "string", 45384 "default": "" 45385 } 45386 }, 45387 usesContext: ["postType"], 45388 supports: { 45389 reusable: false, 45390 html: false, 45391 color: { 45392 link: true 45393 }, 45394 typography: { 45395 fontSize: true, 45396 lineHeight: true, 45397 __experimentalFontFamily: true, 45398 __experimentalFontWeight: true, 45399 __experimentalFontStyle: true, 45400 __experimentalTextTransform: true, 45401 __experimentalTextDecoration: true, 45402 __experimentalLetterSpacing: true, 45403 __experimentalWritingMode: true, 45404 __experimentalDefaultControls: { 45405 fontSize: true 45406 } 45407 }, 45408 interactivity: { 45409 clientNavigation: true 45410 } 45411 }, 45412 style: "wp-block-post-navigation-link" 45413 }; 45414 45415 45416 const { 45417 name: post_navigation_link_name 45418 } = post_navigation_link_metadata; 45419 45420 const post_navigation_link_settings = { 45421 edit: PostNavigationLinkEdit, 45422 variations: post_navigation_link_variations, 45423 example: { 45424 attributes: { 45425 label: (0,external_wp_i18n_namespaceObject.__)('Next post'), 45426 arrow: 'arrow' 45427 } 45428 } 45429 }; 45430 const post_navigation_link_init = () => initBlock({ 45431 name: post_navigation_link_name, 45432 metadata: post_navigation_link_metadata, 45433 settings: post_navigation_link_settings 45434 }); 45435 45436 ;// ./node_modules/@wordpress/block-library/build-module/post-template/edit.js 45437 /* wp:polyfill */ 45438 /** 45439 * External dependencies 45440 */ 45441 45442 45443 /** 45444 * WordPress dependencies 45445 */ 45446 45447 45448 45449 45450 45451 45452 45453 45454 const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]; 45455 function PostTemplateInnerBlocks({ 45456 classList 45457 }) { 45458 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ 45459 className: dist_clsx('wp-block-post', classList) 45460 }, { 45461 template: post_template_edit_TEMPLATE, 45462 __unstableDisableLayoutClassNames: true 45463 }); 45464 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 45465 ...innerBlocksProps 45466 }); 45467 } 45468 function PostTemplateBlockPreview({ 45469 blocks, 45470 blockContextId, 45471 classList, 45472 isHidden, 45473 setActiveBlockContextId 45474 }) { 45475 const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ 45476 blocks, 45477 props: { 45478 className: dist_clsx('wp-block-post', classList) 45479 } 45480 }); 45481 const handleOnClick = () => { 45482 setActiveBlockContextId(blockContextId); 45483 }; 45484 const style = { 45485 display: isHidden ? 'none' : undefined 45486 }; 45487 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 45488 ...blockPreviewProps, 45489 tabIndex: 0 45490 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role 45491 , 45492 role: "button", 45493 onClick: handleOnClick, 45494 onKeyPress: handleOnClick, 45495 style: style 45496 }); 45497 } 45498 const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview); 45499 function PostTemplateEdit({ 45500 setAttributes, 45501 clientId, 45502 context: { 45503 query: { 45504 perPage, 45505 offset = 0, 45506 postType, 45507 order, 45508 orderBy, 45509 author, 45510 search, 45511 exclude, 45512 sticky, 45513 inherit, 45514 taxQuery, 45515 parents, 45516 pages, 45517 format, 45518 // We gather extra query args to pass to the REST API call. 45519 // This way extenders of Query Loop can add their own query args, 45520 // and have accurate previews in the editor. 45521 // Noting though that these args should either be supported by the 45522 // REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`. 45523 ...restQueryArgs 45524 } = {}, 45525 templateSlug, 45526 previewPostType 45527 }, 45528 attributes: { 45529 layout 45530 }, 45531 __unstableLayoutClassNames 45532 }) { 45533 const { 45534 type: layoutType, 45535 columnCount = 3 45536 } = layout || {}; 45537 const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)(); 45538 const { 45539 posts, 45540 blocks 45541 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 45542 const { 45543 getEntityRecords, 45544 getTaxonomies 45545 } = select(external_wp_coreData_namespaceObject.store); 45546 const { 45547 getBlocks 45548 } = select(external_wp_blockEditor_namespaceObject.store); 45549 const templateCategory = inherit && templateSlug?.startsWith('category-') && getEntityRecords('taxonomy', 'category', { 45550 context: 'view', 45551 per_page: 1, 45552 _fields: ['id'], 45553 slug: templateSlug.replace('category-', '') 45554 }); 45555 const templateTag = inherit && templateSlug?.startsWith('tag-') && getEntityRecords('taxonomy', 'post_tag', { 45556 context: 'view', 45557 per_page: 1, 45558 _fields: ['id'], 45559 slug: templateSlug.replace('tag-', '') 45560 }); 45561 const query = { 45562 offset: offset || 0, 45563 order, 45564 orderby: orderBy 45565 }; 45566 // There is no need to build the taxQuery if we inherit. 45567 if (taxQuery && !inherit) { 45568 const taxonomies = getTaxonomies({ 45569 type: postType, 45570 per_page: -1, 45571 context: 'view' 45572 }); 45573 // We have to build the tax query for the REST API and use as 45574 // keys the taxonomies `rest_base` with the `term ids` as values. 45575 const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, [taxonomySlug, terms]) => { 45576 const taxonomy = taxonomies?.find(({ 45577 slug 45578 }) => slug === taxonomySlug); 45579 if (taxonomy?.rest_base) { 45580 accumulator[taxonomy?.rest_base] = terms; 45581 } 45582 return accumulator; 45583 }, {}); 45584 if (!!Object.keys(builtTaxQuery).length) { 45585 Object.assign(query, builtTaxQuery); 45586 } 45587 } 45588 if (perPage) { 45589 query.per_page = perPage; 45590 } 45591 if (author) { 45592 query.author = author; 45593 } 45594 if (search) { 45595 query.search = search; 45596 } 45597 if (exclude?.length) { 45598 query.exclude = exclude; 45599 } 45600 if (parents?.length) { 45601 query.parent = parents; 45602 } 45603 if (format?.length) { 45604 query.format = format; 45605 } 45606 45607 // If sticky is not set, it will return all posts in the results. 45608 // If sticky is set to `only`, it will limit the results to sticky posts only. 45609 // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`. 45610 if (sticky) { 45611 query.sticky = sticky === 'only'; 45612 } 45613 // If `inherit` is truthy, adjust conditionally the query to create a better preview. 45614 if (inherit) { 45615 // Change the post-type if needed. 45616 if (templateSlug?.startsWith('archive-')) { 45617 query.postType = templateSlug.replace('archive-', ''); 45618 postType = query.postType; 45619 } else if (templateCategory) { 45620 query.categories = templateCategory[0]?.id; 45621 } else if (templateTag) { 45622 query.tags = templateTag[0]?.id; 45623 } else if (templateSlug?.startsWith('taxonomy-post_format')) { 45624 // Get the post format slug from the template slug by removing the prefix. 45625 query.format = templateSlug.replace('taxonomy-post_format-post-format-', ''); 45626 } 45627 } 45628 // When we preview Query Loop blocks we should prefer the current 45629 // block's postType, which is passed through block context. 45630 const usedPostType = previewPostType || postType; 45631 return { 45632 posts: getEntityRecords('postType', usedPostType, { 45633 ...query, 45634 ...restQueryArgs 45635 }), 45636 blocks: getBlocks(clientId) 45637 }; 45638 }, [perPage, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, format, restQueryArgs, previewPostType]); 45639 const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts?.map(post => { 45640 var _post$class_list; 45641 return { 45642 postType: post.type, 45643 postId: post.id, 45644 classList: (_post$class_list = post.class_list) !== null && _post$class_list !== void 0 ? _post$class_list : '' 45645 }; 45646 }), [posts]); 45647 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 45648 className: dist_clsx(__unstableLayoutClassNames, { 45649 [`columns-$columnCount}`]: layoutType === 'grid' && columnCount // Ensure column count is flagged via classname for backwards compatibility. 45650 }) 45651 }); 45652 if (!posts) { 45653 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 45654 ...blockProps, 45655 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 45656 }); 45657 } 45658 if (!posts.length) { 45659 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { 45660 ...blockProps, 45661 children: [" ", (0,external_wp_i18n_namespaceObject.__)('No results found.')] 45662 }); 45663 } 45664 const setDisplayLayout = newDisplayLayout => setAttributes({ 45665 layout: { 45666 ...layout, 45667 ...newDisplayLayout 45668 } 45669 }); 45670 const displayLayoutControls = [{ 45671 icon: library_list, 45672 title: (0,external_wp_i18n_namespaceObject._x)('List view', 'Post template block display setting'), 45673 onClick: () => setDisplayLayout({ 45674 type: 'default' 45675 }), 45676 isActive: layoutType === 'default' || layoutType === 'constrained' 45677 }, { 45678 icon: library_grid, 45679 title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'Post template block display setting'), 45680 onClick: () => setDisplayLayout({ 45681 type: 'grid', 45682 columnCount 45683 }), 45684 isActive: layoutType === 'grid' 45685 }]; 45686 45687 // To avoid flicker when switching active block contexts, a preview is rendered 45688 // for each block context, but the preview for the active block context is hidden. 45689 // This ensures that when it is displayed again, the cached rendering of the 45690 // block preview is used, instead of having to re-render the preview from scratch. 45691 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 45692 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 45693 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 45694 controls: displayLayoutControls 45695 }) 45696 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 45697 ...blockProps, 45698 children: blockContexts && blockContexts.map(blockContext => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 45699 value: blockContext, 45700 children: [blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateInnerBlocks, { 45701 classList: blockContext.classList 45702 }) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedPostTemplateBlockPreview, { 45703 blocks: blocks, 45704 blockContextId: blockContext.postId, 45705 classList: blockContext.classList, 45706 setActiveBlockContextId: setActiveBlockContextId, 45707 isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) 45708 })] 45709 }, blockContext.postId)) 45710 })] 45711 }); 45712 } 45713 45714 ;// ./node_modules/@wordpress/block-library/build-module/post-template/save.js 45715 /** 45716 * WordPress dependencies 45717 */ 45718 45719 45720 function PostTemplateSave() { 45721 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 45722 } 45723 45724 ;// ./node_modules/@wordpress/block-library/build-module/post-template/index.js 45725 /** 45726 * WordPress dependencies 45727 */ 45728 45729 45730 /** 45731 * Internal dependencies 45732 */ 45733 45734 const post_template_metadata = { 45735 $schema: "https://schemas.wp.org/trunk/block.json", 45736 apiVersion: 3, 45737 name: "core/post-template", 45738 title: "Post Template", 45739 category: "theme", 45740 ancestor: ["core/query"], 45741 description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", 45742 textdomain: "default", 45743 usesContext: ["queryId", "query", "displayLayout", "templateSlug", "previewPostType", "enhancedPagination", "postType"], 45744 supports: { 45745 reusable: false, 45746 html: false, 45747 align: ["wide", "full"], 45748 layout: true, 45749 color: { 45750 gradients: true, 45751 link: true, 45752 __experimentalDefaultControls: { 45753 background: true, 45754 text: true 45755 } 45756 }, 45757 typography: { 45758 fontSize: true, 45759 lineHeight: true, 45760 __experimentalFontFamily: true, 45761 __experimentalFontWeight: true, 45762 __experimentalFontStyle: true, 45763 __experimentalTextTransform: true, 45764 __experimentalTextDecoration: true, 45765 __experimentalLetterSpacing: true, 45766 __experimentalDefaultControls: { 45767 fontSize: true 45768 } 45769 }, 45770 spacing: { 45771 margin: true, 45772 padding: true, 45773 blockGap: { 45774 __experimentalDefault: "1.25em" 45775 }, 45776 __experimentalDefaultControls: { 45777 blockGap: true, 45778 padding: false, 45779 margin: false 45780 } 45781 }, 45782 interactivity: { 45783 clientNavigation: true 45784 }, 45785 __experimentalBorder: { 45786 radius: true, 45787 color: true, 45788 width: true, 45789 style: true 45790 } 45791 }, 45792 style: "wp-block-post-template", 45793 editorStyle: "wp-block-post-template-editor" 45794 }; 45795 45796 45797 const { 45798 name: post_template_name 45799 } = post_template_metadata; 45800 45801 const post_template_settings = { 45802 icon: library_layout, 45803 edit: PostTemplateEdit, 45804 save: PostTemplateSave 45805 }; 45806 const post_template_init = () => initBlock({ 45807 name: post_template_name, 45808 metadata: post_template_metadata, 45809 settings: post_template_settings 45810 }); 45811 45812 ;// ./node_modules/@wordpress/icons/build-module/library/post-categories.js 45813 /** 45814 * WordPress dependencies 45815 */ 45816 45817 45818 const postCategories = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 45819 viewBox: "0 0 24 24", 45820 xmlns: "http://www.w3.org/2000/svg", 45821 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 45822 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", 45823 fillRule: "evenodd", 45824 clipRule: "evenodd" 45825 }) 45826 }); 45827 /* harmony default export */ const post_categories = (postCategories); 45828 45829 ;// ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js 45830 /** 45831 * WordPress dependencies 45832 */ 45833 45834 45835 const use_post_terms_EMPTY_ARRAY = []; 45836 function usePostTerms({ 45837 postId, 45838 term 45839 }) { 45840 const { 45841 slug 45842 } = term; 45843 return (0,external_wp_data_namespaceObject.useSelect)(select => { 45844 const visible = term?.visibility?.publicly_queryable; 45845 if (!visible) { 45846 return { 45847 postTerms: use_post_terms_EMPTY_ARRAY, 45848 isLoading: false, 45849 hasPostTerms: false 45850 }; 45851 } 45852 const { 45853 getEntityRecords, 45854 isResolving 45855 } = select(external_wp_coreData_namespaceObject.store); 45856 const taxonomyArgs = ['taxonomy', slug, { 45857 post: postId, 45858 per_page: -1, 45859 context: 'view' 45860 }]; 45861 const terms = getEntityRecords(...taxonomyArgs); 45862 return { 45863 postTerms: terms, 45864 isLoading: isResolving('getEntityRecords', taxonomyArgs), 45865 hasPostTerms: !!terms?.length 45866 }; 45867 }, [postId, term?.visibility?.publicly_queryable, slug]); 45868 } 45869 45870 ;// ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js 45871 /* wp:polyfill */ 45872 /** 45873 * External dependencies 45874 */ 45875 45876 45877 /** 45878 * WordPress dependencies 45879 */ 45880 45881 45882 45883 45884 45885 45886 45887 45888 /** 45889 * Internal dependencies 45890 */ 45891 45892 45893 // Allowed formats for the prefix and suffix fields. 45894 45895 const ALLOWED_FORMATS = ['core/bold', 'core/image', 'core/italic', 'core/link', 'core/strikethrough', 'core/text-color']; 45896 function PostTermsEdit({ 45897 attributes, 45898 clientId, 45899 context, 45900 isSelected, 45901 setAttributes, 45902 insertBlocksAfter 45903 }) { 45904 const { 45905 term, 45906 textAlign, 45907 separator, 45908 prefix, 45909 suffix 45910 } = attributes; 45911 const { 45912 postId, 45913 postType 45914 } = context; 45915 const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => { 45916 if (!term) { 45917 return {}; 45918 } 45919 const { 45920 getTaxonomy 45921 } = select(external_wp_coreData_namespaceObject.store); 45922 const taxonomy = getTaxonomy(term); 45923 return taxonomy?.visibility?.publicly_queryable ? taxonomy : {}; 45924 }, [term]); 45925 const { 45926 postTerms, 45927 hasPostTerms, 45928 isLoading 45929 } = usePostTerms({ 45930 postId, 45931 term: selectedTerm 45932 }); 45933 const hasPost = postId && postType; 45934 const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId); 45935 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 45936 className: dist_clsx({ 45937 [`has-text-align-$textAlign}`]: textAlign, 45938 [`taxonomy-$term}`]: term 45939 }) 45940 }); 45941 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 45942 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 45943 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 45944 value: textAlign, 45945 onChange: nextAlign => { 45946 setAttributes({ 45947 textAlign: nextAlign 45948 }); 45949 } 45950 }) 45951 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 45952 group: "advanced", 45953 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 45954 __next40pxDefaultSize: true, 45955 __nextHasNoMarginBottom: true, 45956 autoComplete: "off", 45957 label: (0,external_wp_i18n_namespaceObject.__)('Separator'), 45958 value: separator || '', 45959 onChange: nextValue => { 45960 setAttributes({ 45961 separator: nextValue 45962 }); 45963 }, 45964 help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.') 45965 }) 45966 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 45967 ...blockProps, 45968 children: [isLoading && hasPost && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isLoading && (isSelected || prefix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 45969 identifier: "prefix", 45970 allowedFormats: ALLOWED_FORMATS, 45971 className: "wp-block-post-terms__prefix", 45972 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Prefix'), 45973 placeholder: (0,external_wp_i18n_namespaceObject.__)('Prefix') + ' ', 45974 value: prefix, 45975 onChange: value => setAttributes({ 45976 prefix: value 45977 }), 45978 tagName: "span" 45979 }), (!hasPost || !term) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 45980 children: blockInformation.title 45981 }), hasPost && !isLoading && hasPostTerms && postTerms.map(postTerm => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 45982 href: postTerm.link, 45983 onClick: event => event.preventDefault(), 45984 rel: "tag", 45985 children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTerm.name) 45986 }, postTerm.id)).reduce((prev, curr) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 45987 children: [prev, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 45988 className: "wp-block-post-terms__separator", 45989 children: separator || ' ' 45990 }), curr] 45991 })), hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0,external_wp_i18n_namespaceObject.__)('Term items not found.')), !isLoading && (isSelected || suffix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 45992 identifier: "suffix", 45993 allowedFormats: ALLOWED_FORMATS, 45994 className: "wp-block-post-terms__suffix", 45995 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suffix'), 45996 placeholder: ' ' + (0,external_wp_i18n_namespaceObject.__)('Suffix'), 45997 value: suffix, 45998 onChange: value => setAttributes({ 45999 suffix: value 46000 }), 46001 tagName: "span", 46002 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 46003 })] 46004 })] 46005 }); 46006 } 46007 46008 ;// ./node_modules/@wordpress/icons/build-module/library/post-terms.js 46009 /** 46010 * WordPress dependencies 46011 */ 46012 46013 46014 const postTerms = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 46015 viewBox: "0 0 24 24", 46016 xmlns: "http://www.w3.org/2000/svg", 46017 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 46018 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" 46019 }) 46020 }); 46021 /* harmony default export */ const post_terms = (postTerms); 46022 46023 ;// ./node_modules/@wordpress/block-library/build-module/post-terms/hooks.js 46024 /* wp:polyfill */ 46025 /** 46026 * WordPress dependencies 46027 */ 46028 46029 const variationIconMap = { 46030 category: post_categories, 46031 post_tag: post_terms 46032 }; 46033 46034 // We add `icons` to categories and tags. The remaining ones use 46035 // the block's default icon. 46036 function enhanceVariations(settings, name) { 46037 if (name !== 'core/post-terms') { 46038 return settings; 46039 } 46040 const variations = settings.variations.map(variation => { 46041 var _variationIconMap$var; 46042 return { 46043 ...variation, 46044 ...{ 46045 icon: (_variationIconMap$var = variationIconMap[variation.name]) !== null && _variationIconMap$var !== void 0 ? _variationIconMap$var : post_categories 46046 } 46047 }; 46048 }); 46049 return { 46050 ...settings, 46051 variations 46052 }; 46053 } 46054 46055 ;// ./node_modules/@wordpress/block-library/build-module/post-terms/index.js 46056 /** 46057 * WordPress dependencies 46058 */ 46059 46060 46061 46062 /** 46063 * Internal dependencies 46064 */ 46065 46066 const post_terms_metadata = { 46067 $schema: "https://schemas.wp.org/trunk/block.json", 46068 apiVersion: 3, 46069 name: "core/post-terms", 46070 title: "Post Terms", 46071 category: "theme", 46072 description: "Post terms.", 46073 textdomain: "default", 46074 attributes: { 46075 term: { 46076 type: "string" 46077 }, 46078 textAlign: { 46079 type: "string" 46080 }, 46081 separator: { 46082 type: "string", 46083 "default": ", " 46084 }, 46085 prefix: { 46086 type: "string", 46087 "default": "" 46088 }, 46089 suffix: { 46090 type: "string", 46091 "default": "" 46092 } 46093 }, 46094 usesContext: ["postId", "postType"], 46095 example: { 46096 viewportWidth: 350 46097 }, 46098 supports: { 46099 html: false, 46100 color: { 46101 gradients: true, 46102 link: true, 46103 __experimentalDefaultControls: { 46104 background: true, 46105 text: true, 46106 link: true 46107 } 46108 }, 46109 spacing: { 46110 margin: true, 46111 padding: true 46112 }, 46113 typography: { 46114 fontSize: true, 46115 lineHeight: true, 46116 __experimentalFontFamily: true, 46117 __experimentalFontWeight: true, 46118 __experimentalFontStyle: true, 46119 __experimentalTextTransform: true, 46120 __experimentalTextDecoration: true, 46121 __experimentalLetterSpacing: true, 46122 __experimentalDefaultControls: { 46123 fontSize: true 46124 } 46125 }, 46126 interactivity: { 46127 clientNavigation: true 46128 }, 46129 __experimentalBorder: { 46130 radius: true, 46131 color: true, 46132 width: true, 46133 style: true, 46134 __experimentalDefaultControls: { 46135 radius: true, 46136 color: true, 46137 width: true, 46138 style: true 46139 } 46140 } 46141 }, 46142 style: "wp-block-post-terms" 46143 }; 46144 46145 46146 const { 46147 name: post_terms_name 46148 } = post_terms_metadata; 46149 46150 const post_terms_settings = { 46151 icon: post_categories, 46152 edit: PostTermsEdit 46153 }; 46154 const post_terms_init = () => { 46155 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations); 46156 return initBlock({ 46157 name: post_terms_name, 46158 metadata: post_terms_metadata, 46159 settings: post_terms_settings 46160 }); 46161 }; 46162 46163 ;// external ["wp","wordcount"] 46164 const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; 46165 ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/edit.js 46166 /** 46167 * External dependencies 46168 */ 46169 46170 46171 /** 46172 * WordPress dependencies 46173 */ 46174 46175 46176 46177 46178 46179 46180 46181 /** 46182 * Average reading rate - based on average taken from 46183 * https://irisreading.com/average-reading-speed-in-various-languages/ 46184 * (Characters/minute used for Chinese rather than words). 46185 */ 46186 46187 const AVERAGE_READING_RATE = 189; 46188 function PostTimeToReadEdit({ 46189 attributes, 46190 setAttributes, 46191 context 46192 }) { 46193 const { 46194 textAlign 46195 } = attributes; 46196 const { 46197 postId, 46198 postType 46199 } = context; 46200 const [contentStructure] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); 46201 const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { 46202 id: postId 46203 }); 46204 const minutesToReadString = (0,external_wp_element_namespaceObject.useMemo)(() => { 46205 // Replicates the logic found in getEditedPostContent(). 46206 let content; 46207 if (contentStructure instanceof Function) { 46208 content = contentStructure({ 46209 blocks 46210 }); 46211 } else if (blocks) { 46212 // If we have parsed blocks already, they should be our source of truth. 46213 // Parsing applies block deprecations and legacy block conversions that 46214 // unparsed content will not have. 46215 content = (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks); 46216 } else { 46217 content = contentStructure; 46218 } 46219 46220 /* 46221 * translators: If your word count is based on single characters (e.g. East Asian characters), 46222 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 46223 * Do not translate into your own language. 46224 */ 46225 const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); 46226 const minutesToRead = Math.max(1, Math.round((0,external_wp_wordcount_namespaceObject.count)(content || '', wordCountType) / AVERAGE_READING_RATE)); 46227 return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */ 46228 (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', minutesToRead), minutesToRead); 46229 }, [contentStructure, blocks]); 46230 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 46231 className: dist_clsx({ 46232 [`has-text-align-$textAlign}`]: textAlign 46233 }) 46234 }); 46235 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 46236 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 46237 group: "block", 46238 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 46239 value: textAlign, 46240 onChange: nextAlign => { 46241 setAttributes({ 46242 textAlign: nextAlign 46243 }); 46244 } 46245 }) 46246 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 46247 ...blockProps, 46248 children: minutesToReadString 46249 })] 46250 }); 46251 } 46252 /* harmony default export */ const post_time_to_read_edit = (PostTimeToReadEdit); 46253 46254 ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/icon.js 46255 /** 46256 * WordPress dependencies 46257 */ 46258 46259 46260 /* harmony default export */ const icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 46261 xmlns: "http://www.w3.org/2000/svg", 46262 width: "24", 46263 height: "24", 46264 viewBox: "0 0 24 24", 46265 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 46266 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" 46267 }) 46268 })); 46269 46270 ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js 46271 /** 46272 * Internal dependencies 46273 */ 46274 46275 const post_time_to_read_metadata = { 46276 $schema: "https://schemas.wp.org/trunk/block.json", 46277 apiVersion: 3, 46278 __experimental: true, 46279 name: "core/post-time-to-read", 46280 title: "Time to Read", 46281 category: "theme", 46282 description: "Show minutes required to finish reading the post.", 46283 textdomain: "default", 46284 usesContext: ["postId", "postType"], 46285 attributes: { 46286 textAlign: { 46287 type: "string" 46288 } 46289 }, 46290 supports: { 46291 color: { 46292 gradients: true, 46293 __experimentalDefaultControls: { 46294 background: true, 46295 text: true 46296 } 46297 }, 46298 html: false, 46299 spacing: { 46300 margin: true, 46301 padding: true, 46302 __experimentalDefaultControls: { 46303 margin: false, 46304 padding: false 46305 } 46306 }, 46307 typography: { 46308 fontSize: true, 46309 lineHeight: true, 46310 __experimentalFontFamily: true, 46311 __experimentalFontWeight: true, 46312 __experimentalFontStyle: true, 46313 __experimentalTextTransform: true, 46314 __experimentalTextDecoration: true, 46315 __experimentalLetterSpacing: true, 46316 __experimentalDefaultControls: { 46317 fontSize: true 46318 } 46319 }, 46320 interactivity: { 46321 clientNavigation: true 46322 }, 46323 __experimentalBorder: { 46324 radius: true, 46325 color: true, 46326 width: true, 46327 style: true 46328 } 46329 } 46330 }; 46331 46332 46333 const { 46334 name: post_time_to_read_name 46335 } = post_time_to_read_metadata; 46336 46337 const post_time_to_read_settings = { 46338 icon: icon, 46339 edit: post_time_to_read_edit, 46340 example: {} 46341 }; 46342 const post_time_to_read_init = () => initBlock({ 46343 name: post_time_to_read_name, 46344 metadata: post_time_to_read_metadata, 46345 settings: post_time_to_read_settings 46346 }); 46347 46348 ;// ./node_modules/@wordpress/block-library/build-module/post-title/edit.js 46349 /** 46350 * External dependencies 46351 */ 46352 46353 46354 /** 46355 * WordPress dependencies 46356 */ 46357 46358 46359 46360 46361 46362 46363 46364 function PostTitleEdit({ 46365 attributes: { 46366 level, 46367 levelOptions, 46368 textAlign, 46369 isLink, 46370 rel, 46371 linkTarget 46372 }, 46373 setAttributes, 46374 context: { 46375 postType, 46376 postId, 46377 queryId 46378 }, 46379 insertBlocksAfter 46380 }) { 46381 const TagName = level === 0 ? 'p' : `h$level}`; 46382 const isDescendentOfQueryLoop = Number.isFinite(queryId); 46383 const userCanEdit = (0,external_wp_data_namespaceObject.useSelect)(select => { 46384 /** 46385 * useCanEditEntity may trigger an OPTIONS request to the REST API 46386 * via the canUser resolver. However, when the Post Title is a 46387 * descendant of a Query Loop block, the title cannot be edited. In 46388 * order to avoid these unnecessary requests, we call the hook 46389 * without the proper data, resulting in returning early without 46390 * making them. 46391 */ 46392 if (isDescendentOfQueryLoop) { 46393 return false; 46394 } 46395 return select(external_wp_coreData_namespaceObject.store).canUser('update', { 46396 kind: 'postType', 46397 name: postType, 46398 id: postId 46399 }); 46400 }, [isDescendentOfQueryLoop, postType, postId]); 46401 const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); 46402 const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId); 46403 const onSplitAtEnd = () => { 46404 insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())); 46405 }; 46406 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 46407 className: dist_clsx({ 46408 [`has-text-align-$textAlign}`]: textAlign 46409 }) 46410 }); 46411 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 46412 let titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 46413 ...blockProps, 46414 children: (0,external_wp_i18n_namespaceObject.__)('Title') 46415 }); 46416 if (postType && postId) { 46417 titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 46418 tagName: TagName, 46419 placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), 46420 value: rawTitle, 46421 onChange: setTitle, 46422 __experimentalVersion: 2, 46423 __unstableOnSplitAtEnd: onSplitAtEnd, 46424 ...blockProps 46425 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 46426 ...blockProps, 46427 dangerouslySetInnerHTML: { 46428 __html: fullTitle?.rendered 46429 } 46430 }); 46431 } 46432 if (isLink && postType && postId) { 46433 titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 46434 ...blockProps, 46435 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 46436 tagName: "a", 46437 href: link, 46438 target: linkTarget, 46439 rel: rel, 46440 placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No title') : null, 46441 value: rawTitle, 46442 onChange: setTitle, 46443 __experimentalVersion: 2, 46444 __unstableOnSplitAtEnd: onSplitAtEnd 46445 }) 46446 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 46447 ...blockProps, 46448 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 46449 href: link, 46450 target: linkTarget, 46451 rel: rel, 46452 onClick: event => event.preventDefault(), 46453 dangerouslySetInnerHTML: { 46454 __html: fullTitle?.rendered 46455 } 46456 }) 46457 }); 46458 } 46459 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 46460 children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 46461 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 46462 group: "block", 46463 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 46464 value: level, 46465 options: levelOptions, 46466 onChange: newLevel => setAttributes({ 46467 level: newLevel 46468 }) 46469 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 46470 value: textAlign, 46471 onChange: nextAlign => { 46472 setAttributes({ 46473 textAlign: nextAlign 46474 }); 46475 } 46476 })] 46477 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 46478 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 46479 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 46480 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 46481 __nextHasNoMarginBottom: true, 46482 label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'), 46483 onChange: () => setAttributes({ 46484 isLink: !isLink 46485 }), 46486 checked: isLink 46487 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 46488 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 46489 __nextHasNoMarginBottom: true, 46490 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 46491 onChange: value => setAttributes({ 46492 linkTarget: value ? '_blank' : '_self' 46493 }), 46494 checked: linkTarget === '_blank' 46495 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 46496 __next40pxDefaultSize: true, 46497 __nextHasNoMarginBottom: true, 46498 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 46499 value: rel, 46500 onChange: newRel => setAttributes({ 46501 rel: newRel 46502 }) 46503 })] 46504 })] 46505 }) 46506 })] 46507 }), titleElement] 46508 }); 46509 } 46510 46511 ;// ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js 46512 /** 46513 * Internal dependencies 46514 */ 46515 46516 const post_title_deprecated_v1 = { 46517 attributes: { 46518 textAlign: { 46519 type: 'string' 46520 }, 46521 level: { 46522 type: 'number', 46523 default: 2 46524 }, 46525 isLink: { 46526 type: 'boolean', 46527 default: false 46528 }, 46529 rel: { 46530 type: 'string', 46531 attribute: 'rel', 46532 default: '' 46533 }, 46534 linkTarget: { 46535 type: 'string', 46536 default: '_self' 46537 } 46538 }, 46539 supports: { 46540 align: ['wide', 'full'], 46541 html: false, 46542 color: { 46543 gradients: true, 46544 link: true 46545 }, 46546 spacing: { 46547 margin: true 46548 }, 46549 typography: { 46550 fontSize: true, 46551 lineHeight: true, 46552 __experimentalFontFamily: true, 46553 __experimentalFontWeight: true, 46554 __experimentalFontStyle: true, 46555 __experimentalTextTransform: true 46556 } 46557 }, 46558 save() { 46559 return null; 46560 }, 46561 migrate: migrate_font_family, 46562 isEligible({ 46563 style 46564 }) { 46565 return style?.typography?.fontFamily; 46566 } 46567 }; 46568 46569 /** 46570 * New deprecations need to be placed first 46571 * for them to have higher priority. 46572 * 46573 * Old deprecations may need to be updated as well. 46574 * 46575 * See block-deprecation.md 46576 */ 46577 /* harmony default export */ const post_title_deprecated = ([post_title_deprecated_v1]); 46578 46579 ;// ./node_modules/@wordpress/block-library/build-module/post-title/index.js 46580 /** 46581 * WordPress dependencies 46582 */ 46583 46584 46585 /** 46586 * Internal dependencies 46587 */ 46588 46589 const post_title_metadata = { 46590 $schema: "https://schemas.wp.org/trunk/block.json", 46591 apiVersion: 3, 46592 name: "core/post-title", 46593 title: "Title", 46594 category: "theme", 46595 description: "Displays the title of a post, page, or any other content-type.", 46596 textdomain: "default", 46597 usesContext: ["postId", "postType", "queryId"], 46598 attributes: { 46599 textAlign: { 46600 type: "string" 46601 }, 46602 level: { 46603 type: "number", 46604 "default": 2 46605 }, 46606 levelOptions: { 46607 type: "array" 46608 }, 46609 isLink: { 46610 type: "boolean", 46611 "default": false, 46612 role: "content" 46613 }, 46614 rel: { 46615 type: "string", 46616 attribute: "rel", 46617 "default": "", 46618 role: "content" 46619 }, 46620 linkTarget: { 46621 type: "string", 46622 "default": "_self", 46623 role: "content" 46624 } 46625 }, 46626 example: { 46627 viewportWidth: 350 46628 }, 46629 supports: { 46630 align: ["wide", "full"], 46631 html: false, 46632 color: { 46633 gradients: true, 46634 link: true, 46635 __experimentalDefaultControls: { 46636 background: true, 46637 text: true, 46638 link: true 46639 } 46640 }, 46641 spacing: { 46642 margin: true, 46643 padding: true 46644 }, 46645 typography: { 46646 fontSize: true, 46647 lineHeight: true, 46648 __experimentalFontFamily: true, 46649 __experimentalFontWeight: true, 46650 __experimentalFontStyle: true, 46651 __experimentalTextTransform: true, 46652 __experimentalTextDecoration: true, 46653 __experimentalLetterSpacing: true, 46654 __experimentalDefaultControls: { 46655 fontSize: true 46656 } 46657 }, 46658 interactivity: { 46659 clientNavigation: true 46660 }, 46661 __experimentalBorder: { 46662 radius: true, 46663 color: true, 46664 width: true, 46665 style: true, 46666 __experimentalDefaultControls: { 46667 radius: true, 46668 color: true, 46669 width: true, 46670 style: true 46671 } 46672 } 46673 }, 46674 style: "wp-block-post-title" 46675 }; 46676 46677 46678 const { 46679 name: post_title_name 46680 } = post_title_metadata; 46681 46682 const post_title_settings = { 46683 icon: library_title, 46684 edit: PostTitleEdit, 46685 deprecated: post_title_deprecated 46686 }; 46687 const post_title_init = () => initBlock({ 46688 name: post_title_name, 46689 metadata: post_title_metadata, 46690 settings: post_title_settings 46691 }); 46692 46693 ;// ./node_modules/@wordpress/icons/build-module/library/preformatted.js 46694 /** 46695 * WordPress dependencies 46696 */ 46697 46698 46699 const preformatted = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 46700 viewBox: "0 0 24 24", 46701 xmlns: "http://www.w3.org/2000/svg", 46702 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 46703 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" 46704 }) 46705 }); 46706 /* harmony default export */ const library_preformatted = (preformatted); 46707 46708 ;// ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js 46709 /** 46710 * WordPress dependencies 46711 */ 46712 46713 46714 46715 46716 function PreformattedEdit({ 46717 attributes, 46718 mergeBlocks, 46719 setAttributes, 46720 onRemove, 46721 insertBlocksAfter, 46722 style 46723 }) { 46724 const { 46725 content 46726 } = attributes; 46727 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 46728 style 46729 }); 46730 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 46731 tagName: "pre", 46732 identifier: "content", 46733 preserveWhiteSpace: true, 46734 value: content, 46735 onChange: nextContent => { 46736 setAttributes({ 46737 content: nextContent 46738 }); 46739 }, 46740 onRemove: onRemove, 46741 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'), 46742 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'), 46743 onMerge: mergeBlocks, 46744 ...blockProps, 46745 __unstablePastePlainText: true, 46746 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 46747 }); 46748 } 46749 46750 ;// ./node_modules/@wordpress/block-library/build-module/preformatted/save.js 46751 /** 46752 * WordPress dependencies 46753 */ 46754 46755 46756 function preformatted_save_save({ 46757 attributes 46758 }) { 46759 const { 46760 content 46761 } = attributes; 46762 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { 46763 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 46764 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 46765 value: content 46766 }) 46767 }); 46768 } 46769 46770 ;// ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js 46771 /** 46772 * WordPress dependencies 46773 */ 46774 46775 const preformatted_transforms_transforms = { 46776 from: [{ 46777 type: 'block', 46778 blocks: ['core/code', 'core/paragraph'], 46779 transform: ({ 46780 content, 46781 anchor 46782 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', { 46783 content, 46784 anchor 46785 }) 46786 }, { 46787 type: 'raw', 46788 isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'), 46789 schema: ({ 46790 phrasingContentSchema 46791 }) => ({ 46792 pre: { 46793 children: phrasingContentSchema 46794 } 46795 }) 46796 }], 46797 to: [{ 46798 type: 'block', 46799 blocks: ['core/paragraph'], 46800 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) 46801 }, { 46802 type: 'block', 46803 blocks: ['core/code'], 46804 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes) 46805 }] 46806 }; 46807 /* harmony default export */ const preformatted_transforms = (preformatted_transforms_transforms); 46808 46809 ;// ./node_modules/@wordpress/block-library/build-module/preformatted/index.js 46810 /** 46811 * WordPress dependencies 46812 */ 46813 46814 46815 46816 /** 46817 * Internal dependencies 46818 */ 46819 46820 46821 const preformatted_metadata = { 46822 $schema: "https://schemas.wp.org/trunk/block.json", 46823 apiVersion: 3, 46824 name: "core/preformatted", 46825 title: "Preformatted", 46826 category: "text", 46827 description: "Add text that respects your spacing and tabs, and also allows styling.", 46828 textdomain: "default", 46829 attributes: { 46830 content: { 46831 type: "rich-text", 46832 source: "rich-text", 46833 selector: "pre", 46834 __unstablePreserveWhiteSpace: true, 46835 role: "content" 46836 } 46837 }, 46838 supports: { 46839 anchor: true, 46840 color: { 46841 gradients: true, 46842 __experimentalDefaultControls: { 46843 background: true, 46844 text: true 46845 } 46846 }, 46847 spacing: { 46848 padding: true, 46849 margin: true 46850 }, 46851 typography: { 46852 fontSize: true, 46853 lineHeight: true, 46854 __experimentalFontFamily: true, 46855 __experimentalFontWeight: true, 46856 __experimentalFontStyle: true, 46857 __experimentalTextTransform: true, 46858 __experimentalTextDecoration: true, 46859 __experimentalLetterSpacing: true, 46860 __experimentalDefaultControls: { 46861 fontSize: true 46862 } 46863 }, 46864 interactivity: { 46865 clientNavigation: true 46866 }, 46867 __experimentalBorder: { 46868 radius: true, 46869 color: true, 46870 width: true, 46871 style: true, 46872 __experimentalDefaultControls: { 46873 radius: true, 46874 color: true, 46875 width: true, 46876 style: true 46877 } 46878 } 46879 }, 46880 style: "wp-block-preformatted" 46881 }; 46882 46883 46884 const { 46885 name: preformatted_name 46886 } = preformatted_metadata; 46887 46888 const preformatted_settings = { 46889 icon: library_preformatted, 46890 example: { 46891 attributes: { 46892 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 46893 // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work. 46894 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;') 46895 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 46896 } 46897 }, 46898 transforms: preformatted_transforms, 46899 edit: PreformattedEdit, 46900 save: preformatted_save_save, 46901 merge(attributes, attributesToMerge) { 46902 return { 46903 content: attributes.content + '\n\n' + attributesToMerge.content 46904 }; 46905 } 46906 }; 46907 const preformatted_init = () => initBlock({ 46908 name: preformatted_name, 46909 metadata: preformatted_metadata, 46910 settings: preformatted_settings 46911 }); 46912 46913 ;// ./node_modules/@wordpress/icons/build-module/library/pullquote.js 46914 /** 46915 * WordPress dependencies 46916 */ 46917 46918 46919 const pullquote = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 46920 viewBox: "0 0 24 24", 46921 xmlns: "http://www.w3.org/2000/svg", 46922 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 46923 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" 46924 }) 46925 }); 46926 /* harmony default export */ const library_pullquote = (pullquote); 46927 46928 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js 46929 const SOLID_COLOR_CLASS = `is-style-solid-color`; 46930 46931 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js 46932 /** 46933 * External dependencies 46934 */ 46935 46936 46937 /** 46938 * WordPress dependencies 46939 */ 46940 46941 46942 46943 /** 46944 * Internal dependencies 46945 */ 46946 46947 46948 const pullquote_deprecated_blockAttributes = { 46949 value: { 46950 type: 'string', 46951 source: 'html', 46952 selector: 'blockquote', 46953 multiline: 'p' 46954 }, 46955 citation: { 46956 type: 'string', 46957 source: 'html', 46958 selector: 'cite', 46959 default: '' 46960 }, 46961 mainColor: { 46962 type: 'string' 46963 }, 46964 customMainColor: { 46965 type: 'string' 46966 }, 46967 textColor: { 46968 type: 'string' 46969 }, 46970 customTextColor: { 46971 type: 'string' 46972 } 46973 }; 46974 function parseBorderColor(styleString) { 46975 if (!styleString) { 46976 return; 46977 } 46978 const matches = styleString.match(/border-color:([^;]+)[;]?/); 46979 if (matches && matches[1]) { 46980 return matches[1]; 46981 } 46982 } 46983 function multilineToInline(value) { 46984 value = value || `<p></p>`; 46985 const padded = `</p>$value}<p>`; 46986 const values = padded.split(`</p><p>`); 46987 values.shift(); 46988 values.pop(); 46989 return values.join('<br>'); 46990 } 46991 const pullquote_deprecated_v5 = { 46992 attributes: { 46993 value: { 46994 type: 'string', 46995 source: 'html', 46996 selector: 'blockquote', 46997 multiline: 'p', 46998 role: 'content' 46999 }, 47000 citation: { 47001 type: 'string', 47002 source: 'html', 47003 selector: 'cite', 47004 default: '', 47005 role: 'content' 47006 }, 47007 textAlign: { 47008 type: 'string' 47009 } 47010 }, 47011 save({ 47012 attributes 47013 }) { 47014 const { 47015 textAlign, 47016 citation, 47017 value 47018 } = attributes; 47019 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); 47020 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 47021 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 47022 className: dist_clsx({ 47023 [`has-text-align-$textAlign}`]: textAlign 47024 }) 47025 }), 47026 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47027 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47028 value: value, 47029 multiline: true 47030 }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47031 tagName: "cite", 47032 value: citation 47033 })] 47034 }) 47035 }); 47036 }, 47037 migrate({ 47038 value, 47039 ...attributes 47040 }) { 47041 return { 47042 value: multilineToInline(value), 47043 ...attributes 47044 }; 47045 } 47046 }; 47047 47048 // 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 47049 47050 const pullquote_deprecated_v4 = { 47051 attributes: { 47052 ...pullquote_deprecated_blockAttributes 47053 }, 47054 save({ 47055 attributes 47056 }) { 47057 const { 47058 mainColor, 47059 customMainColor, 47060 customTextColor, 47061 textColor, 47062 value, 47063 citation, 47064 className 47065 } = attributes; 47066 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47067 let figureClasses, figureStyles; 47068 47069 // Is solid color style 47070 if (isSolidColorStyle) { 47071 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 47072 figureClasses = dist_clsx({ 47073 'has-background': backgroundClass || customMainColor, 47074 [backgroundClass]: backgroundClass 47075 }); 47076 figureStyles = { 47077 backgroundColor: backgroundClass ? undefined : customMainColor 47078 }; 47079 // Is normal style and a custom color is being used ( we can set a style directly with its value) 47080 } else if (customMainColor) { 47081 figureStyles = { 47082 borderColor: customMainColor 47083 }; 47084 } 47085 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 47086 const blockquoteClasses = dist_clsx({ 47087 'has-text-color': textColor || customTextColor, 47088 [blockquoteTextColorClass]: blockquoteTextColorClass 47089 }); 47090 const blockquoteStyles = blockquoteTextColorClass ? undefined : { 47091 color: customTextColor 47092 }; 47093 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 47094 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 47095 className: figureClasses, 47096 style: figureStyles 47097 }), 47098 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47099 className: blockquoteClasses, 47100 style: blockquoteStyles, 47101 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47102 value: value, 47103 multiline: true 47104 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47105 tagName: "cite", 47106 value: citation 47107 })] 47108 }) 47109 }); 47110 }, 47111 migrate({ 47112 value, 47113 className, 47114 mainColor, 47115 customMainColor, 47116 customTextColor, 47117 ...attributes 47118 }) { 47119 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47120 let style; 47121 if (customMainColor) { 47122 if (!isSolidColorStyle) { 47123 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 47124 style = { 47125 border: { 47126 color: customMainColor 47127 } 47128 }; 47129 } else { 47130 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 47131 style = { 47132 color: { 47133 background: customMainColor 47134 } 47135 }; 47136 } 47137 } 47138 47139 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 47140 if (customTextColor && style) { 47141 style.color = { 47142 ...style.color, 47143 text: customTextColor 47144 }; 47145 } 47146 return { 47147 value: multilineToInline(value), 47148 className, 47149 backgroundColor: isSolidColorStyle ? mainColor : undefined, 47150 borderColor: isSolidColorStyle ? undefined : mainColor, 47151 textAlign: isSolidColorStyle ? 'left' : undefined, 47152 style, 47153 ...attributes 47154 }; 47155 } 47156 }; 47157 const pullquote_deprecated_v3 = { 47158 attributes: { 47159 ...pullquote_deprecated_blockAttributes, 47160 // figureStyle is an attribute that never existed. 47161 // We are using it as a way to access the styles previously applied to the figure. 47162 figureStyle: { 47163 source: 'attribute', 47164 selector: 'figure', 47165 attribute: 'style' 47166 } 47167 }, 47168 save({ 47169 attributes 47170 }) { 47171 const { 47172 mainColor, 47173 customMainColor, 47174 textColor, 47175 customTextColor, 47176 value, 47177 citation, 47178 className, 47179 figureStyle 47180 } = attributes; 47181 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47182 let figureClasses, figureStyles; 47183 47184 // Is solid color style 47185 if (isSolidColorStyle) { 47186 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 47187 figureClasses = dist_clsx({ 47188 'has-background': backgroundClass || customMainColor, 47189 [backgroundClass]: backgroundClass 47190 }); 47191 figureStyles = { 47192 backgroundColor: backgroundClass ? undefined : customMainColor 47193 }; 47194 // Is normal style and a custom color is being used ( we can set a style directly with its value) 47195 } else if (customMainColor) { 47196 figureStyles = { 47197 borderColor: customMainColor 47198 }; 47199 // If normal style and a named color are being used, we need to retrieve the color value to set the style, 47200 // as there is no expectation that themes create classes that set border colors. 47201 } else if (mainColor) { 47202 // Previously here we queried the color settings to know the color value 47203 // of a named color. This made the save function impure and the block was refactored, 47204 // because meanwhile a change in the editor made it impossible to query color settings in the save function. 47205 // Here instead of querying the color settings to know the color value, we retrieve the value 47206 // directly from the style previously serialized. 47207 const borderColor = parseBorderColor(figureStyle); 47208 figureStyles = { 47209 borderColor 47210 }; 47211 } 47212 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 47213 const blockquoteClasses = (textColor || customTextColor) && dist_clsx('has-text-color', { 47214 [blockquoteTextColorClass]: blockquoteTextColorClass 47215 }); 47216 const blockquoteStyles = blockquoteTextColorClass ? undefined : { 47217 color: customTextColor 47218 }; 47219 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 47220 className: figureClasses, 47221 style: figureStyles, 47222 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47223 className: blockquoteClasses, 47224 style: blockquoteStyles, 47225 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47226 value: value, 47227 multiline: true 47228 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47229 tagName: "cite", 47230 value: citation 47231 })] 47232 }) 47233 }); 47234 }, 47235 migrate({ 47236 value, 47237 className, 47238 figureStyle, 47239 mainColor, 47240 customMainColor, 47241 customTextColor, 47242 ...attributes 47243 }) { 47244 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47245 let style; 47246 if (customMainColor) { 47247 if (!isSolidColorStyle) { 47248 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 47249 style = { 47250 border: { 47251 color: customMainColor 47252 } 47253 }; 47254 } else { 47255 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 47256 style = { 47257 color: { 47258 background: customMainColor 47259 } 47260 }; 47261 } 47262 } 47263 47264 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 47265 if (customTextColor && style) { 47266 style.color = { 47267 ...style.color, 47268 text: customTextColor 47269 }; 47270 } 47271 // If is the default style, and a main color is set, 47272 // migrate the main color value into a custom border color. 47273 // The custom border color value is retrieved by parsing the figure styles. 47274 if (!isSolidColorStyle && mainColor && figureStyle) { 47275 const borderColor = parseBorderColor(figureStyle); 47276 if (borderColor) { 47277 return { 47278 value: multilineToInline(value), 47279 ...attributes, 47280 className, 47281 // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style. 47282 style: { 47283 border: { 47284 color: borderColor 47285 } 47286 } 47287 }; 47288 } 47289 } 47290 return { 47291 value: multilineToInline(value), 47292 className, 47293 backgroundColor: isSolidColorStyle ? mainColor : undefined, 47294 borderColor: isSolidColorStyle ? undefined : mainColor, 47295 textAlign: isSolidColorStyle ? 'left' : undefined, 47296 style, 47297 ...attributes 47298 }; 47299 } 47300 }; 47301 const pullquote_deprecated_v2 = { 47302 attributes: pullquote_deprecated_blockAttributes, 47303 save({ 47304 attributes 47305 }) { 47306 const { 47307 mainColor, 47308 customMainColor, 47309 textColor, 47310 customTextColor, 47311 value, 47312 citation, 47313 className 47314 } = attributes; 47315 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47316 let figureClass, figureStyles; 47317 // Is solid color style 47318 if (isSolidColorStyle) { 47319 figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); 47320 if (!figureClass) { 47321 figureStyles = { 47322 backgroundColor: customMainColor 47323 }; 47324 } 47325 // Is normal style and a custom color is being used ( we can set a style directly with its value) 47326 } else if (customMainColor) { 47327 figureStyles = { 47328 borderColor: customMainColor 47329 }; 47330 // Is normal style and a named color is being used, we need to retrieve the color value to set the style, 47331 // as there is no expectation that themes create classes that set border colors. 47332 } else if (mainColor) { 47333 var _select$getSettings$c; 47334 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 : []; 47335 const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor); 47336 figureStyles = { 47337 borderColor: colorObject.color 47338 }; 47339 } 47340 const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); 47341 const blockquoteClasses = textColor || customTextColor ? dist_clsx('has-text-color', { 47342 [blockquoteTextColorClass]: blockquoteTextColorClass 47343 }) : undefined; 47344 const blockquoteStyle = blockquoteTextColorClass ? undefined : { 47345 color: customTextColor 47346 }; 47347 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 47348 className: figureClass, 47349 style: figureStyles, 47350 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47351 className: blockquoteClasses, 47352 style: blockquoteStyle, 47353 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47354 value: value, 47355 multiline: true 47356 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47357 tagName: "cite", 47358 value: citation 47359 })] 47360 }) 47361 }); 47362 }, 47363 migrate({ 47364 value, 47365 className, 47366 mainColor, 47367 customMainColor, 47368 customTextColor, 47369 ...attributes 47370 }) { 47371 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47372 let style = {}; 47373 if (customMainColor) { 47374 if (!isSolidColorStyle) { 47375 // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. 47376 style = { 47377 border: { 47378 color: customMainColor 47379 } 47380 }; 47381 } else { 47382 // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. 47383 style = { 47384 color: { 47385 background: customMainColor 47386 } 47387 }; 47388 } 47389 } 47390 47391 // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. 47392 if (customTextColor && style) { 47393 style.color = { 47394 ...style.color, 47395 text: customTextColor 47396 }; 47397 } 47398 return { 47399 value: multilineToInline(value), 47400 className, 47401 backgroundColor: isSolidColorStyle ? mainColor : undefined, 47402 borderColor: isSolidColorStyle ? undefined : mainColor, 47403 textAlign: isSolidColorStyle ? 'left' : undefined, 47404 style, 47405 ...attributes 47406 }; 47407 } 47408 }; 47409 const pullquote_deprecated_v1 = { 47410 attributes: { 47411 ...pullquote_deprecated_blockAttributes 47412 }, 47413 save({ 47414 attributes 47415 }) { 47416 const { 47417 value, 47418 citation 47419 } = attributes; 47420 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47421 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47422 value: value, 47423 multiline: true 47424 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47425 tagName: "cite", 47426 value: citation 47427 })] 47428 }); 47429 }, 47430 migrate({ 47431 value, 47432 ...attributes 47433 }) { 47434 return { 47435 value: multilineToInline(value), 47436 ...attributes 47437 }; 47438 } 47439 }; 47440 const deprecated_v0 = { 47441 attributes: { 47442 ...pullquote_deprecated_blockAttributes, 47443 citation: { 47444 type: 'string', 47445 source: 'html', 47446 selector: 'footer' 47447 }, 47448 align: { 47449 type: 'string', 47450 default: 'none' 47451 } 47452 }, 47453 save({ 47454 attributes 47455 }) { 47456 const { 47457 value, 47458 citation, 47459 align 47460 } = attributes; 47461 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47462 className: `align$align}`, 47463 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47464 value: value, 47465 multiline: true 47466 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47467 tagName: "footer", 47468 value: citation 47469 })] 47470 }); 47471 }, 47472 migrate({ 47473 value, 47474 ...attributes 47475 }) { 47476 return { 47477 value: multilineToInline(value), 47478 ...attributes 47479 }; 47480 } 47481 }; 47482 47483 /** 47484 * New deprecations need to be placed first 47485 * for them to have higher priority. 47486 * 47487 * Old deprecations may need to be updated as well. 47488 * 47489 * See block-deprecation.md 47490 */ 47491 /* harmony default export */ const pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]); 47492 47493 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js 47494 const Figure = 'figure'; 47495 47496 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js 47497 const BlockQuote = 'blockquote'; 47498 47499 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js 47500 /** 47501 * External dependencies 47502 */ 47503 47504 47505 /** 47506 * WordPress dependencies 47507 */ 47508 47509 47510 47511 47512 47513 /** 47514 * Internal dependencies 47515 */ 47516 47517 47518 47519 const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; 47520 function PullQuoteEdit({ 47521 attributes, 47522 setAttributes, 47523 isSelected, 47524 insertBlocksAfter 47525 }) { 47526 const { 47527 textAlign, 47528 citation, 47529 value 47530 } = attributes; 47531 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 47532 className: dist_clsx({ 47533 [`has-text-align-$textAlign}`]: textAlign 47534 }) 47535 }); 47536 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected; 47537 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 47538 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 47539 group: "block", 47540 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 47541 value: textAlign, 47542 onChange: nextAlign => { 47543 setAttributes({ 47544 textAlign: nextAlign 47545 }); 47546 } 47547 }) 47548 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Figure, { 47549 ...blockProps, 47550 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockQuote, { 47551 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 47552 identifier: "value", 47553 tagName: "p", 47554 value: value, 47555 onChange: nextValue => setAttributes({ 47556 value: nextValue 47557 }), 47558 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'), 47559 placeholder: 47560 // translators: placeholder text used for the quote 47561 (0,external_wp_i18n_namespaceObject.__)('Add quote'), 47562 textAlign: "center" 47563 }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 47564 identifier: "citation", 47565 tagName: isWebPlatform ? 'cite' : undefined, 47566 style: { 47567 display: 'block' 47568 }, 47569 value: citation, 47570 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'), 47571 placeholder: 47572 // translators: placeholder text used for the citation 47573 (0,external_wp_i18n_namespaceObject.__)('Add citation'), 47574 onChange: nextCitation => setAttributes({ 47575 citation: nextCitation 47576 }), 47577 className: "wp-block-pullquote__citation", 47578 __unstableMobileNoFocusOnMount: true, 47579 textAlign: "center", 47580 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 47581 })] 47582 }) 47583 })] 47584 }); 47585 } 47586 /* harmony default export */ const pullquote_edit = (PullQuoteEdit); 47587 47588 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/save.js 47589 /** 47590 * External dependencies 47591 */ 47592 47593 47594 /** 47595 * WordPress dependencies 47596 */ 47597 47598 47599 function pullquote_save_save({ 47600 attributes 47601 }) { 47602 const { 47603 textAlign, 47604 citation, 47605 value 47606 } = attributes; 47607 const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); 47608 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { 47609 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 47610 className: dist_clsx({ 47611 [`has-text-align-$textAlign}`]: textAlign 47612 }) 47613 }), 47614 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 47615 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47616 tagName: "p", 47617 value: value 47618 }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 47619 tagName: "cite", 47620 value: citation 47621 })] 47622 }) 47623 }); 47624 } 47625 47626 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js 47627 /* wp:polyfill */ 47628 /** 47629 * WordPress dependencies 47630 */ 47631 47632 47633 const pullquote_transforms_transforms = { 47634 from: [{ 47635 type: 'block', 47636 isMultiBlock: true, 47637 blocks: ['core/paragraph'], 47638 transform: attributes => { 47639 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 47640 value: (0,external_wp_richText_namespaceObject.toHTMLString)({ 47641 value: (0,external_wp_richText_namespaceObject.join)(attributes.map(({ 47642 content 47643 }) => (0,external_wp_richText_namespaceObject.create)({ 47644 html: content 47645 })), '\n') 47646 }), 47647 anchor: attributes.anchor 47648 }); 47649 } 47650 }, { 47651 type: 'block', 47652 blocks: ['core/heading'], 47653 transform: ({ 47654 content, 47655 anchor 47656 }) => { 47657 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 47658 value: content, 47659 anchor 47660 }); 47661 } 47662 }], 47663 to: [{ 47664 type: 'block', 47665 blocks: ['core/paragraph'], 47666 transform: ({ 47667 value, 47668 citation 47669 }) => { 47670 const paragraphs = []; 47671 if (value) { 47672 paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 47673 content: value 47674 })); 47675 } 47676 if (citation) { 47677 paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 47678 content: citation 47679 })); 47680 } 47681 if (paragraphs.length === 0) { 47682 return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 47683 content: '' 47684 }); 47685 } 47686 return paragraphs; 47687 } 47688 }, { 47689 type: 'block', 47690 blocks: ['core/heading'], 47691 transform: ({ 47692 value, 47693 citation 47694 }) => { 47695 // If there is no pullquote content, use the citation as the 47696 // content of the resulting heading. A nonexistent citation 47697 // will result in an empty heading. 47698 if (!value) { 47699 return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 47700 content: citation 47701 }); 47702 } 47703 const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 47704 content: value 47705 }); 47706 if (!citation) { 47707 return headingBlock; 47708 } 47709 return [headingBlock, (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { 47710 content: citation 47711 })]; 47712 } 47713 }] 47714 }; 47715 /* harmony default export */ const pullquote_transforms = (pullquote_transforms_transforms); 47716 47717 ;// ./node_modules/@wordpress/block-library/build-module/pullquote/index.js 47718 /** 47719 * WordPress dependencies 47720 */ 47721 47722 47723 47724 /** 47725 * Internal dependencies 47726 */ 47727 47728 47729 47730 const pullquote_metadata = { 47731 $schema: "https://schemas.wp.org/trunk/block.json", 47732 apiVersion: 3, 47733 name: "core/pullquote", 47734 title: "Pullquote", 47735 category: "text", 47736 description: "Give special visual emphasis to a quote from your text.", 47737 textdomain: "default", 47738 attributes: { 47739 value: { 47740 type: "rich-text", 47741 source: "rich-text", 47742 selector: "p", 47743 role: "content" 47744 }, 47745 citation: { 47746 type: "rich-text", 47747 source: "rich-text", 47748 selector: "cite", 47749 role: "content" 47750 }, 47751 textAlign: { 47752 type: "string" 47753 } 47754 }, 47755 supports: { 47756 anchor: true, 47757 align: ["left", "right", "wide", "full"], 47758 background: { 47759 backgroundImage: true, 47760 backgroundSize: true, 47761 __experimentalDefaultControls: { 47762 backgroundImage: true 47763 } 47764 }, 47765 color: { 47766 gradients: true, 47767 background: true, 47768 link: true, 47769 __experimentalDefaultControls: { 47770 background: true, 47771 text: true 47772 } 47773 }, 47774 dimensions: { 47775 minHeight: true, 47776 __experimentalDefaultControls: { 47777 minHeight: false 47778 } 47779 }, 47780 spacing: { 47781 margin: true, 47782 padding: true 47783 }, 47784 typography: { 47785 fontSize: true, 47786 lineHeight: true, 47787 __experimentalFontFamily: true, 47788 __experimentalFontWeight: true, 47789 __experimentalFontStyle: true, 47790 __experimentalTextTransform: true, 47791 __experimentalTextDecoration: true, 47792 __experimentalLetterSpacing: true, 47793 __experimentalDefaultControls: { 47794 fontSize: true 47795 } 47796 }, 47797 __experimentalBorder: { 47798 color: true, 47799 radius: true, 47800 style: true, 47801 width: true, 47802 __experimentalDefaultControls: { 47803 color: true, 47804 radius: true, 47805 style: true, 47806 width: true 47807 } 47808 }, 47809 __experimentalStyle: { 47810 typography: { 47811 fontSize: "1.5em", 47812 lineHeight: "1.6" 47813 } 47814 }, 47815 interactivity: { 47816 clientNavigation: true 47817 } 47818 }, 47819 editorStyle: "wp-block-pullquote-editor", 47820 style: "wp-block-pullquote" 47821 }; 47822 47823 47824 const { 47825 name: pullquote_name 47826 } = pullquote_metadata; 47827 47828 const pullquote_settings = { 47829 icon: library_pullquote, 47830 example: { 47831 attributes: { 47832 value: 47833 // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg. 47834 (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.'), 47835 citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg') 47836 } 47837 }, 47838 transforms: pullquote_transforms, 47839 edit: pullquote_edit, 47840 save: pullquote_save_save, 47841 deprecated: pullquote_deprecated 47842 }; 47843 const pullquote_init = () => initBlock({ 47844 name: pullquote_name, 47845 metadata: pullquote_metadata, 47846 settings: pullquote_settings 47847 }); 47848 47849 ;// ./node_modules/@wordpress/icons/build-module/library/loop.js 47850 /** 47851 * WordPress dependencies 47852 */ 47853 47854 47855 const loop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 47856 viewBox: "0 0 24 24", 47857 xmlns: "http://www.w3.org/2000/svg", 47858 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 47859 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" 47860 }) 47861 }); 47862 /* harmony default export */ const library_loop = (loop); 47863 47864 ;// ./node_modules/@wordpress/block-library/build-module/query/utils.js 47865 /* wp:polyfill */ 47866 /** 47867 * WordPress dependencies 47868 */ 47869 47870 47871 47872 47873 47874 47875 47876 /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ 47877 47878 /** 47879 * @typedef IHasNameAndId 47880 * @property {string|number} id The entity's id. 47881 * @property {string} name The entity's name. 47882 */ 47883 47884 /** 47885 * The object used in Query block that contains info and helper mappings 47886 * from an array of IHasNameAndId objects. 47887 * 47888 * @typedef {Object} QueryEntitiesInfo 47889 * @property {IHasNameAndId[]} entities The array of entities. 47890 * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value. 47891 * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value. 47892 * @property {string[]} names Array with the entities' names. 47893 */ 47894 47895 /** 47896 * Returns a helper object with mapping from Objects that implement 47897 * the `IHasNameAndId` interface. The returned object is used for 47898 * integration with `FormTokenField` component. 47899 * 47900 * @param {IHasNameAndId[]} entities The entities to extract of helper object. 47901 * @return {QueryEntitiesInfo} The object with the entities information. 47902 */ 47903 const getEntitiesInfo = entities => { 47904 const mapping = entities?.reduce((accumulator, entity) => { 47905 const { 47906 mapById, 47907 mapByName, 47908 names 47909 } = accumulator; 47910 mapById[entity.id] = entity; 47911 mapByName[entity.name] = entity; 47912 names.push(entity.name); 47913 return accumulator; 47914 }, { 47915 mapById: {}, 47916 mapByName: {}, 47917 names: [] 47918 }); 47919 return { 47920 entities, 47921 ...mapping 47922 }; 47923 }; 47924 47925 /** 47926 * Helper util to return a value from a certain path of the object. 47927 * Path is specified as a string of properties, separated by dots, 47928 * for example: "parent.child". 47929 * 47930 * @param {Object} object Input object. 47931 * @param {string} path Path to the object property. 47932 * @return {*} Value of the object property at the specified path. 47933 */ 47934 const getValueFromObjectPath = (object, path) => { 47935 const normalizedPath = path.split('.'); 47936 let value = object; 47937 normalizedPath.forEach(fieldName => { 47938 value = value?.[fieldName]; 47939 }); 47940 return value; 47941 }; 47942 47943 /** 47944 * Helper util to map records to add a `name` prop from a 47945 * provided path, in order to handle all entities in the same 47946 * fashion(implementing`IHasNameAndId` interface). 47947 * 47948 * @param {Object[]} entities The array of entities. 47949 * @param {string} path The path to map a `name` property from the entity. 47950 * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. 47951 */ 47952 const mapToIHasNameAndId = (entities, path) => { 47953 return (entities || []).map(entity => ({ 47954 ...entity, 47955 name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getValueFromObjectPath(entity, path)) 47956 })); 47957 }; 47958 47959 /** 47960 * Returns a helper object that contains: 47961 * 1. An `options` object from the available post types, to be passed to a `SelectControl`. 47962 * 2. A helper map with available taxonomies per post type. 47963 * 3. A helper map with post format support per post type. 47964 * 47965 * @return {Object} The helper object related to post types. 47966 */ 47967 const usePostTypes = () => { 47968 const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => { 47969 const { 47970 getPostTypes 47971 } = select(external_wp_coreData_namespaceObject.store); 47972 const excludedPostTypes = ['attachment']; 47973 const filteredPostTypes = getPostTypes({ 47974 per_page: -1 47975 })?.filter(({ 47976 viewable, 47977 slug 47978 }) => viewable && !excludedPostTypes.includes(slug)); 47979 return filteredPostTypes; 47980 }, []); 47981 const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => { 47982 if (!postTypes?.length) { 47983 return; 47984 } 47985 return postTypes.reduce((accumulator, type) => { 47986 accumulator[type.slug] = type.taxonomies; 47987 return accumulator; 47988 }, {}); 47989 }, [postTypes]); 47990 const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(({ 47991 labels, 47992 slug 47993 }) => ({ 47994 label: labels.singular_name, 47995 value: slug 47996 })), [postTypes]); 47997 const postTypeFormatSupportMap = (0,external_wp_element_namespaceObject.useMemo)(() => { 47998 if (!postTypes?.length) { 47999 return {}; 48000 } 48001 return postTypes.reduce((accumulator, type) => { 48002 accumulator[type.slug] = type.supports?.['post-formats'] || false; 48003 return accumulator; 48004 }, {}); 48005 }, [postTypes]); 48006 return { 48007 postTypesTaxonomiesMap, 48008 postTypesSelectOptions, 48009 postTypeFormatSupportMap 48010 }; 48011 }; 48012 48013 /** 48014 * Hook that returns the taxonomies associated with a specific post type. 48015 * 48016 * @param {string} postType The post type from which to retrieve the associated taxonomies. 48017 * @return {Object[]} An array of the associated taxonomies. 48018 */ 48019 const useTaxonomies = postType => { 48020 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { 48021 const { 48022 getTaxonomies, 48023 getPostType 48024 } = select(external_wp_coreData_namespaceObject.store); 48025 // Does the post type have taxonomies? 48026 if (getPostType(postType)?.taxonomies?.length > 0) { 48027 return getTaxonomies({ 48028 type: postType, 48029 per_page: -1 48030 }); 48031 } 48032 return []; 48033 }, [postType]); 48034 return (0,external_wp_element_namespaceObject.useMemo)(() => { 48035 return taxonomies?.filter(({ 48036 visibility 48037 }) => !!visibility?.publicly_queryable); 48038 }, [taxonomies]); 48039 }; 48040 48041 /** 48042 * Hook that returns whether a specific post type is hierarchical. 48043 * 48044 * @param {string} postType The post type to check. 48045 * @return {boolean} Whether a specific post type is hierarchical. 48046 */ 48047 function useIsPostTypeHierarchical(postType) { 48048 return (0,external_wp_data_namespaceObject.useSelect)(select => { 48049 const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType); 48050 return type?.viewable && type?.hierarchical; 48051 }, [postType]); 48052 } 48053 48054 /** 48055 * Hook that returns the query properties' names defined by the active 48056 * block variation, to determine which block's filters to show. 48057 * 48058 * @param {Object} attributes Block attributes. 48059 * @return {string[]} An array of the query attributes. 48060 */ 48061 function useAllowedControls(attributes) { 48062 return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.allowedControls, [attributes]); 48063 } 48064 function isControlAllowed(allowedControls, key) { 48065 // Every controls is allowed if the list is not defined. 48066 if (!allowedControls) { 48067 return true; 48068 } 48069 return allowedControls.includes(key); 48070 } 48071 48072 /** 48073 * Clones a pattern's blocks and then recurses over that list of blocks, 48074 * transforming them to retain some `query` attribute properties. 48075 * For now we retain the `postType` and `inherit` properties as they are 48076 * fundamental for the expected functionality of the block and don't affect 48077 * its design and presentation. 48078 * 48079 * Returns the cloned/transformed blocks and array of existing Query Loop 48080 * client ids for further manipulation, in order to avoid multiple recursions. 48081 * 48082 * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate). 48083 * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes. 48084 * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks. 48085 */ 48086 const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => { 48087 const { 48088 query: { 48089 postType, 48090 inherit 48091 }, 48092 namespace 48093 } = queryBlockAttributes; 48094 const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); 48095 const queryClientIds = []; 48096 const blocksQueue = [...clonedBlocks]; 48097 while (blocksQueue.length > 0) { 48098 const block = blocksQueue.shift(); 48099 if (block.name === 'core/query') { 48100 block.attributes.query = { 48101 ...block.attributes.query, 48102 postType, 48103 inherit 48104 }; 48105 if (namespace) { 48106 block.attributes.namespace = namespace; 48107 } 48108 queryClientIds.push(block.clientId); 48109 } 48110 block.innerBlocks?.forEach(innerBlock => { 48111 blocksQueue.push(innerBlock); 48112 }); 48113 } 48114 return { 48115 newBlocks: clonedBlocks, 48116 queryClientIds 48117 }; 48118 }; 48119 48120 /** 48121 * Helper hook that determines if there is an active variation of the block 48122 * and if there are available specific patterns for this variation. 48123 * If there are, these patterns are going to be the only ones suggested to 48124 * the user in setup and replace flow, without including the default ones 48125 * for Query Loop. 48126 * 48127 * If there are no such patterns, the default ones for Query Loop are going 48128 * to be suggested. 48129 * 48130 * @param {string} clientId The block's client ID. 48131 * @param {Object} attributes The block's attributes. 48132 * @return {string} The block name to be used in the patterns suggestions. 48133 */ 48134 function useBlockNameForPatterns(clientId, attributes) { 48135 return (0,external_wp_data_namespaceObject.useSelect)(select => { 48136 const activeVariationName = select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.name; 48137 if (!activeVariationName) { 48138 return 'core/query'; 48139 } 48140 const { 48141 getBlockRootClientId, 48142 getPatternsByBlockTypes 48143 } = select(external_wp_blockEditor_namespaceObject.store); 48144 const rootClientId = getBlockRootClientId(clientId); 48145 const activePatterns = getPatternsByBlockTypes(`core/query/$activeVariationName}`, rootClientId); 48146 return activePatterns.length > 0 ? `core/query/$activeVariationName}` : 'core/query'; 48147 }, [clientId, attributes]); 48148 } 48149 48150 /** 48151 * Helper hook that determines if there is an active variation of the block 48152 * and if there are available specific scoped `block` variations connected with 48153 * this variation. 48154 * 48155 * If there are, these variations are going to be the only ones suggested 48156 * to the user in setup flow when clicking to `start blank`, without including 48157 * the default ones for Query Loop. 48158 * 48159 * If there are no such scoped `block` variations, the default ones for Query 48160 * Loop are going to be suggested. 48161 * 48162 * The way we determine such variations is with the convention that they have the `namespace` 48163 * attribute defined as an array. This array should contain the names(`name` property) of any 48164 * variations they want to be connected to. 48165 * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`, 48166 * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`. 48167 * If the user selects this variation, the `namespace` attribute will be overridden by the 48168 * main `inserter` variation. 48169 * 48170 * @param {Object} attributes The block's attributes. 48171 * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`. 48172 */ 48173 function useScopedBlockVariations(attributes) { 48174 const { 48175 activeVariationName, 48176 blockVariations 48177 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 48178 const { 48179 getActiveBlockVariation, 48180 getBlockVariations 48181 } = select(external_wp_blocks_namespaceObject.store); 48182 return { 48183 activeVariationName: getActiveBlockVariation('core/query', attributes)?.name, 48184 blockVariations: getBlockVariations('core/query', 'block') 48185 }; 48186 }, [attributes]); 48187 const variations = (0,external_wp_element_namespaceObject.useMemo)(() => { 48188 // Filter out the variations that have defined a `namespace` attribute, 48189 // which means they are 'connected' to specific variations of the block. 48190 const isNotConnected = variation => !variation.attributes?.namespace; 48191 if (!activeVariationName) { 48192 return blockVariations.filter(isNotConnected); 48193 } 48194 const connectedVariations = blockVariations.filter(variation => variation.attributes?.namespace?.includes(activeVariationName)); 48195 if (!!connectedVariations.length) { 48196 return connectedVariations; 48197 } 48198 return blockVariations.filter(isNotConnected); 48199 }, [activeVariationName, blockVariations]); 48200 return variations; 48201 } 48202 48203 /** 48204 * Hook that returns the block patterns for a specific block type. 48205 * 48206 * @param {string} clientId The block's client ID. 48207 * @param {string} name The block type name. 48208 * @return {Object[]} An array of valid block patterns. 48209 */ 48210 const usePatterns = (clientId, name) => { 48211 return (0,external_wp_data_namespaceObject.useSelect)(select => { 48212 const { 48213 getBlockRootClientId, 48214 getPatternsByBlockTypes 48215 } = select(external_wp_blockEditor_namespaceObject.store); 48216 const rootClientId = getBlockRootClientId(clientId); 48217 return getPatternsByBlockTypes(name, rootClientId); 48218 }, [name, clientId]); 48219 }; 48220 48221 /** 48222 * The object returned by useUnsupportedBlocks with info about the type of 48223 * unsupported blocks present inside the Query block. 48224 * 48225 * @typedef {Object} UnsupportedBlocksInfo 48226 * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present. 48227 * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present. 48228 * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks. 48229 */ 48230 48231 /** 48232 * Hook that returns an object with information about the unsupported blocks 48233 * present inside a Query Loop with the given `clientId`. The returned object 48234 * contains props that are true when a certain type of unsupported block is 48235 * present. 48236 * 48237 * @param {string} clientId The block's client ID. 48238 * @return {UnsupportedBlocksInfo} The object containing the information. 48239 */ 48240 const useUnsupportedBlocks = clientId => { 48241 return (0,external_wp_data_namespaceObject.useSelect)(select => { 48242 const { 48243 getClientIdsOfDescendants, 48244 getBlockName 48245 } = select(external_wp_blockEditor_namespaceObject.store); 48246 const blocks = {}; 48247 getClientIdsOfDescendants(clientId).forEach(descendantClientId => { 48248 const blockName = getBlockName(descendantClientId); 48249 /* 48250 * Client side navigation can be true in two states: 48251 * - supports.interactivity = true; 48252 * - supports.interactivity.clientNavigation = true; 48253 */ 48254 const blockSupportsInteractivity = Object.is((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity'), true); 48255 const blockSupportsInteractivityClientNavigation = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity.clientNavigation'); 48256 const blockInteractivity = blockSupportsInteractivity || blockSupportsInteractivityClientNavigation; 48257 if (!blockInteractivity) { 48258 blocks.hasBlocksFromPlugins = true; 48259 } else if (blockName === 'core/post-content') { 48260 blocks.hasPostContentBlock = true; 48261 } 48262 }); 48263 blocks.hasUnsupportedBlocks = blocks.hasBlocksFromPlugins || blocks.hasPostContentBlock; 48264 return blocks; 48265 }, [clientId]); 48266 }; 48267 48268 /** 48269 * Helper function that returns the query context from the editor based on the 48270 * available template slug. 48271 * 48272 * @param {string} templateSlug Current template slug based on context. 48273 * @return {Object} An object with isSingular and templateType properties. 48274 */ 48275 function getQueryContextFromTemplate(templateSlug) { 48276 // In the Post Editor, the template slug is not available. 48277 if (!templateSlug) { 48278 return { 48279 isSingular: true 48280 }; 48281 } 48282 let isSingular = false; 48283 let templateType = templateSlug === 'wp' ? 'custom' : templateSlug; 48284 const singularTemplates = ['404', 'blank', 'single', 'page', 'custom']; 48285 const templateTypeFromSlug = templateSlug.includes('-') ? templateSlug.split('-', 1)[0] : templateSlug; 48286 const queryFromTemplateSlug = templateSlug.includes('-') ? templateSlug.split('-').slice(1).join('-') : ''; 48287 if (queryFromTemplateSlug) { 48288 templateType = templateTypeFromSlug; 48289 } 48290 isSingular = singularTemplates.includes(templateType); 48291 return { 48292 isSingular, 48293 templateType 48294 }; 48295 } 48296 48297 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js 48298 /** 48299 * WordPress dependencies 48300 */ 48301 48302 48303 48304 /** 48305 * Internal dependencies 48306 */ 48307 48308 48309 function EnhancedPaginationControl({ 48310 enhancedPagination, 48311 setAttributes, 48312 clientId 48313 }) { 48314 const { 48315 hasUnsupportedBlocks 48316 } = useUnsupportedBlocks(clientId); 48317 const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation; 48318 let help = (0,external_wp_i18n_namespaceObject.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.'); 48319 if (fullPageClientSideNavigation) { 48320 help = (0,external_wp_i18n_namespaceObject.__)('Experimental full-page client-side navigation setting enabled.'); 48321 } else if (hasUnsupportedBlocks) { 48322 help = (0,external_wp_i18n_namespaceObject.__)('Enhancement disabled because there are non-compatible blocks inside the Query block.'); 48323 } 48324 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 48325 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 48326 __nextHasNoMarginBottom: true, 48327 label: (0,external_wp_i18n_namespaceObject.__)('Reload full page'), 48328 help: help, 48329 checked: !enhancedPagination && !fullPageClientSideNavigation, 48330 disabled: hasUnsupportedBlocks || fullPageClientSideNavigation, 48331 onChange: value => { 48332 setAttributes({ 48333 enhancedPagination: !value 48334 }); 48335 } 48336 }) 48337 }); 48338 } 48339 48340 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js 48341 /** 48342 * WordPress dependencies 48343 */ 48344 48345 48346 48347 const orderOptions = [{ 48348 label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'), 48349 value: 'date/desc' 48350 }, { 48351 label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'), 48352 value: 'date/asc' 48353 }, { 48354 /* translators: Label for ordering posts by title in ascending order. */ 48355 label: (0,external_wp_i18n_namespaceObject.__)('A → Z'), 48356 value: 'title/asc' 48357 }, { 48358 /* translators: Label for ordering posts by title in descending order. */ 48359 label: (0,external_wp_i18n_namespaceObject.__)('Z → A'), 48360 value: 'title/desc' 48361 }]; 48362 function OrderControl({ 48363 order, 48364 orderBy, 48365 onChange 48366 }) { 48367 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 48368 __nextHasNoMarginBottom: true, 48369 __next40pxDefaultSize: true, 48370 label: (0,external_wp_i18n_namespaceObject.__)('Order by'), 48371 value: `$orderBy}/$order}`, 48372 options: orderOptions, 48373 onChange: value => { 48374 const [newOrderBy, newOrder] = value.split('/'); 48375 onChange({ 48376 order: newOrder, 48377 orderBy: newOrderBy 48378 }); 48379 } 48380 }); 48381 } 48382 /* harmony default export */ const order_control = (OrderControl); 48383 48384 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js 48385 /* wp:polyfill */ 48386 /** 48387 * WordPress dependencies 48388 */ 48389 48390 48391 48392 48393 48394 /** 48395 * Internal dependencies 48396 */ 48397 48398 48399 const author_control_AUTHORS_QUERY = { 48400 who: 'authors', 48401 per_page: -1, 48402 _fields: 'id,name', 48403 context: 'view' 48404 }; 48405 function AuthorControl({ 48406 value, 48407 onChange 48408 }) { 48409 const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { 48410 const { 48411 getUsers 48412 } = select(external_wp_coreData_namespaceObject.store); 48413 return getUsers(author_control_AUTHORS_QUERY); 48414 }, []); 48415 if (!authorsList) { 48416 return null; 48417 } 48418 const authorsInfo = getEntitiesInfo(authorsList); 48419 /** 48420 * We need to normalize the value because the block operates on a 48421 * comma(`,`) separated string value and `FormTokenField` needs an 48422 * array. 48423 */ 48424 const normalizedValue = !value ? [] : value.toString().split(','); 48425 // Returns only the existing authors ids. This prevents the component 48426 // from crashing in the editor, when non existing ids are provided. 48427 const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => { 48428 const author = authorsInfo.mapById[authorId]; 48429 if (author) { 48430 accumulator.push({ 48431 id: authorId, 48432 value: author.name 48433 }); 48434 } 48435 return accumulator; 48436 }, []); 48437 const getIdByValue = (entitiesMappedByName, authorValue) => { 48438 const id = authorValue?.id || entitiesMappedByName[authorValue]?.id; 48439 if (id) { 48440 return id; 48441 } 48442 }; 48443 const onAuthorChange = newValue => { 48444 const ids = Array.from(newValue.reduce((accumulator, author) => { 48445 // Verify that new values point to existing entities. 48446 const id = getIdByValue(authorsInfo.mapByName, author); 48447 if (id) { 48448 accumulator.add(id); 48449 } 48450 return accumulator; 48451 }, new Set())); 48452 onChange({ 48453 author: ids.join(',') 48454 }); 48455 }; 48456 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { 48457 label: (0,external_wp_i18n_namespaceObject.__)('Authors'), 48458 value: sanitizedValue, 48459 suggestions: authorsInfo.names, 48460 onChange: onAuthorChange, 48461 __experimentalShowHowTo: false, 48462 __nextHasNoMarginBottom: true, 48463 __next40pxDefaultSize: true 48464 }); 48465 } 48466 /* harmony default export */ const author_control = (AuthorControl); 48467 48468 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/parent-control.js 48469 /* wp:polyfill */ 48470 /** 48471 * WordPress dependencies 48472 */ 48473 48474 48475 48476 48477 48478 48479 48480 /** 48481 * Internal dependencies 48482 */ 48483 48484 48485 const parent_control_EMPTY_ARRAY = []; 48486 const BASE_QUERY = { 48487 order: 'asc', 48488 _fields: 'id,title', 48489 context: 'view' 48490 }; 48491 function ParentControl({ 48492 parents, 48493 postType, 48494 onChange 48495 }) { 48496 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); 48497 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); 48498 const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); 48499 const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); 48500 const { 48501 searchResults, 48502 searchHasResolved 48503 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 48504 if (!search) { 48505 return { 48506 searchResults: parent_control_EMPTY_ARRAY, 48507 searchHasResolved: true 48508 }; 48509 } 48510 const { 48511 getEntityRecords, 48512 hasFinishedResolution 48513 } = select(external_wp_coreData_namespaceObject.store); 48514 const selectorArgs = ['postType', postType, { 48515 ...BASE_QUERY, 48516 search, 48517 orderby: 'relevance', 48518 exclude: parents, 48519 per_page: 20 48520 }]; 48521 return { 48522 searchResults: getEntityRecords(...selectorArgs), 48523 searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) 48524 }; 48525 }, [search, parents]); 48526 const currentParents = (0,external_wp_data_namespaceObject.useSelect)(select => { 48527 if (!parents?.length) { 48528 return parent_control_EMPTY_ARRAY; 48529 } 48530 const { 48531 getEntityRecords 48532 } = select(external_wp_coreData_namespaceObject.store); 48533 return getEntityRecords('postType', postType, { 48534 ...BASE_QUERY, 48535 include: parents, 48536 per_page: parents.length 48537 }); 48538 }, [parents]); 48539 // Update the `value` state only after the selectors are resolved 48540 // to avoid emptying the input when we're changing parents. 48541 (0,external_wp_element_namespaceObject.useEffect)(() => { 48542 if (!parents?.length) { 48543 setValue(parent_control_EMPTY_ARRAY); 48544 } 48545 if (!currentParents?.length) { 48546 return; 48547 } 48548 const currentParentsInfo = getEntitiesInfo(mapToIHasNameAndId(currentParents, 'title.rendered')); 48549 // Returns only the existing entity ids. This prevents the component 48550 // from crashing in the editor, when non existing ids are provided. 48551 const sanitizedValue = parents.reduce((accumulator, id) => { 48552 const entity = currentParentsInfo.mapById[id]; 48553 if (entity) { 48554 accumulator.push({ 48555 id, 48556 value: entity.name 48557 }); 48558 } 48559 return accumulator; 48560 }, []); 48561 setValue(sanitizedValue); 48562 }, [parents, currentParents]); 48563 const entitiesInfo = (0,external_wp_element_namespaceObject.useMemo)(() => { 48564 if (!searchResults?.length) { 48565 return parent_control_EMPTY_ARRAY; 48566 } 48567 return getEntitiesInfo(mapToIHasNameAndId(searchResults, 'title.rendered')); 48568 }, [searchResults]); 48569 // Update suggestions only when the query has resolved. 48570 (0,external_wp_element_namespaceObject.useEffect)(() => { 48571 if (!searchHasResolved) { 48572 return; 48573 } 48574 setSuggestions(entitiesInfo.names); 48575 }, [entitiesInfo.names, searchHasResolved]); 48576 const getIdByValue = (entitiesMappedByName, entity) => { 48577 const id = entity?.id || entitiesMappedByName?.[entity]?.id; 48578 if (id) { 48579 return id; 48580 } 48581 }; 48582 const onParentChange = newValue => { 48583 const ids = Array.from(newValue.reduce((accumulator, entity) => { 48584 // Verify that new values point to existing entities. 48585 const id = getIdByValue(entitiesInfo.mapByName, entity); 48586 if (id) { 48587 accumulator.add(id); 48588 } 48589 return accumulator; 48590 }, new Set())); 48591 setSuggestions(parent_control_EMPTY_ARRAY); 48592 onChange({ 48593 parents: ids 48594 }); 48595 }; 48596 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { 48597 __next40pxDefaultSize: true, 48598 label: (0,external_wp_i18n_namespaceObject.__)('Parents'), 48599 value: value, 48600 onInputChange: debouncedSearch, 48601 suggestions: suggestions, 48602 onChange: onParentChange, 48603 __experimentalShowHowTo: false, 48604 __nextHasNoMarginBottom: true 48605 }); 48606 } 48607 /* harmony default export */ const parent_control = (ParentControl); 48608 48609 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js 48610 /* wp:polyfill */ 48611 /** 48612 * WordPress dependencies 48613 */ 48614 48615 48616 48617 48618 48619 48620 48621 /** 48622 * Internal dependencies 48623 */ 48624 48625 48626 const taxonomy_controls_EMPTY_ARRAY = []; 48627 const taxonomy_controls_BASE_QUERY = { 48628 order: 'asc', 48629 _fields: 'id,name', 48630 context: 'view' 48631 }; 48632 48633 // Helper function to get the term id based on user input in terms `FormTokenField`. 48634 const getTermIdByTermValue = (terms, termValue) => { 48635 // First we check for exact match by `term.id` or case sensitive `term.name` match. 48636 const termId = termValue?.id || terms?.find(term => term.name === termValue)?.id; 48637 if (termId) { 48638 return termId; 48639 } 48640 48641 /** 48642 * Here we make an extra check for entered terms in a non case sensitive way, 48643 * to match user expectations, due to `FormTokenField` behaviour that shows 48644 * suggestions which are case insensitive. 48645 * 48646 * Although WP tries to discourage users to add terms with the same name (case insensitive), 48647 * it's still possible if you manually change the name, as long as the terms have different slugs. 48648 * In this edge case we always apply the first match from the terms list. 48649 */ 48650 const termValueLower = termValue.toLocaleLowerCase(); 48651 return terms?.find(term => term.name.toLocaleLowerCase() === termValueLower)?.id; 48652 }; 48653 function TaxonomyControls({ 48654 onChange, 48655 query 48656 }) { 48657 const { 48658 postType, 48659 taxQuery 48660 } = query; 48661 const taxonomies = useTaxonomies(postType); 48662 if (!taxonomies || taxonomies.length === 0) { 48663 return null; 48664 } 48665 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { 48666 spacing: 4, 48667 children: taxonomies.map(taxonomy => { 48668 const termIds = taxQuery?.[taxonomy.slug] || []; 48669 const handleChange = newTermIds => onChange({ 48670 taxQuery: { 48671 ...taxQuery, 48672 [taxonomy.slug]: newTermIds 48673 } 48674 }); 48675 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyItem, { 48676 taxonomy: taxonomy, 48677 termIds: termIds, 48678 onChange: handleChange 48679 }, taxonomy.slug); 48680 }) 48681 }); 48682 } 48683 48684 /** 48685 * Renders a `FormTokenField` for a given taxonomy. 48686 * 48687 * @param {Object} props The props for the component. 48688 * @param {Object} props.taxonomy The taxonomy object. 48689 * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy. 48690 * @param {Function} props.onChange Callback `onChange` function. 48691 * @return {JSX.Element} The rendered component. 48692 */ 48693 function TaxonomyItem({ 48694 taxonomy, 48695 termIds, 48696 onChange 48697 }) { 48698 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); 48699 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); 48700 const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); 48701 const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); 48702 const { 48703 searchResults, 48704 searchHasResolved 48705 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 48706 if (!search) { 48707 return { 48708 searchResults: taxonomy_controls_EMPTY_ARRAY, 48709 searchHasResolved: true 48710 }; 48711 } 48712 const { 48713 getEntityRecords, 48714 hasFinishedResolution 48715 } = select(external_wp_coreData_namespaceObject.store); 48716 const selectorArgs = ['taxonomy', taxonomy.slug, { 48717 ...taxonomy_controls_BASE_QUERY, 48718 search, 48719 orderby: 'name', 48720 exclude: termIds, 48721 per_page: 20 48722 }]; 48723 return { 48724 searchResults: getEntityRecords(...selectorArgs), 48725 searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) 48726 }; 48727 }, [search, termIds]); 48728 // `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`. 48729 // They are used to extract the terms' names to populate the `FormTokenField` properly 48730 // and to sanitize the provided `termIds`, by setting only the ones that exist. 48731 const existingTerms = (0,external_wp_data_namespaceObject.useSelect)(select => { 48732 if (!termIds?.length) { 48733 return taxonomy_controls_EMPTY_ARRAY; 48734 } 48735 const { 48736 getEntityRecords 48737 } = select(external_wp_coreData_namespaceObject.store); 48738 return getEntityRecords('taxonomy', taxonomy.slug, { 48739 ...taxonomy_controls_BASE_QUERY, 48740 include: termIds, 48741 per_page: termIds.length 48742 }); 48743 }, [termIds]); 48744 // Update the `value` state only after the selectors are resolved 48745 // to avoid emptying the input when we're changing terms. 48746 (0,external_wp_element_namespaceObject.useEffect)(() => { 48747 if (!termIds?.length) { 48748 setValue(taxonomy_controls_EMPTY_ARRAY); 48749 } 48750 if (!existingTerms?.length) { 48751 return; 48752 } 48753 // Returns only the existing entity ids. This prevents the component 48754 // from crashing in the editor, when non existing ids are provided. 48755 const sanitizedValue = termIds.reduce((accumulator, id) => { 48756 const entity = existingTerms.find(term => term.id === id); 48757 if (entity) { 48758 accumulator.push({ 48759 id, 48760 value: entity.name 48761 }); 48762 } 48763 return accumulator; 48764 }, []); 48765 setValue(sanitizedValue); 48766 }, [termIds, existingTerms]); 48767 // Update suggestions only when the query has resolved. 48768 (0,external_wp_element_namespaceObject.useEffect)(() => { 48769 if (!searchHasResolved) { 48770 return; 48771 } 48772 setSuggestions(searchResults.map(result => result.name)); 48773 }, [searchResults, searchHasResolved]); 48774 const onTermsChange = newTermValues => { 48775 const newTermIds = new Set(); 48776 for (const termValue of newTermValues) { 48777 const termId = getTermIdByTermValue(searchResults, termValue); 48778 if (termId) { 48779 newTermIds.add(termId); 48780 } 48781 } 48782 setSuggestions(taxonomy_controls_EMPTY_ARRAY); 48783 onChange(Array.from(newTermIds)); 48784 }; 48785 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 48786 className: "block-library-query-inspector__taxonomy-control", 48787 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { 48788 label: taxonomy.name, 48789 value: value, 48790 onInputChange: debouncedSearch, 48791 suggestions: suggestions, 48792 displayTransform: external_wp_htmlEntities_namespaceObject.decodeEntities, 48793 onChange: onTermsChange, 48794 __experimentalShowHowTo: false, 48795 __nextHasNoMarginBottom: true, 48796 __next40pxDefaultSize: true 48797 }) 48798 }); 48799 } 48800 48801 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/format-controls.js 48802 /* wp:polyfill */ 48803 /** 48804 * WordPress dependencies 48805 */ 48806 48807 48808 48809 48810 48811 // All WP post formats, sorted alphabetically by translated name. 48812 // Value is the post format slug. Label is the name. 48813 48814 const POST_FORMATS = [{ 48815 value: 'aside', 48816 label: (0,external_wp_i18n_namespaceObject.__)('Aside') 48817 }, { 48818 value: 'audio', 48819 label: (0,external_wp_i18n_namespaceObject.__)('Audio') 48820 }, { 48821 value: 'chat', 48822 label: (0,external_wp_i18n_namespaceObject.__)('Chat') 48823 }, { 48824 value: 'gallery', 48825 label: (0,external_wp_i18n_namespaceObject.__)('Gallery') 48826 }, { 48827 value: 'image', 48828 label: (0,external_wp_i18n_namespaceObject.__)('Image') 48829 }, { 48830 value: 'link', 48831 label: (0,external_wp_i18n_namespaceObject.__)('Link') 48832 }, { 48833 value: 'quote', 48834 label: (0,external_wp_i18n_namespaceObject.__)('Quote') 48835 }, { 48836 value: 'standard', 48837 label: (0,external_wp_i18n_namespaceObject.__)('Standard') 48838 }, { 48839 value: 'status', 48840 label: (0,external_wp_i18n_namespaceObject.__)('Status') 48841 }, { 48842 value: 'video', 48843 label: (0,external_wp_i18n_namespaceObject.__)('Video') 48844 }].sort((a, b) => { 48845 const normalizedA = a.label.toUpperCase(); 48846 const normalizedB = b.label.toUpperCase(); 48847 if (normalizedA < normalizedB) { 48848 return -1; 48849 } 48850 if (normalizedA > normalizedB) { 48851 return 1; 48852 } 48853 return 0; 48854 }); 48855 48856 // A helper function to convert translatable post format names into their static values. 48857 function formatNamesToValues(names, formats) { 48858 return names.map(name => { 48859 return formats.find(item => item.label.toLocaleLowerCase() === name.toLocaleLowerCase())?.value; 48860 }).filter(Boolean); 48861 } 48862 function FormatControls({ 48863 onChange, 48864 query: { 48865 format 48866 } 48867 }) { 48868 // 'format' is expected to be an array. If it is not an array, for example 48869 // if a user has manually entered an invalid value in the block markup, 48870 // convert it to an array to prevent JavaScript errors. 48871 const normalizedFormats = Array.isArray(format) ? format : [format]; 48872 const { 48873 supportedFormats 48874 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 48875 const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports(); 48876 return { 48877 supportedFormats: themeSupports.formats 48878 }; 48879 }, []); 48880 const formats = POST_FORMATS.filter(item => supportedFormats.includes(item.value)); 48881 const values = normalizedFormats.map(name => formats.find(item => item.value === name)?.label).filter(Boolean); 48882 const suggestions = formats.filter(item => !normalizedFormats.includes(item.value)).map(item => item.label); 48883 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { 48884 label: (0,external_wp_i18n_namespaceObject.__)('Formats'), 48885 value: values, 48886 suggestions: suggestions, 48887 onChange: newValues => { 48888 onChange({ 48889 format: formatNamesToValues(newValues, formats) 48890 }); 48891 }, 48892 __experimentalShowHowTo: false, 48893 __experimentalExpandOnFocus: true, 48894 __nextHasNoMarginBottom: true, 48895 __next40pxDefaultSize: true 48896 }); 48897 } 48898 48899 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js 48900 /** 48901 * WordPress dependencies 48902 */ 48903 48904 48905 48906 const stickyOptions = [{ 48907 label: (0,external_wp_i18n_namespaceObject.__)('Include'), 48908 value: '' 48909 }, { 48910 label: (0,external_wp_i18n_namespaceObject.__)('Exclude'), 48911 value: 'exclude' 48912 }, { 48913 label: (0,external_wp_i18n_namespaceObject.__)('Only'), 48914 value: 'only' 48915 }]; 48916 function StickyControl({ 48917 value, 48918 onChange 48919 }) { 48920 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 48921 __nextHasNoMarginBottom: true, 48922 __next40pxDefaultSize: true, 48923 label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'), 48924 options: stickyOptions, 48925 value: value, 48926 onChange: onChange, 48927 help: (0,external_wp_i18n_namespaceObject.__)('Sticky posts always appear first, regardless of their publish date.') 48928 }); 48929 } 48930 48931 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/per-page-control.js 48932 /** 48933 * WordPress dependencies 48934 */ 48935 48936 48937 48938 const MIN_POSTS_PER_PAGE = 1; 48939 const MAX_POSTS_PER_PAGE = 100; 48940 const PerPageControl = ({ 48941 perPage, 48942 offset = 0, 48943 onChange 48944 }) => { 48945 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 48946 __next40pxDefaultSize: true, 48947 __nextHasNoMarginBottom: true, 48948 label: (0,external_wp_i18n_namespaceObject.__)('Items per page'), 48949 min: MIN_POSTS_PER_PAGE, 48950 max: MAX_POSTS_PER_PAGE, 48951 onChange: newPerPage => { 48952 if (isNaN(newPerPage) || newPerPage < MIN_POSTS_PER_PAGE || newPerPage > MAX_POSTS_PER_PAGE) { 48953 return; 48954 } 48955 onChange({ 48956 perPage: newPerPage, 48957 offset 48958 }); 48959 }, 48960 value: parseInt(perPage, 10) 48961 }); 48962 }; 48963 /* harmony default export */ const per_page_control = (PerPageControl); 48964 48965 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/offset-controls.js 48966 /** 48967 * WordPress dependencies 48968 */ 48969 48970 48971 48972 const MIN_OFFSET = 0; 48973 const MAX_OFFSET = 100; 48974 const OffsetControl = ({ 48975 offset = 0, 48976 onChange 48977 }) => { 48978 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { 48979 __next40pxDefaultSize: true, 48980 label: (0,external_wp_i18n_namespaceObject.__)('Offset'), 48981 value: offset, 48982 min: MIN_OFFSET, 48983 onChange: newOffset => { 48984 if (isNaN(newOffset) || newOffset < MIN_OFFSET || newOffset > MAX_OFFSET) { 48985 return; 48986 } 48987 onChange({ 48988 offset: newOffset 48989 }); 48990 } 48991 }); 48992 }; 48993 /* harmony default export */ const offset_controls = (OffsetControl); 48994 48995 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/pages-control.js 48996 /** 48997 * WordPress dependencies 48998 */ 48999 49000 49001 49002 const PagesControl = ({ 49003 pages, 49004 onChange 49005 }) => { 49006 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { 49007 __next40pxDefaultSize: true, 49008 label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'), 49009 value: pages, 49010 min: 0, 49011 onChange: newPages => { 49012 if (isNaN(newPages) || newPages < 0) { 49013 return; 49014 } 49015 onChange({ 49016 pages: newPages 49017 }); 49018 }, 49019 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).') 49020 }); 49021 }; 49022 /* harmony default export */ const pages_control = (PagesControl); 49023 49024 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js 49025 /* wp:polyfill */ 49026 /** 49027 * WordPress dependencies 49028 */ 49029 49030 49031 49032 49033 49034 49035 49036 /** 49037 * Internal dependencies 49038 */ 49039 49040 49041 49042 49043 49044 49045 49046 49047 49048 49049 49050 49051 function QueryInspectorControls(props) { 49052 const { 49053 attributes, 49054 setQuery, 49055 setDisplayLayout, 49056 isSingular 49057 } = props; 49058 const { 49059 query, 49060 displayLayout 49061 } = attributes; 49062 const { 49063 order, 49064 orderBy, 49065 author: authorIds, 49066 pages, 49067 postType, 49068 perPage, 49069 offset, 49070 sticky, 49071 inherit, 49072 taxQuery, 49073 parents, 49074 format 49075 } = query; 49076 const allowedControls = useAllowedControls(attributes); 49077 const showSticky = postType === 'post'; 49078 const { 49079 postTypesTaxonomiesMap, 49080 postTypesSelectOptions, 49081 postTypeFormatSupportMap 49082 } = usePostTypes(); 49083 const taxonomies = useTaxonomies(postType); 49084 const isPostTypeHierarchical = useIsPostTypeHierarchical(postType); 49085 const onPostTypeChange = newValue => { 49086 const updateQuery = { 49087 postType: newValue 49088 }; 49089 // We need to dynamically update the `taxQuery` property, 49090 // by removing any not supported taxonomy from the query. 49091 const supportedTaxonomies = postTypesTaxonomiesMap[newValue]; 49092 const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, [taxonomySlug, terms]) => { 49093 if (supportedTaxonomies.includes(taxonomySlug)) { 49094 accumulator[taxonomySlug] = terms; 49095 } 49096 return accumulator; 49097 }, {}); 49098 updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined; 49099 if (newValue !== 'post') { 49100 updateQuery.sticky = ''; 49101 } 49102 // We need to reset `parents` because they are tied to each post type. 49103 updateQuery.parents = []; 49104 // Post types can register post format support with `add_post_type_support`. 49105 // But we need to reset the `format` property when switching to post types 49106 // that do not support post formats. 49107 const hasFormatSupport = postTypeFormatSupportMap[newValue]; 49108 if (!hasFormatSupport) { 49109 updateQuery.format = []; 49110 } 49111 setQuery(updateQuery); 49112 }; 49113 const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search); 49114 const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_wp_compose_namespaceObject.debounce)(() => { 49115 if (query.search !== querySearch) { 49116 setQuery({ 49117 search: querySearch 49118 }); 49119 } 49120 }, 250), [querySearch, query.search]); 49121 (0,external_wp_element_namespaceObject.useEffect)(() => { 49122 onChangeDebounced(); 49123 return onChangeDebounced.cancel; 49124 }, [querySearch, onChangeDebounced]); 49125 const showInheritControl = !isSingular && isControlAllowed(allowedControls, 'inherit'); 49126 const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType'); 49127 const postTypeControlLabel = (0,external_wp_i18n_namespaceObject.__)('Post type'); 49128 const postTypeControlHelp = (0,external_wp_i18n_namespaceObject.__)('Select the type of content to display: posts, pages, or custom post types.'); 49129 const showColumnsControl = false; 49130 const showOrderControl = !inherit && isControlAllowed(allowedControls, 'order'); 49131 const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, 'sticky'); 49132 const showSettingsPanel = showInheritControl || showPostTypeControl || showColumnsControl || showOrderControl || showStickyControl; 49133 const showTaxControl = !!taxonomies?.length && isControlAllowed(allowedControls, 'taxQuery'); 49134 const showAuthorControl = isControlAllowed(allowedControls, 'author'); 49135 const showSearchControl = isControlAllowed(allowedControls, 'search'); 49136 const showParentControl = isControlAllowed(allowedControls, 'parents') && isPostTypeHierarchical; 49137 const postTypeHasFormatSupport = postTypeFormatSupportMap[postType]; 49138 const showFormatControl = (0,external_wp_data_namespaceObject.useSelect)(select => { 49139 // Check if the post type supports post formats and if the control is allowed. 49140 if (!postTypeHasFormatSupport || !isControlAllowed(allowedControls, 'format')) { 49141 return false; 49142 } 49143 const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports(); 49144 49145 // If there are no supported formats, getThemeSupports still includes the default 'standard' format, 49146 // and in this case the control should not be shown since the user has no other formats to choose from. 49147 return themeSupports.formats && themeSupports.formats.length > 0 && themeSupports.formats.some(type => type !== 'standard'); 49148 }, [allowedControls, postTypeHasFormatSupport]); 49149 const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl || showFormatControl; 49150 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 49151 const showPostCountControl = isControlAllowed(allowedControls, 'postCount'); 49152 const showOffSetControl = isControlAllowed(allowedControls, 'offset'); 49153 const showPagesControl = isControlAllowed(allowedControls, 'pages'); 49154 const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl; 49155 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 49156 children: [showSettingsPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 49157 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 49158 resetAll: () => { 49159 setQuery({ 49160 postType: 'post', 49161 order: 'desc', 49162 orderBy: 'date', 49163 sticky: '', 49164 inherit: true 49165 }); 49166 }, 49167 dropdownMenuProps: dropdownMenuProps, 49168 children: [showInheritControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49169 hasValue: () => !inherit, 49170 label: (0,external_wp_i18n_namespaceObject.__)('Query type'), 49171 onDeselect: () => setQuery({ 49172 inherit: true 49173 }), 49174 isShownByDefault: true, 49175 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 49176 __next40pxDefaultSize: true, 49177 __nextHasNoMarginBottom: true, 49178 label: (0,external_wp_i18n_namespaceObject.__)('Query type'), 49179 isBlock: true, 49180 onChange: value => { 49181 setQuery({ 49182 inherit: value === 'default' 49183 }); 49184 }, 49185 help: inherit ? (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on the current template.') : (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on specific criteria.'), 49186 value: !!inherit ? 'default' : 'custom', 49187 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 49188 value: "default", 49189 label: (0,external_wp_i18n_namespaceObject.__)('Default') 49190 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 49191 value: "custom", 49192 label: (0,external_wp_i18n_namespaceObject.__)('Custom') 49193 })] 49194 }) 49195 }), showPostTypeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49196 hasValue: () => postType !== 'post', 49197 label: postTypeControlLabel, 49198 onDeselect: () => onPostTypeChange('post'), 49199 isShownByDefault: true, 49200 children: postTypesSelectOptions.length > 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 49201 __nextHasNoMarginBottom: true, 49202 __next40pxDefaultSize: true, 49203 options: postTypesSelectOptions, 49204 value: postType, 49205 label: postTypeControlLabel, 49206 onChange: onPostTypeChange, 49207 help: postTypeControlHelp 49208 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 49209 __nextHasNoMarginBottom: true, 49210 __next40pxDefaultSize: true, 49211 isBlock: true, 49212 value: postType, 49213 label: postTypeControlLabel, 49214 onChange: onPostTypeChange, 49215 help: postTypeControlHelp, 49216 children: postTypesSelectOptions.map(option => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 49217 value: option.value, 49218 label: option.label 49219 }, option.value)) 49220 }) 49221 }), showColumnsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49222 hasValue: () => displayLayout?.columns !== 2, 49223 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 49224 onDeselect: () => setDisplayLayout({ 49225 columns: 2 49226 }), 49227 isShownByDefault: true, 49228 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 49229 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 49230 __nextHasNoMarginBottom: true, 49231 __next40pxDefaultSize: true, 49232 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 49233 value: displayLayout.columns, 49234 onChange: value => setDisplayLayout({ 49235 columns: value 49236 }), 49237 min: 2, 49238 max: Math.max(6, displayLayout.columns) 49239 }), displayLayout.columns > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { 49240 status: "warning", 49241 isDismissible: false, 49242 children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') 49243 })] 49244 }) 49245 }), showOrderControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49246 hasValue: () => order !== 'desc' || orderBy !== 'date', 49247 label: (0,external_wp_i18n_namespaceObject.__)('Order by'), 49248 onDeselect: () => setQuery({ 49249 order: 'desc', 49250 orderBy: 'date' 49251 }), 49252 isShownByDefault: true, 49253 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(order_control, { 49254 order, 49255 orderBy, 49256 onChange: setQuery 49257 }) 49258 }), showStickyControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49259 hasValue: () => !!sticky, 49260 label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'), 49261 onDeselect: () => setQuery({ 49262 sticky: '' 49263 }), 49264 isShownByDefault: true, 49265 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StickyControl, { 49266 value: sticky, 49267 onChange: value => setQuery({ 49268 sticky: value 49269 }) 49270 }) 49271 })] 49272 }), !inherit && showDisplayPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 49273 className: "block-library-query-toolspanel__display", 49274 label: (0,external_wp_i18n_namespaceObject.__)('Display'), 49275 resetAll: () => { 49276 setQuery({ 49277 offset: 0, 49278 pages: 0 49279 }); 49280 }, 49281 dropdownMenuProps: dropdownMenuProps, 49282 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49283 label: (0,external_wp_i18n_namespaceObject.__)('Items per page'), 49284 hasValue: () => perPage > 0, 49285 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(per_page_control, { 49286 perPage: perPage, 49287 offset: offset, 49288 onChange: setQuery 49289 }) 49290 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49291 label: (0,external_wp_i18n_namespaceObject.__)('Offset'), 49292 hasValue: () => offset > 0, 49293 onDeselect: () => setQuery({ 49294 offset: 0 49295 }), 49296 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(offset_controls, { 49297 offset: offset, 49298 onChange: setQuery 49299 }) 49300 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49301 label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'), 49302 hasValue: () => pages > 0, 49303 onDeselect: () => setQuery({ 49304 pages: 0 49305 }), 49306 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pages_control, { 49307 pages: pages, 49308 onChange: setQuery 49309 }) 49310 })] 49311 }), !inherit && showFiltersPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 49312 className: "block-library-query-toolspanel__filters" // unused but kept for backward compatibility 49313 , 49314 label: (0,external_wp_i18n_namespaceObject.__)('Filters'), 49315 resetAll: () => { 49316 setQuery({ 49317 author: '', 49318 parents: [], 49319 search: '', 49320 taxQuery: null, 49321 format: [] 49322 }); 49323 setQuerySearch(''); 49324 }, 49325 dropdownMenuProps: dropdownMenuProps, 49326 children: [showTaxControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49327 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomies'), 49328 hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length), 49329 onDeselect: () => setQuery({ 49330 taxQuery: null 49331 }), 49332 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyControls, { 49333 onChange: setQuery, 49334 query: query 49335 }) 49336 }), showAuthorControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49337 hasValue: () => !!authorIds, 49338 label: (0,external_wp_i18n_namespaceObject.__)('Authors'), 49339 onDeselect: () => setQuery({ 49340 author: '' 49341 }), 49342 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(author_control, { 49343 value: authorIds, 49344 onChange: setQuery 49345 }) 49346 }), showSearchControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49347 hasValue: () => !!querySearch, 49348 label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), 49349 onDeselect: () => setQuerySearch(''), 49350 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 49351 __nextHasNoMarginBottom: true, 49352 __next40pxDefaultSize: true, 49353 label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), 49354 value: querySearch, 49355 onChange: setQuerySearch 49356 }) 49357 }), showParentControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49358 hasValue: () => !!parents?.length, 49359 label: (0,external_wp_i18n_namespaceObject.__)('Parents'), 49360 onDeselect: () => setQuery({ 49361 parents: [] 49362 }), 49363 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_control, { 49364 parents: parents, 49365 postType: postType, 49366 onChange: setQuery 49367 }) 49368 }), showFormatControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 49369 hasValue: () => !!format?.length, 49370 label: (0,external_wp_i18n_namespaceObject.__)('Formats'), 49371 onDeselect: () => setQuery({ 49372 format: [] 49373 }), 49374 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormatControls, { 49375 onChange: setQuery, 49376 query: query 49377 }) 49378 })] 49379 })] 49380 }); 49381 } 49382 49383 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/enhanced-pagination-modal.js 49384 /** 49385 * WordPress dependencies 49386 */ 49387 49388 49389 49390 49391 /** 49392 * Internal dependencies 49393 */ 49394 49395 49396 const modalDescriptionId = 'wp-block-query-enhanced-pagination-modal__description'; 49397 function EnhancedPaginationModal({ 49398 clientId, 49399 attributes: { 49400 enhancedPagination 49401 }, 49402 setAttributes 49403 }) { 49404 const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); 49405 const { 49406 hasBlocksFromPlugins, 49407 hasPostContentBlock, 49408 hasUnsupportedBlocks 49409 } = useUnsupportedBlocks(clientId); 49410 (0,external_wp_element_namespaceObject.useEffect)(() => { 49411 if (enhancedPagination && hasUnsupportedBlocks && !window.__experimentalFullPageClientSideNavigation) { 49412 setAttributes({ 49413 enhancedPagination: false 49414 }); 49415 setOpen(true); 49416 } 49417 }, [enhancedPagination, hasUnsupportedBlocks, setAttributes]); 49418 const closeModal = () => { 49419 setOpen(false); 49420 }; 49421 let notice = (0,external_wp_i18n_namespaceObject.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.'); 49422 if (hasBlocksFromPlugins) { 49423 notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.') + ' ' + notice; 49424 } else if (hasPostContentBlock) { 49425 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; 49426 } 49427 return isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { 49428 title: (0,external_wp_i18n_namespaceObject.__)('Query block: Reload full page enabled'), 49429 className: "wp-block-query__enhanced-pagination-modal", 49430 aria: { 49431 describedby: modalDescriptionId 49432 }, 49433 role: "alertdialog", 49434 focusOnMount: "firstElement", 49435 isDismissible: false, 49436 onRequestClose: closeModal, 49437 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 49438 alignment: "right", 49439 spacing: 5, 49440 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 49441 id: modalDescriptionId, 49442 children: notice 49443 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 49444 __next40pxDefaultSize: true, 49445 variant: "primary", 49446 onClick: closeModal, 49447 children: (0,external_wp_i18n_namespaceObject.__)('OK') 49448 })] 49449 }) 49450 }); 49451 } 49452 49453 ;// ./node_modules/@wordpress/block-library/build-module/utils/search-patterns.js 49454 /* wp:polyfill */ 49455 /** 49456 * External dependencies 49457 */ 49458 49459 49460 /** 49461 * Sanitizes the search input string. 49462 * 49463 * @param {string} input The search input to normalize. 49464 * 49465 * @return {string} The normalized search input. 49466 */ 49467 function normalizeSearchInput(input = '') { 49468 // Disregard diacritics. 49469 input = remove_accents_default()(input); 49470 49471 // Trim & Lowercase. 49472 input = input.trim().toLowerCase(); 49473 return input; 49474 } 49475 49476 /** 49477 * Get the search rank for a given pattern and a specific search term. 49478 * 49479 * @param {Object} pattern Pattern to rank 49480 * @param {string} searchValue Search term 49481 * @return {number} A pattern search rank 49482 */ 49483 function getPatternSearchRank(pattern, searchValue) { 49484 const normalizedSearchValue = normalizeSearchInput(searchValue); 49485 const normalizedTitle = normalizeSearchInput(pattern.title); 49486 let rank = 0; 49487 if (normalizedSearchValue === normalizedTitle) { 49488 rank += 30; 49489 } else if (normalizedTitle.startsWith(normalizedSearchValue)) { 49490 rank += 20; 49491 } else { 49492 const searchTerms = normalizedSearchValue.split(' '); 49493 const hasMatchedTerms = searchTerms.every(searchTerm => normalizedTitle.includes(searchTerm)); 49494 49495 // Prefer pattern with every search word in the title. 49496 if (hasMatchedTerms) { 49497 rank += 10; 49498 } 49499 } 49500 return rank; 49501 } 49502 49503 /** 49504 * Filters an pattern list given a search term. 49505 * 49506 * @param {Array} patterns Item list 49507 * @param {string} searchValue Search input. 49508 * 49509 * @return {Array} Filtered pattern list. 49510 */ 49511 function searchPatterns(patterns = [], searchValue = '') { 49512 if (!searchValue) { 49513 return patterns; 49514 } 49515 const rankedPatterns = patterns.map(pattern => { 49516 return [pattern, getPatternSearchRank(pattern, searchValue)]; 49517 }).filter(([, rank]) => rank > 0); 49518 rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1); 49519 return rankedPatterns.map(([pattern]) => pattern); 49520 } 49521 49522 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/pattern-selection.js 49523 /** 49524 * WordPress dependencies 49525 */ 49526 49527 49528 49529 49530 49531 49532 /** 49533 * Internal dependencies 49534 */ 49535 49536 49537 49538 function PatternSelectionModal({ 49539 clientId, 49540 attributes, 49541 setIsPatternSelectionModalOpen 49542 }) { 49543 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { 49544 overlayClassName: "block-library-query-pattern__selection-modal", 49545 title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), 49546 onRequestClose: () => setIsPatternSelectionModalOpen(false), 49547 isFullScreen: true, 49548 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { 49549 clientId: clientId, 49550 attributes: attributes 49551 }) 49552 }); 49553 } 49554 function useBlockPatterns(clientId, attributes) { 49555 const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes); 49556 return usePatterns(clientId, blockNameForPatterns); 49557 } 49558 function PatternSelection({ 49559 clientId, 49560 attributes, 49561 showTitlesAsTooltip = false, 49562 showSearch = true 49563 }) { 49564 const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); 49565 const { 49566 replaceBlock, 49567 selectBlock 49568 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 49569 const blockPatterns = useBlockPatterns(clientId, attributes); 49570 /* 49571 * When we preview Query Loop blocks we should prefer the current 49572 * block's postType, which is passed through block context. 49573 */ 49574 const blockPreviewContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({ 49575 previewPostType: attributes.query.postType 49576 }), [attributes.query.postType]); 49577 const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { 49578 return searchPatterns(blockPatterns, searchValue); 49579 }, [blockPatterns, searchValue]); 49580 const onBlockPatternSelect = (pattern, blocks) => { 49581 const { 49582 newBlocks, 49583 queryClientIds 49584 } = getTransformedBlocksFromPattern(blocks, attributes); 49585 replaceBlock(clientId, newBlocks); 49586 if (queryClientIds[0]) { 49587 selectBlock(queryClientIds[0]); 49588 } 49589 }; 49590 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 49591 className: "block-library-query-pattern__selection-content", 49592 children: [showSearch && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 49593 className: "block-library-query-pattern__selection-search", 49594 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { 49595 __nextHasNoMarginBottom: true, 49596 onChange: setSearchValue, 49597 value: searchValue, 49598 label: (0,external_wp_i18n_namespaceObject.__)('Search'), 49599 placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') 49600 }) 49601 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { 49602 value: blockPreviewContext, 49603 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 49604 blockPatterns: filteredBlockPatterns, 49605 onClickPattern: onBlockPatternSelect, 49606 showTitlesAsTooltip: showTitlesAsTooltip 49607 }) 49608 })] 49609 }); 49610 } 49611 49612 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js 49613 /** 49614 * WordPress dependencies 49615 */ 49616 49617 49618 49619 /** 49620 * Internal dependencies 49621 */ 49622 49623 49624 function QueryToolbar({ 49625 clientId, 49626 attributes 49627 }) { 49628 const hasPatterns = useBlockPatterns(clientId, attributes).length; 49629 if (!hasPatterns) { 49630 return null; 49631 } 49632 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 49633 className: "wp-block-template-part__block-control-group", 49634 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { 49635 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { 49636 contentClassName: "block-editor-block-settings-menu__popover", 49637 focusOnMount: "firstElement", 49638 expandOnMobile: true, 49639 renderToggle: ({ 49640 isOpen, 49641 onToggle 49642 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 49643 "aria-haspopup": "true", 49644 "aria-expanded": isOpen, 49645 onClick: onToggle, 49646 children: (0,external_wp_i18n_namespaceObject.__)('Change design') 49647 }), 49648 renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { 49649 clientId: clientId, 49650 attributes: attributes, 49651 showSearch: false, 49652 showTitlesAsTooltip: true 49653 }) 49654 }) 49655 }) 49656 }); 49657 } 49658 49659 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-content.js 49660 /** 49661 * WordPress dependencies 49662 */ 49663 49664 49665 49666 49667 49668 49669 49670 49671 /** 49672 * Internal dependencies 49673 */ 49674 49675 49676 49677 49678 49679 49680 49681 const DEFAULTS_POSTS_PER_PAGE = 3; 49682 const query_content_TEMPLATE = [['core/post-template']]; 49683 function QueryContent({ 49684 attributes, 49685 setAttributes, 49686 clientId, 49687 context, 49688 name 49689 }) { 49690 const { 49691 queryId, 49692 query, 49693 displayLayout, 49694 enhancedPagination, 49695 tagName: TagName = 'div', 49696 query: { 49697 inherit 49698 } = {} 49699 } = attributes; 49700 const { 49701 templateSlug 49702 } = context; 49703 const { 49704 isSingular 49705 } = getQueryContextFromTemplate(templateSlug); 49706 const { 49707 __unstableMarkNextChangeAsNotPersistent 49708 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 49709 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent); 49710 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 49711 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 49712 template: query_content_TEMPLATE 49713 }); 49714 const { 49715 postsPerPage 49716 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 49717 const { 49718 getSettings 49719 } = select(external_wp_blockEditor_namespaceObject.store); 49720 const { 49721 getEntityRecord, 49722 getEntityRecordEdits, 49723 canUser 49724 } = select(external_wp_coreData_namespaceObject.store); 49725 const settingPerPage = canUser('read', { 49726 kind: 'root', 49727 name: 'site' 49728 }) ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage; 49729 49730 // Gets changes made via the template area posts per page setting. These won't be saved 49731 // until the page is saved, but we should reflect this setting within the query loops 49732 // that inherit it. 49733 const editedSettingPerPage = +getEntityRecordEdits('root', 'site')?.posts_per_page; 49734 return { 49735 postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE 49736 }; 49737 }, []); 49738 // There are some effects running where some initialization logic is 49739 // happening and setting some values to some attributes (ex. queryId). 49740 // These updates can cause an `undo trap` where undoing will result in 49741 // resetting again, so we need to mark these changes as not persistent 49742 // with `__unstableMarkNextChangeAsNotPersistent`. 49743 49744 // Changes in query property (which is an object) need to be in the same callback, 49745 // because updates are batched after the render and changes in different query properties 49746 // would cause to override previous wanted changes. 49747 const updateQuery = (0,external_wp_element_namespaceObject.useCallback)(newQuery => setAttributes({ 49748 query: { 49749 ...query, 49750 ...newQuery 49751 } 49752 }), [query, setAttributes]); 49753 (0,external_wp_element_namespaceObject.useEffect)(() => { 49754 const newQuery = {}; 49755 // When we inherit from global query always need to set the `perPage` 49756 // based on the reading settings. 49757 if (inherit && query.perPage !== postsPerPage) { 49758 newQuery.perPage = postsPerPage; 49759 } else if (!query.perPage && postsPerPage) { 49760 newQuery.perPage = postsPerPage; 49761 } 49762 // We need to reset the `inherit` value if in a singular template, as queries 49763 // are not inherited when in singular content (e.g. post, page, 404, blank). 49764 if (isSingular && query.inherit) { 49765 newQuery.inherit = false; 49766 } 49767 if (!!Object.keys(newQuery).length) { 49768 __unstableMarkNextChangeAsNotPersistent(); 49769 updateQuery(newQuery); 49770 } 49771 }, [query.perPage, query.inherit, postsPerPage, inherit, isSingular, __unstableMarkNextChangeAsNotPersistent, updateQuery]); 49772 // We need this for multi-query block pagination. 49773 // Query parameters for each block are scoped to their ID. 49774 (0,external_wp_element_namespaceObject.useEffect)(() => { 49775 if (!Number.isFinite(queryId)) { 49776 __unstableMarkNextChangeAsNotPersistent(); 49777 setAttributes({ 49778 queryId: instanceId 49779 }); 49780 } 49781 }, [queryId, instanceId, __unstableMarkNextChangeAsNotPersistent, setAttributes]); 49782 const updateDisplayLayout = newDisplayLayout => setAttributes({ 49783 displayLayout: { 49784 ...displayLayout, 49785 ...newDisplayLayout 49786 } 49787 }); 49788 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 49789 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationModal, { 49790 attributes: attributes, 49791 setAttributes: setAttributes, 49792 clientId: clientId 49793 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 49794 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryInspectorControls, { 49795 name: name, 49796 attributes: attributes, 49797 setQuery: updateQuery, 49798 setDisplayLayout: updateDisplayLayout, 49799 setAttributes: setAttributes, 49800 clientId: clientId, 49801 isSingular: isSingular 49802 }) 49803 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 49804 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryToolbar, { 49805 attributes: attributes, 49806 clientId: clientId 49807 }) 49808 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 49809 group: "advanced", 49810 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 49811 __nextHasNoMarginBottom: true, 49812 __next40pxDefaultSize: true, 49813 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 49814 options: [{ 49815 label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), 49816 value: 'div' 49817 }, { 49818 label: '<main>', 49819 value: 'main' 49820 }, { 49821 label: '<section>', 49822 value: 'section' 49823 }, { 49824 label: '<aside>', 49825 value: 'aside' 49826 }], 49827 value: TagName, 49828 onChange: value => setAttributes({ 49829 tagName: value 49830 }), 49831 help: htmlElementMessages[TagName] 49832 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationControl, { 49833 enhancedPagination: enhancedPagination, 49834 setAttributes: setAttributes, 49835 clientId: clientId 49836 })] 49837 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 49838 ...innerBlocksProps 49839 })] 49840 }); 49841 } 49842 49843 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js 49844 /** 49845 * WordPress dependencies 49846 */ 49847 49848 49849 49850 49851 49852 49853 49854 /** 49855 * Internal dependencies 49856 */ 49857 49858 49859 49860 function QueryPlaceholder({ 49861 attributes, 49862 clientId, 49863 name, 49864 openPatternSelectionModal 49865 }) { 49866 const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false); 49867 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 49868 const { 49869 blockType, 49870 activeBlockVariation 49871 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 49872 const { 49873 getActiveBlockVariation, 49874 getBlockType 49875 } = select(external_wp_blocks_namespaceObject.store); 49876 return { 49877 blockType: getBlockType(name), 49878 activeBlockVariation: getActiveBlockVariation(name, attributes) 49879 }; 49880 }, [name, attributes]); 49881 const hasPatterns = !!useBlockPatterns(clientId, attributes).length; 49882 const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src; 49883 const label = activeBlockVariation?.title || blockType?.title; 49884 if (isStartingBlank) { 49885 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryVariationPicker, { 49886 clientId: clientId, 49887 attributes: attributes, 49888 icon: icon, 49889 label: label 49890 }); 49891 } 49892 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 49893 ...blockProps, 49894 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 49895 icon: icon, 49896 label: label, 49897 instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.'), 49898 children: [!!hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 49899 __next40pxDefaultSize: true, 49900 variant: "primary", 49901 onClick: openPatternSelectionModal, 49902 children: (0,external_wp_i18n_namespaceObject.__)('Choose') 49903 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 49904 __next40pxDefaultSize: true, 49905 variant: "secondary", 49906 onClick: () => { 49907 setIsStartingBlank(true); 49908 }, 49909 children: (0,external_wp_i18n_namespaceObject.__)('Start blank') 49910 })] 49911 }) 49912 }); 49913 } 49914 function QueryVariationPicker({ 49915 clientId, 49916 attributes, 49917 icon, 49918 label 49919 }) { 49920 const scopeVariations = useScopedBlockVariations(attributes); 49921 const { 49922 replaceInnerBlocks 49923 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 49924 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 49925 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 49926 ...blockProps, 49927 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { 49928 icon: icon, 49929 label: label, 49930 variations: scopeVariations, 49931 onSelect: variation => { 49932 if (variation.innerBlocks) { 49933 replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false); 49934 } 49935 } 49936 }) 49937 }); 49938 } 49939 49940 ;// ./node_modules/@wordpress/block-library/build-module/query/edit/index.js 49941 /** 49942 * WordPress dependencies 49943 */ 49944 49945 49946 49947 49948 /** 49949 * Internal dependencies 49950 */ 49951 49952 49953 49954 49955 const QueryEdit = props => { 49956 const { 49957 clientId, 49958 attributes 49959 } = props; 49960 const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); 49961 const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]); 49962 const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder; 49963 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 49964 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { 49965 ...props, 49966 openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true) 49967 }), isPatternSelectionModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelectionModal, { 49968 clientId: clientId, 49969 attributes: attributes, 49970 setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen 49971 })] 49972 }); 49973 }; 49974 /* harmony default export */ const query_edit = (QueryEdit); 49975 49976 ;// ./node_modules/@wordpress/block-library/build-module/query/save.js 49977 /** 49978 * WordPress dependencies 49979 */ 49980 49981 49982 function query_save_save({ 49983 attributes: { 49984 tagName: Tag = 'div' 49985 } 49986 }) { 49987 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 49988 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 49989 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 49990 ...innerBlocksProps 49991 }); 49992 } 49993 49994 ;// ./node_modules/@wordpress/block-library/build-module/query/icons.js 49995 /** 49996 * WordPress dependencies 49997 */ 49998 49999 50000 const titleDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 50001 xmlns: "http://www.w3.org/2000/svg", 50002 viewBox: "0 0 48 48", 50003 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 50004 d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z" 50005 }) 50006 }); 50007 const titleExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 50008 xmlns: "http://www.w3.org/2000/svg", 50009 viewBox: "0 0 48 48", 50010 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 50011 d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z" 50012 }) 50013 }); 50014 const titleDateExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 50015 xmlns: "http://www.w3.org/2000/svg", 50016 viewBox: "0 0 48 48", 50017 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 50018 d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z" 50019 }) 50020 }); 50021 const imageDateTitle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 50022 xmlns: "http://www.w3.org/2000/svg", 50023 viewBox: "0 0 48 48", 50024 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 50025 d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z" 50026 }) 50027 }); 50028 50029 ;// ./node_modules/@wordpress/block-library/build-module/query/variations.js 50030 /** 50031 * WordPress dependencies 50032 */ 50033 50034 50035 /** 50036 * Internal dependencies 50037 */ 50038 50039 const query_variations_variations = [{ 50040 name: 'title-date', 50041 title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'), 50042 icon: titleDate, 50043 attributes: {}, 50044 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']], 50045 scope: ['block'] 50046 }, { 50047 name: 'title-excerpt', 50048 title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'), 50049 icon: titleExcerpt, 50050 attributes: {}, 50051 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], 50052 scope: ['block'] 50053 }, { 50054 name: 'title-date-excerpt', 50055 title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'), 50056 icon: titleDateExcerpt, 50057 attributes: {}, 50058 innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], 50059 scope: ['block'] 50060 }, { 50061 name: 'image-date-title', 50062 title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'), 50063 icon: imageDateTitle, 50064 attributes: {}, 50065 innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']], 50066 scope: ['block'] 50067 }]; 50068 /* harmony default export */ const query_variations = (query_variations_variations); 50069 50070 ;// ./node_modules/@wordpress/block-library/build-module/query/deprecated.js 50071 /* wp:polyfill */ 50072 /** 50073 * WordPress dependencies 50074 */ 50075 50076 50077 50078 /** 50079 * Internal dependencies 50080 */ 50081 50082 50083 const { 50084 cleanEmptyObject: deprecated_cleanEmptyObject 50085 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 50086 const migrateToTaxQuery = attributes => { 50087 const { 50088 query 50089 } = attributes; 50090 const { 50091 categoryIds, 50092 tagIds, 50093 ...newQuery 50094 } = query; 50095 if (query.categoryIds?.length || query.tagIds?.length) { 50096 newQuery.taxQuery = { 50097 category: !!query.categoryIds?.length ? query.categoryIds : undefined, 50098 post_tag: !!query.tagIds?.length ? query.tagIds : undefined 50099 }; 50100 } 50101 return { 50102 ...attributes, 50103 query: newQuery 50104 }; 50105 }; 50106 const migrateColors = (attributes, innerBlocks) => { 50107 // Remove color style attributes from the Query block. 50108 const { 50109 style, 50110 backgroundColor, 50111 gradient, 50112 textColor, 50113 ...newAttributes 50114 } = attributes; 50115 const hasColorStyles = backgroundColor || gradient || textColor || style?.color || style?.elements?.link; 50116 50117 // If the query block doesn't currently have any color styles, 50118 // nothing needs migrating. 50119 if (!hasColorStyles) { 50120 return [attributes, innerBlocks]; 50121 } 50122 50123 // Clean color values from style attribute object. 50124 if (style) { 50125 newAttributes.style = deprecated_cleanEmptyObject({ 50126 ...style, 50127 color: undefined, 50128 elements: { 50129 ...style.elements, 50130 link: undefined 50131 } 50132 }); 50133 } 50134 50135 // If the inner blocks are already wrapped in a single group 50136 // block, add the color support styles to that group block. 50137 if (hasSingleInnerGroupBlock(innerBlocks)) { 50138 const groupBlock = innerBlocks[0]; 50139 50140 // Create new styles for the group block. 50141 const hasStyles = style?.color || style?.elements?.link || groupBlock.attributes.style; 50142 const newStyles = hasStyles ? deprecated_cleanEmptyObject({ 50143 ...groupBlock.attributes.style, 50144 color: style?.color, 50145 elements: style?.elements?.link ? { 50146 link: style?.elements?.link 50147 } : undefined 50148 }) : undefined; 50149 50150 // Create a new Group block from the original. 50151 const updatedGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 50152 ...groupBlock.attributes, 50153 backgroundColor, 50154 gradient, 50155 textColor, 50156 style: newStyles 50157 }, groupBlock.innerBlocks); 50158 return [newAttributes, [updatedGroupBlock]]; 50159 } 50160 50161 // When we don't have a single wrapping group block for the inner 50162 // blocks, wrap the current inner blocks in a group applying the 50163 // color styles to that. 50164 const newGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 50165 backgroundColor, 50166 gradient, 50167 textColor, 50168 style: deprecated_cleanEmptyObject({ 50169 color: style?.color, 50170 elements: style?.elements?.link ? { 50171 link: style?.elements?.link 50172 } : undefined 50173 }) 50174 }, innerBlocks); 50175 return [newAttributes, [newGroupBlock]]; 50176 }; 50177 const hasSingleInnerGroupBlock = (innerBlocks = []) => innerBlocks.length === 1 && innerBlocks[0].name === 'core/group'; 50178 const migrateToConstrainedLayout = attributes => { 50179 const { 50180 layout = null 50181 } = attributes; 50182 if (!layout) { 50183 return attributes; 50184 } 50185 const { 50186 inherit = null, 50187 contentSize = null, 50188 ...newLayout 50189 } = layout; 50190 if (inherit || contentSize) { 50191 return { 50192 ...attributes, 50193 layout: { 50194 ...newLayout, 50195 contentSize, 50196 type: 'constrained' 50197 } 50198 }; 50199 } 50200 return attributes; 50201 }; 50202 const findPostTemplateBlock = (innerBlocks = []) => { 50203 let foundBlock = null; 50204 for (const block of innerBlocks) { 50205 if (block.name === 'core/post-template') { 50206 foundBlock = block; 50207 break; 50208 } else if (block.innerBlocks.length) { 50209 foundBlock = findPostTemplateBlock(block.innerBlocks); 50210 } 50211 } 50212 return foundBlock; 50213 }; 50214 const replacePostTemplateBlock = (innerBlocks = [], replacementBlock) => { 50215 innerBlocks.forEach((block, index) => { 50216 if (block.name === 'core/post-template') { 50217 innerBlocks.splice(index, 1, replacementBlock); 50218 } else if (block.innerBlocks.length) { 50219 block.innerBlocks = replacePostTemplateBlock(block.innerBlocks, replacementBlock); 50220 } 50221 }); 50222 return innerBlocks; 50223 }; 50224 const migrateDisplayLayout = (attributes, innerBlocks) => { 50225 const { 50226 displayLayout = null, 50227 ...newAttributes 50228 } = attributes; 50229 if (!displayLayout) { 50230 return [attributes, innerBlocks]; 50231 } 50232 const postTemplateBlock = findPostTemplateBlock(innerBlocks); 50233 if (!postTemplateBlock) { 50234 return [attributes, innerBlocks]; 50235 } 50236 const { 50237 type, 50238 columns 50239 } = displayLayout; 50240 50241 // Convert custom displayLayout values to canonical layout types. 50242 const updatedLayoutType = type === 'flex' ? 'grid' : 'default'; 50243 const newPostTemplateBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/post-template', { 50244 ...postTemplateBlock.attributes, 50245 layout: { 50246 type: updatedLayoutType, 50247 ...(columns && { 50248 columnCount: columns 50249 }) 50250 } 50251 }, postTemplateBlock.innerBlocks); 50252 return [newAttributes, replacePostTemplateBlock(innerBlocks, newPostTemplateBlock)]; 50253 }; 50254 50255 // Version with NO wrapper `div` element. 50256 const query_deprecated_v1 = { 50257 attributes: { 50258 queryId: { 50259 type: 'number' 50260 }, 50261 query: { 50262 type: 'object', 50263 default: { 50264 perPage: null, 50265 pages: 0, 50266 offset: 0, 50267 postType: 'post', 50268 categoryIds: [], 50269 tagIds: [], 50270 order: 'desc', 50271 orderBy: 'date', 50272 author: '', 50273 search: '', 50274 exclude: [], 50275 sticky: '', 50276 inherit: true 50277 } 50278 }, 50279 layout: { 50280 type: 'object', 50281 default: { 50282 type: 'list' 50283 } 50284 } 50285 }, 50286 supports: { 50287 html: false 50288 }, 50289 migrate(attributes, innerBlocks) { 50290 const withTaxQuery = migrateToTaxQuery(attributes); 50291 const { 50292 layout, 50293 ...restWithTaxQuery 50294 } = withTaxQuery; 50295 const newAttributes = { 50296 ...restWithTaxQuery, 50297 displayLayout: withTaxQuery.layout 50298 }; 50299 return migrateDisplayLayout(newAttributes, innerBlocks); 50300 }, 50301 save() { 50302 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 50303 } 50304 }; 50305 50306 // Version with `categoryIds and tagIds`. 50307 const query_deprecated_v2 = { 50308 attributes: { 50309 queryId: { 50310 type: 'number' 50311 }, 50312 query: { 50313 type: 'object', 50314 default: { 50315 perPage: null, 50316 pages: 0, 50317 offset: 0, 50318 postType: 'post', 50319 categoryIds: [], 50320 tagIds: [], 50321 order: 'desc', 50322 orderBy: 'date', 50323 author: '', 50324 search: '', 50325 exclude: [], 50326 sticky: '', 50327 inherit: true 50328 } 50329 }, 50330 tagName: { 50331 type: 'string', 50332 default: 'div' 50333 }, 50334 displayLayout: { 50335 type: 'object', 50336 default: { 50337 type: 'list' 50338 } 50339 } 50340 }, 50341 supports: { 50342 align: ['wide', 'full'], 50343 html: false, 50344 color: { 50345 gradients: true, 50346 link: true 50347 }, 50348 layout: true 50349 }, 50350 isEligible: ({ 50351 query: { 50352 categoryIds, 50353 tagIds 50354 } = {} 50355 }) => categoryIds || tagIds, 50356 migrate(attributes, innerBlocks) { 50357 const withTaxQuery = migrateToTaxQuery(attributes); 50358 const [withColorAttributes, withColorInnerBlocks] = migrateColors(withTaxQuery, innerBlocks); 50359 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 50360 return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); 50361 }, 50362 save({ 50363 attributes: { 50364 tagName: Tag = 'div' 50365 } 50366 }) { 50367 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 50368 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 50369 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 50370 ...innerBlocksProps 50371 }); 50372 } 50373 }; 50374 50375 // Version with color support prior to moving it to the PostTemplate block. 50376 const query_deprecated_v3 = { 50377 attributes: { 50378 queryId: { 50379 type: 'number' 50380 }, 50381 query: { 50382 type: 'object', 50383 default: { 50384 perPage: null, 50385 pages: 0, 50386 offset: 0, 50387 postType: 'post', 50388 order: 'desc', 50389 orderBy: 'date', 50390 author: '', 50391 search: '', 50392 exclude: [], 50393 sticky: '', 50394 inherit: true, 50395 taxQuery: null, 50396 parents: [] 50397 } 50398 }, 50399 tagName: { 50400 type: 'string', 50401 default: 'div' 50402 }, 50403 displayLayout: { 50404 type: 'object', 50405 default: { 50406 type: 'list' 50407 } 50408 }, 50409 namespace: { 50410 type: 'string' 50411 } 50412 }, 50413 supports: { 50414 align: ['wide', 'full'], 50415 html: false, 50416 color: { 50417 gradients: true, 50418 link: true, 50419 __experimentalDefaultControls: { 50420 background: true, 50421 text: true 50422 } 50423 }, 50424 layout: true 50425 }, 50426 isEligible(attributes) { 50427 const { 50428 style, 50429 backgroundColor, 50430 gradient, 50431 textColor 50432 } = attributes; 50433 return backgroundColor || gradient || textColor || style?.color || style?.elements?.link; 50434 }, 50435 migrate(attributes, innerBlocks) { 50436 const [withColorAttributes, withColorInnerBlocks] = migrateColors(attributes, innerBlocks); 50437 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 50438 return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); 50439 }, 50440 save({ 50441 attributes: { 50442 tagName: Tag = 'div' 50443 } 50444 }) { 50445 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 50446 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 50447 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 50448 ...innerBlocksProps 50449 }); 50450 } 50451 }; 50452 const query_deprecated_v4 = { 50453 attributes: { 50454 queryId: { 50455 type: 'number' 50456 }, 50457 query: { 50458 type: 'object', 50459 default: { 50460 perPage: null, 50461 pages: 0, 50462 offset: 0, 50463 postType: 'post', 50464 order: 'desc', 50465 orderBy: 'date', 50466 author: '', 50467 search: '', 50468 exclude: [], 50469 sticky: '', 50470 inherit: true, 50471 taxQuery: null, 50472 parents: [] 50473 } 50474 }, 50475 tagName: { 50476 type: 'string', 50477 default: 'div' 50478 }, 50479 displayLayout: { 50480 type: 'object', 50481 default: { 50482 type: 'list' 50483 } 50484 }, 50485 namespace: { 50486 type: 'string' 50487 } 50488 }, 50489 supports: { 50490 align: ['wide', 'full'], 50491 html: false, 50492 color: { 50493 gradients: true, 50494 link: true, 50495 __experimentalDefaultControls: { 50496 background: true, 50497 text: true 50498 } 50499 }, 50500 layout: true 50501 }, 50502 save({ 50503 attributes: { 50504 tagName: Tag = 'div' 50505 } 50506 }) { 50507 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 50508 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 50509 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 50510 ...innerBlocksProps 50511 }); 50512 }, 50513 isEligible: ({ 50514 layout 50515 }) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained', 50516 migrate(attributes, innerBlocks) { 50517 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(attributes); 50518 return migrateDisplayLayout(withConstrainedLayoutAttributes, innerBlocks); 50519 } 50520 }; 50521 const query_deprecated_v5 = { 50522 attributes: { 50523 queryId: { 50524 type: 'number' 50525 }, 50526 query: { 50527 type: 'object', 50528 default: { 50529 perPage: null, 50530 pages: 0, 50531 offset: 0, 50532 postType: 'post', 50533 order: 'desc', 50534 orderBy: 'date', 50535 author: '', 50536 search: '', 50537 exclude: [], 50538 sticky: '', 50539 inherit: true, 50540 taxQuery: null, 50541 parents: [] 50542 } 50543 }, 50544 tagName: { 50545 type: 'string', 50546 default: 'div' 50547 }, 50548 displayLayout: { 50549 type: 'object', 50550 default: { 50551 type: 'list' 50552 } 50553 }, 50554 namespace: { 50555 type: 'string' 50556 } 50557 }, 50558 supports: { 50559 align: ['wide', 'full'], 50560 anchor: true, 50561 html: false, 50562 layout: true 50563 }, 50564 save({ 50565 attributes: { 50566 tagName: Tag = 'div' 50567 } 50568 }) { 50569 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); 50570 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 50571 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 50572 ...innerBlocksProps 50573 }); 50574 }, 50575 isEligible: ({ 50576 displayLayout 50577 }) => { 50578 return !!displayLayout; 50579 }, 50580 migrate: migrateDisplayLayout 50581 }; 50582 const query_deprecated_deprecated = [query_deprecated_v5, query_deprecated_v4, query_deprecated_v3, query_deprecated_v2, query_deprecated_v1]; 50583 /* harmony default export */ const query_deprecated = (query_deprecated_deprecated); 50584 50585 ;// ./node_modules/@wordpress/block-library/build-module/query/index.js 50586 /** 50587 * WordPress dependencies 50588 */ 50589 50590 50591 /** 50592 * Internal dependencies 50593 */ 50594 50595 const query_metadata = { 50596 $schema: "https://schemas.wp.org/trunk/block.json", 50597 apiVersion: 3, 50598 name: "core/query", 50599 title: "Query Loop", 50600 category: "theme", 50601 description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.", 50602 keywords: ["posts", "list", "blog", "blogs", "custom post types"], 50603 textdomain: "default", 50604 attributes: { 50605 queryId: { 50606 type: "number" 50607 }, 50608 query: { 50609 type: "object", 50610 "default": { 50611 perPage: null, 50612 pages: 0, 50613 offset: 0, 50614 postType: "post", 50615 order: "desc", 50616 orderBy: "date", 50617 author: "", 50618 search: "", 50619 exclude: [], 50620 sticky: "", 50621 inherit: true, 50622 taxQuery: null, 50623 parents: [], 50624 format: [] 50625 } 50626 }, 50627 tagName: { 50628 type: "string", 50629 "default": "div" 50630 }, 50631 namespace: { 50632 type: "string" 50633 }, 50634 enhancedPagination: { 50635 type: "boolean", 50636 "default": false 50637 } 50638 }, 50639 usesContext: ["templateSlug"], 50640 providesContext: { 50641 queryId: "queryId", 50642 query: "query", 50643 displayLayout: "displayLayout", 50644 enhancedPagination: "enhancedPagination" 50645 }, 50646 supports: { 50647 align: ["wide", "full"], 50648 html: false, 50649 layout: true, 50650 interactivity: true 50651 }, 50652 editorStyle: "wp-block-query-editor" 50653 }; 50654 50655 50656 50657 50658 const { 50659 name: query_name 50660 } = query_metadata; 50661 50662 const query_settings = { 50663 icon: library_loop, 50664 edit: query_edit, 50665 example: { 50666 viewportWidth: 650, 50667 attributes: { 50668 namespace: 'core/posts-list', 50669 query: { 50670 perPage: 4, 50671 pages: 1, 50672 offset: 0, 50673 postType: 'post', 50674 order: 'desc', 50675 orderBy: 'date', 50676 author: '', 50677 search: '', 50678 sticky: 'exclude', 50679 inherit: false 50680 } 50681 }, 50682 innerBlocks: [{ 50683 name: 'core/post-template', 50684 attributes: { 50685 layout: { 50686 type: 'grid', 50687 columnCount: 2 50688 } 50689 }, 50690 innerBlocks: [{ 50691 name: 'core/post-title' 50692 }, { 50693 name: 'core/post-date' 50694 }, { 50695 name: 'core/post-excerpt' 50696 }] 50697 }] 50698 }, 50699 save: query_save_save, 50700 variations: query_variations, 50701 deprecated: query_deprecated 50702 }; 50703 const query_init = () => initBlock({ 50704 name: query_name, 50705 metadata: query_metadata, 50706 settings: query_settings 50707 }); 50708 50709 ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js 50710 /** 50711 * WordPress dependencies 50712 */ 50713 50714 50715 50716 const query_no_results_edit_TEMPLATE = [['core/paragraph', { 50717 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when a query returns no results.') 50718 }]]; 50719 function QueryNoResultsEdit() { 50720 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 50721 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 50722 template: query_no_results_edit_TEMPLATE 50723 }); 50724 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 50725 ...innerBlocksProps 50726 }); 50727 } 50728 50729 ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js 50730 /** 50731 * WordPress dependencies 50732 */ 50733 50734 50735 function query_no_results_save_save() { 50736 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 50737 } 50738 50739 ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js 50740 /** 50741 * WordPress dependencies 50742 */ 50743 50744 50745 50746 /** 50747 * Internal dependencies 50748 */ 50749 50750 const query_no_results_metadata = { 50751 $schema: "https://schemas.wp.org/trunk/block.json", 50752 apiVersion: 3, 50753 name: "core/query-no-results", 50754 title: "No Results", 50755 category: "theme", 50756 description: "Contains the block elements used to render content when no query results are found.", 50757 ancestor: ["core/query"], 50758 textdomain: "default", 50759 usesContext: ["queryId", "query"], 50760 supports: { 50761 align: true, 50762 reusable: false, 50763 html: false, 50764 color: { 50765 gradients: true, 50766 link: true 50767 }, 50768 typography: { 50769 fontSize: true, 50770 lineHeight: true, 50771 __experimentalFontFamily: true, 50772 __experimentalFontWeight: true, 50773 __experimentalFontStyle: true, 50774 __experimentalTextTransform: true, 50775 __experimentalTextDecoration: true, 50776 __experimentalLetterSpacing: true, 50777 __experimentalDefaultControls: { 50778 fontSize: true 50779 } 50780 }, 50781 interactivity: { 50782 clientNavigation: true 50783 } 50784 } 50785 }; 50786 50787 50788 const { 50789 name: query_no_results_name 50790 } = query_no_results_metadata; 50791 50792 const query_no_results_settings = { 50793 icon: library_loop, 50794 edit: QueryNoResultsEdit, 50795 save: query_no_results_save_save, 50796 example: { 50797 innerBlocks: [{ 50798 name: 'core/paragraph', 50799 attributes: { 50800 content: (0,external_wp_i18n_namespaceObject.__)('No posts were found.') 50801 } 50802 }] 50803 } 50804 }; 50805 const query_no_results_init = () => initBlock({ 50806 name: query_no_results_name, 50807 metadata: query_no_results_metadata, 50808 settings: query_no_results_settings 50809 }); 50810 50811 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js 50812 /** 50813 * WordPress dependencies 50814 */ 50815 50816 50817 50818 function QueryPaginationArrowControls({ 50819 value, 50820 onChange 50821 }) { 50822 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 50823 __next40pxDefaultSize: true, 50824 __nextHasNoMarginBottom: true, 50825 label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), 50826 value: value, 50827 onChange: onChange, 50828 help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'), 50829 isBlock: true, 50830 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 50831 value: "none", 50832 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks') 50833 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 50834 value: "arrow", 50835 label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks') 50836 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 50837 value: "chevron", 50838 label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks') 50839 })] 50840 }); 50841 } 50842 50843 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-label-control.js 50844 /** 50845 * WordPress dependencies 50846 */ 50847 50848 50849 50850 function QueryPaginationLabelControl({ 50851 value, 50852 onChange 50853 }) { 50854 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 50855 __nextHasNoMarginBottom: true, 50856 label: (0,external_wp_i18n_namespaceObject.__)('Show label text'), 50857 help: (0,external_wp_i18n_namespaceObject.__)('Make label text visible, e.g. "Next Page".'), 50858 onChange: onChange, 50859 checked: value === true 50860 }); 50861 } 50862 50863 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js 50864 /** 50865 * WordPress dependencies 50866 */ 50867 50868 50869 50870 50871 50872 50873 /** 50874 * Internal dependencies 50875 */ 50876 50877 50878 50879 50880 const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']]; 50881 function edit_QueryPaginationEdit({ 50882 attributes: { 50883 paginationArrow, 50884 showLabel 50885 }, 50886 setAttributes, 50887 clientId 50888 }) { 50889 const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { 50890 const { 50891 getBlocks 50892 } = select(external_wp_blockEditor_namespaceObject.store); 50893 const innerBlocks = getBlocks(clientId); 50894 /** 50895 * Show the `paginationArrow` and `showLabel` controls only if a 50896 * `QueryPaginationNext/Previous` block exists. 50897 */ 50898 return innerBlocks?.find(innerBlock => { 50899 return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name); 50900 }); 50901 }, [clientId]); 50902 const { 50903 __unstableMarkNextChangeAsNotPersistent 50904 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 50905 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 50906 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 50907 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 50908 template: query_pagination_edit_TEMPLATE 50909 }); 50910 50911 // Always show label text if paginationArrow is set to 'none'. 50912 (0,external_wp_element_namespaceObject.useEffect)(() => { 50913 if (paginationArrow === 'none' && !showLabel) { 50914 __unstableMarkNextChangeAsNotPersistent(); 50915 setAttributes({ 50916 showLabel: true 50917 }); 50918 } 50919 }, [paginationArrow, setAttributes, showLabel, __unstableMarkNextChangeAsNotPersistent]); 50920 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 50921 children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 50922 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 50923 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 50924 resetAll: () => { 50925 setAttributes({ 50926 paginationArrow: 'none', 50927 showLabel: true 50928 }); 50929 }, 50930 dropdownMenuProps: dropdownMenuProps, 50931 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 50932 hasValue: () => paginationArrow !== 'none', 50933 label: (0,external_wp_i18n_namespaceObject.__)('Pagination arrow'), 50934 onDeselect: () => setAttributes({ 50935 paginationArrow: 'none' 50936 }), 50937 isShownByDefault: true, 50938 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationArrowControls, { 50939 value: paginationArrow, 50940 onChange: value => { 50941 setAttributes({ 50942 paginationArrow: value 50943 }); 50944 } 50945 }) 50946 }), paginationArrow !== 'none' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 50947 hasValue: () => !showLabel, 50948 label: (0,external_wp_i18n_namespaceObject.__)('Show text'), 50949 onDeselect: () => setAttributes({ 50950 showLabel: true 50951 }), 50952 isShownByDefault: true, 50953 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationLabelControl, { 50954 value: showLabel, 50955 onChange: value => { 50956 setAttributes({ 50957 showLabel: value 50958 }); 50959 } 50960 }) 50961 })] 50962 }) 50963 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { 50964 ...innerBlocksProps 50965 })] 50966 }); 50967 } 50968 50969 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js 50970 /** 50971 * WordPress dependencies 50972 */ 50973 50974 50975 function query_pagination_save_save() { 50976 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); 50977 } 50978 50979 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js 50980 /** 50981 * WordPress dependencies 50982 */ 50983 50984 50985 const query_pagination_deprecated_deprecated = [ 50986 // Version with wrapper `div` element. 50987 { 50988 save() { 50989 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 50990 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 50991 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 50992 }); 50993 } 50994 }]; 50995 /* harmony default export */ const query_pagination_deprecated = (query_pagination_deprecated_deprecated); 50996 50997 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js 50998 /** 50999 * WordPress dependencies 51000 */ 51001 51002 51003 /** 51004 * Internal dependencies 51005 */ 51006 51007 const query_pagination_metadata = { 51008 $schema: "https://schemas.wp.org/trunk/block.json", 51009 apiVersion: 3, 51010 name: "core/query-pagination", 51011 title: "Pagination", 51012 category: "theme", 51013 ancestor: ["core/query"], 51014 allowedBlocks: ["core/query-pagination-previous", "core/query-pagination-numbers", "core/query-pagination-next"], 51015 description: "Displays a paginated navigation to next/previous set of posts, when applicable.", 51016 textdomain: "default", 51017 attributes: { 51018 paginationArrow: { 51019 type: "string", 51020 "default": "none" 51021 }, 51022 showLabel: { 51023 type: "boolean", 51024 "default": true 51025 } 51026 }, 51027 usesContext: ["queryId", "query"], 51028 providesContext: { 51029 paginationArrow: "paginationArrow", 51030 showLabel: "showLabel" 51031 }, 51032 supports: { 51033 align: true, 51034 reusable: false, 51035 html: false, 51036 color: { 51037 gradients: true, 51038 link: true, 51039 __experimentalDefaultControls: { 51040 background: true, 51041 text: true, 51042 link: true 51043 } 51044 }, 51045 layout: { 51046 allowSwitching: false, 51047 allowInheriting: false, 51048 "default": { 51049 type: "flex" 51050 } 51051 }, 51052 typography: { 51053 fontSize: true, 51054 lineHeight: true, 51055 __experimentalFontFamily: true, 51056 __experimentalFontWeight: true, 51057 __experimentalFontStyle: true, 51058 __experimentalTextTransform: true, 51059 __experimentalTextDecoration: true, 51060 __experimentalLetterSpacing: true, 51061 __experimentalDefaultControls: { 51062 fontSize: true 51063 } 51064 }, 51065 interactivity: { 51066 clientNavigation: true 51067 } 51068 }, 51069 editorStyle: "wp-block-query-pagination-editor", 51070 style: "wp-block-query-pagination" 51071 }; 51072 51073 51074 51075 const { 51076 name: query_pagination_name 51077 } = query_pagination_metadata; 51078 51079 const query_pagination_settings = { 51080 icon: query_pagination, 51081 edit: edit_QueryPaginationEdit, 51082 save: query_pagination_save_save, 51083 deprecated: query_pagination_deprecated 51084 }; 51085 const query_pagination_init = () => initBlock({ 51086 name: query_pagination_name, 51087 metadata: query_pagination_metadata, 51088 settings: query_pagination_settings 51089 }); 51090 51091 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js 51092 /** 51093 * WordPress dependencies 51094 */ 51095 51096 51097 51098 const query_pagination_next_edit_arrowMap = { 51099 none: '', 51100 arrow: '→', 51101 chevron: '»' 51102 }; 51103 function QueryPaginationNextEdit({ 51104 attributes: { 51105 label 51106 }, 51107 setAttributes, 51108 context: { 51109 paginationArrow, 51110 showLabel 51111 } 51112 }) { 51113 const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow]; 51114 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 51115 href: "#pagination-next-pseudo-link", 51116 onClick: event => event.preventDefault(), 51117 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 51118 children: [showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 51119 __experimentalVersion: 2, 51120 tagName: "span", 51121 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'), 51122 placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'), 51123 value: label, 51124 onChange: newLabel => setAttributes({ 51125 label: newLabel 51126 }) 51127 }), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 51128 className: `wp-block-query-pagination-next-arrow is-arrow-$paginationArrow}`, 51129 "aria-hidden": true, 51130 children: displayArrow 51131 })] 51132 }); 51133 } 51134 51135 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js 51136 /** 51137 * WordPress dependencies 51138 */ 51139 51140 51141 /** 51142 * Internal dependencies 51143 */ 51144 51145 const query_pagination_next_metadata = { 51146 $schema: "https://schemas.wp.org/trunk/block.json", 51147 apiVersion: 3, 51148 name: "core/query-pagination-next", 51149 title: "Next Page", 51150 category: "theme", 51151 parent: ["core/query-pagination"], 51152 description: "Displays the next posts page link.", 51153 textdomain: "default", 51154 attributes: { 51155 label: { 51156 type: "string" 51157 } 51158 }, 51159 usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], 51160 supports: { 51161 reusable: false, 51162 html: false, 51163 color: { 51164 gradients: true, 51165 text: false, 51166 __experimentalDefaultControls: { 51167 background: true 51168 } 51169 }, 51170 typography: { 51171 fontSize: true, 51172 lineHeight: true, 51173 __experimentalFontFamily: true, 51174 __experimentalFontWeight: true, 51175 __experimentalFontStyle: true, 51176 __experimentalTextTransform: true, 51177 __experimentalTextDecoration: true, 51178 __experimentalLetterSpacing: true, 51179 __experimentalDefaultControls: { 51180 fontSize: true 51181 } 51182 }, 51183 interactivity: { 51184 clientNavigation: true 51185 } 51186 } 51187 }; 51188 51189 const { 51190 name: query_pagination_next_name 51191 } = query_pagination_next_metadata; 51192 51193 const query_pagination_next_settings = { 51194 icon: query_pagination_next, 51195 edit: QueryPaginationNextEdit 51196 }; 51197 const query_pagination_next_init = () => initBlock({ 51198 name: query_pagination_next_name, 51199 metadata: query_pagination_next_metadata, 51200 settings: query_pagination_next_settings 51201 }); 51202 51203 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js 51204 /** 51205 * WordPress dependencies 51206 */ 51207 51208 51209 51210 51211 /** 51212 * Internal dependencies 51213 */ 51214 51215 51216 const createPaginationItem = (content, Tag = 'a', extraClass = '') => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 51217 className: `page-numbers $extraClass}`, 51218 children: content 51219 }, content); 51220 const previewPaginationNumbers = midSize => { 51221 const paginationItems = []; 51222 51223 // First set of pagination items. 51224 for (let i = 1; i <= midSize; i++) { 51225 paginationItems.push(createPaginationItem(i)); 51226 } 51227 51228 // Current pagination item. 51229 paginationItems.push(createPaginationItem(midSize + 1, 'span', 'current')); 51230 51231 // Second set of pagination items. 51232 for (let i = 1; i <= midSize; i++) { 51233 paginationItems.push(createPaginationItem(midSize + 1 + i)); 51234 } 51235 51236 // Dots. 51237 paginationItems.push(createPaginationItem('...', 'span', 'dots')); 51238 51239 // Last pagination item. 51240 paginationItems.push(createPaginationItem(midSize * 2 + 3)); 51241 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 51242 children: paginationItems 51243 }); 51244 }; 51245 function QueryPaginationNumbersEdit({ 51246 attributes, 51247 setAttributes 51248 }) { 51249 const { 51250 midSize 51251 } = attributes; 51252 const paginationNumbers = previewPaginationNumbers(parseInt(midSize, 10)); 51253 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 51254 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 51255 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 51256 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 51257 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 51258 resetAll: () => setAttributes({ 51259 midSize: 2 51260 }), 51261 dropdownMenuProps: dropdownMenuProps, 51262 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 51263 label: (0,external_wp_i18n_namespaceObject.__)('Number of links'), 51264 hasValue: () => midSize !== 2, 51265 onDeselect: () => setAttributes({ 51266 midSize: 2 51267 }), 51268 isShownByDefault: true, 51269 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 51270 __next40pxDefaultSize: true, 51271 __nextHasNoMarginBottom: true, 51272 label: (0,external_wp_i18n_namespaceObject.__)('Number of links'), 51273 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.'), 51274 value: midSize, 51275 onChange: value => { 51276 setAttributes({ 51277 midSize: parseInt(value, 10) 51278 }); 51279 }, 51280 min: 0, 51281 max: 5, 51282 withInputField: false 51283 }) 51284 }) 51285 }) 51286 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 51287 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 51288 children: paginationNumbers 51289 })] 51290 }); 51291 } 51292 51293 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js 51294 /** 51295 * WordPress dependencies 51296 */ 51297 51298 51299 /** 51300 * Internal dependencies 51301 */ 51302 51303 const query_pagination_numbers_metadata = { 51304 $schema: "https://schemas.wp.org/trunk/block.json", 51305 apiVersion: 3, 51306 name: "core/query-pagination-numbers", 51307 title: "Page Numbers", 51308 category: "theme", 51309 parent: ["core/query-pagination"], 51310 description: "Displays a list of page numbers for pagination.", 51311 textdomain: "default", 51312 attributes: { 51313 midSize: { 51314 type: "number", 51315 "default": 2 51316 } 51317 }, 51318 usesContext: ["queryId", "query", "enhancedPagination"], 51319 supports: { 51320 reusable: false, 51321 html: false, 51322 color: { 51323 gradients: true, 51324 text: false, 51325 __experimentalDefaultControls: { 51326 background: true 51327 } 51328 }, 51329 typography: { 51330 fontSize: true, 51331 lineHeight: true, 51332 __experimentalFontFamily: true, 51333 __experimentalFontWeight: true, 51334 __experimentalFontStyle: true, 51335 __experimentalTextTransform: true, 51336 __experimentalTextDecoration: true, 51337 __experimentalLetterSpacing: true, 51338 __experimentalDefaultControls: { 51339 fontSize: true 51340 } 51341 }, 51342 interactivity: { 51343 clientNavigation: true 51344 } 51345 }, 51346 editorStyle: "wp-block-query-pagination-numbers-editor" 51347 }; 51348 51349 const { 51350 name: query_pagination_numbers_name 51351 } = query_pagination_numbers_metadata; 51352 51353 const query_pagination_numbers_settings = { 51354 icon: query_pagination_numbers, 51355 edit: QueryPaginationNumbersEdit, 51356 example: {} 51357 }; 51358 const query_pagination_numbers_init = () => initBlock({ 51359 name: query_pagination_numbers_name, 51360 metadata: query_pagination_numbers_metadata, 51361 settings: query_pagination_numbers_settings 51362 }); 51363 51364 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js 51365 /** 51366 * WordPress dependencies 51367 */ 51368 51369 51370 51371 const query_pagination_previous_edit_arrowMap = { 51372 none: '', 51373 arrow: '←', 51374 chevron: '«' 51375 }; 51376 function QueryPaginationPreviousEdit({ 51377 attributes: { 51378 label 51379 }, 51380 setAttributes, 51381 context: { 51382 paginationArrow, 51383 showLabel 51384 } 51385 }) { 51386 const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow]; 51387 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { 51388 href: "#pagination-previous-pseudo-link", 51389 onClick: event => event.preventDefault(), 51390 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 51391 children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 51392 className: `wp-block-query-pagination-previous-arrow is-arrow-$paginationArrow}`, 51393 "aria-hidden": true, 51394 children: displayArrow 51395 }), showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 51396 __experimentalVersion: 2, 51397 tagName: "span", 51398 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'), 51399 placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'), 51400 value: label, 51401 onChange: newLabel => setAttributes({ 51402 label: newLabel 51403 }) 51404 })] 51405 }); 51406 } 51407 51408 ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js 51409 /** 51410 * WordPress dependencies 51411 */ 51412 51413 51414 /** 51415 * Internal dependencies 51416 */ 51417 51418 const query_pagination_previous_metadata = { 51419 $schema: "https://schemas.wp.org/trunk/block.json", 51420 apiVersion: 3, 51421 name: "core/query-pagination-previous", 51422 title: "Previous Page", 51423 category: "theme", 51424 parent: ["core/query-pagination"], 51425 description: "Displays the previous posts page link.", 51426 textdomain: "default", 51427 attributes: { 51428 label: { 51429 type: "string" 51430 } 51431 }, 51432 usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], 51433 supports: { 51434 reusable: false, 51435 html: false, 51436 color: { 51437 gradients: true, 51438 text: false, 51439 __experimentalDefaultControls: { 51440 background: true 51441 } 51442 }, 51443 typography: { 51444 fontSize: true, 51445 lineHeight: true, 51446 __experimentalFontFamily: true, 51447 __experimentalFontWeight: true, 51448 __experimentalFontStyle: true, 51449 __experimentalTextTransform: true, 51450 __experimentalTextDecoration: true, 51451 __experimentalLetterSpacing: true, 51452 __experimentalDefaultControls: { 51453 fontSize: true 51454 } 51455 }, 51456 interactivity: { 51457 clientNavigation: true 51458 } 51459 } 51460 }; 51461 51462 const { 51463 name: query_pagination_previous_name 51464 } = query_pagination_previous_metadata; 51465 51466 const query_pagination_previous_settings = { 51467 icon: query_pagination_previous, 51468 edit: QueryPaginationPreviousEdit 51469 }; 51470 const query_pagination_previous_init = () => initBlock({ 51471 name: query_pagination_previous_name, 51472 metadata: query_pagination_previous_metadata, 51473 settings: query_pagination_previous_settings 51474 }); 51475 51476 ;// ./node_modules/@wordpress/block-library/build-module/query-title/use-archive-label.js 51477 /** 51478 * WordPress dependencies 51479 */ 51480 51481 51482 function useArchiveLabel() { 51483 const templateSlug = (0,external_wp_data_namespaceObject.useSelect)(select => { 51484 // @wordpress/block-library should not depend on @wordpress/editor. 51485 // Blocks can be loaded into a *non-post* block editor, so to avoid 51486 // declaring @wordpress/editor as a dependency, we must access its 51487 // store by string. 51488 // The solution here is to split WP specific blocks from generic blocks. 51489 // eslint-disable-next-line @wordpress/data-no-store-string-literals 51490 const { 51491 getCurrentPostId, 51492 getCurrentPostType, 51493 getCurrentTemplateId 51494 } = select('core/editor'); 51495 const currentPostType = getCurrentPostType(); 51496 const templateId = getCurrentTemplateId() || (currentPostType === 'wp_template' ? getCurrentPostId() : null); 51497 return templateId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId)?.slug : null; 51498 }, []); 51499 const taxonomyMatches = templateSlug?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/); 51500 let taxonomy; 51501 let term; 51502 let isAuthor = false; 51503 let authorSlug; 51504 if (taxonomyMatches) { 51505 // If is for a all taxonomies of a type 51506 if (taxonomyMatches[1]) { 51507 taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; 51508 } 51509 // If is for a all taxonomies of a type 51510 else if (taxonomyMatches[3]) { 51511 taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; 51512 term = taxonomyMatches[7]; 51513 } 51514 taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy; 51515 51516 //getTaxonomy( 'category' ); 51517 //wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} ); 51518 } else { 51519 const authorMatches = templateSlug?.match(/^(author)$|^author-(.+)$/); 51520 if (authorMatches) { 51521 isAuthor = true; 51522 if (authorMatches[2]) { 51523 authorSlug = authorMatches[2]; 51524 } 51525 } 51526 } 51527 return (0,external_wp_data_namespaceObject.useSelect)(select => { 51528 const { 51529 getEntityRecords, 51530 getTaxonomy, 51531 getAuthors 51532 } = select(external_wp_coreData_namespaceObject.store); 51533 let archiveTypeLabel; 51534 let archiveNameLabel; 51535 if (taxonomy) { 51536 archiveTypeLabel = getTaxonomy(taxonomy)?.labels?.singular_name; 51537 } 51538 if (term) { 51539 const records = getEntityRecords('taxonomy', taxonomy, { 51540 slug: term, 51541 per_page: 1 51542 }); 51543 if (records && records[0]) { 51544 archiveNameLabel = records[0].name; 51545 } 51546 } 51547 if (isAuthor) { 51548 archiveTypeLabel = 'Author'; 51549 if (authorSlug) { 51550 const authorRecords = getAuthors({ 51551 slug: authorSlug 51552 }); 51553 if (authorRecords && authorRecords[0]) { 51554 archiveNameLabel = authorRecords[0].name; 51555 } 51556 } 51557 } 51558 return { 51559 archiveTypeLabel, 51560 archiveNameLabel 51561 }; 51562 }, [authorSlug, isAuthor, taxonomy, term]); 51563 } 51564 51565 ;// ./node_modules/@wordpress/block-library/build-module/query-title/edit.js 51566 /** 51567 * External dependencies 51568 */ 51569 51570 51571 /** 51572 * WordPress dependencies 51573 */ 51574 51575 51576 51577 51578 /** 51579 * Internal dependencies 51580 */ 51581 51582 51583 51584 const SUPPORTED_TYPES = ['archive', 'search']; 51585 function QueryTitleEdit({ 51586 attributes: { 51587 type, 51588 level, 51589 levelOptions, 51590 textAlign, 51591 showPrefix, 51592 showSearchTerm 51593 }, 51594 setAttributes 51595 }) { 51596 const { 51597 archiveTypeLabel, 51598 archiveNameLabel 51599 } = useArchiveLabel(); 51600 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 51601 const TagName = `h$level}`; 51602 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 51603 className: dist_clsx('wp-block-query-title__placeholder', { 51604 [`has-text-align-$textAlign}`]: textAlign 51605 }) 51606 }); 51607 if (!SUPPORTED_TYPES.includes(type)) { 51608 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 51609 ...blockProps, 51610 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 51611 children: (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.') 51612 }) 51613 }); 51614 } 51615 let titleElement; 51616 if (type === 'archive') { 51617 let title; 51618 if (archiveTypeLabel) { 51619 if (showPrefix) { 51620 if (archiveNameLabel) { 51621 title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */ 51622 (0,external_wp_i18n_namespaceObject._x)('%1$s: %2$s', 'archive label'), archiveTypeLabel, archiveNameLabel); 51623 } else { 51624 title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */ 51625 (0,external_wp_i18n_namespaceObject.__)('%s: Name'), archiveTypeLabel); 51626 } 51627 } else if (archiveNameLabel) { 51628 title = archiveNameLabel; 51629 } else { 51630 title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */ 51631 (0,external_wp_i18n_namespaceObject.__)('%s name'), archiveTypeLabel); 51632 } 51633 } else { 51634 title = showPrefix ? (0,external_wp_i18n_namespaceObject.__)('Archive type: Name') : (0,external_wp_i18n_namespaceObject.__)('Archive title'); 51635 } 51636 titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 51637 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 51638 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 51639 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 51640 resetAll: () => setAttributes({ 51641 showPrefix: true 51642 }), 51643 dropdownMenuProps: dropdownMenuProps, 51644 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 51645 hasValue: () => !showPrefix, 51646 label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'), 51647 onDeselect: () => setAttributes({ 51648 showPrefix: true 51649 }), 51650 isShownByDefault: true, 51651 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 51652 __nextHasNoMarginBottom: true, 51653 label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'), 51654 onChange: () => setAttributes({ 51655 showPrefix: !showPrefix 51656 }), 51657 checked: showPrefix 51658 }) 51659 }) 51660 }) 51661 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 51662 ...blockProps, 51663 children: title 51664 })] 51665 }); 51666 } 51667 if (type === 'search') { 51668 titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 51669 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 51670 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 51671 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 51672 resetAll: () => setAttributes({ 51673 showSearchTerm: true 51674 }), 51675 dropdownMenuProps: dropdownMenuProps, 51676 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 51677 hasValue: () => !showSearchTerm, 51678 label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'), 51679 onDeselect: () => setAttributes({ 51680 showSearchTerm: true 51681 }), 51682 isShownByDefault: true, 51683 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 51684 __nextHasNoMarginBottom: true, 51685 label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'), 51686 onChange: () => setAttributes({ 51687 showSearchTerm: !showSearchTerm 51688 }), 51689 checked: showSearchTerm 51690 }) 51691 }) 51692 }) 51693 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 51694 ...blockProps, 51695 children: showSearchTerm ? (0,external_wp_i18n_namespaceObject.__)('Search results for: “search term”') : (0,external_wp_i18n_namespaceObject.__)('Search results') 51696 })] 51697 }); 51698 } 51699 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 51700 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 51701 group: "block", 51702 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 51703 value: level, 51704 options: levelOptions, 51705 onChange: newLevel => setAttributes({ 51706 level: newLevel 51707 }) 51708 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 51709 value: textAlign, 51710 onChange: nextAlign => { 51711 setAttributes({ 51712 textAlign: nextAlign 51713 }); 51714 } 51715 })] 51716 }), titleElement] 51717 }); 51718 } 51719 51720 ;// ./node_modules/@wordpress/block-library/build-module/query-title/variations.js 51721 /* wp:polyfill */ 51722 /** 51723 * WordPress dependencies 51724 */ 51725 51726 51727 const query_title_variations_variations = [{ 51728 isDefault: true, 51729 name: 'archive-title', 51730 title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'), 51731 description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'), 51732 icon: library_title, 51733 attributes: { 51734 type: 'archive' 51735 }, 51736 scope: ['inserter'] 51737 }, { 51738 isDefault: false, 51739 name: 'search-title', 51740 title: (0,external_wp_i18n_namespaceObject.__)('Search Results Title'), 51741 description: (0,external_wp_i18n_namespaceObject.__)('Display the search results title based on the queried object.'), 51742 icon: library_title, 51743 attributes: { 51744 type: 'search' 51745 }, 51746 scope: ['inserter'] 51747 }]; 51748 51749 /** 51750 * Add `isActive` function to all `query-title` variations, if not defined. 51751 * `isActive` function is used to find a variation match from a created 51752 * Block by providing its attributes. 51753 */ 51754 query_title_variations_variations.forEach(variation => { 51755 if (variation.isActive) { 51756 return; 51757 } 51758 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; 51759 }); 51760 /* harmony default export */ const query_title_variations = (query_title_variations_variations); 51761 51762 ;// ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js 51763 /** 51764 * Internal dependencies 51765 */ 51766 51767 const query_title_deprecated_v1 = { 51768 attributes: { 51769 type: { 51770 type: 'string' 51771 }, 51772 textAlign: { 51773 type: 'string' 51774 }, 51775 level: { 51776 type: 'number', 51777 default: 1 51778 } 51779 }, 51780 supports: { 51781 align: ['wide', 'full'], 51782 html: false, 51783 color: { 51784 gradients: true 51785 }, 51786 spacing: { 51787 margin: true 51788 }, 51789 typography: { 51790 fontSize: true, 51791 lineHeight: true, 51792 __experimentalFontFamily: true 51793 } 51794 }, 51795 save() { 51796 return null; 51797 }, 51798 migrate: migrate_font_family, 51799 isEligible({ 51800 style 51801 }) { 51802 return style?.typography?.fontFamily; 51803 } 51804 }; 51805 51806 /** 51807 * New deprecations need to be placed first 51808 * for them to have higher priority. 51809 * 51810 * Old deprecations may need to be updated as well. 51811 * 51812 * See block-deprecation.md 51813 */ 51814 /* harmony default export */ const query_title_deprecated = ([query_title_deprecated_v1]); 51815 51816 ;// ./node_modules/@wordpress/block-library/build-module/query-title/index.js 51817 /** 51818 * WordPress dependencies 51819 */ 51820 51821 51822 /** 51823 * Internal dependencies 51824 */ 51825 51826 const query_title_metadata = { 51827 $schema: "https://schemas.wp.org/trunk/block.json", 51828 apiVersion: 3, 51829 name: "core/query-title", 51830 title: "Query Title", 51831 category: "theme", 51832 description: "Display the query title.", 51833 textdomain: "default", 51834 attributes: { 51835 type: { 51836 type: "string" 51837 }, 51838 textAlign: { 51839 type: "string" 51840 }, 51841 level: { 51842 type: "number", 51843 "default": 1 51844 }, 51845 levelOptions: { 51846 type: "array" 51847 }, 51848 showPrefix: { 51849 type: "boolean", 51850 "default": true 51851 }, 51852 showSearchTerm: { 51853 type: "boolean", 51854 "default": true 51855 } 51856 }, 51857 example: { 51858 attributes: { 51859 type: "search" 51860 } 51861 }, 51862 supports: { 51863 align: ["wide", "full"], 51864 html: false, 51865 color: { 51866 gradients: true, 51867 __experimentalDefaultControls: { 51868 background: true, 51869 text: true 51870 } 51871 }, 51872 spacing: { 51873 margin: true, 51874 padding: true 51875 }, 51876 typography: { 51877 fontSize: true, 51878 lineHeight: true, 51879 __experimentalFontFamily: true, 51880 __experimentalFontStyle: true, 51881 __experimentalFontWeight: true, 51882 __experimentalLetterSpacing: true, 51883 __experimentalTextTransform: true, 51884 __experimentalTextDecoration: true, 51885 __experimentalDefaultControls: { 51886 fontSize: true 51887 } 51888 }, 51889 interactivity: { 51890 clientNavigation: true 51891 }, 51892 __experimentalBorder: { 51893 radius: true, 51894 color: true, 51895 width: true, 51896 style: true, 51897 __experimentalDefaultControls: { 51898 radius: true, 51899 color: true, 51900 width: true, 51901 style: true 51902 } 51903 } 51904 }, 51905 style: "wp-block-query-title" 51906 }; 51907 51908 51909 51910 const { 51911 name: query_title_name 51912 } = query_title_metadata; 51913 51914 const query_title_settings = { 51915 icon: library_title, 51916 edit: QueryTitleEdit, 51917 variations: query_title_variations, 51918 deprecated: query_title_deprecated 51919 }; 51920 const query_title_init = () => initBlock({ 51921 name: query_title_name, 51922 metadata: query_title_metadata, 51923 settings: query_title_settings 51924 }); 51925 51926 ;// ./node_modules/@wordpress/block-library/build-module/query-total/icons.js 51927 /** 51928 * WordPress dependencies 51929 */ 51930 51931 51932 const resultsFound = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 51933 xmlns: "http://www.w3.org/2000/svg", 51934 viewBox: "0 0 24 24", 51935 width: "24", 51936 height: "24", 51937 "aria-hidden": "true", 51938 focusable: "false", 51939 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 51940 d: "M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z" 51941 }) 51942 }); 51943 const displayingResults = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 51944 xmlns: "http://www.w3.org/2000/svg", 51945 viewBox: "0 0 24 24", 51946 width: "24", 51947 height: "24", 51948 "aria-hidden": "true", 51949 focusable: "false", 51950 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 51951 d: "M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z" 51952 }) 51953 }); 51954 const queryTotal = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 51955 xmlns: "http://www.w3.org/2000/svg", 51956 viewBox: "0 0 24 24", 51957 width: "24", 51958 height: "24", 51959 "aria-hidden": "true", 51960 focusable: "false", 51961 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 51962 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.5v12Zm-7-6-4.1 5h8.8v-3h-1.5v1.5h-4.2l2.9-3.5-2.9-3.5h4.2V10h1.5V7H7.4l4.1 5Z" 51963 }) 51964 }); 51965 51966 ;// ./node_modules/@wordpress/block-library/build-module/query-total/edit.js 51967 /** 51968 * WordPress dependencies 51969 */ 51970 51971 51972 51973 51974 /** 51975 * Internal dependencies 51976 */ 51977 51978 51979 function QueryTotalEdit({ 51980 attributes, 51981 setAttributes 51982 }) { 51983 const { 51984 displayType 51985 } = attributes; 51986 51987 // Block properties and classes. 51988 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 51989 const getButtonPositionIcon = () => { 51990 switch (displayType) { 51991 case 'total-results': 51992 return resultsFound; 51993 case 'range-display': 51994 return displayingResults; 51995 } 51996 }; 51997 const buttonPositionControls = [{ 51998 role: 'menuitemradio', 51999 title: (0,external_wp_i18n_namespaceObject.__)('Total results'), 52000 isActive: displayType === 'total-results', 52001 icon: resultsFound, 52002 onClick: () => { 52003 setAttributes({ 52004 displayType: 'total-results' 52005 }); 52006 } 52007 }, { 52008 role: 'menuitemradio', 52009 title: (0,external_wp_i18n_namespaceObject.__)('Range display'), 52010 isActive: displayType === 'range-display', 52011 icon: displayingResults, 52012 onClick: () => { 52013 setAttributes({ 52014 displayType: 'range-display' 52015 }); 52016 } 52017 }]; 52018 52019 // Controls for the block. 52020 const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 52021 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 52022 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 52023 icon: getButtonPositionIcon(), 52024 label: (0,external_wp_i18n_namespaceObject.__)('Change display type'), 52025 controls: buttonPositionControls 52026 }) 52027 }) 52028 }); 52029 52030 // Render output based on the selected display type. 52031 const renderDisplay = () => { 52032 if (displayType === 'total-results') { 52033 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 52034 children: (0,external_wp_i18n_namespaceObject.__)('12 results found') 52035 }); 52036 } 52037 if (displayType === 'range-display') { 52038 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 52039 children: (0,external_wp_i18n_namespaceObject.__)('Displaying 1 – 10 of 12') 52040 }); 52041 } 52042 return null; 52043 }; 52044 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 52045 ...blockProps, 52046 children: [controls, renderDisplay()] 52047 }); 52048 } 52049 52050 ;// ./node_modules/@wordpress/block-library/build-module/query-total/index.js 52051 /** 52052 * Internal dependencies 52053 */ 52054 const query_total_metadata = { 52055 $schema: "https://schemas.wp.org/trunk/block.json", 52056 apiVersion: 3, 52057 name: "core/query-total", 52058 title: "Query Total", 52059 category: "theme", 52060 ancestor: ["core/query"], 52061 description: "Display the total number of results in a query.", 52062 textdomain: "default", 52063 attributes: { 52064 displayType: { 52065 type: "string", 52066 "default": "total-results" 52067 } 52068 }, 52069 usesContext: ["queryId", "query"], 52070 supports: { 52071 align: ["wide", "full"], 52072 html: false, 52073 spacing: { 52074 margin: true, 52075 padding: true 52076 }, 52077 color: { 52078 gradients: true, 52079 text: true, 52080 __experimentalDefaultControls: { 52081 background: true 52082 } 52083 }, 52084 typography: { 52085 fontSize: true, 52086 lineHeight: true, 52087 __experimentalFontFamily: true, 52088 __experimentalFontWeight: true, 52089 __experimentalFontStyle: true, 52090 __experimentalTextTransform: true, 52091 __experimentalTextDecoration: true, 52092 __experimentalLetterSpacing: true, 52093 __experimentalDefaultControls: { 52094 fontSize: true 52095 } 52096 }, 52097 __experimentalBorder: { 52098 radius: true, 52099 color: true, 52100 width: true, 52101 style: true, 52102 __experimentalDefaultControls: { 52103 radius: true, 52104 color: true, 52105 width: true, 52106 style: true 52107 } 52108 } 52109 }, 52110 style: "wp-block-query-total" 52111 }; 52112 52113 52114 52115 52116 /* Block settings */ 52117 const { 52118 name: query_total_name 52119 } = query_total_metadata; 52120 52121 const query_total_settings = { 52122 icon: queryTotal, 52123 edit: QueryTotalEdit 52124 }; 52125 const query_total_init = () => initBlock({ 52126 name: query_total_name, 52127 metadata: query_total_metadata, 52128 settings: query_total_settings 52129 }); 52130 52131 ;// ./node_modules/@wordpress/icons/build-module/library/quote.js 52132 /** 52133 * WordPress dependencies 52134 */ 52135 52136 52137 const quote = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 52138 viewBox: "0 0 24 24", 52139 xmlns: "http://www.w3.org/2000/svg", 52140 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 52141 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" 52142 }) 52143 }); 52144 /* harmony default export */ const library_quote = (quote); 52145 52146 ;// ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js 52147 /* wp:polyfill */ 52148 /** 52149 * External dependencies 52150 */ 52151 52152 52153 /** 52154 * WordPress dependencies 52155 */ 52156 52157 52158 52159 const migrateToQuoteV2 = attributes => { 52160 const { 52161 value, 52162 ...restAttributes 52163 } = attributes; 52164 return [{ 52165 ...restAttributes 52166 }, value ? (0,external_wp_blocks_namespaceObject.parseWithAttributeSchema)(value, { 52167 type: 'array', 52168 source: 'query', 52169 selector: 'p', 52170 query: { 52171 content: { 52172 type: 'string', 52173 source: 'html' 52174 } 52175 } 52176 }).map(({ 52177 content 52178 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52179 content 52180 })) : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')]; 52181 }; 52182 const deprecated_TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; 52183 52184 // Migrate existing text alignment settings to the renamed attribute. 52185 const deprecated_migrateTextAlign = (attributes, innerBlocks) => { 52186 const { 52187 align, 52188 ...rest 52189 } = attributes; 52190 // Check if there are valid alignments stored in the old attribute 52191 // and assign them to the new attribute name. 52192 const migratedAttributes = deprecated_TEXT_ALIGN_OPTIONS.includes(align) ? { 52193 ...rest, 52194 textAlign: align 52195 } : attributes; 52196 return [migratedAttributes, innerBlocks]; 52197 }; 52198 52199 // Migrate the v2 blocks with style === `2`; 52200 const migrateLargeStyle = (attributes, innerBlocks) => { 52201 return [{ 52202 ...attributes, 52203 className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large' 52204 }, innerBlocks]; 52205 }; 52206 52207 // Version before the 'align' attribute was replaced with 'textAlign'. 52208 const quote_deprecated_v4 = { 52209 attributes: { 52210 value: { 52211 type: 'string', 52212 source: 'html', 52213 selector: 'blockquote', 52214 multiline: 'p', 52215 default: '', 52216 role: 'content' 52217 }, 52218 citation: { 52219 type: 'string', 52220 source: 'html', 52221 selector: 'cite', 52222 default: '', 52223 role: 'content' 52224 }, 52225 align: { 52226 type: 'string' 52227 } 52228 }, 52229 supports: { 52230 anchor: true, 52231 html: false, 52232 __experimentalOnEnter: true, 52233 __experimentalOnMerge: true, 52234 typography: { 52235 fontSize: true, 52236 lineHeight: true, 52237 __experimentalFontFamily: true, 52238 __experimentalFontWeight: true, 52239 __experimentalFontStyle: true, 52240 __experimentalTextTransform: true, 52241 __experimentalTextDecoration: true, 52242 __experimentalLetterSpacing: true, 52243 __experimentalDefaultControls: { 52244 fontSize: true, 52245 fontAppearance: true 52246 } 52247 }, 52248 color: { 52249 gradients: true, 52250 heading: true, 52251 link: true, 52252 __experimentalDefaultControls: { 52253 background: true, 52254 text: true 52255 } 52256 } 52257 }, 52258 isEligible: ({ 52259 align 52260 }) => deprecated_TEXT_ALIGN_OPTIONS.includes(align), 52261 save({ 52262 attributes 52263 }) { 52264 const { 52265 align, 52266 citation 52267 } = attributes; 52268 const className = dist_clsx({ 52269 [`has-text-align-$align}`]: align 52270 }); 52271 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52272 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 52273 className 52274 }), 52275 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52276 tagName: "cite", 52277 value: citation 52278 })] 52279 }); 52280 }, 52281 migrate: deprecated_migrateTextAlign 52282 }; 52283 const quote_deprecated_v3 = { 52284 attributes: { 52285 value: { 52286 type: 'string', 52287 source: 'html', 52288 selector: 'blockquote', 52289 multiline: 'p', 52290 default: '', 52291 role: 'content' 52292 }, 52293 citation: { 52294 type: 'string', 52295 source: 'html', 52296 selector: 'cite', 52297 default: '', 52298 role: 'content' 52299 }, 52300 align: { 52301 type: 'string' 52302 } 52303 }, 52304 supports: { 52305 anchor: true, 52306 __experimentalSlashInserter: true, 52307 typography: { 52308 fontSize: true, 52309 lineHeight: true, 52310 __experimentalFontStyle: true, 52311 __experimentalFontWeight: true, 52312 __experimentalLetterSpacing: true, 52313 __experimentalTextTransform: true, 52314 __experimentalDefaultControls: { 52315 fontSize: true, 52316 fontAppearance: true 52317 } 52318 } 52319 }, 52320 save({ 52321 attributes 52322 }) { 52323 const { 52324 align, 52325 value, 52326 citation 52327 } = attributes; 52328 const className = dist_clsx({ 52329 [`has-text-align-$align}`]: align 52330 }); 52331 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52332 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 52333 className 52334 }), 52335 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52336 multiline: true, 52337 value: value 52338 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52339 tagName: "cite", 52340 value: citation 52341 })] 52342 }); 52343 }, 52344 migrate(attributes) { 52345 return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); 52346 } 52347 }; 52348 const quote_deprecated_v2 = { 52349 attributes: { 52350 value: { 52351 type: 'string', 52352 source: 'html', 52353 selector: 'blockquote', 52354 multiline: 'p', 52355 default: '' 52356 }, 52357 citation: { 52358 type: 'string', 52359 source: 'html', 52360 selector: 'cite', 52361 default: '' 52362 }, 52363 align: { 52364 type: 'string' 52365 } 52366 }, 52367 migrate(attributes) { 52368 return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); 52369 }, 52370 save({ 52371 attributes 52372 }) { 52373 const { 52374 align, 52375 value, 52376 citation 52377 } = attributes; 52378 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52379 style: { 52380 textAlign: align ? align : null 52381 }, 52382 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52383 multiline: true, 52384 value: value 52385 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52386 tagName: "cite", 52387 value: citation 52388 })] 52389 }); 52390 } 52391 }; 52392 const quote_deprecated_v1 = { 52393 attributes: { 52394 value: { 52395 type: 'string', 52396 source: 'html', 52397 selector: 'blockquote', 52398 multiline: 'p', 52399 default: '' 52400 }, 52401 citation: { 52402 type: 'string', 52403 source: 'html', 52404 selector: 'cite', 52405 default: '' 52406 }, 52407 align: { 52408 type: 'string' 52409 }, 52410 style: { 52411 type: 'number', 52412 default: 1 52413 } 52414 }, 52415 migrate(attributes) { 52416 if (attributes.style === 2) { 52417 const { 52418 style, 52419 ...restAttributes 52420 } = attributes; 52421 return deprecated_migrateTextAlign(...migrateLargeStyle(...migrateToQuoteV2(restAttributes))); 52422 } 52423 return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); 52424 }, 52425 save({ 52426 attributes 52427 }) { 52428 const { 52429 align, 52430 value, 52431 citation, 52432 style 52433 } = attributes; 52434 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52435 className: style === 2 ? 'is-large' : '', 52436 style: { 52437 textAlign: align ? align : null 52438 }, 52439 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52440 multiline: true, 52441 value: value 52442 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52443 tagName: "cite", 52444 value: citation 52445 })] 52446 }); 52447 } 52448 }; 52449 const quote_deprecated_v0 = { 52450 attributes: { 52451 value: { 52452 type: 'string', 52453 source: 'html', 52454 selector: 'blockquote', 52455 multiline: 'p', 52456 default: '' 52457 }, 52458 citation: { 52459 type: 'string', 52460 source: 'html', 52461 selector: 'footer', 52462 default: '' 52463 }, 52464 align: { 52465 type: 'string' 52466 }, 52467 style: { 52468 type: 'number', 52469 default: 1 52470 } 52471 }, 52472 migrate(attributes) { 52473 if (!isNaN(parseInt(attributes.style))) { 52474 const { 52475 style, 52476 ...restAttributes 52477 } = attributes; 52478 return deprecated_migrateTextAlign(...migrateToQuoteV2(restAttributes)); 52479 } 52480 return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); 52481 }, 52482 save({ 52483 attributes 52484 }) { 52485 const { 52486 align, 52487 value, 52488 citation, 52489 style 52490 } = attributes; 52491 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52492 className: `blocks-quote-style-$style}`, 52493 style: { 52494 textAlign: align ? align : null 52495 }, 52496 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52497 multiline: true, 52498 value: value 52499 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52500 tagName: "footer", 52501 value: citation 52502 })] 52503 }); 52504 } 52505 }; 52506 52507 /** 52508 * New deprecations need to be placed first 52509 * for them to have higher priority. 52510 * 52511 * Old deprecations may need to be updated as well. 52512 * 52513 * See block-deprecation.md 52514 */ 52515 /* harmony default export */ const quote_deprecated = ([quote_deprecated_v4, quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]); 52516 52517 ;// ./node_modules/@wordpress/icons/build-module/library/verse.js 52518 /** 52519 * WordPress dependencies 52520 */ 52521 52522 52523 const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 52524 viewBox: "0 0 24 24", 52525 xmlns: "http://www.w3.org/2000/svg", 52526 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 52527 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" 52528 }) 52529 }); 52530 /* harmony default export */ const library_verse = (verse); 52531 52532 ;// ./node_modules/@wordpress/block-library/build-module/quote/edit.js 52533 /** 52534 * External dependencies 52535 */ 52536 52537 52538 /** 52539 * WordPress dependencies 52540 */ 52541 52542 52543 52544 52545 52546 52547 52548 52549 /** 52550 * Internal dependencies 52551 */ 52552 52553 52554 52555 const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; 52556 const quote_edit_TEMPLATE = [['core/paragraph', {}]]; 52557 52558 /** 52559 * At the moment, deprecations don't handle create blocks from attributes 52560 * (like when using CPT templates). For this reason, this hook is necessary 52561 * to avoid breaking templates using the old quote block format. 52562 * 52563 * @param {Object} attributes Block attributes. 52564 * @param {string} clientId Block client ID. 52565 */ 52566 const edit_useMigrateOnLoad = (attributes, clientId) => { 52567 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 52568 const { 52569 updateBlockAttributes, 52570 replaceInnerBlocks 52571 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 52572 (0,external_wp_element_namespaceObject.useEffect)(() => { 52573 // As soon as the block is loaded, migrate it to the new version. 52574 52575 if (!attributes.value) { 52576 // No need to migrate if it doesn't have the value attribute. 52577 return; 52578 } 52579 const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes); 52580 external_wp_deprecated_default()('Value attribute on the quote block', { 52581 since: '6.0', 52582 version: '6.5', 52583 alternative: 'inner blocks' 52584 }); 52585 registry.batch(() => { 52586 updateBlockAttributes(clientId, newAttributes); 52587 replaceInnerBlocks(clientId, newInnerBlocks); 52588 }); 52589 }, [attributes.value]); 52590 }; 52591 function QuoteEdit({ 52592 attributes, 52593 setAttributes, 52594 insertBlocksAfter, 52595 clientId, 52596 className, 52597 style, 52598 isSelected 52599 }) { 52600 const { 52601 textAlign 52602 } = attributes; 52603 edit_useMigrateOnLoad(attributes, clientId); 52604 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 52605 className: dist_clsx(className, { 52606 [`has-text-align-$textAlign}`]: textAlign 52607 }), 52608 ...(!edit_isWebPlatform && { 52609 style 52610 }) 52611 }); 52612 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 52613 template: quote_edit_TEMPLATE, 52614 templateInsertUpdatesSelection: true, 52615 __experimentalCaptureToolbars: true, 52616 renderAppender: false 52617 }); 52618 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 52619 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 52620 group: "block", 52621 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 52622 value: textAlign, 52623 onChange: nextAlign => { 52624 setAttributes({ 52625 textAlign: nextAlign 52626 }); 52627 } 52628 }) 52629 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BlockQuotation, { 52630 ...innerBlocksProps, 52631 children: [innerBlocksProps.children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 52632 attributeKey: "citation", 52633 tagName: edit_isWebPlatform ? 'cite' : 'p', 52634 style: edit_isWebPlatform && { 52635 display: 'block' 52636 }, 52637 isSelected: isSelected, 52638 attributes: attributes, 52639 setAttributes: setAttributes, 52640 __unstableMobileNoFocusOnMount: true, 52641 icon: library_verse, 52642 label: (0,external_wp_i18n_namespaceObject.__)('Quote citation'), 52643 placeholder: 52644 // translators: placeholder text used for the 52645 // citation 52646 (0,external_wp_i18n_namespaceObject.__)('Add citation'), 52647 addLabel: (0,external_wp_i18n_namespaceObject.__)('Add citation'), 52648 removeLabel: (0,external_wp_i18n_namespaceObject.__)('Remove citation'), 52649 excludeElementClassName: true, 52650 className: "wp-block-quote__citation", 52651 insertBlocksAfter: insertBlocksAfter, 52652 ...(!edit_isWebPlatform ? { 52653 textAlign 52654 } : {}) 52655 })] 52656 })] 52657 }); 52658 } 52659 52660 ;// ./node_modules/@wordpress/block-library/build-module/quote/save.js 52661 /** 52662 * External dependencies 52663 */ 52664 52665 52666 /** 52667 * WordPress dependencies 52668 */ 52669 52670 52671 function quote_save_save({ 52672 attributes 52673 }) { 52674 const { 52675 textAlign, 52676 citation 52677 } = attributes; 52678 const className = dist_clsx({ 52679 [`has-text-align-$textAlign}`]: textAlign 52680 }); 52681 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { 52682 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 52683 className 52684 }), 52685 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 52686 tagName: "cite", 52687 value: citation 52688 })] 52689 }); 52690 } 52691 52692 ;// ./node_modules/@wordpress/block-library/build-module/quote/transforms.js 52693 /* wp:polyfill */ 52694 /** 52695 * WordPress dependencies 52696 */ 52697 52698 52699 const quote_transforms_transforms = { 52700 from: [{ 52701 type: 'block', 52702 blocks: ['core/pullquote'], 52703 transform: ({ 52704 value, 52705 align, 52706 citation, 52707 anchor, 52708 fontSize, 52709 style 52710 }) => { 52711 return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { 52712 align, 52713 citation, 52714 anchor, 52715 fontSize, 52716 style 52717 }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52718 content: value 52719 })]); 52720 } 52721 }, { 52722 type: 'prefix', 52723 prefix: '>', 52724 transform: content => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52725 content 52726 })]) 52727 }, { 52728 type: 'raw', 52729 schema: () => ({ 52730 blockquote: { 52731 children: '*' 52732 } 52733 }), 52734 selector: 'blockquote', 52735 transform: (node, handler) => { 52736 return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', 52737 // Don't try to parse any `cite` out of this content. 52738 // * There may be more than one cite. 52739 // * There may be more attribution text than just the cite. 52740 // * If the cite is nested in the quoted text, it's wrong to 52741 // remove it. 52742 {}, handler({ 52743 HTML: node.innerHTML, 52744 mode: 'BLOCKS' 52745 })); 52746 } 52747 }, { 52748 type: 'block', 52749 isMultiBlock: true, 52750 blocks: ['*'], 52751 isMatch: ({}, blocks) => { 52752 // When a single block is selected make the transformation 52753 // available only to specific blocks that make sense. 52754 if (blocks.length === 1) { 52755 return ['core/paragraph', 'core/heading', 'core/list', 'core/pullquote'].includes(blocks[0].name); 52756 } 52757 return !blocks.some(({ 52758 name 52759 }) => name === 'core/quote'); 52760 }, 52761 __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))) 52762 }], 52763 to: [{ 52764 type: 'block', 52765 blocks: ['core/pullquote'], 52766 isMatch: ({}, block) => { 52767 return block.innerBlocks.every(({ 52768 name 52769 }) => name === 'core/paragraph'); 52770 }, 52771 transform: ({ 52772 align, 52773 citation, 52774 anchor, 52775 fontSize, 52776 style 52777 }, innerBlocks) => { 52778 const value = innerBlocks.map(({ 52779 attributes 52780 }) => `$attributes.content}`).join('<br>'); 52781 return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { 52782 value, 52783 align, 52784 citation, 52785 anchor, 52786 fontSize, 52787 style 52788 }); 52789 } 52790 }, { 52791 type: 'block', 52792 blocks: ['core/paragraph'], 52793 transform: ({ 52794 citation 52795 }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52796 content: citation 52797 })] 52798 }, { 52799 type: 'block', 52800 blocks: ['core/group'], 52801 transform: ({ 52802 citation, 52803 anchor 52804 }, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { 52805 anchor 52806 }, external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52807 content: citation 52808 })]) 52809 }], 52810 ungroup: ({ 52811 citation 52812 }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 52813 content: citation 52814 })] 52815 }; 52816 /* harmony default export */ const quote_transforms = (quote_transforms_transforms); 52817 52818 ;// ./node_modules/@wordpress/block-library/build-module/quote/index.js 52819 /** 52820 * WordPress dependencies 52821 */ 52822 52823 52824 52825 /** 52826 * Internal dependencies 52827 */ 52828 52829 52830 52831 const quote_metadata = { 52832 $schema: "https://schemas.wp.org/trunk/block.json", 52833 apiVersion: 3, 52834 name: "core/quote", 52835 title: "Quote", 52836 category: "text", 52837 description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar", 52838 keywords: ["blockquote", "cite"], 52839 textdomain: "default", 52840 attributes: { 52841 value: { 52842 type: "string", 52843 source: "html", 52844 selector: "blockquote", 52845 multiline: "p", 52846 "default": "", 52847 role: "content" 52848 }, 52849 citation: { 52850 type: "rich-text", 52851 source: "rich-text", 52852 selector: "cite", 52853 role: "content" 52854 }, 52855 textAlign: { 52856 type: "string" 52857 } 52858 }, 52859 supports: { 52860 anchor: true, 52861 align: ["left", "right", "wide", "full"], 52862 html: false, 52863 background: { 52864 backgroundImage: true, 52865 backgroundSize: true, 52866 __experimentalDefaultControls: { 52867 backgroundImage: true 52868 } 52869 }, 52870 __experimentalBorder: { 52871 color: true, 52872 radius: true, 52873 style: true, 52874 width: true, 52875 __experimentalDefaultControls: { 52876 color: true, 52877 radius: true, 52878 style: true, 52879 width: true 52880 } 52881 }, 52882 dimensions: { 52883 minHeight: true, 52884 __experimentalDefaultControls: { 52885 minHeight: false 52886 } 52887 }, 52888 __experimentalOnEnter: true, 52889 __experimentalOnMerge: true, 52890 typography: { 52891 fontSize: true, 52892 lineHeight: true, 52893 __experimentalFontFamily: true, 52894 __experimentalFontWeight: true, 52895 __experimentalFontStyle: true, 52896 __experimentalTextTransform: true, 52897 __experimentalTextDecoration: true, 52898 __experimentalLetterSpacing: true, 52899 __experimentalDefaultControls: { 52900 fontSize: true 52901 } 52902 }, 52903 color: { 52904 gradients: true, 52905 heading: true, 52906 link: true, 52907 __experimentalDefaultControls: { 52908 background: true, 52909 text: true 52910 } 52911 }, 52912 layout: { 52913 allowEditing: false 52914 }, 52915 spacing: { 52916 blockGap: true, 52917 padding: true, 52918 margin: true 52919 }, 52920 interactivity: { 52921 clientNavigation: true 52922 } 52923 }, 52924 styles: [{ 52925 name: "default", 52926 label: "Default", 52927 isDefault: true 52928 }, { 52929 name: "plain", 52930 label: "Plain" 52931 }], 52932 editorStyle: "wp-block-quote-editor", 52933 style: "wp-block-quote" 52934 }; 52935 52936 52937 const { 52938 name: quote_name 52939 } = quote_metadata; 52940 52941 const quote_settings = { 52942 icon: library_quote, 52943 example: { 52944 attributes: { 52945 citation: 'Julio Cortázar' 52946 }, 52947 innerBlocks: [{ 52948 name: 'core/paragraph', 52949 attributes: { 52950 content: (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') 52951 } 52952 }] 52953 }, 52954 transforms: quote_transforms, 52955 edit: QuoteEdit, 52956 save: quote_save_save, 52957 deprecated: quote_deprecated 52958 }; 52959 const quote_init = () => initBlock({ 52960 name: quote_name, 52961 metadata: quote_metadata, 52962 settings: quote_settings 52963 }); 52964 52965 ;// ./node_modules/@wordpress/icons/build-module/library/symbol.js 52966 /** 52967 * WordPress dependencies 52968 */ 52969 52970 52971 const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 52972 xmlns: "http://www.w3.org/2000/svg", 52973 viewBox: "0 0 24 24", 52974 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 52975 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" 52976 }) 52977 }); 52978 /* harmony default export */ const library_symbol = (symbol); 52979 52980 ;// external ["wp","patterns"] 52981 const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; 52982 ;// ./node_modules/@wordpress/block-library/build-module/block/edit.js 52983 /* wp:polyfill */ 52984 /** 52985 * External dependencies 52986 */ 52987 52988 52989 /** 52990 * WordPress dependencies 52991 */ 52992 52993 52994 52995 52996 52997 52998 52999 53000 53001 /** 53002 * Internal dependencies 53003 */ 53004 53005 53006 const { 53007 useLayoutClasses 53008 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 53009 const { 53010 hasOverridableBlocks 53011 } = unlock(external_wp_patterns_namespaceObject.privateApis); 53012 const fullAlignments = ['full', 'wide', 'left', 'right']; 53013 const useInferredLayout = (blocks, parentLayout) => { 53014 const initialInferredAlignmentRef = (0,external_wp_element_namespaceObject.useRef)(); 53015 return (0,external_wp_element_namespaceObject.useMemo)(() => { 53016 // Exit early if the pattern's blocks haven't loaded yet. 53017 if (!blocks?.length) { 53018 return {}; 53019 } 53020 let alignment = initialInferredAlignmentRef.current; 53021 53022 // Only track the initial alignment so that temporarily removed 53023 // alignments can be reapplied. 53024 if (alignment === undefined) { 53025 const isConstrained = parentLayout?.type === 'constrained'; 53026 const hasFullAlignment = blocks.some(block => fullAlignments.includes(block.attributes.align)); 53027 alignment = isConstrained && hasFullAlignment ? 'full' : null; 53028 initialInferredAlignmentRef.current = alignment; 53029 } 53030 const layout = alignment ? parentLayout : undefined; 53031 return { 53032 alignment, 53033 layout 53034 }; 53035 }, [blocks, parentLayout]); 53036 }; 53037 function RecursionWarning() { 53038 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 53039 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 53040 ...blockProps, 53041 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 53042 children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') 53043 }) 53044 }); 53045 } 53046 const edit_NOOP = () => {}; 53047 53048 // Wrap the main Edit function for the pattern block with a recursion wrapper 53049 // that allows short-circuiting rendering as early as possible, before any 53050 // of the other effects in the block edit have run. 53051 function ReusableBlockEditRecursionWrapper(props) { 53052 const { 53053 ref 53054 } = props.attributes; 53055 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref); 53056 if (hasAlreadyRendered) { 53057 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionWarning, {}); 53058 } 53059 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 53060 uniqueId: ref, 53061 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockEdit, { 53062 ...props 53063 }) 53064 }); 53065 } 53066 function ReusableBlockControl({ 53067 recordId, 53068 canOverrideBlocks, 53069 hasContent, 53070 handleEditOriginal, 53071 resetContent 53072 }) { 53073 const canUserEdit = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).canUser('update', { 53074 kind: 'postType', 53075 name: 'wp_block', 53076 id: recordId 53077 }), [recordId]); 53078 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 53079 children: [canUserEdit && !!handleEditOriginal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 53080 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 53081 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 53082 onClick: handleEditOriginal, 53083 children: (0,external_wp_i18n_namespaceObject.__)('Edit original') 53084 }) 53085 }) 53086 }), canOverrideBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 53087 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 53088 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 53089 onClick: resetContent, 53090 disabled: !hasContent, 53091 children: (0,external_wp_i18n_namespaceObject.__)('Reset') 53092 }) 53093 }) 53094 })] 53095 }); 53096 } 53097 function ReusableBlockEdit({ 53098 name, 53099 attributes: { 53100 ref, 53101 content 53102 }, 53103 __unstableParentLayout: parentLayout, 53104 setAttributes 53105 }) { 53106 const { 53107 record, 53108 hasResolved 53109 } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_block', ref); 53110 const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', { 53111 id: ref 53112 }); 53113 const isMissing = hasResolved && !record; 53114 const { 53115 __unstableMarkLastChangeAsPersistent 53116 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 53117 const { 53118 onNavigateToEntityRecord, 53119 hasPatternOverridesSource 53120 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 53121 const { 53122 getSettings 53123 } = select(external_wp_blockEditor_namespaceObject.store); 53124 // For editing link to the site editor if the theme and user permissions support it. 53125 return { 53126 onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, 53127 hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides') 53128 }; 53129 }, []); 53130 const canOverrideBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => hasPatternOverridesSource && hasOverridableBlocks(blocks), [hasPatternOverridesSource, blocks]); 53131 const { 53132 alignment, 53133 layout 53134 } = useInferredLayout(blocks, parentLayout); 53135 const layoutClasses = useLayoutClasses({ 53136 layout 53137 }, name); 53138 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 53139 className: dist_clsx('block-library-block__reusable-block-container', layout && layoutClasses, { 53140 [`align$alignment}`]: alignment 53141 }) 53142 }); 53143 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 53144 layout, 53145 value: blocks, 53146 onInput: edit_NOOP, 53147 onChange: edit_NOOP, 53148 renderAppender: blocks?.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 53149 }); 53150 const handleEditOriginal = () => { 53151 onNavigateToEntityRecord({ 53152 postId: ref, 53153 postType: 'wp_block' 53154 }); 53155 }; 53156 const resetContent = () => { 53157 if (content) { 53158 // Make sure any previous changes are persisted before resetting. 53159 __unstableMarkLastChangeAsPersistent(); 53160 setAttributes({ 53161 content: undefined 53162 }); 53163 } 53164 }; 53165 let children = null; 53166 if (isMissing) { 53167 children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 53168 children: (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.') 53169 }); 53170 } 53171 if (!hasResolved) { 53172 children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 53173 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 53174 }); 53175 } 53176 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 53177 children: [hasResolved && !isMissing && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockControl, { 53178 recordId: ref, 53179 canOverrideBlocks: canOverrideBlocks, 53180 hasContent: !!content, 53181 handleEditOriginal: onNavigateToEntityRecord ? handleEditOriginal : undefined, 53182 resetContent: resetContent 53183 }), children === null ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 53184 ...innerBlocksProps 53185 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 53186 ...blockProps, 53187 children: children 53188 })] 53189 }); 53190 } 53191 53192 ;// ./node_modules/@wordpress/block-library/build-module/block/deprecated.js 53193 /* wp:polyfill */ 53194 const isObject = obj => typeof obj === 'object' && !Array.isArray(obj) && obj !== null; 53195 53196 // v2: Migrate to a more condensed version of the 'content' attribute attribute. 53197 const block_deprecated_v2 = { 53198 attributes: { 53199 ref: { 53200 type: 'number' 53201 }, 53202 content: { 53203 type: 'object' 53204 } 53205 }, 53206 supports: { 53207 customClassName: false, 53208 html: false, 53209 inserter: false, 53210 renaming: false 53211 }, 53212 // Force this deprecation to run whenever there's a values sub-property that's an object. 53213 // 53214 // This could fail in the future if a block ever has binding to a `values` attribute. 53215 // Some extra protection is added to ensure `values` is an object, but this only reduces 53216 // the likelihood, it doesn't solve it completely. 53217 isEligible({ 53218 content 53219 }) { 53220 return !!content && Object.keys(content).every(contentKey => content[contentKey].values && isObject(content[contentKey].values)); 53221 }, 53222 /* 53223 * Old attribute format: 53224 * content: { 53225 * "V98q_x": { 53226 * // The attribute values are now stored as a 'values' sub-property. 53227 * values: { content: 'My content value' }, 53228 * // ... additional metadata, like the block name can be stored here. 53229 * } 53230 * } 53231 * 53232 * New attribute format: 53233 * content: { 53234 * "V98q_x": { 53235 * content: 'My content value', 53236 * } 53237 * } 53238 */ 53239 migrate(attributes) { 53240 const { 53241 content, 53242 ...retainedAttributes 53243 } = attributes; 53244 if (content && Object.keys(content).length) { 53245 const updatedContent = { 53246 ...content 53247 }; 53248 for (const contentKey in content) { 53249 updatedContent[contentKey] = content[contentKey].values; 53250 } 53251 return { 53252 ...retainedAttributes, 53253 content: updatedContent 53254 }; 53255 } 53256 return attributes; 53257 } 53258 }; 53259 53260 // v1: Rename the `overrides` attribute to the `content` attribute. 53261 const block_deprecated_v1 = { 53262 attributes: { 53263 ref: { 53264 type: 'number' 53265 }, 53266 overrides: { 53267 type: 'object' 53268 } 53269 }, 53270 supports: { 53271 customClassName: false, 53272 html: false, 53273 inserter: false, 53274 renaming: false 53275 }, 53276 // Force this deprecation to run whenever there's an `overrides` object. 53277 isEligible({ 53278 overrides 53279 }) { 53280 return !!overrides; 53281 }, 53282 /* 53283 * Old attribute format: 53284 * overrides: { 53285 * // An key is an id that represents a block. 53286 * // The values are the attribute values of the block. 53287 * "V98q_x": { content: 'My content value' } 53288 * } 53289 * 53290 * New attribute format: 53291 * content: { 53292 * "V98q_x": { content: 'My content value' } 53293 * } 53294 * 53295 */ 53296 migrate(attributes) { 53297 const { 53298 overrides, 53299 ...retainedAttributes 53300 } = attributes; 53301 const content = {}; 53302 Object.keys(overrides).forEach(id => { 53303 content[id] = overrides[id]; 53304 }); 53305 return { 53306 ...retainedAttributes, 53307 content 53308 }; 53309 } 53310 }; 53311 /* harmony default export */ const block_deprecated = ([block_deprecated_v2, block_deprecated_v1]); 53312 53313 ;// ./node_modules/@wordpress/block-library/build-module/block/index.js 53314 /** 53315 * WordPress dependencies 53316 */ 53317 53318 53319 53320 53321 53322 /** 53323 * Internal dependencies 53324 */ 53325 53326 const block_metadata = { 53327 $schema: "https://schemas.wp.org/trunk/block.json", 53328 apiVersion: 3, 53329 name: "core/block", 53330 title: "Pattern", 53331 category: "reusable", 53332 description: "Reuse this design across your site.", 53333 keywords: ["reusable"], 53334 textdomain: "default", 53335 attributes: { 53336 ref: { 53337 type: "number" 53338 }, 53339 content: { 53340 type: "object", 53341 "default": {} 53342 } 53343 }, 53344 providesContext: { 53345 "pattern/overrides": "content" 53346 }, 53347 supports: { 53348 customClassName: false, 53349 html: false, 53350 inserter: false, 53351 renaming: false, 53352 interactivity: { 53353 clientNavigation: true 53354 } 53355 } 53356 }; 53357 53358 53359 const { 53360 name: block_name 53361 } = block_metadata; 53362 53363 const block_settings = { 53364 deprecated: block_deprecated, 53365 edit: ReusableBlockEditRecursionWrapper, 53366 icon: library_symbol, 53367 __experimentalLabel: ({ 53368 ref 53369 }) => { 53370 if (!ref) { 53371 return; 53372 } 53373 const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_block', ref); 53374 if (!entity?.title) { 53375 return; 53376 } 53377 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title); 53378 } 53379 }; 53380 const block_init = () => initBlock({ 53381 name: block_name, 53382 metadata: block_metadata, 53383 settings: block_settings 53384 }); 53385 53386 ;// ./node_modules/@wordpress/block-library/build-module/read-more/edit.js 53387 /** 53388 * WordPress dependencies 53389 */ 53390 53391 53392 53393 53394 53395 /** 53396 * Internal dependencies 53397 */ 53398 53399 53400 function ReadMore({ 53401 attributes: { 53402 content, 53403 linkTarget 53404 }, 53405 setAttributes, 53406 insertBlocksAfter 53407 }) { 53408 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 53409 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 53410 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 53411 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 53412 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 53413 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 53414 resetAll: () => setAttributes({ 53415 linkTarget: '_self' 53416 }), 53417 dropdownMenuProps: dropdownMenuProps, 53418 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 53419 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 53420 isShownByDefault: true, 53421 hasValue: () => linkTarget !== '_self', 53422 onDeselect: () => setAttributes({ 53423 linkTarget: '_self' 53424 }), 53425 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 53426 __nextHasNoMarginBottom: true, 53427 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 53428 onChange: value => setAttributes({ 53429 linkTarget: value ? '_blank' : '_self' 53430 }), 53431 checked: linkTarget === '_blank' 53432 }) 53433 }) 53434 }) 53435 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 53436 identifier: "content", 53437 tagName: "a", 53438 "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), 53439 placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'), 53440 value: content, 53441 onChange: newValue => setAttributes({ 53442 content: newValue 53443 }), 53444 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 53445 withoutInteractiveFormatting: true, 53446 ...blockProps 53447 })] 53448 }); 53449 } 53450 53451 ;// ./node_modules/@wordpress/block-library/build-module/read-more/index.js 53452 /** 53453 * WordPress dependencies 53454 */ 53455 53456 53457 53458 /** 53459 * Internal dependencies 53460 */ 53461 53462 const read_more_metadata = { 53463 $schema: "https://schemas.wp.org/trunk/block.json", 53464 apiVersion: 3, 53465 name: "core/read-more", 53466 title: "Read More", 53467 category: "theme", 53468 description: "Displays the link of a post, page, or any other content-type.", 53469 textdomain: "default", 53470 attributes: { 53471 content: { 53472 type: "string" 53473 }, 53474 linkTarget: { 53475 type: "string", 53476 "default": "_self" 53477 } 53478 }, 53479 usesContext: ["postId"], 53480 supports: { 53481 html: false, 53482 color: { 53483 gradients: true, 53484 text: true 53485 }, 53486 typography: { 53487 fontSize: true, 53488 lineHeight: true, 53489 __experimentalFontFamily: true, 53490 __experimentalFontWeight: true, 53491 __experimentalFontStyle: true, 53492 __experimentalTextTransform: true, 53493 __experimentalLetterSpacing: true, 53494 __experimentalTextDecoration: true, 53495 __experimentalDefaultControls: { 53496 fontSize: true, 53497 textDecoration: true 53498 } 53499 }, 53500 spacing: { 53501 margin: ["top", "bottom"], 53502 padding: true, 53503 __experimentalDefaultControls: { 53504 padding: true 53505 } 53506 }, 53507 __experimentalBorder: { 53508 color: true, 53509 radius: true, 53510 width: true, 53511 __experimentalDefaultControls: { 53512 width: true 53513 } 53514 }, 53515 interactivity: { 53516 clientNavigation: true 53517 } 53518 }, 53519 style: "wp-block-read-more" 53520 }; 53521 53522 const { 53523 name: read_more_name 53524 } = read_more_metadata; 53525 53526 const read_more_settings = { 53527 icon: library_link, 53528 edit: ReadMore, 53529 example: { 53530 attributes: { 53531 content: (0,external_wp_i18n_namespaceObject.__)('Read more') 53532 } 53533 } 53534 }; 53535 const read_more_init = () => initBlock({ 53536 name: read_more_name, 53537 metadata: read_more_metadata, 53538 settings: read_more_settings 53539 }); 53540 53541 ;// ./node_modules/@wordpress/icons/build-module/library/rss.js 53542 /** 53543 * WordPress dependencies 53544 */ 53545 53546 53547 const rss = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 53548 xmlns: "http://www.w3.org/2000/svg", 53549 viewBox: "0 0 24 24", 53550 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 53551 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" 53552 }) 53553 }); 53554 /* harmony default export */ const library_rss = (rss); 53555 53556 ;// ./node_modules/@wordpress/block-library/build-module/rss/edit.js 53557 /** 53558 * WordPress dependencies 53559 */ 53560 53561 53562 53563 53564 53565 53566 53567 53568 const DEFAULT_MIN_ITEMS = 1; 53569 const DEFAULT_MAX_ITEMS = 20; 53570 function RSSEdit({ 53571 attributes, 53572 setAttributes 53573 }) { 53574 const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL); 53575 const { 53576 blockLayout, 53577 columns, 53578 displayAuthor, 53579 displayDate, 53580 displayExcerpt, 53581 excerptLength, 53582 feedURL, 53583 itemsToShow 53584 } = attributes; 53585 function toggleAttribute(propName) { 53586 return () => { 53587 const value = attributes[propName]; 53588 setAttributes({ 53589 [propName]: !value 53590 }); 53591 }; 53592 } 53593 function onSubmitURL(event) { 53594 event.preventDefault(); 53595 if (feedURL) { 53596 setAttributes({ 53597 feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL) 53598 }); 53599 setIsEditing(false); 53600 } 53601 } 53602 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 53603 const label = (0,external_wp_i18n_namespaceObject.__)('RSS URL'); 53604 if (isEditing) { 53605 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 53606 ...blockProps, 53607 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 53608 icon: library_rss, 53609 label: label, 53610 instructions: (0,external_wp_i18n_namespaceObject.__)('Display entries from any RSS or Atom feed.'), 53611 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { 53612 onSubmit: onSubmitURL, 53613 className: "wp-block-rss__placeholder-form", 53614 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { 53615 __next40pxDefaultSize: true, 53616 label: label, 53617 type: "url", 53618 hideLabelFromVision: true, 53619 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'), 53620 value: feedURL, 53621 onChange: value => setAttributes({ 53622 feedURL: value 53623 }), 53624 className: "wp-block-rss__placeholder-input" 53625 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 53626 __next40pxDefaultSize: true, 53627 variant: "primary", 53628 type: "submit", 53629 children: (0,external_wp_i18n_namespaceObject.__)('Apply') 53630 })] 53631 }) 53632 }) 53633 }); 53634 } 53635 const toolbarControls = [{ 53636 icon: library_edit, 53637 title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'), 53638 onClick: () => setIsEditing(true) 53639 }, { 53640 icon: library_list, 53641 title: (0,external_wp_i18n_namespaceObject._x)('List view', 'RSS block display setting'), 53642 onClick: () => setAttributes({ 53643 blockLayout: 'list' 53644 }), 53645 isActive: blockLayout === 'list' 53646 }, { 53647 icon: library_grid, 53648 title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'RSS block display setting'), 53649 onClick: () => setAttributes({ 53650 blockLayout: 'grid' 53651 }), 53652 isActive: blockLayout === 'grid' 53653 }]; 53654 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 53655 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 53656 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 53657 controls: toolbarControls 53658 }) 53659 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 53660 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 53661 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 53662 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 53663 __nextHasNoMarginBottom: true, 53664 __next40pxDefaultSize: true, 53665 label: (0,external_wp_i18n_namespaceObject.__)('Number of items'), 53666 value: itemsToShow, 53667 onChange: value => setAttributes({ 53668 itemsToShow: value 53669 }), 53670 min: DEFAULT_MIN_ITEMS, 53671 max: DEFAULT_MAX_ITEMS, 53672 required: true 53673 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 53674 __nextHasNoMarginBottom: true, 53675 label: (0,external_wp_i18n_namespaceObject.__)('Display author'), 53676 checked: displayAuthor, 53677 onChange: toggleAttribute('displayAuthor') 53678 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 53679 __nextHasNoMarginBottom: true, 53680 label: (0,external_wp_i18n_namespaceObject.__)('Display date'), 53681 checked: displayDate, 53682 onChange: toggleAttribute('displayDate') 53683 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 53684 __nextHasNoMarginBottom: true, 53685 label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), 53686 checked: displayExcerpt, 53687 onChange: toggleAttribute('displayExcerpt') 53688 }), displayExcerpt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 53689 __nextHasNoMarginBottom: true, 53690 __next40pxDefaultSize: true, 53691 label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'), 53692 value: excerptLength, 53693 onChange: value => setAttributes({ 53694 excerptLength: value 53695 }), 53696 min: 10, 53697 max: 100, 53698 required: true 53699 }), blockLayout === 'grid' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 53700 __nextHasNoMarginBottom: true, 53701 __next40pxDefaultSize: true, 53702 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 53703 value: columns, 53704 onChange: value => setAttributes({ 53705 columns: value 53706 }), 53707 min: 2, 53708 max: 6, 53709 required: true 53710 })] 53711 }) 53712 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 53713 ...blockProps, 53714 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 53715 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { 53716 block: "core/rss", 53717 attributes: attributes 53718 }) 53719 }) 53720 })] 53721 }); 53722 } 53723 53724 ;// ./node_modules/@wordpress/block-library/build-module/rss/index.js 53725 /** 53726 * WordPress dependencies 53727 */ 53728 53729 53730 /** 53731 * Internal dependencies 53732 */ 53733 53734 const rss_metadata = { 53735 $schema: "https://schemas.wp.org/trunk/block.json", 53736 apiVersion: 3, 53737 name: "core/rss", 53738 title: "RSS", 53739 category: "widgets", 53740 description: "Display entries from any RSS or Atom feed.", 53741 keywords: ["atom", "feed"], 53742 textdomain: "default", 53743 attributes: { 53744 columns: { 53745 type: "number", 53746 "default": 2 53747 }, 53748 blockLayout: { 53749 type: "string", 53750 "default": "list" 53751 }, 53752 feedURL: { 53753 type: "string", 53754 "default": "" 53755 }, 53756 itemsToShow: { 53757 type: "number", 53758 "default": 5 53759 }, 53760 displayExcerpt: { 53761 type: "boolean", 53762 "default": false 53763 }, 53764 displayAuthor: { 53765 type: "boolean", 53766 "default": false 53767 }, 53768 displayDate: { 53769 type: "boolean", 53770 "default": false 53771 }, 53772 excerptLength: { 53773 type: "number", 53774 "default": 55 53775 } 53776 }, 53777 supports: { 53778 align: true, 53779 html: false, 53780 interactivity: { 53781 clientNavigation: true 53782 }, 53783 color: { 53784 background: true, 53785 text: true, 53786 gradients: true, 53787 link: true 53788 } 53789 }, 53790 editorStyle: "wp-block-rss-editor", 53791 style: "wp-block-rss" 53792 }; 53793 53794 const { 53795 name: rss_name 53796 } = rss_metadata; 53797 53798 const rss_settings = { 53799 icon: library_rss, 53800 example: { 53801 attributes: { 53802 feedURL: 'https://wordpress.org' 53803 } 53804 }, 53805 edit: RSSEdit 53806 }; 53807 const rss_init = () => initBlock({ 53808 name: rss_name, 53809 metadata: rss_metadata, 53810 settings: rss_settings 53811 }); 53812 53813 ;// ./node_modules/@wordpress/icons/build-module/library/search.js 53814 /** 53815 * WordPress dependencies 53816 */ 53817 53818 53819 const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 53820 xmlns: "http://www.w3.org/2000/svg", 53821 viewBox: "0 0 24 24", 53822 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 53823 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" 53824 }) 53825 }); 53826 /* harmony default export */ const library_search = (search); 53827 53828 ;// ./node_modules/@wordpress/block-library/build-module/search/icons.js 53829 /** 53830 * WordPress dependencies 53831 */ 53832 53833 53834 const buttonOnly = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 53835 xmlns: "http://www.w3.org/2000/svg", 53836 viewBox: "0 0 24 24", 53837 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53838 x: "7", 53839 y: "10", 53840 width: "10", 53841 height: "4", 53842 rx: "1", 53843 fill: "currentColor" 53844 }) 53845 }); 53846 const buttonOutside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 53847 xmlns: "http://www.w3.org/2000/svg", 53848 viewBox: "0 0 24 24", 53849 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53850 x: "4.75", 53851 y: "15.25", 53852 width: "6.5", 53853 height: "9.5", 53854 transform: "rotate(-90 4.75 15.25)", 53855 stroke: "currentColor", 53856 strokeWidth: "1.5", 53857 fill: "none" 53858 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53859 x: "16", 53860 y: "10", 53861 width: "4", 53862 height: "4", 53863 rx: "1", 53864 fill: "currentColor" 53865 })] 53866 }); 53867 const buttonInside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 53868 xmlns: "http://www.w3.org/2000/svg", 53869 viewBox: "0 0 24 24", 53870 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53871 x: "4.75", 53872 y: "15.25", 53873 width: "6.5", 53874 height: "14.5", 53875 transform: "rotate(-90 4.75 15.25)", 53876 stroke: "currentColor", 53877 strokeWidth: "1.5", 53878 fill: "none" 53879 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53880 x: "14", 53881 y: "10", 53882 width: "4", 53883 height: "4", 53884 rx: "1", 53885 fill: "currentColor" 53886 })] 53887 }); 53888 const noButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 53889 xmlns: "http://www.w3.org/2000/svg", 53890 viewBox: "0 0 24 24", 53891 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53892 x: "4.75", 53893 y: "15.25", 53894 width: "6.5", 53895 height: "14.5", 53896 transform: "rotate(-90 4.75 15.25)", 53897 stroke: "currentColor", 53898 fill: "none", 53899 strokeWidth: "1.5" 53900 }) 53901 }); 53902 const buttonWithIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 53903 xmlns: "http://www.w3.org/2000/svg", 53904 viewBox: "0 0 24 24", 53905 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53906 x: "4.75", 53907 y: "7.75", 53908 width: "14.5", 53909 height: "8.5", 53910 rx: "1.25", 53911 stroke: "currentColor", 53912 fill: "none", 53913 strokeWidth: "1.5" 53914 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53915 x: "8", 53916 y: "11", 53917 width: "8", 53918 height: "2", 53919 fill: "currentColor" 53920 })] 53921 }); 53922 const toggleLabel = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { 53923 xmlns: "http://www.w3.org/2000/svg", 53924 viewBox: "0 0 24 24", 53925 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53926 x: "4.75", 53927 y: "17.25", 53928 width: "5.5", 53929 height: "14.5", 53930 transform: "rotate(-90 4.75 17.25)", 53931 stroke: "currentColor", 53932 fill: "none", 53933 strokeWidth: "1.5" 53934 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { 53935 x: "4", 53936 y: "7", 53937 width: "10", 53938 height: "2", 53939 fill: "currentColor" 53940 })] 53941 }); 53942 53943 ;// ./node_modules/@wordpress/block-library/build-module/search/utils.js 53944 /** 53945 * Constants 53946 */ 53947 const PC_WIDTH_DEFAULT = 50; 53948 const PX_WIDTH_DEFAULT = 350; 53949 const MIN_WIDTH = 220; 53950 53951 /** 53952 * Returns a boolean whether passed unit is percentage 53953 * 53954 * @param {string} unit Block width unit. 53955 * 53956 * @return {boolean} Whether unit is '%'. 53957 */ 53958 function utils_isPercentageUnit(unit) { 53959 return unit === '%'; 53960 } 53961 53962 ;// ./node_modules/@wordpress/block-library/build-module/search/edit.js 53963 /** 53964 * External dependencies 53965 */ 53966 53967 53968 /** 53969 * WordPress dependencies 53970 */ 53971 53972 53973 53974 53975 53976 53977 53978 53979 53980 /** 53981 * Internal dependencies 53982 */ 53983 53984 53985 53986 53987 // Used to calculate border radius adjustment to avoid "fat" corners when 53988 // button is placed inside wrapper. 53989 53990 const DEFAULT_INNER_PADDING = '4px'; 53991 const PERCENTAGE_WIDTHS = [25, 50, 75, 100]; 53992 function SearchEdit({ 53993 className, 53994 attributes, 53995 setAttributes, 53996 toggleSelection, 53997 isSelected, 53998 clientId 53999 }) { 54000 const { 54001 label, 54002 showLabel, 54003 placeholder, 54004 width, 54005 widthUnit, 54006 align, 54007 buttonText, 54008 buttonPosition, 54009 buttonUseIcon, 54010 isSearchFieldHidden, 54011 style 54012 } = attributes; 54013 const wasJustInsertedIntoNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => { 54014 const { 54015 getBlockParentsByBlockName, 54016 wasBlockJustInserted 54017 } = select(external_wp_blockEditor_namespaceObject.store); 54018 return !!getBlockParentsByBlockName(clientId, 'core/navigation')?.length && wasBlockJustInserted(clientId); 54019 }, [clientId]); 54020 const { 54021 __unstableMarkNextChangeAsNotPersistent 54022 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 54023 (0,external_wp_element_namespaceObject.useEffect)(() => { 54024 if (wasJustInsertedIntoNavigationBlock) { 54025 // This side-effect should not create an undo level. 54026 __unstableMarkNextChangeAsNotPersistent(); 54027 setAttributes({ 54028 showLabel: false, 54029 buttonUseIcon: true, 54030 buttonPosition: 'button-inside' 54031 }); 54032 } 54033 }, [__unstableMarkNextChangeAsNotPersistent, wasJustInsertedIntoNavigationBlock, setAttributes]); 54034 const borderRadius = style?.border?.radius; 54035 let borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 54036 54037 // Check for old deprecated numerical border radius. Done as a separate 54038 // check so that a borderRadius style won't overwrite the longhand 54039 // per-corner styles. 54040 if (typeof borderRadius === 'number') { 54041 borderProps = { 54042 ...borderProps, 54043 style: { 54044 ...borderProps.style, 54045 borderRadius: `$borderRadius}px` 54046 } 54047 }; 54048 } 54049 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 54050 const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); 54051 const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { 54052 typography: { 54053 fluid: fluidTypographySettings 54054 }, 54055 layout: { 54056 wideSize: layout?.wideSize 54057 } 54058 }); 54059 const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); 54060 const unitControlInputId = `wp-block-search__width-$unitControlInstanceId}`; 54061 const isButtonPositionInside = 'button-inside' === buttonPosition; 54062 const isButtonPositionOutside = 'button-outside' === buttonPosition; 54063 const hasNoButton = 'no-button' === buttonPosition; 54064 const hasOnlyButton = 'button-only' === buttonPosition; 54065 const searchFieldRef = (0,external_wp_element_namespaceObject.useRef)(); 54066 const buttonRef = (0,external_wp_element_namespaceObject.useRef)(); 54067 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 54068 availableUnits: ['%', 'px'], 54069 defaultValues: { 54070 '%': PC_WIDTH_DEFAULT, 54071 px: PX_WIDTH_DEFAULT 54072 } 54073 }); 54074 (0,external_wp_element_namespaceObject.useEffect)(() => { 54075 if (hasOnlyButton && !isSelected) { 54076 setAttributes({ 54077 isSearchFieldHidden: true 54078 }); 54079 } 54080 }, [hasOnlyButton, isSelected, setAttributes]); 54081 54082 // Show the search field when width changes. 54083 (0,external_wp_element_namespaceObject.useEffect)(() => { 54084 if (!hasOnlyButton || !isSelected) { 54085 return; 54086 } 54087 setAttributes({ 54088 isSearchFieldHidden: false 54089 }); 54090 }, [hasOnlyButton, isSelected, setAttributes, width]); 54091 const getBlockClassNames = () => { 54092 return dist_clsx(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); 54093 }; 54094 const buttonPositionControls = [{ 54095 role: 'menuitemradio', 54096 title: (0,external_wp_i18n_namespaceObject.__)('Button outside'), 54097 isActive: buttonPosition === 'button-outside', 54098 icon: buttonOutside, 54099 onClick: () => { 54100 setAttributes({ 54101 buttonPosition: 'button-outside', 54102 isSearchFieldHidden: false 54103 }); 54104 } 54105 }, { 54106 role: 'menuitemradio', 54107 title: (0,external_wp_i18n_namespaceObject.__)('Button inside'), 54108 isActive: buttonPosition === 'button-inside', 54109 icon: buttonInside, 54110 onClick: () => { 54111 setAttributes({ 54112 buttonPosition: 'button-inside', 54113 isSearchFieldHidden: false 54114 }); 54115 } 54116 }, { 54117 role: 'menuitemradio', 54118 title: (0,external_wp_i18n_namespaceObject.__)('No button'), 54119 isActive: buttonPosition === 'no-button', 54120 icon: noButton, 54121 onClick: () => { 54122 setAttributes({ 54123 buttonPosition: 'no-button', 54124 isSearchFieldHidden: false 54125 }); 54126 } 54127 }, { 54128 role: 'menuitemradio', 54129 title: (0,external_wp_i18n_namespaceObject.__)('Button only'), 54130 isActive: buttonPosition === 'button-only', 54131 icon: buttonOnly, 54132 onClick: () => { 54133 setAttributes({ 54134 buttonPosition: 'button-only', 54135 isSearchFieldHidden: true 54136 }); 54137 } 54138 }]; 54139 const getButtonPositionIcon = () => { 54140 switch (buttonPosition) { 54141 case 'button-inside': 54142 return buttonInside; 54143 case 'button-outside': 54144 return buttonOutside; 54145 case 'no-button': 54146 return noButton; 54147 case 'button-only': 54148 return buttonOnly; 54149 } 54150 }; 54151 const getResizableSides = () => { 54152 if (hasOnlyButton) { 54153 return {}; 54154 } 54155 return { 54156 right: align !== 'right', 54157 left: align === 'right' 54158 }; 54159 }; 54160 const renderTextField = () => { 54161 // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control. 54162 const textFieldClasses = dist_clsx('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className); 54163 const textFieldStyles = { 54164 ...(isButtonPositionInside ? { 54165 borderRadius 54166 } : borderProps.style), 54167 ...typographyProps.style, 54168 textDecoration: undefined 54169 }; 54170 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { 54171 type: "search", 54172 className: textFieldClasses, 54173 style: textFieldStyles, 54174 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') 54175 // We hide the placeholder field's placeholder when there is a value. This 54176 // stops screen readers from reading the placeholder field's placeholder 54177 // which is confusing. 54178 , 54179 placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), 54180 value: placeholder, 54181 onChange: event => setAttributes({ 54182 placeholder: event.target.value 54183 }), 54184 ref: searchFieldRef 54185 }); 54186 }; 54187 const renderButton = () => { 54188 // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button. 54189 const buttonClasses = dist_clsx('wp-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); 54190 const buttonStyles = { 54191 ...colorProps.style, 54192 ...typographyProps.style, 54193 ...(isButtonPositionInside ? { 54194 borderRadius 54195 } : borderProps.style) 54196 }; 54197 const handleButtonClick = () => { 54198 if (hasOnlyButton) { 54199 setAttributes({ 54200 isSearchFieldHidden: !isSearchFieldHidden 54201 }); 54202 } 54203 }; 54204 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 54205 children: [buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { 54206 type: "button", 54207 className: buttonClasses, 54208 style: buttonStyles, 54209 "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search'), 54210 onClick: handleButtonClick, 54211 ref: buttonRef, 54212 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { 54213 icon: library_search 54214 }) 54215 }), !buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 54216 identifier: "buttonText", 54217 className: buttonClasses, 54218 style: buttonStyles, 54219 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), 54220 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'), 54221 withoutInteractiveFormatting: true, 54222 value: buttonText, 54223 onChange: html => setAttributes({ 54224 buttonText: html 54225 }), 54226 onClick: handleButtonClick 54227 })] 54228 }); 54229 }; 54230 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 54231 const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 54232 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 54233 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { 54234 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 54235 title: (0,external_wp_i18n_namespaceObject.__)('Show search label'), 54236 icon: toggleLabel, 54237 onClick: () => { 54238 setAttributes({ 54239 showLabel: !showLabel 54240 }); 54241 }, 54242 className: showLabel ? 'is-pressed' : undefined 54243 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 54244 icon: getButtonPositionIcon(), 54245 label: (0,external_wp_i18n_namespaceObject.__)('Change button position'), 54246 controls: buttonPositionControls 54247 }), !hasNoButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 54248 title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'), 54249 icon: buttonWithIcon, 54250 onClick: () => { 54251 setAttributes({ 54252 buttonUseIcon: !buttonUseIcon 54253 }); 54254 }, 54255 className: buttonUseIcon ? 'is-pressed' : undefined 54256 })] 54257 }) 54258 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 54259 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 54260 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 54261 resetAll: () => { 54262 setAttributes({ 54263 width: undefined, 54264 widthUnit: undefined 54265 }); 54266 }, 54267 dropdownMenuProps: dropdownMenuProps, 54268 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 54269 hasValue: () => !!width, 54270 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 54271 onDeselect: () => { 54272 setAttributes({ 54273 width: undefined, 54274 widthUnit: undefined 54275 }); 54276 }, 54277 isShownByDefault: true, 54278 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 54279 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 54280 __next40pxDefaultSize: true, 54281 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 54282 id: unitControlInputId // Unused, kept for backwards compatibility 54283 , 54284 min: utils_isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH, 54285 max: utils_isPercentageUnit(widthUnit) ? 100 : undefined, 54286 step: 1, 54287 onChange: newWidth => { 54288 const parsedNewWidth = newWidth === '' ? undefined : parseInt(newWidth, 10); 54289 setAttributes({ 54290 width: parsedNewWidth 54291 }); 54292 }, 54293 onUnitChange: newUnit => { 54294 setAttributes({ 54295 width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT, 54296 widthUnit: newUnit 54297 }); 54298 }, 54299 __unstableInputWidth: "80px", 54300 value: `$width}$widthUnit}`, 54301 units: units 54302 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { 54303 label: (0,external_wp_i18n_namespaceObject.__)('Percentage Width'), 54304 value: PERCENTAGE_WIDTHS.includes(width) && widthUnit === '%' ? width : undefined, 54305 hideLabelFromVision: true, 54306 onChange: newWidth => { 54307 setAttributes({ 54308 width: newWidth, 54309 widthUnit: '%' 54310 }); 54311 }, 54312 isBlock: true, 54313 __next40pxDefaultSize: true, 54314 __nextHasNoMarginBottom: true, 54315 children: PERCENTAGE_WIDTHS.map(widthValue => { 54316 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { 54317 value: widthValue, 54318 label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ 54319 (0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue) 54320 }, widthValue); 54321 }) 54322 })] 54323 }) 54324 }) 54325 }) 54326 })] 54327 }); 54328 const padBorderRadius = radius => radius ? `calc($radius} + $DEFAULT_INNER_PADDING})` : undefined; 54329 const getWrapperStyles = () => { 54330 const styles = isButtonPositionInside ? borderProps.style : { 54331 borderRadius: borderProps.style?.borderRadius, 54332 borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, 54333 borderTopRightRadius: borderProps.style?.borderTopRightRadius, 54334 borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, 54335 borderBottomRightRadius: borderProps.style?.borderBottomRightRadius 54336 }; 54337 const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0; 54338 if (isButtonPositionInside && isNonZeroBorderRadius) { 54339 // We have button inside wrapper and a border radius value to apply. 54340 // Add default padding so we don't get "fat" corners. 54341 // 54342 // CSS calc() is used here to support non-pixel units. The inline 54343 // style using calc() will only apply if both values have units. 54344 54345 if (typeof borderRadius === 'object') { 54346 // Individual corner border radii present. 54347 const { 54348 topLeft, 54349 topRight, 54350 bottomLeft, 54351 bottomRight 54352 } = borderRadius; 54353 return { 54354 ...styles, 54355 borderTopLeftRadius: padBorderRadius(topLeft), 54356 borderTopRightRadius: padBorderRadius(topRight), 54357 borderBottomLeftRadius: padBorderRadius(bottomLeft), 54358 borderBottomRightRadius: padBorderRadius(bottomRight) 54359 }; 54360 } 54361 54362 // The inline style using calc() will only apply if both values 54363 // supplied to calc() have units. Deprecated block's may have 54364 // unitless integer. 54365 const radius = Number.isInteger(borderRadius) ? `$borderRadius}px` : borderRadius; 54366 styles.borderRadius = `calc($radius} + $DEFAULT_INNER_PADDING})`; 54367 } 54368 return styles; 54369 }; 54370 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 54371 className: getBlockClassNames(), 54372 style: { 54373 ...typographyProps.style, 54374 // Input opts out of text decoration. 54375 textDecoration: undefined 54376 } 54377 }); 54378 const labelClassnames = dist_clsx('wp-block-search__label', typographyProps.className); 54379 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 54380 ...blockProps, 54381 children: [controls, showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 54382 identifier: "label", 54383 className: labelClassnames, 54384 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), 54385 placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'), 54386 withoutInteractiveFormatting: true, 54387 value: label, 54388 onChange: html => setAttributes({ 54389 label: html 54390 }), 54391 style: typographyProps.style 54392 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, { 54393 size: { 54394 width: width === undefined ? 'auto' : `$width}$widthUnit}`, 54395 height: 'auto' 54396 }, 54397 className: dist_clsx('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined), 54398 style: getWrapperStyles(), 54399 minWidth: MIN_WIDTH, 54400 enable: getResizableSides(), 54401 onResizeStart: (event, direction, elt) => { 54402 setAttributes({ 54403 width: parseInt(elt.offsetWidth, 10), 54404 widthUnit: 'px' 54405 }); 54406 toggleSelection(false); 54407 }, 54408 onResizeStop: (event, direction, elt, delta) => { 54409 setAttributes({ 54410 width: parseInt(width + delta.width, 10) 54411 }); 54412 toggleSelection(true); 54413 }, 54414 showHandle: isSelected, 54415 children: [(isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 54416 children: [renderTextField(), renderButton()] 54417 }), hasNoButton && renderTextField()] 54418 })] 54419 }); 54420 } 54421 54422 ;// ./node_modules/@wordpress/block-library/build-module/search/variations.js 54423 /** 54424 * WordPress dependencies 54425 */ 54426 54427 const search_variations_variations = [{ 54428 name: 'default', 54429 isDefault: true, 54430 attributes: { 54431 buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), 54432 label: (0,external_wp_i18n_namespaceObject.__)('Search') 54433 } 54434 }]; 54435 /* harmony default export */ const search_variations = (search_variations_variations); 54436 54437 ;// ./node_modules/@wordpress/block-library/build-module/search/index.js 54438 /** 54439 * WordPress dependencies 54440 */ 54441 54442 54443 54444 /** 54445 * Internal dependencies 54446 */ 54447 54448 const search_metadata = { 54449 $schema: "https://schemas.wp.org/trunk/block.json", 54450 apiVersion: 3, 54451 name: "core/search", 54452 title: "Search", 54453 category: "widgets", 54454 description: "Help visitors find your content.", 54455 keywords: ["find"], 54456 textdomain: "default", 54457 attributes: { 54458 label: { 54459 type: "string", 54460 role: "content" 54461 }, 54462 showLabel: { 54463 type: "boolean", 54464 "default": true 54465 }, 54466 placeholder: { 54467 type: "string", 54468 "default": "", 54469 role: "content" 54470 }, 54471 width: { 54472 type: "number" 54473 }, 54474 widthUnit: { 54475 type: "string" 54476 }, 54477 buttonText: { 54478 type: "string", 54479 role: "content" 54480 }, 54481 buttonPosition: { 54482 type: "string", 54483 "default": "button-outside" 54484 }, 54485 buttonUseIcon: { 54486 type: "boolean", 54487 "default": false 54488 }, 54489 query: { 54490 type: "object", 54491 "default": {} 54492 }, 54493 isSearchFieldHidden: { 54494 type: "boolean", 54495 "default": false 54496 } 54497 }, 54498 supports: { 54499 align: ["left", "center", "right"], 54500 color: { 54501 gradients: true, 54502 __experimentalSkipSerialization: true, 54503 __experimentalDefaultControls: { 54504 background: true, 54505 text: true 54506 } 54507 }, 54508 interactivity: true, 54509 typography: { 54510 __experimentalSkipSerialization: true, 54511 __experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button", 54512 fontSize: true, 54513 lineHeight: true, 54514 __experimentalFontFamily: true, 54515 __experimentalFontWeight: true, 54516 __experimentalFontStyle: true, 54517 __experimentalTextTransform: true, 54518 __experimentalTextDecoration: true, 54519 __experimentalLetterSpacing: true, 54520 __experimentalDefaultControls: { 54521 fontSize: true 54522 } 54523 }, 54524 __experimentalBorder: { 54525 color: true, 54526 radius: true, 54527 width: true, 54528 __experimentalSkipSerialization: true, 54529 __experimentalDefaultControls: { 54530 color: true, 54531 radius: true, 54532 width: true 54533 } 54534 }, 54535 spacing: { 54536 margin: true 54537 }, 54538 html: false 54539 }, 54540 editorStyle: "wp-block-search-editor", 54541 style: "wp-block-search" 54542 }; 54543 54544 54545 const { 54546 name: search_name 54547 } = search_metadata; 54548 54549 const search_settings = { 54550 icon: library_search, 54551 example: { 54552 attributes: { 54553 buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), 54554 label: (0,external_wp_i18n_namespaceObject.__)('Search') 54555 }, 54556 viewportWidth: 400 54557 }, 54558 variations: search_variations, 54559 edit: SearchEdit 54560 }; 54561 const search_init = () => initBlock({ 54562 name: search_name, 54563 metadata: search_metadata, 54564 settings: search_settings 54565 }); 54566 54567 ;// ./node_modules/@wordpress/icons/build-module/library/separator.js 54568 /** 54569 * WordPress dependencies 54570 */ 54571 54572 54573 const separator = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 54574 viewBox: "0 0 24 24", 54575 xmlns: "http://www.w3.org/2000/svg", 54576 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 54577 d: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z" 54578 }) 54579 }); 54580 /* harmony default export */ const library_separator = (separator); 54581 54582 ;// ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js 54583 /** 54584 * WordPress dependencies 54585 */ 54586 54587 54588 function useDeprecatedOpacity(opacity, currentColor, setAttributes) { 54589 const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false); 54590 const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); 54591 54592 // A separator with no color set will always have previousColor set to undefined, 54593 // and we need to differentiate these from those with color set that will return 54594 // previousColor as undefined on the first render. 54595 (0,external_wp_element_namespaceObject.useEffect)(() => { 54596 if (opacity === 'css' && !currentColor && !previousColor) { 54597 setDeprecatedOpacityWithNoColor(true); 54598 } 54599 }, [currentColor, previousColor, opacity]); 54600 54601 // For deprecated blocks, that have a default 0.4 css opacity set, we 54602 // need to remove this if the current color is changed, or a color is added. 54603 // In these instances the opacity attribute is set back to the default of 54604 // alpha-channel which allows a new custom opacity to be set via the color picker. 54605 (0,external_wp_element_namespaceObject.useEffect)(() => { 54606 if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) { 54607 setAttributes({ 54608 opacity: 'alpha-channel' 54609 }); 54610 setDeprecatedOpacityWithNoColor(false); 54611 } 54612 }, [deprecatedOpacityWithNoColor, currentColor, previousColor]); 54613 } 54614 54615 ;// ./node_modules/@wordpress/block-library/build-module/separator/edit.js 54616 /** 54617 * External dependencies 54618 */ 54619 54620 54621 /** 54622 * WordPress dependencies 54623 */ 54624 54625 54626 54627 54628 /** 54629 * Internal dependencies 54630 */ 54631 54632 54633 54634 function SeparatorEdit({ 54635 attributes, 54636 setAttributes 54637 }) { 54638 const { 54639 backgroundColor, 54640 opacity, 54641 style, 54642 tagName 54643 } = attributes; 54644 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 54645 const currentColor = colorProps?.style?.backgroundColor; 54646 const hasCustomColor = !!style?.color?.background; 54647 useDeprecatedOpacity(opacity, currentColor, setAttributes); 54648 54649 // The dots styles uses text for the dots, to change those dots color is 54650 // using color, not backgroundColor. 54651 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); 54652 const className = dist_clsx({ 54653 'has-text-color': backgroundColor || currentColor, 54654 [colorClass]: colorClass, 54655 'has-css-opacity': opacity === 'css', 54656 'has-alpha-channel-opacity': opacity === 'alpha-channel' 54657 }, colorProps.className); 54658 const styles = { 54659 color: currentColor, 54660 backgroundColor: currentColor 54661 }; 54662 const Wrapper = tagName === 'hr' ? external_wp_components_namespaceObject.HorizontalRule : tagName; 54663 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 54664 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 54665 group: "advanced", 54666 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 54667 __nextHasNoMarginBottom: true, 54668 __next40pxDefaultSize: true, 54669 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 54670 options: [{ 54671 label: (0,external_wp_i18n_namespaceObject.__)('Default (<hr>)'), 54672 value: 'hr' 54673 }, { 54674 label: '<div>', 54675 value: 'div' 54676 }], 54677 value: tagName, 54678 onChange: value => setAttributes({ 54679 tagName: value 54680 }), 54681 help: htmlElementMessages[tagName] 54682 }) 54683 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { 54684 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 54685 className, 54686 style: hasCustomColor ? styles : undefined 54687 }) 54688 })] 54689 }); 54690 } 54691 54692 ;// ./node_modules/@wordpress/block-library/build-module/separator/save.js 54693 /** 54694 * External dependencies 54695 */ 54696 54697 54698 /** 54699 * WordPress dependencies 54700 */ 54701 54702 54703 function separatorSave({ 54704 attributes 54705 }) { 54706 const { 54707 backgroundColor, 54708 style, 54709 opacity, 54710 tagName: Tag 54711 } = attributes; 54712 const customColor = style?.color?.background; 54713 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 54714 // The hr support changing color using border-color, since border-color 54715 // is not yet supported in the color palette, we use background-color. 54716 54717 // The dots styles uses text for the dots, to change those dots color is 54718 // using color, not backgroundColor. 54719 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); 54720 const className = dist_clsx({ 54721 'has-text-color': backgroundColor || customColor, 54722 [colorClass]: colorClass, 54723 'has-css-opacity': opacity === 'css', 54724 'has-alpha-channel-opacity': opacity === 'alpha-channel' 54725 }, colorProps.className); 54726 const styles = { 54727 backgroundColor: colorProps?.style?.backgroundColor, 54728 color: colorClass ? undefined : customColor 54729 }; 54730 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 54731 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 54732 className, 54733 style: styles 54734 }) 54735 }); 54736 } 54737 54738 ;// ./node_modules/@wordpress/block-library/build-module/separator/transforms.js 54739 /** 54740 * WordPress dependencies 54741 */ 54742 54743 const separator_transforms_transforms = { 54744 from: [{ 54745 type: 'enter', 54746 regExp: /^-{3,}$/, 54747 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator') 54748 }, { 54749 type: 'raw', 54750 selector: 'hr', 54751 schema: { 54752 hr: {} 54753 } 54754 }], 54755 to: [{ 54756 type: 'block', 54757 blocks: ['core/spacer'], 54758 // Transform to Spacer. 54759 transform: ({ 54760 anchor 54761 }) => { 54762 return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer', { 54763 anchor: anchor || '' 54764 }); 54765 } 54766 }] 54767 }; 54768 /* harmony default export */ const separator_transforms = (separator_transforms_transforms); 54769 54770 ;// ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js 54771 /** 54772 * External dependencies 54773 */ 54774 54775 54776 /** 54777 * WordPress dependencies 54778 */ 54779 54780 54781 const separator_deprecated_v1 = { 54782 attributes: { 54783 color: { 54784 type: 'string' 54785 }, 54786 customColor: { 54787 type: 'string' 54788 } 54789 }, 54790 save({ 54791 attributes 54792 }) { 54793 const { 54794 color, 54795 customColor 54796 } = attributes; 54797 54798 // the hr support changing color using border-color, since border-color 54799 // is not yet supported in the color palette, we use background-color 54800 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); 54801 // the dots styles uses text for the dots, to change those dots color is 54802 // using color, not backgroundColor 54803 const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color); 54804 const className = dist_clsx({ 54805 'has-text-color has-background': color || customColor, 54806 [backgroundClass]: backgroundClass, 54807 [colorClass]: colorClass 54808 }); 54809 const style = { 54810 backgroundColor: backgroundClass ? undefined : customColor, 54811 color: colorClass ? undefined : customColor 54812 }; 54813 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", { 54814 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 54815 className, 54816 style 54817 }) 54818 }); 54819 }, 54820 migrate(attributes) { 54821 const { 54822 color, 54823 customColor, 54824 ...restAttributes 54825 } = attributes; 54826 return { 54827 ...restAttributes, 54828 backgroundColor: color ? color : undefined, 54829 opacity: 'css', 54830 style: customColor ? { 54831 color: { 54832 background: customColor 54833 } 54834 } : undefined, 54835 tagName: 'hr' 54836 }; 54837 } 54838 }; 54839 /* harmony default export */ const separator_deprecated = ([separator_deprecated_v1]); 54840 54841 ;// ./node_modules/@wordpress/block-library/build-module/separator/index.js 54842 /** 54843 * WordPress dependencies 54844 */ 54845 54846 54847 /** 54848 * Internal dependencies 54849 */ 54850 54851 54852 const separator_metadata = { 54853 $schema: "https://schemas.wp.org/trunk/block.json", 54854 apiVersion: 3, 54855 name: "core/separator", 54856 title: "Separator", 54857 category: "design", 54858 description: "Create a break between ideas or sections with a horizontal separator.", 54859 keywords: ["horizontal-line", "hr", "divider"], 54860 textdomain: "default", 54861 attributes: { 54862 opacity: { 54863 type: "string", 54864 "default": "alpha-channel" 54865 }, 54866 tagName: { 54867 type: "string", 54868 "enum": ["hr", "div"], 54869 "default": "hr" 54870 } 54871 }, 54872 supports: { 54873 anchor: true, 54874 align: ["center", "wide", "full"], 54875 color: { 54876 enableContrastChecker: false, 54877 __experimentalSkipSerialization: true, 54878 gradients: true, 54879 background: true, 54880 text: false, 54881 __experimentalDefaultControls: { 54882 background: true 54883 } 54884 }, 54885 spacing: { 54886 margin: ["top", "bottom"] 54887 }, 54888 interactivity: { 54889 clientNavigation: true 54890 } 54891 }, 54892 styles: [{ 54893 name: "default", 54894 label: "Default", 54895 isDefault: true 54896 }, { 54897 name: "wide", 54898 label: "Wide Line" 54899 }, { 54900 name: "dots", 54901 label: "Dots" 54902 }], 54903 editorStyle: "wp-block-separator-editor", 54904 style: "wp-block-separator" 54905 }; 54906 54907 54908 54909 const { 54910 name: separator_name 54911 } = separator_metadata; 54912 54913 const separator_settings = { 54914 icon: library_separator, 54915 example: { 54916 attributes: { 54917 customColor: '#065174', 54918 className: 'is-style-wide' 54919 } 54920 }, 54921 transforms: separator_transforms, 54922 edit: SeparatorEdit, 54923 save: separatorSave, 54924 deprecated: separator_deprecated 54925 }; 54926 const separator_init = () => initBlock({ 54927 name: separator_name, 54928 metadata: separator_metadata, 54929 settings: separator_settings 54930 }); 54931 54932 ;// ./node_modules/@wordpress/icons/build-module/library/shortcode.js 54933 /** 54934 * WordPress dependencies 54935 */ 54936 54937 54938 const shortcode = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 54939 viewBox: "0 0 24 24", 54940 xmlns: "http://www.w3.org/2000/svg", 54941 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 54942 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" 54943 }) 54944 }); 54945 /* harmony default export */ const library_shortcode = (shortcode); 54946 54947 ;// ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js 54948 /** 54949 * WordPress dependencies 54950 */ 54951 54952 54953 54954 54955 54956 54957 function ShortcodeEdit({ 54958 attributes, 54959 setAttributes 54960 }) { 54961 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit); 54962 const inputId = `blocks-shortcode-input-$instanceId}`; 54963 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 54964 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 54965 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 54966 icon: library_shortcode, 54967 label: (0,external_wp_i18n_namespaceObject.__)('Shortcode'), 54968 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { 54969 className: "blocks-shortcode__textarea", 54970 id: inputId, 54971 value: attributes.text, 54972 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'), 54973 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'), 54974 onChange: text => setAttributes({ 54975 text 54976 }) 54977 }) 54978 }) 54979 }); 54980 } 54981 54982 ;// ./node_modules/@wordpress/block-library/build-module/shortcode/save.js 54983 /** 54984 * WordPress dependencies 54985 */ 54986 54987 54988 function shortcode_save_save({ 54989 attributes 54990 }) { 54991 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { 54992 children: attributes.text 54993 }); 54994 } 54995 54996 ;// external ["wp","autop"] 54997 const external_wp_autop_namespaceObject = window["wp"]["autop"]; 54998 ;// ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js 54999 /** 55000 * WordPress dependencies 55001 */ 55002 55003 const shortcode_transforms_transforms = { 55004 from: [{ 55005 type: 'shortcode', 55006 // Per "Shortcode names should be all lowercase and use all 55007 // letters, but numbers and underscores should work fine too. 55008 // Be wary of using hyphens (dashes), you'll be better off not 55009 // using them." in https://codex.wordpress.org/Shortcode_API 55010 // Require that the first character be a letter. This notably 55011 // prevents footnote markings ([1]) from being caught as 55012 // shortcodes. 55013 tag: '[a-z][a-z0-9_-]*', 55014 attributes: { 55015 text: { 55016 type: 'string', 55017 shortcode: (attrs, { 55018 content 55019 }) => { 55020 return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content)); 55021 } 55022 } 55023 }, 55024 priority: 20 55025 }] 55026 }; 55027 /* harmony default export */ const shortcode_transforms = (shortcode_transforms_transforms); 55028 55029 ;// ./node_modules/@wordpress/block-library/build-module/shortcode/index.js 55030 /** 55031 * WordPress dependencies 55032 */ 55033 55034 55035 /** 55036 * Internal dependencies 55037 */ 55038 55039 55040 55041 55042 const shortcode_metadata = { 55043 $schema: "https://schemas.wp.org/trunk/block.json", 55044 apiVersion: 3, 55045 name: "core/shortcode", 55046 title: "Shortcode", 55047 category: "widgets", 55048 description: "Insert additional custom elements with a WordPress shortcode.", 55049 textdomain: "default", 55050 attributes: { 55051 text: { 55052 type: "string", 55053 source: "raw" 55054 } 55055 }, 55056 supports: { 55057 className: false, 55058 customClassName: false, 55059 html: false 55060 }, 55061 editorStyle: "wp-block-shortcode-editor" 55062 }; 55063 const { 55064 name: shortcode_name 55065 } = shortcode_metadata; 55066 55067 const shortcode_settings = { 55068 icon: library_shortcode, 55069 transforms: shortcode_transforms, 55070 edit: ShortcodeEdit, 55071 save: shortcode_save_save 55072 }; 55073 const shortcode_init = () => initBlock({ 55074 name: shortcode_name, 55075 metadata: shortcode_metadata, 55076 settings: shortcode_settings 55077 }); 55078 55079 ;// ./node_modules/@wordpress/icons/build-module/library/site-logo.js 55080 /** 55081 * WordPress dependencies 55082 */ 55083 55084 55085 const siteLogo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 55086 xmlns: "http://www.w3.org/2000/svg", 55087 viewBox: "0 0 24 24", 55088 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 55089 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" 55090 }) 55091 }); 55092 /* harmony default export */ const site_logo = (siteLogo); 55093 55094 ;// ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js 55095 /** 55096 * External dependencies 55097 */ 55098 55099 55100 /** 55101 * WordPress dependencies 55102 */ 55103 55104 55105 55106 55107 55108 55109 55110 55111 55112 55113 55114 /** 55115 * Internal dependencies 55116 */ 55117 55118 55119 const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image']; 55120 const ACCEPT_MEDIA_STRING = 'image/*'; 55121 const SiteLogo = ({ 55122 alt, 55123 attributes: { 55124 align, 55125 width, 55126 height, 55127 isLink, 55128 linkTarget, 55129 shouldSyncIcon 55130 }, 55131 isSelected, 55132 setAttributes, 55133 setLogo, 55134 logoUrl, 55135 siteUrl, 55136 logoId, 55137 iconId, 55138 setIcon, 55139 canUserEdit 55140 }) => { 55141 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); 55142 const isWideAligned = ['wide', 'full'].includes(align); 55143 const isResizable = !isWideAligned && isLargeViewport; 55144 const [{ 55145 naturalWidth, 55146 naturalHeight 55147 }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); 55148 const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); 55149 const { 55150 toggleSelection 55151 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 55152 const { 55153 imageEditing, 55154 maxWidth, 55155 title 55156 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 55157 const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 55158 const siteEntities = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase'); 55159 return { 55160 title: siteEntities?.name, 55161 imageEditing: settings.imageEditing, 55162 maxWidth: settings.maxWidth 55163 }; 55164 }, []); 55165 (0,external_wp_element_namespaceObject.useEffect)(() => { 55166 // Turn the `Use as site icon` toggle off if it is on but the logo and icon have 55167 // fallen out of sync. This can happen if the toggle is saved in the `on` position, 55168 // but changes are later made to the site icon in the Customizer. 55169 if (shouldSyncIcon && logoId !== iconId) { 55170 setAttributes({ 55171 shouldSyncIcon: false 55172 }); 55173 } 55174 }, []); 55175 (0,external_wp_element_namespaceObject.useEffect)(() => { 55176 if (!isSelected) { 55177 setIsEditingImage(false); 55178 } 55179 }, [isSelected]); 55180 function onResizeStart() { 55181 toggleSelection(false); 55182 } 55183 function onResizeStop() { 55184 toggleSelection(true); 55185 } 55186 const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55187 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 55188 className: "custom-logo", 55189 src: logoUrl, 55190 alt: alt, 55191 onLoad: event => { 55192 setNaturalSize({ 55193 naturalWidth: event.target.naturalWidth, 55194 naturalHeight: event.target.naturalHeight 55195 }); 55196 } 55197 }), (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] 55198 }); 55199 let imgWrapper = img; 55200 55201 // Disable reason: Image itself is not meant to be interactive, but 55202 // should direct focus to block. 55203 if (isLink) { 55204 imgWrapper = 55205 /*#__PURE__*/ 55206 /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ 55207 (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 55208 href: siteUrl, 55209 className: "custom-logo-link", 55210 rel: "home", 55211 title: title, 55212 onClick: event => event.preventDefault(), 55213 children: img 55214 }) 55215 /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; 55216 } 55217 if (!isResizable || !naturalWidth || !naturalHeight) { 55218 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 55219 style: { 55220 width, 55221 height 55222 }, 55223 children: imgWrapper 55224 }); 55225 } 55226 55227 // Set the default width to a responsible size. 55228 // Note that this width is also set in the attached frontend CSS file. 55229 const defaultWidth = 120; 55230 const currentWidth = width || defaultWidth; 55231 const ratio = naturalWidth / naturalHeight; 55232 const currentHeight = currentWidth / ratio; 55233 const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE * ratio); 55234 const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE / ratio); 55235 55236 // With the current implementation of ResizableBox, an image needs an 55237 // explicit pixel value for the max-width. In absence of being able to 55238 // set the content-width, this max-width is currently dictated by the 55239 // vanilla editor style. The following variable adds a buffer to this 55240 // vanilla style, so 3rd party themes have some wiggleroom. This does, 55241 // in most cases, allow you to scale the image beyond the width of the 55242 // main column, though not infinitely. 55243 // @todo It would be good to revisit this once a content-width variable 55244 // becomes available. 55245 const maxWidthBuffer = maxWidth * 2.5; 55246 let showRightHandle = false; 55247 let showLeftHandle = false; 55248 55249 /* eslint-disable no-lonely-if */ 55250 // See https://github.com/WordPress/gutenberg/issues/7584. 55251 if (align === 'center') { 55252 // When the image is centered, show both handles. 55253 showRightHandle = true; 55254 showLeftHandle = true; 55255 } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { 55256 // In RTL mode the image is on the right by default. 55257 // Show the right handle and hide the left handle only when it is 55258 // aligned left. Otherwise always show the left handle. 55259 if (align === 'left') { 55260 showRightHandle = true; 55261 } else { 55262 showLeftHandle = true; 55263 } 55264 } else { 55265 // Show the left handle and hide the right handle only when the 55266 // image is aligned right. Otherwise always show the right handle. 55267 if (align === 'right') { 55268 showLeftHandle = true; 55269 } else { 55270 showRightHandle = true; 55271 } 55272 } 55273 /* eslint-enable no-lonely-if */ 55274 55275 const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing; 55276 const imgEdit = canEditImage && isEditingImage ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { 55277 id: logoId, 55278 url: logoUrl, 55279 width: currentWidth, 55280 height: currentHeight, 55281 naturalHeight: naturalHeight, 55282 naturalWidth: naturalWidth, 55283 onSaveImage: imageAttributes => { 55284 setLogo(imageAttributes.id); 55285 }, 55286 onFinishEditing: () => { 55287 setIsEditingImage(false); 55288 } 55289 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 55290 size: { 55291 width: currentWidth, 55292 height: currentHeight 55293 }, 55294 showHandle: isSelected, 55295 minWidth: minWidth, 55296 maxWidth: maxWidthBuffer, 55297 minHeight: minHeight, 55298 maxHeight: maxWidthBuffer / ratio, 55299 lockAspectRatio: true, 55300 enable: { 55301 top: false, 55302 right: showRightHandle, 55303 bottom: true, 55304 left: showLeftHandle 55305 }, 55306 onResizeStart: onResizeStart, 55307 onResizeStop: (event, direction, elt, delta) => { 55308 onResizeStop(); 55309 setAttributes({ 55310 width: parseInt(currentWidth + delta.width, 10), 55311 height: parseInt(currentHeight + delta.height, 10) 55312 }); 55313 }, 55314 children: imgWrapper 55315 }); 55316 55317 // Support the previous location for the Site Icon settings. To be removed 55318 // when the required WP core version for Gutenberg is >= 6.5.0. 55319 const shouldUseNewUrl = !window?.__experimentalUseCustomizerSiteLogoUrl; 55320 const siteIconSettingsUrl = shouldUseNewUrl ? siteUrl + '/wp-admin/options-general.php' : siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline'; 55321 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>.'), { 55322 a: 55323 /*#__PURE__*/ 55324 // eslint-disable-next-line jsx-a11y/anchor-has-content 55325 (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 55326 href: siteIconSettingsUrl, 55327 target: "_blank", 55328 rel: "noopener noreferrer" 55329 }) 55330 }); 55331 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55332 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 55333 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { 55334 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), 55335 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 55336 __nextHasNoMarginBottom: true, 55337 __next40pxDefaultSize: true, 55338 label: (0,external_wp_i18n_namespaceObject.__)('Image width'), 55339 onChange: newWidth => setAttributes({ 55340 width: newWidth 55341 }), 55342 min: minWidth, 55343 max: maxWidthBuffer, 55344 initialPosition: Math.min(defaultWidth, maxWidthBuffer), 55345 value: width || '', 55346 disabled: !isResizable 55347 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 55348 __nextHasNoMarginBottom: true, 55349 label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'), 55350 onChange: () => setAttributes({ 55351 isLink: !isLink 55352 }), 55353 checked: isLink 55354 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55355 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 55356 __nextHasNoMarginBottom: true, 55357 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 55358 onChange: value => setAttributes({ 55359 linkTarget: value ? '_blank' : '_self' 55360 }), 55361 checked: linkTarget === '_blank' 55362 }) 55363 }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55364 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 55365 __nextHasNoMarginBottom: true, 55366 label: (0,external_wp_i18n_namespaceObject.__)('Use as Site Icon'), 55367 onChange: value => { 55368 setAttributes({ 55369 shouldSyncIcon: value 55370 }); 55371 setIcon(value ? logoId : undefined); 55372 }, 55373 checked: !!shouldSyncIcon, 55374 help: syncSiteIconHelpText 55375 }) 55376 })] 55377 }) 55378 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 55379 group: "block", 55380 children: canEditImage && !isEditingImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 55381 onClick: () => setIsEditingImage(true), 55382 icon: library_crop, 55383 label: (0,external_wp_i18n_namespaceObject.__)('Crop') 55384 }) 55385 }), imgEdit] 55386 }); 55387 }; 55388 55389 // This is a light wrapper around MediaReplaceFlow because the block has two 55390 // different MediaReplaceFlows, one for the inspector and one for the toolbar. 55391 function SiteLogoReplaceFlow({ 55392 mediaURL, 55393 ...mediaReplaceProps 55394 }) { 55395 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 55396 ...mediaReplaceProps, 55397 mediaURL: mediaURL, 55398 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 55399 accept: ACCEPT_MEDIA_STRING 55400 }); 55401 } 55402 const InspectorLogoPreview = ({ 55403 media, 55404 itemGroupProps 55405 }) => { 55406 const { 55407 alt_text: alt, 55408 source_url: logoUrl, 55409 slug: logoSlug, 55410 media_details: logoMediaDetails 55411 } = media !== null && media !== void 0 ? media : {}; 55412 const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug; 55413 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { 55414 ...itemGroupProps, 55415 as: "span", 55416 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 55417 justify: "flex-start", 55418 as: "span", 55419 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { 55420 src: logoUrl, 55421 alt: alt 55422 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 55423 as: "span", 55424 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { 55425 numberOfLines: 1, 55426 className: "block-library-site-logo__inspector-media-replace-title", 55427 children: logoLabel 55428 }) 55429 })] 55430 }) 55431 }); 55432 }; 55433 function LogoEdit({ 55434 attributes, 55435 className, 55436 setAttributes, 55437 isSelected 55438 }) { 55439 const { 55440 width, 55441 shouldSyncIcon 55442 } = attributes; 55443 const { 55444 siteLogoId, 55445 canUserEdit, 55446 url, 55447 siteIconId, 55448 mediaItemData, 55449 isRequestingMediaItem 55450 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 55451 const { 55452 canUser, 55453 getEntityRecord, 55454 getEditedEntityRecord 55455 } = select(external_wp_coreData_namespaceObject.store); 55456 const _canUserEdit = canUser('update', { 55457 kind: 'root', 55458 name: 'site' 55459 }); 55460 const siteSettings = _canUserEdit ? getEditedEntityRecord('root', 'site') : undefined; 55461 const siteData = getEntityRecord('root', '__unstableBase'); 55462 const _siteLogoId = _canUserEdit ? siteSettings?.site_logo : siteData?.site_logo; 55463 const _siteIconId = siteSettings?.site_icon; 55464 const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, { 55465 context: 'view' 55466 }); 55467 const _isRequestingMediaItem = !!_siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, { 55468 context: 'view' 55469 }]); 55470 return { 55471 siteLogoId: _siteLogoId, 55472 canUserEdit: _canUserEdit, 55473 url: siteData?.home, 55474 mediaItemData: mediaItem, 55475 isRequestingMediaItem: _isRequestingMediaItem, 55476 siteIconId: _siteIconId 55477 }; 55478 }, []); 55479 const { 55480 getSettings 55481 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 55482 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(); 55483 const { 55484 editEntityRecord 55485 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 55486 const setLogo = (newValue, shouldForceSync = false) => { 55487 // `shouldForceSync` is used to force syncing when the attribute 55488 // may not have updated yet. 55489 if (shouldSyncIcon || shouldForceSync) { 55490 setIcon(newValue); 55491 } 55492 editEntityRecord('root', 'site', undefined, { 55493 site_logo: newValue 55494 }); 55495 }; 55496 const setIcon = newValue => 55497 // The new value needs to be `null` to reset the Site Icon. 55498 editEntityRecord('root', 'site', undefined, { 55499 site_icon: newValue !== null && newValue !== void 0 ? newValue : null 55500 }); 55501 const { 55502 alt_text: alt, 55503 source_url: logoUrl 55504 } = mediaItemData !== null && mediaItemData !== void 0 ? mediaItemData : {}; 55505 const onInitialSelectLogo = media => { 55506 // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no 55507 // site icon, automatically sync the logo to the icon. 55508 if (shouldSyncIcon === undefined) { 55509 const shouldForceSync = !siteIconId; 55510 setAttributes({ 55511 shouldSyncIcon: shouldForceSync 55512 }); 55513 55514 // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by 55515 // the time `setLogo` is called, pass an argument to force the syncing. 55516 onSelectLogo(media, shouldForceSync); 55517 return; 55518 } 55519 onSelectLogo(media); 55520 }; 55521 const onSelectLogo = (media, shouldForceSync = false) => { 55522 if (!media) { 55523 return; 55524 } 55525 if (!media.id && media.url) { 55526 // This is a temporary blob image. 55527 setTemporaryURL(media.url); 55528 setLogo(undefined); 55529 return; 55530 } 55531 setLogo(media.id, shouldForceSync); 55532 }; 55533 const onRemoveLogo = () => { 55534 setLogo(null); 55535 setAttributes({ 55536 width: undefined 55537 }); 55538 }; 55539 const { 55540 createErrorNotice 55541 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 55542 const onUploadError = message => { 55543 createErrorNotice(message, { 55544 type: 'snackbar' 55545 }); 55546 setTemporaryURL(); 55547 }; 55548 const onFilesDrop = filesList => { 55549 if (filesList?.length > 1) { 55550 onUploadError((0,external_wp_i18n_namespaceObject.__)('Only one image can be used as a site logo.')); 55551 return; 55552 } 55553 getSettings().mediaUpload({ 55554 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 55555 filesList, 55556 onFileChange([image]) { 55557 if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) { 55558 setTemporaryURL(image.url); 55559 return; 55560 } 55561 onInitialSelectLogo(image); 55562 }, 55563 onError: onUploadError 55564 }); 55565 }; 55566 const mediaReplaceFlowProps = { 55567 mediaURL: logoUrl, 55568 name: !logoUrl ? (0,external_wp_i18n_namespaceObject.__)('Choose logo') : (0,external_wp_i18n_namespaceObject.__)('Replace'), 55569 onSelect: onSelectLogo, 55570 onError: onUploadError, 55571 onReset: onRemoveLogo 55572 }; 55573 const controls = canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 55574 group: "other", 55575 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, { 55576 ...mediaReplaceFlowProps 55577 }) 55578 }); 55579 let logoImage; 55580 const isLoading = siteLogoId === undefined || isRequestingMediaItem; 55581 if (isLoading) { 55582 logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}); 55583 } 55584 55585 // Reset temporary url when logoUrl is available. 55586 (0,external_wp_element_namespaceObject.useEffect)(() => { 55587 if (logoUrl && temporaryURL) { 55588 setTemporaryURL(); 55589 } 55590 }, [logoUrl, temporaryURL]); 55591 if (!!logoUrl || !!temporaryURL) { 55592 logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55593 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogo, { 55594 alt: alt, 55595 attributes: attributes, 55596 className: className, 55597 isSelected: isSelected, 55598 setAttributes: setAttributes, 55599 logoUrl: temporaryURL || logoUrl, 55600 setLogo: setLogo, 55601 logoId: mediaItemData?.id || siteLogoId, 55602 siteUrl: url, 55603 setIcon: setIcon, 55604 iconId: siteIconId, 55605 canUserEdit: canUserEdit 55606 }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { 55607 onFilesDrop: onFilesDrop 55608 })] 55609 }); 55610 } 55611 const placeholder = content => { 55612 const placeholderClassName = dist_clsx('block-editor-media-placeholder', className); 55613 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 55614 className: placeholderClassName, 55615 preview: logoImage, 55616 withIllustration: true, 55617 style: { 55618 width 55619 }, 55620 children: content 55621 }); 55622 }; 55623 const classes = dist_clsx(className, { 55624 'is-default-size': !width, 55625 'is-transient': temporaryURL 55626 }); 55627 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 55628 className: classes 55629 }); 55630 const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 55631 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 55632 title: (0,external_wp_i18n_namespaceObject.__)('Media'), 55633 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 55634 className: "block-library-site-logo__inspector-media-replace-container", 55635 children: !canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, { 55636 media: mediaItemData, 55637 itemGroupProps: { 55638 isBordered: true, 55639 className: 'block-library-site-logo__inspector-readonly-logo-preview' 55640 } 55641 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55642 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, { 55643 ...mediaReplaceFlowProps, 55644 name: !!logoUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, { 55645 media: mediaItemData 55646 }) : (0,external_wp_i18n_namespaceObject.__)('Choose logo'), 55647 renderToggle: props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 55648 ...props, 55649 __next40pxDefaultSize: true, 55650 children: temporaryURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : props.children 55651 }) 55652 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { 55653 onFilesDrop: onFilesDrop 55654 })] 55655 }) 55656 }) 55657 }) 55658 }); 55659 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 55660 ...blockProps, 55661 children: [controls, mediaInspectorPanel, (!!logoUrl || !!temporaryURL) && logoImage, (isLoading || !temporaryURL && !logoUrl && !canUserEdit) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 55662 className: "site-logo_placeholder", 55663 withIllustration: true, 55664 children: isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 55665 className: "components-placeholder__preview", 55666 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 55667 }) 55668 }), !isLoading && !temporaryURL && !logoUrl && canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 55669 onSelect: onInitialSelectLogo, 55670 accept: ACCEPT_MEDIA_STRING, 55671 allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, 55672 onError: onUploadError, 55673 placeholder: placeholder, 55674 mediaLibraryButton: ({ 55675 open 55676 }) => { 55677 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 55678 __next40pxDefaultSize: true, 55679 icon: library_upload, 55680 variant: "primary", 55681 label: (0,external_wp_i18n_namespaceObject.__)('Choose logo'), 55682 showTooltip: true, 55683 tooltipPosition: "middle right", 55684 onClick: () => { 55685 open(); 55686 } 55687 }); 55688 } 55689 })] 55690 }); 55691 } 55692 55693 ;// ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js 55694 /** 55695 * WordPress dependencies 55696 */ 55697 55698 const site_logo_transforms_transforms = { 55699 to: [{ 55700 type: 'block', 55701 blocks: ['core/site-title'], 55702 transform: ({ 55703 isLink, 55704 linkTarget 55705 }) => { 55706 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', { 55707 isLink, 55708 linkTarget 55709 }); 55710 } 55711 }] 55712 }; 55713 /* harmony default export */ const site_logo_transforms = (site_logo_transforms_transforms); 55714 55715 ;// ./node_modules/@wordpress/block-library/build-module/site-logo/index.js 55716 /** 55717 * WordPress dependencies 55718 */ 55719 55720 55721 /** 55722 * Internal dependencies 55723 */ 55724 55725 const site_logo_metadata = { 55726 $schema: "https://schemas.wp.org/trunk/block.json", 55727 apiVersion: 3, 55728 name: "core/site-logo", 55729 title: "Site Logo", 55730 category: "theme", 55731 description: "Display an image to represent this site. Update this block and the changes apply everywhere.", 55732 textdomain: "default", 55733 attributes: { 55734 width: { 55735 type: "number" 55736 }, 55737 isLink: { 55738 type: "boolean", 55739 "default": true, 55740 role: "content" 55741 }, 55742 linkTarget: { 55743 type: "string", 55744 "default": "_self", 55745 role: "content" 55746 }, 55747 shouldSyncIcon: { 55748 type: "boolean" 55749 } 55750 }, 55751 example: { 55752 viewportWidth: 500, 55753 attributes: { 55754 width: 350, 55755 className: "block-editor-block-types-list__site-logo-example" 55756 } 55757 }, 55758 supports: { 55759 html: false, 55760 align: true, 55761 alignWide: false, 55762 color: { 55763 __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before", 55764 text: false, 55765 background: false 55766 }, 55767 spacing: { 55768 margin: true, 55769 padding: true, 55770 __experimentalDefaultControls: { 55771 margin: false, 55772 padding: false 55773 } 55774 }, 55775 interactivity: { 55776 clientNavigation: true 55777 } 55778 }, 55779 styles: [{ 55780 name: "default", 55781 label: "Default", 55782 isDefault: true 55783 }, { 55784 name: "rounded", 55785 label: "Rounded" 55786 }], 55787 editorStyle: "wp-block-site-logo-editor", 55788 style: "wp-block-site-logo" 55789 }; 55790 55791 55792 const { 55793 name: site_logo_name 55794 } = site_logo_metadata; 55795 55796 const site_logo_settings = { 55797 icon: site_logo, 55798 example: {}, 55799 edit: LogoEdit, 55800 transforms: site_logo_transforms 55801 }; 55802 const site_logo_init = () => initBlock({ 55803 name: site_logo_name, 55804 metadata: site_logo_metadata, 55805 settings: site_logo_settings 55806 }); 55807 55808 ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js 55809 /** 55810 * External dependencies 55811 */ 55812 55813 55814 /** 55815 * WordPress dependencies 55816 */ 55817 55818 55819 55820 55821 55822 55823 function SiteTaglineEdit({ 55824 attributes, 55825 setAttributes, 55826 insertBlocksAfter 55827 }) { 55828 const { 55829 textAlign, 55830 level, 55831 levelOptions 55832 } = attributes; 55833 const { 55834 canUserEdit, 55835 tagline 55836 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 55837 const { 55838 canUser, 55839 getEntityRecord, 55840 getEditedEntityRecord 55841 } = select(external_wp_coreData_namespaceObject.store); 55842 const canEdit = canUser('update', { 55843 kind: 'root', 55844 name: 'site' 55845 }); 55846 const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; 55847 const readOnlySettings = getEntityRecord('root', '__unstableBase'); 55848 return { 55849 canUserEdit: canEdit, 55850 tagline: canEdit ? settings?.description : readOnlySettings?.description 55851 }; 55852 }, []); 55853 const TagName = level === 0 ? 'p' : `h$level}`; 55854 const { 55855 editEntityRecord 55856 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 55857 function setTagline(newTagline) { 55858 editEntityRecord('root', 'site', undefined, { 55859 description: newTagline 55860 }); 55861 } 55862 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 55863 className: dist_clsx({ 55864 [`has-text-align-$textAlign}`]: textAlign, 55865 'wp-block-site-tagline__placeholder': !canUserEdit && !tagline 55866 }) 55867 }); 55868 const siteTaglineContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 55869 allowedFormats: [], 55870 onChange: setTagline, 55871 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'), 55872 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'), 55873 tagName: TagName, 55874 value: tagline, 55875 disableLineBreaks: true, 55876 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), 55877 ...blockProps 55878 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 55879 ...blockProps, 55880 children: tagline || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder') 55881 }); 55882 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 55883 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 55884 group: "block", 55885 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 55886 value: level, 55887 options: levelOptions, 55888 onChange: newLevel => setAttributes({ 55889 level: newLevel 55890 }) 55891 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 55892 onChange: newAlign => setAttributes({ 55893 textAlign: newAlign 55894 }), 55895 value: textAlign 55896 })] 55897 }), siteTaglineContent] 55898 }); 55899 } 55900 55901 ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js 55902 /** 55903 * WordPress dependencies 55904 */ 55905 55906 55907 /* harmony default export */ const site_tagline_icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { 55908 xmlns: "http://www.w3.org/2000/svg", 55909 width: "24", 55910 height: "24", 55911 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { 55912 d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z" 55913 }) 55914 })); 55915 55916 ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js 55917 /** 55918 * Internal dependencies 55919 */ 55920 55921 const site_tagline_deprecated_v1 = { 55922 attributes: { 55923 textAlign: { 55924 type: 'string' 55925 } 55926 }, 55927 supports: { 55928 align: ['wide', 'full'], 55929 html: false, 55930 color: { 55931 gradients: true 55932 }, 55933 spacing: { 55934 margin: true, 55935 padding: true 55936 }, 55937 typography: { 55938 fontSize: true, 55939 lineHeight: true, 55940 __experimentalFontFamily: true, 55941 __experimentalTextTransform: true, 55942 __experimentalFontStyle: true, 55943 __experimentalFontWeight: true, 55944 __experimentalLetterSpacing: true 55945 } 55946 }, 55947 save() { 55948 return null; 55949 }, 55950 migrate: migrate_font_family, 55951 isEligible({ 55952 style 55953 }) { 55954 return style?.typography?.fontFamily; 55955 } 55956 }; 55957 55958 /** 55959 * New deprecations need to be placed first 55960 * for them to have higher priority. 55961 * 55962 * Old deprecations may need to be updated as well. 55963 * 55964 * See block-deprecation.md 55965 */ 55966 /* harmony default export */ const site_tagline_deprecated = ([site_tagline_deprecated_v1]); 55967 55968 ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js 55969 /** 55970 * Internal dependencies 55971 */ 55972 55973 const site_tagline_metadata = { 55974 $schema: "https://schemas.wp.org/trunk/block.json", 55975 apiVersion: 3, 55976 name: "core/site-tagline", 55977 title: "Site Tagline", 55978 category: "theme", 55979 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.", 55980 keywords: ["description"], 55981 textdomain: "default", 55982 attributes: { 55983 textAlign: { 55984 type: "string" 55985 }, 55986 level: { 55987 type: "number", 55988 "default": 0 55989 }, 55990 levelOptions: { 55991 type: "array", 55992 "default": [0, 1, 2, 3, 4, 5, 6] 55993 } 55994 }, 55995 example: { 55996 viewportWidth: 350, 55997 attributes: { 55998 textAlign: "center" 55999 } 56000 }, 56001 supports: { 56002 align: ["wide", "full"], 56003 html: false, 56004 color: { 56005 gradients: true, 56006 __experimentalDefaultControls: { 56007 background: true, 56008 text: true 56009 } 56010 }, 56011 spacing: { 56012 margin: true, 56013 padding: true, 56014 __experimentalDefaultControls: { 56015 margin: false, 56016 padding: false 56017 } 56018 }, 56019 typography: { 56020 fontSize: true, 56021 lineHeight: true, 56022 __experimentalFontFamily: true, 56023 __experimentalTextTransform: true, 56024 __experimentalTextDecoration: true, 56025 __experimentalFontStyle: true, 56026 __experimentalFontWeight: true, 56027 __experimentalLetterSpacing: true, 56028 __experimentalWritingMode: true, 56029 __experimentalDefaultControls: { 56030 fontSize: true 56031 } 56032 }, 56033 interactivity: { 56034 clientNavigation: true 56035 }, 56036 __experimentalBorder: { 56037 radius: true, 56038 color: true, 56039 width: true, 56040 style: true 56041 } 56042 }, 56043 editorStyle: "wp-block-site-tagline-editor", 56044 style: "wp-block-site-tagline" 56045 }; 56046 56047 56048 56049 const { 56050 name: site_tagline_name 56051 } = site_tagline_metadata; 56052 56053 const site_tagline_settings = { 56054 icon: site_tagline_icon, 56055 edit: SiteTaglineEdit, 56056 deprecated: site_tagline_deprecated 56057 }; 56058 const site_tagline_init = () => initBlock({ 56059 name: site_tagline_name, 56060 metadata: site_tagline_metadata, 56061 settings: site_tagline_settings 56062 }); 56063 56064 ;// ./node_modules/@wordpress/icons/build-module/library/map-marker.js 56065 /** 56066 * WordPress dependencies 56067 */ 56068 56069 56070 const mapMarker = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56071 xmlns: "http://www.w3.org/2000/svg", 56072 viewBox: "0 0 24 24", 56073 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56074 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" 56075 }) 56076 }); 56077 /* harmony default export */ const map_marker = (mapMarker); 56078 56079 ;// ./node_modules/@wordpress/block-library/build-module/site-title/edit.js 56080 /** 56081 * External dependencies 56082 */ 56083 56084 56085 /** 56086 * WordPress dependencies 56087 */ 56088 56089 56090 56091 56092 56093 56094 56095 56096 /** 56097 * Internal dependencies 56098 */ 56099 56100 56101 function SiteTitleEdit({ 56102 attributes, 56103 setAttributes, 56104 insertBlocksAfter 56105 }) { 56106 const { 56107 level, 56108 levelOptions, 56109 textAlign, 56110 isLink, 56111 linkTarget 56112 } = attributes; 56113 const { 56114 canUserEdit, 56115 title 56116 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 56117 const { 56118 canUser, 56119 getEntityRecord, 56120 getEditedEntityRecord 56121 } = select(external_wp_coreData_namespaceObject.store); 56122 const canEdit = canUser('update', { 56123 kind: 'root', 56124 name: 'site' 56125 }); 56126 const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; 56127 const readOnlySettings = getEntityRecord('root', '__unstableBase'); 56128 return { 56129 canUserEdit: canEdit, 56130 title: canEdit ? settings?.title : readOnlySettings?.name 56131 }; 56132 }, []); 56133 const { 56134 editEntityRecord 56135 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 56136 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 56137 function setTitle(newTitle) { 56138 editEntityRecord('root', 'site', undefined, { 56139 title: newTitle 56140 }); 56141 } 56142 const TagName = level === 0 ? 'p' : `h$level}`; 56143 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 56144 className: dist_clsx({ 56145 [`has-text-align-$textAlign}`]: textAlign, 56146 'wp-block-site-title__placeholder': !canUserEdit && !title 56147 }) 56148 }); 56149 const siteTitleContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 56150 ...blockProps, 56151 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 56152 tagName: isLink ? 'a' : 'span', 56153 href: isLink ? '#site-title-pseudo-link' : undefined, 56154 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'), 56155 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'), 56156 value: title, 56157 onChange: setTitle, 56158 allowedFormats: [], 56159 disableLineBreaks: true, 56160 __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 56161 }) 56162 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 56163 ...blockProps, 56164 children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 56165 href: "#site-title-pseudo-link", 56166 onClick: event => event.preventDefault(), 56167 children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder') 56168 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 56169 children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder') 56170 }) 56171 }); 56172 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 56173 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { 56174 group: "block", 56175 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { 56176 value: level, 56177 options: levelOptions, 56178 onChange: newLevel => setAttributes({ 56179 level: newLevel 56180 }) 56181 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 56182 value: textAlign, 56183 onChange: nextAlign => { 56184 setAttributes({ 56185 textAlign: nextAlign 56186 }); 56187 } 56188 })] 56189 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 56190 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 56191 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 56192 resetAll: () => { 56193 setAttributes({ 56194 isLink: true, 56195 linkTarget: '_self' 56196 }); 56197 }, 56198 dropdownMenuProps: dropdownMenuProps, 56199 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 56200 hasValue: () => !isLink, 56201 label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'), 56202 onDeselect: () => setAttributes({ 56203 isLink: true 56204 }), 56205 isShownByDefault: true, 56206 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 56207 __nextHasNoMarginBottom: true, 56208 label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'), 56209 onChange: () => setAttributes({ 56210 isLink: !isLink 56211 }), 56212 checked: isLink 56213 }) 56214 }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 56215 hasValue: () => linkTarget !== '_self', 56216 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 56217 onDeselect: () => setAttributes({ 56218 linkTarget: '_self' 56219 }), 56220 isShownByDefault: true, 56221 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 56222 __nextHasNoMarginBottom: true, 56223 label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), 56224 onChange: value => setAttributes({ 56225 linkTarget: value ? '_blank' : '_self' 56226 }), 56227 checked: linkTarget === '_blank' 56228 }) 56229 })] 56230 }) 56231 }), siteTitleContent] 56232 }); 56233 } 56234 56235 ;// ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js 56236 /** 56237 * Internal dependencies 56238 */ 56239 56240 const site_title_deprecated_v1 = { 56241 attributes: { 56242 level: { 56243 type: 'number', 56244 default: 1 56245 }, 56246 textAlign: { 56247 type: 'string' 56248 }, 56249 isLink: { 56250 type: 'boolean', 56251 default: true 56252 }, 56253 linkTarget: { 56254 type: 'string', 56255 default: '_self' 56256 } 56257 }, 56258 supports: { 56259 align: ['wide', 'full'], 56260 html: false, 56261 color: { 56262 gradients: true, 56263 link: true 56264 }, 56265 spacing: { 56266 padding: true, 56267 margin: true 56268 }, 56269 typography: { 56270 fontSize: true, 56271 lineHeight: true, 56272 __experimentalFontFamily: true, 56273 __experimentalTextTransform: true, 56274 __experimentalFontStyle: true, 56275 __experimentalFontWeight: true, 56276 __experimentalLetterSpacing: true 56277 } 56278 }, 56279 save() { 56280 return null; 56281 }, 56282 migrate: migrate_font_family, 56283 isEligible({ 56284 style 56285 }) { 56286 return style?.typography?.fontFamily; 56287 } 56288 }; 56289 56290 /** 56291 * New deprecations need to be placed first 56292 * for them to have higher priority. 56293 * 56294 * Old deprecations may need to be updated as well. 56295 * 56296 * See block-deprecation.md 56297 */ 56298 /* harmony default export */ const site_title_deprecated = ([site_title_deprecated_v1]); 56299 56300 ;// ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js 56301 /** 56302 * WordPress dependencies 56303 */ 56304 56305 const site_title_transforms_transforms = { 56306 to: [{ 56307 type: 'block', 56308 blocks: ['core/site-logo'], 56309 transform: ({ 56310 isLink, 56311 linkTarget 56312 }) => { 56313 return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', { 56314 isLink, 56315 linkTarget 56316 }); 56317 } 56318 }] 56319 }; 56320 /* harmony default export */ const site_title_transforms = (site_title_transforms_transforms); 56321 56322 ;// ./node_modules/@wordpress/block-library/build-module/site-title/index.js 56323 /** 56324 * WordPress dependencies 56325 */ 56326 56327 56328 /** 56329 * Internal dependencies 56330 */ 56331 56332 const site_title_metadata = { 56333 $schema: "https://schemas.wp.org/trunk/block.json", 56334 apiVersion: 3, 56335 name: "core/site-title", 56336 title: "Site Title", 56337 category: "theme", 56338 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.", 56339 textdomain: "default", 56340 attributes: { 56341 level: { 56342 type: "number", 56343 "default": 1 56344 }, 56345 levelOptions: { 56346 type: "array", 56347 "default": [0, 1, 2, 3, 4, 5, 6] 56348 }, 56349 textAlign: { 56350 type: "string" 56351 }, 56352 isLink: { 56353 type: "boolean", 56354 "default": true, 56355 role: "content" 56356 }, 56357 linkTarget: { 56358 type: "string", 56359 "default": "_self", 56360 role: "content" 56361 } 56362 }, 56363 example: { 56364 viewportWidth: 500 56365 }, 56366 supports: { 56367 align: ["wide", "full"], 56368 html: false, 56369 color: { 56370 gradients: true, 56371 link: true, 56372 __experimentalDefaultControls: { 56373 background: true, 56374 text: true, 56375 link: true 56376 } 56377 }, 56378 spacing: { 56379 padding: true, 56380 margin: true, 56381 __experimentalDefaultControls: { 56382 margin: false, 56383 padding: false 56384 } 56385 }, 56386 typography: { 56387 fontSize: true, 56388 lineHeight: true, 56389 __experimentalFontFamily: true, 56390 __experimentalTextTransform: true, 56391 __experimentalTextDecoration: true, 56392 __experimentalFontStyle: true, 56393 __experimentalFontWeight: true, 56394 __experimentalLetterSpacing: true, 56395 __experimentalWritingMode: true, 56396 __experimentalDefaultControls: { 56397 fontSize: true 56398 } 56399 }, 56400 interactivity: { 56401 clientNavigation: true 56402 }, 56403 __experimentalBorder: { 56404 radius: true, 56405 color: true, 56406 width: true, 56407 style: true 56408 } 56409 }, 56410 editorStyle: "wp-block-site-title-editor", 56411 style: "wp-block-site-title" 56412 }; 56413 56414 56415 56416 const { 56417 name: site_title_name 56418 } = site_title_metadata; 56419 56420 const site_title_settings = { 56421 icon: map_marker, 56422 example: { 56423 viewportWidth: 350, 56424 attributes: { 56425 textAlign: 'center' 56426 } 56427 }, 56428 edit: SiteTitleEdit, 56429 transforms: site_title_transforms, 56430 deprecated: site_title_deprecated 56431 }; 56432 const site_title_init = () => initBlock({ 56433 name: site_title_name, 56434 metadata: site_title_metadata, 56435 settings: site_title_settings 56436 }); 56437 56438 ;// ./node_modules/@wordpress/icons/build-module/library/share.js 56439 /** 56440 * WordPress dependencies 56441 */ 56442 56443 56444 const share = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56445 viewBox: "0 0 24 24", 56446 xmlns: "http://www.w3.org/2000/svg", 56447 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56448 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" 56449 }) 56450 }); 56451 /* harmony default export */ const library_share = (share); 56452 56453 ;// ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js 56454 /** 56455 * WordPress dependencies 56456 */ 56457 56458 56459 const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56460 xmlns: "http://www.w3.org/2000/svg", 56461 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56462 d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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" 56463 }) 56464 }); 56465 /* harmony default export */ const keyboard_return = (keyboardReturn); 56466 56467 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js 56468 /** 56469 * WordPress dependencies 56470 */ 56471 56472 56473 const WordPressIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56474 width: "24", 56475 height: "24", 56476 viewBox: "0 0 24 24", 56477 version: "1.1", 56478 xmlns: "http://www.w3.org/2000/svg", 56479 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56480 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" 56481 }) 56482 }); 56483 56484 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js 56485 /** 56486 * WordPress dependencies 56487 */ 56488 56489 56490 const FivehundredpxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56491 width: "24", 56492 height: "24", 56493 viewBox: "0 0 24 24", 56494 version: "1.1", 56495 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56496 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" 56497 }) 56498 }); 56499 56500 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js 56501 /** 56502 * WordPress dependencies 56503 */ 56504 56505 56506 const AmazonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56507 width: "24", 56508 height: "24", 56509 viewBox: "0 0 24 24", 56510 version: "1.1", 56511 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56512 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" 56513 }) 56514 }); 56515 56516 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js 56517 /** 56518 * WordPress dependencies 56519 */ 56520 56521 56522 56523 const BandcampIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56524 width: "24", 56525 height: "24", 56526 viewBox: "0 0 24 24", 56527 version: "1.1", 56528 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56529 d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289" 56530 }) 56531 }); 56532 56533 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js 56534 /** 56535 * WordPress dependencies 56536 */ 56537 56538 56539 const BehanceIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56540 width: "24", 56541 height: "24", 56542 viewBox: "0 0 24 24", 56543 version: "1.1", 56544 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56545 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" 56546 }) 56547 }); 56548 56549 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bluesky.js 56550 /** 56551 * WordPress dependencies 56552 */ 56553 56554 56555 const BlueskyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56556 width: "24", 56557 height: "24", 56558 viewBox: "0 0 24 24", 56559 version: "1.1", 56560 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56561 d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" 56562 }) 56563 }); 56564 56565 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js 56566 /** 56567 * WordPress dependencies 56568 */ 56569 56570 56571 const ChainIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56572 width: "24", 56573 height: "24", 56574 viewBox: "0 0 24 24", 56575 version: "1.1", 56576 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56577 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" 56578 }) 56579 }); 56580 56581 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js 56582 /** 56583 * WordPress dependencies 56584 */ 56585 56586 56587 const CodepenIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56588 width: "24", 56589 height: "24", 56590 viewBox: "0 0 24 24", 56591 version: "1.1", 56592 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56593 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" 56594 }) 56595 }); 56596 56597 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js 56598 /** 56599 * WordPress dependencies 56600 */ 56601 56602 56603 const DeviantArtIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56604 width: "24", 56605 height: "24", 56606 viewBox: "0 0 24 24", 56607 version: "1.1", 56608 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56609 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" 56610 }) 56611 }); 56612 56613 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js 56614 /** 56615 * WordPress dependencies 56616 */ 56617 56618 56619 const DribbbleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56620 width: "24", 56621 height: "24", 56622 viewBox: "0 0 24 24", 56623 version: "1.1", 56624 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56625 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" 56626 }) 56627 }); 56628 56629 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js 56630 /** 56631 * WordPress dependencies 56632 */ 56633 56634 56635 const DropboxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56636 width: "24", 56637 height: "24", 56638 viewBox: "0 0 24 24", 56639 version: "1.1", 56640 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56641 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" 56642 }) 56643 }); 56644 56645 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js 56646 /** 56647 * WordPress dependencies 56648 */ 56649 56650 56651 const EtsyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56652 width: "24", 56653 height: "24", 56654 viewBox: "0 0 24 24", 56655 version: "1.1", 56656 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56657 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" 56658 }) 56659 }); 56660 56661 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js 56662 /** 56663 * WordPress dependencies 56664 */ 56665 56666 56667 const FacebookIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56668 width: "24", 56669 height: "24", 56670 viewBox: "0 0 24 24", 56671 version: "1.1", 56672 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56673 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" 56674 }) 56675 }); 56676 56677 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js 56678 /** 56679 * WordPress dependencies 56680 */ 56681 56682 56683 const FeedIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56684 width: "24", 56685 height: "24", 56686 viewBox: "0 0 24 24", 56687 version: "1.1", 56688 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56689 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" 56690 }) 56691 }); 56692 56693 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js 56694 /** 56695 * WordPress dependencies 56696 */ 56697 56698 56699 const FlickrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56700 width: "24", 56701 height: "24", 56702 viewBox: "0 0 24 24", 56703 version: "1.1", 56704 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56705 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" 56706 }) 56707 }); 56708 56709 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js 56710 /** 56711 * WordPress dependencies 56712 */ 56713 56714 56715 const FoursquareIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56716 width: "24", 56717 height: "24", 56718 viewBox: "0 0 24 24", 56719 version: "1.1", 56720 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56721 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" 56722 }) 56723 }); 56724 56725 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js 56726 /** 56727 * WordPress dependencies 56728 */ 56729 56730 56731 const GoodreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56732 width: "24", 56733 height: "24", 56734 viewBox: "0 0 24 24", 56735 version: "1.1", 56736 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56737 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" 56738 }) 56739 }); 56740 56741 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js 56742 /** 56743 * WordPress dependencies 56744 */ 56745 56746 56747 const GoogleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56748 width: "24", 56749 height: "24", 56750 viewBox: "0 0 24 24", 56751 version: "1.1", 56752 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56753 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" 56754 }) 56755 }); 56756 56757 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js 56758 /** 56759 * WordPress dependencies 56760 */ 56761 56762 56763 const GitHubIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56764 width: "24", 56765 height: "24", 56766 viewBox: "0 0 24 24", 56767 version: "1.1", 56768 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56769 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" 56770 }) 56771 }); 56772 56773 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/gravatar.js 56774 /** 56775 * WordPress dependencies 56776 */ 56777 56778 56779 const GravatarIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56780 width: "24", 56781 height: "24", 56782 viewBox: "0 0 24 24", 56783 version: "1.1", 56784 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56785 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" 56786 }) 56787 }); 56788 56789 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js 56790 /** 56791 * WordPress dependencies 56792 */ 56793 56794 56795 const InstagramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56796 width: "24", 56797 height: "24", 56798 viewBox: "0 0 24 24", 56799 version: "1.1", 56800 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56801 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" 56802 }) 56803 }); 56804 56805 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js 56806 /** 56807 * WordPress dependencies 56808 */ 56809 56810 56811 const LastfmIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56812 width: "24", 56813 height: "24", 56814 viewBox: "0 0 24 24", 56815 version: "1.1", 56816 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56817 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" 56818 }) 56819 }); 56820 56821 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js 56822 /** 56823 * WordPress dependencies 56824 */ 56825 56826 56827 const LinkedInIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56828 width: "24", 56829 height: "24", 56830 viewBox: "0 0 24 24", 56831 version: "1.1", 56832 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56833 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" 56834 }) 56835 }); 56836 56837 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js 56838 /** 56839 * WordPress dependencies 56840 */ 56841 56842 56843 const MailIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56844 width: "24", 56845 height: "24", 56846 viewBox: "0 0 24 24", 56847 version: "1.1", 56848 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56849 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" 56850 }) 56851 }); 56852 56853 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js 56854 /** 56855 * WordPress dependencies 56856 */ 56857 56858 56859 const MastodonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56860 width: "24", 56861 height: "24", 56862 viewBox: "0 0 24 24", 56863 version: "1.1", 56864 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56865 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" 56866 }) 56867 }); 56868 56869 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js 56870 /** 56871 * WordPress dependencies 56872 */ 56873 56874 56875 const MeetupIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56876 width: "24", 56877 height: "24", 56878 viewBox: "0 0 24 24", 56879 version: "1.1", 56880 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56881 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" 56882 }) 56883 }); 56884 56885 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js 56886 /** 56887 * WordPress dependencies 56888 */ 56889 56890 56891 const MediumIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56892 width: "24", 56893 height: "24", 56894 viewBox: "0 0 24 24", 56895 version: "1.1", 56896 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56897 d: "M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12" 56898 }) 56899 }); 56900 56901 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js 56902 /** 56903 * WordPress dependencies 56904 */ 56905 56906 56907 const PatreonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56908 width: "24", 56909 height: "24", 56910 viewBox: "0 0 24 24", 56911 version: "1.1", 56912 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56913 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" 56914 }) 56915 }); 56916 56917 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js 56918 /** 56919 * WordPress dependencies 56920 */ 56921 56922 56923 const PinterestIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56924 width: "24", 56925 height: "24", 56926 viewBox: "0 0 24 24", 56927 version: "1.1", 56928 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56929 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" 56930 }) 56931 }); 56932 56933 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js 56934 /** 56935 * WordPress dependencies 56936 */ 56937 56938 56939 const PocketIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56940 width: "24", 56941 height: "24", 56942 viewBox: "0 0 24 24", 56943 version: "1.1", 56944 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56945 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" 56946 }) 56947 }); 56948 56949 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js 56950 /** 56951 * WordPress dependencies 56952 */ 56953 56954 56955 const RedditIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56956 width: "24", 56957 height: "24", 56958 viewBox: "0 0 24 24", 56959 version: "1.1", 56960 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56961 d: "M5.27 9.221A2.775 2.775 0 0 0 2.498 11.993a2.785 2.785 0 0 0 1.6 2.511 5.337 5.337 0 0 0 2.374 4.11 9.386 9.386 0 0 0 5.539 1.7 9.386 9.386 0 0 0 5.541-1.7 5.331 5.331 0 0 0 2.372-4.114 2.787 2.787 0 0 0 1.583-2.5 2.775 2.775 0 0 0-2.772-2.772 2.742 2.742 0 0 0-1.688.574 9.482 9.482 0 0 0-4.637-1.348v-.008a2.349 2.349 0 0 1 2.011-2.316 1.97 1.97 0 0 0 1.926 1.521 1.98 1.98 0 0 0 1.978-1.978 1.98 1.98 0 0 0-1.978-1.978 1.985 1.985 0 0 0-1.938 1.578 3.183 3.183 0 0 0-2.849 3.172v.011a9.463 9.463 0 0 0-4.59 1.35 2.741 2.741 0 0 0-1.688-.574Zm6.736 9.1a3.162 3.162 0 0 1-2.921-1.944.215.215 0 0 1 .014-.2.219.219 0 0 1 .168-.106 27.327 27.327 0 0 1 2.74-.133 27.357 27.357 0 0 1 2.74.133.219.219 0 0 1 .168.106.215.215 0 0 1 .014.2 3.158 3.158 0 0 1-2.921 1.944Zm3.743-3.157a1.265 1.265 0 0 1-1.4-1.371 1.954 1.954 0 0 1 .482-1.442 1.15 1.15 0 0 1 .842-.379 1.7 1.7 0 0 1 1.49 1.777 1.323 1.323 0 0 1-.325 1.015 1.476 1.476 0 0 1-1.089.4Zm-7.485 0a1.476 1.476 0 0 1-1.086-.4 1.323 1.323 0 0 1-.325-1.016 1.7 1.7 0 0 1 1.49-1.777 1.151 1.151 0 0 1 .843.379 1.951 1.951 0 0 1 .481 1.441 1.276 1.276 0 0 1-1.403 1.373Z" 56962 }) 56963 }); 56964 56965 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js 56966 /** 56967 * WordPress dependencies 56968 */ 56969 56970 56971 const SkypeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56972 width: "24", 56973 height: "24", 56974 viewBox: "0 0 24 24", 56975 version: "1.1", 56976 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56977 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" 56978 }) 56979 }); 56980 56981 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js 56982 /** 56983 * WordPress dependencies 56984 */ 56985 56986 56987 const SnapchatIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 56988 width: "24", 56989 height: "24", 56990 viewBox: "0 0 24 24", 56991 version: "1.1", 56992 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 56993 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" 56994 }) 56995 }); 56996 56997 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js 56998 /** 56999 * WordPress dependencies 57000 */ 57001 57002 57003 const SoundCloudIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57004 width: "24", 57005 height: "24", 57006 viewBox: "0 0 24 24", 57007 version: "1.1", 57008 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57009 d: "M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z" 57010 }) 57011 }); 57012 57013 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js 57014 /** 57015 * WordPress dependencies 57016 */ 57017 57018 57019 const SpotifyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57020 width: "24", 57021 height: "24", 57022 viewBox: "0 0 24 24", 57023 version: "1.1", 57024 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57025 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" 57026 }) 57027 }); 57028 57029 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js 57030 /** 57031 * WordPress dependencies 57032 */ 57033 57034 57035 const TelegramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57036 width: "24", 57037 height: "24", 57038 viewBox: "0 0 128 128", 57039 version: "1.1", 57040 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57041 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" 57042 }) 57043 }); 57044 57045 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/threads.js 57046 /** 57047 * WordPress dependencies 57048 */ 57049 57050 57051 const ThreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57052 width: "24", 57053 height: "24", 57054 viewBox: "0 0 24 24", 57055 version: "1.1", 57056 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57057 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" 57058 }) 57059 }); 57060 57061 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js 57062 /** 57063 * WordPress dependencies 57064 */ 57065 57066 57067 const TiktokIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57068 width: "24", 57069 height: "24", 57070 viewBox: "0 0 32 32", 57071 version: "1.1", 57072 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57073 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" 57074 }) 57075 }); 57076 57077 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js 57078 /** 57079 * WordPress dependencies 57080 */ 57081 57082 57083 const TumblrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57084 width: "24", 57085 height: "24", 57086 viewBox: "0 0 24 24", 57087 version: "1.1", 57088 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57089 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" 57090 }) 57091 }); 57092 57093 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js 57094 /** 57095 * WordPress dependencies 57096 */ 57097 57098 57099 const TwitchIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57100 width: "24", 57101 height: "24", 57102 viewBox: "0 0 24 24", 57103 version: "1.1", 57104 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57105 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" 57106 }) 57107 }); 57108 57109 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js 57110 /** 57111 * WordPress dependencies 57112 */ 57113 57114 57115 const TwitterIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57116 width: "24", 57117 height: "24", 57118 viewBox: "0 0 24 24", 57119 version: "1.1", 57120 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57121 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" 57122 }) 57123 }); 57124 57125 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js 57126 /** 57127 * WordPress dependencies 57128 */ 57129 57130 57131 const VimeoIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57132 width: "24", 57133 height: "24", 57134 viewBox: "0 0 24 24", 57135 version: "1.1", 57136 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57137 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" 57138 }) 57139 }); 57140 57141 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js 57142 /** 57143 * WordPress dependencies 57144 */ 57145 57146 57147 const VkIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57148 width: "24", 57149 height: "24", 57150 viewBox: "0 0 24 24", 57151 version: "1.1", 57152 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57153 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" 57154 }) 57155 }); 57156 57157 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/whatsapp.js 57158 /** 57159 * WordPress dependencies 57160 */ 57161 57162 57163 const WhatsAppIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57164 width: "24", 57165 height: "24", 57166 viewBox: "0 0 24 24", 57167 version: "1.1", 57168 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57169 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" 57170 }) 57171 }); 57172 57173 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/x.js 57174 /** 57175 * WordPress dependencies 57176 */ 57177 57178 57179 const XIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57180 width: "24", 57181 height: "24", 57182 viewBox: "0 0 24 24", 57183 version: "1.1", 57184 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57185 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" 57186 }) 57187 }); 57188 57189 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js 57190 /** 57191 * WordPress dependencies 57192 */ 57193 57194 57195 const YelpIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57196 width: "24", 57197 height: "24", 57198 viewBox: "0 0 24 24", 57199 version: "1.1", 57200 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57201 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" 57202 }) 57203 }); 57204 57205 ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js 57206 /** 57207 * WordPress dependencies 57208 */ 57209 57210 57211 const YouTubeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 57212 width: "24", 57213 height: "24", 57214 viewBox: "0 0 24 24", 57215 version: "1.1", 57216 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 57217 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" 57218 }) 57219 }); 57220 57221 ;// ./node_modules/@wordpress/block-library/build-module/social-link/variations.js 57222 /* wp:polyfill */ 57223 /** 57224 * Internal dependencies 57225 */ 57226 57227 const social_link_variations_variations = [{ 57228 isDefault: true, 57229 name: 'wordpress', 57230 attributes: { 57231 service: 'wordpress' 57232 }, 57233 title: 'WordPress', 57234 icon: WordPressIcon 57235 }, { 57236 name: 'fivehundredpx', 57237 attributes: { 57238 service: 'fivehundredpx' 57239 }, 57240 title: '500px', 57241 icon: FivehundredpxIcon 57242 }, { 57243 name: 'amazon', 57244 attributes: { 57245 service: 'amazon' 57246 }, 57247 title: 'Amazon', 57248 icon: AmazonIcon 57249 }, { 57250 name: 'bandcamp', 57251 attributes: { 57252 service: 'bandcamp' 57253 }, 57254 title: 'Bandcamp', 57255 icon: BandcampIcon 57256 }, { 57257 name: 'behance', 57258 attributes: { 57259 service: 'behance' 57260 }, 57261 title: 'Behance', 57262 icon: BehanceIcon 57263 }, { 57264 name: 'bluesky', 57265 attributes: { 57266 service: 'bluesky' 57267 }, 57268 title: 'Bluesky', 57269 icon: BlueskyIcon 57270 }, { 57271 name: 'chain', 57272 attributes: { 57273 service: 'chain' 57274 }, 57275 title: 'Link', 57276 icon: ChainIcon 57277 }, { 57278 name: 'codepen', 57279 attributes: { 57280 service: 'codepen' 57281 }, 57282 title: 'CodePen', 57283 icon: CodepenIcon 57284 }, { 57285 name: 'deviantart', 57286 attributes: { 57287 service: 'deviantart' 57288 }, 57289 title: 'DeviantArt', 57290 icon: DeviantArtIcon 57291 }, { 57292 name: 'dribbble', 57293 attributes: { 57294 service: 'dribbble' 57295 }, 57296 title: 'Dribbble', 57297 icon: DribbbleIcon 57298 }, { 57299 name: 'dropbox', 57300 attributes: { 57301 service: 'dropbox' 57302 }, 57303 title: 'Dropbox', 57304 icon: DropboxIcon 57305 }, { 57306 name: 'etsy', 57307 attributes: { 57308 service: 'etsy' 57309 }, 57310 title: 'Etsy', 57311 icon: EtsyIcon 57312 }, { 57313 name: 'facebook', 57314 attributes: { 57315 service: 'facebook' 57316 }, 57317 title: 'Facebook', 57318 icon: FacebookIcon 57319 }, { 57320 name: 'feed', 57321 attributes: { 57322 service: 'feed' 57323 }, 57324 title: 'RSS Feed', 57325 icon: FeedIcon 57326 }, { 57327 name: 'flickr', 57328 attributes: { 57329 service: 'flickr' 57330 }, 57331 title: 'Flickr', 57332 icon: FlickrIcon 57333 }, { 57334 name: 'foursquare', 57335 attributes: { 57336 service: 'foursquare' 57337 }, 57338 title: 'Foursquare', 57339 icon: FoursquareIcon 57340 }, { 57341 name: 'goodreads', 57342 attributes: { 57343 service: 'goodreads' 57344 }, 57345 title: 'Goodreads', 57346 icon: GoodreadsIcon 57347 }, { 57348 name: 'google', 57349 attributes: { 57350 service: 'google' 57351 }, 57352 title: 'Google', 57353 icon: GoogleIcon 57354 }, { 57355 name: 'github', 57356 attributes: { 57357 service: 'github' 57358 }, 57359 title: 'GitHub', 57360 icon: GitHubIcon 57361 }, { 57362 name: 'gravatar', 57363 attributes: { 57364 service: 'gravatar' 57365 }, 57366 title: 'Gravatar', 57367 icon: GravatarIcon 57368 }, { 57369 name: 'instagram', 57370 attributes: { 57371 service: 'instagram' 57372 }, 57373 title: 'Instagram', 57374 icon: InstagramIcon 57375 }, { 57376 name: 'lastfm', 57377 attributes: { 57378 service: 'lastfm' 57379 }, 57380 title: 'Last.fm', 57381 icon: LastfmIcon 57382 }, { 57383 name: 'linkedin', 57384 attributes: { 57385 service: 'linkedin' 57386 }, 57387 title: 'LinkedIn', 57388 icon: LinkedInIcon 57389 }, { 57390 name: 'mail', 57391 attributes: { 57392 service: 'mail' 57393 }, 57394 title: 'Mail', 57395 keywords: ['email', 'e-mail'], 57396 icon: MailIcon 57397 }, { 57398 name: 'mastodon', 57399 attributes: { 57400 service: 'mastodon' 57401 }, 57402 title: 'Mastodon', 57403 icon: MastodonIcon 57404 }, { 57405 name: 'meetup', 57406 attributes: { 57407 service: 'meetup' 57408 }, 57409 title: 'Meetup', 57410 icon: MeetupIcon 57411 }, { 57412 name: 'medium', 57413 attributes: { 57414 service: 'medium' 57415 }, 57416 title: 'Medium', 57417 icon: MediumIcon 57418 }, { 57419 name: 'patreon', 57420 attributes: { 57421 service: 'patreon' 57422 }, 57423 title: 'Patreon', 57424 icon: PatreonIcon 57425 }, { 57426 name: 'pinterest', 57427 attributes: { 57428 service: 'pinterest' 57429 }, 57430 title: 'Pinterest', 57431 icon: PinterestIcon 57432 }, { 57433 name: 'pocket', 57434 attributes: { 57435 service: 'pocket' 57436 }, 57437 title: 'Pocket', 57438 icon: PocketIcon 57439 }, { 57440 name: 'reddit', 57441 attributes: { 57442 service: 'reddit' 57443 }, 57444 title: 'Reddit', 57445 icon: RedditIcon 57446 }, { 57447 name: 'skype', 57448 attributes: { 57449 service: 'skype' 57450 }, 57451 title: 'Skype', 57452 icon: SkypeIcon 57453 }, { 57454 name: 'snapchat', 57455 attributes: { 57456 service: 'snapchat' 57457 }, 57458 title: 'Snapchat', 57459 icon: SnapchatIcon 57460 }, { 57461 name: 'soundcloud', 57462 attributes: { 57463 service: 'soundcloud' 57464 }, 57465 title: 'SoundCloud', 57466 icon: SoundCloudIcon 57467 }, { 57468 name: 'spotify', 57469 attributes: { 57470 service: 'spotify' 57471 }, 57472 title: 'Spotify', 57473 icon: SpotifyIcon 57474 }, { 57475 name: 'telegram', 57476 attributes: { 57477 service: 'telegram' 57478 }, 57479 title: 'Telegram', 57480 icon: TelegramIcon 57481 }, { 57482 name: 'threads', 57483 attributes: { 57484 service: 'threads' 57485 }, 57486 title: 'Threads', 57487 icon: ThreadsIcon 57488 }, { 57489 name: 'tiktok', 57490 attributes: { 57491 service: 'tiktok' 57492 }, 57493 title: 'TikTok', 57494 icon: TiktokIcon 57495 }, { 57496 name: 'tumblr', 57497 attributes: { 57498 service: 'tumblr' 57499 }, 57500 title: 'Tumblr', 57501 icon: TumblrIcon 57502 }, { 57503 name: 'twitch', 57504 attributes: { 57505 service: 'twitch' 57506 }, 57507 title: 'Twitch', 57508 icon: TwitchIcon 57509 }, { 57510 name: 'twitter', 57511 attributes: { 57512 service: 'twitter' 57513 }, 57514 title: 'Twitter', 57515 icon: TwitterIcon 57516 }, { 57517 name: 'vimeo', 57518 attributes: { 57519 service: 'vimeo' 57520 }, 57521 title: 'Vimeo', 57522 icon: VimeoIcon 57523 }, { 57524 name: 'vk', 57525 attributes: { 57526 service: 'vk' 57527 }, 57528 title: 'VK', 57529 icon: VkIcon 57530 }, { 57531 name: 'whatsapp', 57532 attributes: { 57533 service: 'whatsapp' 57534 }, 57535 title: 'WhatsApp', 57536 icon: WhatsAppIcon 57537 }, { 57538 name: 'x', 57539 attributes: { 57540 service: 'x' 57541 }, 57542 keywords: ['twitter'], 57543 title: 'X', 57544 icon: XIcon 57545 }, { 57546 name: 'yelp', 57547 attributes: { 57548 service: 'yelp' 57549 }, 57550 title: 'Yelp', 57551 icon: YelpIcon 57552 }, { 57553 name: 'youtube', 57554 attributes: { 57555 service: 'youtube' 57556 }, 57557 title: 'YouTube', 57558 icon: YouTubeIcon 57559 }]; 57560 57561 /** 57562 * Add `isActive` function to all `social link` variations, if not defined. 57563 * `isActive` function is used to find a variation match from a created 57564 * Block by providing its attributes. 57565 */ 57566 social_link_variations_variations.forEach(variation => { 57567 if (variation.isActive) { 57568 return; 57569 } 57570 variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service; 57571 }); 57572 /* harmony default export */ const social_link_variations = (social_link_variations_variations); 57573 57574 ;// ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js 57575 /* wp:polyfill */ 57576 /** 57577 * WordPress dependencies 57578 */ 57579 57580 57581 /** 57582 * Internal dependencies 57583 */ 57584 57585 57586 57587 /** 57588 * Retrieves the social service's icon component. 57589 * 57590 * @param {string} name key for a social service (lowercase slug) 57591 * 57592 * @return {Component} Icon component for social service. 57593 */ 57594 const getIconBySite = name => { 57595 const variation = social_link_variations.find(v => v.name === name); 57596 return variation ? variation.icon : ChainIcon; 57597 }; 57598 57599 /** 57600 * Retrieves the display name for the social service. 57601 * 57602 * @param {string} name key for a social service (lowercase slug) 57603 * 57604 * @return {string} Display name for social service 57605 */ 57606 const getNameBySite = name => { 57607 const variation = social_link_variations.find(v => v.name === name); 57608 return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon'); 57609 }; 57610 57611 ;// ./node_modules/@wordpress/block-library/build-module/social-link/edit.js 57612 /** 57613 * External dependencies 57614 */ 57615 57616 57617 /** 57618 * WordPress dependencies 57619 */ 57620 57621 57622 57623 57624 57625 57626 57627 57628 57629 /** 57630 * Internal dependencies 57631 */ 57632 57633 57634 57635 const SocialLinkURLPopover = ({ 57636 url, 57637 setAttributes, 57638 setPopover, 57639 popoverAnchor, 57640 clientId 57641 }) => { 57642 const { 57643 removeBlock 57644 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 57645 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLPopover, { 57646 anchor: popoverAnchor, 57647 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Edit social link'), 57648 onClose: () => { 57649 setPopover(false); 57650 popoverAnchor?.focus(); 57651 }, 57652 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { 57653 className: "block-editor-url-popover__link-editor", 57654 onSubmit: event => { 57655 event.preventDefault(); 57656 setPopover(false); 57657 popoverAnchor?.focus(); 57658 }, 57659 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 57660 className: "block-editor-url-input", 57661 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLInput, { 57662 value: url, 57663 onChange: nextURL => setAttributes({ 57664 url: nextURL 57665 }), 57666 placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter social link'), 57667 label: (0,external_wp_i18n_namespaceObject.__)('Enter social link'), 57668 hideLabelFromVision: true, 57669 disableSuggestions: true, 57670 onKeyDown: event => { 57671 if (!!url || event.defaultPrevented || ![external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode)) { 57672 return; 57673 } 57674 removeBlock(clientId); 57675 }, 57676 suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { 57677 variant: "control", 57678 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 57679 icon: keyboard_return, 57680 label: (0,external_wp_i18n_namespaceObject.__)('Apply'), 57681 type: "submit", 57682 size: "small" 57683 }) 57684 }) 57685 }) 57686 }) 57687 }) 57688 }); 57689 }; 57690 const SocialLinkEdit = ({ 57691 attributes, 57692 context, 57693 isSelected, 57694 setAttributes, 57695 clientId 57696 }) => { 57697 const { 57698 url, 57699 service, 57700 label = '', 57701 rel 57702 } = attributes; 57703 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 57704 const { 57705 showLabels, 57706 iconColor, 57707 iconColorValue, 57708 iconBackgroundColor, 57709 iconBackgroundColorValue 57710 } = context; 57711 const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false); 57712 const wrapperClasses = dist_clsx('wp-social-link', 57713 // Manually adding this class for backwards compatibility of CSS when moving the 57714 // blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883 57715 'wp-block-social-link', 'wp-social-link-' + service, { 57716 'wp-social-link__is-incomplete': !url, 57717 [`has-$iconColor}-color`]: iconColor, 57718 [`has-$iconBackgroundColor}-background-color`]: iconBackgroundColor 57719 }); 57720 57721 // Use internal state instead of a ref to make sure that the component 57722 // re-renders when the popover's anchor updates. 57723 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); 57724 const isContentOnlyMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)() === 'contentOnly'; 57725 const IconComponent = getIconBySite(service); 57726 const socialLinkName = getNameBySite(service); 57727 // The initial label (ie. the link text) is an empty string. 57728 // We want to prevent empty links so that the link text always fallbacks to 57729 // the social name, even when users enter and save an empty string or only 57730 // spaces. The PHP render callback fallbacks to the social name as well. 57731 const socialLinkText = label.trim() === '' ? socialLinkName : label; 57732 const ref = (0,external_wp_element_namespaceObject.useRef)(); 57733 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 57734 className: 'wp-block-social-link-anchor', 57735 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), 57736 onClick: () => setPopover(true), 57737 onKeyDown: event => { 57738 if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { 57739 event.preventDefault(); 57740 setPopover(true); 57741 } 57742 } 57743 }); 57744 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 57745 children: [isContentOnlyMode && showLabels && 57746 /*#__PURE__*/ 57747 // Add an extra control to modify the label attribute when content only mode is active. 57748 // With content only mode active, the inspector is hidden, so users need another way 57749 // to edit this attribute. 57750 (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 57751 group: "other", 57752 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { 57753 popoverProps: { 57754 position: 'bottom right' 57755 }, 57756 renderToggle: ({ 57757 isOpen, 57758 onToggle 57759 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 57760 onClick: onToggle, 57761 "aria-haspopup": "true", 57762 "aria-expanded": isOpen, 57763 children: (0,external_wp_i18n_namespaceObject.__)('Text') 57764 }), 57765 renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 57766 __next40pxDefaultSize: true, 57767 __nextHasNoMarginBottom: true, 57768 className: "wp-block-social-link__toolbar_content_text", 57769 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 57770 help: (0,external_wp_i18n_namespaceObject.__)('Provide a text label or use the default.'), 57771 value: label, 57772 onChange: value => setAttributes({ 57773 label: value 57774 }), 57775 placeholder: socialLinkName 57776 }) 57777 }) 57778 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 57779 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 57780 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 57781 resetAll: () => { 57782 setAttributes({ 57783 label: undefined 57784 }); 57785 }, 57786 dropdownMenuProps: dropdownMenuProps, 57787 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 57788 isShownByDefault: true, 57789 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 57790 hasValue: () => !!label, 57791 onDeselect: () => { 57792 setAttributes({ 57793 label: undefined 57794 }); 57795 }, 57796 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 57797 __next40pxDefaultSize: true, 57798 __nextHasNoMarginBottom: true, 57799 label: (0,external_wp_i18n_namespaceObject.__)('Text'), 57800 help: (0,external_wp_i18n_namespaceObject.__)('The text is visible when enabled from the parent Social Icons block.'), 57801 value: label, 57802 onChange: value => setAttributes({ 57803 label: value 57804 }), 57805 placeholder: socialLinkName 57806 }) 57807 }) 57808 }) 57809 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 57810 group: "advanced", 57811 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 57812 __next40pxDefaultSize: true, 57813 __nextHasNoMarginBottom: true, 57814 label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), 57815 value: rel || '', 57816 onChange: value => setAttributes({ 57817 rel: value 57818 }) 57819 }) 57820 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 57821 role: "presentation", 57822 className: wrapperClasses, 57823 style: { 57824 color: iconColorValue, 57825 backgroundColor: iconBackgroundColorValue 57826 }, 57827 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { 57828 "aria-haspopup": "dialog", 57829 ...blockProps, 57830 role: "button", 57831 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IconComponent, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 57832 className: dist_clsx('wp-block-social-link-label', { 57833 'screen-reader-text': !showLabels 57834 }), 57835 children: socialLinkText 57836 })] 57837 }), isSelected && showURLPopover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SocialLinkURLPopover, { 57838 url: url, 57839 setAttributes: setAttributes, 57840 setPopover: setPopover, 57841 popoverAnchor: popoverAnchor, 57842 clientId: clientId 57843 })] 57844 })] 57845 }); 57846 }; 57847 /* harmony default export */ const social_link_edit = (SocialLinkEdit); 57848 57849 ;// ./node_modules/@wordpress/block-library/build-module/social-link/index.js 57850 /** 57851 * WordPress dependencies 57852 */ 57853 57854 57855 /** 57856 * Internal dependencies 57857 */ 57858 57859 57860 const social_link_metadata = { 57861 $schema: "https://schemas.wp.org/trunk/block.json", 57862 apiVersion: 3, 57863 name: "core/social-link", 57864 title: "Social Icon", 57865 category: "widgets", 57866 parent: ["core/social-links"], 57867 description: "Display an icon linking to a social profile or site.", 57868 textdomain: "default", 57869 attributes: { 57870 url: { 57871 type: "string", 57872 role: "content" 57873 }, 57874 service: { 57875 type: "string" 57876 }, 57877 label: { 57878 type: "string", 57879 role: "content" 57880 }, 57881 rel: { 57882 type: "string" 57883 } 57884 }, 57885 usesContext: ["openInNewTab", "showLabels", "iconColor", "iconColorValue", "iconBackgroundColor", "iconBackgroundColorValue"], 57886 supports: { 57887 reusable: false, 57888 html: false, 57889 interactivity: { 57890 clientNavigation: true 57891 } 57892 }, 57893 editorStyle: "wp-block-social-link-editor" 57894 }; 57895 57896 const { 57897 name: social_link_name 57898 } = social_link_metadata; 57899 57900 const social_link_settings = { 57901 icon: library_share, 57902 edit: social_link_edit, 57903 variations: social_link_variations 57904 }; 57905 const social_link_init = () => initBlock({ 57906 name: social_link_name, 57907 metadata: social_link_metadata, 57908 settings: social_link_settings 57909 }); 57910 57911 ;// ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js 57912 /** 57913 * External dependencies 57914 */ 57915 57916 57917 /** 57918 * WordPress dependencies 57919 */ 57920 57921 57922 /** 57923 * The specific handling by `className` below is needed because `itemsJustification` 57924 * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't 57925 * declared in block.json. 57926 * 57927 * @param {Object} attributes Block's attributes. 57928 */ 57929 57930 const social_links_deprecated_migrateWithLayout = attributes => { 57931 if (!!attributes.layout) { 57932 return attributes; 57933 } 57934 const { 57935 className 57936 } = attributes; 57937 // Matches classes with `items-justified-` prefix. 57938 const prefix = `items-justified-`; 57939 const justifiedItemsRegex = new RegExp(`\\b$prefix}[^ ]*[ ]?\\b`, 'g'); 57940 const newAttributes = { 57941 ...attributes, 57942 className: className?.replace(justifiedItemsRegex, '').trim() 57943 }; 57944 /** 57945 * Add `layout` prop only if `justifyContent` is defined, for backwards 57946 * compatibility. In other cases the block's default layout will be used. 57947 * Also noting that due to the missing attribute, it's possible for a block 57948 * to have more than one of `justified` classes. 57949 */ 57950 const justifyContent = className?.match(justifiedItemsRegex)?.[0]?.trim(); 57951 if (justifyContent) { 57952 Object.assign(newAttributes, { 57953 layout: { 57954 type: 'flex', 57955 justifyContent: justifyContent.slice(prefix.length) 57956 } 57957 }); 57958 } 57959 return newAttributes; 57960 }; 57961 57962 // Social Links block deprecations. 57963 const social_links_deprecated_deprecated = [ 57964 // V1. Remove CSS variable use for colors. 57965 { 57966 attributes: { 57967 iconColor: { 57968 type: 'string' 57969 }, 57970 customIconColor: { 57971 type: 'string' 57972 }, 57973 iconColorValue: { 57974 type: 'string' 57975 }, 57976 iconBackgroundColor: { 57977 type: 'string' 57978 }, 57979 customIconBackgroundColor: { 57980 type: 'string' 57981 }, 57982 iconBackgroundColorValue: { 57983 type: 'string' 57984 }, 57985 openInNewTab: { 57986 type: 'boolean', 57987 default: false 57988 }, 57989 size: { 57990 type: 'string' 57991 } 57992 }, 57993 providesContext: { 57994 openInNewTab: 'openInNewTab' 57995 }, 57996 supports: { 57997 align: ['left', 'center', 'right'], 57998 anchor: true 57999 }, 58000 migrate: social_links_deprecated_migrateWithLayout, 58001 save: props => { 58002 const { 58003 attributes: { 58004 iconBackgroundColorValue, 58005 iconColorValue, 58006 itemsJustification, 58007 size 58008 } 58009 } = props; 58010 const className = dist_clsx(size, { 58011 'has-icon-color': iconColorValue, 58012 'has-icon-background-color': iconBackgroundColorValue, 58013 [`items-justified-$itemsJustification}`]: itemsJustification 58014 }); 58015 const style = { 58016 '--wp--social-links--icon-color': iconColorValue, 58017 '--wp--social-links--icon-background-color': iconBackgroundColorValue 58018 }; 58019 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 58020 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 58021 className, 58022 style 58023 }), 58024 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) 58025 }); 58026 } 58027 }]; 58028 /* harmony default export */ const social_links_deprecated = (social_links_deprecated_deprecated); 58029 58030 ;// ./node_modules/@wordpress/icons/build-module/library/check.js 58031 /** 58032 * WordPress dependencies 58033 */ 58034 58035 58036 const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 58037 xmlns: "http://www.w3.org/2000/svg", 58038 viewBox: "0 0 24 24", 58039 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 58040 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" 58041 }) 58042 }); 58043 /* harmony default export */ const library_check = (check); 58044 58045 ;// ./node_modules/@wordpress/block-library/build-module/social-links/edit.js 58046 /* wp:polyfill */ 58047 /** 58048 * External dependencies 58049 */ 58050 58051 58052 /** 58053 * WordPress dependencies 58054 */ 58055 58056 58057 58058 58059 58060 58061 58062 /** 58063 * Internal dependencies 58064 */ 58065 58066 58067 const sizeOptions = [{ 58068 name: (0,external_wp_i18n_namespaceObject.__)('Small'), 58069 value: 'has-small-icon-size' 58070 }, { 58071 name: (0,external_wp_i18n_namespaceObject.__)('Normal'), 58072 value: 'has-normal-icon-size' 58073 }, { 58074 name: (0,external_wp_i18n_namespaceObject.__)('Large'), 58075 value: 'has-large-icon-size' 58076 }, { 58077 name: (0,external_wp_i18n_namespaceObject.__)('Huge'), 58078 value: 'has-huge-icon-size' 58079 }]; 58080 function SocialLinksEdit(props) { 58081 var _attributes$layout$or; 58082 const { 58083 clientId, 58084 attributes, 58085 iconBackgroundColor, 58086 iconColor, 58087 isSelected, 58088 setAttributes, 58089 setIconBackgroundColor, 58090 setIconColor 58091 } = props; 58092 const { 58093 iconBackgroundColorValue, 58094 customIconBackgroundColor, 58095 iconColorValue, 58096 openInNewTab, 58097 showLabels, 58098 size 58099 } = attributes; 58100 const hasSelectedChild = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).hasSelectedInnerBlock(clientId), [clientId]); 58101 const hasAnySelected = isSelected || hasSelectedChild; 58102 const logosOnly = attributes.className?.includes('is-style-logos-only'); 58103 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 58104 58105 // Remove icon background color when logos only style is selected or 58106 // restore it when any other style is selected. 58107 const backgroundBackupRef = (0,external_wp_element_namespaceObject.useRef)({}); 58108 (0,external_wp_element_namespaceObject.useEffect)(() => { 58109 if (logosOnly) { 58110 backgroundBackupRef.current = { 58111 iconBackgroundColor, 58112 iconBackgroundColorValue, 58113 customIconBackgroundColor 58114 }; 58115 setAttributes({ 58116 iconBackgroundColor: undefined, 58117 customIconBackgroundColor: undefined, 58118 iconBackgroundColorValue: undefined 58119 }); 58120 } else { 58121 setAttributes({ 58122 ...backgroundBackupRef.current 58123 }); 58124 } 58125 }, [logosOnly]); 58126 const SocialPlaceholder = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { 58127 className: "wp-block-social-links__social-placeholder", 58128 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 58129 className: "wp-block-social-links__social-placeholder-icons", 58130 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 58131 className: "wp-social-link wp-social-link-twitter" 58132 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 58133 className: "wp-social-link wp-social-link-facebook" 58134 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 58135 className: "wp-social-link wp-social-link-instagram" 58136 })] 58137 }) 58138 }); 58139 58140 // Fallback color values are used maintain selections in case switching 58141 // themes and named colors in palette do not match. 58142 const className = dist_clsx(size, { 58143 'has-visible-labels': showLabels, 58144 'has-icon-color': iconColor.color || iconColorValue, 58145 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue 58146 }); 58147 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 58148 className 58149 }); 58150 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 58151 placeholder: !isSelected && SocialPlaceholder, 58152 templateLock: false, 58153 orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal', 58154 __experimentalAppenderTagName: 'li', 58155 renderAppender: hasAnySelected && external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 58156 }); 58157 const POPOVER_PROPS = { 58158 position: 'bottom right' 58159 }; 58160 const colorSettings = [{ 58161 // Use custom attribute as fallback to prevent loss of named color selection when 58162 // switching themes to a new theme that does not have a matching named color. 58163 value: iconColor.color || iconColorValue, 58164 onChange: colorValue => { 58165 setIconColor(colorValue); 58166 setAttributes({ 58167 iconColorValue: colorValue 58168 }); 58169 }, 58170 label: (0,external_wp_i18n_namespaceObject.__)('Icon color'), 58171 resetAllFilter: () => { 58172 setIconColor(undefined); 58173 setAttributes({ 58174 iconColorValue: undefined 58175 }); 58176 } 58177 }]; 58178 if (!logosOnly) { 58179 colorSettings.push({ 58180 // Use custom attribute as fallback to prevent loss of named color selection when 58181 // switching themes to a new theme that does not have a matching named color. 58182 value: iconBackgroundColor.color || iconBackgroundColorValue, 58183 onChange: colorValue => { 58184 setIconBackgroundColor(colorValue); 58185 setAttributes({ 58186 iconBackgroundColorValue: colorValue 58187 }); 58188 }, 58189 label: (0,external_wp_i18n_namespaceObject.__)('Icon background'), 58190 resetAllFilter: () => { 58191 setIconBackgroundColor(undefined); 58192 setAttributes({ 58193 iconBackgroundColorValue: undefined 58194 }); 58195 } 58196 }); 58197 } 58198 const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); 58199 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 58200 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 58201 group: "other", 58202 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 58203 label: (0,external_wp_i18n_namespaceObject.__)('Size'), 58204 text: (0,external_wp_i18n_namespaceObject.__)('Size'), 58205 icon: null, 58206 popoverProps: POPOVER_PROPS, 58207 children: ({ 58208 onClose 58209 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 58210 children: sizeOptions.map(entry => { 58211 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 58212 icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check, 58213 isSelected: size === entry.value, 58214 onClick: () => { 58215 setAttributes({ 58216 size: entry.value 58217 }); 58218 }, 58219 onClose: onClose, 58220 role: "menuitemradio", 58221 children: entry.name 58222 }, entry.value); 58223 }) 58224 }) 58225 }) 58226 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 58227 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 58228 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 58229 resetAll: () => { 58230 setAttributes({ 58231 openInNewTab: false, 58232 showLabels: false 58233 }); 58234 }, 58235 dropdownMenuProps: dropdownMenuProps, 58236 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 58237 isShownByDefault: true, 58238 label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'), 58239 hasValue: () => !!openInNewTab, 58240 onDeselect: () => setAttributes({ 58241 openInNewTab: false 58242 }), 58243 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 58244 __nextHasNoMarginBottom: true, 58245 label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'), 58246 checked: openInNewTab, 58247 onChange: () => setAttributes({ 58248 openInNewTab: !openInNewTab 58249 }) 58250 }) 58251 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 58252 isShownByDefault: true, 58253 label: (0,external_wp_i18n_namespaceObject.__)('Show text'), 58254 hasValue: () => !!showLabels, 58255 onDeselect: () => setAttributes({ 58256 showLabels: false 58257 }), 58258 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 58259 __nextHasNoMarginBottom: true, 58260 label: (0,external_wp_i18n_namespaceObject.__)('Show text'), 58261 checked: showLabels, 58262 onChange: () => setAttributes({ 58263 showLabels: !showLabels 58264 }) 58265 }) 58266 })] 58267 }) 58268 }), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { 58269 group: "color", 58270 children: [colorSettings.map(({ 58271 onChange, 58272 label, 58273 value, 58274 resetAllFilter 58275 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { 58276 __experimentalIsRenderedInSidebar: true, 58277 settings: [{ 58278 colorValue: value, 58279 label, 58280 onColorChange: onChange, 58281 isShownByDefault: true, 58282 resetAllFilter, 58283 enableAlpha: true, 58284 clearable: true 58285 }], 58286 panelId: clientId, 58287 ...colorGradientSettings 58288 }, `social-links-color-$label}`)), !logosOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { 58289 textColor: iconColorValue, 58290 backgroundColor: iconBackgroundColorValue, 58291 isLargeText: false 58292 })] 58293 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 58294 ...innerBlocksProps 58295 })] 58296 }); 58297 } 58298 const iconColorAttributes = { 58299 iconColor: 'icon-color', 58300 iconBackgroundColor: 'icon-background-color' 58301 }; 58302 /* harmony default export */ const social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit)); 58303 58304 ;// ./node_modules/@wordpress/block-library/build-module/social-links/save.js 58305 /** 58306 * External dependencies 58307 */ 58308 58309 58310 /** 58311 * WordPress dependencies 58312 */ 58313 58314 58315 function social_links_save_save(props) { 58316 const { 58317 attributes: { 58318 iconBackgroundColorValue, 58319 iconColorValue, 58320 showLabels, 58321 size 58322 } 58323 } = props; 58324 const className = dist_clsx(size, { 58325 'has-visible-labels': showLabels, 58326 'has-icon-color': iconColorValue, 58327 'has-icon-background-color': iconBackgroundColorValue 58328 }); 58329 const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ 58330 className 58331 }); 58332 const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); 58333 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { 58334 ...innerBlocksProps 58335 }); 58336 } 58337 58338 ;// ./node_modules/@wordpress/block-library/build-module/social-links/index.js 58339 /** 58340 * WordPress dependencies 58341 */ 58342 58343 58344 /** 58345 * Internal dependencies 58346 */ 58347 58348 58349 58350 const social_links_metadata = { 58351 $schema: "https://schemas.wp.org/trunk/block.json", 58352 apiVersion: 3, 58353 name: "core/social-links", 58354 title: "Social Icons", 58355 category: "widgets", 58356 allowedBlocks: ["core/social-link"], 58357 description: "Display icons linking to your social profiles or sites.", 58358 keywords: ["links"], 58359 textdomain: "default", 58360 attributes: { 58361 iconColor: { 58362 type: "string" 58363 }, 58364 customIconColor: { 58365 type: "string" 58366 }, 58367 iconColorValue: { 58368 type: "string" 58369 }, 58370 iconBackgroundColor: { 58371 type: "string" 58372 }, 58373 customIconBackgroundColor: { 58374 type: "string" 58375 }, 58376 iconBackgroundColorValue: { 58377 type: "string" 58378 }, 58379 openInNewTab: { 58380 type: "boolean", 58381 "default": false 58382 }, 58383 showLabels: { 58384 type: "boolean", 58385 "default": false 58386 }, 58387 size: { 58388 type: "string" 58389 } 58390 }, 58391 providesContext: { 58392 openInNewTab: "openInNewTab", 58393 showLabels: "showLabels", 58394 iconColor: "iconColor", 58395 iconColorValue: "iconColorValue", 58396 iconBackgroundColor: "iconBackgroundColor", 58397 iconBackgroundColorValue: "iconBackgroundColorValue" 58398 }, 58399 supports: { 58400 align: ["left", "center", "right"], 58401 anchor: true, 58402 __experimentalExposeControlsToChildren: true, 58403 layout: { 58404 allowSwitching: false, 58405 allowInheriting: false, 58406 allowVerticalAlignment: false, 58407 "default": { 58408 type: "flex" 58409 } 58410 }, 58411 color: { 58412 enableContrastChecker: false, 58413 background: true, 58414 gradients: true, 58415 text: false, 58416 __experimentalDefaultControls: { 58417 background: false 58418 } 58419 }, 58420 spacing: { 58421 blockGap: ["horizontal", "vertical"], 58422 margin: true, 58423 padding: true, 58424 units: ["px", "em", "rem", "vh", "vw"], 58425 __experimentalDefaultControls: { 58426 blockGap: true, 58427 margin: true, 58428 padding: false 58429 } 58430 }, 58431 interactivity: { 58432 clientNavigation: true 58433 }, 58434 __experimentalBorder: { 58435 radius: true, 58436 color: true, 58437 width: true, 58438 style: true, 58439 __experimentalDefaultControls: { 58440 radius: true, 58441 color: true, 58442 width: true, 58443 style: true 58444 } 58445 } 58446 }, 58447 styles: [{ 58448 name: "default", 58449 label: "Default", 58450 isDefault: true 58451 }, { 58452 name: "logos-only", 58453 label: "Logos Only" 58454 }, { 58455 name: "pill-shape", 58456 label: "Pill Shape" 58457 }], 58458 editorStyle: "wp-block-social-links-editor", 58459 style: "wp-block-social-links" 58460 }; 58461 58462 const { 58463 name: social_links_name 58464 } = social_links_metadata; 58465 58466 const social_links_settings = { 58467 example: { 58468 innerBlocks: [{ 58469 name: 'core/social-link', 58470 attributes: { 58471 service: 'wordpress', 58472 url: 'https://wordpress.org' 58473 } 58474 }, { 58475 name: 'core/social-link', 58476 attributes: { 58477 service: 'facebook', 58478 url: 'https://www.facebook.com/WordPress/' 58479 } 58480 }, { 58481 name: 'core/social-link', 58482 attributes: { 58483 service: 'twitter', 58484 url: 'https://twitter.com/WordPress' 58485 } 58486 }] 58487 }, 58488 icon: library_share, 58489 edit: social_links_edit, 58490 save: social_links_save_save, 58491 deprecated: social_links_deprecated 58492 }; 58493 const social_links_init = () => initBlock({ 58494 name: social_links_name, 58495 metadata: social_links_metadata, 58496 settings: social_links_settings 58497 }); 58498 58499 ;// ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js 58500 /** 58501 * WordPress dependencies 58502 */ 58503 58504 58505 const resizeCornerNE = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 58506 viewBox: "0 0 24 24", 58507 xmlns: "http://www.w3.org/2000/svg", 58508 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 58509 d: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z" 58510 }) 58511 }); 58512 /* harmony default export */ const resize_corner_n_e = (resizeCornerNE); 58513 58514 ;// ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js 58515 /** 58516 * WordPress dependencies 58517 */ 58518 58519 58520 const spacer_deprecated_deprecated = [{ 58521 attributes: { 58522 height: { 58523 type: 'number', 58524 default: 100 58525 }, 58526 width: { 58527 type: 'number' 58528 } 58529 }, 58530 migrate(attributes) { 58531 const { 58532 height, 58533 width 58534 } = attributes; 58535 return { 58536 ...attributes, 58537 width: width !== undefined ? `$width}px` : undefined, 58538 height: height !== undefined ? `$height}px` : undefined 58539 }; 58540 }, 58541 save({ 58542 attributes 58543 }) { 58544 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 58545 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 58546 style: { 58547 height: attributes.height, 58548 width: attributes.width 58549 }, 58550 'aria-hidden': true 58551 }) 58552 }); 58553 } 58554 }]; 58555 /* harmony default export */ const spacer_deprecated = (spacer_deprecated_deprecated); 58556 58557 ;// ./node_modules/@wordpress/block-library/build-module/spacer/constants.js 58558 const MIN_SPACER_SIZE = 0; 58559 58560 ;// ./node_modules/@wordpress/block-library/build-module/spacer/controls.js 58561 /* wp:polyfill */ 58562 /** 58563 * WordPress dependencies 58564 */ 58565 58566 58567 58568 58569 58570 58571 /** 58572 * Internal dependencies 58573 */ 58574 58575 58576 58577 58578 const { 58579 useSpacingSizes 58580 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 58581 function DimensionInput({ 58582 label, 58583 onChange, 58584 isResizing, 58585 value = '' 58586 }) { 58587 const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); 58588 const spacingSizes = useSpacingSizes(); 58589 const [spacingUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 58590 // In most contexts the spacer size cannot meaningfully be set to a 58591 // percentage, since this is relative to the parent container. This 58592 // unit is disabled from the UI. 58593 const availableUnits = spacingUnits ? spacingUnits.filter(unit => unit !== '%') : ['px', 'em', 'rem', 'vw', 'vh']; 58594 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 58595 availableUnits, 58596 defaultValues: { 58597 px: 100, 58598 em: 10, 58599 rem: 10, 58600 vw: 10, 58601 vh: 25 58602 } 58603 }); 58604 58605 // Force the unit to update to `px` when the Spacer is being resized. 58606 const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); 58607 const computedValue = (0,external_wp_blockEditor_namespaceObject.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? 'px' : parsedUnit].join(''); 58608 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 58609 children: spacingSizes?.length < 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 58610 id: inputId, 58611 isResetValueOnUnitChange: true, 58612 min: MIN_SPACER_SIZE, 58613 onChange: onChange, 58614 value: computedValue, 58615 units: units, 58616 label: label, 58617 __next40pxDefaultSize: true 58618 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { 58619 className: "tools-panel-item-spacing", 58620 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalSpacingSizesControl, { 58621 values: { 58622 all: computedValue 58623 }, 58624 onChange: ({ 58625 all 58626 }) => { 58627 onChange(all); 58628 }, 58629 label: label, 58630 sides: ['all'], 58631 units: units, 58632 allowReset: false, 58633 splitOnAxis: false, 58634 showSideInLabel: false 58635 }) 58636 }) 58637 }); 58638 } 58639 function SpacerControls({ 58640 setAttributes, 58641 orientation, 58642 height, 58643 width, 58644 isResizing 58645 }) { 58646 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 58647 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 58648 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 58649 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 58650 resetAll: () => { 58651 setAttributes({ 58652 width: undefined, 58653 height: '100px' 58654 }); 58655 }, 58656 dropdownMenuProps: dropdownMenuProps, 58657 children: [orientation === 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 58658 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 58659 isShownByDefault: true, 58660 hasValue: () => width !== undefined, 58661 onDeselect: () => setAttributes({ 58662 width: undefined 58663 }), 58664 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, { 58665 label: (0,external_wp_i18n_namespaceObject.__)('Width'), 58666 value: width, 58667 onChange: nextWidth => setAttributes({ 58668 width: nextWidth 58669 }), 58670 isResizing: isResizing 58671 }) 58672 }), orientation !== 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 58673 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 58674 isShownByDefault: true, 58675 hasValue: () => height !== '100px', 58676 onDeselect: () => setAttributes({ 58677 height: '100px' 58678 }), 58679 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, { 58680 label: (0,external_wp_i18n_namespaceObject.__)('Height'), 58681 value: height, 58682 onChange: nextHeight => setAttributes({ 58683 height: nextHeight 58684 }), 58685 isResizing: isResizing 58686 }) 58687 })] 58688 }) 58689 }); 58690 } 58691 58692 ;// ./node_modules/@wordpress/block-library/build-module/spacer/edit.js 58693 /** 58694 * External dependencies 58695 */ 58696 58697 58698 /** 58699 * WordPress dependencies 58700 */ 58701 58702 58703 58704 58705 58706 58707 /** 58708 * Internal dependencies 58709 */ 58710 58711 58712 58713 58714 const { 58715 useSpacingSizes: edit_useSpacingSizes 58716 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 58717 const ResizableSpacer = ({ 58718 orientation, 58719 onResizeStart, 58720 onResize, 58721 onResizeStop, 58722 isSelected, 58723 isResizing, 58724 setIsResizing, 58725 ...props 58726 }) => { 58727 const getCurrentSize = elt => { 58728 return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight; 58729 }; 58730 const getNextVal = elt => { 58731 return `$getCurrentSize(elt)}px`; 58732 }; 58733 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { 58734 className: dist_clsx('block-library-spacer__resize-container', { 58735 'resize-horizontal': orientation === 'horizontal', 58736 'is-resizing': isResizing, 58737 'is-selected': isSelected 58738 }), 58739 onResizeStart: (_event, _direction, elt) => { 58740 const nextVal = getNextVal(elt); 58741 onResizeStart(nextVal); 58742 onResize(nextVal); 58743 }, 58744 onResize: (_event, _direction, elt) => { 58745 onResize(getNextVal(elt)); 58746 if (!isResizing) { 58747 setIsResizing(true); 58748 } 58749 }, 58750 onResizeStop: (_event, _direction, elt) => { 58751 const nextVal = getCurrentSize(elt); 58752 onResizeStop(`$nextVal}px`); 58753 setIsResizing(false); 58754 }, 58755 __experimentalShowTooltip: true, 58756 __experimentalTooltipProps: { 58757 axis: orientation === 'horizontal' ? 'x' : 'y', 58758 position: 'corner', 58759 isVisible: isResizing 58760 }, 58761 showHandle: isSelected, 58762 ...props 58763 }); 58764 }; 58765 const SpacerEdit = ({ 58766 attributes, 58767 isSelected, 58768 setAttributes, 58769 toggleSelection, 58770 context, 58771 __unstableParentLayout: parentLayout, 58772 className 58773 }) => { 58774 const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => { 58775 const editorSettings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); 58776 return editorSettings?.disableCustomSpacingSizes; 58777 }); 58778 const { 58779 orientation 58780 } = context; 58781 const { 58782 orientation: parentOrientation, 58783 type, 58784 default: { 58785 type: defaultType 58786 } = {} 58787 } = parentLayout || {}; 58788 // Check if the spacer is inside a flex container. 58789 const isFlexLayout = type === 'flex' || !type && defaultType === 'flex'; 58790 // If the spacer is inside a flex container, it should either inherit the orientation 58791 // of the parent or use the flex default orientation. 58792 const inheritedOrientation = !parentOrientation && isFlexLayout ? 'horizontal' : parentOrientation || orientation; 58793 const { 58794 height, 58795 width, 58796 style: blockStyle = {} 58797 } = attributes; 58798 const { 58799 layout = {} 58800 } = blockStyle; 58801 const { 58802 selfStretch, 58803 flexSize 58804 } = layout; 58805 const spacingSizes = edit_useSpacingSizes(); 58806 const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); 58807 const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null); 58808 const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null); 58809 const onResizeStart = () => toggleSelection(false); 58810 const onResizeStop = () => toggleSelection(true); 58811 const { 58812 __unstableMarkNextChangeAsNotPersistent 58813 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 58814 const handleOnVerticalResizeStop = newHeight => { 58815 onResizeStop(); 58816 if (isFlexLayout) { 58817 setAttributes({ 58818 style: { 58819 ...blockStyle, 58820 layout: { 58821 ...layout, 58822 flexSize: newHeight, 58823 selfStretch: 'fixed' 58824 } 58825 } 58826 }); 58827 } 58828 setAttributes({ 58829 height: newHeight 58830 }); 58831 setTemporaryHeight(null); 58832 }; 58833 const handleOnHorizontalResizeStop = newWidth => { 58834 onResizeStop(); 58835 if (isFlexLayout) { 58836 setAttributes({ 58837 style: { 58838 ...blockStyle, 58839 layout: { 58840 ...layout, 58841 flexSize: newWidth, 58842 selfStretch: 'fixed' 58843 } 58844 } 58845 }); 58846 } 58847 setAttributes({ 58848 width: newWidth 58849 }); 58850 setTemporaryWidth(null); 58851 }; 58852 const getHeightForVerticalBlocks = () => { 58853 if (isFlexLayout) { 58854 return undefined; 58855 } 58856 return temporaryHeight || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(height) || undefined; 58857 }; 58858 const getWidthForHorizontalBlocks = () => { 58859 if (isFlexLayout) { 58860 return undefined; 58861 } 58862 return temporaryWidth || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) || undefined; 58863 }; 58864 const sizeConditionalOnOrientation = inheritedOrientation === 'horizontal' ? temporaryWidth || flexSize : temporaryHeight || flexSize; 58865 const style = { 58866 height: inheritedOrientation === 'horizontal' ? 24 : getHeightForVerticalBlocks(), 58867 width: inheritedOrientation === 'horizontal' ? getWidthForHorizontalBlocks() : undefined, 58868 // In vertical flex containers, the spacer shrinks to nothing without a minimum width. 58869 minWidth: inheritedOrientation === 'vertical' && isFlexLayout ? 48 : undefined, 58870 // Add flex-basis so temporary sizes are respected. 58871 flexBasis: isFlexLayout ? sizeConditionalOnOrientation : undefined, 58872 // Remove flex-grow when resizing. 58873 flexGrow: isFlexLayout && isResizing ? 0 : undefined 58874 }; 58875 const resizableBoxWithOrientation = blockOrientation => { 58876 if (blockOrientation === 'horizontal') { 58877 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, { 58878 minWidth: MIN_SPACER_SIZE, 58879 enable: { 58880 top: false, 58881 right: true, 58882 bottom: false, 58883 left: false, 58884 topRight: false, 58885 bottomRight: false, 58886 bottomLeft: false, 58887 topLeft: false 58888 }, 58889 orientation: blockOrientation, 58890 onResizeStart: onResizeStart, 58891 onResize: setTemporaryWidth, 58892 onResizeStop: handleOnHorizontalResizeStop, 58893 isSelected: isSelected, 58894 isResizing: isResizing, 58895 setIsResizing: setIsResizing 58896 }); 58897 } 58898 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 58899 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, { 58900 minHeight: MIN_SPACER_SIZE, 58901 enable: { 58902 top: false, 58903 right: false, 58904 bottom: true, 58905 left: false, 58906 topRight: false, 58907 bottomRight: false, 58908 bottomLeft: false, 58909 topLeft: false 58910 }, 58911 orientation: blockOrientation, 58912 onResizeStart: onResizeStart, 58913 onResize: setTemporaryHeight, 58914 onResizeStop: handleOnVerticalResizeStop, 58915 isSelected: isSelected, 58916 isResizing: isResizing, 58917 setIsResizing: setIsResizing 58918 }) 58919 }); 58920 }; 58921 (0,external_wp_element_namespaceObject.useEffect)(() => { 58922 // To avoid interfering with undo/redo operations any changes in this 58923 // effect must not make history and should be preceded by 58924 // `__unstableMarkNextChangeAsNotPersistent()`. 58925 const setAttributesCovertly = nextAttributes => { 58926 __unstableMarkNextChangeAsNotPersistent(); 58927 setAttributes(nextAttributes); 58928 }; 58929 if (isFlexLayout && selfStretch !== 'fill' && selfStretch !== 'fit' && flexSize === undefined) { 58930 if (inheritedOrientation === 'horizontal') { 58931 // If spacer is moving from a vertical container to a horizontal container, 58932 // it might not have width but have height instead. 58933 const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || '100px'; 58934 setAttributesCovertly({ 58935 width: '0px', 58936 style: { 58937 ...blockStyle, 58938 layout: { 58939 ...layout, 58940 flexSize: newSize, 58941 selfStretch: 'fixed' 58942 } 58943 } 58944 }); 58945 } else { 58946 const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || '100px'; 58947 setAttributesCovertly({ 58948 height: '0px', 58949 style: { 58950 ...blockStyle, 58951 layout: { 58952 ...layout, 58953 flexSize: newSize, 58954 selfStretch: 'fixed' 58955 } 58956 } 58957 }); 58958 } 58959 } else if (isFlexLayout && (selfStretch === 'fill' || selfStretch === 'fit')) { 58960 setAttributesCovertly(inheritedOrientation === 'horizontal' ? { 58961 width: undefined 58962 } : { 58963 height: undefined 58964 }); 58965 } else if (!isFlexLayout && (selfStretch || flexSize)) { 58966 setAttributesCovertly({ 58967 ...(inheritedOrientation === 'horizontal' ? { 58968 width: flexSize 58969 } : { 58970 height: flexSize 58971 }), 58972 style: { 58973 ...blockStyle, 58974 layout: { 58975 ...layout, 58976 flexSize: undefined, 58977 selfStretch: undefined 58978 } 58979 } 58980 }); 58981 } 58982 }, [blockStyle, flexSize, height, inheritedOrientation, isFlexLayout, layout, selfStretch, setAttributes, spacingSizes, width, __unstableMarkNextChangeAsNotPersistent]); 58983 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 58984 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { 58985 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 58986 style, 58987 className: dist_clsx(className, { 58988 'custom-sizes-disabled': disableCustomSpacingSizes 58989 }) 58990 }), 58991 children: resizableBoxWithOrientation(inheritedOrientation) 58992 }), !isFlexLayout && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacerControls, { 58993 setAttributes: setAttributes, 58994 height: temporaryHeight || height, 58995 width: temporaryWidth || width, 58996 orientation: inheritedOrientation, 58997 isResizing: isResizing 58998 })] 58999 }); 59000 }; 59001 /* harmony default export */ const spacer_edit = (SpacerEdit); 59002 59003 ;// ./node_modules/@wordpress/block-library/build-module/spacer/transforms.js 59004 /** 59005 * WordPress dependencies 59006 */ 59007 59008 const spacer_transforms_transforms = { 59009 to: [{ 59010 type: 'block', 59011 blocks: ['core/separator'], 59012 // Transform to Separator. 59013 transform: ({ 59014 anchor 59015 }) => { 59016 return (0,external_wp_blocks_namespaceObject.createBlock)('core/separator', { 59017 anchor: anchor || '' 59018 }); 59019 } 59020 }] 59021 }; 59022 /* harmony default export */ const spacer_transforms = (spacer_transforms_transforms); 59023 59024 ;// ./node_modules/@wordpress/block-library/build-module/spacer/save.js 59025 /** 59026 * WordPress dependencies 59027 */ 59028 59029 59030 function spacer_save_save({ 59031 attributes 59032 }) { 59033 const { 59034 height, 59035 width, 59036 style 59037 } = attributes; 59038 const { 59039 layout: { 59040 selfStretch 59041 } = {} 59042 } = style || {}; 59043 // If selfStretch is set to 'fill' or 'fit', don't set default height. 59044 const finalHeight = selfStretch === 'fill' || selfStretch === 'fit' ? undefined : height; 59045 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 59046 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 59047 style: { 59048 height: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(finalHeight), 59049 width: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) 59050 }, 59051 'aria-hidden': true 59052 }) 59053 }); 59054 } 59055 59056 ;// ./node_modules/@wordpress/block-library/build-module/spacer/index.js 59057 /** 59058 * WordPress dependencies 59059 */ 59060 59061 59062 /** 59063 * Internal dependencies 59064 */ 59065 59066 59067 59068 const spacer_metadata = { 59069 $schema: "https://schemas.wp.org/trunk/block.json", 59070 apiVersion: 3, 59071 name: "core/spacer", 59072 title: "Spacer", 59073 category: "design", 59074 description: "Add white space between blocks and customize its height.", 59075 textdomain: "default", 59076 attributes: { 59077 height: { 59078 type: "string", 59079 "default": "100px" 59080 }, 59081 width: { 59082 type: "string" 59083 } 59084 }, 59085 usesContext: ["orientation"], 59086 supports: { 59087 anchor: true, 59088 spacing: { 59089 margin: ["top", "bottom"], 59090 __experimentalDefaultControls: { 59091 margin: true 59092 } 59093 }, 59094 interactivity: { 59095 clientNavigation: true 59096 } 59097 }, 59098 editorStyle: "wp-block-spacer-editor", 59099 style: "wp-block-spacer" 59100 }; 59101 59102 59103 const { 59104 name: spacer_name 59105 } = spacer_metadata; 59106 59107 const spacer_settings = { 59108 icon: resize_corner_n_e, 59109 transforms: spacer_transforms, 59110 edit: spacer_edit, 59111 save: spacer_save_save, 59112 deprecated: spacer_deprecated 59113 }; 59114 const spacer_init = () => initBlock({ 59115 name: spacer_name, 59116 metadata: spacer_metadata, 59117 settings: spacer_settings 59118 }); 59119 59120 ;// ./node_modules/@wordpress/icons/build-module/library/block-table.js 59121 /** 59122 * WordPress dependencies 59123 */ 59124 59125 59126 const blockTable = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59127 viewBox: "0 0 24 24", 59128 xmlns: "http://www.w3.org/2000/svg", 59129 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59130 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" 59131 }) 59132 }); 59133 /* harmony default export */ const block_table = (blockTable); 59134 59135 ;// ./node_modules/@wordpress/block-library/build-module/table/deprecated.js 59136 /* wp:polyfill */ 59137 /** 59138 * External dependencies 59139 */ 59140 59141 59142 /** 59143 * WordPress dependencies 59144 */ 59145 59146 59147 // As the previous arbitrary colors won't match theme color palettes, the hex 59148 // value will be mapped to the style.color.background attribute as if it was 59149 // a custom color selection. 59150 59151 const oldColors = { 59152 'subtle-light-gray': '#f3f4f5', 59153 'subtle-pale-green': '#e9fbe5', 59154 'subtle-pale-blue': '#e7f5fe', 59155 'subtle-pale-pink': '#fcf0ef' 59156 }; 59157 59158 // Fixed width table cells on by default. 59159 const v4Query = { 59160 content: { 59161 type: 'rich-text', 59162 source: 'rich-text' 59163 }, 59164 tag: { 59165 type: 'string', 59166 default: 'td', 59167 source: 'tag' 59168 }, 59169 scope: { 59170 type: 'string', 59171 source: 'attribute', 59172 attribute: 'scope' 59173 }, 59174 align: { 59175 type: 'string', 59176 source: 'attribute', 59177 attribute: 'data-align' 59178 }, 59179 colspan: { 59180 type: 'string', 59181 source: 'attribute', 59182 attribute: 'colspan' 59183 }, 59184 rowspan: { 59185 type: 'string', 59186 source: 'attribute', 59187 attribute: 'rowspan' 59188 } 59189 }; 59190 const table_deprecated_v4 = { 59191 attributes: { 59192 hasFixedLayout: { 59193 type: 'boolean', 59194 default: false 59195 }, 59196 caption: { 59197 type: 'rich-text', 59198 source: 'rich-text', 59199 selector: 'figcaption' 59200 }, 59201 head: { 59202 type: 'array', 59203 default: [], 59204 source: 'query', 59205 selector: 'thead tr', 59206 query: { 59207 cells: { 59208 type: 'array', 59209 default: [], 59210 source: 'query', 59211 selector: 'td,th', 59212 query: v4Query 59213 } 59214 } 59215 }, 59216 body: { 59217 type: 'array', 59218 default: [], 59219 source: 'query', 59220 selector: 'tbody tr', 59221 query: { 59222 cells: { 59223 type: 'array', 59224 default: [], 59225 source: 'query', 59226 selector: 'td,th', 59227 query: v4Query 59228 } 59229 } 59230 }, 59231 foot: { 59232 type: 'array', 59233 default: [], 59234 source: 'query', 59235 selector: 'tfoot tr', 59236 query: { 59237 cells: { 59238 type: 'array', 59239 default: [], 59240 source: 'query', 59241 selector: 'td,th', 59242 query: v4Query 59243 } 59244 } 59245 } 59246 }, 59247 supports: { 59248 anchor: true, 59249 align: true, 59250 color: { 59251 __experimentalSkipSerialization: true, 59252 gradients: true, 59253 __experimentalDefaultControls: { 59254 background: true, 59255 text: true 59256 } 59257 }, 59258 spacing: { 59259 margin: true, 59260 padding: true, 59261 __experimentalDefaultControls: { 59262 margin: false, 59263 padding: false 59264 } 59265 }, 59266 typography: { 59267 fontSize: true, 59268 lineHeight: true, 59269 __experimentalFontFamily: true, 59270 __experimentalFontStyle: true, 59271 __experimentalFontWeight: true, 59272 __experimentalLetterSpacing: true, 59273 __experimentalTextTransform: true, 59274 __experimentalTextDecoration: true, 59275 __experimentalDefaultControls: { 59276 fontSize: true 59277 } 59278 }, 59279 __experimentalBorder: { 59280 __experimentalSkipSerialization: true, 59281 color: true, 59282 style: true, 59283 width: true, 59284 __experimentalDefaultControls: { 59285 color: true, 59286 style: true, 59287 width: true 59288 } 59289 }, 59290 __experimentalSelector: '.wp-block-table > table', 59291 interactivity: { 59292 clientNavigation: true 59293 } 59294 }, 59295 save({ 59296 attributes 59297 }) { 59298 const { 59299 hasFixedLayout, 59300 head, 59301 body, 59302 foot, 59303 caption 59304 } = attributes; 59305 const isEmpty = !head.length && !body.length && !foot.length; 59306 if (isEmpty) { 59307 return null; 59308 } 59309 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 59310 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 59311 const classes = dist_clsx(colorProps.className, borderProps.className, { 59312 'has-fixed-layout': hasFixedLayout 59313 }); 59314 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 59315 const Section = ({ 59316 type, 59317 rows 59318 }) => { 59319 if (!rows.length) { 59320 return null; 59321 } 59322 const Tag = `t$type}`; 59323 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 59324 children: rows.map(({ 59325 cells 59326 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 59327 children: cells.map(({ 59328 content, 59329 tag, 59330 scope, 59331 align, 59332 colspan, 59333 rowspan 59334 }, cellIndex) => { 59335 const cellClasses = dist_clsx({ 59336 [`has-text-align-$align}`]: align 59337 }); 59338 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59339 className: cellClasses ? cellClasses : undefined, 59340 "data-align": align, 59341 tagName: tag, 59342 value: content, 59343 scope: tag === 'th' ? scope : undefined, 59344 colSpan: colspan, 59345 rowSpan: rowspan 59346 }, cellIndex); 59347 }) 59348 }, rowIndex)) 59349 }); 59350 }; 59351 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 59352 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 59353 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { 59354 className: classes === '' ? undefined : classes, 59355 style: { 59356 ...colorProps.style, 59357 ...borderProps.style 59358 }, 59359 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59360 type: "head", 59361 rows: head 59362 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59363 type: "body", 59364 rows: body 59365 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59366 type: "foot", 59367 rows: foot 59368 })] 59369 }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59370 tagName: "figcaption", 59371 value: caption, 59372 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') 59373 })] 59374 }); 59375 } 59376 }; 59377 59378 // In #41140 support was added to global styles for caption elements which 59379 // added a `wp-element-caption` classname to the embed figcaption element. 59380 const v3Query = { 59381 content: { 59382 type: 'string', 59383 source: 'html' 59384 }, 59385 tag: { 59386 type: 'string', 59387 default: 'td', 59388 source: 'tag' 59389 }, 59390 scope: { 59391 type: 'string', 59392 source: 'attribute', 59393 attribute: 'scope' 59394 }, 59395 align: { 59396 type: 'string', 59397 source: 'attribute', 59398 attribute: 'data-align' 59399 } 59400 }; 59401 const table_deprecated_v3 = { 59402 attributes: { 59403 hasFixedLayout: { 59404 type: 'boolean', 59405 default: false 59406 }, 59407 caption: { 59408 type: 'string', 59409 source: 'html', 59410 selector: 'figcaption', 59411 default: '' 59412 }, 59413 head: { 59414 type: 'array', 59415 default: [], 59416 source: 'query', 59417 selector: 'thead tr', 59418 query: { 59419 cells: { 59420 type: 'array', 59421 default: [], 59422 source: 'query', 59423 selector: 'td,th', 59424 query: v3Query 59425 } 59426 } 59427 }, 59428 body: { 59429 type: 'array', 59430 default: [], 59431 source: 'query', 59432 selector: 'tbody tr', 59433 query: { 59434 cells: { 59435 type: 'array', 59436 default: [], 59437 source: 'query', 59438 selector: 'td,th', 59439 query: v3Query 59440 } 59441 } 59442 }, 59443 foot: { 59444 type: 'array', 59445 default: [], 59446 source: 'query', 59447 selector: 'tfoot tr', 59448 query: { 59449 cells: { 59450 type: 'array', 59451 default: [], 59452 source: 'query', 59453 selector: 'td,th', 59454 query: v3Query 59455 } 59456 } 59457 } 59458 }, 59459 supports: { 59460 anchor: true, 59461 align: true, 59462 color: { 59463 __experimentalSkipSerialization: true, 59464 gradients: true, 59465 __experimentalDefaultControls: { 59466 background: true, 59467 text: true 59468 } 59469 }, 59470 spacing: { 59471 margin: true, 59472 padding: true 59473 }, 59474 typography: { 59475 fontSize: true, 59476 lineHeight: true, 59477 __experimentalFontFamily: true, 59478 __experimentalFontStyle: true, 59479 __experimentalFontWeight: true, 59480 __experimentalLetterSpacing: true, 59481 __experimentalTextTransform: true, 59482 __experimentalTextDecoration: true, 59483 __experimentalDefaultControls: { 59484 fontSize: true 59485 } 59486 }, 59487 __experimentalBorder: { 59488 __experimentalSkipSerialization: true, 59489 color: true, 59490 style: true, 59491 width: true, 59492 __experimentalDefaultControls: { 59493 color: true, 59494 style: true, 59495 width: true 59496 } 59497 }, 59498 __experimentalSelector: '.wp-block-table > table' 59499 }, 59500 save({ 59501 attributes 59502 }) { 59503 const { 59504 hasFixedLayout, 59505 head, 59506 body, 59507 foot, 59508 caption 59509 } = attributes; 59510 const isEmpty = !head.length && !body.length && !foot.length; 59511 if (isEmpty) { 59512 return null; 59513 } 59514 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 59515 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 59516 const classes = dist_clsx(colorProps.className, borderProps.className, { 59517 'has-fixed-layout': hasFixedLayout 59518 }); 59519 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 59520 const Section = ({ 59521 type, 59522 rows 59523 }) => { 59524 if (!rows.length) { 59525 return null; 59526 } 59527 const Tag = `t$type}`; 59528 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 59529 children: rows.map(({ 59530 cells 59531 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 59532 children: cells.map(({ 59533 content, 59534 tag, 59535 scope, 59536 align 59537 }, cellIndex) => { 59538 const cellClasses = dist_clsx({ 59539 [`has-text-align-$align}`]: align 59540 }); 59541 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59542 className: cellClasses ? cellClasses : undefined, 59543 "data-align": align, 59544 tagName: tag, 59545 value: content, 59546 scope: tag === 'th' ? scope : undefined 59547 }, cellIndex); 59548 }) 59549 }, rowIndex)) 59550 }); 59551 }; 59552 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 59553 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 59554 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { 59555 className: classes === '' ? undefined : classes, 59556 style: { 59557 ...colorProps.style, 59558 ...borderProps.style 59559 }, 59560 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59561 type: "head", 59562 rows: head 59563 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59564 type: "body", 59565 rows: body 59566 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59567 type: "foot", 59568 rows: foot 59569 })] 59570 }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59571 tagName: "figcaption", 59572 value: caption 59573 })] 59574 }); 59575 } 59576 }; 59577 59578 // Deprecation migrating table block to use colors block support feature. 59579 const v2Query = { 59580 content: { 59581 type: 'string', 59582 source: 'html' 59583 }, 59584 tag: { 59585 type: 'string', 59586 default: 'td', 59587 source: 'tag' 59588 }, 59589 scope: { 59590 type: 'string', 59591 source: 'attribute', 59592 attribute: 'scope' 59593 }, 59594 align: { 59595 type: 'string', 59596 source: 'attribute', 59597 attribute: 'data-align' 59598 } 59599 }; 59600 const table_deprecated_v2 = { 59601 attributes: { 59602 hasFixedLayout: { 59603 type: 'boolean', 59604 default: false 59605 }, 59606 backgroundColor: { 59607 type: 'string' 59608 }, 59609 caption: { 59610 type: 'string', 59611 source: 'html', 59612 selector: 'figcaption', 59613 default: '' 59614 }, 59615 head: { 59616 type: 'array', 59617 default: [], 59618 source: 'query', 59619 selector: 'thead tr', 59620 query: { 59621 cells: { 59622 type: 'array', 59623 default: [], 59624 source: 'query', 59625 selector: 'td,th', 59626 query: v2Query 59627 } 59628 } 59629 }, 59630 body: { 59631 type: 'array', 59632 default: [], 59633 source: 'query', 59634 selector: 'tbody tr', 59635 query: { 59636 cells: { 59637 type: 'array', 59638 default: [], 59639 source: 'query', 59640 selector: 'td,th', 59641 query: v2Query 59642 } 59643 } 59644 }, 59645 foot: { 59646 type: 'array', 59647 default: [], 59648 source: 'query', 59649 selector: 'tfoot tr', 59650 query: { 59651 cells: { 59652 type: 'array', 59653 default: [], 59654 source: 'query', 59655 selector: 'td,th', 59656 query: v2Query 59657 } 59658 } 59659 } 59660 }, 59661 supports: { 59662 anchor: true, 59663 align: true, 59664 __experimentalSelector: '.wp-block-table > table' 59665 }, 59666 save: ({ 59667 attributes 59668 }) => { 59669 const { 59670 hasFixedLayout, 59671 head, 59672 body, 59673 foot, 59674 backgroundColor, 59675 caption 59676 } = attributes; 59677 const isEmpty = !head.length && !body.length && !foot.length; 59678 if (isEmpty) { 59679 return null; 59680 } 59681 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 59682 const classes = dist_clsx(backgroundClass, { 59683 'has-fixed-layout': hasFixedLayout, 59684 'has-background': !!backgroundClass 59685 }); 59686 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 59687 const Section = ({ 59688 type, 59689 rows 59690 }) => { 59691 if (!rows.length) { 59692 return null; 59693 } 59694 const Tag = `t$type}`; 59695 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 59696 children: rows.map(({ 59697 cells 59698 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 59699 children: cells.map(({ 59700 content, 59701 tag, 59702 scope, 59703 align 59704 }, cellIndex) => { 59705 const cellClasses = dist_clsx({ 59706 [`has-text-align-$align}`]: align 59707 }); 59708 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59709 className: cellClasses ? cellClasses : undefined, 59710 "data-align": align, 59711 tagName: tag, 59712 value: content, 59713 scope: tag === 'th' ? scope : undefined 59714 }, cellIndex); 59715 }) 59716 }, rowIndex)) 59717 }); 59718 }; 59719 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 59720 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 59721 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { 59722 className: classes === '' ? undefined : classes, 59723 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59724 type: "head", 59725 rows: head 59726 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59727 type: "body", 59728 rows: body 59729 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59730 type: "foot", 59731 rows: foot 59732 })] 59733 }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59734 tagName: "figcaption", 59735 value: caption 59736 })] 59737 }); 59738 }, 59739 isEligible: attributes => { 59740 return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style; 59741 }, 59742 // This version is the first to introduce the style attribute to the 59743 // table block. As a result, we'll explicitly override that. 59744 migrate: attributes => { 59745 return { 59746 ...attributes, 59747 backgroundColor: undefined, 59748 style: { 59749 color: { 59750 background: oldColors[attributes.backgroundColor] 59751 } 59752 } 59753 }; 59754 } 59755 }; 59756 const v1Query = { 59757 content: { 59758 type: 'string', 59759 source: 'html' 59760 }, 59761 tag: { 59762 type: 'string', 59763 default: 'td', 59764 source: 'tag' 59765 }, 59766 scope: { 59767 type: 'string', 59768 source: 'attribute', 59769 attribute: 'scope' 59770 } 59771 }; 59772 const table_deprecated_v1 = { 59773 attributes: { 59774 hasFixedLayout: { 59775 type: 'boolean', 59776 default: false 59777 }, 59778 backgroundColor: { 59779 type: 'string' 59780 }, 59781 head: { 59782 type: 'array', 59783 default: [], 59784 source: 'query', 59785 selector: 'thead tr', 59786 query: { 59787 cells: { 59788 type: 'array', 59789 default: [], 59790 source: 'query', 59791 selector: 'td,th', 59792 query: v1Query 59793 } 59794 } 59795 }, 59796 body: { 59797 type: 'array', 59798 default: [], 59799 source: 'query', 59800 selector: 'tbody tr', 59801 query: { 59802 cells: { 59803 type: 'array', 59804 default: [], 59805 source: 'query', 59806 selector: 'td,th', 59807 query: v1Query 59808 } 59809 } 59810 }, 59811 foot: { 59812 type: 'array', 59813 default: [], 59814 source: 'query', 59815 selector: 'tfoot tr', 59816 query: { 59817 cells: { 59818 type: 'array', 59819 default: [], 59820 source: 'query', 59821 selector: 'td,th', 59822 query: v1Query 59823 } 59824 } 59825 } 59826 }, 59827 supports: { 59828 align: true 59829 }, 59830 save({ 59831 attributes 59832 }) { 59833 const { 59834 hasFixedLayout, 59835 head, 59836 body, 59837 foot, 59838 backgroundColor 59839 } = attributes; 59840 const isEmpty = !head.length && !body.length && !foot.length; 59841 if (isEmpty) { 59842 return null; 59843 } 59844 const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); 59845 const classes = dist_clsx(backgroundClass, { 59846 'has-fixed-layout': hasFixedLayout, 59847 'has-background': !!backgroundClass 59848 }); 59849 const Section = ({ 59850 type, 59851 rows 59852 }) => { 59853 if (!rows.length) { 59854 return null; 59855 } 59856 const Tag = `t$type}`; 59857 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 59858 children: rows.map(({ 59859 cells 59860 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 59861 children: cells.map(({ 59862 content, 59863 tag, 59864 scope 59865 }, cellIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 59866 tagName: tag, 59867 value: content, 59868 scope: tag === 'th' ? scope : undefined 59869 }, cellIndex)) 59870 }, rowIndex)) 59871 }); 59872 }; 59873 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { 59874 className: classes, 59875 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59876 type: "head", 59877 rows: head 59878 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59879 type: "body", 59880 rows: body 59881 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 59882 type: "foot", 59883 rows: foot 59884 })] 59885 }); 59886 } 59887 }; 59888 59889 /** 59890 * New deprecations need to be placed first 59891 * for them to have higher priority. 59892 * 59893 * Old deprecations may need to be updated as well. 59894 * 59895 * See block-deprecation.md 59896 */ 59897 /* harmony default export */ const table_deprecated = ([table_deprecated_v4, table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]); 59898 59899 ;// ./node_modules/@wordpress/icons/build-module/library/align-left.js 59900 /** 59901 * WordPress dependencies 59902 */ 59903 59904 59905 const alignLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59906 xmlns: "http://www.w3.org/2000/svg", 59907 viewBox: "0 0 24 24", 59908 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59909 d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" 59910 }) 59911 }); 59912 /* harmony default export */ const align_left = (alignLeft); 59913 59914 ;// ./node_modules/@wordpress/icons/build-module/library/align-center.js 59915 /** 59916 * WordPress dependencies 59917 */ 59918 59919 59920 const alignCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59921 xmlns: "http://www.w3.org/2000/svg", 59922 viewBox: "0 0 24 24", 59923 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59924 d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" 59925 }) 59926 }); 59927 /* harmony default export */ const align_center = (alignCenter); 59928 59929 ;// ./node_modules/@wordpress/icons/build-module/library/align-right.js 59930 /** 59931 * WordPress dependencies 59932 */ 59933 59934 59935 const alignRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59936 xmlns: "http://www.w3.org/2000/svg", 59937 viewBox: "0 0 24 24", 59938 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59939 d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" 59940 }) 59941 }); 59942 /* harmony default export */ const align_right = (alignRight); 59943 59944 ;// ./node_modules/@wordpress/icons/build-module/library/table-row-before.js 59945 /** 59946 * WordPress dependencies 59947 */ 59948 59949 59950 const tableRowBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59951 xmlns: "http://www.w3.org/2000/svg", 59952 viewBox: "-2 -2 24 24", 59953 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59954 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" 59955 }) 59956 }); 59957 /* harmony default export */ const table_row_before = (tableRowBefore); 59958 59959 ;// ./node_modules/@wordpress/icons/build-module/library/table-row-after.js 59960 /** 59961 * WordPress dependencies 59962 */ 59963 59964 59965 const tableRowAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59966 xmlns: "http://www.w3.org/2000/svg", 59967 viewBox: "-2 -2 24 24", 59968 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59969 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" 59970 }) 59971 }); 59972 /* harmony default export */ const table_row_after = (tableRowAfter); 59973 59974 ;// ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js 59975 /** 59976 * WordPress dependencies 59977 */ 59978 59979 59980 const tableRowDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59981 xmlns: "http://www.w3.org/2000/svg", 59982 viewBox: "-2 -2 24 24", 59983 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59984 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" 59985 }) 59986 }); 59987 /* harmony default export */ const table_row_delete = (tableRowDelete); 59988 59989 ;// ./node_modules/@wordpress/icons/build-module/library/table-column-before.js 59990 /** 59991 * WordPress dependencies 59992 */ 59993 59994 59995 const tableColumnBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 59996 xmlns: "http://www.w3.org/2000/svg", 59997 viewBox: "-2 -2 24 24", 59998 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 59999 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" 60000 }) 60001 }); 60002 /* harmony default export */ const table_column_before = (tableColumnBefore); 60003 60004 ;// ./node_modules/@wordpress/icons/build-module/library/table-column-after.js 60005 /** 60006 * WordPress dependencies 60007 */ 60008 60009 60010 const tableColumnAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 60011 xmlns: "http://www.w3.org/2000/svg", 60012 viewBox: "-2 -2 24 24", 60013 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 60014 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" 60015 }) 60016 }); 60017 /* harmony default export */ const table_column_after = (tableColumnAfter); 60018 60019 ;// ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js 60020 /** 60021 * WordPress dependencies 60022 */ 60023 60024 60025 const tableColumnDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 60026 xmlns: "http://www.w3.org/2000/svg", 60027 viewBox: "-2 -2 24 24", 60028 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 60029 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" 60030 }) 60031 }); 60032 /* harmony default export */ const table_column_delete = (tableColumnDelete); 60033 60034 ;// ./node_modules/@wordpress/icons/build-module/library/table.js 60035 /** 60036 * WordPress dependencies 60037 */ 60038 60039 60040 const table = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 60041 xmlns: "http://www.w3.org/2000/svg", 60042 viewBox: "0 0 24 24", 60043 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 60044 d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z" 60045 }) 60046 }); 60047 /* harmony default export */ const library_table = (table); 60048 60049 ;// ./node_modules/@wordpress/block-library/build-module/table/state.js 60050 /* wp:polyfill */ 60051 const INHERITED_COLUMN_ATTRIBUTES = ['align']; 60052 60053 /** 60054 * Creates a table state. 60055 * 60056 * @param {Object} options 60057 * @param {number} options.rowCount Row count for the table to create. 60058 * @param {number} options.columnCount Column count for the table to create. 60059 * 60060 * @return {Object} New table state. 60061 */ 60062 function createTable({ 60063 rowCount, 60064 columnCount 60065 }) { 60066 return { 60067 body: Array.from({ 60068 length: rowCount 60069 }).map(() => ({ 60070 cells: Array.from({ 60071 length: columnCount 60072 }).map(() => ({ 60073 content: '', 60074 tag: 'td' 60075 })) 60076 })) 60077 }; 60078 } 60079 60080 /** 60081 * Returns the first row in the table. 60082 * 60083 * @param {Object} state Current table state. 60084 * 60085 * @return {Object | undefined} The first table row. 60086 */ 60087 function getFirstRow(state) { 60088 if (!isEmptyTableSection(state.head)) { 60089 return state.head[0]; 60090 } 60091 if (!isEmptyTableSection(state.body)) { 60092 return state.body[0]; 60093 } 60094 if (!isEmptyTableSection(state.foot)) { 60095 return state.foot[0]; 60096 } 60097 } 60098 60099 /** 60100 * Gets an attribute for a cell. 60101 * 60102 * @param {Object} state Current table state. 60103 * @param {Object} cellLocation The location of the cell 60104 * @param {string} attributeName The name of the attribute to get the value of. 60105 * 60106 * @return {*} The attribute value. 60107 */ 60108 function getCellAttribute(state, cellLocation, attributeName) { 60109 const { 60110 sectionName, 60111 rowIndex, 60112 columnIndex 60113 } = cellLocation; 60114 return state[sectionName]?.[rowIndex]?.cells?.[columnIndex]?.[attributeName]; 60115 } 60116 60117 /** 60118 * Returns updated cell attributes after applying the `updateCell` function to the selection. 60119 * 60120 * @param {Object} state The block attributes. 60121 * @param {Object} selection The selection of cells to update. 60122 * @param {Function} updateCell A function to update the selected cell attributes. 60123 * 60124 * @return {Object} New table state including the updated cells. 60125 */ 60126 function updateSelectedCell(state, selection, updateCell) { 60127 if (!selection) { 60128 return state; 60129 } 60130 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 60131 const { 60132 sectionName: selectionSectionName, 60133 rowIndex: selectionRowIndex 60134 } = selection; 60135 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 60136 if (selectionSectionName && selectionSectionName !== sectionName) { 60137 return [sectionName, section]; 60138 } 60139 return [sectionName, section.map((row, rowIndex) => { 60140 if (selectionRowIndex && selectionRowIndex !== rowIndex) { 60141 return row; 60142 } 60143 return { 60144 cells: row.cells.map((cellAttributes, columnIndex) => { 60145 const cellLocation = { 60146 sectionName, 60147 columnIndex, 60148 rowIndex 60149 }; 60150 if (!isCellSelected(cellLocation, selection)) { 60151 return cellAttributes; 60152 } 60153 return updateCell(cellAttributes); 60154 }) 60155 }; 60156 })]; 60157 })); 60158 } 60159 60160 /** 60161 * Returns whether the cell at `cellLocation` is included in the selection `selection`. 60162 * 60163 * @param {Object} cellLocation An object containing cell location properties. 60164 * @param {Object} selection An object containing selection properties. 60165 * 60166 * @return {boolean} True if the cell is selected, false otherwise. 60167 */ 60168 function isCellSelected(cellLocation, selection) { 60169 if (!cellLocation || !selection) { 60170 return false; 60171 } 60172 switch (selection.type) { 60173 case 'column': 60174 return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex; 60175 case 'cell': 60176 return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex; 60177 } 60178 } 60179 60180 /** 60181 * Inserts a row in the table state. 60182 * 60183 * @param {Object} state Current table state. 60184 * @param {Object} options 60185 * @param {string} options.sectionName Section in which to insert the row. 60186 * @param {number} options.rowIndex Row index at which to insert the row. 60187 * @param {number} options.columnCount Column count for the table to create. 60188 * 60189 * @return {Object} New table state. 60190 */ 60191 function insertRow(state, { 60192 sectionName, 60193 rowIndex, 60194 columnCount 60195 }) { 60196 const firstRow = getFirstRow(state); 60197 const cellCount = columnCount === undefined ? firstRow?.cells?.length : columnCount; 60198 60199 // Bail early if the function cannot determine how many cells to add. 60200 if (!cellCount) { 60201 return state; 60202 } 60203 return { 60204 [sectionName]: [...state[sectionName].slice(0, rowIndex), { 60205 cells: Array.from({ 60206 length: cellCount 60207 }).map((_, index) => { 60208 var _firstRow$cells$index; 60209 const firstCellInColumn = (_firstRow$cells$index = firstRow?.cells?.[index]) !== null && _firstRow$cells$index !== void 0 ? _firstRow$cells$index : {}; 60210 const inheritedAttributes = Object.fromEntries(Object.entries(firstCellInColumn).filter(([key]) => INHERITED_COLUMN_ATTRIBUTES.includes(key))); 60211 return { 60212 ...inheritedAttributes, 60213 content: '', 60214 tag: sectionName === 'head' ? 'th' : 'td' 60215 }; 60216 }) 60217 }, ...state[sectionName].slice(rowIndex)] 60218 }; 60219 } 60220 60221 /** 60222 * Deletes a row from the table state. 60223 * 60224 * @param {Object} state Current table state. 60225 * @param {Object} options 60226 * @param {string} options.sectionName Section in which to delete the row. 60227 * @param {number} options.rowIndex Row index to delete. 60228 * 60229 * @return {Object} New table state. 60230 */ 60231 function deleteRow(state, { 60232 sectionName, 60233 rowIndex 60234 }) { 60235 return { 60236 [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex) 60237 }; 60238 } 60239 60240 /** 60241 * Inserts a column in the table state. 60242 * 60243 * @param {Object} state Current table state. 60244 * @param {Object} options 60245 * @param {number} options.columnIndex Column index at which to insert the column. 60246 * 60247 * @return {Object} New table state. 60248 */ 60249 function insertColumn(state, { 60250 columnIndex 60251 }) { 60252 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 60253 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 60254 // Bail early if the table section is empty. 60255 if (isEmptyTableSection(section)) { 60256 return [sectionName, section]; 60257 } 60258 return [sectionName, section.map(row => { 60259 // Bail early if the row is empty or it's an attempt to insert past 60260 // the last possible index of the array. 60261 if (isEmptyRow(row) || row.cells.length < columnIndex) { 60262 return row; 60263 } 60264 return { 60265 cells: [...row.cells.slice(0, columnIndex), { 60266 content: '', 60267 tag: sectionName === 'head' ? 'th' : 'td' 60268 }, ...row.cells.slice(columnIndex)] 60269 }; 60270 })]; 60271 })); 60272 } 60273 60274 /** 60275 * Deletes a column from the table state. 60276 * 60277 * @param {Object} state Current table state. 60278 * @param {Object} options 60279 * @param {number} options.columnIndex Column index to delete. 60280 * 60281 * @return {Object} New table state. 60282 */ 60283 function deleteColumn(state, { 60284 columnIndex 60285 }) { 60286 const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); 60287 return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { 60288 // Bail early if the table section is empty. 60289 if (isEmptyTableSection(section)) { 60290 return [sectionName, section]; 60291 } 60292 return [sectionName, section.map(row => ({ 60293 cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells 60294 })).filter(row => row.cells.length)]; 60295 })); 60296 } 60297 60298 /** 60299 * Toggles the existence of a section. 60300 * 60301 * @param {Object} state Current table state. 60302 * @param {string} sectionName Name of the section to toggle. 60303 * 60304 * @return {Object} New table state. 60305 */ 60306 function toggleSection(state, sectionName) { 60307 var _state$body$0$cells$l; 60308 // Section exists, replace it with an empty row to remove it. 60309 if (!isEmptyTableSection(state[sectionName])) { 60310 return { 60311 [sectionName]: [] 60312 }; 60313 } 60314 60315 // Get the length of the first row of the body to use when creating the header. 60316 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; 60317 60318 // Section doesn't exist, insert an empty row to create the section. 60319 return insertRow(state, { 60320 sectionName, 60321 rowIndex: 0, 60322 columnCount 60323 }); 60324 } 60325 60326 /** 60327 * Determines whether a table section is empty. 60328 * 60329 * @param {Object} section Table section state. 60330 * 60331 * @return {boolean} True if the table section is empty, false otherwise. 60332 */ 60333 function isEmptyTableSection(section) { 60334 return !section || !section.length || section.every(isEmptyRow); 60335 } 60336 60337 /** 60338 * Determines whether a table row is empty. 60339 * 60340 * @param {Object} row Table row state. 60341 * 60342 * @return {boolean} True if the table section is empty, false otherwise. 60343 */ 60344 function isEmptyRow(row) { 60345 return !(row.cells && row.cells.length); 60346 } 60347 60348 ;// ./node_modules/@wordpress/block-library/build-module/table/edit.js 60349 /* wp:polyfill */ 60350 /** 60351 * External dependencies 60352 */ 60353 60354 60355 /** 60356 * WordPress dependencies 60357 */ 60358 60359 60360 60361 60362 60363 60364 /** 60365 * Internal dependencies 60366 */ 60367 60368 60369 60370 60371 const ALIGNMENT_CONTROLS = [{ 60372 icon: align_left, 60373 title: (0,external_wp_i18n_namespaceObject.__)('Align column left'), 60374 align: 'left' 60375 }, { 60376 icon: align_center, 60377 title: (0,external_wp_i18n_namespaceObject.__)('Align column center'), 60378 align: 'center' 60379 }, { 60380 icon: align_right, 60381 title: (0,external_wp_i18n_namespaceObject.__)('Align column right'), 60382 align: 'right' 60383 }]; 60384 const cellAriaLabel = { 60385 head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'), 60386 body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'), 60387 foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text') 60388 }; 60389 const edit_placeholder = { 60390 head: (0,external_wp_i18n_namespaceObject.__)('Header label'), 60391 foot: (0,external_wp_i18n_namespaceObject.__)('Footer label') 60392 }; 60393 function TSection({ 60394 name, 60395 ...props 60396 }) { 60397 const TagName = `t$name}`; 60398 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 60399 ...props 60400 }); 60401 } 60402 function TableEdit({ 60403 attributes, 60404 setAttributes, 60405 insertBlocksAfter, 60406 isSelected: isSingleSelected 60407 }) { 60408 const { 60409 hasFixedLayout, 60410 head, 60411 foot 60412 } = attributes; 60413 const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2); 60414 const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2); 60415 const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)(); 60416 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); 60417 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); 60418 const tableRef = (0,external_wp_element_namespaceObject.useRef)(); 60419 const [hasTableCreated, setHasTableCreated] = (0,external_wp_element_namespaceObject.useState)(false); 60420 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 60421 60422 /** 60423 * Updates the initial column count used for table creation. 60424 * 60425 * @param {number} count New initial column count. 60426 */ 60427 function onChangeInitialColumnCount(count) { 60428 setInitialColumnCount(count); 60429 } 60430 60431 /** 60432 * Updates the initial row count used for table creation. 60433 * 60434 * @param {number} count New initial row count. 60435 */ 60436 function onChangeInitialRowCount(count) { 60437 setInitialRowCount(count); 60438 } 60439 60440 /** 60441 * Creates a table based on dimensions in local state. 60442 * 60443 * @param {Object} event Form submit event. 60444 */ 60445 function onCreateTable(event) { 60446 event.preventDefault(); 60447 setAttributes(createTable({ 60448 rowCount: parseInt(initialRowCount, 10) || 2, 60449 columnCount: parseInt(initialColumnCount, 10) || 2 60450 })); 60451 setHasTableCreated(true); 60452 } 60453 60454 /** 60455 * Toggles whether the table has a fixed layout or not. 60456 */ 60457 function onChangeFixedLayout() { 60458 setAttributes({ 60459 hasFixedLayout: !hasFixedLayout 60460 }); 60461 } 60462 60463 /** 60464 * Changes the content of the currently selected cell. 60465 * 60466 * @param {Array} content A RichText content value. 60467 */ 60468 function onChange(content) { 60469 if (!selectedCell) { 60470 return; 60471 } 60472 setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ 60473 ...cellAttributes, 60474 content 60475 }))); 60476 } 60477 60478 /** 60479 * Align text within the a column. 60480 * 60481 * @param {string} align The new alignment to apply to the column. 60482 */ 60483 function onChangeColumnAlignment(align) { 60484 if (!selectedCell) { 60485 return; 60486 } 60487 60488 // Convert the cell selection to a column selection so that alignment 60489 // is applied to the entire column. 60490 const columnSelection = { 60491 type: 'column', 60492 columnIndex: selectedCell.columnIndex 60493 }; 60494 const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ 60495 ...cellAttributes, 60496 align 60497 })); 60498 setAttributes(newAttributes); 60499 } 60500 60501 /** 60502 * Get the alignment of the currently selected cell. 60503 * 60504 * @return {string | undefined} The new alignment to apply to the column. 60505 */ 60506 function getCellAlignment() { 60507 if (!selectedCell) { 60508 return; 60509 } 60510 return getCellAttribute(attributes, selectedCell, 'align'); 60511 } 60512 60513 /** 60514 * Add or remove a `head` table section. 60515 */ 60516 function onToggleHeaderSection() { 60517 setAttributes(toggleSection(attributes, 'head')); 60518 } 60519 60520 /** 60521 * Add or remove a `foot` table section. 60522 */ 60523 function onToggleFooterSection() { 60524 setAttributes(toggleSection(attributes, 'foot')); 60525 } 60526 60527 /** 60528 * Inserts a row at the currently selected row index, plus `delta`. 60529 * 60530 * @param {number} delta Offset for selected row index at which to insert. 60531 */ 60532 function onInsertRow(delta) { 60533 if (!selectedCell) { 60534 return; 60535 } 60536 const { 60537 sectionName, 60538 rowIndex 60539 } = selectedCell; 60540 const newRowIndex = rowIndex + delta; 60541 setAttributes(insertRow(attributes, { 60542 sectionName, 60543 rowIndex: newRowIndex 60544 })); 60545 // Select the first cell of the new row. 60546 setSelectedCell({ 60547 sectionName, 60548 rowIndex: newRowIndex, 60549 columnIndex: 0, 60550 type: 'cell' 60551 }); 60552 } 60553 60554 /** 60555 * Inserts a row before the currently selected row. 60556 */ 60557 function onInsertRowBefore() { 60558 onInsertRow(0); 60559 } 60560 60561 /** 60562 * Inserts a row after the currently selected row. 60563 */ 60564 function onInsertRowAfter() { 60565 onInsertRow(1); 60566 } 60567 60568 /** 60569 * Deletes the currently selected row. 60570 */ 60571 function onDeleteRow() { 60572 if (!selectedCell) { 60573 return; 60574 } 60575 const { 60576 sectionName, 60577 rowIndex 60578 } = selectedCell; 60579 setSelectedCell(); 60580 setAttributes(deleteRow(attributes, { 60581 sectionName, 60582 rowIndex 60583 })); 60584 } 60585 60586 /** 60587 * Inserts a column at the currently selected column index, plus `delta`. 60588 * 60589 * @param {number} delta Offset for selected column index at which to insert. 60590 */ 60591 function onInsertColumn(delta = 0) { 60592 if (!selectedCell) { 60593 return; 60594 } 60595 const { 60596 columnIndex 60597 } = selectedCell; 60598 const newColumnIndex = columnIndex + delta; 60599 setAttributes(insertColumn(attributes, { 60600 columnIndex: newColumnIndex 60601 })); 60602 // Select the first cell of the new column. 60603 setSelectedCell({ 60604 rowIndex: 0, 60605 columnIndex: newColumnIndex, 60606 type: 'cell' 60607 }); 60608 } 60609 60610 /** 60611 * Inserts a column before the currently selected column. 60612 */ 60613 function onInsertColumnBefore() { 60614 onInsertColumn(0); 60615 } 60616 60617 /** 60618 * Inserts a column after the currently selected column. 60619 */ 60620 function onInsertColumnAfter() { 60621 onInsertColumn(1); 60622 } 60623 60624 /** 60625 * Deletes the currently selected column. 60626 */ 60627 function onDeleteColumn() { 60628 if (!selectedCell) { 60629 return; 60630 } 60631 const { 60632 sectionName, 60633 columnIndex 60634 } = selectedCell; 60635 setSelectedCell(); 60636 setAttributes(deleteColumn(attributes, { 60637 sectionName, 60638 columnIndex 60639 })); 60640 } 60641 (0,external_wp_element_namespaceObject.useEffect)(() => { 60642 if (!isSingleSelected) { 60643 setSelectedCell(); 60644 } 60645 }, [isSingleSelected]); 60646 (0,external_wp_element_namespaceObject.useEffect)(() => { 60647 if (hasTableCreated) { 60648 tableRef?.current?.querySelector('td div[contentEditable="true"]')?.focus(); 60649 setHasTableCreated(false); 60650 } 60651 }, [hasTableCreated]); 60652 const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name])); 60653 const tableControls = [{ 60654 icon: table_row_before, 60655 title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'), 60656 isDisabled: !selectedCell, 60657 onClick: onInsertRowBefore 60658 }, { 60659 icon: table_row_after, 60660 title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'), 60661 isDisabled: !selectedCell, 60662 onClick: onInsertRowAfter 60663 }, { 60664 icon: table_row_delete, 60665 title: (0,external_wp_i18n_namespaceObject.__)('Delete row'), 60666 isDisabled: !selectedCell, 60667 onClick: onDeleteRow 60668 }, { 60669 icon: table_column_before, 60670 title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'), 60671 isDisabled: !selectedCell, 60672 onClick: onInsertColumnBefore 60673 }, { 60674 icon: table_column_after, 60675 title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'), 60676 isDisabled: !selectedCell, 60677 onClick: onInsertColumnAfter 60678 }, { 60679 icon: table_column_delete, 60680 title: (0,external_wp_i18n_namespaceObject.__)('Delete column'), 60681 isDisabled: !selectedCell, 60682 onClick: onDeleteColumn 60683 }]; 60684 const renderedSections = sections.map(name => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TSection, { 60685 name: name, 60686 children: attributes[name].map(({ 60687 cells 60688 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 60689 children: cells.map(({ 60690 content, 60691 tag: CellTag, 60692 scope, 60693 align, 60694 colspan, 60695 rowspan 60696 }, columnIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CellTag, { 60697 scope: CellTag === 'th' ? scope : undefined, 60698 colSpan: colspan, 60699 rowSpan: rowspan, 60700 className: dist_clsx({ 60701 [`has-text-align-$align}`]: align 60702 }, 'wp-block-table__cell-content'), 60703 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 60704 value: content, 60705 onChange: onChange, 60706 onFocus: () => { 60707 setSelectedCell({ 60708 sectionName: name, 60709 rowIndex, 60710 columnIndex, 60711 type: 'cell' 60712 }); 60713 }, 60714 "aria-label": cellAriaLabel[name], 60715 placeholder: edit_placeholder[name] 60716 }) 60717 }, columnIndex)) 60718 }, rowIndex)) 60719 }, name)); 60720 const isEmpty = !sections.length; 60721 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 60722 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 60723 ref: tableRef 60724 }), 60725 children: [!isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 60726 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 60727 group: "block", 60728 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 60729 label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'), 60730 alignmentControls: ALIGNMENT_CONTROLS, 60731 value: getCellAlignment(), 60732 onChange: nextAlign => onChangeColumnAlignment(nextAlign) 60733 }) 60734 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 60735 group: "other", 60736 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { 60737 icon: library_table, 60738 label: (0,external_wp_i18n_namespaceObject.__)('Edit table'), 60739 controls: tableControls 60740 }) 60741 })] 60742 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 60743 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 60744 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 60745 resetAll: () => { 60746 setAttributes({ 60747 hasFixedLayout: true, 60748 head: [], 60749 foot: [] 60750 }); 60751 }, 60752 dropdownMenuProps: dropdownMenuProps, 60753 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 60754 hasValue: () => hasFixedLayout !== true, 60755 label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'), 60756 onDeselect: () => setAttributes({ 60757 hasFixedLayout: true 60758 }), 60759 isShownByDefault: true, 60760 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 60761 __nextHasNoMarginBottom: true, 60762 label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'), 60763 checked: !!hasFixedLayout, 60764 onChange: onChangeFixedLayout 60765 }) 60766 }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 60767 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 60768 hasValue: () => head && head.length, 60769 label: (0,external_wp_i18n_namespaceObject.__)('Header section'), 60770 onDeselect: () => setAttributes({ 60771 head: [] 60772 }), 60773 isShownByDefault: true, 60774 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 60775 __nextHasNoMarginBottom: true, 60776 label: (0,external_wp_i18n_namespaceObject.__)('Header section'), 60777 checked: !!(head && head.length), 60778 onChange: onToggleHeaderSection 60779 }) 60780 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 60781 hasValue: () => foot && foot.length, 60782 label: (0,external_wp_i18n_namespaceObject.__)('Footer section'), 60783 onDeselect: () => setAttributes({ 60784 foot: [] 60785 }), 60786 isShownByDefault: true, 60787 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 60788 __nextHasNoMarginBottom: true, 60789 label: (0,external_wp_i18n_namespaceObject.__)('Footer section'), 60790 checked: !!(foot && foot.length), 60791 onChange: onToggleFooterSection 60792 }) 60793 })] 60794 })] 60795 }) 60796 }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("table", { 60797 className: dist_clsx(colorProps.className, borderProps.className, { 60798 'has-fixed-layout': hasFixedLayout, 60799 // This is required in the editor only to overcome 60800 // the fact the editor rewrites individual border 60801 // widths into a shorthand format. 60802 'has-individual-borders': (0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes?.style?.border) 60803 }), 60804 style: { 60805 ...colorProps.style, 60806 ...borderProps.style 60807 }, 60808 children: renderedSections 60809 }), isEmpty ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 60810 label: (0,external_wp_i18n_namespaceObject.__)('Table'), 60811 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 60812 icon: block_table, 60813 showColors: true 60814 }), 60815 instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.'), 60816 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { 60817 className: "blocks-table__placeholder-form", 60818 onSubmit: onCreateTable, 60819 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 60820 __nextHasNoMarginBottom: true, 60821 __next40pxDefaultSize: true, 60822 type: "number", 60823 label: (0,external_wp_i18n_namespaceObject.__)('Column count'), 60824 value: initialColumnCount, 60825 onChange: onChangeInitialColumnCount, 60826 min: "1", 60827 className: "blocks-table__placeholder-input" 60828 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 60829 __nextHasNoMarginBottom: true, 60830 __next40pxDefaultSize: true, 60831 type: "number", 60832 label: (0,external_wp_i18n_namespaceObject.__)('Row count'), 60833 value: initialRowCount, 60834 onChange: onChangeInitialRowCount, 60835 min: "1", 60836 className: "blocks-table__placeholder-input" 60837 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 60838 __next40pxDefaultSize: true, 60839 variant: "primary", 60840 type: "submit", 60841 children: (0,external_wp_i18n_namespaceObject.__)('Create Table') 60842 })] 60843 }) 60844 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 60845 attributes: attributes, 60846 setAttributes: setAttributes, 60847 isSelected: isSingleSelected, 60848 insertBlocksAfter: insertBlocksAfter, 60849 label: (0,external_wp_i18n_namespaceObject.__)('Table caption text'), 60850 showToolbarButton: isSingleSelected 60851 })] 60852 }); 60853 } 60854 /* harmony default export */ const table_edit = (TableEdit); 60855 60856 ;// ./node_modules/@wordpress/block-library/build-module/table/save.js 60857 /* wp:polyfill */ 60858 /** 60859 * External dependencies 60860 */ 60861 60862 60863 /** 60864 * WordPress dependencies 60865 */ 60866 60867 60868 function table_save_save({ 60869 attributes 60870 }) { 60871 const { 60872 hasFixedLayout, 60873 head, 60874 body, 60875 foot, 60876 caption 60877 } = attributes; 60878 const isEmpty = !head.length && !body.length && !foot.length; 60879 if (isEmpty) { 60880 return null; 60881 } 60882 const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); 60883 const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); 60884 const classes = dist_clsx(colorProps.className, borderProps.className, { 60885 'has-fixed-layout': hasFixedLayout 60886 }); 60887 const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); 60888 const Section = ({ 60889 type, 60890 rows 60891 }) => { 60892 if (!rows.length) { 60893 return null; 60894 } 60895 const Tag = `t$type}`; 60896 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { 60897 children: rows.map(({ 60898 cells 60899 }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { 60900 children: cells.map(({ 60901 content, 60902 tag, 60903 scope, 60904 align, 60905 colspan, 60906 rowspan 60907 }, cellIndex) => { 60908 const cellClasses = dist_clsx({ 60909 [`has-text-align-$align}`]: align 60910 }); 60911 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 60912 className: cellClasses ? cellClasses : undefined, 60913 "data-align": align, 60914 tagName: tag, 60915 value: content, 60916 scope: tag === 'th' ? scope : undefined, 60917 colSpan: colspan, 60918 rowSpan: rowspan 60919 }, cellIndex); 60920 }) 60921 }, rowIndex)) 60922 }); 60923 }; 60924 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 60925 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 60926 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { 60927 className: classes === '' ? undefined : classes, 60928 style: { 60929 ...colorProps.style, 60930 ...borderProps.style 60931 }, 60932 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 60933 type: "head", 60934 rows: head 60935 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 60936 type: "body", 60937 rows: body 60938 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { 60939 type: "foot", 60940 rows: foot 60941 })] 60942 }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 60943 tagName: "figcaption", 60944 value: caption, 60945 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') 60946 })] 60947 }); 60948 } 60949 60950 ;// ./node_modules/@wordpress/block-library/build-module/table/utils.js 60951 /** 60952 * Normalize the rowspan/colspan value. 60953 * Returns undefined if the parameter is not a positive number 60954 * or the default value (1) for rowspan/colspan. 60955 * 60956 * @param {number|undefined} rowColSpan rowspan/colspan value. 60957 * 60958 * @return {string|undefined} normalized rowspan/colspan value. 60959 */ 60960 function normalizeRowColSpan(rowColSpan) { 60961 const parsedValue = parseInt(rowColSpan, 10); 60962 if (!Number.isInteger(parsedValue)) { 60963 return undefined; 60964 } 60965 return parsedValue < 0 || parsedValue === 1 ? undefined : parsedValue.toString(); 60966 } 60967 60968 ;// ./node_modules/@wordpress/block-library/build-module/table/transforms.js 60969 /* wp:polyfill */ 60970 /** 60971 * WordPress dependencies 60972 */ 60973 60974 60975 /** 60976 * Internal dependencies 60977 */ 60978 60979 const tableContentPasteSchema = ({ 60980 phrasingContentSchema 60981 }) => ({ 60982 tr: { 60983 allowEmpty: true, 60984 children: { 60985 th: { 60986 allowEmpty: true, 60987 children: phrasingContentSchema, 60988 attributes: ['scope', 'colspan', 'rowspan'] 60989 }, 60990 td: { 60991 allowEmpty: true, 60992 children: phrasingContentSchema, 60993 attributes: ['colspan', 'rowspan'] 60994 } 60995 } 60996 } 60997 }); 60998 const tablePasteSchema = args => ({ 60999 table: { 61000 children: { 61001 thead: { 61002 allowEmpty: true, 61003 children: tableContentPasteSchema(args) 61004 }, 61005 tfoot: { 61006 allowEmpty: true, 61007 children: tableContentPasteSchema(args) 61008 }, 61009 tbody: { 61010 allowEmpty: true, 61011 children: tableContentPasteSchema(args) 61012 } 61013 } 61014 } 61015 }); 61016 const table_transforms_transforms = { 61017 from: [{ 61018 type: 'raw', 61019 selector: 'table', 61020 schema: tablePasteSchema, 61021 transform: node => { 61022 const attributes = Array.from(node.children).reduce((sectionAcc, section) => { 61023 if (!section.children.length) { 61024 return sectionAcc; 61025 } 61026 const sectionName = section.nodeName.toLowerCase().slice(1); 61027 const sectionAttributes = Array.from(section.children).reduce((rowAcc, row) => { 61028 if (!row.children.length) { 61029 return rowAcc; 61030 } 61031 const rowAttributes = Array.from(row.children).reduce((colAcc, col) => { 61032 const rowspan = normalizeRowColSpan(col.getAttribute('rowspan')); 61033 const colspan = normalizeRowColSpan(col.getAttribute('colspan')); 61034 colAcc.push({ 61035 tag: col.nodeName.toLowerCase(), 61036 content: col.innerHTML, 61037 rowspan, 61038 colspan 61039 }); 61040 return colAcc; 61041 }, []); 61042 rowAcc.push({ 61043 cells: rowAttributes 61044 }); 61045 return rowAcc; 61046 }, []); 61047 sectionAcc[sectionName] = sectionAttributes; 61048 return sectionAcc; 61049 }, {}); 61050 return (0,external_wp_blocks_namespaceObject.createBlock)('core/table', attributes); 61051 } 61052 }] 61053 }; 61054 /* harmony default export */ const table_transforms = (table_transforms_transforms); 61055 61056 ;// ./node_modules/@wordpress/block-library/build-module/table/index.js 61057 /** 61058 * WordPress dependencies 61059 */ 61060 61061 61062 61063 /** 61064 * Internal dependencies 61065 */ 61066 61067 61068 61069 const table_metadata = { 61070 $schema: "https://schemas.wp.org/trunk/block.json", 61071 apiVersion: 3, 61072 name: "core/table", 61073 title: "Table", 61074 category: "text", 61075 description: "Create structured content in rows and columns to display information.", 61076 textdomain: "default", 61077 attributes: { 61078 hasFixedLayout: { 61079 type: "boolean", 61080 "default": true 61081 }, 61082 caption: { 61083 type: "rich-text", 61084 source: "rich-text", 61085 selector: "figcaption" 61086 }, 61087 head: { 61088 type: "array", 61089 "default": [], 61090 source: "query", 61091 selector: "thead tr", 61092 query: { 61093 cells: { 61094 type: "array", 61095 "default": [], 61096 source: "query", 61097 selector: "td,th", 61098 query: { 61099 content: { 61100 type: "rich-text", 61101 source: "rich-text" 61102 }, 61103 tag: { 61104 type: "string", 61105 "default": "td", 61106 source: "tag" 61107 }, 61108 scope: { 61109 type: "string", 61110 source: "attribute", 61111 attribute: "scope" 61112 }, 61113 align: { 61114 type: "string", 61115 source: "attribute", 61116 attribute: "data-align" 61117 }, 61118 colspan: { 61119 type: "string", 61120 source: "attribute", 61121 attribute: "colspan" 61122 }, 61123 rowspan: { 61124 type: "string", 61125 source: "attribute", 61126 attribute: "rowspan" 61127 } 61128 } 61129 } 61130 } 61131 }, 61132 body: { 61133 type: "array", 61134 "default": [], 61135 source: "query", 61136 selector: "tbody tr", 61137 query: { 61138 cells: { 61139 type: "array", 61140 "default": [], 61141 source: "query", 61142 selector: "td,th", 61143 query: { 61144 content: { 61145 type: "rich-text", 61146 source: "rich-text" 61147 }, 61148 tag: { 61149 type: "string", 61150 "default": "td", 61151 source: "tag" 61152 }, 61153 scope: { 61154 type: "string", 61155 source: "attribute", 61156 attribute: "scope" 61157 }, 61158 align: { 61159 type: "string", 61160 source: "attribute", 61161 attribute: "data-align" 61162 }, 61163 colspan: { 61164 type: "string", 61165 source: "attribute", 61166 attribute: "colspan" 61167 }, 61168 rowspan: { 61169 type: "string", 61170 source: "attribute", 61171 attribute: "rowspan" 61172 } 61173 } 61174 } 61175 } 61176 }, 61177 foot: { 61178 type: "array", 61179 "default": [], 61180 source: "query", 61181 selector: "tfoot tr", 61182 query: { 61183 cells: { 61184 type: "array", 61185 "default": [], 61186 source: "query", 61187 selector: "td,th", 61188 query: { 61189 content: { 61190 type: "rich-text", 61191 source: "rich-text" 61192 }, 61193 tag: { 61194 type: "string", 61195 "default": "td", 61196 source: "tag" 61197 }, 61198 scope: { 61199 type: "string", 61200 source: "attribute", 61201 attribute: "scope" 61202 }, 61203 align: { 61204 type: "string", 61205 source: "attribute", 61206 attribute: "data-align" 61207 }, 61208 colspan: { 61209 type: "string", 61210 source: "attribute", 61211 attribute: "colspan" 61212 }, 61213 rowspan: { 61214 type: "string", 61215 source: "attribute", 61216 attribute: "rowspan" 61217 } 61218 } 61219 } 61220 } 61221 } 61222 }, 61223 supports: { 61224 anchor: true, 61225 align: true, 61226 color: { 61227 __experimentalSkipSerialization: true, 61228 gradients: true, 61229 __experimentalDefaultControls: { 61230 background: true, 61231 text: true 61232 } 61233 }, 61234 spacing: { 61235 margin: true, 61236 padding: true, 61237 __experimentalDefaultControls: { 61238 margin: false, 61239 padding: false 61240 } 61241 }, 61242 typography: { 61243 fontSize: true, 61244 lineHeight: true, 61245 __experimentalFontFamily: true, 61246 __experimentalFontStyle: true, 61247 __experimentalFontWeight: true, 61248 __experimentalLetterSpacing: true, 61249 __experimentalTextTransform: true, 61250 __experimentalTextDecoration: true, 61251 __experimentalDefaultControls: { 61252 fontSize: true 61253 } 61254 }, 61255 __experimentalBorder: { 61256 __experimentalSkipSerialization: true, 61257 color: true, 61258 style: true, 61259 width: true, 61260 __experimentalDefaultControls: { 61261 color: true, 61262 style: true, 61263 width: true 61264 } 61265 }, 61266 interactivity: { 61267 clientNavigation: true 61268 } 61269 }, 61270 selectors: { 61271 root: ".wp-block-table > table", 61272 spacing: ".wp-block-table" 61273 }, 61274 styles: [{ 61275 name: "regular", 61276 label: "Default", 61277 isDefault: true 61278 }, { 61279 name: "stripes", 61280 label: "Stripes" 61281 }], 61282 editorStyle: "wp-block-table-editor", 61283 style: "wp-block-table" 61284 }; 61285 61286 61287 const { 61288 name: table_name 61289 } = table_metadata; 61290 61291 const table_settings = { 61292 icon: block_table, 61293 example: { 61294 attributes: { 61295 head: [{ 61296 cells: [{ 61297 content: (0,external_wp_i18n_namespaceObject.__)('Version'), 61298 tag: 'th' 61299 }, { 61300 content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'), 61301 tag: 'th' 61302 }, { 61303 content: (0,external_wp_i18n_namespaceObject.__)('Release Date'), 61304 tag: 'th' 61305 }] 61306 }], 61307 body: [{ 61308 cells: [{ 61309 content: '5.2', 61310 tag: 'td' 61311 }, { 61312 content: 'Jaco Pastorius', 61313 tag: 'td' 61314 }, { 61315 content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'), 61316 tag: 'td' 61317 }] 61318 }, { 61319 cells: [{ 61320 content: '5.1', 61321 tag: 'td' 61322 }, { 61323 content: 'Betty Carter', 61324 tag: 'td' 61325 }, { 61326 content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'), 61327 tag: 'td' 61328 }] 61329 }, { 61330 cells: [{ 61331 content: '5.0', 61332 tag: 'td' 61333 }, { 61334 content: 'Bebo Valdés', 61335 tag: 'td' 61336 }, { 61337 content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'), 61338 tag: 'td' 61339 }] 61340 }] 61341 }, 61342 viewportWidth: 450 61343 }, 61344 transforms: table_transforms, 61345 edit: table_edit, 61346 save: table_save_save, 61347 deprecated: table_deprecated 61348 }; 61349 const table_init = () => initBlock({ 61350 name: table_name, 61351 metadata: table_metadata, 61352 settings: table_settings 61353 }); 61354 61355 ;// ./node_modules/@wordpress/icons/build-module/library/table-of-contents.js 61356 /** 61357 * WordPress dependencies 61358 */ 61359 61360 61361 const tableOfContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { 61362 xmlns: "http://www.w3.org/2000/svg", 61363 viewBox: "0 0 24 24", 61364 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 61365 fillRule: "evenodd", 61366 clipRule: "evenodd", 61367 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" 61368 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 61369 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" 61370 })] 61371 }); 61372 /* harmony default export */ const table_of_contents = (tableOfContents); 61373 61374 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/list.js 61375 /* wp:polyfill */ 61376 61377 /** 61378 * External dependencies 61379 */ 61380 61381 /** 61382 * Internal dependencies 61383 */ 61384 61385 const ENTRY_CLASS_NAME = 'wp-block-table-of-contents__entry'; 61386 function TableOfContentsList({ 61387 nestedHeadingList, 61388 disableLinkActivation, 61389 onClick 61390 }) { 61391 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 61392 children: nestedHeadingList.map((node, index) => { 61393 const { 61394 content, 61395 link 61396 } = node.heading; 61397 const entry = link ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 61398 className: ENTRY_CLASS_NAME, 61399 href: link, 61400 "aria-disabled": disableLinkActivation || undefined, 61401 onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined, 61402 children: content 61403 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 61404 className: ENTRY_CLASS_NAME, 61405 children: content 61406 }); 61407 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 61408 children: [entry, node.children ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 61409 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { 61410 nestedHeadingList: node.children, 61411 disableLinkActivation: disableLinkActivation, 61412 onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined 61413 }) 61414 }) : null] 61415 }, index); 61416 }) 61417 }); 61418 } 61419 61420 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/utils.js 61421 /* wp:polyfill */ 61422 /** 61423 * Takes a flat list of heading parameters and nests them based on each header's 61424 * immediate parent's level. 61425 * 61426 * @param headingList The flat list of headings to nest. 61427 * 61428 * @return The nested list of headings. 61429 */ 61430 function linearToNestedHeadingList(headingList) { 61431 const nestedHeadingList = []; 61432 headingList.forEach((heading, key) => { 61433 if (heading.content === '') { 61434 return; 61435 } 61436 61437 // Make sure we are only working with the same level as the first iteration in our set. 61438 if (heading.level === headingList[0].level) { 61439 // Check that the next iteration will return a value. 61440 // If it does and the next level is greater than the current level, 61441 // the next iteration becomes a child of the current iteration. 61442 if (headingList[key + 1]?.level > heading.level) { 61443 // We must calculate the last index before the next iteration that 61444 // has the same level (siblings). We then use this index to slice 61445 // the array for use in recursion. This prevents duplicate nodes. 61446 let endOfSlice = headingList.length; 61447 for (let i = key + 1; i < headingList.length; i++) { 61448 if (headingList[i].level === heading.level) { 61449 endOfSlice = i; 61450 break; 61451 } 61452 } 61453 61454 // We found a child node: Push a new node onto the return array 61455 // with children. 61456 nestedHeadingList.push({ 61457 heading, 61458 children: linearToNestedHeadingList(headingList.slice(key + 1, endOfSlice)) 61459 }); 61460 } else { 61461 // No child node: Push a new node onto the return array. 61462 nestedHeadingList.push({ 61463 heading, 61464 children: null 61465 }); 61466 } 61467 } 61468 }); 61469 return nestedHeadingList; 61470 } 61471 61472 // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js 61473 var es6 = __webpack_require__(7734); 61474 var es6_default = /*#__PURE__*/__webpack_require__.n(es6); 61475 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/hooks.js 61476 /** 61477 * External dependencies 61478 */ 61479 61480 61481 /** 61482 * WordPress dependencies 61483 */ 61484 61485 61486 61487 61488 61489 function getLatestHeadings(select, clientId) { 61490 var _select$getPermalink, _getBlockAttributes; 61491 const { 61492 getBlockAttributes, 61493 getBlockName, 61494 getClientIdsWithDescendants, 61495 getBlocksByName 61496 } = select(external_wp_blockEditor_namespaceObject.store); 61497 61498 // FIXME: @wordpress/block-library should not depend on @wordpress/editor. 61499 // Blocks can be loaded into a *non-post* block editor, so to avoid 61500 // declaring @wordpress/editor as a dependency, we must access its 61501 // store by string. When the store is not available, editorSelectors 61502 // will be null, and the block's saved markup will lack permalinks. 61503 // eslint-disable-next-line @wordpress/data-no-store-string-literals 61504 const permalink = (_select$getPermalink = select('core/editor').getPermalink()) !== null && _select$getPermalink !== void 0 ? _select$getPermalink : null; 61505 const isPaginated = getBlocksByName('core/nextpage').length !== 0; 61506 const { 61507 onlyIncludeCurrentPage 61508 } = (_getBlockAttributes = getBlockAttributes(clientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {}; 61509 61510 // Get the client ids of all blocks in the editor. 61511 const allBlockClientIds = getClientIdsWithDescendants(); 61512 61513 // 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. 61514 let tocPage = 1; 61515 if (isPaginated && onlyIncludeCurrentPage) { 61516 // We can't use getBlockIndex because it only returns the index 61517 // relative to sibling blocks. 61518 const tocIndex = allBlockClientIds.indexOf(clientId); 61519 for (const [blockIndex, blockClientId] of allBlockClientIds.entries()) { 61520 // If we've reached blocks after the Table of Contents, we've 61521 // finished calculating which page the block is on. 61522 if (blockIndex >= tocIndex) { 61523 break; 61524 } 61525 if (getBlockName(blockClientId) === 'core/nextpage') { 61526 tocPage++; 61527 } 61528 } 61529 } 61530 const latestHeadings = []; 61531 61532 /** The page (of a paginated post) a heading will be part of. */ 61533 let headingPage = 1; 61534 let headingPageLink = null; 61535 61536 // If the core/editor store is available, we can add permalinks to the 61537 // generated table of contents. 61538 if (typeof permalink === 'string') { 61539 headingPageLink = isPaginated ? (0,external_wp_url_namespaceObject.addQueryArgs)(permalink, { 61540 page: headingPage 61541 }) : permalink; 61542 } 61543 for (const blockClientId of allBlockClientIds) { 61544 const blockName = getBlockName(blockClientId); 61545 if (blockName === 'core/nextpage') { 61546 headingPage++; 61547 61548 // If we're only including headings from the current page (of 61549 // a paginated post), then exit the loop if we've reached the 61550 // pages after the one with the Table of Contents block. 61551 if (onlyIncludeCurrentPage && headingPage > tocPage) { 61552 break; 61553 } 61554 if (typeof permalink === 'string') { 61555 headingPageLink = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(permalink, ['page']), { 61556 page: headingPage 61557 }); 61558 } 61559 } 61560 // If we're including all headings or we've reached headings on 61561 // the same page as the Table of Contents block, add them to the 61562 // list. 61563 else if (!onlyIncludeCurrentPage || headingPage === tocPage) { 61564 if (blockName === 'core/heading') { 61565 const headingAttributes = getBlockAttributes(blockClientId); 61566 const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== ''; 61567 latestHeadings.push({ 61568 // Convert line breaks to spaces, and get rid of HTML tags in the headings. 61569 content: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(<br *\/?>)+/g, ' ')), 61570 level: headingAttributes.level, 61571 link: canBeLinked ? `$headingPageLink}#${headingAttributes.anchor}` : null 61572 }); 61573 } 61574 } 61575 } 61576 return latestHeadings; 61577 } 61578 function observeCallback(select, dispatch, clientId) { 61579 const { 61580 getBlockAttributes 61581 } = select(external_wp_blockEditor_namespaceObject.store); 61582 const { 61583 updateBlockAttributes, 61584 __unstableMarkNextChangeAsNotPersistent 61585 } = dispatch(external_wp_blockEditor_namespaceObject.store); 61586 61587 /** 61588 * If the block no longer exists in the store, skip the update. 61589 * The "undo" action recreates the block and provides a new `clientId`. 61590 * The hook still might be observing the changes while the old block unmounts. 61591 */ 61592 const attributes = getBlockAttributes(clientId); 61593 if (attributes === null) { 61594 return; 61595 } 61596 const headings = getLatestHeadings(select, clientId); 61597 if (!es6_default()(headings, attributes.headings)) { 61598 __unstableMarkNextChangeAsNotPersistent(); 61599 updateBlockAttributes(clientId, { 61600 headings 61601 }); 61602 } 61603 } 61604 function useObserveHeadings(clientId) { 61605 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 61606 (0,external_wp_element_namespaceObject.useEffect)(() => { 61607 // Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`. 61608 // See: https://github.com/WordPress/gutenberg/pull/45513 61609 return registry.subscribe(() => observeCallback(registry.select, registry.dispatch, clientId)); 61610 }, [registry, clientId]); 61611 } 61612 61613 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/edit.js 61614 /** 61615 * WordPress dependencies 61616 */ 61617 61618 61619 61620 61621 61622 61623 61624 61625 61626 61627 /** 61628 * Internal dependencies 61629 */ 61630 61631 61632 61633 61634 61635 /** @typedef {import('./utils').HeadingData} HeadingData */ 61636 61637 /** 61638 * Table of Contents block edit component. 61639 * 61640 * @param {Object} props The props. 61641 * @param {Object} props.attributes The block attributes. 61642 * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post. 61643 * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated). 61644 * @param {string} props.clientId 61645 * @param {(attributes: Object) => void} props.setAttributes 61646 * 61647 * @return {Component} The component. 61648 */ 61649 61650 function TableOfContentsEdit({ 61651 attributes: { 61652 headings = [], 61653 onlyIncludeCurrentPage 61654 }, 61655 clientId, 61656 setAttributes 61657 }) { 61658 useObserveHeadings(clientId); 61659 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 61660 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TableOfContentsEdit, 'table-of-contents'); 61661 61662 // If a user clicks to a link prevent redirection and show a warning. 61663 const { 61664 createWarningNotice 61665 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 61666 const showRedirectionPreventedNotice = event => { 61667 event.preventDefault(); 61668 createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { 61669 id: `block-library/core/table-of-contents/redirection-prevented/$instanceId}`, 61670 type: 'snackbar' 61671 }); 61672 }; 61673 const canInsertList = (0,external_wp_data_namespaceObject.useSelect)(select => { 61674 const { 61675 getBlockRootClientId, 61676 canInsertBlockType 61677 } = select(external_wp_blockEditor_namespaceObject.store); 61678 const rootClientId = getBlockRootClientId(clientId); 61679 return canInsertBlockType('core/list', rootClientId); 61680 }, [clientId]); 61681 const { 61682 replaceBlocks 61683 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 61684 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 61685 const headingTree = linearToNestedHeadingList(headings); 61686 const toolbarControls = canInsertList && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 61687 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 61688 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 61689 onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { 61690 ordered: true, 61691 values: (0,external_wp_element_namespaceObject.renderToString)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { 61692 nestedHeadingList: headingTree 61693 })) 61694 })), 61695 children: (0,external_wp_i18n_namespaceObject.__)('Convert to static list') 61696 }) 61697 }) 61698 }); 61699 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 61700 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 61701 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 61702 resetAll: () => { 61703 setAttributes({ 61704 onlyIncludeCurrentPage: false 61705 }); 61706 }, 61707 dropdownMenuProps: dropdownMenuProps, 61708 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 61709 hasValue: () => !!onlyIncludeCurrentPage, 61710 label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'), 61711 onDeselect: () => setAttributes({ 61712 onlyIncludeCurrentPage: false 61713 }), 61714 isShownByDefault: true, 61715 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 61716 __nextHasNoMarginBottom: true, 61717 label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'), 61718 checked: onlyIncludeCurrentPage, 61719 onChange: value => setAttributes({ 61720 onlyIncludeCurrentPage: value 61721 }), 61722 help: onlyIncludeCurrentPage ? (0,external_wp_i18n_namespaceObject.__)('Only including headings from the current page (if the post is paginated).') : (0,external_wp_i18n_namespaceObject.__)('Include headings from all pages (if the post is paginated).') 61723 }) 61724 }) 61725 }) 61726 }); 61727 61728 // If there are no headings or the only heading is empty. 61729 // Note that the toolbar controls are intentionally omitted since the 61730 // "Convert to static list" option is useless to the placeholder state. 61731 if (headings.length === 0) { 61732 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 61733 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 61734 ...blockProps, 61735 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 61736 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 61737 icon: table_of_contents 61738 }), 61739 label: (0,external_wp_i18n_namespaceObject.__)('Table of Contents'), 61740 instructions: (0,external_wp_i18n_namespaceObject.__)('Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.') 61741 }) 61742 }), inspectorControls] 61743 }); 61744 } 61745 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 61746 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { 61747 ...blockProps, 61748 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 61749 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { 61750 nestedHeadingList: headingTree, 61751 disableLinkActivation: true, 61752 onClick: showRedirectionPreventedNotice 61753 }) 61754 }) 61755 }), toolbarControls, inspectorControls] 61756 }); 61757 } 61758 61759 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/save.js 61760 /** 61761 * WordPress dependencies 61762 */ 61763 61764 61765 /** 61766 * Internal dependencies 61767 */ 61768 61769 61770 61771 function table_of_contents_save_save({ 61772 attributes: { 61773 headings = [] 61774 } 61775 }) { 61776 if (headings.length === 0) { 61777 return null; 61778 } 61779 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { 61780 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 61781 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 61782 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { 61783 nestedHeadingList: linearToNestedHeadingList(headings) 61784 }) 61785 }) 61786 }); 61787 } 61788 61789 ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js 61790 /** 61791 * WordPress dependencies 61792 */ 61793 61794 61795 61796 /** 61797 * Internal dependencies 61798 */ 61799 61800 const table_of_contents_metadata = { 61801 $schema: "https://schemas.wp.org/trunk/block.json", 61802 apiVersion: 3, 61803 __experimental: true, 61804 name: "core/table-of-contents", 61805 title: "Table of Contents", 61806 category: "design", 61807 description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.", 61808 keywords: ["document outline", "summary"], 61809 textdomain: "default", 61810 attributes: { 61811 headings: { 61812 type: "array", 61813 items: { 61814 type: "object" 61815 }, 61816 "default": [] 61817 }, 61818 onlyIncludeCurrentPage: { 61819 type: "boolean", 61820 "default": false 61821 } 61822 }, 61823 supports: { 61824 html: false, 61825 color: { 61826 text: true, 61827 background: true, 61828 gradients: true, 61829 link: true 61830 }, 61831 spacing: { 61832 margin: true, 61833 padding: true 61834 }, 61835 typography: { 61836 fontSize: true, 61837 lineHeight: true, 61838 __experimentalFontFamily: true, 61839 __experimentalFontWeight: true, 61840 __experimentalFontStyle: true, 61841 __experimentalTextTransform: true, 61842 __experimentalTextDecoration: true, 61843 __experimentalLetterSpacing: true, 61844 __experimentalDefaultControls: { 61845 fontSize: true 61846 } 61847 }, 61848 interactivity: { 61849 clientNavigation: true 61850 }, 61851 __experimentalBorder: { 61852 radius: true, 61853 color: true, 61854 width: true, 61855 style: true, 61856 __experimentalDefaultControls: { 61857 radius: true, 61858 color: true, 61859 width: true, 61860 style: true 61861 } 61862 } 61863 }, 61864 style: "wp-block-table-of-contents" 61865 }; 61866 61867 61868 const { 61869 name: table_of_contents_name 61870 } = table_of_contents_metadata; 61871 61872 const table_of_contents_settings = { 61873 icon: table_of_contents, 61874 edit: TableOfContentsEdit, 61875 save: table_of_contents_save_save, 61876 example: { 61877 innerBlocks: [{ 61878 name: 'core/heading', 61879 attributes: { 61880 level: 2, 61881 content: (0,external_wp_i18n_namespaceObject.__)('Heading') 61882 } 61883 }, { 61884 name: 'core/heading', 61885 attributes: { 61886 level: 3, 61887 content: (0,external_wp_i18n_namespaceObject.__)('Subheading') 61888 } 61889 }, { 61890 name: 'core/heading', 61891 attributes: { 61892 level: 2, 61893 content: (0,external_wp_i18n_namespaceObject.__)('Heading') 61894 } 61895 }, { 61896 name: 'core/heading', 61897 attributes: { 61898 level: 3, 61899 content: (0,external_wp_i18n_namespaceObject.__)('Subheading') 61900 } 61901 }], 61902 attributes: { 61903 headings: [{ 61904 content: (0,external_wp_i18n_namespaceObject.__)('Heading'), 61905 level: 2 61906 }, { 61907 content: (0,external_wp_i18n_namespaceObject.__)('Subheading'), 61908 level: 3 61909 }, { 61910 content: (0,external_wp_i18n_namespaceObject.__)('Heading'), 61911 level: 2 61912 }, { 61913 content: (0,external_wp_i18n_namespaceObject.__)('Subheading'), 61914 level: 3 61915 }] 61916 } 61917 } 61918 }; 61919 const table_of_contents_init = () => initBlock({ 61920 name: table_of_contents_name, 61921 metadata: table_of_contents_metadata, 61922 settings: table_of_contents_settings 61923 }); 61924 61925 ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js 61926 /** 61927 * WordPress dependencies 61928 */ 61929 61930 const tag_cloud_transforms_transforms = { 61931 from: [{ 61932 type: 'block', 61933 blocks: ['core/categories'], 61934 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud') 61935 }], 61936 to: [{ 61937 type: 'block', 61938 blocks: ['core/categories'], 61939 transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories') 61940 }] 61941 }; 61942 /* harmony default export */ const tag_cloud_transforms = (tag_cloud_transforms_transforms); 61943 61944 ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js 61945 /* wp:polyfill */ 61946 /** 61947 * WordPress dependencies 61948 */ 61949 61950 61951 61952 61953 61954 61955 61956 /** 61957 * Internal dependencies 61958 */ 61959 61960 61961 /** 61962 * Minimum number of tags a user can show using this block. 61963 * 61964 * @type {number} 61965 */ 61966 61967 const MIN_TAGS = 1; 61968 61969 /** 61970 * Maximum number of tags a user can show using this block. 61971 * 61972 * @type {number} 61973 */ 61974 const MAX_TAGS = 100; 61975 const MIN_FONT_SIZE = 0.1; 61976 const MAX_FONT_SIZE = 100; 61977 function TagCloudEdit({ 61978 attributes, 61979 setAttributes 61980 }) { 61981 const { 61982 taxonomy, 61983 showTagCounts, 61984 numberOfTags, 61985 smallestFontSize, 61986 largestFontSize 61987 } = attributes; 61988 const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); 61989 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 61990 61991 // The `pt` unit is used as the default value and is therefore 61992 // always considered an available unit. 61993 const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ 61994 availableUnits: availableUnits ? [...availableUnits, 'pt'] : ['%', 'px', 'em', 'rem', 'pt'] 61995 }); 61996 const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTaxonomies({ 61997 per_page: -1 61998 }), []); 61999 const getTaxonomyOptions = () => { 62000 const selectOption = { 62001 label: (0,external_wp_i18n_namespaceObject.__)('- Select -'), 62002 value: '', 62003 disabled: true 62004 }; 62005 const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(tax => !!tax.show_cloud).map(item => { 62006 return { 62007 value: item.slug, 62008 label: item.name 62009 }; 62010 }); 62011 return [selectOption, ...taxonomyOptions]; 62012 }; 62013 const onFontSizeChange = (fontSizeLabel, newValue) => { 62014 // eslint-disable-next-line @wordpress/no-unused-vars-before-return 62015 const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue); 62016 if (!Number.isFinite(quantity)) { 62017 return; 62018 } 62019 const updateObj = { 62020 [fontSizeLabel]: newValue 62021 }; 62022 // We need to keep in sync the `unit` changes to both `smallestFontSize` 62023 // and `largestFontSize` attributes. 62024 Object.entries({ 62025 smallestFontSize, 62026 largestFontSize 62027 }).forEach(([attribute, currentValue]) => { 62028 const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); 62029 // Only add an update if the other font size attribute has a different unit. 62030 if (attribute !== fontSizeLabel && currentUnit !== newUnit) { 62031 updateObj[attribute] = `$currentQuantity}$newUnit}`; 62032 } 62033 }); 62034 setAttributes(updateObj); 62035 }; 62036 62037 // Remove border styles from the server-side attributes to prevent duplicate border. 62038 const serverSideAttributes = { 62039 ...attributes, 62040 style: { 62041 ...attributes?.style, 62042 border: undefined 62043 } 62044 }; 62045 const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 62046 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 62047 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 62048 resetAll: () => { 62049 setAttributes({ 62050 taxonomy: 'post_tag', 62051 showTagCounts: false, 62052 numberOfTags: 45, 62053 smallestFontSize: '8pt', 62054 largestFontSize: '22pt' 62055 }); 62056 }, 62057 dropdownMenuProps: dropdownMenuProps, 62058 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 62059 hasValue: () => taxonomy !== 'post_tag', 62060 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), 62061 onDeselect: () => setAttributes({ 62062 taxonomy: 'post_tag' 62063 }), 62064 isShownByDefault: true, 62065 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 62066 __nextHasNoMarginBottom: true, 62067 __next40pxDefaultSize: true, 62068 label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), 62069 options: getTaxonomyOptions(), 62070 value: taxonomy, 62071 onChange: selectedTaxonomy => setAttributes({ 62072 taxonomy: selectedTaxonomy 62073 }) 62074 }) 62075 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 62076 hasValue: () => smallestFontSize !== '8pt' || largestFontSize !== '22pt', 62077 label: (0,external_wp_i18n_namespaceObject.__)('Font size'), 62078 onDeselect: () => setAttributes({ 62079 smallestFontSize: '8pt', 62080 largestFontSize: '22pt' 62081 }), 62082 isShownByDefault: true, 62083 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { 62084 gap: 4, 62085 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 62086 isBlock: true, 62087 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 62088 label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'), 62089 value: smallestFontSize, 62090 onChange: value => { 62091 onFontSizeChange('smallestFontSize', value); 62092 }, 62093 units: units, 62094 min: MIN_FONT_SIZE, 62095 max: MAX_FONT_SIZE, 62096 size: "__unstable-large" 62097 }) 62098 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 62099 isBlock: true, 62100 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { 62101 label: (0,external_wp_i18n_namespaceObject.__)('Largest size'), 62102 value: largestFontSize, 62103 onChange: value => { 62104 onFontSizeChange('largestFontSize', value); 62105 }, 62106 units: units, 62107 min: MIN_FONT_SIZE, 62108 max: MAX_FONT_SIZE, 62109 size: "__unstable-large" 62110 }) 62111 })] 62112 }) 62113 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 62114 hasValue: () => numberOfTags !== 45, 62115 label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'), 62116 onDeselect: () => setAttributes({ 62117 numberOfTags: 45 62118 }), 62119 isShownByDefault: true, 62120 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 62121 __nextHasNoMarginBottom: true, 62122 __next40pxDefaultSize: true, 62123 label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'), 62124 value: numberOfTags, 62125 onChange: value => setAttributes({ 62126 numberOfTags: value 62127 }), 62128 min: MIN_TAGS, 62129 max: MAX_TAGS, 62130 required: true 62131 }) 62132 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 62133 hasValue: () => showTagCounts !== false, 62134 label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'), 62135 onDeselect: () => setAttributes({ 62136 showTagCounts: false 62137 }), 62138 isShownByDefault: true, 62139 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 62140 __nextHasNoMarginBottom: true, 62141 label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'), 62142 checked: showTagCounts, 62143 onChange: () => setAttributes({ 62144 showTagCounts: !showTagCounts 62145 }) 62146 }) 62147 })] 62148 }) 62149 }); 62150 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 62151 children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 62152 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), 62153 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 62154 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { 62155 skipBlockSupportAttributes: true, 62156 block: "core/tag-cloud", 62157 attributes: serverSideAttributes 62158 }) 62159 }) 62160 })] 62161 }); 62162 } 62163 /* harmony default export */ const tag_cloud_edit = (TagCloudEdit); 62164 62165 ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js 62166 /** 62167 * WordPress dependencies 62168 */ 62169 62170 62171 /** 62172 * Internal dependencies 62173 */ 62174 62175 62176 const tag_cloud_metadata = { 62177 $schema: "https://schemas.wp.org/trunk/block.json", 62178 apiVersion: 3, 62179 name: "core/tag-cloud", 62180 title: "Tag Cloud", 62181 category: "widgets", 62182 description: "A cloud of popular keywords, each sized by how often it appears.", 62183 textdomain: "default", 62184 attributes: { 62185 numberOfTags: { 62186 type: "number", 62187 "default": 45, 62188 minimum: 1, 62189 maximum: 100 62190 }, 62191 taxonomy: { 62192 type: "string", 62193 "default": "post_tag" 62194 }, 62195 showTagCounts: { 62196 type: "boolean", 62197 "default": false 62198 }, 62199 smallestFontSize: { 62200 type: "string", 62201 "default": "8pt" 62202 }, 62203 largestFontSize: { 62204 type: "string", 62205 "default": "22pt" 62206 } 62207 }, 62208 styles: [{ 62209 name: "default", 62210 label: "Default", 62211 isDefault: true 62212 }, { 62213 name: "outline", 62214 label: "Outline" 62215 }], 62216 supports: { 62217 html: false, 62218 align: true, 62219 spacing: { 62220 margin: true, 62221 padding: true 62222 }, 62223 typography: { 62224 lineHeight: true, 62225 __experimentalFontFamily: true, 62226 __experimentalFontWeight: true, 62227 __experimentalFontStyle: true, 62228 __experimentalTextTransform: true, 62229 __experimentalLetterSpacing: true 62230 }, 62231 interactivity: { 62232 clientNavigation: true 62233 }, 62234 __experimentalBorder: { 62235 radius: true, 62236 color: true, 62237 width: true, 62238 style: true, 62239 __experimentalDefaultControls: { 62240 radius: true, 62241 color: true, 62242 width: true, 62243 style: true 62244 } 62245 } 62246 }, 62247 editorStyle: "wp-block-tag-cloud-editor" 62248 }; 62249 62250 const { 62251 name: tag_cloud_name 62252 } = tag_cloud_metadata; 62253 62254 const tag_cloud_settings = { 62255 icon: library_tag, 62256 example: {}, 62257 edit: tag_cloud_edit, 62258 transforms: tag_cloud_transforms 62259 }; 62260 const tag_cloud_init = () => initBlock({ 62261 name: tag_cloud_name, 62262 metadata: tag_cloud_metadata, 62263 settings: tag_cloud_settings 62264 }); 62265 62266 ;// ./node_modules/tslib/tslib.es6.mjs 62267 /****************************************************************************** 62268 Copyright (c) Microsoft Corporation. 62269 62270 Permission to use, copy, modify, and/or distribute this software for any 62271 purpose with or without fee is hereby granted. 62272 62273 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 62274 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 62275 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 62276 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 62277 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 62278 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 62279 PERFORMANCE OF THIS SOFTWARE. 62280 ***************************************************************************** */ 62281 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 62282 62283 var extendStatics = function(d, b) { 62284 extendStatics = Object.setPrototypeOf || 62285 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 62286 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 62287 return extendStatics(d, b); 62288 }; 62289 62290 function __extends(d, b) { 62291 if (typeof b !== "function" && b !== null) 62292 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 62293 extendStatics(d, b); 62294 function __() { this.constructor = d; } 62295 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 62296 } 62297 62298 var __assign = function() { 62299 __assign = Object.assign || function __assign(t) { 62300 for (var s, i = 1, n = arguments.length; i < n; i++) { 62301 s = arguments[i]; 62302 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 62303 } 62304 return t; 62305 } 62306 return __assign.apply(this, arguments); 62307 } 62308 62309 function __rest(s, e) { 62310 var t = {}; 62311 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 62312 t[p] = s[p]; 62313 if (s != null && typeof Object.getOwnPropertySymbols === "function") 62314 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 62315 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 62316 t[p[i]] = s[p[i]]; 62317 } 62318 return t; 62319 } 62320 62321 function __decorate(decorators, target, key, desc) { 62322 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 62323 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 62324 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; 62325 return c > 3 && r && Object.defineProperty(target, key, r), r; 62326 } 62327 62328 function __param(paramIndex, decorator) { 62329 return function (target, key) { decorator(target, key, paramIndex); } 62330 } 62331 62332 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 62333 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 62334 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 62335 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 62336 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 62337 var _, done = false; 62338 for (var i = decorators.length - 1; i >= 0; i--) { 62339 var context = {}; 62340 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 62341 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 62342 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 62343 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 62344 if (kind === "accessor") { 62345 if (result === void 0) continue; 62346 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 62347 if (_ = accept(result.get)) descriptor.get = _; 62348 if (_ = accept(result.set)) descriptor.set = _; 62349 if (_ = accept(result.init)) initializers.unshift(_); 62350 } 62351 else if (_ = accept(result)) { 62352 if (kind === "field") initializers.unshift(_); 62353 else descriptor[key] = _; 62354 } 62355 } 62356 if (target) Object.defineProperty(target, contextIn.name, descriptor); 62357 done = true; 62358 }; 62359 62360 function __runInitializers(thisArg, initializers, value) { 62361 var useValue = arguments.length > 2; 62362 for (var i = 0; i < initializers.length; i++) { 62363 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 62364 } 62365 return useValue ? value : void 0; 62366 }; 62367 62368 function __propKey(x) { 62369 return typeof x === "symbol" ? x : "".concat(x); 62370 }; 62371 62372 function __setFunctionName(f, name, prefix) { 62373 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 62374 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 62375 }; 62376 62377 function __metadata(metadataKey, metadataValue) { 62378 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 62379 } 62380 62381 function __awaiter(thisArg, _arguments, P, generator) { 62382 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 62383 return new (P || (P = Promise))(function (resolve, reject) { 62384 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 62385 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 62386 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 62387 step((generator = generator.apply(thisArg, _arguments || [])).next()); 62388 }); 62389 } 62390 62391 function __generator(thisArg, body) { 62392 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 62393 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 62394 function verb(n) { return function (v) { return step([n, v]); }; } 62395 function step(op) { 62396 if (f) throw new TypeError("Generator is already executing."); 62397 while (g && (g = 0, op[0] && (_ = 0)), _) try { 62398 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; 62399 if (y = 0, t) op = [op[0] & 2, t.value]; 62400 switch (op[0]) { 62401 case 0: case 1: t = op; break; 62402 case 4: _.label++; return { value: op[1], done: false }; 62403 case 5: _.label++; y = op[1]; op = [0]; continue; 62404 case 7: op = _.ops.pop(); _.trys.pop(); continue; 62405 default: 62406 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 62407 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 62408 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 62409 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 62410 if (t[2]) _.ops.pop(); 62411 _.trys.pop(); continue; 62412 } 62413 op = body.call(thisArg, _); 62414 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 62415 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 62416 } 62417 } 62418 62419 var __createBinding = Object.create ? (function(o, m, k, k2) { 62420 if (k2 === undefined) k2 = k; 62421 var desc = Object.getOwnPropertyDescriptor(m, k); 62422 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 62423 desc = { enumerable: true, get: function() { return m[k]; } }; 62424 } 62425 Object.defineProperty(o, k2, desc); 62426 }) : (function(o, m, k, k2) { 62427 if (k2 === undefined) k2 = k; 62428 o[k2] = m[k]; 62429 }); 62430 62431 function __exportStar(m, o) { 62432 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 62433 } 62434 62435 function __values(o) { 62436 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 62437 if (m) return m.call(o); 62438 if (o && typeof o.length === "number") return { 62439 next: function () { 62440 if (o && i >= o.length) o = void 0; 62441 return { value: o && o[i++], done: !o }; 62442 } 62443 }; 62444 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 62445 } 62446 62447 function __read(o, n) { 62448 var m = typeof Symbol === "function" && o[Symbol.iterator]; 62449 if (!m) return o; 62450 var i = m.call(o), r, ar = [], e; 62451 try { 62452 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 62453 } 62454 catch (error) { e = { error: error }; } 62455 finally { 62456 try { 62457 if (r && !r.done && (m = i["return"])) m.call(i); 62458 } 62459 finally { if (e) throw e.error; } 62460 } 62461 return ar; 62462 } 62463 62464 /** @deprecated */ 62465 function __spread() { 62466 for (var ar = [], i = 0; i < arguments.length; i++) 62467 ar = ar.concat(__read(arguments[i])); 62468 return ar; 62469 } 62470 62471 /** @deprecated */ 62472 function __spreadArrays() { 62473 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 62474 for (var r = Array(s), k = 0, i = 0; i < il; i++) 62475 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 62476 r[k] = a[j]; 62477 return r; 62478 } 62479 62480 function __spreadArray(to, from, pack) { 62481 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 62482 if (ar || !(i in from)) { 62483 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 62484 ar[i] = from[i]; 62485 } 62486 } 62487 return to.concat(ar || Array.prototype.slice.call(from)); 62488 } 62489 62490 function __await(v) { 62491 return this instanceof __await ? (this.v = v, this) : new __await(v); 62492 } 62493 62494 function __asyncGenerator(thisArg, _arguments, generator) { 62495 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 62496 var g = generator.apply(thisArg, _arguments || []), i, q = []; 62497 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 62498 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 62499 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 62500 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 62501 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 62502 function fulfill(value) { resume("next", value); } 62503 function reject(value) { resume("throw", value); } 62504 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 62505 } 62506 62507 function __asyncDelegator(o) { 62508 var i, p; 62509 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 62510 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; } 62511 } 62512 62513 function __asyncValues(o) { 62514 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 62515 var m = o[Symbol.asyncIterator], i; 62516 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); 62517 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); }); }; } 62518 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 62519 } 62520 62521 function __makeTemplateObject(cooked, raw) { 62522 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 62523 return cooked; 62524 }; 62525 62526 var __setModuleDefault = Object.create ? (function(o, v) { 62527 Object.defineProperty(o, "default", { enumerable: true, value: v }); 62528 }) : function(o, v) { 62529 o["default"] = v; 62530 }; 62531 62532 var ownKeys = function(o) { 62533 ownKeys = Object.getOwnPropertyNames || function (o) { 62534 var ar = []; 62535 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 62536 return ar; 62537 }; 62538 return ownKeys(o); 62539 }; 62540 62541 function __importStar(mod) { 62542 if (mod && mod.__esModule) return mod; 62543 var result = {}; 62544 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 62545 __setModuleDefault(result, mod); 62546 return result; 62547 } 62548 62549 function __importDefault(mod) { 62550 return (mod && mod.__esModule) ? mod : { default: mod }; 62551 } 62552 62553 function __classPrivateFieldGet(receiver, state, kind, f) { 62554 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 62555 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"); 62556 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 62557 } 62558 62559 function __classPrivateFieldSet(receiver, state, value, kind, f) { 62560 if (kind === "m") throw new TypeError("Private method is not writable"); 62561 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 62562 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"); 62563 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 62564 } 62565 62566 function __classPrivateFieldIn(state, receiver) { 62567 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 62568 return typeof state === "function" ? receiver === state : state.has(receiver); 62569 } 62570 62571 function __addDisposableResource(env, value, async) { 62572 if (value !== null && value !== void 0) { 62573 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 62574 var dispose, inner; 62575 if (async) { 62576 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 62577 dispose = value[Symbol.asyncDispose]; 62578 } 62579 if (dispose === void 0) { 62580 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 62581 dispose = value[Symbol.dispose]; 62582 if (async) inner = dispose; 62583 } 62584 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 62585 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 62586 env.stack.push({ value: value, dispose: dispose, async: async }); 62587 } 62588 else if (async) { 62589 env.stack.push({ async: true }); 62590 } 62591 return value; 62592 } 62593 62594 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 62595 var e = new Error(message); 62596 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 62597 }; 62598 62599 function __disposeResources(env) { 62600 function fail(e) { 62601 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 62602 env.hasError = true; 62603 } 62604 var r, s = 0; 62605 function next() { 62606 while (r = env.stack.pop()) { 62607 try { 62608 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 62609 if (r.dispose) { 62610 var result = r.dispose.call(r.value); 62611 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 62612 } 62613 else s |= 1; 62614 } 62615 catch (e) { 62616 fail(e); 62617 } 62618 } 62619 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 62620 if (env.hasError) throw env.error; 62621 } 62622 return next(); 62623 } 62624 62625 function __rewriteRelativeImportExtension(path, preserveJsx) { 62626 if (typeof path === "string" && /^\.\.?\//.test(path)) { 62627 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 62628 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 62629 }); 62630 } 62631 return path; 62632 } 62633 62634 /* harmony default export */ const tslib_es6 = ({ 62635 __extends, 62636 __assign, 62637 __rest, 62638 __decorate, 62639 __param, 62640 __esDecorate, 62641 __runInitializers, 62642 __propKey, 62643 __setFunctionName, 62644 __metadata, 62645 __awaiter, 62646 __generator, 62647 __createBinding, 62648 __exportStar, 62649 __values, 62650 __read, 62651 __spread, 62652 __spreadArrays, 62653 __spreadArray, 62654 __await, 62655 __asyncGenerator, 62656 __asyncDelegator, 62657 __asyncValues, 62658 __makeTemplateObject, 62659 __importStar, 62660 __importDefault, 62661 __classPrivateFieldGet, 62662 __classPrivateFieldSet, 62663 __classPrivateFieldIn, 62664 __addDisposableResource, 62665 __disposeResources, 62666 __rewriteRelativeImportExtension, 62667 }); 62668 62669 ;// ./node_modules/lower-case/dist.es2015/index.js 62670 /** 62671 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt 62672 */ 62673 var SUPPORTED_LOCALE = { 62674 tr: { 62675 regexp: /\u0130|\u0049|\u0049\u0307/g, 62676 map: { 62677 İ: "\u0069", 62678 I: "\u0131", 62679 İ: "\u0069", 62680 }, 62681 }, 62682 az: { 62683 regexp: /\u0130/g, 62684 map: { 62685 İ: "\u0069", 62686 I: "\u0131", 62687 İ: "\u0069", 62688 }, 62689 }, 62690 lt: { 62691 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, 62692 map: { 62693 I: "\u0069\u0307", 62694 J: "\u006A\u0307", 62695 Į: "\u012F\u0307", 62696 Ì: "\u0069\u0307\u0300", 62697 Í: "\u0069\u0307\u0301", 62698 Ĩ: "\u0069\u0307\u0303", 62699 }, 62700 }, 62701 }; 62702 /** 62703 * Localized lower case. 62704 */ 62705 function localeLowerCase(str, locale) { 62706 var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; 62707 if (lang) 62708 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); 62709 return lowerCase(str); 62710 } 62711 /** 62712 * Lower case as a function. 62713 */ 62714 function lowerCase(str) { 62715 return str.toLowerCase(); 62716 } 62717 62718 ;// ./node_modules/no-case/dist.es2015/index.js 62719 62720 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). 62721 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 62722 // Remove all non-word characters. 62723 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 62724 /** 62725 * Normalize the string into something other libraries can manipulate easier. 62726 */ 62727 function noCase(input, options) { 62728 if (options === void 0) { options = {}; } 62729 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; 62730 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 62731 var start = 0; 62732 var end = result.length; 62733 // Trim the delimiter from around the output string. 62734 while (result.charAt(start) === "\0") 62735 start++; 62736 while (result.charAt(end - 1) === "\0") 62737 end--; 62738 // Transform each token independently. 62739 return result.slice(start, end).split("\0").map(transform).join(delimiter); 62740 } 62741 /** 62742 * Replace `re` in the input string with the replacement value. 62743 */ 62744 function replace(input, re, value) { 62745 if (re instanceof RegExp) 62746 return input.replace(re, value); 62747 return re.reduce(function (input, re) { return input.replace(re, value); }, input); 62748 } 62749 62750 ;// ./node_modules/upper-case-first/dist.es2015/index.js 62751 /** 62752 * Upper case the first character of an input string. 62753 */ 62754 function upperCaseFirst(input) { 62755 return input.charAt(0).toUpperCase() + input.substr(1); 62756 } 62757 62758 ;// ./node_modules/capital-case/dist.es2015/index.js 62759 62760 62761 62762 function capitalCaseTransform(input) { 62763 return upperCaseFirst(input.toLowerCase()); 62764 } 62765 function capitalCase(input, options) { 62766 if (options === void 0) { options = {}; } 62767 return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); 62768 } 62769 62770 ;// ./node_modules/dot-case/dist.es2015/index.js 62771 62772 62773 function dotCase(input, options) { 62774 if (options === void 0) { options = {}; } 62775 return noCase(input, __assign({ delimiter: "." }, options)); 62776 } 62777 62778 ;// ./node_modules/param-case/dist.es2015/index.js 62779 62780 62781 function paramCase(input, options) { 62782 if (options === void 0) { options = {}; } 62783 return dotCase(input, __assign({ delimiter: "-" }, options)); 62784 } 62785 62786 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js 62787 /* wp:polyfill */ 62788 /** 62789 * External dependencies 62790 */ 62791 62792 62793 /** 62794 * WordPress dependencies 62795 */ 62796 62797 62798 62799 62800 62801 62802 62803 /** 62804 * Internal dependencies 62805 */ 62806 62807 62808 /** 62809 * Retrieves the available template parts for the given area. 62810 * 62811 * @param {string} area Template part area. 62812 * @param {string} excludedId Template part ID to exclude. 62813 * 62814 * @return {{ templateParts: Array, isResolving: boolean }} array of template parts. 62815 */ 62816 function useAlternativeTemplateParts(area, excludedId) { 62817 const { 62818 templateParts, 62819 isResolving 62820 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 62821 const { 62822 getEntityRecords, 62823 isResolving: _isResolving 62824 } = select(external_wp_coreData_namespaceObject.store); 62825 const query = { 62826 per_page: -1 62827 }; 62828 return { 62829 templateParts: getEntityRecords('postType', 'wp_template_part', query), 62830 isResolving: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query]) 62831 }; 62832 }, []); 62833 const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { 62834 if (!templateParts) { 62835 return []; 62836 } 62837 return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || []; 62838 }, [templateParts, area, excludedId]); 62839 return { 62840 templateParts: filteredTemplateParts, 62841 isResolving 62842 }; 62843 } 62844 62845 /** 62846 * Retrieves the available block patterns for the given area. 62847 * 62848 * @param {string} area Template part area. 62849 * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks). 62850 * 62851 * @return {Array} array of block patterns. 62852 */ 62853 function useAlternativeBlockPatterns(area, clientId) { 62854 return (0,external_wp_data_namespaceObject.useSelect)(select => { 62855 const blockNameWithArea = area ? `core/template-part/$area}` : 'core/template-part'; 62856 const { 62857 getBlockRootClientId, 62858 getPatternsByBlockTypes 62859 } = select(external_wp_blockEditor_namespaceObject.store); 62860 const rootClientId = getBlockRootClientId(clientId); 62861 return getPatternsByBlockTypes(blockNameWithArea, rootClientId); 62862 }, [area, clientId]); 62863 } 62864 function useCreateTemplatePartFromBlocks(area, setAttributes) { 62865 const { 62866 saveEntityRecord 62867 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 62868 return async (blocks = [], title = (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')) => { 62869 // Currently template parts only allow latin chars. 62870 // Fallback slug will receive suffix by default. 62871 const cleanSlug = paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; 62872 62873 // If we have `area` set from block attributes, means an exposed 62874 // block variation was inserted. So add this prop to the template 62875 // part entity on creation. Afterwards remove `area` value from 62876 // block attributes. 62877 const record = { 62878 title, 62879 slug: cleanSlug, 62880 content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), 62881 // `area` is filterable on the server and defaults to `UNCATEGORIZED` 62882 // if provided value is not allowed. 62883 area 62884 }; 62885 const templatePart = await saveEntityRecord('postType', 'wp_template_part', record); 62886 setAttributes({ 62887 slug: templatePart.slug, 62888 theme: templatePart.theme, 62889 area: undefined 62890 }); 62891 }; 62892 } 62893 62894 /** 62895 * Retrieves the template part area object. 62896 * 62897 * @param {string} area Template part area identifier. 62898 * 62899 * @return {{icon: Object, label: string, tagName: string}} Template Part area. 62900 */ 62901 function useTemplatePartArea(area) { 62902 return (0,external_wp_data_namespaceObject.useSelect)(select => { 62903 var _selectedArea$area_ta; 62904 const definedAreas = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || []; 62905 const selectedArea = definedAreas.find(definedArea => definedArea.area === area); 62906 const defaultArea = definedAreas.find(definedArea => definedArea.area === 'uncategorized'); 62907 return { 62908 icon: selectedArea?.icon || defaultArea?.icon, 62909 label: selectedArea?.label || (0,external_wp_i18n_namespaceObject.__)('Template Part'), 62910 tagName: (_selectedArea$area_ta = selectedArea?.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div' 62911 }; 62912 }, [area]); 62913 } 62914 62915 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js 62916 /** 62917 * WordPress dependencies 62918 */ 62919 62920 62921 62922 62923 function TitleModal({ 62924 areaLabel, 62925 onClose, 62926 onSubmit 62927 }) { 62928 // Restructure onCreate to set the blocks on local state. 62929 // Add modal to confirm title and trigger onCreate. 62930 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); 62931 const submitForCreation = event => { 62932 event.preventDefault(); 62933 onSubmit(title); 62934 }; 62935 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { 62936 title: (0,external_wp_i18n_namespaceObject.sprintf)( 62937 // Translators: %s as template part area title ("Header", "Footer", etc.). 62938 (0,external_wp_i18n_namespaceObject.__)('Create new %s'), areaLabel.toLowerCase()), 62939 onRequestClose: onClose, 62940 focusOnMount: "firstContentElement", 62941 size: "small", 62942 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { 62943 onSubmit: submitForCreation, 62944 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 62945 spacing: "5", 62946 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 62947 label: (0,external_wp_i18n_namespaceObject.__)('Name'), 62948 value: title, 62949 onChange: setTitle, 62950 placeholder: (0,external_wp_i18n_namespaceObject.__)('Custom Template Part'), 62951 __nextHasNoMarginBottom: true, 62952 __next40pxDefaultSize: true 62953 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 62954 justify: "right", 62955 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 62956 __next40pxDefaultSize: true, 62957 variant: "tertiary", 62958 onClick: () => { 62959 onClose(); 62960 setTitle(''); 62961 }, 62962 children: (0,external_wp_i18n_namespaceObject.__)('Cancel') 62963 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 62964 variant: "primary", 62965 type: "submit", 62966 accessibleWhenDisabled: true, 62967 disabled: !title.length, 62968 __next40pxDefaultSize: true, 62969 children: (0,external_wp_i18n_namespaceObject.__)('Create') 62970 })] 62971 })] 62972 }) 62973 }) 62974 }); 62975 } 62976 62977 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js 62978 /** 62979 * WordPress dependencies 62980 */ 62981 62982 62983 62984 62985 62986 62987 /** 62988 * Internal dependencies 62989 */ 62990 62991 62992 62993 function TemplatePartPlaceholder({ 62994 area, 62995 clientId, 62996 templatePartId, 62997 onOpenSelectionModal, 62998 setAttributes 62999 }) { 63000 const { 63001 templateParts, 63002 isResolving 63003 } = useAlternativeTemplateParts(area, templatePartId); 63004 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 63005 const { 63006 isBlockBasedTheme, 63007 canCreateTemplatePart 63008 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 63009 const { 63010 getCurrentTheme, 63011 canUser 63012 } = select(external_wp_coreData_namespaceObject.store); 63013 return { 63014 isBlockBasedTheme: getCurrentTheme()?.is_block_theme, 63015 canCreateTemplatePart: canUser('create', { 63016 kind: 'postType', 63017 name: 'wp_template_part' 63018 }) 63019 }; 63020 }, []); 63021 const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false); 63022 const areaObject = useTemplatePartArea(area); 63023 const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); 63024 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { 63025 icon: areaObject.icon, 63026 label: areaObject.label, 63027 instructions: isBlockBasedTheme ? (0,external_wp_i18n_namespaceObject.sprintf)( 63028 // Translators: %s as template part area title ("Header", "Footer", etc.). 63029 (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase()) : (0,external_wp_i18n_namespaceObject.sprintf)( 63030 // Translators: %s as template part area title ("Header", "Footer", etc.). 63031 (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s.'), areaObject.label.toLowerCase()), 63032 children: [isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isResolving && !!(templateParts.length || blockPatterns.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 63033 __next40pxDefaultSize: true, 63034 variant: "primary", 63035 onClick: onOpenSelectionModal, 63036 children: (0,external_wp_i18n_namespaceObject.__)('Choose') 63037 }), !isResolving && isBlockBasedTheme && canCreateTemplatePart && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 63038 __next40pxDefaultSize: true, 63039 variant: "secondary", 63040 onClick: () => { 63041 setShowTitleModal(true); 63042 }, 63043 children: (0,external_wp_i18n_namespaceObject.__)('Start blank') 63044 }), showTitleModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TitleModal, { 63045 areaLabel: areaObject.label, 63046 onClose: () => setShowTitleModal(false), 63047 onSubmit: title => { 63048 createFromBlocks([], title); 63049 } 63050 })] 63051 }); 63052 } 63053 63054 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js 63055 /** 63056 * WordPress dependencies 63057 */ 63058 63059 63060 /** 63061 * Internal dependencies 63062 */ 63063 63064 63065 /** 63066 * This maps the properties of a template part to those of a block pattern. 63067 * @param {Object} templatePart 63068 * @return {Object} The template part in the shape of block pattern. 63069 */ 63070 function mapTemplatePartToBlockPattern(templatePart) { 63071 return { 63072 name: createTemplatePartId(templatePart.theme, templatePart.slug), 63073 title: templatePart.title.rendered, 63074 blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw), 63075 templatePart 63076 }; 63077 } 63078 63079 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js 63080 /* wp:polyfill */ 63081 /** 63082 * WordPress dependencies 63083 */ 63084 63085 63086 63087 63088 63089 63090 63091 /** 63092 * Internal dependencies 63093 */ 63094 63095 63096 63097 63098 function TemplatePartSelectionModal({ 63099 setAttributes, 63100 onClose, 63101 templatePartId = null, 63102 area, 63103 clientId 63104 }) { 63105 const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); 63106 const { 63107 templateParts 63108 } = useAlternativeTemplateParts(area, templatePartId); 63109 63110 // We can map template parts to block patters to reuse the BlockPatternsList UI 63111 const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { 63112 const partsAsPatterns = templateParts.map(templatePart => mapTemplatePartToBlockPattern(templatePart)); 63113 return searchPatterns(partsAsPatterns, searchValue); 63114 }, [templateParts, searchValue]); 63115 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 63116 const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { 63117 return searchPatterns(blockPatterns, searchValue); 63118 }, [blockPatterns, searchValue]); 63119 const { 63120 createSuccessNotice 63121 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 63122 const onTemplatePartSelect = templatePart => { 63123 setAttributes({ 63124 slug: templatePart.slug, 63125 theme: templatePart.theme, 63126 area: undefined 63127 }); 63128 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title. */ 63129 (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), templatePart.title?.rendered || templatePart.slug), { 63130 type: 'snackbar' 63131 }); 63132 onClose(); 63133 }; 63134 const hasTemplateParts = !!filteredTemplateParts.length; 63135 const hasBlockPatterns = !!filteredBlockPatterns.length; 63136 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 63137 className: "block-library-template-part__selection-content", 63138 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 63139 className: "block-library-template-part__selection-search", 63140 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { 63141 __nextHasNoMarginBottom: true, 63142 onChange: setSearchValue, 63143 value: searchValue, 63144 label: (0,external_wp_i18n_namespaceObject.__)('Search'), 63145 placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') 63146 }) 63147 }), hasTemplateParts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 63148 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { 63149 children: (0,external_wp_i18n_namespaceObject.__)('Existing template parts') 63150 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 63151 blockPatterns: filteredTemplateParts, 63152 onClickPattern: pattern => { 63153 onTemplatePartSelect(pattern.templatePart); 63154 } 63155 })] 63156 }), !hasTemplateParts && !hasBlockPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { 63157 alignment: "center", 63158 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 63159 children: (0,external_wp_i18n_namespaceObject.__)('No results found.') 63160 }) 63161 })] 63162 }); 63163 } 63164 63165 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/transformers.js 63166 /* wp:polyfill */ 63167 /** 63168 * WordPress dependencies 63169 */ 63170 63171 63172 /** 63173 * Converts a widget entity record into a block. 63174 * 63175 * @param {Object} widget The widget entity record. 63176 * @return {Object} a block (converted from the entity record). 63177 */ 63178 function transformWidgetToBlock(widget) { 63179 if (widget.id_base !== 'block') { 63180 let attributes; 63181 if (widget._embedded.about[0].is_multi) { 63182 attributes = { 63183 idBase: widget.id_base, 63184 instance: widget.instance 63185 }; 63186 } else { 63187 attributes = { 63188 id: widget.id 63189 }; 63190 } 63191 return switchLegacyWidgetType((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes)); 63192 } 63193 const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { 63194 __unstableSkipAutop: true 63195 }); 63196 if (!parsedBlocks.length) { 63197 return undefined; 63198 } 63199 const block = parsedBlocks[0]; 63200 if (block.name === 'core/widget-group') { 63201 return (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks)); 63202 } 63203 if (block.innerBlocks.length > 0) { 63204 return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, undefined, transformInnerBlocks(block.innerBlocks)); 63205 } 63206 return block; 63207 } 63208 63209 /** 63210 * Switch Legacy Widget to the first matching transformation block. 63211 * 63212 * @param {Object} block Legacy Widget block object 63213 * @return {Object|undefined} a block 63214 */ 63215 function switchLegacyWidgetType(block) { 63216 const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => { 63217 // The block without any transformations can't be a wildcard. 63218 if (!item.transforms) { 63219 return true; 63220 } 63221 const hasWildCardFrom = item.transforms?.from?.find(from => from.blocks && from.blocks.includes('*')); 63222 const hasWildCardTo = item.transforms?.to?.find(to => to.blocks && to.blocks.includes('*')); 63223 63224 // Skip wildcard transformations. 63225 return !hasWildCardFrom && !hasWildCardTo; 63226 }); 63227 if (!transforms.length) { 63228 return undefined; 63229 } 63230 return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name); 63231 } 63232 function transformInnerBlocks(innerBlocks = []) { 63233 return innerBlocks.flatMap(block => { 63234 if (block.name === 'core/legacy-widget') { 63235 return switchLegacyWidgetType(block); 63236 } 63237 return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks)); 63238 }).filter(block => !!block); 63239 } 63240 63241 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/import-controls.js 63242 /* wp:polyfill */ 63243 /** 63244 * WordPress dependencies 63245 */ 63246 63247 63248 63249 63250 63251 63252 63253 /** 63254 * Internal dependencies 63255 */ 63256 63257 63258 63259 const SIDEBARS_QUERY = { 63260 per_page: -1, 63261 _fields: 'id,name,description,status,widgets' 63262 }; 63263 function TemplatePartImportControls({ 63264 area, 63265 setAttributes 63266 }) { 63267 const [selectedSidebar, setSelectedSidebar] = (0,external_wp_element_namespaceObject.useState)(''); 63268 const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); 63269 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 63270 const { 63271 sidebars, 63272 hasResolved 63273 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 63274 const { 63275 getSidebars, 63276 hasFinishedResolution 63277 } = select(external_wp_coreData_namespaceObject.store); 63278 return { 63279 sidebars: getSidebars(SIDEBARS_QUERY), 63280 hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY]) 63281 }; 63282 }, []); 63283 const { 63284 createErrorNotice 63285 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 63286 const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); 63287 const options = (0,external_wp_element_namespaceObject.useMemo)(() => { 63288 const sidebarOptions = (sidebars !== null && sidebars !== void 0 ? sidebars : []).filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets' && widgetArea.widgets.length > 0).map(widgetArea => { 63289 return { 63290 value: widgetArea.id, 63291 label: widgetArea.name 63292 }; 63293 }); 63294 if (!sidebarOptions.length) { 63295 return []; 63296 } 63297 return [{ 63298 value: '', 63299 label: (0,external_wp_i18n_namespaceObject.__)('Select widget area') 63300 }, ...sidebarOptions]; 63301 }, [sidebars]); 63302 63303 // Render an empty node while data is loading to avoid SlotFill re-positioning bug. 63304 // See: https://github.com/WordPress/gutenberg/issues/15641. 63305 if (!hasResolved) { 63306 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { 63307 marginBottom: "0" 63308 }); 63309 } 63310 if (hasResolved && !options.length) { 63311 return null; 63312 } 63313 async function createFromWidgets(event) { 63314 event.preventDefault(); 63315 if (isBusy || !selectedSidebar) { 63316 return; 63317 } 63318 setIsBusy(true); 63319 const sidebar = options.find(({ 63320 value 63321 }) => value === selectedSidebar); 63322 const { 63323 getWidgets 63324 } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); 63325 63326 // The widgets API always returns a successful response. 63327 const widgets = await getWidgets({ 63328 sidebar: sidebar.value, 63329 _embed: 'about' 63330 }); 63331 const skippedWidgets = new Set(); 63332 const blocks = widgets.flatMap(widget => { 63333 const block = transformWidgetToBlock(widget); 63334 63335 // Skip the block if we have no matching transformations. 63336 if (!block) { 63337 skippedWidgets.add(widget.id_base); 63338 return []; 63339 } 63340 return block; 63341 }); 63342 await createFromBlocks(blocks, /* translators: %s: name of the widget area */ 63343 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Widget area: %s'), sidebar.label)); 63344 if (skippedWidgets.size) { 63345 createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the list of widgets */ 63346 (0,external_wp_i18n_namespaceObject.__)('Unable to import the following widgets: %s.'), Array.from(skippedWidgets).join(', ')), { 63347 type: 'snackbar' 63348 }); 63349 } 63350 setIsBusy(false); 63351 } 63352 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { 63353 marginBottom: "4", 63354 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 63355 as: "form", 63356 onSubmit: createFromWidgets, 63357 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { 63358 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 63359 label: (0,external_wp_i18n_namespaceObject.__)('Import widget area'), 63360 value: selectedSidebar, 63361 options: options, 63362 onChange: value => setSelectedSidebar(value), 63363 disabled: !options.length, 63364 __next40pxDefaultSize: true, 63365 __nextHasNoMarginBottom: true 63366 }) 63367 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { 63368 style: { 63369 marginBottom: '8px', 63370 marginTop: 'auto' 63371 }, 63372 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 63373 __next40pxDefaultSize: true, 63374 variant: "primary", 63375 type: "submit", 63376 isBusy: isBusy, 63377 "aria-disabled": isBusy || !selectedSidebar, 63378 children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label') 63379 }) 63380 })] 63381 }) 63382 }); 63383 } 63384 63385 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js 63386 /* wp:polyfill */ 63387 /** 63388 * WordPress dependencies 63389 */ 63390 63391 63392 63393 63394 63395 /** 63396 * Internal dependencies 63397 */ 63398 63399 63400 63401 function TemplatePartAdvancedControls({ 63402 tagName, 63403 setAttributes, 63404 isEntityAvailable, 63405 templatePartId, 63406 defaultWrapper, 63407 hasInnerBlocks 63408 }) { 63409 const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId); 63410 const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId); 63411 const defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [], []); 63412 const areaOptions = defaultTemplatePartAreas.map(({ 63413 label, 63414 area: _area 63415 }) => ({ 63416 label, 63417 value: _area 63418 })); 63419 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 63420 children: [isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 63421 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 63422 __next40pxDefaultSize: true, 63423 __nextHasNoMarginBottom: true, 63424 label: (0,external_wp_i18n_namespaceObject.__)('Title'), 63425 value: title, 63426 onChange: value => { 63427 setTitle(value); 63428 }, 63429 onFocus: event => event.target.select() 63430 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 63431 __next40pxDefaultSize: true, 63432 __nextHasNoMarginBottom: true, 63433 label: (0,external_wp_i18n_namespaceObject.__)('Area'), 63434 labelPosition: "top", 63435 options: areaOptions, 63436 value: area, 63437 onChange: setArea 63438 })] 63439 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 63440 __nextHasNoMarginBottom: true, 63441 __next40pxDefaultSize: true, 63442 label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), 63443 options: [{ 63444 label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: HTML tag based on area. */ 63445 (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<$defaultWrapper}>`), 63446 value: '' 63447 }, { 63448 label: '<header>', 63449 value: 'header' 63450 }, { 63451 label: '<main>', 63452 value: 'main' 63453 }, { 63454 label: '<section>', 63455 value: 'section' 63456 }, { 63457 label: '<article>', 63458 value: 'article' 63459 }, { 63460 label: '<aside>', 63461 value: 'aside' 63462 }, { 63463 label: '<footer>', 63464 value: 'footer' 63465 }, { 63466 label: '<div>', 63467 value: 'div' 63468 }], 63469 value: tagName || '', 63470 onChange: value => setAttributes({ 63471 tagName: value 63472 }), 63473 help: htmlElementMessages[tagName] 63474 }), !hasInnerBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartImportControls, { 63475 area: area, 63476 setAttributes: setAttributes 63477 })] 63478 }); 63479 } 63480 63481 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js 63482 /** 63483 * WordPress dependencies 63484 */ 63485 63486 63487 63488 63489 63490 63491 function useRenderAppender(hasInnerBlocks) { 63492 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 63493 // Disable appending when the editing mode is 'contentOnly'. This is so that the user can't 63494 // append into a template part when editing a page in the site editor. See 63495 // DisableNonPageContentBlocks. Ideally instead of (mis)using editing mode there would be a 63496 // block editor API for achieving this. 63497 if (blockEditingMode === 'contentOnly') { 63498 return false; 63499 } 63500 if (!hasInnerBlocks) { 63501 return external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; 63502 } 63503 } 63504 function useLayout(layout) { 63505 const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => { 63506 const { 63507 getSettings 63508 } = select(external_wp_blockEditor_namespaceObject.store); 63509 return getSettings()?.supportsLayout; 63510 }, []); 63511 const [defaultLayout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout'); 63512 if (themeSupportsLayout) { 63513 return layout?.inherit ? defaultLayout || {} : layout; 63514 } 63515 } 63516 function NonEditableTemplatePartPreview({ 63517 postId: id, 63518 layout, 63519 tagName: TagName, 63520 blockProps 63521 }) { 63522 (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)('disabled'); 63523 const { 63524 content, 63525 editedBlocks 63526 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 63527 if (!id) { 63528 return {}; 63529 } 63530 const { 63531 getEditedEntityRecord 63532 } = select(external_wp_coreData_namespaceObject.store); 63533 const editedRecord = getEditedEntityRecord('postType', 'wp_template_part', id, { 63534 context: 'view' 63535 }); 63536 return { 63537 editedBlocks: editedRecord.blocks, 63538 content: editedRecord.content 63539 }; 63540 }, [id]); 63541 const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { 63542 if (!id) { 63543 return undefined; 63544 } 63545 if (editedBlocks) { 63546 return editedBlocks; 63547 } 63548 if (!content || typeof content !== 'string') { 63549 return []; 63550 } 63551 return (0,external_wp_blocks_namespaceObject.parse)(content); 63552 }, [id, editedBlocks, content]); 63553 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 63554 value: blocks, 63555 onInput: () => {}, 63556 onChange: () => {}, 63557 renderAppender: false, 63558 layout: useLayout(layout) 63559 }); 63560 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63561 ...innerBlocksProps 63562 }); 63563 } 63564 function EditableTemplatePartInnerBlocks({ 63565 postId: id, 63566 hasInnerBlocks, 63567 layout, 63568 tagName: TagName, 63569 blockProps 63570 }) { 63571 const onNavigateToEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().onNavigateToEntityRecord, []); 63572 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', { 63573 id 63574 }); 63575 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { 63576 value: blocks, 63577 onInput, 63578 onChange, 63579 renderAppender: useRenderAppender(hasInnerBlocks), 63580 layout: useLayout(layout) 63581 }); 63582 const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); 63583 const customProps = blockEditingMode === 'contentOnly' && onNavigateToEntityRecord ? { 63584 onDoubleClick: () => onNavigateToEntityRecord({ 63585 postId: id, 63586 postType: 'wp_template_part' 63587 }) 63588 } : {}; 63589 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63590 ...innerBlocksProps, 63591 ...customProps 63592 }); 63593 } 63594 function TemplatePartInnerBlocks({ 63595 postId: id, 63596 hasInnerBlocks, 63597 layout, 63598 tagName: TagName, 63599 blockProps 63600 }) { 63601 const { 63602 canViewTemplatePart, 63603 canEditTemplatePart 63604 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 63605 return { 63606 canViewTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('read', { 63607 kind: 'postType', 63608 name: 'wp_template_part', 63609 id 63610 }), 63611 canEditTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('update', { 63612 kind: 'postType', 63613 name: 'wp_template_part', 63614 id 63615 }) 63616 }; 63617 }, [id]); 63618 if (!canViewTemplatePart) { 63619 return null; 63620 } 63621 const TemplatePartInnerBlocksComponent = canEditTemplatePart ? EditableTemplatePartInnerBlocks : NonEditableTemplatePartPreview; 63622 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocksComponent, { 63623 postId: id, 63624 hasInnerBlocks: hasInnerBlocks, 63625 layout: layout, 63626 tagName: TagName, 63627 blockProps: blockProps 63628 }); 63629 } 63630 63631 ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js 63632 /** 63633 * WordPress dependencies 63634 */ 63635 63636 63637 63638 63639 63640 63641 63642 63643 63644 /** 63645 * Internal dependencies 63646 */ 63647 63648 63649 63650 63651 63652 63653 63654 function ReplaceButton({ 63655 isEntityAvailable, 63656 area, 63657 templatePartId, 63658 isTemplatePartSelectionOpen, 63659 setIsTemplatePartSelectionOpen 63660 }) { 63661 // This hook fetches patterns, so don't run it unconditionally in the main 63662 // edit function! 63663 const { 63664 templateParts 63665 } = useAlternativeTemplateParts(area, templatePartId); 63666 const hasReplacements = !!templateParts.length; 63667 const canReplace = isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); 63668 if (!canReplace) { 63669 return null; 63670 } 63671 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 63672 onClick: () => { 63673 setIsTemplatePartSelectionOpen(true); 63674 }, 63675 "aria-expanded": isTemplatePartSelectionOpen, 63676 "aria-haspopup": "dialog", 63677 children: (0,external_wp_i18n_namespaceObject.__)('Replace') 63678 }); 63679 } 63680 function TemplatesList({ 63681 area, 63682 clientId, 63683 isEntityAvailable, 63684 onSelect 63685 }) { 63686 // This hook fetches patterns, so don't run it unconditionally in the main 63687 // edit function! 63688 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 63689 const canReplace = isEntityAvailable && !!blockPatterns.length && (area === 'header' || area === 'footer'); 63690 if (!canReplace) { 63691 return null; 63692 } 63693 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 63694 title: (0,external_wp_i18n_namespaceObject.__)('Design'), 63695 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { 63696 label: (0,external_wp_i18n_namespaceObject.__)('Templates'), 63697 blockPatterns: blockPatterns, 63698 onClickPattern: onSelect, 63699 showTitlesAsTooltip: true 63700 }) 63701 }); 63702 } 63703 function TemplatePartEdit({ 63704 attributes, 63705 setAttributes, 63706 clientId 63707 }) { 63708 const { 63709 createSuccessNotice 63710 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 63711 const { 63712 editEntityRecord 63713 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 63714 const currentTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); 63715 const { 63716 slug, 63717 theme = currentTheme, 63718 tagName, 63719 layout = {} 63720 } = attributes; 63721 const templatePartId = createTemplatePartId(theme, slug); 63722 const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(templatePartId); 63723 const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); 63724 const { 63725 isResolved, 63726 hasInnerBlocks, 63727 isMissing, 63728 area, 63729 onNavigateToEntityRecord, 63730 title, 63731 canUserEdit 63732 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 63733 const { 63734 getEditedEntityRecord, 63735 hasFinishedResolution 63736 } = select(external_wp_coreData_namespaceObject.store); 63737 const { 63738 getBlockCount, 63739 getSettings 63740 } = select(external_wp_blockEditor_namespaceObject.store); 63741 const getEntityArgs = ['postType', 'wp_template_part', templatePartId]; 63742 const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null; 63743 const _area = entityRecord?.area || attributes.area; 63744 const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false; 63745 const _canUserEdit = hasResolvedEntity ? select(external_wp_coreData_namespaceObject.store).canUser('update', { 63746 kind: 'postType', 63747 name: 'wp_template_part', 63748 id: templatePartId 63749 }) : false; 63750 return { 63751 hasInnerBlocks: getBlockCount(clientId) > 0, 63752 isResolved: hasResolvedEntity, 63753 isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0), 63754 area: _area, 63755 onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, 63756 title: entityRecord?.title, 63757 canUserEdit: !!_canUserEdit 63758 }; 63759 }, [templatePartId, attributes.area, clientId]); 63760 const areaObject = useTemplatePartArea(area); 63761 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 63762 const isPlaceholder = !slug; 63763 const isEntityAvailable = !isPlaceholder && !isMissing && isResolved; 63764 const TagName = tagName || areaObject.tagName; 63765 const onPatternSelect = async pattern => { 63766 await editEntityRecord('postType', 'wp_template_part', templatePartId, { 63767 blocks: pattern.blocks, 63768 content: (0,external_wp_blocks_namespaceObject.serialize)(pattern.blocks) 63769 }); 63770 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title. */ 63771 (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" updated.'), title || slug), { 63772 type: 'snackbar' 63773 }); 63774 }; 63775 63776 // We don't want to render a missing state if we have any inner blocks. 63777 // A new template part is automatically created if we have any inner blocks but no entity. 63778 if (!hasInnerBlocks && (slug && !theme || slug && isMissing)) { 63779 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63780 ...blockProps, 63781 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 63782 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Template part slug. */ 63783 (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug) 63784 }) 63785 }); 63786 } 63787 if (isEntityAvailable && hasAlreadyRendered) { 63788 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63789 ...blockProps, 63790 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { 63791 children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') 63792 }) 63793 }); 63794 } 63795 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 63796 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { 63797 uniqueId: templatePartId, 63798 children: [isEntityAvailable && onNavigateToEntityRecord && canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 63799 group: "other", 63800 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 63801 onClick: () => onNavigateToEntityRecord({ 63802 postId: templatePartId, 63803 postType: 'wp_template_part' 63804 }), 63805 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 63806 }) 63807 }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 63808 group: "advanced", 63809 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartAdvancedControls, { 63810 tagName: tagName, 63811 setAttributes: setAttributes, 63812 isEntityAvailable: isEntityAvailable, 63813 templatePartId: templatePartId, 63814 defaultWrapper: areaObject.tagName, 63815 hasInnerBlocks: hasInnerBlocks 63816 }) 63817 }), isPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63818 ...blockProps, 63819 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartPlaceholder, { 63820 area: attributes.area, 63821 templatePartId: templatePartId, 63822 clientId: clientId, 63823 setAttributes: setAttributes, 63824 onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true) 63825 }) 63826 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { 63827 children: ({ 63828 selectedClientIds 63829 }) => { 63830 // Only enable for single selection that matches the current block. 63831 // Ensures menu item doesn't render multiple times. 63832 if (!(selectedClientIds.length === 1 && clientId === selectedClientIds[0])) { 63833 return null; 63834 } 63835 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReplaceButton, { 63836 isEntityAvailable, 63837 area, 63838 clientId, 63839 templatePartId, 63840 isTemplatePartSelectionOpen, 63841 setIsTemplatePartSelectionOpen 63842 }); 63843 } 63844 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 63845 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatesList, { 63846 area: area, 63847 clientId: clientId, 63848 isEntityAvailable: isEntityAvailable, 63849 onSelect: pattern => onPatternSelect(pattern) 63850 }) 63851 }), isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocks, { 63852 tagName: TagName, 63853 blockProps: blockProps, 63854 postId: templatePartId, 63855 hasInnerBlocks: hasInnerBlocks, 63856 layout: layout 63857 }), !isPlaceholder && !isResolved && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { 63858 ...blockProps, 63859 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) 63860 })] 63861 }), isTemplatePartSelectionOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { 63862 overlayClassName: "block-editor-template-part__selection-modal", 63863 title: (0,external_wp_i18n_namespaceObject.sprintf)( 63864 // Translators: %s as template part area title ("Header", "Footer", etc.). 63865 (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()), 63866 onRequestClose: () => setIsTemplatePartSelectionOpen(false), 63867 isFullScreen: true, 63868 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartSelectionModal, { 63869 templatePartId: templatePartId, 63870 clientId: clientId, 63871 area: area, 63872 setAttributes: setAttributes, 63873 onClose: () => setIsTemplatePartSelectionOpen(false) 63874 }) 63875 })] 63876 }); 63877 } 63878 63879 ;// ./node_modules/@wordpress/block-library/build-module/template-part/variations.js 63880 /* wp:polyfill */ 63881 /** 63882 * WordPress dependencies 63883 */ 63884 63885 63886 63887 /** 63888 * Internal dependencies 63889 */ 63890 63891 function enhanceTemplatePartVariations(settings, name) { 63892 if (name !== 'core/template-part') { 63893 return settings; 63894 } 63895 if (settings.variations) { 63896 const isActive = (blockAttributes, variationAttributes) => { 63897 const { 63898 area, 63899 theme, 63900 slug 63901 } = blockAttributes; 63902 // We first check the `area` block attribute which is set during insertion. 63903 // This property is removed on the creation of a template part. 63904 if (area) { 63905 return area === variationAttributes.area; 63906 } 63907 // Find a matching variation from the created template part 63908 // by checking the entity's `area` property. 63909 if (!slug) { 63910 return false; 63911 } 63912 const { 63913 getCurrentTheme, 63914 getEntityRecord 63915 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 63916 const entity = getEntityRecord('postType', 'wp_template_part', `$theme || getCurrentTheme()?.stylesheet}//${slug}`); 63917 if (entity?.slug) { 63918 return entity.slug === variationAttributes.slug; 63919 } 63920 return entity?.area === variationAttributes.area; 63921 }; 63922 const variations = settings.variations.map(variation => { 63923 return { 63924 ...variation, 63925 ...(!variation.isActive && { 63926 isActive 63927 }), 63928 ...(typeof variation.icon === 'string' && { 63929 icon: getTemplatePartIcon(variation.icon) 63930 }) 63931 }; 63932 }); 63933 return { 63934 ...settings, 63935 variations 63936 }; 63937 } 63938 return settings; 63939 } 63940 63941 ;// ./node_modules/@wordpress/block-library/build-module/template-part/index.js 63942 /** 63943 * External dependencies 63944 */ 63945 63946 63947 /** 63948 * WordPress dependencies 63949 */ 63950 63951 63952 63953 63954 63955 63956 /** 63957 * Internal dependencies 63958 */ 63959 63960 const template_part_metadata = { 63961 $schema: "https://schemas.wp.org/trunk/block.json", 63962 apiVersion: 3, 63963 name: "core/template-part", 63964 title: "Template Part", 63965 category: "theme", 63966 description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", 63967 textdomain: "default", 63968 attributes: { 63969 slug: { 63970 type: "string" 63971 }, 63972 theme: { 63973 type: "string" 63974 }, 63975 tagName: { 63976 type: "string" 63977 }, 63978 area: { 63979 type: "string" 63980 } 63981 }, 63982 supports: { 63983 align: true, 63984 html: false, 63985 reusable: false, 63986 renaming: false, 63987 interactivity: { 63988 clientNavigation: true 63989 } 63990 }, 63991 editorStyle: "wp-block-template-part-editor" 63992 }; 63993 63994 63995 const { 63996 name: template_part_name 63997 } = template_part_metadata; 63998 63999 const template_part_settings = { 64000 icon: symbol_filled, 64001 __experimentalLabel: ({ 64002 slug, 64003 theme 64004 }) => { 64005 // Attempt to find entity title if block is a template part. 64006 // Require slug to request, otherwise entity is uncreated and will throw 404. 64007 if (!slug) { 64008 return; 64009 } 64010 const { 64011 getCurrentTheme, 64012 getEditedEntityRecord 64013 } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); 64014 const entity = getEditedEntityRecord('postType', 'wp_template_part', (theme || getCurrentTheme()?.stylesheet) + '//' + slug); 64015 if (!entity) { 64016 return; 64017 } 64018 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title) || capitalCase(entity.slug || ''); 64019 }, 64020 edit: TemplatePartEdit 64021 }; 64022 const template_part_init = () => { 64023 (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); 64024 64025 // Prevent adding template parts inside post templates. 64026 const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content']; 64027 (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, { 64028 getBlock, 64029 getBlockParentsByBlockName 64030 }) => { 64031 if (blockType.name !== 'core/template-part') { 64032 return canInsert; 64033 } 64034 for (const disallowedParentType of DISALLOWED_PARENTS) { 64035 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; 64036 if (hasDisallowedParent) { 64037 return false; 64038 } 64039 } 64040 return true; 64041 }); 64042 return initBlock({ 64043 name: template_part_name, 64044 metadata: template_part_metadata, 64045 settings: template_part_settings 64046 }); 64047 }; 64048 64049 ;// ./node_modules/@wordpress/icons/build-module/library/term-description.js 64050 /** 64051 * WordPress dependencies 64052 */ 64053 64054 64055 const term_description_tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 64056 xmlns: "http://www.w3.org/2000/svg", 64057 viewBox: "0 0 24 24", 64058 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 64059 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" 64060 }) 64061 }); 64062 /* harmony default export */ const term_description = (term_description_tag); 64063 64064 ;// ./node_modules/@wordpress/block-library/build-module/term-description/edit.js 64065 /** 64066 * External dependencies 64067 */ 64068 64069 64070 /** 64071 * WordPress dependencies 64072 */ 64073 64074 64075 64076 function TermDescriptionEdit({ 64077 attributes, 64078 setAttributes, 64079 mergedStyle 64080 }) { 64081 const { 64082 textAlign 64083 } = attributes; 64084 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 64085 className: dist_clsx({ 64086 [`has-text-align-$textAlign}`]: textAlign 64087 }), 64088 style: mergedStyle 64089 }); 64090 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 64091 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 64092 group: "block", 64093 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { 64094 value: textAlign, 64095 onChange: nextAlign => { 64096 setAttributes({ 64097 textAlign: nextAlign 64098 }); 64099 } 64100 }) 64101 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64102 ...blockProps, 64103 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64104 className: "wp-block-term-description__placeholder", 64105 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 64106 children: (0,external_wp_i18n_namespaceObject.__)('Term Description') 64107 }) 64108 }) 64109 })] 64110 }); 64111 } 64112 64113 ;// ./node_modules/@wordpress/block-library/build-module/term-description/index.js 64114 /** 64115 * WordPress dependencies 64116 */ 64117 64118 64119 /** 64120 * Internal dependencies 64121 */ 64122 64123 const term_description_metadata = { 64124 $schema: "https://schemas.wp.org/trunk/block.json", 64125 apiVersion: 3, 64126 name: "core/term-description", 64127 title: "Term Description", 64128 category: "theme", 64129 description: "Display the description of categories, tags and custom taxonomies when viewing an archive.", 64130 textdomain: "default", 64131 attributes: { 64132 textAlign: { 64133 type: "string" 64134 } 64135 }, 64136 supports: { 64137 align: ["wide", "full"], 64138 html: false, 64139 color: { 64140 link: true, 64141 __experimentalDefaultControls: { 64142 background: true, 64143 text: true 64144 } 64145 }, 64146 spacing: { 64147 padding: true, 64148 margin: true 64149 }, 64150 typography: { 64151 fontSize: true, 64152 lineHeight: true, 64153 __experimentalFontFamily: true, 64154 __experimentalFontWeight: true, 64155 __experimentalFontStyle: true, 64156 __experimentalTextTransform: true, 64157 __experimentalTextDecoration: true, 64158 __experimentalLetterSpacing: true, 64159 __experimentalDefaultControls: { 64160 fontSize: true 64161 } 64162 }, 64163 interactivity: { 64164 clientNavigation: true 64165 }, 64166 __experimentalBorder: { 64167 radius: true, 64168 color: true, 64169 width: true, 64170 style: true, 64171 __experimentalDefaultControls: { 64172 radius: true, 64173 color: true, 64174 width: true, 64175 style: true 64176 } 64177 } 64178 } 64179 }; 64180 64181 const { 64182 name: term_description_name 64183 } = term_description_metadata; 64184 64185 const term_description_settings = { 64186 icon: term_description, 64187 edit: TermDescriptionEdit, 64188 example: {} 64189 }; 64190 const term_description_init = () => initBlock({ 64191 name: term_description_name, 64192 metadata: term_description_metadata, 64193 settings: term_description_settings 64194 }); 64195 64196 ;// ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js 64197 /* wp:polyfill */ 64198 /** 64199 * WordPress dependencies 64200 */ 64201 64202 64203 64204 64205 64206 function TextColumnsEdit({ 64207 attributes, 64208 setAttributes 64209 }) { 64210 const { 64211 width, 64212 content, 64213 columns 64214 } = attributes; 64215 external_wp_deprecated_default()('The Text Columns block', { 64216 since: '5.3', 64217 alternative: 'the Columns block' 64218 }); 64219 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 64220 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 64221 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, { 64222 value: width, 64223 onChange: nextWidth => setAttributes({ 64224 width: nextWidth 64225 }), 64226 controls: ['center', 'wide', 'full'] 64227 }) 64228 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 64229 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { 64230 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { 64231 __nextHasNoMarginBottom: true, 64232 __next40pxDefaultSize: true, 64233 label: (0,external_wp_i18n_namespaceObject.__)('Columns'), 64234 value: columns, 64235 onChange: value => setAttributes({ 64236 columns: value 64237 }), 64238 min: 2, 64239 max: 4, 64240 required: true 64241 }) 64242 }) 64243 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64244 ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 64245 className: `align$width} columns-$columns}` 64246 }), 64247 children: Array.from({ 64248 length: columns 64249 }).map((_, index) => { 64250 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64251 className: "wp-block-column", 64252 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 64253 tagName: "p", 64254 value: content?.[index]?.children, 64255 onChange: nextContent => { 64256 setAttributes({ 64257 content: [...content.slice(0, index), { 64258 children: nextContent 64259 }, ...content.slice(index + 1)] 64260 }); 64261 }, 64262 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( 64263 // translators: %d: column index (starting with 1) 64264 (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1), 64265 placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column') 64266 }) 64267 }, `column-$index}`); 64268 }) 64269 })] 64270 }); 64271 } 64272 64273 ;// ./node_modules/@wordpress/block-library/build-module/text-columns/save.js 64274 /* wp:polyfill */ 64275 /** 64276 * WordPress dependencies 64277 */ 64278 64279 64280 function text_columns_save_save({ 64281 attributes 64282 }) { 64283 const { 64284 width, 64285 content, 64286 columns 64287 } = attributes; 64288 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64289 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 64290 className: `align$width} columns-$columns}` 64291 }), 64292 children: Array.from({ 64293 length: columns 64294 }).map((_, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 64295 className: "wp-block-column", 64296 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 64297 tagName: "p", 64298 value: content?.[index]?.children 64299 }) 64300 }, `column-$index}`)) 64301 }); 64302 } 64303 64304 ;// ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js 64305 /* wp:polyfill */ 64306 /** 64307 * WordPress dependencies 64308 */ 64309 64310 const text_columns_transforms_transforms = { 64311 to: [{ 64312 type: 'block', 64313 blocks: ['core/columns'], 64314 transform: ({ 64315 className, 64316 columns, 64317 content, 64318 width 64319 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { 64320 align: 'wide' === width || 'full' === width ? width : undefined, 64321 className, 64322 columns 64323 }, content.map(({ 64324 children 64325 }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { 64326 content: children 64327 })]))) 64328 }] 64329 }; 64330 /* harmony default export */ const text_columns_transforms = (text_columns_transforms_transforms); 64331 64332 ;// ./node_modules/@wordpress/block-library/build-module/text-columns/index.js 64333 /** 64334 * Internal dependencies 64335 */ 64336 64337 64338 const text_columns_metadata = { 64339 $schema: "https://schemas.wp.org/trunk/block.json", 64340 apiVersion: 3, 64341 name: "core/text-columns", 64342 title: "Text Columns (deprecated)", 64343 icon: "columns", 64344 category: "design", 64345 description: "This block is deprecated. Please use the Columns block instead.", 64346 textdomain: "default", 64347 attributes: { 64348 content: { 64349 type: "array", 64350 source: "query", 64351 selector: "p", 64352 query: { 64353 children: { 64354 type: "string", 64355 source: "html" 64356 } 64357 }, 64358 "default": [{}, {}] 64359 }, 64360 columns: { 64361 type: "number", 64362 "default": 2 64363 }, 64364 width: { 64365 type: "string" 64366 } 64367 }, 64368 supports: { 64369 inserter: false, 64370 interactivity: { 64371 clientNavigation: true 64372 } 64373 }, 64374 editorStyle: "wp-block-text-columns-editor", 64375 style: "wp-block-text-columns" 64376 }; 64377 64378 64379 const { 64380 name: text_columns_name 64381 } = text_columns_metadata; 64382 64383 const text_columns_settings = { 64384 transforms: text_columns_transforms, 64385 getEditWrapperProps(attributes) { 64386 const { 64387 width 64388 } = attributes; 64389 if ('wide' === width || 'full' === width) { 64390 return { 64391 'data-align': width 64392 }; 64393 } 64394 }, 64395 edit: TextColumnsEdit, 64396 save: text_columns_save_save 64397 }; 64398 const text_columns_init = () => initBlock({ 64399 name: text_columns_name, 64400 metadata: text_columns_metadata, 64401 settings: text_columns_settings 64402 }); 64403 64404 ;// ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js 64405 /** 64406 * External dependencies 64407 */ 64408 64409 64410 /** 64411 * WordPress dependencies 64412 */ 64413 64414 64415 /** 64416 * Internal dependencies 64417 */ 64418 64419 64420 const verse_deprecated_v1 = { 64421 attributes: { 64422 content: { 64423 type: 'string', 64424 source: 'html', 64425 selector: 'pre', 64426 default: '' 64427 }, 64428 textAlign: { 64429 type: 'string' 64430 } 64431 }, 64432 save({ 64433 attributes 64434 }) { 64435 const { 64436 textAlign, 64437 content 64438 } = attributes; 64439 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 64440 tagName: "pre", 64441 style: { 64442 textAlign 64443 }, 64444 value: content 64445 }); 64446 } 64447 }; 64448 const verse_deprecated_v2 = { 64449 attributes: { 64450 content: { 64451 type: 'string', 64452 source: 'html', 64453 selector: 'pre', 64454 default: '', 64455 __unstablePreserveWhiteSpace: true, 64456 role: 'content' 64457 }, 64458 textAlign: { 64459 type: 'string' 64460 } 64461 }, 64462 supports: { 64463 anchor: true, 64464 color: { 64465 gradients: true, 64466 link: true 64467 }, 64468 typography: { 64469 fontSize: true, 64470 __experimentalFontFamily: true 64471 }, 64472 spacing: { 64473 padding: true 64474 } 64475 }, 64476 save({ 64477 attributes 64478 }) { 64479 const { 64480 textAlign, 64481 content 64482 } = attributes; 64483 const className = dist_clsx({ 64484 [`has-text-align-$textAlign}`]: textAlign 64485 }); 64486 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { 64487 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 64488 className 64489 }), 64490 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 64491 value: content 64492 }) 64493 }); 64494 }, 64495 migrate: migrate_font_family, 64496 isEligible({ 64497 style 64498 }) { 64499 return style?.typography?.fontFamily; 64500 } 64501 }; 64502 64503 /** 64504 * New deprecations need to be placed first 64505 * for them to have higher priority. 64506 * 64507 * Old deprecations may need to be updated as well. 64508 * 64509 * See block-deprecation.md 64510 */ 64511 /* harmony default export */ const verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]); 64512 64513 ;// ./node_modules/@wordpress/block-library/build-module/verse/edit.js 64514 /** 64515 * External dependencies 64516 */ 64517 64518 64519 /** 64520 * WordPress dependencies 64521 */ 64522 64523 64524 64525 64526 function VerseEdit({ 64527 attributes, 64528 setAttributes, 64529 mergeBlocks, 64530 onRemove, 64531 insertBlocksAfter, 64532 style 64533 }) { 64534 const { 64535 textAlign, 64536 content 64537 } = attributes; 64538 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 64539 className: dist_clsx({ 64540 [`has-text-align-$textAlign}`]: textAlign 64541 }), 64542 style 64543 }); 64544 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 64545 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 64546 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { 64547 value: textAlign, 64548 onChange: nextAlign => { 64549 setAttributes({ 64550 textAlign: nextAlign 64551 }); 64552 } 64553 }) 64554 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 64555 tagName: "pre", 64556 identifier: "content", 64557 preserveWhiteSpace: true, 64558 value: content, 64559 onChange: nextContent => { 64560 setAttributes({ 64561 content: nextContent 64562 }); 64563 }, 64564 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'), 64565 placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'), 64566 onRemove: onRemove, 64567 onMerge: mergeBlocks, 64568 textAlign: textAlign, 64569 ...blockProps, 64570 __unstablePastePlainText: true, 64571 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) 64572 })] 64573 }); 64574 } 64575 64576 ;// ./node_modules/@wordpress/block-library/build-module/verse/save.js 64577 /** 64578 * External dependencies 64579 */ 64580 64581 64582 /** 64583 * WordPress dependencies 64584 */ 64585 64586 64587 function verse_save_save({ 64588 attributes 64589 }) { 64590 const { 64591 textAlign, 64592 content 64593 } = attributes; 64594 const className = dist_clsx({ 64595 [`has-text-align-$textAlign}`]: textAlign 64596 }); 64597 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { 64598 ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ 64599 className 64600 }), 64601 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 64602 value: content 64603 }) 64604 }); 64605 } 64606 64607 ;// ./node_modules/@wordpress/block-library/build-module/verse/transforms.js 64608 /** 64609 * WordPress dependencies 64610 */ 64611 64612 const verse_transforms_transforms = { 64613 from: [{ 64614 type: 'block', 64615 blocks: ['core/paragraph'], 64616 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes) 64617 }], 64618 to: [{ 64619 type: 'block', 64620 blocks: ['core/paragraph'], 64621 transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) 64622 }] 64623 }; 64624 /* harmony default export */ const verse_transforms = (verse_transforms_transforms); 64625 64626 ;// ./node_modules/@wordpress/block-library/build-module/verse/index.js 64627 /** 64628 * WordPress dependencies 64629 */ 64630 64631 64632 64633 /** 64634 * Internal dependencies 64635 */ 64636 64637 64638 64639 const verse_metadata = { 64640 $schema: "https://schemas.wp.org/trunk/block.json", 64641 apiVersion: 3, 64642 name: "core/verse", 64643 title: "Verse", 64644 category: "text", 64645 description: "Insert poetry. Use special spacing formats. Or quote song lyrics.", 64646 keywords: ["poetry", "poem"], 64647 textdomain: "default", 64648 attributes: { 64649 content: { 64650 type: "rich-text", 64651 source: "rich-text", 64652 selector: "pre", 64653 __unstablePreserveWhiteSpace: true, 64654 role: "content" 64655 }, 64656 textAlign: { 64657 type: "string" 64658 } 64659 }, 64660 supports: { 64661 anchor: true, 64662 background: { 64663 backgroundImage: true, 64664 backgroundSize: true, 64665 __experimentalDefaultControls: { 64666 backgroundImage: true 64667 } 64668 }, 64669 color: { 64670 gradients: true, 64671 link: true, 64672 __experimentalDefaultControls: { 64673 background: true, 64674 text: true 64675 } 64676 }, 64677 dimensions: { 64678 minHeight: true, 64679 __experimentalDefaultControls: { 64680 minHeight: false 64681 } 64682 }, 64683 typography: { 64684 fontSize: true, 64685 __experimentalFontFamily: true, 64686 lineHeight: true, 64687 __experimentalFontStyle: true, 64688 __experimentalFontWeight: true, 64689 __experimentalLetterSpacing: true, 64690 __experimentalTextTransform: true, 64691 __experimentalTextDecoration: true, 64692 __experimentalWritingMode: true, 64693 __experimentalDefaultControls: { 64694 fontSize: true 64695 } 64696 }, 64697 spacing: { 64698 margin: true, 64699 padding: true, 64700 __experimentalDefaultControls: { 64701 margin: false, 64702 padding: false 64703 } 64704 }, 64705 __experimentalBorder: { 64706 radius: true, 64707 width: true, 64708 color: true, 64709 style: true 64710 }, 64711 interactivity: { 64712 clientNavigation: true 64713 } 64714 }, 64715 style: "wp-block-verse", 64716 editorStyle: "wp-block-verse-editor" 64717 }; 64718 64719 64720 const { 64721 name: verse_name 64722 } = verse_metadata; 64723 64724 const verse_settings = { 64725 icon: library_verse, 64726 example: { 64727 attributes: { 64728 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 64729 // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work. 64730 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.') 64731 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 64732 } 64733 }, 64734 transforms: verse_transforms, 64735 deprecated: verse_deprecated, 64736 merge(attributes, attributesToMerge) { 64737 return { 64738 content: attributes.content + '\n\n' + attributesToMerge.content 64739 }; 64740 }, 64741 edit: VerseEdit, 64742 save: verse_save_save 64743 }; 64744 const verse_init = () => initBlock({ 64745 name: verse_name, 64746 metadata: verse_metadata, 64747 settings: verse_settings 64748 }); 64749 64750 ;// ./node_modules/@wordpress/icons/build-module/library/video.js 64751 /** 64752 * WordPress dependencies 64753 */ 64754 64755 64756 const video = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 64757 viewBox: "0 0 24 24", 64758 xmlns: "http://www.w3.org/2000/svg", 64759 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 64760 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" 64761 }) 64762 }); 64763 /* harmony default export */ const library_video = (video); 64764 64765 ;// ./node_modules/@wordpress/block-library/build-module/video/tracks.js 64766 /* wp:polyfill */ 64767 64768 function Tracks({ 64769 tracks = [] 64770 }) { 64771 return tracks.map(track => { 64772 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("track", { 64773 ...track 64774 }, track.src); 64775 }); 64776 } 64777 64778 ;// ./node_modules/@wordpress/block-library/build-module/video/deprecated.js 64779 /** 64780 * WordPress dependencies 64781 */ 64782 64783 64784 /** 64785 * Internal dependencies 64786 */ 64787 const video_deprecated_metadata = { 64788 $schema: "https://schemas.wp.org/trunk/block.json", 64789 apiVersion: 3, 64790 name: "core/video", 64791 title: "Video", 64792 category: "media", 64793 description: "Embed a video from your media library or upload a new one.", 64794 keywords: ["movie"], 64795 textdomain: "default", 64796 attributes: { 64797 autoplay: { 64798 type: "boolean", 64799 source: "attribute", 64800 selector: "video", 64801 attribute: "autoplay" 64802 }, 64803 caption: { 64804 type: "rich-text", 64805 source: "rich-text", 64806 selector: "figcaption", 64807 role: "content" 64808 }, 64809 controls: { 64810 type: "boolean", 64811 source: "attribute", 64812 selector: "video", 64813 attribute: "controls", 64814 "default": true 64815 }, 64816 id: { 64817 type: "number", 64818 role: "content" 64819 }, 64820 loop: { 64821 type: "boolean", 64822 source: "attribute", 64823 selector: "video", 64824 attribute: "loop" 64825 }, 64826 muted: { 64827 type: "boolean", 64828 source: "attribute", 64829 selector: "video", 64830 attribute: "muted" 64831 }, 64832 poster: { 64833 type: "string", 64834 source: "attribute", 64835 selector: "video", 64836 attribute: "poster" 64837 }, 64838 preload: { 64839 type: "string", 64840 source: "attribute", 64841 selector: "video", 64842 attribute: "preload", 64843 "default": "metadata" 64844 }, 64845 blob: { 64846 type: "string", 64847 role: "local" 64848 }, 64849 src: { 64850 type: "string", 64851 source: "attribute", 64852 selector: "video", 64853 attribute: "src", 64854 role: "content" 64855 }, 64856 playsInline: { 64857 type: "boolean", 64858 source: "attribute", 64859 selector: "video", 64860 attribute: "playsinline" 64861 }, 64862 tracks: { 64863 role: "content", 64864 type: "array", 64865 items: { 64866 type: "object" 64867 }, 64868 "default": [] 64869 } 64870 }, 64871 supports: { 64872 anchor: true, 64873 align: true, 64874 spacing: { 64875 margin: true, 64876 padding: true, 64877 __experimentalDefaultControls: { 64878 margin: false, 64879 padding: false 64880 } 64881 }, 64882 interactivity: { 64883 clientNavigation: true 64884 } 64885 }, 64886 editorStyle: "wp-block-video-editor", 64887 style: "wp-block-video" 64888 }; 64889 64890 64891 const { 64892 attributes: video_deprecated_blockAttributes 64893 } = video_deprecated_metadata; 64894 64895 // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname 64896 // to the video figcaption element. 64897 const video_deprecated_v1 = { 64898 attributes: video_deprecated_blockAttributes, 64899 save({ 64900 attributes 64901 }) { 64902 const { 64903 autoplay, 64904 caption, 64905 controls, 64906 loop, 64907 muted, 64908 poster, 64909 preload, 64910 src, 64911 playsInline, 64912 tracks 64913 } = attributes; 64914 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 64915 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 64916 children: [src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 64917 autoPlay: autoplay, 64918 controls: controls, 64919 loop: loop, 64920 muted: muted, 64921 poster: poster, 64922 preload: preload !== 'metadata' ? preload : undefined, 64923 src: src, 64924 playsInline: playsInline, 64925 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { 64926 tracks: tracks 64927 }) 64928 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 64929 tagName: "figcaption", 64930 value: caption 64931 })] 64932 }); 64933 } 64934 }; 64935 const video_deprecated_deprecated = [video_deprecated_v1]; 64936 /* harmony default export */ const video_deprecated = (video_deprecated_deprecated); 64937 64938 ;// ./node_modules/@wordpress/block-library/build-module/video/poster-image.js 64939 /** 64940 * WordPress dependencies 64941 */ 64942 64943 64944 64945 64946 64947 function PosterImage({ 64948 poster, 64949 setAttributes, 64950 instanceId 64951 }) { 64952 const posterImageButton = (0,external_wp_element_namespaceObject.useRef)(); 64953 const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image']; 64954 const videoPosterDescription = `video-block__poster-image-description-$instanceId}`; 64955 function onSelectPoster(image) { 64956 setAttributes({ 64957 poster: image.url 64958 }); 64959 } 64960 function onRemovePoster() { 64961 setAttributes({ 64962 poster: undefined 64963 }); 64964 64965 // Move focus back to the Media Upload button. 64966 posterImageButton.current.focus(); 64967 } 64968 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 64969 label: (0,external_wp_i18n_namespaceObject.__)('Poster image'), 64970 isShownByDefault: true, 64971 hasValue: () => !!poster, 64972 onDeselect: () => { 64973 setAttributes({ 64974 poster: '' 64975 }); 64976 }, 64977 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { 64978 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 64979 className: "editor-video-poster-control", 64980 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { 64981 children: (0,external_wp_i18n_namespaceObject.__)('Poster image') 64982 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { 64983 title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'), 64984 onSelect: onSelectPoster, 64985 allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES, 64986 render: ({ 64987 open 64988 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 64989 __next40pxDefaultSize: true, 64990 variant: "primary", 64991 onClick: open, 64992 ref: posterImageButton, 64993 "aria-describedby": videoPosterDescription, 64994 children: !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace') 64995 }) 64996 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 64997 id: videoPosterDescription, 64998 hidden: true, 64999 children: poster ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: poster image URL. */ 65000 (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') 65001 }), !!poster && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 65002 __next40pxDefaultSize: true, 65003 onClick: onRemovePoster, 65004 variant: "tertiary", 65005 children: (0,external_wp_i18n_namespaceObject.__)('Remove') 65006 })] 65007 }) 65008 }) 65009 }); 65010 } 65011 /* harmony default export */ const poster_image = (PosterImage); 65012 65013 ;// ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js 65014 /** 65015 * WordPress dependencies 65016 */ 65017 65018 65019 65020 65021 const options = [{ 65022 value: 'auto', 65023 label: (0,external_wp_i18n_namespaceObject.__)('Auto') 65024 }, { 65025 value: 'metadata', 65026 label: (0,external_wp_i18n_namespaceObject.__)('Metadata') 65027 }, { 65028 value: 'none', 65029 label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') 65030 }]; 65031 const VideoSettings = ({ 65032 setAttributes, 65033 attributes 65034 }) => { 65035 const { 65036 autoplay, 65037 controls, 65038 loop, 65039 muted, 65040 playsInline, 65041 preload 65042 } = attributes; 65043 const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.'); 65044 const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({ 65045 web: (0,external_wp_element_namespaceObject.useCallback)(checked => { 65046 return checked ? autoPlayHelpText : null; 65047 }, []), 65048 native: autoPlayHelpText 65049 }); 65050 const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => { 65051 const toggleAttribute = attribute => { 65052 return newValue => { 65053 setAttributes({ 65054 [attribute]: newValue 65055 }); 65056 }; 65057 }; 65058 return { 65059 autoplay: toggleAttribute('autoplay'), 65060 loop: toggleAttribute('loop'), 65061 muted: toggleAttribute('muted'), 65062 controls: toggleAttribute('controls'), 65063 playsInline: toggleAttribute('playsInline') 65064 }; 65065 }, []); 65066 const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => { 65067 setAttributes({ 65068 preload: value 65069 }); 65070 }, []); 65071 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 65072 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65073 label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), 65074 isShownByDefault: true, 65075 hasValue: () => !!autoplay, 65076 onDeselect: () => { 65077 setAttributes({ 65078 autoplay: false 65079 }); 65080 }, 65081 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 65082 __nextHasNoMarginBottom: true, 65083 label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), 65084 onChange: toggleFactory.autoplay, 65085 checked: !!autoplay, 65086 help: getAutoplayHelp 65087 }) 65088 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65089 label: (0,external_wp_i18n_namespaceObject.__)('Loop'), 65090 isShownByDefault: true, 65091 hasValue: () => !!loop, 65092 onDeselect: () => { 65093 setAttributes({ 65094 loop: false 65095 }); 65096 }, 65097 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 65098 __nextHasNoMarginBottom: true, 65099 label: (0,external_wp_i18n_namespaceObject.__)('Loop'), 65100 onChange: toggleFactory.loop, 65101 checked: !!loop 65102 }) 65103 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65104 label: (0,external_wp_i18n_namespaceObject.__)('Muted'), 65105 isShownByDefault: true, 65106 hasValue: () => !!muted, 65107 onDeselect: () => { 65108 setAttributes({ 65109 muted: false 65110 }); 65111 }, 65112 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 65113 __nextHasNoMarginBottom: true, 65114 label: (0,external_wp_i18n_namespaceObject.__)('Muted'), 65115 onChange: toggleFactory.muted, 65116 checked: !!muted 65117 }) 65118 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65119 label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'), 65120 isShownByDefault: true, 65121 hasValue: () => !controls, 65122 onDeselect: () => { 65123 setAttributes({ 65124 controls: true 65125 }); 65126 }, 65127 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 65128 __nextHasNoMarginBottom: true, 65129 label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'), 65130 onChange: toggleFactory.controls, 65131 checked: !!controls 65132 }) 65133 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65134 label: (0,external_wp_i18n_namespaceObject.__)('Play inline'), 65135 isShownByDefault: true, 65136 hasValue: () => !!playsInline, 65137 onDeselect: () => { 65138 setAttributes({ 65139 playsInline: false 65140 }); 65141 }, 65142 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { 65143 __nextHasNoMarginBottom: true 65144 /* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */, 65145 label: (0,external_wp_i18n_namespaceObject.__)('Play inline'), 65146 onChange: toggleFactory.playsInline, 65147 checked: !!playsInline, 65148 help: (0,external_wp_i18n_namespaceObject.__)('When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.') 65149 }) 65150 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { 65151 label: (0,external_wp_i18n_namespaceObject.__)('Preload'), 65152 isShownByDefault: true, 65153 hasValue: () => preload !== 'metadata', 65154 onDeselect: () => { 65155 setAttributes({ 65156 preload: 'metadata' 65157 }); 65158 }, 65159 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 65160 __next40pxDefaultSize: true, 65161 __nextHasNoMarginBottom: true, 65162 label: (0,external_wp_i18n_namespaceObject.__)('Preload'), 65163 value: preload, 65164 onChange: onChangePreload, 65165 options: options, 65166 hideCancelButton: true 65167 }) 65168 })] 65169 }); 65170 }; 65171 /* harmony default export */ const edit_common_settings = (VideoSettings); 65172 65173 ;// ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js 65174 /* wp:polyfill */ 65175 /** 65176 * WordPress dependencies 65177 */ 65178 65179 65180 65181 65182 65183 65184 65185 65186 const ALLOWED_TYPES = ['text/vtt']; 65187 const DEFAULT_KIND = 'subtitles'; 65188 const KIND_OPTIONS = [{ 65189 label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'), 65190 value: 'subtitles' 65191 }, { 65192 label: (0,external_wp_i18n_namespaceObject.__)('Captions'), 65193 value: 'captions' 65194 }, { 65195 label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'), 65196 value: 'descriptions' 65197 }, { 65198 label: (0,external_wp_i18n_namespaceObject.__)('Chapters'), 65199 value: 'chapters' 65200 }, { 65201 label: (0,external_wp_i18n_namespaceObject.__)('Metadata'), 65202 value: 'metadata' 65203 }]; 65204 function TrackList({ 65205 tracks, 65206 onEditPress 65207 }) { 65208 const content = tracks.map((track, index) => { 65209 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 65210 className: "block-library-video-tracks-editor__track-list-track", 65211 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 65212 children: track.label 65213 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 65214 __next40pxDefaultSize: true, 65215 variant: "tertiary", 65216 onClick: () => onEditPress(index), 65217 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the video text track e.g: "French subtitles". */ 65218 (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'text tracks'), track.label), 65219 children: (0,external_wp_i18n_namespaceObject.__)('Edit') 65220 })] 65221 }, index); 65222 }); 65223 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { 65224 label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'), 65225 className: "block-library-video-tracks-editor__track-list", 65226 children: content 65227 }); 65228 } 65229 function SingleTrackEditor({ 65230 track, 65231 onChange, 65232 onClose, 65233 onRemove 65234 }) { 65235 const { 65236 src = '', 65237 label = '', 65238 srcLang = '', 65239 kind = DEFAULT_KIND 65240 } = track; 65241 const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || ''; 65242 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 65243 className: "block-library-video-tracks-editor__single-track-editor", 65244 spacing: "4", 65245 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 65246 className: "block-library-video-tracks-editor__single-track-editor-edit-track-label", 65247 children: (0,external_wp_i18n_namespaceObject.__)('Edit track') 65248 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { 65249 children: [(0,external_wp_i18n_namespaceObject.__)('File'), ": ", /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("b", { 65250 children: fileName 65251 })] 65252 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { 65253 columns: 2, 65254 gap: 4, 65255 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 65256 __next40pxDefaultSize: true, 65257 __nextHasNoMarginBottom: true, 65258 onChange: newLabel => onChange({ 65259 ...track, 65260 label: newLabel 65261 }), 65262 label: (0,external_wp_i18n_namespaceObject.__)('Label'), 65263 value: label, 65264 help: (0,external_wp_i18n_namespaceObject.__)('Title of track') 65265 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { 65266 __next40pxDefaultSize: true, 65267 __nextHasNoMarginBottom: true, 65268 onChange: newSrcLang => onChange({ 65269 ...track, 65270 srcLang: newSrcLang 65271 }), 65272 label: (0,external_wp_i18n_namespaceObject.__)('Source language'), 65273 value: srcLang, 65274 help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)') 65275 })] 65276 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { 65277 spacing: "8", 65278 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { 65279 __next40pxDefaultSize: true, 65280 __nextHasNoMarginBottom: true, 65281 className: "block-library-video-tracks-editor__single-track-editor-kind-select", 65282 options: KIND_OPTIONS, 65283 value: kind, 65284 label: (0,external_wp_i18n_namespaceObject.__)('Kind'), 65285 onChange: newKind => { 65286 onChange({ 65287 ...track, 65288 kind: newKind 65289 }); 65290 } 65291 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 65292 className: "block-library-video-tracks-editor__single-track-editor-buttons-container", 65293 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 65294 __next40pxDefaultSize: true, 65295 isDestructive: true, 65296 variant: "link", 65297 onClick: onRemove, 65298 children: (0,external_wp_i18n_namespaceObject.__)('Remove track') 65299 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { 65300 __next40pxDefaultSize: true, 65301 variant: "primary", 65302 onClick: () => { 65303 const changes = {}; 65304 let hasChanges = false; 65305 if (label === '') { 65306 changes.label = (0,external_wp_i18n_namespaceObject.__)('English'); 65307 hasChanges = true; 65308 } 65309 if (srcLang === '') { 65310 changes.srcLang = 'en'; 65311 hasChanges = true; 65312 } 65313 if (track.kind === undefined) { 65314 changes.kind = DEFAULT_KIND; 65315 hasChanges = true; 65316 } 65317 if (hasChanges) { 65318 onChange({ 65319 ...track, 65320 ...changes 65321 }); 65322 } 65323 onClose(); 65324 }, 65325 children: (0,external_wp_i18n_namespaceObject.__)('Apply') 65326 })] 65327 })] 65328 })] 65329 }); 65330 } 65331 function TracksEditor({ 65332 tracks = [], 65333 onChange 65334 }) { 65335 const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { 65336 return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload; 65337 }, []); 65338 const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null); 65339 const dropdownPopoverRef = (0,external_wp_element_namespaceObject.useRef)(); 65340 (0,external_wp_element_namespaceObject.useEffect)(() => { 65341 dropdownPopoverRef.current?.focus(); 65342 }, [trackBeingEdited]); 65343 if (!mediaUpload) { 65344 return null; 65345 } 65346 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { 65347 contentClassName: "block-library-video-tracks-editor", 65348 focusOnMount: true, 65349 popoverProps: { 65350 ref: dropdownPopoverRef 65351 }, 65352 renderToggle: ({ 65353 isOpen, 65354 onToggle 65355 }) => { 65356 const handleOnToggle = () => { 65357 if (!isOpen) { 65358 // When the Popover opens make sure the initial view is 65359 // always the track list rather than the edit track UI. 65360 setTrackBeingEdited(null); 65361 } 65362 onToggle(); 65363 }; 65364 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { 65365 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { 65366 "aria-expanded": isOpen, 65367 "aria-haspopup": "true", 65368 onClick: handleOnToggle, 65369 children: (0,external_wp_i18n_namespaceObject.__)('Text tracks') 65370 }) 65371 }); 65372 }, 65373 renderContent: () => { 65374 if (trackBeingEdited !== null) { 65375 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleTrackEditor, { 65376 track: tracks[trackBeingEdited], 65377 onChange: newTrack => { 65378 const newTracks = [...tracks]; 65379 newTracks[trackBeingEdited] = newTrack; 65380 onChange(newTracks); 65381 }, 65382 onClose: () => setTrackBeingEdited(null), 65383 onRemove: () => { 65384 onChange(tracks.filter((_track, index) => index !== trackBeingEdited)); 65385 setTrackBeingEdited(null); 65386 } 65387 }); 65388 } 65389 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 65390 children: [tracks.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 65391 className: "block-library-video-tracks-editor__tracks-informative-message", 65392 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { 65393 className: "block-library-video-tracks-editor__tracks-informative-message-title", 65394 children: (0,external_wp_i18n_namespaceObject.__)('Text tracks') 65395 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { 65396 className: "block-library-video-tracks-editor__tracks-informative-message-description", 65397 children: (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.') 65398 })] 65399 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { 65400 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TrackList, { 65401 tracks: tracks, 65402 onEditPress: setTrackBeingEdited 65403 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { 65404 className: "block-library-video-tracks-editor__add-tracks-container", 65405 label: (0,external_wp_i18n_namespaceObject.__)('Add tracks'), 65406 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { 65407 onSelect: ({ 65408 url 65409 }) => { 65410 const trackIndex = tracks.length; 65411 onChange([...tracks, { 65412 src: url 65413 }]); 65414 setTrackBeingEdited(trackIndex); 65415 }, 65416 allowedTypes: ALLOWED_TYPES, 65417 render: ({ 65418 open 65419 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 65420 icon: library_media, 65421 onClick: open, 65422 children: (0,external_wp_i18n_namespaceObject.__)('Open Media Library') 65423 }) 65424 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { 65425 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormFileUpload, { 65426 onChange: event => { 65427 const files = event.target.files; 65428 const trackIndex = tracks.length; 65429 mediaUpload({ 65430 allowedTypes: ALLOWED_TYPES, 65431 filesList: files, 65432 onFileChange: ([{ 65433 url 65434 }]) => { 65435 const newTracks = [...tracks]; 65436 if (!newTracks[trackIndex]) { 65437 newTracks[trackIndex] = {}; 65438 } 65439 newTracks[trackIndex] = { 65440 ...tracks[trackIndex], 65441 src: url 65442 }; 65443 onChange(newTracks); 65444 setTrackBeingEdited(trackIndex); 65445 } 65446 }); 65447 }, 65448 accept: ".vtt,text/vtt", 65449 render: ({ 65450 openFileDialog 65451 }) => { 65452 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { 65453 icon: library_upload, 65454 onClick: () => { 65455 openFileDialog(); 65456 }, 65457 children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb') 65458 }); 65459 } 65460 }) 65461 })] 65462 })] 65463 })] 65464 }); 65465 } 65466 }); 65467 } 65468 65469 ;// ./node_modules/@wordpress/block-library/build-module/video/edit.js 65470 /** 65471 * External dependencies 65472 */ 65473 65474 65475 /** 65476 * WordPress dependencies 65477 */ 65478 65479 65480 65481 65482 65483 65484 65485 65486 65487 65488 /** 65489 * Internal dependencies 65490 */ 65491 65492 65493 65494 65495 65496 65497 65498 65499 const video_edit_ALLOWED_MEDIA_TYPES = ['video']; 65500 function VideoEdit({ 65501 isSelected: isSingleSelected, 65502 attributes, 65503 className, 65504 setAttributes, 65505 insertBlocksAfter, 65506 onReplace 65507 }) { 65508 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit); 65509 const videoPlayer = (0,external_wp_element_namespaceObject.useRef)(); 65510 const { 65511 id, 65512 controls, 65513 poster, 65514 src, 65515 tracks 65516 } = attributes; 65517 const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); 65518 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 65519 useUploadMediaFromBlobURL({ 65520 url: temporaryURL, 65521 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, 65522 onChange: onSelectVideo, 65523 onError: onUploadError 65524 }); 65525 (0,external_wp_element_namespaceObject.useEffect)(() => { 65526 // Placeholder may be rendered. 65527 if (videoPlayer.current) { 65528 videoPlayer.current.load(); 65529 } 65530 }, [poster]); 65531 function onSelectVideo(media) { 65532 if (!media || !media.url) { 65533 // In this case there was an error 65534 // previous attributes should be removed 65535 // because they may be temporary blob urls. 65536 setAttributes({ 65537 src: undefined, 65538 id: undefined, 65539 poster: undefined, 65540 caption: undefined, 65541 blob: undefined 65542 }); 65543 setTemporaryURL(); 65544 return; 65545 } 65546 if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { 65547 setTemporaryURL(media.url); 65548 return; 65549 } 65550 65551 // Sets the block's attribute and updates the edit component from the 65552 // selected media. 65553 setAttributes({ 65554 blob: undefined, 65555 src: media.url, 65556 id: media.id, 65557 poster: media.image?.src !== media.icon ? media.image?.src : undefined, 65558 caption: media.caption 65559 }); 65560 setTemporaryURL(); 65561 } 65562 function onSelectURL(newSrc) { 65563 if (newSrc !== src) { 65564 // Check if there's an embed block that handles this URL. 65565 const embedBlock = createUpgradedEmbedBlock({ 65566 attributes: { 65567 url: newSrc 65568 } 65569 }); 65570 if (undefined !== embedBlock && onReplace) { 65571 onReplace(embedBlock); 65572 return; 65573 } 65574 setAttributes({ 65575 blob: undefined, 65576 src: newSrc, 65577 id: undefined, 65578 poster: undefined 65579 }); 65580 setTemporaryURL(); 65581 } 65582 } 65583 const { 65584 createErrorNotice 65585 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 65586 function onUploadError(message) { 65587 createErrorNotice(message, { 65588 type: 'snackbar' 65589 }); 65590 } 65591 65592 // Much of this description is duplicated from MediaPlaceholder. 65593 const placeholder = content => { 65594 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 65595 className: "block-editor-media-placeholder", 65596 withIllustration: !isSingleSelected, 65597 icon: library_video, 65598 label: (0,external_wp_i18n_namespaceObject.__)('Video'), 65599 instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop a video, upload, or choose from your library.'), 65600 children: content 65601 }); 65602 }; 65603 const classes = dist_clsx(className, { 65604 'is-transient': !!temporaryURL 65605 }); 65606 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ 65607 className: classes 65608 }); 65609 if (!src && !temporaryURL) { 65610 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 65611 ...blockProps, 65612 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { 65613 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 65614 icon: library_video 65615 }), 65616 onSelect: onSelectVideo, 65617 onSelectURL: onSelectURL, 65618 accept: "video/*", 65619 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, 65620 value: attributes, 65621 onError: onUploadError, 65622 placeholder: placeholder 65623 }) 65624 }); 65625 } 65626 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 65627 children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { 65628 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 65629 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TracksEditor, { 65630 tracks: tracks, 65631 onChange: newTracks => { 65632 setAttributes({ 65633 tracks: newTracks 65634 }); 65635 } 65636 }) 65637 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { 65638 group: "other", 65639 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { 65640 mediaId: id, 65641 mediaURL: src, 65642 allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, 65643 accept: "video/*", 65644 onSelect: onSelectVideo, 65645 onSelectURL: onSelectURL, 65646 onError: onUploadError, 65647 onReset: () => onSelectVideo(undefined) 65648 }) 65649 })] 65650 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { 65651 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { 65652 label: (0,external_wp_i18n_namespaceObject.__)('Settings'), 65653 resetAll: () => { 65654 setAttributes({ 65655 autoplay: false, 65656 controls: true, 65657 loop: false, 65658 muted: false, 65659 playsInline: false, 65660 preload: 'metadata', 65661 poster: '' 65662 }); 65663 }, 65664 dropdownMenuProps: dropdownMenuProps, 65665 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_common_settings, { 65666 setAttributes: setAttributes, 65667 attributes: attributes 65668 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(poster_image, { 65669 poster: poster, 65670 setAttributes: setAttributes, 65671 instanceId: instanceId 65672 })] 65673 }) 65674 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 65675 ...blockProps, 65676 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { 65677 isDisabled: !isSingleSelected, 65678 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 65679 controls: controls, 65680 poster: poster, 65681 src: src || temporaryURL, 65682 ref: videoPlayer, 65683 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { 65684 tracks: tracks 65685 }) 65686 }) 65687 }), !!temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { 65688 attributes: attributes, 65689 setAttributes: setAttributes, 65690 isSelected: isSingleSelected, 65691 insertBlocksAfter: insertBlocksAfter, 65692 label: (0,external_wp_i18n_namespaceObject.__)('Video caption text'), 65693 showToolbarButton: isSingleSelected 65694 })] 65695 })] 65696 }); 65697 } 65698 /* harmony default export */ const video_edit = (VideoEdit); 65699 65700 ;// ./node_modules/@wordpress/block-library/build-module/video/save.js 65701 /** 65702 * WordPress dependencies 65703 */ 65704 65705 65706 /** 65707 * Internal dependencies 65708 */ 65709 65710 65711 function video_save_save({ 65712 attributes 65713 }) { 65714 const { 65715 autoplay, 65716 caption, 65717 controls, 65718 loop, 65719 muted, 65720 poster, 65721 preload, 65722 src, 65723 playsInline, 65724 tracks 65725 } = attributes; 65726 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { 65727 ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), 65728 children: [src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { 65729 autoPlay: autoplay, 65730 controls: controls, 65731 loop: loop, 65732 muted: muted, 65733 poster: poster, 65734 preload: preload !== 'metadata' ? preload : undefined, 65735 src: src, 65736 playsInline: playsInline, 65737 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { 65738 tracks: tracks 65739 }) 65740 }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { 65741 className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), 65742 tagName: "figcaption", 65743 value: caption 65744 })] 65745 }); 65746 } 65747 65748 ;// ./node_modules/@wordpress/block-library/build-module/video/transforms.js 65749 /** 65750 * WordPress dependencies 65751 */ 65752 65753 65754 const video_transforms_transforms = { 65755 from: [{ 65756 type: 'files', 65757 isMatch(files) { 65758 return files.length === 1 && files[0].type.indexOf('video/') === 0; 65759 }, 65760 transform(files) { 65761 const file = files[0]; 65762 // We don't need to upload the media directly here 65763 // It's already done as part of the `componentDidMount` 65764 // in the video block 65765 const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { 65766 blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) 65767 }); 65768 return block; 65769 } 65770 }, { 65771 type: 'shortcode', 65772 tag: 'video', 65773 attributes: { 65774 src: { 65775 type: 'string', 65776 shortcode: ({ 65777 named: { 65778 src, 65779 mp4, 65780 m4v, 65781 webm, 65782 ogv, 65783 flv 65784 } 65785 }) => { 65786 return src || mp4 || m4v || webm || ogv || flv; 65787 } 65788 }, 65789 poster: { 65790 type: 'string', 65791 shortcode: ({ 65792 named: { 65793 poster 65794 } 65795 }) => { 65796 return poster; 65797 } 65798 }, 65799 loop: { 65800 type: 'string', 65801 shortcode: ({ 65802 named: { 65803 loop 65804 } 65805 }) => { 65806 return loop; 65807 } 65808 }, 65809 autoplay: { 65810 type: 'string', 65811 shortcode: ({ 65812 named: { 65813 autoplay 65814 } 65815 }) => { 65816 return autoplay; 65817 } 65818 }, 65819 preload: { 65820 type: 'string', 65821 shortcode: ({ 65822 named: { 65823 preload 65824 } 65825 }) => { 65826 return preload; 65827 } 65828 } 65829 } 65830 }, { 65831 type: 'raw', 65832 isMatch: node => node.nodeName === 'P' && node.children.length === 1 && node.firstChild.nodeName === 'VIDEO', 65833 transform: node => { 65834 const videoElement = node.firstChild; 65835 const attributes = { 65836 autoplay: videoElement.hasAttribute('autoplay') ? true : undefined, 65837 controls: videoElement.hasAttribute('controls') ? undefined : false, 65838 loop: videoElement.hasAttribute('loop') ? true : undefined, 65839 muted: videoElement.hasAttribute('muted') ? true : undefined, 65840 preload: videoElement.getAttribute('preload') || undefined, 65841 playsInline: videoElement.hasAttribute('playsinline') ? true : undefined, 65842 poster: videoElement.getAttribute('poster') || undefined, 65843 src: videoElement.getAttribute('src') || undefined 65844 }; 65845 if ((0,external_wp_blob_namespaceObject.isBlobURL)(attributes.src)) { 65846 attributes.blob = attributes.src; 65847 delete attributes.src; 65848 } 65849 return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', attributes); 65850 } 65851 }] 65852 }; 65853 /* harmony default export */ const video_transforms = (video_transforms_transforms); 65854 65855 ;// ./node_modules/@wordpress/block-library/build-module/video/index.js 65856 /** 65857 * WordPress dependencies 65858 */ 65859 65860 65861 65862 /** 65863 * Internal dependencies 65864 */ 65865 65866 65867 65868 const video_metadata = { 65869 $schema: "https://schemas.wp.org/trunk/block.json", 65870 apiVersion: 3, 65871 name: "core/video", 65872 title: "Video", 65873 category: "media", 65874 description: "Embed a video from your media library or upload a new one.", 65875 keywords: ["movie"], 65876 textdomain: "default", 65877 attributes: { 65878 autoplay: { 65879 type: "boolean", 65880 source: "attribute", 65881 selector: "video", 65882 attribute: "autoplay" 65883 }, 65884 caption: { 65885 type: "rich-text", 65886 source: "rich-text", 65887 selector: "figcaption", 65888 role: "content" 65889 }, 65890 controls: { 65891 type: "boolean", 65892 source: "attribute", 65893 selector: "video", 65894 attribute: "controls", 65895 "default": true 65896 }, 65897 id: { 65898 type: "number", 65899 role: "content" 65900 }, 65901 loop: { 65902 type: "boolean", 65903 source: "attribute", 65904 selector: "video", 65905 attribute: "loop" 65906 }, 65907 muted: { 65908 type: "boolean", 65909 source: "attribute", 65910 selector: "video", 65911 attribute: "muted" 65912 }, 65913 poster: { 65914 type: "string", 65915 source: "attribute", 65916 selector: "video", 65917 attribute: "poster" 65918 }, 65919 preload: { 65920 type: "string", 65921 source: "attribute", 65922 selector: "video", 65923 attribute: "preload", 65924 "default": "metadata" 65925 }, 65926 blob: { 65927 type: "string", 65928 role: "local" 65929 }, 65930 src: { 65931 type: "string", 65932 source: "attribute", 65933 selector: "video", 65934 attribute: "src", 65935 role: "content" 65936 }, 65937 playsInline: { 65938 type: "boolean", 65939 source: "attribute", 65940 selector: "video", 65941 attribute: "playsinline" 65942 }, 65943 tracks: { 65944 role: "content", 65945 type: "array", 65946 items: { 65947 type: "object" 65948 }, 65949 "default": [] 65950 } 65951 }, 65952 supports: { 65953 anchor: true, 65954 align: true, 65955 spacing: { 65956 margin: true, 65957 padding: true, 65958 __experimentalDefaultControls: { 65959 margin: false, 65960 padding: false 65961 } 65962 }, 65963 interactivity: { 65964 clientNavigation: true 65965 } 65966 }, 65967 editorStyle: "wp-block-video-editor", 65968 style: "wp-block-video" 65969 }; 65970 65971 65972 const { 65973 name: video_name 65974 } = video_metadata; 65975 65976 const video_settings = { 65977 icon: library_video, 65978 example: { 65979 attributes: { 65980 src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm', 65981 // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block. 65982 caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.') 65983 } 65984 }, 65985 transforms: video_transforms, 65986 deprecated: video_deprecated, 65987 edit: video_edit, 65988 save: video_save_save 65989 }; 65990 const video_init = () => initBlock({ 65991 name: video_name, 65992 metadata: video_metadata, 65993 settings: video_settings 65994 }); 65995 65996 ;// ./node_modules/@wordpress/block-library/build-module/footnotes/edit.js 65997 /* wp:polyfill */ 65998 /** 65999 * WordPress dependencies 66000 */ 66001 66002 66003 66004 66005 66006 66007 function FootnotesEdit({ 66008 context: { 66009 postType, 66010 postId 66011 } 66012 }) { 66013 const [meta, updateMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta', postId); 66014 const footnotesSupported = 'string' === typeof meta?.footnotes; 66015 const footnotes = meta?.footnotes ? JSON.parse(meta.footnotes) : []; 66016 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 66017 if (!footnotesSupported) { 66018 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 66019 ...blockProps, 66020 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 66021 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 66022 icon: format_list_numbered 66023 }), 66024 label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), 66025 instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes are not supported here. Add this block to post or page content.') 66026 }) 66027 }); 66028 } 66029 if (!footnotes.length) { 66030 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 66031 ...blockProps, 66032 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { 66033 icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { 66034 icon: format_list_numbered 66035 }), 66036 label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), 66037 instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes found in blocks within this document will be displayed here.') 66038 }) 66039 }); 66040 } 66041 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { 66042 ...blockProps, 66043 children: footnotes.map(({ 66044 id, 66045 content 66046 }) => 66047 /*#__PURE__*/ 66048 /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ 66049 (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { 66050 onMouseDown: event => { 66051 // When clicking on the list item (not on descendants), 66052 // focus the rich text element since it's only 1px wide when 66053 // empty. 66054 if (event.target === event.currentTarget) { 66055 event.target.firstElementChild.focus(); 66056 event.preventDefault(); 66057 } 66058 }, 66059 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { 66060 id: id, 66061 tagName: "span", 66062 value: content, 66063 identifier: id 66064 // To do: figure out why the browser is not scrolling 66065 // into view when it receives focus. 66066 , 66067 onFocus: event => { 66068 if (!event.target.textContent.trim()) { 66069 event.target.scrollIntoView(); 66070 } 66071 }, 66072 onChange: nextFootnote => { 66073 updateMeta({ 66074 ...meta, 66075 footnotes: JSON.stringify(footnotes.map(footnote => { 66076 return footnote.id === id ? { 66077 content: nextFootnote, 66078 id 66079 } : footnote; 66080 })) 66081 }); 66082 } 66083 }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { 66084 href: `#$id}-link`, 66085 children: "\u21A9\uFE0E" 66086 })] 66087 }, id)) 66088 }); 66089 } 66090 66091 ;// ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/native.js 66092 const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); 66093 /* harmony default export */ const esm_browser_native = ({ 66094 randomUUID 66095 }); 66096 ;// ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/rng.js 66097 // Unique ID creation requires a high quality random # generator. In the browser we therefore 66098 // require the crypto API and do not support built-in fallback to lower quality random number 66099 // generators (like Math.random()). 66100 let getRandomValues; 66101 const rnds8 = new Uint8Array(16); 66102 function rng() { 66103 // lazy load so that environments that need to polyfill have a chance to do so 66104 if (!getRandomValues) { 66105 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. 66106 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); 66107 66108 if (!getRandomValues) { 66109 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 66110 } 66111 } 66112 66113 return getRandomValues(rnds8); 66114 } 66115 ;// ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/stringify.js 66116 66117 /** 66118 * Convert array of 16 byte values to UUID string format of the form: 66119 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 66120 */ 66121 66122 const byteToHex = []; 66123 66124 for (let i = 0; i < 256; ++i) { 66125 byteToHex.push((i + 0x100).toString(16).slice(1)); 66126 } 66127 66128 function unsafeStringify(arr, offset = 0) { 66129 // Note: Be careful editing this code! It's been tuned for performance 66130 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 66131 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]]; 66132 } 66133 66134 function stringify(arr, offset = 0) { 66135 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one 66136 // of the following: 66137 // - One or more input array values don't map to a hex octet (leading to 66138 // "undefined" in the uuid) 66139 // - Invalid input values for the RFC `version` or `variant` fields 66140 66141 if (!validate(uuid)) { 66142 throw TypeError('Stringified UUID is invalid'); 66143 } 66144 66145 return uuid; 66146 } 66147 66148 /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); 66149 ;// ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/v4.js 66150 66151 66152 66153 66154 function v4_v4(options, buf, offset) { 66155 if (esm_browser_native.randomUUID && !buf && !options) { 66156 return esm_browser_native.randomUUID(); 66157 } 66158 66159 options = options || {}; 66160 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 66161 66162 rnds[6] = rnds[6] & 0x0f | 0x40; 66163 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 66164 66165 if (buf) { 66166 offset = offset || 0; 66167 66168 for (let i = 0; i < 16; ++i) { 66169 buf[offset + i] = rnds[i]; 66170 } 66171 66172 return buf; 66173 } 66174 66175 return unsafeStringify(rnds); 66176 } 66177 66178 /* harmony default export */ const esm_browser_v4 = (v4_v4); 66179 ;// ./node_modules/@wordpress/block-library/build-module/footnotes/format.js 66180 /** 66181 * External dependencies 66182 */ 66183 66184 66185 /** 66186 * WordPress dependencies 66187 */ 66188 66189 66190 66191 66192 66193 66194 66195 66196 /** 66197 * Internal dependencies 66198 */ 66199 66200 66201 const { 66202 usesContextKey 66203 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 66204 const formatName = 'core/footnote'; 66205 const POST_CONTENT_BLOCK_NAME = 'core/post-content'; 66206 const SYNCED_PATTERN_BLOCK_NAME = 'core/block'; 66207 const format = { 66208 title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), 66209 tagName: 'sup', 66210 className: 'fn', 66211 attributes: { 66212 'data-fn': 'data-fn' 66213 }, 66214 interactive: true, 66215 contentEditable: false, 66216 [usesContextKey]: ['postType', 'postId'], 66217 edit: function Edit({ 66218 value, 66219 onChange, 66220 isObjectActive, 66221 context: { 66222 postType, 66223 postId 66224 } 66225 }) { 66226 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); 66227 const { 66228 getSelectedBlockClientId, 66229 getBlocks, 66230 getBlockRootClientId, 66231 getBlockName, 66232 getBlockParentsByBlockName 66233 } = registry.select(external_wp_blockEditor_namespaceObject.store); 66234 const isFootnotesSupported = (0,external_wp_data_namespaceObject.useSelect)(select => { 66235 if (!select(external_wp_blocks_namespaceObject.store).getBlockType('core/footnotes')) { 66236 return false; 66237 } 66238 const allowedBlocks = select(external_wp_blockEditor_namespaceObject.store).getSettings().allowedBlockTypes; 66239 if (allowedBlocks === false || Array.isArray(allowedBlocks) && !allowedBlocks.includes('core/footnotes')) { 66240 return false; 66241 } 66242 const entityRecord = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); 66243 if ('string' !== typeof entityRecord?.meta?.footnotes) { 66244 return false; 66245 } 66246 66247 // Checks if the selected block lives within a pattern. 66248 const { 66249 getBlockParentsByBlockName: _getBlockParentsByBlockName, 66250 getSelectedBlockClientId: _getSelectedBlockClientId 66251 } = select(external_wp_blockEditor_namespaceObject.store); 66252 const parentCoreBlocks = _getBlockParentsByBlockName(_getSelectedBlockClientId(), SYNCED_PATTERN_BLOCK_NAME); 66253 return !parentCoreBlocks || parentCoreBlocks.length === 0; 66254 }, [postType, postId]); 66255 const { 66256 selectionChange, 66257 insertBlock 66258 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 66259 if (!isFootnotesSupported) { 66260 return null; 66261 } 66262 function onClick() { 66263 registry.batch(() => { 66264 let id; 66265 if (isObjectActive) { 66266 const object = value.replacements[value.start]; 66267 id = object?.attributes?.['data-fn']; 66268 } else { 66269 id = esm_browser_v4(); 66270 const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, { 66271 type: formatName, 66272 attributes: { 66273 'data-fn': id 66274 }, 66275 innerHTML: `<a href="#$id}" id="$id}-link">*</a>` 66276 }, value.end, value.end); 66277 newValue.start = newValue.end - 1; 66278 onChange(newValue); 66279 } 66280 const selectedClientId = getSelectedBlockClientId(); 66281 66282 /* 66283 * Attempts to find a common parent post content block. 66284 * This allows for locating blocks within a page edited in the site editor. 66285 */ 66286 const parentPostContent = getBlockParentsByBlockName(selectedClientId, POST_CONTENT_BLOCK_NAME); 66287 66288 // When called with a post content block, getBlocks will return 66289 // the block with controlled inner blocks included. 66290 const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); 66291 66292 // BFS search to find the first footnote block. 66293 let fnBlock = null; 66294 { 66295 const queue = [...blocks]; 66296 while (queue.length) { 66297 const block = queue.shift(); 66298 if (block.name === 'core/footnotes') { 66299 fnBlock = block; 66300 break; 66301 } 66302 queue.push(...block.innerBlocks); 66303 } 66304 } 66305 66306 // Maybe this should all also be moved to the entity provider. 66307 // When there is no footnotes block in the post, create one and 66308 // insert it at the bottom. 66309 if (!fnBlock) { 66310 let rootClientId = getBlockRootClientId(selectedClientId); 66311 while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) { 66312 rootClientId = getBlockRootClientId(rootClientId); 66313 } 66314 fnBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/footnotes'); 66315 insertBlock(fnBlock, undefined, rootClientId); 66316 } 66317 selectionChange(fnBlock.clientId, id, 0, 0); 66318 }); 66319 } 66320 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { 66321 icon: format_list_numbered, 66322 title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), 66323 onClick: onClick, 66324 isActive: isObjectActive 66325 }); 66326 } 66327 }; 66328 66329 ;// ./node_modules/@wordpress/block-library/build-module/footnotes/index.js 66330 /** 66331 * WordPress dependencies 66332 */ 66333 66334 66335 66336 /** 66337 * Internal dependencies 66338 */ 66339 66340 66341 const footnotes_metadata = { 66342 $schema: "https://schemas.wp.org/trunk/block.json", 66343 apiVersion: 3, 66344 name: "core/footnotes", 66345 title: "Footnotes", 66346 category: "text", 66347 description: "Display footnotes added to the page.", 66348 keywords: ["references"], 66349 textdomain: "default", 66350 usesContext: ["postId", "postType"], 66351 supports: { 66352 __experimentalBorder: { 66353 radius: true, 66354 color: true, 66355 width: true, 66356 style: true, 66357 __experimentalDefaultControls: { 66358 radius: false, 66359 color: false, 66360 width: false, 66361 style: false 66362 } 66363 }, 66364 color: { 66365 background: true, 66366 link: true, 66367 text: true, 66368 __experimentalDefaultControls: { 66369 link: true, 66370 text: true 66371 } 66372 }, 66373 html: false, 66374 multiple: false, 66375 reusable: false, 66376 inserter: false, 66377 spacing: { 66378 margin: true, 66379 padding: true, 66380 __experimentalDefaultControls: { 66381 margin: false, 66382 padding: false 66383 } 66384 }, 66385 typography: { 66386 fontSize: true, 66387 lineHeight: true, 66388 __experimentalFontFamily: true, 66389 __experimentalTextDecoration: true, 66390 __experimentalFontStyle: true, 66391 __experimentalFontWeight: true, 66392 __experimentalLetterSpacing: true, 66393 __experimentalTextTransform: true, 66394 __experimentalWritingMode: true, 66395 __experimentalDefaultControls: { 66396 fontSize: true 66397 } 66398 }, 66399 interactivity: { 66400 clientNavigation: true 66401 } 66402 }, 66403 style: "wp-block-footnotes" 66404 }; 66405 66406 const { 66407 name: footnotes_name 66408 } = footnotes_metadata; 66409 66410 const footnotes_settings = { 66411 icon: format_list_numbered, 66412 edit: FootnotesEdit 66413 }; 66414 const footnotes_init = () => { 66415 (0,external_wp_richText_namespaceObject.registerFormatType)(formatName, format); 66416 initBlock({ 66417 name: footnotes_name, 66418 metadata: footnotes_metadata, 66419 settings: footnotes_settings 66420 }); 66421 }; 66422 66423 // EXTERNAL MODULE: ./node_modules/@wordpress/block-library/build-module/utils/is-block-metadata-experimental.js 66424 var is_block_metadata_experimental = __webpack_require__(2321); 66425 var is_block_metadata_experimental_default = /*#__PURE__*/__webpack_require__.n(is_block_metadata_experimental); 66426 ;// external ["wp","keyboardShortcuts"] 66427 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; 66428 ;// ./node_modules/@wordpress/block-library/build-module/block-keyboard-shortcuts/index.js 66429 /** 66430 * WordPress dependencies 66431 */ 66432 66433 66434 66435 66436 66437 66438 function BlockKeyboardShortcuts() { 66439 const { 66440 registerShortcut 66441 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); 66442 const { 66443 replaceBlocks 66444 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); 66445 const { 66446 getBlockName, 66447 getSelectedBlockClientId, 66448 getBlockAttributes 66449 } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); 66450 const handleTransformHeadingAndParagraph = (event, level) => { 66451 event.preventDefault(); 66452 const currentClientId = getSelectedBlockClientId(); 66453 if (currentClientId === null) { 66454 return; 66455 } 66456 const blockName = getBlockName(currentClientId); 66457 const isParagraph = blockName === 'core/paragraph'; 66458 const isHeading = blockName === 'core/heading'; 66459 if (!isParagraph && !isHeading) { 66460 return; 66461 } 66462 const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading'; 66463 const attributes = getBlockAttributes(currentClientId); 66464 66465 // Avoid unnecessary block transform when attempting to transform to 66466 // the same block type and/or same level. 66467 if (isParagraph && level === 0 || isHeading && attributes.level === level) { 66468 return; 66469 } 66470 const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign'; 66471 const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign'; 66472 replaceBlocks(currentClientId, (0,external_wp_blocks_namespaceObject.createBlock)(destinationBlockName, { 66473 level, 66474 content: attributes.content, 66475 ...{ 66476 [destinationTextAlign]: attributes[textAlign] 66477 } 66478 })); 66479 }; 66480 (0,external_wp_element_namespaceObject.useEffect)(() => { 66481 registerShortcut({ 66482 name: 'core/block-editor/transform-heading-to-paragraph', 66483 category: 'block-library', 66484 description: (0,external_wp_i18n_namespaceObject.__)('Transform heading to paragraph.'), 66485 keyCombination: { 66486 modifier: 'access', 66487 character: '0' 66488 }, 66489 aliases: [{ 66490 modifier: 'access', 66491 character: '7' 66492 }] 66493 }); 66494 [1, 2, 3, 4, 5, 6].forEach(level => { 66495 registerShortcut({ 66496 name: `core/block-editor/transform-paragraph-to-heading-$level}`, 66497 category: 'block-library', 66498 description: (0,external_wp_i18n_namespaceObject.__)('Transform paragraph to heading.'), 66499 keyCombination: { 66500 modifier: 'access', 66501 character: `$level}` 66502 } 66503 }); 66504 }); 66505 }, [registerShortcut]); 66506 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-heading-to-paragraph', event => handleTransformHeadingAndParagraph(event, 0)); 66507 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-1', event => handleTransformHeadingAndParagraph(event, 1)); 66508 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-2', event => handleTransformHeadingAndParagraph(event, 2)); 66509 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-3', event => handleTransformHeadingAndParagraph(event, 3)); 66510 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-4', event => handleTransformHeadingAndParagraph(event, 4)); 66511 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-5', event => handleTransformHeadingAndParagraph(event, 5)); 66512 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-6', event => handleTransformHeadingAndParagraph(event, 6)); 66513 return null; 66514 } 66515 /* harmony default export */ const block_keyboard_shortcuts = (BlockKeyboardShortcuts); 66516 66517 ;// ./node_modules/@wordpress/block-library/build-module/private-apis.js 66518 /** 66519 * Internal dependencies 66520 */ 66521 66522 66523 66524 /** 66525 * @private 66526 */ 66527 const privateApis = {}; 66528 lock(privateApis, { 66529 BlockKeyboardShortcuts: block_keyboard_shortcuts 66530 }); 66531 66532 ;// ./node_modules/@wordpress/block-library/build-module/index.js 66533 /* wp:polyfill */ 66534 /** 66535 * WordPress dependencies 66536 */ 66537 66538 66539 /** 66540 * Internal dependencies 66541 */ 66542 // When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks 66543 // are transformed by packages/block-library/src/index.js as follows: 66544 // import * as experimentalBlock from './experimental-block' 66545 // becomes 66546 // const experimentalBlock = null; 66547 // This enables webpack to eliminate the experimental blocks code from the 66548 // production build to make the final bundle smaller. 66549 // 66550 // See https://github.com/WordPress/gutenberg/pull/40655 for more context. 66551 66552 66553 66554 66555 66556 66557 66558 66559 66560 66561 66562 66563 66564 66565 66566 66567 66568 66569 66570 66571 66572 66573 66574 66575 66576 66577 66578 66579 66580 66581 66582 66583 66584 66585 66586 66587 66588 66589 66590 66591 66592 66593 66594 66595 66596 66597 66598 66599 66600 66601 66602 66603 66604 66605 66606 66607 66608 66609 66610 66611 66612 66613 66614 66615 66616 66617 66618 66619 66620 66621 66622 66623 66624 66625 66626 66627 66628 66629 66630 66631 66632 66633 66634 66635 66636 66637 66638 66639 66640 66641 66642 66643 66644 66645 66646 66647 66648 66649 66650 66651 66652 66653 66654 66655 /** 66656 * Function to get all the block-library blocks in an array 66657 */ 66658 const getAllBlocks = () => { 66659 const blocks = [ 66660 // Common blocks are grouped at the top to prioritize their display 66661 // in various contexts — like the inserter and auto-complete components. 66662 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, 66663 // Register all remaining core blocks. 66664 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, 66665 // theme blocks 66666 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, query_total_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]; 66667 if (window?.__experimentalEnableFormBlocks) { 66668 blocks.push(build_module_form_namespaceObject); 66669 blocks.push(form_input_namespaceObject); 66670 blocks.push(form_submit_button_namespaceObject); 66671 blocks.push(form_submission_notification_namespaceObject); 66672 } 66673 66674 // When in a WordPress context, conditionally 66675 // add the classic block and TinyMCE editor 66676 // under any of the following conditions: 66677 // - the current post contains a classic block 66678 // - the experiment to disable TinyMCE isn't active. 66679 // - a query argument specifies that TinyMCE should be loaded 66680 if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get('requiresTinymce'))) { 66681 blocks.push(freeform_namespaceObject); 66682 } 66683 return blocks.filter(Boolean); 66684 }; 66685 66686 /** 66687 * Function to get all the core blocks in an array. 66688 * 66689 * @example 66690 * ```js 66691 * import { __experimentalGetCoreBlocks } from '@wordpress/block-library'; 66692 * 66693 * const coreBlocks = __experimentalGetCoreBlocks(); 66694 * ``` 66695 */ 66696 const __experimentalGetCoreBlocks = () => getAllBlocks().filter(({ 66697 metadata 66698 }) => !is_block_metadata_experimental_default()(metadata)); 66699 66700 /** 66701 * Function to register core blocks provided by the block editor. 66702 * 66703 * @param {Array} blocks An optional array of the core blocks being registered. 66704 * 66705 * @example 66706 * ```js 66707 * import { registerCoreBlocks } from '@wordpress/block-library'; 66708 * 66709 * registerCoreBlocks(); 66710 * ``` 66711 */ 66712 const registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => { 66713 blocks.forEach(({ 66714 init 66715 }) => init()); 66716 (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name); 66717 if (window.wp && window.wp.oldEditor && blocks.some(({ 66718 name 66719 }) => name === freeform_name)) { 66720 (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name); 66721 } 66722 (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name); 66723 (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name); 66724 }; 66725 66726 /** 66727 * Function to register experimental core blocks depending on editor settings. 66728 * 66729 * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks. 66730 * @example 66731 * ```js 66732 * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library'; 66733 * 66734 * __experimentalRegisterExperimentalCoreBlocks( settings ); 66735 * ``` 66736 */ 66737 const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined; 66738 66739 66740 })(); 66741 66742 (window.wp = window.wp || {}).blockLibrary = __webpack_exports__; 66743 /******/ })() 66744 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Fri Feb 21 08:20:01 2025 | Cross-referenced by PHPXref |